Commit 1a39aefa by Kim Peace

Adopt js lint

parent d1e0e0f0
// 名前空間 // 名前空間
var ARCHIVE_UI = {}; var ARCHIVE_UI = {};
$(function() { $(function () {
// アーカイブ検索 // アーカイブ検索
$('#archive .search_form input[type="search"]').keyup(function(e) { $('#archive .search_form input[type="search"]').keyup(function (e) {
var keyword = $('#archive .search_form input[type="search"]').val(); var keyword = $('#archive .search_form input[type="search"]').val();
if (e.KeyCode == 13 || e.key == "Enter") { if (e.KeyCode == 13 || e.key == "Enter") {
if (keyword.length != 0 && keyword != '') { if (keyword.length != 0 && keyword != "") {
$('#archive .search_form input[type="search"]').blur(); $('#archive .search_form input[type="search"]').blur();
return;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return; return;
}
} else if (keyword == "" || keyword.length < 2) {
$(".overlay_src_msg").empty();
return;
} }
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword); ARCHIVE_UI.refreshSearchScreen(keyword);
if (e.KeyCode == 13 || e.key == "Enter") { if (e.KeyCode == 13 || e.key == "Enter") {
$('#archive .search_form input[type="search"]').blur(); $('#archive .search_form input[type="search"]').blur();
return; return;
} }
// 検索結果を表示 // 検索結果を表示
}); });
// iOSキーボード変換検知用 // iOSキーボード変換検知用
$('#archive .search_form input[type="search"]').on('compositionend', function() { $('#archive .search_form input[type="search"]').on(
if (CHAT_UTIL.isIOS()) { "compositionend",
var keyword = $('#archive .search_form input[type="search"]').val(); function () {
$('.overlay_src_msg').empty(); if (CHAT_UTIL.isIOS()) {
ARCHIVE_UI.refreshSearchScreen(keyword); var keyword = $('#archive .search_form input[type="search"]').val();
$(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword);
}
} }
}); );
}); });
ARCHIVE_UI.refreshSearchScreen = function(keyword) { ARCHIVE_UI.refreshSearchScreen = function (keyword) {
var archiveList = CHAT_DB.getArchiveByName(keyword); var archiveList = CHAT_DB.getArchiveByName(keyword);
var archiveTemplate; var archiveTemplate;
$.get({ url: "./template/template_archive_list.html", async: false } $.get(
, function(text) { { url: "./template/template_archive_list.html", async: false },
archiveTemplate = text; function (text) {
}); archiveTemplate = text;
}
);
archiveList.forEach(function(archive) { archiveList.forEach(function (archive) {
var typeImage = ""; var typeImage = "";
switch(archive.archiveType) { switch (archive.archiveType) {
case 0: // 画像 case 0: // 画像
typeImage = "icon/icon_collabo_picture.png"; typeImage = "icon/icon_collabo_picture.png";
break; break;
...@@ -57,7 +62,8 @@ ARCHIVE_UI.refreshSearchScreen = function(keyword) { ...@@ -57,7 +62,8 @@ ARCHIVE_UI.refreshSearchScreen = function(keyword) {
case 3: // 文書 case 3: // 文書
typeImage = "icon/icon_collabo_document.png"; typeImage = "icon/icon_collabo_document.png";
break; break;
default: // その他 default:
// その他
typeImage = ""; typeImage = "";
} }
...@@ -65,10 +71,10 @@ ARCHIVE_UI.refreshSearchScreen = function(keyword) { ...@@ -65,10 +71,10 @@ ARCHIVE_UI.refreshSearchScreen = function(keyword) {
archiveId: archive.archiveId, archiveId: archive.archiveId,
fileName: archive.archiveName, fileName: archive.archiveName,
insertDate: archive.archiveDate, insertDate: archive.archiveDate,
typeImage: typeImage typeImage: typeImage,
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); $(".overlay_src_msg").append(obj);
}); });
}; };
// 名前空間 // 名前空間
var CHAT_ADD_USER = {}; var CHAT_ADD_USER = {};
$(function() { $(function () {
// メンバー検索 // メンバー検索
$('#chat_add_user .search_form input[type="search"]').click(function(e){ $('#chat_add_user .search_form input[type="search"]').click(function (e) {
//画面タイトル設定 //画面タイトル設定
let contactListTitle = getLocalizedString("userSearch"); let contactListTitle = getLocalizedString("userSearch");
$('#addUserTitle').text(contactListTitle); $("#addUserTitle").text(contactListTitle);
}) });
$('#chat_add_user .search_form input[type="search"]').keyup(function(e){ $('#chat_add_user .search_form input[type="search"]').keyup(function (e) {
var keyword = $('#chat_add_user .search_form input[type="search"]').val(); var keyword = $('#chat_add_user .search_form input[type="search"]').val();
if (e.key == "Enter" || e.KeyCode == 13) { if (e.key == "Enter" || e.KeyCode == 13) {
if (keyword != '' && keyword.length != 0) { if (keyword != "" && keyword.length != 0) {
$('#chat_add_user .search_form input[type="search"]').blur(); $('#chat_add_user .search_form input[type="search"]').blur();
return false;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return false; return false;
}
} else if (keyword == "" || keyword.length < 2) {
$(".overlay_src_msg").empty();
return false;
} }
CHAT_ADD_USER.searchUser(keyword); CHAT_ADD_USER.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) { if (e.key == "Enter" || e.KeyCode == 13) {
$('#chat_add_user .search_form input[type="search"]').blur(); $('#chat_add_user .search_form input[type="search"]').blur();
return; return;
} }
}); });
// iOSキーボード変換検知用 // iOSキーボード変換検知用
$('#chat_add_user .search_form input[type="search"]').on('compositionend', function() { $('#chat_add_user .search_form input[type="search"]').on(
if (CHAT_UTIL.isIOS()) { "compositionend",
var keyword = $('#chat_add_user .search_form input[type="search"]').val(); function () {
if (CHAT_UTIL.isIOS()) {
var keyword = $(
'#chat_add_user .search_form input[type="search"]'
).val();
CHAT_ADD_USER.searchUser(keyword); CHAT_ADD_USER.searchUser(keyword);
}
} }
}); );
}); });
// ユーザー検索 // ユーザー検索
CHAT_ADD_USER.searchUser = function(keyword) { CHAT_ADD_USER.searchUser = function (keyword) {
var isAllGroup = $('#tabAllGroupOnAddUser').is(':checked'); var isAllGroup = $("#tabAllGroupOnAddUser").is(":checked");
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
//全グループ検索画面 //全グループ検索画面
if (isAllGroup) { if (isAllGroup) {
//グループデータ検索 //グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword); var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate; var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false } $.get(
, function(text) { { url: "./template/template_make_room_group_list.html", async: false },
groupTemplate = text; function (text) {
}); groupTemplate = text;
}
);
groupList.forEach(function(group) { groupList.forEach(function (group) {
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
name: group.groupName, name: group.groupName,
id: group.groupId, id: group.groupId,
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); $(".overlay_src_msg").append(obj);
}) });
//ユーザデータ検索 //ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword); var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
var userTemplate; var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false } $.get(
, function(text) { { url: "./template/template_make_room_user_list.html", async: false },
userTemplate = text; function (text) {
}); userTemplate = text;
userList.forEach(function(user) { }
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); );
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { userList.forEach(function (user) {
return shopMemberId == user.shopMemberId; user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
}) let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
if (findObj) { return shopMemberId == user.shopMemberId;
user.checked = 'checked'; });
} if (findObj) {
}); user.checked = "checked";
let html = Mustache.render(userTemplate, { }
userList: userList });
}); let html = Mustache.render(userTemplate, {
let obj = jQuery.parseHTML(html); userList: userList,
$('.overlay_src_msg').append(obj); });
if (userList.length == 0 && groupList.length == 0) { let obj = jQuery.parseHTML(html);
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); $(".overlay_src_msg").append(obj);
noResultMsg.append(getLocalizedString("noResult")) if (userList.length == 0 && groupList.length == 0) {
$('.overlay_src_msg').append(noResultMsg); const noResultMsg = $("<div/>", {
} width: "auto",
  //連絡先画面 style: "text-align: center",
} else { });
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword); noResultMsg.append(getLocalizedString("noResult"));
var userTemplate; $(".overlay_src_msg").append(noResultMsg);
$.get({ url: "./template/template_make_room_user_list.html", async: false } } //連絡先画面
, function(text) { } else {
userTemplate = text; var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
}); var userTemplate;
userList.forEach(function(user) { $.get(
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); { url: "./template/template_make_room_user_list.html", async: false },
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { function (text) {
return shopMemberId == user.shopMemberId; userTemplate = text;
}) }
if (findObj) { );
user.checked = 'checked'; userList.forEach(function (user) {
} user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
}); let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
let html = Mustache.render(userTemplate, { return shopMemberId == user.shopMemberId;
userList: userList });
}); if (findObj) {
let obj = jQuery.parseHTML(html); user.checked = "checked";
$('.overlay_src_msg').html(obj); }
if (userList.length == 0) { });
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); let html = Mustache.render(userTemplate, {
noResultMsg.append(getLocalizedString("noResult")) userList: userList,
$('.overlay_src_msg').append(noResultMsg); });
} let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").html(obj);
if (userList.length == 0) {
const noResultMsg = $("<div/>", {
width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
$(".overlay_src_msg").append(noResultMsg);
} }
}
}; };
jQuery('#homeButton').on('click', function() { jQuery("#homeButton").on("click", function () {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({}); webkit.messageHandlers.goHome.postMessage({});
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
android.goHome(); android.goHome();
} }
}); });
jQuery('#reloadButton').on('click', function() { jQuery("#reloadButton").on("click", function () {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要。 //TODO IOS処理追加必要。
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
android.reload(); android.reload();
} }
}); });
\ No newline at end of file
var lastscrollvalue; var lastscrollvalue;
window.onscroll = function() { window.onscroll = function () {
beforeScroll = window.scrollY; beforeScroll = window.scrollY;
} };
$('#roomNameChangeBtn').click(function() { $("#roomNameChangeBtn").click(function () {
var changeRoomName = $('#roomNameInput').val(); var changeRoomName = $("#roomNameInput").val();
var trimmedRoomName = $('#roomNameInput').val().trim(); var trimmedRoomName = $("#roomNameInput").val().trim();
if (trimmedRoomName.length == 0) { if (trimmedRoomName.length == 0) {
alert(getLocalizedString("error_empty_room_name")); alert(getLocalizedString("error_empty_room_name"));
return; return;
} }
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.changeRoomName.postMessage(changeRoomName); webkit.messageHandlers.changeRoomName.postMessage(changeRoomName);
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
android.changeRoomName(changeRoomName); android.changeRoomName(changeRoomName);
} }
}) });
/* /*
$('#messages').scroll(function() { $('#messages').scroll(function() {
......
// 名前空間 // 名前空間
var CHAT_UTIL = {}; var CHAT_UTIL = {};
CHAT_UTIL.isAndroid = function() { CHAT_UTIL.isAndroid = function () {
return PLATFORM == 'android'; return PLATFORM == "android";
}; };
CHAT_UTIL.isIOS = function() { CHAT_UTIL.isIOS = function () {
return PLATFORM == 'ios'; return PLATFORM == "ios";
}; };
CHAT_UTIL.isMobile = function() { CHAT_UTIL.isMobile = function () {
return IS_MOBILE == 'true'; return IS_MOBILE == "true";
}; };
CHAT_UTIL.formatDate = function(date) { CHAT_UTIL.formatDate = function (date) {
const REFERENCE = moment(); const REFERENCE = moment();
const TODAY = REFERENCE.clone().startOf('day'); const TODAY = REFERENCE.clone().startOf("day");
let createdAt = moment(date); let createdAt = moment(date);
if (date.length == 14) { if (date.length == 14) {
createdAt = moment(date,'YYYYMMDDhhmmss'); createdAt = moment(date, "YYYYMMDDhhmmss");
} else { } else {
createdAt = moment(date); createdAt = moment(date);
} }
// #36171 // #36171
const createdAtDay = createdAt.format('MMM Do'); const createdAtDay = createdAt.format("MMM Do");
const createdAtTime = createdAt.format('HH:mm'); const createdAtTime = createdAt.format("HH:mm");
if (createdAt.isSame(TODAY, 'd')) { if (createdAt.isSame(TODAY, "d")) {
createdAt = createdAtTime; createdAt = createdAtTime;
} else { } else {
createdAt = createdAtDay; createdAt = createdAtDay;
} }
let rntDate = new Object(); let rntDate = new Object();
rntDate.createdAtDay = createdAtDay; rntDate.createdAtDay = createdAtDay;
rntDate.createdAtTime = createdAtTime; rntDate.createdAtTime = createdAtTime;
rntDate.createdAt = createdAt; rntDate.createdAt = createdAt;
return rntDate; return rntDate;
} };
CHAT_UTIL.htmlDecode = function(input) { CHAT_UTIL.htmlDecode = function (input) {
var e = document.createElement('textarea'); var e = document.createElement("textarea");
e.innerHTML = input; e.innerHTML = input;
// handle case of empty input // handle case of empty input
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue; return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
} };
//generates a unique id, not obligator a UUID //generates a unique id, not obligator a UUID
CHAT_UTIL.generateUUID = function() { CHAT_UTIL.generateUUID = function () {
var d = new Date().getTime(); var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
var r = (d + Math.random()*16)%16 | 0; /[xy]/g,
d = Math.floor(d/16); function (c) {
return (c=='x' ? r : (r&0x3|0x8)).toString(16); var r = (d + Math.random() * 16) % 16 | 0;
}); d = Math.floor(d / 16);
return uuid; return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
}
);
return uuid;
}; };
CHAT_UTIL.systemDay = function(date) { CHAT_UTIL.systemDay = function (date) {
let createdAt = moment(date); let createdAt = moment(date);
createdAt = moment(date,'YYYYMMDDhhmmss'); createdAt = moment(date, "YYYYMMDDhhmmss");
const createdAtDow = createdAt.format('YYYY-MM-DD'); const createdAtDow = createdAt.format("YYYY-MM-DD");
let systemDay = new Object(); let systemDay = new Object();
systemDay.year = createdAt.format('YYYY'); systemDay.year = createdAt.format("YYYY");
systemDay.month = createdAt.format('MM'); systemDay.month = createdAt.format("MM");
systemDay.day = createdAt.format('DD'); systemDay.day = createdAt.format("DD");
systemDay.dow = moment(createdAtDow).day(); systemDay.dow = moment(createdAtDow).day();
return systemDay; return systemDay;
} };
CHAT_UTIL.findDow = function(data) { CHAT_UTIL.findDow = function (data) {
let dow = ""; let dow = "";
if (data == 0) { if (data == 0) {
dow = getLocalizedString('sunday'); dow = getLocalizedString("sunday");
} else if (data == 1) { } else if (data == 1) {
dow = getLocalizedString('monday'); dow = getLocalizedString("monday");
} else if (data == 2) { } else if (data == 2) {
dow = getLocalizedString('thusday'); dow = getLocalizedString("thusday");
} else if (data == 3) { } else if (data == 3) {
dow = getLocalizedString('wednesday'); dow = getLocalizedString("wednesday");
} else if (data == 4) { } else if (data == 4) {
dow = getLocalizedString('thursday'); dow = getLocalizedString("thursday");
} else if (data == 5) { } else if (data == 5) {
dow = getLocalizedString('friday'); dow = getLocalizedString("friday");
} else if (data == 6) { } else if (data == 6) {
dow = getLocalizedString('sunday'); dow = getLocalizedString("sunday");
} }
return dow; return dow;
} };
function msToTime(s) { function msToTime(s) {
var ms = s % 1000; var ms = s % 1000;
...@@ -98,55 +101,57 @@ function msToTime(s) { ...@@ -98,55 +101,57 @@ function msToTime(s) {
var mins = s % 60; var mins = s % 60;
var hrs = (s - mins) / 60; var hrs = (s - mins) / 60;
return hrs + ':' + mins + ':' + secs; return hrs + ":" + mins + ":" + secs;
} }
function updateDuration() { function updateDuration() {
var now = new Date(); var now = new Date();
$('.collaboration_duration').each(function(index, item) { $(".collaboration_duration").each(function (index, item) {
var insertDateString = $(item).data('insertdate'); var insertDateString = $(item).data("insertdate");
insertDateString = insertDateString.toString(); insertDateString = insertDateString.toString();
var year = insertDateString.substring(0,4); var year = insertDateString.substring(0, 4);
var month = insertDateString.substring(4,6); var month = insertDateString.substring(4, 6);
var day = insertDateString.substring(6,8); var day = insertDateString.substring(6, 8);
var hour = insertDateString.substring(8,10); var hour = insertDateString.substring(8, 10);
var min = insertDateString.substring(10,12); var min = insertDateString.substring(10, 12);
var sec = insertDateString.substring(12,14); var sec = insertDateString.substring(12, 14);
var insertDate = new Date(year, month-1 , day, hour, min, sec); var insertDate = new Date(year, month - 1, day, hour, min, sec);
$(item).html(msToTime(now - insertDate)); $(item).html(msToTime(now - insertDate));
}); });
} }
CHAT_UTIL.getCollaborationType = function(key) { CHAT_UTIL.getCollaborationType = function (key) {
switch(key) { switch (key) {
case collaborationTypeKey.AUDIO: case collaborationTypeKey.AUDIO:
return COLLABORATION_TYPE.AUDIO; return COLLABORATION_TYPE.AUDIO;
case collaborationTypeKey.CAMERA: case collaborationTypeKey.CAMERA:
return COLLABORATION_TYPE.CAMERA; return COLLABORATION_TYPE.CAMERA;
case collaborationTypeKey.VIDEO: case collaborationTypeKey.VIDEO:
return COLLABORATION_TYPE.VIDEO; return COLLABORATION_TYPE.VIDEO;
case collaborationTypeKey.DOCUMENT: case collaborationTypeKey.DOCUMENT:
return COLLABORATION_TYPE.DOCUMENT; return COLLABORATION_TYPE.DOCUMENT;
default: default:
return 0; return 0;
} }
} };
CHAT_UTIL.getCoviewTypeFromCollaborationType = function(joinCollaborationType) { CHAT_UTIL.getCoviewTypeFromCollaborationType = function (
switch(joinCollaborationType) { joinCollaborationType
case COLLABORATION_TYPE.AUDIO: ) {
console.log(collaborationTypeKey.AUDIO); switch (joinCollaborationType) {
return collaborationTypeKey.AUDIO; case COLLABORATION_TYPE.AUDIO:
case COLLABORATION_TYPE.CAMERA: console.log(collaborationTypeKey.AUDIO);
console.log(collaborationTypeKey.CAMERA); return collaborationTypeKey.AUDIO;
return collaborationTypeKey.CAMERA; case COLLABORATION_TYPE.CAMERA:
case COLLABORATION_TYPE.VIDEO: console.log(collaborationTypeKey.CAMERA);
return collaborationTypeKey.VIDEO; return collaborationTypeKey.CAMERA;
case COLLABORATION_TYPE.DOCUMENT: case COLLABORATION_TYPE.VIDEO:
return collaborationTypeKey.DOCUMENT; return collaborationTypeKey.VIDEO;
case COLLABORATION_TYPE.BOARD: case COLLABORATION_TYPE.DOCUMENT:
return collaborationTypeKey.BOARD; return collaborationTypeKey.DOCUMENT;
default: case COLLABORATION_TYPE.BOARD:
return 0; return collaborationTypeKey.BOARD;
} default:
} return 0;
\ No newline at end of file }
};
// 名前空間 // 名前空間
var CHAT_MAKE_ROOM = {}; var CHAT_MAKE_ROOM = {};
$(function() { $(function () {
// メンバー検索 // メンバー検索
$('#chatMakeRoom .search_form input[type="search"]').click(function(e) { $('#chatMakeRoom .search_form input[type="search"]').click(function (e) {
let contactListTitle = getLocalizedString("userSearch"); let contactListTitle = getLocalizedString("userSearch");
$('#makeRoomTitle').text(contactListTitle); $("#makeRoomTitle").text(contactListTitle);
}); });
$('#chatMakeRoom .search_form input[type="search"]').keyup(function(e) { $('#chatMakeRoom .search_form input[type="search"]').keyup(function (e) {
//画面タイトル設定 //画面タイトル設定
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val(); var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
if (e.KeyCode == 13 || e.key == "Enter") { if (e.KeyCode == 13 || e.key == "Enter") {
if (keyword != '' && keyword.length != 0) { if (keyword != "" && keyword.length != 0) {
$('#chatMakeRoom .search_form input[type="search"]').blur(); $('#chatMakeRoom .search_form input[type="search"]').blur();
return false; return false;
} }
} else if (keyword == '' || keyword.length < 2) { } else if (keyword == "" || keyword.length < 2) {
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
return false; return false;
} }
CHAT_MAKE_ROOM.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return;
}
});
// iOSキーボード変換検知用
$('#chatMakeRoom .search_form input[type="search"]').on(
"compositionend",
function () {
if (CHAT_UTIL.isIOS()) {
var keyword = $(
'#chatMakeRoom .search_form input[type="search"]'
).val();
CHAT_MAKE_ROOM.searchUser(keyword); CHAT_MAKE_ROOM.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) { }
$('#chatMakeRoom .search_form input[type="search"]').blur(); }
return; );
}
});
// iOSキーボード変換検知用
$('#chatMakeRoom .search_form input[type="search"]').on('compositionend', function() {
if (CHAT_UTIL.isIOS()) {
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
CHAT_MAKE_ROOM.searchUser(keyword);
}
});
}); });
// メンバー検索 // メンバー検索
CHAT_MAKE_ROOM.searchUser = function(keyword) { CHAT_MAKE_ROOM.searchUser = function (keyword) {
var isAllGroup = $('#tabAllGroupOnMakeRoom').is(':checked'); var isAllGroup = $("#tabAllGroupOnMakeRoom").is(":checked");
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
//全グループ検索画面 //全グループ検索画面
if (isAllGroup) { if (isAllGroup) {
//グループデータ検索 //グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword); var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate; var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false } $.get(
, function(text) { { url: "./template/template_make_room_group_list.html", async: false },
groupTemplate = text; function (text) {
}); groupTemplate = text;
}
);
groupList.forEach(function(group) { groupList.forEach(function (group) {
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
name: group.groupName, name: group.groupName,
id: group.groupId, id: group.groupId,
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); $(".overlay_src_msg").append(obj);
}) });
//ユーザデータ検索 //ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword); var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
var userTemplate; var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false } $.get(
, function(text) { { url: "./template/template_make_room_user_list.html", async: false },
userTemplate = text; function (text) {
}); userTemplate = text;
userList.forEach(function(user) { }
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); );
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { userList.forEach(function (user) {
return shopMemberId == user.shopMemberId; user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
}) let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
if (findObj) { return shopMemberId == user.shopMemberId;
user.checked = 'checked'; });
} if (findObj) {
}); user.checked = "checked";
let html = Mustache.render(userTemplate, { }
userList: userList });
}); let html = Mustache.render(userTemplate, {
let obj = jQuery.parseHTML(html); userList: userList,
$('.overlay_src_msg').append(obj); });
if (groupList.length == 0 && userList.length == 0) { let obj = jQuery.parseHTML(html);
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); $(".overlay_src_msg").append(obj);
noResultMsg.append(getLocalizedString("noResult")) if (groupList.length == 0 && userList.length == 0) {
$('.overlay_src_msg').append(noResultMsg); const noResultMsg = $("<div/>", {
} width: "auto",
  //連絡先画面 style: "text-align: center",
} else { });
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword); noResultMsg.append(getLocalizedString("noResult"));
var userTemplate; $(".overlay_src_msg").append(noResultMsg);
$.get({ url: "./template/template_make_room_user_list.html", async: false } } //連絡先画面
, function(text) { } else {
userTemplate = text; var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
}); var userTemplate;
userList.forEach(function(user) { $.get(
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); { url: "./template/template_make_room_user_list.html", async: false },
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { function (text) {
return shopMemberId == user.shopMemberId; userTemplate = text;
}) }
if (findObj) { );
user.checked = 'checked'; userList.forEach(function (user) {
} user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
}); let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
let html = Mustache.render(userTemplate, { return shopMemberId == user.shopMemberId;
userList: userList });
}); if (findObj) {
let obj = jQuery.parseHTML(html); user.checked = "checked";
$('.overlay_src_msg').html(obj); }
if (userList.length == 0) { });
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); let html = Mustache.render(userTemplate, {
noResultMsg.append(getLocalizedString("noResult")) userList: userList,
$('.overlay_src_msg').append(noResultMsg); });
} let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").html(obj);
if (userList.length == 0) {
const noResultMsg = $("<div/>", {
width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
$(".overlay_src_msg").append(noResultMsg);
} }
} }
};
function recordStart() { function recordStart() {
MainManRecord('on'); MainManRecord("on");
$('#recordBtn').removeClass('bg_gray'); $("#recordBtn").removeClass("bg_gray");
$('#recordBtn').addClass('bg_red'); $("#recordBtn").addClass("bg_red");
} }
function recordStop(callback) { function recordStop(callback) {
...@@ -9,64 +9,68 @@ function recordStop(callback) { ...@@ -9,64 +9,68 @@ function recordStop(callback) {
screenLock(); screenLock();
// アーカイブ保存処理 // アーカイブ保存処理
MainManRecordWithCollaboration('stop', CMS_SERVER_URL + '/chatapi/file/uploadArchive', callback); MainManRecordWithCollaboration(
"stop",
CMS_SERVER_URL + "/chatapi/file/uploadArchive",
callback
);
} }
function MainManRecordWithCollaboration(action, url, callback) { function MainManRecordWithCollaboration(action, url, callback) {
mediaRecorder.stop(); mediaRecorder.stop();
console.log('Recorded Blobs: ', recordedBlobs); console.log("Recorded Blobs: ", recordedBlobs);
setTimeout(function() { setTimeout(function () {
console.log("Recoding File upload.."); console.log("Recoding File upload..");
const blob = new Blob(recordedBlobs, {type: 'video/webm'}); const blob = new Blob(recordedBlobs, { type: "video/webm" });
console.log(blob) console.log(blob);
var uploadFileName = "record_" + g_webroom + "_" + g_shareCount + ".webm"; var uploadFileName = "record_" + g_webroom + "_" + g_shareCount + ".webm";
g_shareCount++; g_shareCount++;
var formData = new FormData(); var formData = new FormData();
formData.append("fileData",blob,uploadFileName); formData.append("fileData", blob, uploadFileName);
formData.append('sid', globalUserInfo.sid); formData.append("sid", globalUserInfo.sid);
formData.append('roomId', globalUserInfo.roomId); formData.append("roomId", globalUserInfo.roomId);
if (joinCollaborationType == COLLABORATION_TYPE.VIDEO) { if (joinCollaborationType == COLLABORATION_TYPE.VIDEO) {
formData.append('archiveType', 1); formData.append("archiveType", 1);
} else { } else {
formData.append('archiveType', 2); formData.append("archiveType", 2);
} }
console.log(uploadFileName) console.log(uploadFileName);
$.ajax({ $.ajax({
type :'post', type: "post",
url, url,
data : formData, data: formData,
contentType: false, contentType: false,
processData: false, processData: false,
success : function(res) { success: function (res) {
recordFinished(); recordFinished();
callback(); callback();
console.log(res) console.log(res);
} },
,error : function(err){ error: function (err) {
recordFinished(); recordFinished();
callback(); callback();
console.log(err); console.log(err);
} },
}); });
}, 1000); }, 1000);
} }
function screenLock(){ function screenLock() {
// ロック用のdivを生成 // ロック用のdivを生成
var element = document.createElement('div'); var element = document.createElement("div");
element.id = "screenLock"; element.id = "screenLock";
// ロック用のスタイル // ロック用のスタイル
element.style.height = '100%'; element.style.height = "100%";
element.style.left = '0px'; element.style.left = "0px";
element.style.position = 'fixed'; element.style.position = "fixed";
element.style.top = '0px'; element.style.top = "0px";
element.style.width = '100%'; element.style.width = "100%";
element.style.zIndex = '9999'; element.style.zIndex = "9999";
element.style.opacity = '0'; element.style.opacity = "0";
var objBody = document.getElementsByTagName("body").item(0); var objBody = document.getElementsByTagName("body").item(0);
objBody.appendChild(element); objBody.appendChild(element);
} }
...@@ -78,10 +82,10 @@ function delete_dom_obj(id_name) { ...@@ -78,10 +82,10 @@ function delete_dom_obj(id_name) {
} }
function recordFinished() { function recordFinished() {
$('#recordBtn').addClass('bg_gray'); $("#recordBtn").addClass("bg_gray");
$('#recordBtn').removeClass('bg_red'); $("#recordBtn").removeClass("bg_red");
// ロック画面の削除 // ロック画面の削除
delete_dom_obj('screenLock'); delete_dom_obj("screenLock");
} }
$(function () { $(function () {
...@@ -94,7 +98,6 @@ $(function () { ...@@ -94,7 +98,6 @@ $(function () {
.toggleClass("slidein") .toggleClass("slidein")
.css({ transform: "translateX(" & -w & ")" }); .css({ transform: "translateX(" & -w & ")" });
$("#collabo_main").toggleClass("noscroll"); $("#collabo_main").toggleClass("noscroll");
}); });
// ユーザーリストオーバーレイ表示 // ユーザーリストオーバーレイ表示
...@@ -107,7 +110,6 @@ $(function () { ...@@ -107,7 +110,6 @@ $(function () {
.css({ transform: "translateX(" & -w & ")" }); .css({ transform: "translateX(" & -w & ")" });
$("#collabo_main").toggleClass("noscroll"); $("#collabo_main").toggleClass("noscroll");
if ($("#overlay_user_list.overlay").hasClass("noscroll")) { if ($("#overlay_user_list.overlay").hasClass("noscroll")) {
$("#overlay_user_list.overlay").removeClass("noscroll"); $("#overlay_user_list.overlay").removeClass("noscroll");
} else { } else {
...@@ -119,7 +121,7 @@ $(function () { ...@@ -119,7 +121,7 @@ $(function () {
$(".footer_menu_btn").click(function () { $(".footer_menu_btn").click(function () {
var h_active = $("#collabo_footer").height(); var h_active = $("#collabo_footer").height();
var h_hide = h_active - $("#collabo_footer_menu").height(); var h_hide = h_active - $("#collabo_footer_menu").height();
// 非アクティブ時 // 非アクティブ時
if ($(this).hasClass("hide")) { if ($(this).hasClass("hide")) {
$(this).removeClass("hide"); $(this).removeClass("hide");
...@@ -156,89 +158,95 @@ $(function () { ...@@ -156,89 +158,95 @@ $(function () {
// ユーザー招待メンバー検索 // ユーザー招待メンバー検索
$(".add_user_btn").click(function () { $(".add_user_btn").click(function () {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
CHAT.globalSelectedUserList = []; CHAT.globalSelectedUserList = [];
CHAT_UI.refreshMyGroupForAddUserInCollaboration(); CHAT_UI.refreshMyGroupForAddUserInCollaboration();
$('#addUserConfirmBtnInCollaboration').off().on('click', function() { $("#addUserConfirmBtnInCollaboration")
$('#addUserInCollaboration').modal('hide'); .off()
if (typeof(android) != "undefined") { .on("click", function () {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(",")); $("#addUserInCollaboration").modal("hide");
} else { if (typeof android != "undefined") {
webkit.messageHandlers.saveSelectedUserList.postMessage(CHAT.globalSelectedUserList.join(",")); android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
} } else {
CHAT_UI.confirmInviteUserListInCollaboration(); webkit.messageHandlers.saveSelectedUserList.postMessage(
CHAT.globalSelectedUserList.join(",")
);
}
CHAT_UI.confirmInviteUserListInCollaboration();
}); });
}); });
$('#penBtn').click(function () { $("#penBtn").click(function () {
$('#coviewPenCtrBtn').click(); $("#coviewPenCtrBtn").click();
if ($('#penBtn').hasClass('bg_red')) { if ($("#penBtn").hasClass("bg_red")) {
$('#penBtn').removeClass('bg_red'); $("#penBtn").removeClass("bg_red");
$('#penBtn').addClass('bg_blue'); $("#penBtn").addClass("bg_blue");
} else { } else {
$('#penBtn').addClass('bg_red'); $("#penBtn").addClass("bg_red");
$('#penBtn').removeClass('bg_blue'); $("#penBtn").removeClass("bg_blue");
} }
}) });
$('#photo_open_place_holder').click(function () { $("#photo_open_place_holder").click(function () {
$("#open_file_upload").trigger("click"); $("#open_file_upload").trigger("click");
}) });
$('#eraserBtn').click(function () { $("#eraserBtn").click(function () {
$('#coviewEraserCtrBtn').click(); $("#coviewEraserCtrBtn").click();
}) });
$('#micBtn').click(function () { $("#micBtn").click(function () {
$('#coviewMicCtrBtn').click(); $("#coviewMicCtrBtn").click();
if ($('#micBtn').hasClass('bg_red')) { if ($("#micBtn").hasClass("bg_red")) {
micOn(); micOn();
} else { } else {
micOff(); micOff();
} }
}) });
$('#captureBtn').click(function () { $("#captureBtn").click(function () {
if ($('#recordBtn').hasClass('bg_red')) { if ($("#recordBtn").hasClass("bg_red")) {
screenLock(); screenLock();
recordStop(function() { recordStop(function () {
$('#screenLock').remove(); $("#screenLock").remove();
coview_api.Capture(CMS_SERVER_URL + '/chatapi/file/uploadArchive'); coview_api.Capture(CMS_SERVER_URL + "/chatapi/file/uploadArchive");
}); });
} else { } else {
coview_api.Capture(CMS_SERVER_URL + '/chatapi/file/uploadArchive'); coview_api.Capture(CMS_SERVER_URL + "/chatapi/file/uploadArchive");
} }
}) });
$('#captureRequestBtn').click(function () { $("#captureRequestBtn").click(function () {
fw.sendToMsg('others', 'CAPTURE_REQUEST', {"name": CHAT.globalLoginParameter.loginId}); fw.sendToMsg("others", "CAPTURE_REQUEST", {
}) name: CHAT.globalLoginParameter.loginId,
});
});
$('#recordBtn').click(function () { $("#recordBtn").click(function () {
if ($('#recordBtn').hasClass('bg_gray')) { if ($("#recordBtn").hasClass("bg_gray")) {
recordStart(); recordStart();
} else { } else {
recordStop(null); recordStop(null);
} }
}) });
}); });
function penOff() { function penOff() {
if ($('#penBtn').hasClass('bg_blue')) { if ($("#penBtn").hasClass("bg_blue")) {
$('#coviewPenCtrBtn').click(); $("#coviewPenCtrBtn").click();
$('#penBtn').addClass('bg_red'); $("#penBtn").addClass("bg_red");
$('#penBtn').removeClass('bg_blue'); $("#penBtn").removeClass("bg_blue");
} }
}; }
function micOn() { function micOn() {
coview_api.MicMuteControl('off'); coview_api.MicMuteControl("off");
$('#micBtn').addClass('bg_blue'); $("#micBtn").addClass("bg_blue");
$('#micBtn').removeClass('bg_red'); $("#micBtn").removeClass("bg_red");
}; }
function micOff() { function micOff() {
coview_api.MicMuteControl('on'); coview_api.MicMuteControl("on");
$('#micBtn').removeClass('bg_blue'); $("#micBtn").removeClass("bg_blue");
$('#micBtn').addClass('bg_red'); $("#micBtn").addClass("bg_red");
}; }
// アコーディオン // アコーディオン
$('.category').on('click', function() { $(".category").on("click", function () {
$(this).toggleClass("open"); $(this).toggleClass("open");
$(this).next().slideToggle(); $(this).next().slideToggle();
}); });
$('.home_btn').on('click', function() { $(".home_btn").on("click", function () {
if (CHAT_UTIL.isAndroid()) { if (CHAT_UTIL.isAndroid()) {
android.goHome(); android.goHome();
} else if (CHAT_UTIL.isIOS()) { } else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({}); webkit.messageHandlers.goHome.postMessage({});
} }
}); });
$(function() { $(function () {
var h = $(window).height(); //画面の高さを取得 var h = $(window).height(); //画面の高さを取得
// ローディング表示 // ローディング表示
...@@ -29,41 +29,40 @@ $(function() { ...@@ -29,41 +29,40 @@ $(function() {
$('.search_form input[type="search"]').click(function () { $('.search_form input[type="search"]').click(function () {
$(this).addClass("focus"); $(this).addClass("focus");
// キャンセルボタン表示 // キャンセルボタン表示
$('.cancel').removeClass('none'); $(".cancel").removeClass("none");
$('.search_form form').addClass('d-flex flex-row h-100 align-items-center'); $(".search_form form").addClass("d-flex flex-row h-100 align-items-center");
$('.content').addClass('none'); $(".content").addClass("none");
$('.craeteRoomButton').addClass('none'); $(".craeteRoomButton").addClass("none");
}); });
// 共通検索フォーム キャンセルボタン押下イベント // 共通検索フォーム キャンセルボタン押下イベント
$('.search_form .cancel').click(function(){ $(".search_form .cancel").click(function () {
$(this).addClass('none'); $(this).addClass("none");
$('.search_form input').removeClass('focus'); $(".search_form input").removeClass("focus");
$('.search_form input').val(''); $(".search_form input").val("");
$('.search_form form').removeClass(); $(".search_form form").removeClass();
$('.content').removeClass('none'); $(".content").removeClass("none");
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
$('.craeteRoomButton').removeClass('none'); $(".craeteRoomButton").removeClass("none");
}); });
$('.message_input_form').on('focus',function(e){ $(".message_input_form").on("focus", function (e) {
setTimeout(function() { setTimeout(function () {
$('.message_input_send').removeClass('none'); $(".message_input_send").removeClass("none");
$('.attach_file').addClass('none'); $(".attach_file").addClass("none");
$('.footer_content_b').addClass('none'); $(".footer_content_b").addClass("none");
}, 10); }, 10);
}); });
$('.message_input_form').on('focusout',function(e){ $(".message_input_form").on("focusout", function (e) {
setTimeout(function() { setTimeout(function () {
if($(e.relatedTarget).hasClass('message_input_send')){ if ($(e.relatedTarget).hasClass("message_input_send")) {
CHAT_UI.sendMessage(); CHAT_UI.sendMessage();
} else { } else {
$('.message_input_send').addClass('none'); $(".message_input_send").addClass("none");
$('.attach_file').removeClass('none'); $(".attach_file").removeClass("none");
$('.footer_content_b').removeClass('none'); $(".footer_content_b").removeClass("none");
} }
}, 10); }, 10);
}); });
}); });
...@@ -10,62 +10,62 @@ const readyState = { ...@@ -10,62 +10,62 @@ const readyState = {
}; };
const messageType = { const messageType = {
TEXT : 0 , TEXT: 0,
IMAGE : 1 , IMAGE: 1,
VIDEO : 2 , VIDEO: 2,
SYSTEM : 3 , SYSTEM: 3,
COMMUNICATIONSTART : 4, COMMUNICATIONSTART: 4,
COMMUNICATIONEND : 5 COMMUNICATIONEND: 5,
} };
const userAPICmd = { const userAPICmd = {
MYINFO : 9 MYINFO: 9,
} };
const chatRoomType = { const chatRoomType = {
DM : "1", DM: "1",
GROUP : "0", GROUP: "0",
ALL : "2" ALL: "2",
} };
const groupSearchFlg = { const groupSearchFlg = {
ROOT : "0" ROOT: "0",
} };
const nameCardAreaId = { const nameCardAreaId = {
MY : "myNamecard", MY: "myNamecard",
USER : "userNamecard" USER: "userNamecard",
} };
const collaborationTypeKey = { const collaborationTypeKey = {
AUDIO : "audio", AUDIO: "audio",
CAMERA : "camera", CAMERA: "camera",
VIDEO : "video" , VIDEO: "video",
DOCUMENT : "document", DOCUMENT: "document",
BOARD : "board" BOARD: "board",
} };
const COLLABORATION_TYPE = { const COLLABORATION_TYPE = {
AUDIO : 0, AUDIO: 0,
CAMERA : 2, CAMERA: 2,
VIDEO : 3, VIDEO: 3,
DOCUMENT : 4, DOCUMENT: 4,
BOARD : 5 BOARD: 5,
} };
const makeRoomFlg = { const makeRoomFlg = {
NAME_CARD : 0, NAME_CARD: 0,
MAKE_ROOM : 1 MAKE_ROOM: 1,
} };
const ANDROID_SDK_VERSION = { const ANDROID_SDK_VERSION = {
O : 26 O: 26,
} };
const HOST_REQUEST_FLG = { const HOST_REQUEST_FLG = {
DONE : 0, DONE: 0,
DOING : 1 DOING: 1,
} };
const messageSeperator = "<::split>"; const messageSeperator = "<::split>";
const dataMessageScheme = "::NOT_MESSAGE"; const dataMessageScheme = "::NOT_MESSAGE";
...@@ -2,99 +2,114 @@ ...@@ -2,99 +2,114 @@
var CONTACT = {}; var CONTACT = {};
$(function () { $(function () {
// メンバー検索 // メンバー検索
$('#contact .search_form input[type="search"]').keyup(function(e) { $('#contact .search_form input[type="search"]').keyup(function (e) {
var keyword = $('#contact .search_form input[type="search"]').val();
if (e.key == "Enter" || e.KeyCode == 13) {
if (keyword != "" && keyword.length != 0) {
$('#contact .search_form input[type="search"]').blur();
return;
}
} else if (keyword == "" || keyword.length < 2) {
$(".overlay_src_msg").empty();
return;
}
CONTACT.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#contact .search_form input[type="search"]').blur();
return;
}
});
// iOSキーボード変換検知用
$('#contact .search_form input[type="search"]').on(
"compositionend",
function () {
if (CHAT_UTIL.isIOS()) {
var keyword = $('#contact .search_form input[type="search"]').val(); var keyword = $('#contact .search_form input[type="search"]').val();
if (e.key == "Enter" || e.KeyCode == 13) {
if (keyword != '' && keyword.length != 0) {
$('#contact .search_form input[type="search"]').blur();
return;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return;
}
CONTACT.searchUser(keyword); CONTACT.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) { }
$('#contact .search_form input[type="search"]').blur(); }
return; );
}
});
// iOSキーボード変換検知用
$('#contact .search_form input[type="search"]').on('compositionend', function() {
if (CHAT_UTIL.isIOS()) {
var keyword = $('#contact .search_form input[type="search"]').val();
CONTACT.searchUser(keyword);
}
});
}); });
// ユーザー検索 // ユーザー検索
CONTACT.searchUser = function(keyword) { CONTACT.searchUser = function (keyword) {
var groupList; var groupList;
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
var isAllGroup = $('#tabAllGroup').is(':checked'); var isAllGroup = $("#tabAllGroup").is(":checked");
//全グループ検索画面 //全グループ検索画面
if (isAllGroup) { if (isAllGroup) {
//グループデータ検索 //グループデータ検索
groupList = CHAT_DB.getGroupByName(keyword); groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate; var groupTemplate;
$.get({ url: "./template/template_group_list.html", async: false } $.get(
, function(text) { { url: "./template/template_group_list.html", async: false },
groupTemplate = text; function (text) {
}); groupTemplate = text;
}
);
groupList.forEach(function(group) { groupList.forEach(function (group) {
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
name: group.groupName, name: group.groupName,
id: group.groupId, id: group.groupId,
isFavorite: group.isFavorite isFavorite: group.isFavorite,
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); $(".overlay_src_msg").append(obj);
}) });
//ユーザデータ検索 //ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword); var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
var userTemplate; var userTemplate;
$.get({ url: "./template/template_user_list.html", async: false } $.get(
, function(text) { { url: "./template/template_user_list.html", async: false },
userTemplate = text; function (text) {
}); userTemplate = text;
userList.forEach(function(user) { }
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); );
}); userList.forEach(function (user) {
let html = Mustache.render(userTemplate, { user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
userList: userList });
}); let html = Mustache.render(userTemplate, {
let obj = jQuery.parseHTML(html); userList: userList,
$('.overlay_src_msg').append(obj); });
if (userList.length == 0 && groupList.length == 0) { let obj = jQuery.parseHTML(html);
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); $(".overlay_src_msg").append(obj);
noResultMsg.append(getLocalizedString("noResult")) if (userList.length == 0 && groupList.length == 0) {
$('.overlay_src_msg').append(noResultMsg); const noResultMsg = $("<div/>", {
} width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
$(".overlay_src_msg").append(noResultMsg);
}
//連絡先画面 //連絡先画面
} else { } else {
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword); var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate; var userTemplate;
$.get({ url: "./template/template_user_list.html", async: false } $.get(
, function(text) { { url: "./template/template_user_list.html", async: false },
userTemplate = text; function (text) {
}); userTemplate = text;
userList.forEach(function(user) { }
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); );
}); userList.forEach(function (user) {
let html = Mustache.render(userTemplate, { user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
userList: userList });
}); let html = Mustache.render(userTemplate, {
let obj = jQuery.parseHTML(html); userList: userList,
$('.overlay_src_msg').html(obj); });
if (userList.length == 0) { let obj = jQuery.parseHTML(html);
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); $(".overlay_src_msg").html(obj);
noResultMsg.append(getLocalizedString("noResult")) if (userList.length == 0) {
$('.overlay_src_msg').append(noResultMsg); const noResultMsg = $("<div/>", {
} width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
$(".overlay_src_msg").append(noResultMsg);
} }
}
}; };
$(window).on('load',function () { //読み込み完了したら実行する $(window).on("load", function () {
$('#loader-bg').delay(900).fadeOut(800);//ローディングを隠す //読み込み完了したら実行する
$('#loader').delay(600).fadeOut(300); $("#loader-bg").delay(900).fadeOut(800); //ローディングを隠す
$("#loader").delay(600).fadeOut(300);
}); });
$(function () { $(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment