Commit 1a39aefa by Kim Peace

Adopt js lint

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