Commit c886b040 by Kim Peace

Unified common js logics

parent 9cdbfe65
......@@ -53,24 +53,22 @@ var getArchiveTypeIconURL = function (type) {
var getArchiveTemplate = function () {
return new Promise(function (resolve, reject) {
$.get(
{ url: "./template/template_archive_list.html", async: false },
function (text) {
resolve(text);
}
);
$.get({ url: TemplateURL.ARCHIVE_LIST, async: false }, function (text) {
resolve(text);
});
});
};
var bindArchiveSearch = function () {
$('#archive .search_form input[type="search"]').keyup(function (e) {
var keyword = $('#archive .search_form input[type="search"]').val();
const searchInput = $('#archive .search_form input[type="search"]');
searchInput.keyup(function (e) {
var keyword = searchInput.val();
const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword.length != 0 && keyword != "";
if (enterKeyPressed) {
if (keywordNotEmpty) {
$('#archive .search_form input[type="search"]').blur();
searchInput.blur();
return;
}
} else if (keywordEmpty) {
......@@ -82,7 +80,7 @@ var bindArchiveSearch = function () {
ARCHIVE_UI.refreshSearchScreen(keyword);
if (enterKeyPressed) {
$('#archive .search_form input[type="search"]').blur();
searchInput.blur();
return;
}
// 検索結果を表示
......@@ -90,16 +88,14 @@ var bindArchiveSearch = function () {
};
var bindiOSKeyBoardEvent = function () {
$('#archive .search_form input[type="search"]').on(
"compositionend",
function () {
if (CHAT_UTIL.isIOS()) {
var keyword = $('#archive .search_form input[type="search"]').val();
$(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword);
}
const searchInput = $('#archive .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
$(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword);
}
);
});
};
var renderArchiveTemplate = function (
......
......@@ -12,6 +12,7 @@ document.addEventListener("DOMContentLoaded", function () {
CHAT_ADD_USER.searchUser = function (keyword) {
const isAllGroup = $("#tabAllGroupOnAddUser").is(":checked");
const overlayMessage = $(".overlay_src_msg");
let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面
......@@ -23,20 +24,18 @@ CHAT_ADD_USER.searchUser = function (keyword) {
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList);
hasNoData = userList.length == 0 && groupList.length == 0;
// Set NoResult
if (userList.length == 0 && groupList.length == 0) {
const noResultMessage = getNoResultMessage();
overlayMessage.append(noResultMessage);
} //連絡先画面
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList);
if (userList.length == 0) {
const noResultMessage = getNoResultMessage();
overlayMessage.append(noResultMessage);
}
hasNoData = userList.length == 0;
}
// Set NoResult
if (hasNoData) {
const noResultMessage = getNoResultMessage();
overlayMessage.append(noResultMessage);
}
};
......@@ -76,6 +75,7 @@ var bindMemberSearch = function () {
};
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#chat_add_user .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
......@@ -85,7 +85,7 @@ var bindiOSKeyBoardEvent = function () {
};
var searchGroupData = function (groupList) {
const groupTemplate = getGroupTemplate();
const groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) {
let html = renderGroupTemplate(
......@@ -99,17 +99,6 @@ var searchGroupData = function (groupList) {
});
};
var getGroupTemplate = function () {
var groupTemplate;
$.get(
{ url: "./template/template_make_room_group_list.html", async: false },
function (text) {
groupTemplate = text;
}
);
return groupTemplate;
};
var renderGroupTemplate = function (groupTemplate, groupName, groupID) {
return Mustache.render(groupTemplate, {
name: groupName,
......@@ -118,7 +107,7 @@ var renderGroupTemplate = function (groupTemplate, groupName, groupID) {
};
var searchUserData = function (userList) {
const userTemplate = getUserTemplate();
const userTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
userList.forEach(function (user) {
setUserProfile(user);
checkUser(user);
......@@ -128,17 +117,6 @@ var searchUserData = function (userList) {
overlayMessage.append(obj);
};
var getUserTemplate = function () {
var userTemplate;
$.get(
{ url: "./template/template_make_room_user_list.html", async: false },
function (text) {
userTemplate = text;
}
);
return userTemplate;
};
var setUserProfile = function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
};
......@@ -157,12 +135,3 @@ var renderUserTemplate = function (userTemplate, userList) {
userList: userList,
});
};
var getNoResultMessage = function () {
const noResultMsg = $("<div/>", {
width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
return noResultMsg;
};
includeJs("./chat-db-foriOS.js");
includeJs("./js/chat-db-foriOS.js");
// 名前空間
var CHAT_DB = {};
......
......@@ -166,37 +166,10 @@ function setSocketAction() {
// #36170
socket.on("newMessage", function (message, roomId, roomName) {
console.log(message);
var userMessageTemplate;
$.get(
{ url: "./template/template_user_message.html", async: false },
function (text) {
userMessageTemplate = text;
}
);
var myMessageTemplate;
$.get(
{ url: "./template/template_my_message.html", async: false },
function (text) {
myMessageTemplate = text;
}
);
var systemMessageTemplate;
$.get(
{ url: "./template/template_system_message.html", async: false },
function (text) {
systemMessageTemplate = text;
}
);
var openCollaborationMessageTemplate;
$.get(
{
url: "./template/template_open_collaboration_message.html",
async: false,
},
function (text) {
openCollaborationMessageTemplate = text;
}
);
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
var systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
var openCollaborationMessageTemplate = getTemplate(TemplateURL.OPEN_COLLABORATION_MESSAGE);
let template = userMessageTemplate;
if (message.id === socket.id) {
......
......@@ -582,20 +582,9 @@ document.addEventListener('DOMContentLoaded', function() {
return;
}
var messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(","));
var userMessageTemplate;
$.get(
{ url: "./template/template_user_message.html", async: false },
function (text) {
userMessageTemplate = text;
}
);
var myMessageTemplate;
$.get(
{ url: "./template/template_my_message.html", async: false },
function (text) {
myMessageTemplate = text;
}
);
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
let jQueryMessages = $(".overlay_src_msg");
messages.forEach(function (message) {
......@@ -647,13 +636,7 @@ CHAT.searchRoom = function (keyword, rooms) {
rooms = CHAT_DB.getRoomList(ChatRoomType.ALL, keyword);
let roomListTitle = getLocalizedString("room_search_placeholder");
$("#chatTitle").text(roomListTitle);
var template;
$.get(
{ url: "./template/template_room_list.html", async: false },
function (text) {
template = text;
}
);
var template = getTemplate(TemplateURL.ROOM_LIST);
rooms.forEach(function (room) {
room.profileImagePath = ASSET_PATH + "images/user-profile.png";
if (room.message) {
......@@ -704,11 +687,7 @@ CHAT.searchRoom = function (keyword, rooms) {
$(".overlay_src_msg").append(obj);
});
if (rooms.length == 0) {
const noResultMsg = $("<div/>", {
width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
const noResultMsg = getNoResultMessage();
$(".overlay_src_msg").append(noResultMsg);
}
};
......@@ -722,20 +701,8 @@ CHAT.searchMessage = function (keyword, workVal) {
checkedUserList.push($(selectedUser).data("user-id"));
});
var messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(","));
var userMessageTemplate;
$.get(
{ url: "./template/template_user_message.html", async: false },
function (text) {
userMessageTemplate = text;
}
);
var myMessageTemplate;
$.get(
{ url: "./template/template_my_message.html", async: false },
function (text) {
myMessageTemplate = text;
}
);
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
let jQueryMessages = $(".overlay_src_msg");
messages.forEach(function (message) {
......@@ -776,11 +743,7 @@ CHAT.searchMessage = function (keyword, workVal) {
});
jQueryMessages.prepend(workVal);
if (messages.length == 0) {
const noResultMsg = $("<div/>", {
width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
const noResultMsg = getNoResultMessage();
jQueryMessages.append(noResultMsg);
}
};
// 名前空間
var CHAT_MAKE_ROOM = {};
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener("DOMContentLoaded", function () {
// メンバー検索
$('#chatMakeRoom .search_form input[type="search"]').click(function (e) {
let contactListTitle = getLocalizedString("userSearch");
$("#makeRoomTitle").text(contactListTitle);
});
$('#chatMakeRoom .search_form input[type="search"]').keyup(function (e) {
//画面タイトル設定
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
if (e.KeyCode == 13 || e.key == "Enter") {
if (keyword != "" && keyword.length != 0) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return false;
}
} else if (keyword == "" || keyword.length < 2) {
$(".overlay_src_msg").empty();
return false;
}
CHAT_MAKE_ROOM.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return;
}
});
searchMember();
// 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);
}
}
);
bindiOSKeyBoardEvent();
});
// メンバー検索
CHAT_MAKE_ROOM.searchUser = function (keyword) {
var isAllGroup = $("#tabAllGroupOnMakeRoom").is(":checked");
$(".overlay_src_msg").empty();
const overlayMessage = $(".overlay_src_msg");
const isAllGroup = $("#tabAllGroupOnMakeRoom").is(":checked");
let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate;
$.get(
{ url: "./template/template_make_room_group_list.html", async: false },
function (text) {
groupTemplate = text;
}
);
var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) {
let html = Mustache.render(groupTemplate, {
name: group.groupName,
id: group.groupId,
});
renderRoomList(groupTemplate, group.groupName, group.groupId);
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").append(obj);
overlayMessage.append(obj);
});
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
var userTemplate;
$.get(
{ url: "./template/template_make_room_user_list.html", async: false },
function (text) {
userTemplate = text;
}
);
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
return shopMemberId == user.shopMemberId;
});
if (findObj) {
user.checked = "checked";
}
});
let html = Mustache.render(userTemplate, {
userList: userList,
});
searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList);
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").append(obj);
if (groupList.length == 0 && userList.length == 0) {
const noResultMsg = $("<div/>", {
width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
$(".overlay_src_msg").append(noResultMsg);
} //連絡先画面
overlayMessage.append(obj);
hasNoData = groupList.length == 0 && userList.length == 0;
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate;
$.get(
{ url: "./template/template_make_room_user_list.html", async: false },
function (text) {
userTemplate = text;
}
);
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
return shopMemberId == user.shopMemberId;
});
if (findObj) {
user.checked = "checked";
}
});
let html = Mustache.render(userTemplate, {
userList: userList,
});
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
searchUserData();
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList);
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);
}
hasNoData = userList.length == 0;
}
if (hasNoData) {
const noResultMsg = getNoResultMessage();
overlayMessage.append(noResultMsg);
}
};
/** UTIL */
var searchMember = function () {
const searchInput = $('#chatMakeRoom .search_form input[type="search"]');
searchInput.click(function (e) {
let contactListTitle = getLocalizedString("userSearch");
$("#makeRoomTitle").text(contactListTitle);
});
searchInput.keyup(function (e) {
const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword != "" && keyword.length != 0;
//画面タイトル設定
var keyword = searchInput.val();
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return false;
}
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
return false;
}
CHAT_MAKE_ROOM.searchUser(keyword);
if (enterKeyPressed) {
searchInput.blur();
return;
}
});
};
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#chatMakeRoom .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
CHAT_MAKE_ROOM.searchUser(keyword);
}
});
};
var renderRoomList = function (url, groupName, groupID) {
return Mustache.render(url, {
name: groupName,
id: groupID,
});
};
var searchUserData = function (userList) {
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
return shopMemberId == user.shopMemberId;
});
if (findObj) {
user.checked = "checked";
}
});
};
var renderUser = function (url, userList) {
return Mustache.render(url, {
userList: userList,
});
};
......@@ -7,6 +7,23 @@ function includeJs(jsFilePath) {
document.body.appendChild(js);
}
function getTemplate(url) {
var template;
$.get({ url: url, async: false }, function (text) {
template = text;
});
return template;
}
function getNoResultMessage() {
const noResultMsg = $("<div/>", {
width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
return noResultMsg;
}
// アコーディオン
$(".category").on("click", function () {
$(this).toggleClass("open");
......@@ -21,7 +38,7 @@ $(".home_btn").on("click", function () {
}
});
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener("DOMContentLoaded", function () {
var h = $(window).height(); //画面の高さを取得
// ローディング表示
......
......@@ -56,3 +56,43 @@ const HostRequestFlag = {
const messageSeperator = "<::split>";
const dataMessageScheme = "::NOT_MESSAGE";
const TemplateURL = {
GROUP_PATH: "./template/template_group_path.html",
GROUP_LIST: "./template/template_group_list.html",
ARCHIVE_LIST: "./template/template_archive_list.html",
MAKE_ROOM_GROUP_LIST: "./template/template_make_room_group_list.html",
GROUP_USER_LIST: "./template/template_group_user_list.html",
ROOM_LIST: "./template/template_room_list.html",
SYSTEM_MESSAGE: "./template/template_system_message.html",
USER_LIST: "./template/template_user_list.html",
USER_NAME_CARD: "./template/template_user_name_card.html",
USER_MESSAGE: "./template/template_user_message.html",
MY_NAME_CARD: "./template/template_my_name_card.html",
MY_MESSAGE: "./template/template_my_message.html",
OPEN_COLLABORATION_MESSAGE:
"./template/template_open_collaboration_message.html",
CHATROOM_USER_LIST: "./template/template_chatroom_user_list.html",
CHATROOM_USER_FILTER_LIST:
"./template/template_chatroom_user_filter_list.html",
MAKE_ROOM_USER_LIST: "./template/template_make_room_user_list.html",
MAKE_ROOM_GROUP_USER_LIST:
"./template/template_make_room_group_user_list.html",
MAKE_ROOM_GROUP_PATH: "./template/template_make_room_group_path.html",
MAKE_ROOM_CONFIRM_USER_LIST:
"./template/template_make_room_confirm_user_list.html",
ADD_USER_CONFIRM_USER_LIST:
"./template/template_add_user_confirm_user_list.html",
ADD_USER_USER_LIST: "./template/template_add_user_user_list.html",
ADD_USER_USER_LIST_IN_COLLABORATION:
"./template/template_add_user_user_list_in_collaboration.html",
ADD_USER_GROUP_PATH: "./template/template_add_user_group_path.html",
ADD_USER_GROUP_LIST: "./template/template_add_user_group_list.html",
ADD_USER_GROUP_LIST_IN_COLLABORATION:
"./template/template_add_user_group_list_in_collaboration.html",
ADD_USER_GROUP_USER_LIST: "./template/template_add_user_group_user_list.html",
ADD_USER_GROUP_USER_LIST_IN_COLLABORATION:
"./template/template_add_user_group_user_list_in_collaboration.html",
ADD_USER_GROUP_PATH_IN_COLLABORATION:
"./template/template_add_user_group_path_in_collaboration.html",
};
// 名前空間
var CONTACT = {};
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener("DOMContentLoaded", function () {
// メンバー検索
$('#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;
}
});
bindMemeberSearch();
// 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);
}
}
);
bindiOSKeyBoardEvent();
});
// ユーザー検索
CONTACT.searchUser = function (keyword) {
var groupList;
$(".overlay_src_msg").empty();
var isAllGroup = $("#tabAllGroup").is(":checked");
const overlayMessage = $(".overlay_src_msg");
const isAllGroup = $("#tabAllGroup").is(":checked");
let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate;
$.get(
{ url: "./template/template_group_list.html", async: false },
function (text) {
groupTemplate = text;
}
);
groupList.forEach(function (group) {
let html = Mustache.render(groupTemplate, {
name: group.groupName,
id: group.groupId,
isFavorite: group.isFavorite,
});
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").append(obj);
});
const groupList = CHAT_DB.getGroupByName(keyword);
groupDataSearch(groupList);
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
var userTemplate;
$.get(
{ url: "./template/template_user_list.html", async: false },
function (text) {
userTemplate = text;
}
);
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(userTemplate, {
userList: userList,
});
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").append(obj);
if (userList.length == 0 && groupList.length == 0) {
const noResultMsg = $("<div/>", {
width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
$(".overlay_src_msg").append(noResultMsg);
}
const userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate;
$.get(
{ url: "./template/template_user_list.html", async: false },
function (text) {
userTemplate = text;
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0;
}
if (hasNoData) {
const noResultMsg = getNoResultMessage();
overlayMessage.append(noResultMsg);
}
};
/** UTILS */
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#contact .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
CONTACT.searchUser(keyword);
}
});
};
var bindMemeberSearch = function () {
const searchInput = $('#contact .search_form input[type="search"]');
searchInput.keyup(function (e) {
const keyword = searchInput.val();
const enterKeyPressed = e.key == "Enter" || e.KeyCode == 13;
const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword != "" && keyword.length != 0;
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return;
}
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
return;
}
CONTACT.searchUser(keyword);
if (enterKeyPressed) {
searchInput.blur();
return;
}
});
};
var groupDataSearch = function (groupList) {
const groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
groupList.forEach(function (group) {
let html = renderGroupList(
groupTemplate,
group.groupName,
group.groupId,
group.isFavorite
);
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(userTemplate, {
userList: userList,
});
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);
}
}
$(".overlay_src_msg").append(obj);
});
};
var renderGroupList = function (url, groupName, groupID, isFavorite) {
return Mustache.render(url, {
name: groupName,
id: groupID,
isFavorite: isFavorite,
});
};
var userDataSearch = function (userList) {
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
var userTemplate = getTemplate(TemplateURL.USER_LIST);
let html = renderUserList(userTemplate, userList);
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").append(obj);
};
var renderUserList = function (url, userList) {
return Mustache.render(url, {
userList: userList,
});
};
\ No newline at end of file
......@@ -9,7 +9,7 @@ let timeInterval = null;
var backgroundFileName;
var isIos;
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener("DOMContentLoaded", function () {
var coviewApiActive = coview_api.Init({
testSTRParam: "param1",
testNUMParam: 77,
......@@ -723,9 +723,7 @@ function applyForHostChange() {
if (CHAT_UTIL.isAndroid()) {
android.setHostRequestFlg(HostRequestFlag.DOING);
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(
HostRequestFlag.DOING
);
webkit.messageHandlers.setHostRequestFlg.postMessage(HostRequestFlag.DOING);
}
fw.sendToMsg("others", "CHANGE_HOST_APPLY", {
hostId: CHAT.globalLoginParameter.loginId,
......
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