Commit f75d3558 by Kim Peace

Changed getGlobalParam to LoginInfo, Device Info and ServerInfo

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