Commit f75d3558 by Kim Peace

Changed getGlobalParam to LoginInfo, Device Info and ServerInfo

parent 203c862e
......@@ -149,24 +149,13 @@
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
$("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html");
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
function getGlobalParam() {
CHAT_UI.refreshArchiveScreen();
};
</script>
......
......@@ -185,28 +185,15 @@
</div>
</script>
<script>
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
var archiveId;
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
function getGlobalParam() {
CHAT_UI.refreshArchiveDetailScreen(archiveId);
};
</script>
<script>
var archiveId;
window.addEventListener('DOMContentLoaded', function () {
var urlPrm = new Object;
var urlSearch = location.search.substring(1).split('&');
......
......@@ -130,25 +130,15 @@
String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
$("#loadingArea").load("./loading.html");
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
NativeBridgeDelegate.saveSelectedUserList("");
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isAndroid()) {
function getGlobalParam() {
if (deviceInfo.isAndroid()) {
var needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
......
......@@ -161,23 +161,10 @@
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
function getGlobalParam() {
const selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") {
selectedUsers.forEach(function (user) {
......
......@@ -89,22 +89,10 @@
String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
function getGlobalParam() {
CHAT_UI.showAddUserConfirmView();
};
</script>
......
......@@ -88,24 +88,12 @@
String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let roomId = 0;
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
};
function getGlobalParam() { };
</script>
</body>
......
......@@ -162,23 +162,10 @@
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
function getGlobalParam() {
if (NativeBridgeDataSource.loadSelectedUsers() != "") {
let selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
selectedUsers.forEach(function (user) {
......
......@@ -97,22 +97,12 @@
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
$("#newRoomName").attr("placeholder", getLocalizedString("newRoomName"));
function getGlobalParam() {
CHAT_UI.showMakeRoomConfirmView();
};
</script>
......
......@@ -53,18 +53,13 @@
<!-- コンテンツ -->
<main id="chat_room">
<div id="user_list" class="user_list d-flex flex-row">
</div>
<div id="user_list" class="user_list d-flex flex-row"> </div>
<!-- フィルター -->
<div id="filter" class="user_list filter d-flex flex-row none"></div>
<div class="chat_list none" id="searchList">
<ul class="overlay_src_msg">
</ul>
</div>
<!-- チャット内容 -->
<div class="room_container">
<div class="room_contents scroll">
......@@ -72,7 +67,6 @@
</div>
</div>
</main>
<!-- フッター -->
<footer class="chat_room_footer">
<!-- フッター上 -->
......@@ -169,10 +163,10 @@
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<script src="./js/sockets/chat-websocket-refresh-group-list.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -190,14 +184,7 @@
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let androidVersion = 0;
let roomName;
$("#pictureModal").load("./modal_chat_picture.html");
$("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html");
......@@ -210,19 +197,15 @@
androidVersion = android.getAndroidVersion();
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isAndroid()) {
function getGlobalParam() {
if (deviceInfo.isAndroid()) {
var needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
}
}
CHAT_UI.loadMessages(CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomName);
CHAT_UI.loadMessages(roomInfo.roomID, roomInfo.roomName);
};
</script>
</body>
......
......@@ -149,10 +149,12 @@
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<script src="./js/Models/coview-userinfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<script src="./js/sockets/chat-websocket-refresh-group-list.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -170,12 +172,6 @@
$("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html");
$("#loadingArea").load("./loading.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
let isInvited = 0;
......@@ -199,17 +195,12 @@
return this.split(org).join(dest);
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
async function getGlobalParam() {
joinCollaborationType = NativeBridgeDataSource.getJoinCollaborationType();
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
if (CHAT_UTIL.isAndroid()) {
if (deviceInfo.isAndroid()) {
androidVersion = android.getAndroidVersion();
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) {
alert(getLocalizedString('not_support_version'));
......@@ -221,9 +212,18 @@
initCollaborationUI(joinCollaborationType);
globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType);
globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType);
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { });
const joinInfo = new JoinInfo(
currentUserInfo.sid,
currentUserInfo.loginID,
currentUserInfo.shopName,
roomInfo.roomID,
roomInfo.roomName,
currentUserInfo.shopMembeID
);
CHAT_SOCKET.emitJoin(joinInfo, false, false);
}
};
</script>
......
......@@ -29,7 +29,8 @@
<div class="text-right d-flex align-items-center">
<button type="button" name="button" class="btn add_user_btn"></button>
<button type="button" name="button" class="btn menu_btn"></button>
<button type="button" name="button" class="btn start_pip_btn" onclick="NativeBridgeDelegate.startPIPMode();"></button>
<button type="button" name="button" class="btn start_pip_btn"
onclick="NativeBridgeDelegate.startPIPMode();"></button>
</div>
</div>
</div>
......@@ -92,10 +93,10 @@
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<script src="./js/sockets/chat-websocket-refresh-group-list.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -112,12 +113,6 @@
$("#collaboration_voice_overlay_menu").load("./collaboration_voice_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
NativeBridgeDelegate.getLoginParameter();
......@@ -127,18 +122,22 @@
NativeBridgeDelegate.finishPIPMode();
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT;
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { });
const joinInfo = new JoinInfo(
currentUserInfo.sid,
currentUserInfo.loginID,
currentUserInfo.shopName,
roomInfo.roomID,
roomInfo.roomName,
currentUserInfo.shopMembeID
);
CHAT_SOCKET.emitJoin(joinInfo, false, false);
};
</script>
</body>
</html>
\ No newline at end of file
......@@ -153,10 +153,12 @@
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<script src="./js/sockets/chat-websocket-refresh-group-list.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -174,12 +176,6 @@
$("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
NativeBridgeDelegate.getLoginParameter();
......@@ -190,18 +186,22 @@
$('.add_user_btn').removeClass('none');
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { });
CHAT_SOCKET.connectSocket();
const joinInfo = new JoinInfo(
currentUserInfo.sid,
currentUserInfo.loginID,
currentUserInfo.shopName,
roomInfo.roomID,
roomInfo.roomName,
currentUserInfo.shopMembeID
);
CHAT_SOCKET.emitJoin(joinInfo, false, false);
}
};
</script>
......
......@@ -143,10 +143,11 @@
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<script src="./js/sockets/chat-websocket-refresh-group-list.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -165,12 +166,6 @@
$("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
NativeBridgeDelegate.getLoginParameter();
......@@ -181,18 +176,21 @@
$('.add_user_btn').removeClass('none');
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { });
const joinInfo = new JoinInfo(
currentUserInfo.sid,
currentUserInfo.loginID,
currentUserInfo.shopName,
roomInfo.roomID,
roomInfo.roomName,
currentUserInfo.shopMembeID
);
CHAT_SOCKET.emitJoin(joinInfo, false, false);
}
};
</script>
......
......@@ -88,10 +88,11 @@
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<script src="./js/sockets/chat-websocket-refresh-group-list.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -108,12 +109,6 @@
$("#collaboration_voice_overlay_menu").load("./collaboration_voice_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
......@@ -125,18 +120,21 @@
$('.add_user_btn').removeClass('none');
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { });
const joinInfo = new JoinInfo(
currentUserInfo.sid,
currentUserInfo.loginID,
currentUserInfo.shopName,
roomInfo.roomID,
roomInfo.roomName,
currentUserInfo.shopMembeID
);
CHAT_SOCKET.emitJoin(joinInfo, false, false);
}
};
</script>
......
......@@ -145,10 +145,11 @@
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<script src="./js/sockets/chat-websocket-refresh-group-list.js"></script>
<!-- View -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
......@@ -166,12 +167,6 @@
$("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
......@@ -183,18 +178,21 @@
$('.add_user_btn').removeClass('none');
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.BOARD;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { });
const joinInfo = new JoinInfo(
currentUserInfo.sid,
currentUserInfo.loginID,
currentUserInfo.shopName,
roomInfo.roomID,
roomInfo.roomName,
currentUserInfo.shopMembeID
);
CHAT_SOCKET.emitJoin(joinInfo, false, false);
}
};
</script>
......
......@@ -210,23 +210,12 @@
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
$("#loadingArea").load("./loading.html");
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
function getGlobalParam() {
const groupID = NativeBridgeDataSource.getToMoveGroupId();
......
var CoviewUserInfo = class {
sid;
loginId;
roomId;
shopName;
coWorkType;
constructor(sid, loginId, roomId, shopName, coWorkType) {
this.sid = sid;
this.loginId = loginId;
this.roomId = roomId;
this.shopName = shopName;
this.coWorkType = coWorkType;
}
};
// variable name for legacy connection to agent_app.js in coview library
var globalUserInfo = new CoviewUserInfo(
currentUserInfo.sid,
currentUserInfo.loginId,
roomInfo.roomID,
currentUserInfo.shopName,
""
);
......@@ -14,6 +14,18 @@ var DeviceInfo = class {
this.isMoble = deviceInfo.isMoble;
this.platform = deviceInfo.platform;
}
isiOS() {
return this.platform == "ios";
}
isAndroid() {
return this.platform == "android";
}
isMobile() {
return this.isMoble == "true";
}
};
var deviceInfo = new DeviceInfo(NativeBridgeDataSource.getDeviceInfo());
var JoinInfo = class {
sid;
loginId;
shopName;
roomId;
roomName;
shopMemberId;
constructor(sid, loginId, shopName, roomId, roomName, shopMemberId) {
this.sid = sid;
this.loginId = loginId;
this.shopName = shopName;
this.roomId = roomId;
this.roomName = roomName;
this.shopMemberId = shopMemberId;
}
};
NativeBridgeDataSource.getMyUserInfo = function() {
NativeBridgeDataSource.getMyUserInfo = function () {
if (typeof android != "undefined") {
return JSON.parse(android.removeFavoriteGroup(groupID));
} else {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.currentUserInfo, { }));
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.currentUserInfo, {}));
}
}
};
var CurrentUserInfo = class {
sid;
......@@ -17,8 +17,23 @@ var CurrentUserInfo = class {
this.loginId = userInfo.loginId;
this.shopName = userInfo.shopName;
this.shopMemberId = userInfo.shopMemberId;
if (userInfo.languageCode == undefined) {
userInfo.languageCode = "jp";
}
this.languageCode = userInfo.languageCode;
}
configureLanguage(languageCode = undefined) {
if (languageCode == undefined) {
languageCode = this.languageCode;
}
moment.locale(languageCode);
setLanguage(languageCode);
}
};
var currentUserInfo = new CurrentUserInfo(NativeBridgeDataSource.getMyUserInfo());
var currentUserInfo = new CurrentUserInfo(
NativeBridgeDataSource.getMyUserInfo()
);
currentUserInfo.configureLanguage();
......@@ -90,7 +90,7 @@ var bindArchiveSearch = function () {
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#archive .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
var keyword = searchInput.val();
$(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword);
......
......@@ -77,7 +77,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()) {
if (deviceInfo.isiOS()) {
var keyword = searchInput.val();
CHAT_ADD_USER.searchUser(keyword);
}
......
// New Room
// チャットルーム生成ボタン処理
$("#createChatRoom").on("click", function () {
//loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
let isInvite = false;
CHAT.globalIsInvite = isInvite;
socket.emit("getGroupList", isInvite);
});
//メッセージ送信
$("#messageInput").on("keypress", function (event) {
if (event.which == 13) {
......
CHAT_UI.startCollaboration = function (collaborationType) {
if (CHAT_UTIL.isAndroid()) {
if (deviceInfo.isAndroid()) {
if (
collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
......@@ -14,13 +14,8 @@ CHAT_UI.startCollaboration = function (collaborationType) {
CHAT_UI.dismissLoadingIndicator();
return;
}
socket.emit(
"createMessage",
{
text: DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL,
},
0
);
const sendData = DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL;
CHAT_SOCKET.emitCreateMessage(sendData, 0);
NativeBridgeDelegate.finishAllCollaboration();
}
NativeBridgeDelegate.startCollaboration(collaborationType);
......@@ -241,7 +236,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) {
};
CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) {
if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) {
if (currentUserInfo.shopMemberId == shopMemberId) {
return;
}
var nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId);
......@@ -289,59 +284,3 @@ CHAT_UI.insertFavoriteUserInCollaboration = function (shopMemberId) {
NativeBridgeDataSource.addFavoriteUser(shopMemberId);
CHAT_UI.dismissLoadingIndicator();
};
CHAT_UI.confirmInviteUserListInCollaboration = function () {
var selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") {
$("#selectedUserListinCollaboration").html("");
var selectedUserList = NativeBridgeDataSource.loadSelectedUsers();
selectedUserList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
var modalTemplate;
$.get(
{ url: "./modal_add_user_confirm.html", async: false },
function (text) {
modalTemplate = text;
}
);
let html = Mustache.render(modalTemplate, {
userList: selectedUserList,
});
let obj = jQuery.parseHTML(html);
$("#modal_add_user_confirm").html(obj);
$("#modalAddUserConfirm").modal("show");
} else {
}
$("#cancelAddUserBtn")
.off()
.on("click", function () {
console.log("cancelClick");
$("#modalAddUserConfirm").modal("hide");
$("#addUserInCollaboration").modal("show");
});
$("#addUserBtn")
.off()
.on("click", function () {
CHAT_UI.showLoadingIndicator();
let userIdList = new Array();
selectedUserList.forEach(function (user) {
userIdList.push(user.shopMemberId);
});
const commaJoinedUserIDList = userIdList.join(",");
const collaborationType = CHAT_UTIL.getCollaborationType(
globalUserInfo.coWorkType
);
NativeBridgeDelegate.inviteCollaboration(
commaJoinedUserIDList,
collaborationType
);
CHAT_UI.dismissLoadingIndicator();
$("#modalAddUserConfirm").modal("hide");
});
};
......@@ -6,13 +6,13 @@ includeJs("./js/chat-ui-collaboration.js");
// Rotate
$(window).on("resize", function () {
if (CHAT_UTIL.isMobile()) {
if (deviceInfo.isMobile()) {
return;
}
console.log(`width : ${$(this).width()}` + `height : ${$(this).height()}`);
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
if (isLandscape == true) {
$(".mesgs").addClass("landscape_mesgs");
} else if (isLandscape == false) {
......@@ -57,11 +57,8 @@ CHAT_UI.sendMessage = function (e) {
messageTextBox.val("");
if (message.length > 0) {
socket.emit(
"createMessage",
{ text: message + messageSeperator + MessageType.TEXT },
0
);
const sendData = message + messageSeperator + MessageType.TEXT;
CHAT_SOCKET.emitCreateMessage(sendData, 0);
}
$(".message_input_form").focus();
};
......@@ -92,17 +89,14 @@ CHAT_UI.dismissLoadingIndicator = function () {
//画面の方向をcheck
CHAT_UI.isLandscapeMode = function () {
if (CHAT_UTIL.isMobile()) {
if (deviceInfo.isMobile()) {
return false;
}
return $(window).width() > $(window).height();
};
CHAT_UI.htmlElementTextInitialize = function (languageCode) {
moment.locale(languageCode);
setLanguage(languageCode);
CHAT_UI.htmlElementTextInitialize = function () {
$("#newRoomName").attr("placeholder", getLocalizedString("newRoomName"));
$(".ttl_detail").text(getLocalizedString("detail"));
......@@ -231,7 +225,7 @@ CHAT_UI.refreshContactScreen = function () {
};
CHAT_UI.refreshRoomList = function (roomType) {
if (IS_ONLINE == "true") {
if (serverInfo.isOnline == "true") {
CHAT_UI.refreshForOnline();
} else {
CHAT_UI.refreshForOffline();
......@@ -249,7 +243,7 @@ CHAT_UI.refreshRoomList = function (roomType) {
$("#tabGroup").prop("checked", true);
}
if (IS_ONLINE == "true") {
if (serverInfo.isOnline == "true") {
NativeBridgeDelegate.updateRoomList();
}
var rooms = NativeBridgeDataSource.getRoomList(roomType, null);
......@@ -280,7 +274,7 @@ CHAT_UI.refreshRoomList = function (roomType) {
var template = getTemplate(TemplateURL.ROOM_LIST);
rooms.forEach(function (room) {
room.profileImagePath = ASSET_PATH + "images/user-profile.png";
room.profileImagePath = "./images/user-profile.png";
if (room.message) {
room.message = room.message.toString();
} else {
......@@ -357,7 +351,7 @@ CHAT_UI.refreshRoomList = function (roomType) {
CHAT_UI.loadMessages = function (roomId, joinRoomName) {
roomName = joinRoomName;
if (IS_ONLINE == "true") {
if (serverInfo.isOnline == "true") {
CHAT_UI.refreshForOnline();
NativeBridgeDelegate.updateMessages(roomId);
} else {
......@@ -403,7 +397,7 @@ CHAT_UI.loadMessages = function (roomId, joinRoomName) {
CHAT_UI.waitForLoadingImage(jQueryMessages, CHAT_UI.scrollToBottom);
CHAT_UI.waitForLoadingVideo(jQueryMessages, CHAT_UI.scrollToBottom);
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
$(window).on("load", function () {
CHAT_UI.scrollToBottom();
});
......@@ -432,7 +426,7 @@ CHAT_UI.prependMessage = function (messages) {
var beforeDate = "";
messages.forEach(function (message) {
let template = userMessageTemplate;
if (message.shopMemberId == CHAT.globalLoginParameter.shopMemberId) {
if (message.shopMemberId == currentUserInfo.shopMemberId) {
template = myMessageTemplate;
}
if (message.messageType == MessageType.SYSTEM) {
......@@ -458,7 +452,7 @@ CHAT_UI.prependMessage = function (messages) {
var replacePath = message.message;
replacePath = replacePath.replaceAll(
"?fileName=",
"?sid=" + CHAT.globalLoginParameter.sid + "&fileName="
"?sid=" + currentUserInfo.sid + "&fileName="
);
message.message = replacePath;
/* if (message.message contain) {
......@@ -725,7 +719,7 @@ CHAT_UI.startChat = function (userShopMemberId, userName) {
userIdList.push(userShopMemberId);
// 参加ユーザ名でルーム名を生成
let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName;
let newRoomName = currentUserInfo.loginId + "," + userName;
NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM,
userIdList.join(","),
......@@ -741,7 +735,7 @@ CHAT_UI.startVoice = function (userShopMemberId, userName) {
userIdList.push(userShopMemberId);
// 参加ユーザ名でルーム名を生成
let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName;
let newRoomName = currentUserInfo.loginId + "," + userName;
NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM,
userIdList.join(","),
......@@ -752,7 +746,7 @@ CHAT_UI.startVoice = function (userShopMemberId, userName) {
};
CHAT_UI.makeNameCard = function (shopMemberId) {
if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) {
if (currentUserInfo.shopMemberId == shopMemberId) {
return;
}
var nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId);
......@@ -794,7 +788,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
// アーカイブ詳細の様式を読み込む
const archiveDetailTemplate = $("#archive-detail-template").html();
if (IS_ONLINE == "true") {
if (serverInfo.isOnline == "true") {
NativeBridgeDelegate.updateArchiveDetail(archiveId);
}
// アーカイブ詳細取得
......@@ -833,7 +827,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
break;
case "1": // 動画
case 1:
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
$("#archive_player").prepend(
'<video class="archive_player" controls autoplay muted playsinline controlsList="nodownload"><source src="' +
archiveFilePath +
......@@ -853,7 +847,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
break;
case "2": // 音声
case 2:
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
$("#archive_player").prepend(
'<audio class="archive_audio_player" controls controlsList="nodownload"><source src="' +
archiveFilePath +
......@@ -909,7 +903,8 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
$("#attendUser").append(obj);
});
CHAT_UI.htmlElementTextInitialize(navigator.language);
currentUserInfo.configureLanguage();
CHAT_UI.htmlElementTextInitialize();
// チャットルームへのリンク付け
document.getElementById("joinChatRoom").onclick = function () {
......@@ -1122,7 +1117,7 @@ CHAT_UI.refreshArchiveScreen = function () {
const archiveTemplate = $("#archive-template").html();
// アーカイブ一覧取得
if (IS_ONLINE == "true") {
if (serverInfo.isOnline == "true") {
NativeBridgeDelegate.updateArchiveList();
}
......@@ -1200,7 +1195,7 @@ CHAT_UI.showMakeRoomConfirmView = function () {
// 参加ユーザ名でルーム名を生成
let newRoomName =
CHAT.globalLoginParameter.loginId + "," + userNameList.join(",");
currentUserInfo.loginId + "," + userNameList.join(",");
NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM,
userIdList.join(","),
......@@ -1473,7 +1468,7 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) {
};
CHAT_UI.refreshForOnline = function () {
IS_ONLINE = "true";
serverInfo.isOnline = "true";
$(".craeteRoomButton").off("click", CHAT_UI.offlineHandler);
$(".craeteRoomButton").css("opacity", "1.0");
$(".footer_item a").removeClass("ui-state-disabled");
......@@ -1488,12 +1483,20 @@ CHAT_UI.refreshForOnline = function () {
$(".fa-download").show();
if (typeof $("#roomTitle").val() != "undefined") {
CHAT_SOCKET.connectSocket();
socket.emit("join", CHAT.globalLoginParameter, function () {});
const joinInfo = new JoinInfo(
currentUserInfo.sid,
currentUserInfo.loginID,
currentUserInfo.shopName,
roomInfo.roomID,
roomInfo.roomName,
currentUserInfo.shopMembeID
);
CHAT_SOCKET.emitJoin(joinInfo, false, false);
}
};
CHAT_UI.refreshForOffline = function () {
IS_ONLINE = "false";
serverInfo.isOnline = "false";
$(".craeteRoomButton").on("click", CHAT_UI.offlineHandler);
$(".craeteRoomButton").css("opacity", "0.3");
$(".footer_item a").addClass("ui-state-disabled");
......@@ -1520,10 +1523,7 @@ CHAT_UI.refreshForOffline = function () {
NativeBridgeDelegate.finishCollaboration();
if (collaborationJoinFlg != "2") {
NativeBridgeDelegate.joinRoom(
CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name
);
NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.name);
} else {
NativeBridgeDelegate.openCommunicationHome();
}
......
......@@ -5,19 +5,13 @@ var CHAT = {};
CHAT.globalSelectedUserList = new Array();
CHAT.globalIsInvite = false;
//ログイン中の部屋情報を保存する変数
CHAT.globalLoginParameter;
// fermi coview share
let globalUserInfo = new Object();
var beforeHeight = window.innerHeight;
var beforeWidth = window.innerWidth;
var beforeScroll;
CHAT.saveRoomInfo = function (roomID, roomName) {
CHAT.globalLoginParameter.roomId = roomID;
CHAT.globalLoginParameter.roomName = roomName;
roomInfo.roomID = roomID;
roomInfo.roomName = roomName;
NativeBridgeDelegate.saveVisitRoomInfo(roomID, roomName);
};
......@@ -25,18 +19,18 @@ CHAT.saveRoomInfo = function (roomID, roomName) {
// 存在する場合はプロフィール画像取得用APIのURLを生成して返す
CHAT.getProfileImgUrl = function (path) {
if (path == undefined || path == "") {
return ASSET_PATH + "img/noImage.png";
return "./img/noImage.png";
} else {
if (path.includes("/mnt")) {
var userInfo = path.split("/").reverse();
return (
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/user?profileFileName=" +
userInfo[0] +
"&profileGetLoginId=" +
userInfo[1] +
"&sid=" +
CHAT.globalLoginParameter.sid +
currentUserInfo.sid +
"&cmd=12"
);
} else {
......@@ -105,12 +99,12 @@ CHAT.createVideoThumbnailAndUpload = function (sourceImage, callback) {
// Ajaxでイメージをアップロードする
CHAT.uploadImage = function (formData) {
formData.append("roomId", CHAT.globalLoginParameter.roomId);
formData.append("sid", CHAT.globalLoginParameter.sid);
formData.append("roomId", roomInfo.roomID);
formData.append("sid", currentUserInfo.sid);
jQuery
.ajax({
async: true,
url: CMS_SERVER_URL + "/chatapi/file/upload",
url: serverInfo.cmsURL + "/chatapi/file/upload",
type: "post",
data: formData,
contentType: false,
......@@ -122,11 +116,11 @@ CHAT.uploadImage = function (formData) {
})
.done(function (res) {
var imgPath =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/getImage?fileName=" +
res.fileName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
var imageName = res.fileName;
// uploadFileの判断
......@@ -142,19 +136,19 @@ CHAT.uploadImage = function (formData) {
) {
if (res.thumbnailPath && res.thumbnailPath.length > 0) {
imgPath =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/getImage?fileName=" +
res.thumbImageFileName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
imageName = res.thumbImageFileName;
}
let downloadPath =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/download?fileName=" +
imageName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
// アップロードが終了した後ローディング画面から離れてメッセージをメッセージを転送する
const lightbox = $("<a/>", {
"data-lightbox": "attachedImages",
......@@ -182,38 +176,32 @@ CHAT.uploadImage = function (formData) {
} catch (e) {
encodedText = text;
}
socket.emit(
"createMessage",
{
text: encodedText + messageSeperator + MessageType.IMAGE,
},
1
);
const sendData = encodedText + messageSeperator + MessageType.IMAGE;
CHAT_SOCKET.emitCreateMessage(sendData, 1);
} else {
// 動画の処理
if (res.thumbnailPath && res.thumbnailPath.length > 0) {
imgPath =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/getImage?fileName=" +
res.thumbImageFileName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
}
let downloadPath =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/download?fileName=" +
imageName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
var videoSrc =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/getImage?fileName=" +
res.fileName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
const totalDiv = $("<div/>", { id: "attachedImages" });
const videoTag = $("<video/>", {
controls: "true",
......@@ -238,14 +226,8 @@ CHAT.uploadImage = function (formData) {
} catch (e) {
encodedText = text;
}
socket.emit(
"createMessage",
{
text: encodedText + messageSeperator + MessageType.VIDEO,
},
1
);
const sendData = encodedText + messageSeperator + MessageType.VIDEO;
CHAT_SOCKET.emitCreateMessage(sendData, 1);
}
$(".overlay").removeClass("active undismissable");
......@@ -256,9 +238,9 @@ CHAT.uploadImage = function (formData) {
CHAT.createGetDataUrl = function (fileName, roomId) {
var filePath =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/getImage?sid=" +
CHAT.globalLoginParameter.sid +
currentUserInfo.sid +
"&fileName=" +
fileName +
"&roomId=" +
......@@ -330,48 +312,14 @@ CHAT.createThumbnailAndUpload = function (sourceImage, callback) {
};
// 該当チャットルームに参加するためログイン情報をサーバに渡す
getLoginParameter = function (
sid,
loginId,
shopName,
roomId = undefined,
roomName = undefined,
languageCode,
shopMemberId
) {
var loginParam = new Object();
loginParam.sid = sid;
loginParam.loginId = loginId;
loginParam.shopName = shopName;
loginParam.roomId = roomId;
loginParam.roomName = roomName;
loginParam.shopMemberId = shopMemberId;
CHAT.globalLoginParameter = loginParam;
if (!languageCode) {
languageCode = "en";
}
// fermi coview share
globalUserInfo.sid = sid;
globalUserInfo.loginId = shopName + "_" + loginId;
globalUserInfo.shopName = shopName;
globalUserInfo.roomId = roomId;
globalUserInfo.roomName = roomName;
globalUserInfo.languageCode = languageCode;
CHAT_UI.htmlElementTextInitialize(languageCode);
getLoginParameter = function () {
CHAT_UI.htmlElementTextInitialize();
CHAT_UI.dismissLoadingIndicator();
console.log("peacekim:: getLoginParameter called and currentUserInfo: "+currentUserInfo);
console.log("peacekim:: getLoginParameter called and deviceInfo: "+deviceInfo);
console.log("peacekim:: getLoginParameter called and chatRoomInfo: "+roomInfo);
console.log("peacekim:: getLoginParameter called and serverInfo: "+serverInfo);
};
// for android native call
CHAT.leaveRoom = function () {
socket.emit("leaveRoom", function () {});
CHAT_SOCKET.emitLeaveRoom();
};
document.addEventListener("DOMContentLoaded", function () {
......@@ -476,7 +424,7 @@ document.addEventListener("DOMContentLoaded", function () {
$('#chat .search_form input[type="search"]').on(
"compositionend",
function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isIOS()) {
var rooms;
var keyword = $('#chat .search_form input[type="search"]').val();
CHAT.searchRoom(keyword, rooms);
......@@ -490,7 +438,7 @@ document.addEventListener("DOMContentLoaded", function () {
var afterWidth = window.innerWidth;
var moreScroll = beforeHeight - afterHeight;
if (beforeHeight > afterHeight && beforeHeight - afterHeight > 50) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
window.scrollTo(0, beforeScroll + moreScroll);
} else if (beforeWidth == afterWidth) {
//キーボード表示時
......@@ -508,7 +456,7 @@ document.addEventListener("DOMContentLoaded", function () {
}
} else if (beforeHeight < afterHeight) {
$(".room_container").css("margin-bottom", footerHeight);
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isIOS()) {
window.scrollTo(0, beforeScroll + moreScroll);
} else if (beforeWidth == afterWidth) {
//キーボード非表示
......@@ -558,7 +506,7 @@ document.addEventListener("DOMContentLoaded", function () {
$('.chat_room_src_form input[type="search"]').on(
"compositionend",
function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isIOS()) {
let workVal = "";
var keyword = $('.chat_room_src_form input[type="search"]').val();
CHAT.searchMessage(keyword, workVal);
......@@ -584,7 +532,7 @@ document.addEventListener("DOMContentLoaded", function () {
let jQueryMessages = $(".overlay_src_msg");
messages.forEach(function (message) {
let template = userMessageTemplate;
if (message.shopMemberId == CHAT.globalLoginParameter.shopMemberId) {
if (message.shopMemberId == currentUserInfo.shopMemberId) {
template = myMessageTemplate;
}
if (message.messageType == MessageType.SYSTEM) {
......@@ -602,7 +550,7 @@ document.addEventListener("DOMContentLoaded", function () {
var replacePath = message.message;
replacePath = replacePath.replaceAll(
"?fileName=",
"?sid=" + CHAT.globalLoginParameter.sid + "&fileName="
"?sid=" + currentUserInfo.sid + "&fileName="
);
message.message = replacePath;
......@@ -644,7 +592,7 @@ CHAT.searchRoom = function (keyword, rooms) {
var template = getTemplate(TemplateURL.ROOM_LIST);
rooms.forEach(function (room) {
room.profileImagePath = ASSET_PATH + "images/user-profile.png";
room.profileImagePath = "./images/user-profile.png";
const roomMessage = getRoomMessage(room.message);
const displayMessage = getDisplayMessage(room.messageType, roomMessage);
......@@ -733,7 +681,7 @@ CHAT.searchMessage = function (keyword, workVal) {
let jQueryMessages = $(".overlay_src_msg");
messages.forEach(function (message) {
let template = userMessageTemplate;
if (message.shopMemberId == CHAT.globalLoginParameter.shopMemberId) {
if (message.shopMemberId == currentUserInfo.shopMemberId) {
template = myMessageTemplate;
}
if (message.messageType == MessageType.SYSTEM) {
......@@ -749,7 +697,7 @@ CHAT.searchMessage = function (keyword, workVal) {
var replacePath = message.message;
replacePath = replacePath.replaceAll(
"?fileName=",
"?sid=" + CHAT.globalLoginParameter.sid + "&fileName="
"?sid=" + currentUserInfo.sid + "&fileName="
);
message.message = replacePath;
let html = Mustache.render(template, {
......
......@@ -88,7 +88,7 @@ var searchMember = function () {
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#chatMakeRoom .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
var keyword = searchInput.val();
CHAT_MAKE_ROOM.searchUser(keyword);
}
......
......@@ -90,3 +90,59 @@ function scroll_control(event) {
event.preventDefault();
}
}
CHAT_UI.confirmInviteUserListInCollaboration = function () {
var selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") {
$("#selectedUserListinCollaboration").html("");
var selectedUserList = NativeBridgeDataSource.loadSelectedUsers();
selectedUserList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
var modalTemplate;
$.get(
{ url: "./modal_add_user_confirm.html", async: false },
function (text) {
modalTemplate = text;
}
);
let html = Mustache.render(modalTemplate, {
userList: selectedUserList,
});
let obj = jQuery.parseHTML(html);
$("#modal_add_user_confirm").html(obj);
$("#modalAddUserConfirm").modal("show");
} else {
}
$("#cancelAddUserBtn")
.off()
.on("click", function () {
console.log("cancelClick");
$("#modalAddUserConfirm").modal("hide");
$("#addUserInCollaboration").modal("show");
});
$("#addUserBtn")
.off()
.on("click", function () {
CHAT_UI.showLoadingIndicator();
let userIdList = new Array();
selectedUserList.forEach(function (user) {
userIdList.push(user.shopMemberId);
});
const commaJoinedUserIDList = userIdList.join(",");
const collaborationType = CHAT_UTIL.getCollaborationType(
globalUserInfo.coWorkType
);
NativeBridgeDelegate.inviteCollaboration(
commaJoinedUserIDList,
collaborationType
);
CHAT_UI.dismissLoadingIndicator();
$("#modalAddUserConfirm").modal("hide");
});
};
......@@ -55,7 +55,7 @@ const HostRequestFlag = {
};
const PagingSize = {
MESSAGE: 100
MESSAGE: 100,
};
const InvitedFlag = {
......@@ -118,6 +118,9 @@ const SOCKET_KEY = {
SHOW_SERVER_ERROR: "showServerError",
RETRY_JOIN_PROCESS: "retryJoinProcess",
JOIN: "join",
CREATE_MESSAGE: "createMessage",
GET_GROUP_LIST: "getGroupList",
LEAVE_ROOM: "leaveRoom",
};
const NATIVE_KEY_IOS = {
......
......@@ -18,7 +18,7 @@ function callNativeApp(iosKey, jsonData) {
var NativeBridgeDataSource = {};
NativeBridgeDataSource.removeFavoriteGroup = function (groupID) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
const result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteGroup, {
groupId: groupID,
});
......@@ -53,24 +53,24 @@ NativeBridgeDataSource.getRoomType = function () {
//ロカールDBからルーム一覧情報を取得
NativeBridgeDataSource.getRoomList = function (roomType, keyWord) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, {
roomType: roomType,
keyWord: keyWord,
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
return JSON.parse(android.getRoomList(roomType, keyWord));
}
};
NativeBridgeDataSource.callGetRoomList = function (roomType) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, { roomType: roomType })
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList(roomType));
}
......@@ -78,101 +78,101 @@ NativeBridgeDataSource.callGetRoomList = function (roomType) {
//ロカールDBからログインしたユーザのデータを取得する。
NativeBridgeDataSource.getMyInfo = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyInfo, {}));
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyInfo());
}
};
NativeBridgeDataSource.getMessages = function (roomId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessages, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMessageList(roomId));
}
};
NativeBridgeDataSource.getMessagesWithMessageId = function (messageId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessageListFromMessageId, {
messageId: messageId,
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
return JSON.parse(android.getMessageListFromMessageId(messageId));
}
};
NativeBridgeDataSource.getFavoriteUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getFavoriteUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsersNotInRoom());
}
};
NativeBridgeDataSource.getFavoriteUsers = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsers());
}
};
NativeBridgeDataSource.getFavoriteGroups = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteGroups, {}));
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteGroups());
}
};
NativeBridgeDataSource.getMyGroupUsers = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyGroupUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsers());
}
};
NativeBridgeDataSource.getGroupInfo = function (groupId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfo, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfo(groupId));
}
};
NativeBridgeDataSource.getGroupInfoForAddUser = function (groupId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfoForAddUser, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfoForAddUser(groupId));
}
};
NativeBridgeDataSource.loadSelectedUsers = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getSelectedUserList, {}));
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
console.log(JSON.parse(android.getSelectedUserList()));
return JSON.parse(android.getSelectedUserList());
......@@ -180,25 +180,25 @@ NativeBridgeDataSource.loadSelectedUsers = function () {
};
NativeBridgeDataSource.getNameCardData = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getNameCardData, {
shopMemberId: shopMemberId,
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
return JSON.parse(android.getNameCardData(shopMemberId));
}
};
NativeBridgeDataSource.getMyGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupShopMemberByName(shopMemberName));
}
......@@ -207,13 +207,13 @@ NativeBridgeDataSource.getMyGroupShopMemberByName = function (shopMemberName) {
NativeBridgeDataSource.getMyGroupShopMemberNotInRoomByName = function (
shopMemberName
) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getMyGroupShopMemberNotInRoomByName(shopMemberName)
......@@ -222,13 +222,13 @@ NativeBridgeDataSource.getMyGroupShopMemberNotInRoomByName = function (
};
NativeBridgeDataSource.getAllGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getAllGroupShopMemberByName(shopMemberName));
}
......@@ -237,13 +237,13 @@ NativeBridgeDataSource.getAllGroupShopMemberByName = function (shopMemberName) {
NativeBridgeDataSource.getAllGroupShopMemberNotInRoomByName = function (
shopMemberName
) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getAllGroupShopMemberNotInRoomByName(shopMemberName)
......@@ -252,22 +252,22 @@ NativeBridgeDataSource.getAllGroupShopMemberNotInRoomByName = function (
};
NativeBridgeDataSource.getGroupByName = function (groupName) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupByName, { groupName: groupName })
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupByName(groupName));
}
};
NativeBridgeDataSource.getUsersInRoom = function (roomId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUsersInRoom, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUsersInRoom(roomId));
}
......@@ -275,56 +275,56 @@ NativeBridgeDataSource.getUsersInRoom = function (roomId) {
// アーカイブ一覧
NativeBridgeDataSource.getArchiveList = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getArchiveList, {}));
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
return JSON.parse(android.getArchiveList());
}
};
// アーカイブ一覧検索
NativeBridgeDataSource.getArchiveByName = function (archiveName) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveByName, {
archiveName: archiveName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
return JSON.parse(android.getArchiveListByName(archiveName));
}
};
// アーカイブ詳細
NativeBridgeDataSource.getArchiveDetail = function (archiveId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveDetail, { archiveId: archiveId })
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
return JSON.parse(android.getArchiveDetail(archiveId));
}
};
NativeBridgeDataSource.searchMessages = function (keyword, userList) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.searchMessages, {
keyWord: keyword,
userList: userList,
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
return JSON.parse(android.searchMessages(keyword, userList));
}
};
NativeBridgeDataSource.getMyGroupUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsersNotInRoom());
}
......@@ -334,11 +334,11 @@ NativeBridgeDataSource.getUserInfo = function (shopMemberId) {
if (shopMemberId == "") {
return;
}
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserInfo, { shopMemberId: shopMemberId })
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUserInfo(shopMemberId));
}
......@@ -346,19 +346,19 @@ NativeBridgeDataSource.getUserInfo = function (shopMemberId) {
NativeBridgeDataSource.getUserListByLoginId = function (loginIdList) {
console.log(loginIdList);
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserListByLoginId, {
loginIdList: loginIdList.join(","),
})
);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
return JSON.parse(android.getUserListByLoginId(loginIdList.join(",")));
}
};
NativeBridgeDataSource.getBeforeRoomType = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return callNativeApp(NATIVE_KEY_IOS.getBeforeRoomType, {});
} else {
return android.getBeforeRoomType();
......@@ -366,7 +366,7 @@ NativeBridgeDataSource.getBeforeRoomType = function () {
};
NativeBridgeDataSource.removeFavoriteUser = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteUser, {
shopMemberId: shopMemberId,
});
......@@ -381,7 +381,7 @@ NativeBridgeDataSource.removeFavoriteUser = function (shopMemberId) {
};
NativeBridgeDataSource.addFavoriteUser = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteUser, {
shopMemberId: shopMemberId,
});
......@@ -396,7 +396,7 @@ NativeBridgeDataSource.addFavoriteUser = function (shopMemberId) {
};
NativeBridgeDataSource.getJoinCollaborationType = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return parseInt(
callNativeApp(NATIVE_KEY_IOS.getJoinCollaborationType, {}),
10
......@@ -407,7 +407,7 @@ NativeBridgeDataSource.getJoinCollaborationType = function () {
};
NativeBridgeDataSource.getCollaborationJoinFlg = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return callNativeApp(NATIVE_KEY_IOS.getCollaborationJoinFlg, {});
} else {
return android.getCollaborationJoinFlg();
......@@ -415,7 +415,7 @@ NativeBridgeDataSource.getCollaborationJoinFlg = function () {
};
NativeBridgeDataSource.getUserInfoList = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return callNativeApp(NATIVE_KEY_IOS.getUserInfoList, {
shopMemberId: shopMemberId,
});
......@@ -425,7 +425,7 @@ NativeBridgeDataSource.getUserInfoList = function (shopMemberId) {
};
NativeBridgeDataSource.createContentView = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.createContentView, {}));
} else {
return android.createContentView();
......@@ -433,7 +433,7 @@ NativeBridgeDataSource.createContentView = function () {
};
NativeBridgeDataSource.getToMoveGroupId = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return callNativeApp(NATIVE_KEY_IOS.getToMoveGroupId, {});
} else {
return android.getToMoveGroupId();
......@@ -441,7 +441,7 @@ NativeBridgeDataSource.getToMoveGroupId = function () {
};
NativeBridgeDataSource.getHostRequestFlg = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getHostRequestFlg, {}), 10);
} else {
return android.getHostRequestFlg();
......
......@@ -67,7 +67,7 @@ NativeBridgeDelegate.createChatRoom = function (
};
NativeBridgeDelegate.updateContactInfo = function () {
if (IS_ONLINE != "true") {
if (serverInfo.isOnline != "true") {
return;
}
NativeBridgeDelegate.updateGroupInfo("0");
......@@ -83,7 +83,7 @@ NativeBridgeDelegate.updateContactInfo = function () {
};
NativeBridgeDelegate.updateGroupInfo = function (groupID) {
if (IS_ONLINE == "true") {
if (serverInfo.isOnline == "true") {
if (typeof android != "undefined") {
// TODO: peacekim:: check this method is right or not
android.updateGroupUser();
......@@ -97,12 +97,12 @@ NativeBridgeDelegate.joinCollaboration = function (
collaborationType,
meetingId = 0
) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.joinCollaboration.postMessage({
collaborationType: collaborationType,
meetingId: meetingId,
});
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
if (
collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
......@@ -151,14 +151,14 @@ NativeBridgeDelegate.saveSelectedUserList = function (selectedUserList) {
NativeBridgeDelegate.startPIPMode = function () {
if (typeof android != "undefined") {
android.startPipMode();
} else if (CHAT_UTIL.isIOS()) {
} else if (deviceInfo.isiOS()) {
webkit.messageHandlers.startPipMode.postMessage({});
}
};
NativeBridgeDelegate.finishPIPMode = function (needsAndroid = false) {
// not for android
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.finishPipMode.postMessage({});
} else if (needsAndroid && typeof android != "undefined") {
android.finishPip();
......@@ -166,7 +166,7 @@ NativeBridgeDelegate.finishPIPMode = function (needsAndroid = false) {
};
NativeBridgeDelegate.setHostRequestFlg = function (hostRequestFlag) {
if (CHAT_UTIL.isAndroid()) {
if (deviceInfo.isAndroid()) {
android.setHostRequestFlg(hostRequestFlag);
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(hostRequestFlag);
......@@ -182,32 +182,32 @@ NativeBridgeDelegate.setToMoveGroupId = function (groupID) {
};
NativeBridgeDelegate.updateArchiveList = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.updateArchiveList.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.updateArchiveList();
}
};
NativeBridgeDelegate.updateArchiveDetail = function (archiveId) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.updateArchiveDetail.postMessage(archiveId);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.updateArchiveDetail(archiveId);
}
};
NativeBridgeDelegate.goHome = function () {
if (CHAT_UTIL.isAndroid()) {
if (deviceInfo.isAndroid()) {
android.goHome();
} else if (CHAT_UTIL.isIOS()) {
} else if (deviceInfo.isiOS()) {
webkit.messageHandlers.goHome.postMessage({});
}
};
NativeBridgeDelegate.updatePreMessage = function (messageId) {
if (typeof android != "undefined") {
if (IS_ONLINE == "true") {
if (serverInfo.isOnline == "true") {
android.updatePreMessage(messageId);
}
} else {
......@@ -219,23 +219,23 @@ NativeBridgeDelegate.updatePreMessage = function (messageId) {
};
NativeBridgeDelegate.changeRoomName = function (newRoomName) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.changeRoomName.postMessage(newRoomName);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.changeRoomName(newRoomName);
}
};
NativeBridgeDelegate.startCollaboration = function (type) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.startCollaboration.postMessage(type);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.startCollaboration(type);
}
};
NativeBridgeDelegate.finishCollaboration = function (needsAndroid = false) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.finishCollaboration.postMessage({});
} else if (needsAndroid) {
android.finishCollaboration();
......@@ -243,9 +243,9 @@ NativeBridgeDelegate.finishCollaboration = function (needsAndroid = false) {
};
NativeBridgeDelegate.finishAllCollaboration = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.finishAllCollaboration.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.finishAllCollaboration();
}
};
......@@ -281,12 +281,12 @@ NativeBridgeDelegate.updateMessages = function (roomID) {
};
NativeBridgeDelegate.saveVisitRoomInfo = function (roomID = "", roomName = "") {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.roomInfosaveMessageHandlerId.postMessage({
roomId: roomID,
roomName: roomName,
});
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
if (roomId == undefined && roomName == undefined) {
android.saveVisitRoomInfo("", "");
} else {
......@@ -296,9 +296,9 @@ NativeBridgeDelegate.saveVisitRoomInfo = function (roomID = "", roomName = "") {
};
NativeBridgeDelegate.exitMeetingRoom = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.exitMeetingRoom.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.exitMeetingRoom();
}
};
......@@ -307,20 +307,20 @@ NativeBridgeDelegate.joinChangedCollaboration = function (
joinCollaborationType,
meetingID
) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.joinChangedCollaboration.postMessage({
joinCollaborationType: joinCollaborationType,
meetingId: meetingID,
});
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.joinChangedCollaboration(joinCollaborationType, meetingID);
}
};
NativeBridgeDelegate.joinMeetingRoom = function (meetingID) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.joinMeetingRoom.postMessage(meetingID);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.joinMeetingRoom(meetingID);
}
};
......@@ -329,9 +329,9 @@ NativeBridgeDelegate.setJoinCollaborationType = function (
type,
androidVersion
) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.setJoinCollaborationType.postMessage(type);
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
if (
type == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
......@@ -344,27 +344,27 @@ NativeBridgeDelegate.setJoinCollaborationType = function (
};
NativeBridgeDelegate.showExitHostAlert = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.showExitHostAlert.postMessage({});
}
// TODO: peacekim:: check not to need this method for android
};
NativeBridgeDelegate.startContentView = function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.startContentView.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.startContentView();
}
};
NativeBridgeDelegate.changeCollaboration = function (type, meetingID) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.changeCollaboration.postMessage({
changeCollaborationType: type,
meetingId: meetingID,
});
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
android.changeCollaboration(type, meetingID);
}
};
......@@ -46,7 +46,7 @@ CONTACT.searchUser = function (keyword) {
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#contact .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
var keyword = searchInput.val();
CONTACT.searchUser(keyword);
}
......
......@@ -128,7 +128,7 @@ document.addEventListener("DOMContentLoaded", function () {
NativeBridgeDelegate.exitMeetingRoom();
NativeBridgeDelegate.finishPIPMode(true);
if (CHAT_UTIL.isAndroid()) {
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
......@@ -137,7 +137,7 @@ document.addEventListener("DOMContentLoaded", function () {
}
if (
CHAT_UTIL.isAndroid() &&
deviceInfo.isAndroid() &&
data.payload.collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
) {
......@@ -180,13 +180,13 @@ document.addEventListener("DOMContentLoaded", function () {
recordStop(function () {
$("#screenLock").remove();
captureAndShareImage(
CMS_SERVER_URL + "/chatapi/file/uploadArchive",
serverInfo.cmsURL + "/chatapi/file/uploadArchive",
data.payload.name
);
});
} else {
captureAndShareImage(
CMS_SERVER_URL + "/chatapi/file/uploadArchive",
serverInfo.cmsURL + "/chatapi/file/uploadArchive",
data.payload.name
);
}
......@@ -194,9 +194,9 @@ document.addEventListener("DOMContentLoaded", function () {
} else if (data.type === "HOST_CHANGE_REQUEST") {
if (data.payload.loginId == globalUserInfo.loginId) {
fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", {
isAndroid: CHAT_UTIL.isAndroid(),
isAndroid: deviceInfo.isAndroid(),
isAble: androidVersion >= ANDROID_SDK_VERSION.O,
loginId: CHAT.globalLoginParameter.loginId,
loginId: currentUserInfo.loginId,
});
}
} else if (data.type === "HOST_CHANGE_RESPONSE") {
......@@ -223,7 +223,7 @@ document.addEventListener("DOMContentLoaded", function () {
joinCollaborationType == COLLABORATION_TYPE.DOCUMENT
) {
NativeBridgeDelegate.finishPIPMode(true);
if (CHAT_UTIL.isAndroid()) {
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
}
......@@ -248,7 +248,7 @@ document.addEventListener("DOMContentLoaded", function () {
if (g_isMainMan) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
NativeBridgeDelegate.finishPIPMode(true);
if (CHAT_UTIL.isAndroid()) {
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
}
......@@ -279,7 +279,7 @@ document.addEventListener("DOMContentLoaded", function () {
} else if (data.type === "HOST_REQUEST_DONE") {
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
} else if (data.type === "HOST_REQUEST_REJECT") {
if (data.payload.hostId == CHAT.globalLoginParameter.loginId) {
if (data.payload.hostId == currentUserInfo.loginId) {
alert("REJECT for owner user");
}
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
......@@ -293,7 +293,7 @@ document.addEventListener("DOMContentLoaded", function () {
console.log(data.payload.newMeetingId);
if (data.payload.loginId == globalUserInfo.loginId) {
if (
CHAT_UTIL.isAndroid() &&
deviceInfo.isAndroid() &&
data.payload.collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
) {
......@@ -339,23 +339,20 @@ document.addEventListener("DOMContentLoaded", function () {
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
isDocument = true;
}
if (CHAT_UTIL.isAndroid()) {
if (deviceInfo.isAndroid()) {
android.setExitHostAlert();
}
if (isDocument) {
NativeBridgeDelegate.exitMeetingRoom();
}
if (isInvited == InvitedFlag.NONE) {
NativeBridgeDelegate.joinRoom(
CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name
);
NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName);
} else {
NativeBridgeDelegate.openCommunicationHome();
}
console.log("=============> HOST BYE : share hostbye");
// TODO: peacekim:: check not to need this method for android
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
NativeBridgeDelegate.showExitHostAlert();
return;
}
......@@ -451,13 +448,7 @@ document.addEventListener("DOMContentLoaded", function () {
messageSeperator +
CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType);
}
socket.emit(
"createMessage",
{
text: coviewInviteMessage,
},
0
);
CHAT_SOCKET.emitCreateMessage(coviewInviteMessage, 0);
} else {
}
break;
......@@ -468,10 +459,7 @@ document.addEventListener("DOMContentLoaded", function () {
coview_api.LeaveRoom();
$(".coview_share_area").hide();
$("#loadingIndicator").removeClass("full_active");
NativeBridgeDelegate.joinRoom(
CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name
);
NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName);
}
break;
case "JoinRoomResponse":
......@@ -592,7 +580,7 @@ function changeCollaboration(changeCollaborationType) {
}
var scrollLock = function (e) {
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
if (
$(e.target).closest(".add_user_modal").length > 0 ||
$(e.target).closest("#overlay_user_list").length > 0 ||
......@@ -689,10 +677,7 @@ function Coview_finishCollaboration() {
}
isLeaved = true;
if (isInvited == InvitedFlag.NONE) {
NativeBridgeDelegate.joinRoom(
CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name
);
NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName);
} else {
NativeBridgeDelegate.openCommunicationHome();
}
......@@ -728,7 +713,7 @@ function applyForHostChange() {
if (
joinCollaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O &&
CHAT_UTIL.isAndroid()
deviceInfo.isAndroid()
) {
alert(getLocalizedString("not_support_version"));
return;
......@@ -742,7 +727,7 @@ function applyForHostChange() {
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING);
fw.sendToMsg("others", "CHANGE_HOST_APPLY", {
hostId: CHAT.globalLoginParameter.loginId,
hostId: currentUserInfo.loginId,
});
}
......@@ -759,9 +744,7 @@ function hostSearchInterval() {
let hostName = "";
function hostSearch() {
if (g_isMainMan) {
$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).addClass(
"host"
);
$("#collaboration_user_" + currentUserInfo.loginId).addClass("host");
$(".host_contents").removeClass("none");
if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").removeClass("none");
......@@ -770,11 +753,9 @@ function hostSearchInterval() {
$(".video_contents_host").removeClass("none");
$(".video_contents_user").addClass("none");
}
if (CHAT_UTIL.isIOS()) isIos = true;
if (deviceInfo.isiOS()) isIos = true;
} else {
$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).removeClass(
"host"
);
$("#collaboration_user_" + currentUserInfo.loginId).removeClass("host");
$(".host_contents").addClass("none");
if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").addClass("none");
......@@ -797,14 +778,12 @@ function hostSearchInterval() {
} else {
if (hostName == "") {
if (
!$(
"#collaboration_user_" + CHAT.globalLoginParameter.loginId
).hasClass("host") &&
!$("#collaboration_user_" + currentUserInfo.loginId).hasClass(
"host"
) &&
coview_api.getRoomUsers()
) {
$(
"#collaboration_user_" + CHAT.globalLoginParameter.loginId
).addClass("host");
$("#collaboration_user_" + currentUserInfo.loginId).addClass("host");
}
} else {
if (
......@@ -998,7 +977,7 @@ function recordStop(callback) {
// アーカイブ保存処理
MainManRecordWithCollaboration(
"stop",
CMS_SERVER_URL + "/chatapi/file/uploadArchive",
serverInfo.cmsURL + "/chatapi/file/uploadArchive",
callback
);
}
......@@ -1077,13 +1056,8 @@ function delete_dom_obj(id_name) {
function requestCollaborationFinish() {
if (socket != null && socket.connected) {
socket.emit(
"createMessage",
{
text: DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL,
},
0
);
const sendData = DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL;
CHAT_SOCKET.emitCreateMessage(sendData, 0);
}
}
......@@ -1110,14 +1084,14 @@ function captureToggle() {
screenLock();
recordStop(function () {
$("#screenLock").remove();
coview_api.Capture(CMS_SERVER_URL + "/chatapi/file/uploadArchive");
coview_api.Capture(serverInfo.cmsURL + "/chatapi/file/uploadArchive");
});
} else {
coview_api.Capture(CMS_SERVER_URL + "/chatapi/file/uploadArchive");
coview_api.Capture(serverInfo.cmsURL + "/chatapi/file/uploadArchive");
}
}
function captureRequestToggle() {
fw.sendToMsg("others", "CAPTURE_REQUEST", {
name: CHAT.globalLoginParameter.loginId,
name: currentUserInfo.loginId,
});
}
......@@ -59,7 +59,9 @@ var addCollaborationMessage = function (
) {
const collaborationType = messageInfo[2];
const meetingID = getMeetingID(collaborationType, messageInfo);
const userInCollaboration = JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
const userInCollaboration = JSON.parse(
NativeBridgeDataSource.getUserInfoList(userID)
);
userInCollaboration.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
......@@ -187,7 +189,7 @@ var insertSID = function (text) {
let replacePath = text;
replacePath = replacePath.replaceAll(
"?fileName=",
"?sid=" + CHAT.globalLoginParameter.sid + "&fileName="
"?sid=" + currentUserInfo.sid + "&fileName="
);
return replacePath;
};
......
var bindOnRefreshGroupList = function () {
// Update Group List(Invite)
socket.on(SOCKET_KEY.REFRESH_GROUPLIST, function (groups, isInvite) {
const groupListElement = $("#group_list");
groupListElement.html("");
if (groups.length === 0) {
groupListElement.append(
'<center class="text-secondary">' +
getLocalizedString(everyoneIsHere) +
"</center>"
);
}
updateTopBar();
});
};
var updateTopBar = function () {
$("#newRoomName").hide();
};
......@@ -10,14 +10,14 @@ CHAT_SOCKET.socketCheck = function () {
};
CHAT_SOCKET.connectSocket = function () {
if (IS_ONLINE == "true") {
socket = io(CHAT_SERVER_URL);
if (serverInfo.isOnline == "true") {
socket = io(serverInfo.chatURL);
setSocketAction();
} else {
//オフラインの場合、DBからルーム一覧を表示。
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
//TODO IOSの場合
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
}
}
};
......@@ -84,6 +84,24 @@ var bindOnNewNotification = function () {
});
};
var bindOnRefreshGroupList = function () {
// Update Group List(Invite)
socket.on(SOCKET_KEY.REFRESH_GROUPLIST, function (groups, isInvite) {
const groupListElement = $("#group_list");
groupListElement.html("");
if (groups.length === 0) {
groupListElement.append(
'<center class="text-secondary">' +
getLocalizedString(everyoneIsHere) +
"</center>"
);
}
$("#newRoomName").hide();
});
};
var bindOnShowServerError = function () {
socket.on(SOCKET_KEY.SHOW_SERVER_ERROR, function (message) {
// #36215
......@@ -117,26 +135,36 @@ var bindOnShowServerError = function () {
var bindOnRetryJoinProcess = function () {
socket.on(SOCKET_KEY.RETRY_JOIN_PROCESS, function () {
if (CHAT_UTIL.isIOS() || CHAT_UTIL.isAndroid()) {
if (deviceInfo.isiOS() || deviceInfo.isAndroid()) {
NativeBridgeDelegate.getLoginParameter();
} else {
CHAT_UI.htmlElementTextInitialize("ko");
currentUserInfo.configureLanguage();
// webでのsocket connect
emitJoin();
CHAT_SOCKET.emitJoin(params, true, true);
}
});
};
var emitJoin = function () {
socket.emit(SOCKET_KEY.JOIN, params, function (err) {
CHAT_SOCKET.emitJoin = function (
joinInfo,
needsDismissLoadingIndicator,
needsHandlingError
) {
socket.emit(SOCKET_KEY.JOIN, joinInfo, function (err) {
if (err) {
if (needsHandlingError) {
errorHandlingForEmitJoin();
}
if (needsDismissLoadingIndicator) {
CHAT_UI.dismissLoadingIndicator();
}
return;
}
if (needsDismissLoadingIndicator) {
// loadingIndicatorを表示しない
CHAT_UI.dismissLoadingIndicator();
}
});
};
......@@ -161,7 +189,22 @@ var bindOnRefreshUserListInGroup = function () {
socket.on(
SOCKET_KEY.REFRESH_USERLIST_INGROUP,
function (users, groupId, isInvite) {
console.log(SOCKET_KEY.REFRESH_USERLIST_INGROUP + "message received but it does nothing.");
console.log(
SOCKET_KEY.REFRESH_USERLIST_INGROUP +
"message received but it does nothing."
);
}
);
};
CHAT_SOCKET.emitCreateMessage = function (sendData, offset) {
socket.emit(SOCKET_KEY.CREATE_MESSAGE, { text: sendData }, offset);
};
CHAT_SOCKET.emitGetGroupList = function (isInvite) {
socket.emit(SOCKET_KEY.GET_GROUP_LIST, isInvite);
};
CHAT_SOCKET.emitLeaveRoom = function () {
socket.emit(SOCKET_KEY.LEAVE_ROOM, function () {});
};
......@@ -79,7 +79,6 @@ $("#video-form").on("submit", function (e) {
}
});
// this method call from android only for now
CHAT_UI.videoEncodeFail = function () {
alert(getLocalizedString("error_send_video"));
......@@ -96,12 +95,12 @@ CHAT_UI.videoEncodeEnd = function (encodedUri) {
xhr.addEventListener("load", function () {
var formData = new FormData();
formData.append("image", xhr.response, fileName);
formData.append("sid", CHAT.globalLoginParameter.sid);
formData.append("roomId", CHAT.globalLoginParameter.roomId);
formData.append("sid", currentUserInfo.sid);
formData.append("roomId", roomInfo.roomID);
jQuery
.ajax({
async: true,
url: CMS_SERVER_URL + "/chatapi/file/upload",
url: serverInfo.cmsURL + "/chatapi/file/upload",
type: "post",
data: formData,
contentType: false,
......@@ -112,15 +111,15 @@ CHAT_UI.videoEncodeEnd = function (encodedUri) {
},
})
.done(function (res) {
if (CHAT_UTIL.isAndroid()) {
if (deviceInfo.isAndroid()) {
android.removeEncodedVideo(encodedUri);
}
var imgPath =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/getImage?fileName=" +
res.fileName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
var imageName = res.fileName;
// uploadFileの判断
......@@ -130,24 +129,24 @@ CHAT_UI.videoEncodeEnd = function (encodedUri) {
if (res.thumbnailPath && res.thumbnailPath.length > 0) {
imgPath =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/getImage?fileName=" +
res.thumbImageFileName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
}
let downloadPath =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/download?fileName=" +
imageName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
var videoSrc =
CMS_SERVER_URL +
serverInfo.cmsURL +
"/chatapi/file/getImage?fileName=" +
res.fileName +
"&roomId=" +
CHAT.globalLoginParameter.roomId;
roomInfo.roomID;
const totalDiv = $("<div/>", { id: "attachedImages" });
const videoTag = $("<video/>", {
controls: "true",
......@@ -170,13 +169,8 @@ CHAT_UI.videoEncodeEnd = function (encodedUri) {
} catch (e) {
encodedText = text;
}
socket.emit(
"createMessage",
{
text: encodedText + messageSeperator + MessageType.VIDEO,
},
1
);
const sendData = encodedText + messageSeperator + MessageType.VIDEO;
CHAT_SOCKET.emitCreateMessage(sendData, 1);
$(".overlay").removeClass("active undismissable");
$(".loader").removeClass("active");
......
// 名前空間
var CHAT_UTIL = {};
CHAT_UTIL.isAndroid = function () {
return PLATFORM == "android";
};
CHAT_UTIL.isIOS = function () {
return PLATFORM == "ios";
};
CHAT_UTIL.isMobile = function () {
return IS_MOBILE == "true";
};
CHAT_UTIL.formatDate = function (date) {
const REFERENCE = moment();
const TODAY = REFERENCE.clone().startOf("day");
......
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