Commit 6d617479 by Kim Peace

Merge branch 'refactoring/prettier' into 'develop'

Refactoring/prettier

See merge request !172
parents b8fab3f1 a1bee735
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script id="archive-template" type="text/template"> <script id="archive-template" type="text/template">
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
......
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script id="archive-detail-template" type="text/template"> <script id="archive-detail-template" type="text/template">
<div id="archive_player" class="player"> <div id="archive_player" class="player">
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script> <script>
String.prototype.replaceAll = function(org, dest) { String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
...@@ -142,7 +143,7 @@ ...@@ -142,7 +143,7 @@
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
console.log("onChat"); console.log("onChat");
CHAT_UI.refreshRoomList(chatRoomType.GROUP); CHAT_UI.refreshRoomList(ChatRoomType.GROUP);
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}; };
</script> </script>
......
...@@ -142,6 +142,7 @@ ...@@ -142,6 +142,7 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script src="./js/chat-add-user.js"></script> <script src="./js/chat-add-user.js"></script>
<script> <script>
String.prototype.replaceAll = function(org, dest) { String.prototype.replaceAll = function(org, dest) {
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script> <script>
String.prototype.replaceAll = function(org, dest) { String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
......
...@@ -43,8 +43,11 @@ ...@@ -43,8 +43,11 @@
<main id="chat_change_room_name"> <main id="chat_change_room_name">
<!-- ルーム名入力 --> <!-- ルーム名入力 -->
<div class="room_name"> <div class="room_name">
<label for="room_name"><h2>ルーム名</h2></label> <label for="room_name">
<input type="text" class="input_name_room" name="room_name" placeholder="ルーム名を入力してください" id="roomNameInput" maxlength="20"> <h2>ルーム名</h2>
</label>
<input type="text" class="input_name_room" name="room_name" placeholder="ルーム名を入力してください" id="roomNameInput"
maxlength="20">
</div> </div>
<!-- ルーム名変更ボタン --> <!-- ルーム名変更ボタン -->
...@@ -72,10 +75,14 @@ ...@@ -72,10 +75,14 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script src="./js/chat-websocket.js"></script> <script src="./js/chat-websocket.js"></script>
<script src="./js/chat-websocket-message.js"></script>
<script src="./js/chat-websocket-refresh-group-list.js"></script>
<script src="./js/chat-websocket-refresh-user-list-in-group.js"></script>
<script src="./js/chat-room.js"></script> <script src="./js/chat-room.js"></script>
<script> <script>
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 CHAT_SERVER_URL = '';
...@@ -86,7 +93,7 @@ ...@@ -86,7 +93,7 @@
let IS_ONLINE = false; let IS_ONLINE = false;
let roomId = 0; let roomId = 0;
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter(); android.getLoginParameter();
android.getGlobalParameter(); android.getGlobalParameter();
} else { } else {
......
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script> <script>
String.prototype.replaceAll = function(org, dest) { String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
......
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script> <script>
String.prototype.replaceAll = function(org, dest) { String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
<div class="col-4 pl-0"> <div class="col-4 pl-0">
<div class="nav-item text-right"> <div class="nav-item text-right">
<a href="#" class="search_menu"><img src="icon/icon_search.png" alt="検索"></a> <a href="#" class="search_menu"><img src="icon/icon_search.png" alt="検索"></a>
<a href="#" data-toggle="modal" data-target="#menuModalCenter" id="roomMenu" class="none"><img src="icon/icon_room_menu.png" alt="メニュー"></a> <a href="#" data-toggle="modal" data-target="#menuModalCenter" id="roomMenu" class="none"><img
src="icon/icon_room_menu.png" alt="メニュー"></a>
</div> </div>
</div><!-- .col --> </div><!-- .col -->
</div><!-- .row --> </div><!-- .row -->
...@@ -94,8 +95,10 @@ ...@@ -94,8 +95,10 @@
<input class="d-none" type="file" name="image" id="videoInputTag" accept="video/mp4"> <input class="d-none" type="file" name="image" id="videoInputTag" accept="video/mp4">
</form> </form>
</div> </div>
<input type="text" name="message" class="message_input_form" id="messageInput" placeholder="メッセージを入力してください" maxlength="600"> <input type="text" name="message" class="message_input_form" id="messageInput" placeholder="メッセージを入力してください"
<button type="button" name="button" class="message_input_send none" id="messageSend" onclick="CHAT_UI.sendMessage(this);">送信</button> maxlength="600">
<button type="button" name="button" class="message_input_send none" id="messageSend"
onclick="CHAT_UI.sendMessage(this);">送信</button>
</div> </div>
</div> </div>
<!-- フッター下 --> <!-- フッター下 -->
...@@ -160,7 +163,11 @@ ...@@ -160,7 +163,11 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script src="./js/chat-websocket.js"></script> <script src="./js/chat-websocket.js"></script>
<script src="./js/chat-websocket-message.js"></script>
<script src="./js/chat-websocket-refresh-group-list.js"></script>
<script src="./js/chat-websocket-refresh-user-list-in-group.js"></script>
<script src="./js/chat-room.js"></script> <script src="./js/chat-room.js"></script>
<script> <script>
function imageModal(image) { function imageModal(image) {
...@@ -168,7 +175,7 @@ ...@@ -168,7 +175,7 @@
$('#pictureModalCenter').modal('show'); $('#pictureModalCenter').modal('show');
} }
String.prototype.replaceAll = function(org, dest) { String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
} }
...@@ -183,7 +190,7 @@ ...@@ -183,7 +190,7 @@
$("#chatMenuModal").load("./modal_chat_menu.html"); $("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter(); android.getLoginParameter();
android.getGlobalParameter(); android.getGlobalParameter();
android.saveSelectedUserList(""); android.saveSelectedUserList("");
......
...@@ -27,10 +27,12 @@ ...@@ -27,10 +27,12 @@
</div> </div>
<div class="collabo_nav_r"> <div class="collabo_nav_r">
<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 user_btn collaboration_contents picture_contents video_contents board_contents"></button> <button type="button" name="button"
class="btn user_btn collaboration_contents picture_contents video_contents board_contents"></button>
<button type="button" name="button" class="btn add_user_btn none"></button> <button type="button" name="button" class="btn add_user_btn none"></button>
<button type="button" name="button" class="btn menu_btn host_contents"></button> <button type="button" name="button" class="btn menu_btn host_contents"></button>
<button type="button" name="button" class="btn start_pip_btn collaboration_contents document_contents" onclick="startPipMode();"></button> <button type="button" name="button" class="btn start_pip_btn collaboration_contents document_contents"
onclick="startPipMode();"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="Coview_exitCollaboration();"></button> --> <!-- <button type="button" name="button" class="btn exit_btn" onclick="Coview_exitCollaboration();"></button> -->
</div> </div>
</div> </div>
...@@ -57,7 +59,7 @@ ...@@ -57,7 +59,7 @@
<!-- ユーザー追加オーバーレイ --> <!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm" ></div> <div id="modal_add_user_confirm"></div>
<!-- オーバーレイ メニュー --> <!-- オーバーレイ メニュー -->
<div id="collaboration_picture_overlay_menu"></div> <div id="collaboration_picture_overlay_menu"></div>
...@@ -169,11 +171,15 @@ ...@@ -169,11 +171,15 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script src="./js/language.js"></script> <script src="./js/language.js"></script>
<script src="./js/language_ko.js" charset="UTF-8"></script> <script src="./js/language_ko.js" charset="UTF-8"></script>
<script src="./js/language_ja.js" charset="UTF-8"></script> <script src="./js/language_ja.js" charset="UTF-8"></script>
<script src="./js/language_en.js" charset="UTF-8"></script> <script src="./js/language_en.js" charset="UTF-8"></script>
<script src="./js/chat-websocket.js"></script> <script src="./js/chat-websocket.js"></script>
<script src="./js/chat-websocket-message.js"></script>
<script src="./js/chat-websocket-refresh-group-list.js"></script>
<script src="./js/chat-websocket-refresh-user-list-in-group.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>
...@@ -198,7 +204,7 @@ ...@@ -198,7 +204,7 @@
let joinMeetingId = 0; let joinMeetingId = 0;
let androidVersion = 0; let androidVersion = 0;
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter(); android.getLoginParameter();
android.getGlobalParameter(); android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
...@@ -208,12 +214,12 @@ ...@@ -208,12 +214,12 @@
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
if (roomType == chatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
function startPipMode() { function startPipMode() {
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.startPipMode(); android.startPipMode();
} else { } else {
webkit.messageHandlers.startPipMode.postMessage({}); webkit.messageHandlers.startPipMode.postMessage({});
...@@ -226,7 +232,7 @@ ...@@ -226,7 +232,7 @@
} }
} }
String.prototype.replaceAll = function(org, dest) { String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
} }
...@@ -253,10 +259,11 @@ ...@@ -253,10 +259,11 @@
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() { socket.emit('join', CHAT.globalLoginParameter, function () {
}); });
} }
}; };
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
</head> </head>
<body> <body>
<!-- ナビメニュー --> <!-- ナビメニュー -->
<header id="collabo_header"> <header id="collabo_header">
<div class="d-flex align-items-center h-100"> <div class="d-flex align-items-center h-100">
<div class="collabo_nav_l text-left w-100"> <div class="collabo_nav_l text-left w-100">
</div> </div>
...@@ -33,65 +33,69 @@ ...@@ -33,65 +33,69 @@
</div> </div>
</div> </div>
</div> </div>
</header><!-- header --> </header><!-- header -->
<!-- コンテンツ --> <!-- コンテンツ -->
<main id="collabo_main" class="none"> <main id="collabo_main" class="none">
<div class="document_wrap"> <div class="document_wrap">
<div class="coview_share_body coview_share_area" id="coviewShare" style="z-index: 1;"> <div class="coview_share_body coview_share_area" id="coviewShare" style="z-index: 1;">
</div> </div>
</div> </div>
</main> </main>
<!-- オーバーレイ メニュー --> <!-- オーバーレイ メニュー -->
<div id="collaboration_voice_overlay_menu"></div> <div id="collaboration_voice_overlay_menu"></div>
<!-- オーバーレイ ユーザーリスト --> <!-- オーバーレイ ユーザーリスト -->
<div id="overlay_user_list" class="overlay slidein" style="z-index: 3;"> <div id="overlay_user_list" class="overlay slidein" style="z-index: 3;">
<div id="collaboration_overlay_user_list"></div> <div id="collaboration_overlay_user_list"></div>
</div> </div>
<!-- プロフィールモーダル --> <!-- プロフィールモーダル -->
<div id="userProfileModalInCollaboration"></div> <div id="userProfileModalInCollaboration"></div>
<div id="modal_collabo_profile2"></div> <div id="modal_collabo_profile2"></div>
<div id="add_user_list" ></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm" ></div> <div id="modal_add_user_confirm"></div>
<!-- ホスト変更モーダル --> <!-- ホスト変更モーダル -->
<div id="modal_collabo_change_host"></div> <div id="modal_collabo_change_host"></div>
<!-- ホストリクエストモーダル --> <!-- ホストリクエストモーダル -->
<div id="modal_collabo_host_request"></div> <div id="modal_collabo_host_request"></div>
<!-- フッター --> <!-- フッター -->
<div id="footer_collabo"></div> <div id="footer_collabo"></div>
<div id="loadingArea"></div> <div id="loadingArea"></div>
<div class="pip_indicator none" onclick="finishPipMode();"> <div class="pip_indicator none" onclick="finishPipMode();">
<div style="vertical-align: middle;display: table-cell;">協業中 <div style="vertical-align: middle;display: table-cell;">協業中
</div> </div>
</div> </div>
<script src="./js/libs/jquery-3.3.1.min.js"></script> <script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/socket.io.js"></script> <script src="./js/libs/socket.io.js"></script>
<script src="./js/libs/moment.js"></script> <script src="./js/libs/moment.js"></script>
<script src="./js/libs/locale/ko.js" charset="UTF-8"></script> <script src="./js/libs/locale/ko.js" charset="UTF-8"></script>
<script src="./js/libs/locale/ja.js" charset="UTF-8"></script> <script src="./js/libs/locale/ja.js" charset="UTF-8"></script>
<script src="./js/libs/mustache.min.js"></script> <script src="./js/libs/mustache.min.js"></script>
<script src="./js/libs/bootstrap.min.js"></script> <script src="./js/libs/bootstrap.min.js"></script>
<script src="./js/libs/jquery.mark.min.js"></script> <script src="./js/libs/jquery.mark.min.js"></script>
<script src="./js/constant.js"></script> <script src="./js/constant.js"></script>
<script src="./js/collaboration.js"></script> <script src="./js/collaboration.js"></script>
<script src="./js/common.js"></script> <script src="./js/common.js"></script>
<script src="./js/loading.js"></script> <script src="./js/loading.js"></script>
<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/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/language.js"></script> <script src="./js/chat-db-foriOS.js"></script>
<script src="./js/language_ko.js" charset="UTF-8"></script> <script src="./js/language.js"></script>
<script src="./js/language_ja.js" charset="UTF-8"></script> <script src="./js/language_ko.js" charset="UTF-8"></script>
<script src="./js/language_en.js" charset="UTF-8"></script> <script src="./js/language_ja.js" charset="UTF-8"></script>
<script src="./js/chat-websocket.js"></script> <script src="./js/language_en.js" charset="UTF-8"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="./js/chat-websocket.js"></script>
<script src="./js/share.js"></script> <script src="./js/chat-websocket-message.js"></script>
<script> <script src="./js/chat-websocket-refresh-group-list.js"></script>
<script src="./js/chat-websocket-refresh-user-list-in-group.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></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");
$("#modal_collabo_change_host").load("./modal_collabo_change_host.html"); $("#modal_collabo_change_host").load("./modal_collabo_change_host.html");
...@@ -109,7 +113,7 @@ ...@@ -109,7 +113,7 @@
let IS_ONLINE = false; let IS_ONLINE = false;
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter(); android.getLoginParameter();
android.getGlobalParameter(); android.getGlobalParameter();
} else { } else {
...@@ -118,7 +122,7 @@ ...@@ -118,7 +122,7 @@
} }
function startPipMode() { function startPipMode() {
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.startPipMode(); android.startPipMode();
} else if (CHAT_UTIL.isIOS()) { } else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.startPipMode.postMessage({}); webkit.messageHandlers.startPipMode.postMessage({});
...@@ -142,9 +146,9 @@ ...@@ -142,9 +146,9 @@
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg(); collaborationJoinFlg = android.getCollaborationJoinFlg();
} }
globalUserInfo.coWorkType = collaborationTypeKey.DOCUMENT; globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT;
CHAT_SOCKET.connectSocket(); CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() { socket.emit('join', CHAT.globalLoginParameter, function () {
}); });
}; };
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<!-- ユーザー追加オーバーレイ --> <!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm" ></div> <div id="modal_add_user_confirm"></div>
<!-- オーバーレイ メニュー --> <!-- オーバーレイ メニュー -->
<div id="collaboration_picture_overlay_menu"></div> <div id="collaboration_picture_overlay_menu"></div>
...@@ -144,11 +144,15 @@ ...@@ -144,11 +144,15 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script src="./js/language.js"></script> <script src="./js/language.js"></script>
<script src="./js/language_ko.js" charset="UTF-8"></script> <script src="./js/language_ko.js" charset="UTF-8"></script>
<script src="./js/language_ja.js" charset="UTF-8"></script> <script src="./js/language_ja.js" charset="UTF-8"></script>
<script src="./js/language_en.js" charset="UTF-8"></script> <script src="./js/language_en.js" charset="UTF-8"></script>
<script src="./js/chat-websocket.js"></script> <script src="./js/chat-websocket.js"></script>
<script src="./js/chat-websocket-message.js"></script>
<script src="./js/chat-websocket-refresh-group-list.js"></script>
<script src="./js/chat-websocket-refresh-user-list-in-group.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>
...@@ -170,7 +174,7 @@ ...@@ -170,7 +174,7 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType; let roomType;
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter(); android.getLoginParameter();
android.getGlobalParameter(); android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
...@@ -180,7 +184,7 @@ ...@@ -180,7 +184,7 @@
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
if (roomType == chatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
...@@ -196,13 +200,14 @@ ...@@ -196,13 +200,14 @@
collaborationJoinFlg = android.getCollaborationJoinFlg(); collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg); console.log(collaborationJoinFlg);
} }
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() { socket.emit('join', CHAT.globalLoginParameter, function () {
}); });
} }
}; };
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<!-- ユーザー追加オーバーレイ --> <!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm" ></div> <div id="modal_add_user_confirm"></div>
<!-- オーバーレイ メニュー --> <!-- オーバーレイ メニュー -->
<div id="collaboration_video_overlay_menu"></div> <div id="collaboration_video_overlay_menu"></div>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
</div> </div>
<div class="d-flex align-items-center h-100"> <div class="d-flex align-items-center h-100">
<div class="footer_menu_item"> <div class="footer_menu_item">
<!-- <a href="#" data-toggle="modal" data-target="#captyaModal">--> <!-- <a href="#" data-toggle="modal" data-target="#captyaModal">-->
<a href="#"> <a href="#">
<div class="img_wrap wide bg_blue" id="captureBtn"> <div class="img_wrap wide bg_blue" id="captureBtn">
<img src="icon/icon_collabo_capture.png" alt="キャプチャ"> <img src="icon/icon_collabo_capture.png" alt="キャプチャ">
...@@ -131,11 +131,15 @@ ...@@ -131,11 +131,15 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script src="./js/language.js"></script> <script src="./js/language.js"></script>
<script src="./js/language_ko.js" charset="UTF-8"></script> <script src="./js/language_ko.js" charset="UTF-8"></script>
<script src="./js/language_ja.js" charset="UTF-8"></script> <script src="./js/language_ja.js" charset="UTF-8"></script>
<script src="./js/language_en.js" charset="UTF-8"></script> <script src="./js/language_en.js" charset="UTF-8"></script>
<script src="./js/chat-websocket.js"></script> <script src="./js/chat-websocket.js"></script>
<script src="./js/chat-websocket-message.js"></script>
<script src="./js/chat-websocket-refresh-group-list.js"></script>
<script src="./js/chat-websocket-refresh-user-list-in-group.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>
</body> </body>
...@@ -158,7 +162,7 @@ ...@@ -158,7 +162,7 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType; let roomType;
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter(); android.getLoginParameter();
android.getGlobalParameter(); android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
...@@ -168,7 +172,7 @@ ...@@ -168,7 +172,7 @@
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
if (roomType == chatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
...@@ -184,12 +188,13 @@ ...@@ -184,12 +188,13 @@
collaborationJoinFlg = android.getCollaborationJoinFlg(); collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg); console.log(collaborationJoinFlg);
} }
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() { socket.emit('join', CHAT.globalLoginParameter, function () {
}); });
} }
}; };
</script> </script>
</html> </html>
\ No newline at end of file
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<div id="userProfileModalInCollaboration"></div> <div id="userProfileModalInCollaboration"></div>
<div id="modal_collabo_profile2"></div> <div id="modal_collabo_profile2"></div>
<!-- ユーザー追加オーバーレイ --> <!-- ユーザー追加オーバーレイ -->
<div id="add_user_list" ></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm"></div> <div id="modal_add_user_confirm"></div>
<!-- ホスト変更モーダル --> <!-- ホスト変更モーダル -->
<div id="modal_collabo_change_host"></div> <div id="modal_collabo_change_host"></div>
...@@ -78,11 +78,15 @@ ...@@ -78,11 +78,15 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script src="./js/language.js"></script> <script src="./js/language.js"></script>
<script src="./js/language_ko.js" charset="UTF-8"></script> <script src="./js/language_ko.js" charset="UTF-8"></script>
<script src="./js/language_ja.js" charset="UTF-8"></script> <script src="./js/language_ja.js" charset="UTF-8"></script>
<script src="./js/language_en.js" charset="UTF-8"></script> <script src="./js/language_en.js" charset="UTF-8"></script>
<script src="./js/chat-websocket.js"></script> <script src="./js/chat-websocket.js"></script>
<script src="./js/chat-websocket-message.js"></script>
<script src="./js/chat-websocket-refresh-group-list.js"></script>
<script src="./js/chat-websocket-refresh-user-list-in-group.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>
...@@ -103,7 +107,7 @@ ...@@ -103,7 +107,7 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType; let roomType;
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter(); android.getLoginParameter();
android.getGlobalParameter(); android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
...@@ -113,7 +117,7 @@ ...@@ -113,7 +117,7 @@
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
if (roomType == chatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
...@@ -129,10 +133,10 @@ ...@@ -129,10 +133,10 @@
collaborationJoinFlg = android.getCollaborationJoinFlg(); collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg); console.log(collaborationJoinFlg);
} }
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() { socket.emit('join', CHAT.globalLoginParameter, function () {
}); });
} }
}; };
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<!-- ユーザー追加オーバーレイ --> <!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm" ></div> <div id="modal_add_user_confirm"></div>
<!-- オーバーレイ メニュー --> <!-- オーバーレイ メニュー -->
<div id="collaboration_picture_overlay_menu"></div> <div id="collaboration_picture_overlay_menu"></div>
...@@ -136,11 +136,15 @@ ...@@ -136,11 +136,15 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script src="./js/language.js"></script> <script src="./js/language.js"></script>
<script src="./js/language_ko.js" charset="UTF-8"></script> <script src="./js/language_ko.js" charset="UTF-8"></script>
<script src="./js/language_ja.js" charset="UTF-8"></script> <script src="./js/language_ja.js" charset="UTF-8"></script>
<script src="./js/language_en.js" charset="UTF-8"></script> <script src="./js/language_en.js" charset="UTF-8"></script>
<script src="./js/chat-websocket.js"></script> <script src="./js/chat-websocket.js"></script>
<script src="./js/chat-websocket-message.js"></script>
<script src="./js/chat-websocket-refresh-group-list.js"></script>
<script src="./js/chat-websocket-refresh-user-list-in-group.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>
...@@ -162,7 +166,7 @@ ...@@ -162,7 +166,7 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType; let roomType;
if (typeof(android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter(); android.getLoginParameter();
android.getGlobalParameter(); android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
...@@ -172,7 +176,7 @@ ...@@ -172,7 +176,7 @@
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
if (roomType == chatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
...@@ -187,10 +191,10 @@ ...@@ -187,10 +191,10 @@
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg(); collaborationJoinFlg = android.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() { socket.emit('join', CHAT.globalLoginParameter, function () {
}); });
} }
}; };
......
...@@ -191,6 +191,7 @@ ...@@ -191,6 +191,7 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script> <script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script> <script>
String.prototype.replaceAll = function(org, dest) { String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
......
// 名前空間 // 名前空間
var ARCHIVE_UI = {}; var ARCHIVE_UI = {};
$(function() { document.addEventListener("DOMContentLoaded", function () {
// アーカイブ検索 // アーカイブ検索
$('#archive .search_form input[type="search"]').keyup(function(e) { bindArchiveSearch();
var keyword = $('#archive .search_form input[type="search"]').val(); // iOSキーボード変換検知用
if (e.KeyCode == 13 || e.key == "Enter") { bindiOSKeyBoardEvent();
if (keyword.length != 0 && keyword != '') { });
$('#archive .search_form input[type="search"]').blur();
ARCHIVE_UI.refreshSearchScreen = function (keyword) {
const archiveList = CHAT_DB.getArchiveByName(keyword);
const typeImage = getArchiveTypeIconURL(archive.archiveType);
getArchiveTemplate().then(function (archiveTemplate) {
archiveList.forEach(function (archive) {
let html = renderArchiveTemplate(
archiveTemplate,
archive.archiveId,
archive.archiveName,
archive.archiveDate,
typeImage
);
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").append(obj);
});
});
};
//* UTILS *//
const ARCHIVE_TYPE = {
PICTURE: 0,
VIDEO: 1,
VOICE: 2,
DOCUMENT: 3,
};
var getArchiveTypeIconURL = function (type) {
switch (type) {
case ARCHIVE_TYPE.PICTURE:
return "icon/icon_collabo_picture.png";
case ARCHIVE_TYPE.VIDEO:
return "icon/icon_collabo_videocam.png";
case ARCHIVE_TYPE.VOICE:
return "icon/icon_collabo_headset.png";
case ARCHIVE_TYPE.DOCUMENT:
return "icon/icon_collabo_document.png";
default:
return "";
}
};
var getArchiveTemplate = function () {
return new Promise(function (resolve, reject) {
$.get({ url: TemplateURL.ARCHIVE_LIST, async: false }, function (text) {
resolve(text);
});
});
};
var bindArchiveSearch = function () {
const searchInput = $('#archive .search_form input[type="search"]');
searchInput.keyup(function (e) {
var keyword = searchInput.val();
const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword.length != 0 && keyword != "";
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return; return;
} }
} else if (keyword == '' || keyword.length < 2) { } else if (keywordEmpty) {
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
return; return;
} }
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword); ARCHIVE_UI.refreshSearchScreen(keyword);
if (e.KeyCode == 13 || e.key == "Enter") { if (enterKeyPressed) {
$('#archive .search_form input[type="search"]').blur(); searchInput.blur();
return; return;
} }
// 検索結果を表示 // 検索結果を表示
}); });
// iOSキーボード変換検知用 };
$('#archive .search_form input[type="search"]').on('compositionend', function() {
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#archive .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
var keyword = $('#archive .search_form input[type="search"]').val(); var keyword = searchInput.val();
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword); ARCHIVE_UI.refreshSearchScreen(keyword);
} }
}); });
}); };
ARCHIVE_UI.refreshSearchScreen = function(keyword) {
var archiveList = CHAT_DB.getArchiveByName(keyword);
var archiveTemplate;
$.get({ url: "./template/template_archive_list.html", async: false }
, function(text) {
archiveTemplate = text;
});
archiveList.forEach(function(archive) {
var typeImage = "";
switch(archive.archiveType) {
case 0: // 画像
typeImage = "icon/icon_collabo_picture.png";
break;
case 1: // 動画
typeImage = "icon/icon_collabo_videocam.png";
break;
case 2: // 音声
typeImage = "icon/icon_collabo_headset.png";
break;
case 3: // 文書
typeImage = "icon/icon_collabo_document.png";
break;
default: // その他
typeImage = "";
}
let html = Mustache.render(archiveTemplate, {
archiveId: archive.archiveId,
fileName: archive.archiveName,
insertDate: archive.archiveDate,
typeImage: typeImage
});
let obj = jQuery.parseHTML(html); var renderArchiveTemplate = function (
$('.overlay_src_msg').append(obj); html,
archiveId,
archiveName,
archiveDate,
typeImageURL
) {
return Mustache.render(html, {
archiveId: archiveId,
fileName: archiveName,
insertDate: archiveDate,
typeImage: typeImageURL,
}); });
}; };
// 名前空間 // 名前空間
var CHAT_ADD_USER = {}; var CHAT_ADD_USER = {};
$(function() { document.addEventListener("DOMContentLoaded", function () {
// メンバー検索 // メンバー検索
$('#chat_add_user .search_form input[type="search"]').click(function(e){ bindMemberSearch();
// iOSキーボード変換検知用
bindiOSKeyBoardEvent();
});
// ユーザー検索
CHAT_ADD_USER.searchUser = function (keyword) {
const isAllGroup = $("#tabAllGroupOnAddUser").is(":checked");
const overlayMessage = $(".overlay_src_msg");
let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
const groupList = CHAT_DB.getGroupByName(keyword);
searchGroupData(groupList);
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList);
hasNoData = userList.length == 0;
}
// Set NoResult
if (hasNoData) {
const noResultMessage = getNoResultMessage();
overlayMessage.append(noResultMessage);
}
};
/** UTILS */
var bindMemberSearch = function () {
const searchInput = $('#chat_add_user .search_form input[type="search"]');
searchInput.click(function (e) {
//画面タイトル設定 //画面タイトル設定
let contactListTitle = getLocalizedString("userSearch"); let contactListTitle = getLocalizedString("userSearch");
$('#addUserTitle').text(contactListTitle); $("#addUserTitle").text(contactListTitle);
}) });
$('#chat_add_user .search_form input[type="search"]').keyup(function(e){ searchInput.keyup(function (e) {
var keyword = $('#chat_add_user .search_form input[type="search"]').val(); const keyword = searchInput.val();
if (e.key == "Enter" || e.KeyCode == 13) { const enterKeyPressed = e.key == "Enter" || e.KeyCode == 13;
if (keyword != '' && keyword.length != 0) { const keywordNotEmpty = keyword != "" && keyword.length != 0;
$('#chat_add_user .search_form input[type="search"]').blur(); const keywordEmpty = keyword == "" || keyword.length < 2;
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return false; return false;
} }
} else if (keyword == '' || keyword.length < 2) { } else if (keywordEmpty) {
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
return false; return false;
} }
CHAT_ADD_USER.searchUser(keyword); CHAT_ADD_USER.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#chat_add_user .search_form input[type="search"]').blur(); if (enterKeyPressed) {
searchInput.blur();
return; return;
} }
}); });
// iOSキーボード変換検知用 };
$('#chat_add_user .search_form input[type="search"]').on('compositionend', function() {
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#chat_add_user .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
var keyword = $('#chat_add_user .search_form input[type="search"]').val(); var keyword = searchInput.val();
CHAT_ADD_USER.searchUser(keyword); CHAT_ADD_USER.searchUser(keyword);
} }
}); });
}); };
// ユーザー検索 var searchGroupData = function (groupList) {
CHAT_ADD_USER.searchUser = function(keyword) { const groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
var isAllGroup = $('#tabAllGroupOnAddUser').is(':checked');
$('.overlay_src_msg').empty();
//全グループ検索画面 groupList.forEach(function (group) {
if (isAllGroup) { let html = renderGroupTemplate(
//グループデータ検索 groupTemplate,
var groupList = CHAT_DB.getGroupByName(keyword); group.groupName,
var groupTemplate; group.groupId
$.get({ url: "./template/template_make_room_group_list.html", async: false } );
, function(text) {
groupTemplate = text; let obj = jQuery.parseHTML(html);
overlayMessage.append(obj);
}); });
};
groupList.forEach(function(group) { var renderGroupTemplate = function (groupTemplate, groupName, groupID) {
let html = Mustache.render(groupTemplate, { return Mustache.render(groupTemplate, {
name: group.groupName, name: groupName,
id: group.groupId, id: groupID,
}); });
};
var searchUserData = function (userList) {
const userTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
userList.forEach(function (user) {
setUserProfile(user);
checkUser(user);
});
let html = renderUserTemplate(userTemplate, userList);
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); overlayMessage.append(obj);
}) };
//ユーザデータ検索 var setUserProfile = function (user) {
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { };
var checkUser = function (user) {
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
return shopMemberId == user.shopMemberId; return shopMemberId == user.shopMemberId;
})
if (findObj) {
user.checked = 'checked';
}
});
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
if (userList.length == 0 && groupList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
  //連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
}); });
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == user.shopMemberId;
})
if (findObj) { if (findObj) {
user.checked = 'checked'; user.checked = "checked";
} }
};
var renderUserTemplate = function (userTemplate, userList) {
return Mustache.render(userTemplate, {
userList: userList,
}); });
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').html(obj);
if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
}
}; };
// ios用
function callNativeApp(iosKey, jsonData) {
console.log("callNativeApp called");
var result;
try {
var key = iosKey;
var data = jsonData;
var payload = { key: key, data: data };
// payloadの形 {"type":"SJbridge","data":{"name":"abc","role":"dev"}}
// resにObjective-cからのレスポンスが返る
result = prompt(JSON.stringify(payload));
console.log(result);
} catch (err) {
console.log("The native context does not exist yet");
}
return result;
}
CHAT_DB.getBeforeRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getBeforeRoomType, {});
}
};
CHAT_DB.getRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getRoomType, {}), 10);
}
};
CHAT_DB.removeFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.removeFavoriteGroup = function (groupId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteGroup, {
groupId: groupId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteGroup = function (groupId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteGroup, {
groupId: groupId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.getCollaborationJoinFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getCollaborationJoinFlg, {});
}
};
CHAT_DB.getUserInfoList = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getUserInfoList, {
shopMemberId: shopMemberId,
});
}
};
CHAT_DB.createContentView = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.createContentView, {}));
}
};
CHAT_DB.getToMoveGroupId = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getToMoveGroupId, {});
}
};
CHAT_DB.getJoinCollaborationType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(
callNativeApp(NATIVE_KEY_IOS.getJoinCollaborationType, {}),
10
);
}
};
CHAT_DB.getHostRequestFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getHostRequestFlg, {}), 10);
}
};
jQuery('#homeButton').on('click', function() { jQuery("#homeButton").on("click", function () {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({}); webkit.messageHandlers.goHome.postMessage({});
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
...@@ -6,7 +6,7 @@ jQuery('#homeButton').on('click', function() { ...@@ -6,7 +6,7 @@ jQuery('#homeButton').on('click', function() {
} }
}); });
jQuery('#reloadButton').on('click', function() { jQuery("#reloadButton").on("click", function () {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要。 //TODO IOS処理追加必要。
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
......
var lastscrollvalue; var lastscrollvalue;
window.onscroll = function() { window.onscroll = function () {
beforeScroll = window.scrollY; beforeScroll = window.scrollY;
} };
$('#roomNameChangeBtn').click(function() { $("#roomNameChangeBtn").click(function () {
var changeRoomName = $('#roomNameInput').val(); var changeRoomName = $("#roomNameInput").val();
var trimmedRoomName = $('#roomNameInput').val().trim(); var trimmedRoomName = $("#roomNameInput").val().trim();
if (trimmedRoomName.length == 0) { if (trimmedRoomName.length == 0) {
alert(getLocalizedString("error_empty_room_name")); alert(getLocalizedString("error_empty_room_name"));
return; return;
...@@ -15,7 +15,7 @@ $('#roomNameChangeBtn').click(function() { ...@@ -15,7 +15,7 @@ $('#roomNameChangeBtn').click(function() {
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
android.changeRoomName(changeRoomName); android.changeRoomName(changeRoomName);
} }
}) });
/* /*
$('#messages').scroll(function() { $('#messages').scroll(function() {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
// 名前空間 // 名前空間
var CHAT_UTIL = {}; var CHAT_UTIL = {};
CHAT_UTIL.isAndroid = function() { CHAT_UTIL.isAndroid = function () {
return PLATFORM == 'android'; return PLATFORM == "android";
}; };
CHAT_UTIL.isIOS = function() { CHAT_UTIL.isIOS = function () {
return PLATFORM == 'ios'; return PLATFORM == "ios";
}; };
CHAT_UTIL.isMobile = function() { CHAT_UTIL.isMobile = function () {
return IS_MOBILE == 'true'; return IS_MOBILE == "true";
}; };
CHAT_UTIL.formatDate = function(date) { CHAT_UTIL.formatDate = function (date) {
const REFERENCE = moment(); const REFERENCE = moment();
const TODAY = REFERENCE.clone().startOf('day'); const TODAY = REFERENCE.clone().startOf("day");
let createdAt = moment(date); let createdAt = moment(date);
if (date.length == 14) { if (date.length == 14) {
createdAt = moment(date,'YYYYMMDDhhmmss'); createdAt = moment(date, "YYYYMMDDhhmmss");
} else { } else {
createdAt = moment(date); createdAt = moment(date);
} }
// #36171 // #36171
const createdAtDay = createdAt.format('MMM Do'); const createdAtDay = createdAt.format("MMM Do");
const createdAtTime = createdAt.format('HH:mm'); const createdAtTime = createdAt.format("HH:mm");
if (createdAt.isSame(TODAY, 'd')) { if (createdAt.isSame(TODAY, "d")) {
createdAt = createdAtTime; createdAt = createdAtTime;
} else { } else {
createdAt = createdAtDay; createdAt = createdAtDay;
...@@ -36,59 +36,62 @@ CHAT_UTIL.formatDate = function(date) { ...@@ -36,59 +36,62 @@ CHAT_UTIL.formatDate = function(date) {
rntDate.createdAtTime = createdAtTime; rntDate.createdAtTime = createdAtTime;
rntDate.createdAt = createdAt; rntDate.createdAt = createdAt;
return rntDate; return rntDate;
} };
CHAT_UTIL.htmlDecode = function(input) { CHAT_UTIL.htmlDecode = function (input) {
var e = document.createElement('textarea'); var e = document.createElement("textarea");
e.innerHTML = input; e.innerHTML = input;
// handle case of empty input // handle case of empty input
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue; return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
} };
//generates a unique id, not obligator a UUID //generates a unique id, not obligator a UUID
CHAT_UTIL.generateUUID = function() { CHAT_UTIL.generateUUID = function () {
var d = new Date().getTime(); var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
var r = (d + Math.random()*16)%16 | 0; /[xy]/g,
d = Math.floor(d/16); function (c) {
return (c=='x' ? r : (r&0x3|0x8)).toString(16); var r = (d + Math.random() * 16) % 16 | 0;
}); d = Math.floor(d / 16);
return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
}
);
return uuid; return uuid;
}; };
CHAT_UTIL.systemDay = function(date) { CHAT_UTIL.systemDay = function (date) {
let createdAt = moment(date); let createdAt = moment(date);
createdAt = moment(date,'YYYYMMDDhhmmss'); createdAt = moment(date, "YYYYMMDDhhmmss");
const createdAtDow = createdAt.format('YYYY-MM-DD'); const createdAtDow = createdAt.format("YYYY-MM-DD");
let systemDay = new Object(); let systemDay = new Object();
systemDay.year = createdAt.format('YYYY'); systemDay.year = createdAt.format("YYYY");
systemDay.month = createdAt.format('MM'); systemDay.month = createdAt.format("MM");
systemDay.day = createdAt.format('DD'); systemDay.day = createdAt.format("DD");
systemDay.dow = moment(createdAtDow).day(); systemDay.dow = moment(createdAtDow).day();
return systemDay; return systemDay;
} };
CHAT_UTIL.findDow = function(data) { CHAT_UTIL.findDow = function (data) {
let dow = ""; let dow = "";
if (data == 0) { if (data == 0) {
dow = getLocalizedString('sunday'); dow = getLocalizedString("sunday");
} else if (data == 1) { } else if (data == 1) {
dow = getLocalizedString('monday'); dow = getLocalizedString("monday");
} else if (data == 2) { } else if (data == 2) {
dow = getLocalizedString('thusday'); dow = getLocalizedString("thusday");
} else if (data == 3) { } else if (data == 3) {
dow = getLocalizedString('wednesday'); dow = getLocalizedString("wednesday");
} else if (data == 4) { } else if (data == 4) {
dow = getLocalizedString('thursday'); dow = getLocalizedString("thursday");
} else if (data == 5) { } else if (data == 5) {
dow = getLocalizedString('friday'); dow = getLocalizedString("friday");
} else if (data == 6) { } else if (data == 6) {
dow = getLocalizedString('sunday'); dow = getLocalizedString("sunday");
} }
return dow; return dow;
} };
function msToTime(s) { function msToTime(s) {
var ms = s % 1000; var ms = s % 1000;
...@@ -98,55 +101,57 @@ function msToTime(s) { ...@@ -98,55 +101,57 @@ function msToTime(s) {
var mins = s % 60; var mins = s % 60;
var hrs = (s - mins) / 60; var hrs = (s - mins) / 60;
return hrs + ':' + mins + ':' + secs; return hrs + ":" + mins + ":" + secs;
} }
function updateDuration() { function updateDuration() {
var now = new Date(); var now = new Date();
$('.collaboration_duration').each(function(index, item) { $(".collaboration_duration").each(function (index, item) {
var insertDateString = $(item).data('insertdate'); var insertDateString = $(item).data("insertdate");
insertDateString = insertDateString.toString(); insertDateString = insertDateString.toString();
var year = insertDateString.substring(0,4); var year = insertDateString.substring(0, 4);
var month = insertDateString.substring(4,6); var month = insertDateString.substring(4, 6);
var day = insertDateString.substring(6,8); var day = insertDateString.substring(6, 8);
var hour = insertDateString.substring(8,10); var hour = insertDateString.substring(8, 10);
var min = insertDateString.substring(10,12); var min = insertDateString.substring(10, 12);
var sec = insertDateString.substring(12,14); var sec = insertDateString.substring(12, 14);
var insertDate = new Date(year, month-1 , day, hour, min, sec); var insertDate = new Date(year, month - 1, day, hour, min, sec);
$(item).html(msToTime(now - insertDate)); $(item).html(msToTime(now - insertDate));
}); });
} }
CHAT_UTIL.getCollaborationType = function(key) { CHAT_UTIL.getCollaborationType = function (key) {
switch(key) { switch (key) {
case collaborationTypeKey.AUDIO: case CollaborationTypeKey.AUDIO:
return COLLABORATION_TYPE.AUDIO; return COLLABORATION_TYPE.AUDIO;
case collaborationTypeKey.CAMERA: case CollaborationTypeKey.CAMERA:
return COLLABORATION_TYPE.CAMERA; return COLLABORATION_TYPE.CAMERA;
case collaborationTypeKey.VIDEO: case CollaborationTypeKey.VIDEO:
return COLLABORATION_TYPE.VIDEO; return COLLABORATION_TYPE.VIDEO;
case collaborationTypeKey.DOCUMENT: case CollaborationTypeKey.DOCUMENT:
return COLLABORATION_TYPE.DOCUMENT; return COLLABORATION_TYPE.DOCUMENT;
default: default:
return 0; return 0;
} }
} };
CHAT_UTIL.getCoviewTypeFromCollaborationType = function(joinCollaborationType) { CHAT_UTIL.getCoviewTypeFromCollaborationType = function (
switch(joinCollaborationType) { joinCollaborationType
) {
switch (joinCollaborationType) {
case COLLABORATION_TYPE.AUDIO: case COLLABORATION_TYPE.AUDIO:
console.log(collaborationTypeKey.AUDIO); console.log(CollaborationTypeKey.AUDIO);
return collaborationTypeKey.AUDIO; return CollaborationTypeKey.AUDIO;
case COLLABORATION_TYPE.CAMERA: case COLLABORATION_TYPE.CAMERA:
console.log(collaborationTypeKey.CAMERA); console.log(CollaborationTypeKey.CAMERA);
return collaborationTypeKey.CAMERA; return CollaborationTypeKey.CAMERA;
case COLLABORATION_TYPE.VIDEO: case COLLABORATION_TYPE.VIDEO:
return collaborationTypeKey.VIDEO; return CollaborationTypeKey.VIDEO;
case COLLABORATION_TYPE.DOCUMENT: case COLLABORATION_TYPE.DOCUMENT:
return collaborationTypeKey.DOCUMENT; return CollaborationTypeKey.DOCUMENT;
case COLLABORATION_TYPE.BOARD: case COLLABORATION_TYPE.BOARD:
return collaborationTypeKey.BOARD; return CollaborationTypeKey.BOARD;
default: default:
return 0; return 0;
} }
} };
\ No newline at end of file
var bindOnNewMessage = function () {
// New Message
// #36170
socket.on(SOCKET_KEY.NEW_MESSAGE, function (message, roomId, roomName) {
console.log(message);
const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
const unwrappedMessageInfo = decodeMessage(message.text);
if (
unwrappedMessageInfo ==
DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL
) {
cleanUpCollaborationMessage();
return;
}
if (unwrappedMessageInfo.includes(messageSeperator)) {
const messageInfo = unwrappedMessageInfo.split(messageSeperator);
const messageText = messageInfo[0];
const messageType = messageInfo[1];
if (
messageType == MessageType.COMMUNICATIONSTART ||
messageType == MessageType.COMMUNICATIONEND
) {
addCollaborationMessage(
messageInfo,
message.userId,
roomName,
message.insertDate,
message.createdAt
);
} else {
addTextMessage(messageText, message, socket.id);
}
}
// 画像、動画の描画を待ってからスクロール
setTimeout(function () {
CHAT_UI.scrollToBottom();
}, 300);
});
};
var decodeMessage = function (text) {
try {
return decodeURIComponent(text);
} catch (e) {
return text;
}
};
var addCollaborationMessage = function (
messageInfo,
userID,
roomName,
insertDate,
createdAt
) {
const collaborationType = messageInfo[2];
const meetingID = getMeetingID(collaborationType, messageInfo);
const userInCollaboration = getUserInfoList(userID);
userInCollaboration.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
const openCollaborationMessageTemplate = getTemplate(
TemplateURL.OPEN_COLLABORATION_MESSAGE
);
const html = renderCollaborationMessage(
openCollaborationMessageTemplate,
roomName,
userInCollaboration,
insertDate,
collaborationType,
meetingID,
createdAt
);
$("#messages").append(html);
};
var getMeetingID = function (collaborationType, messageInfo) {
if (
collaborationType ==
CHAT_UTIL.getCollaborationType(CollaborationTypeKey.DOCUMENT)
) {
return messageInfo[3];
} else {
return 0;
}
};
var renderCollaborationMessage = function (
template,
roomName,
userList,
insertDate,
collaborationType,
meetingID,
createdAt
) {
let messageTime = CHAT_UTIL.formatDate(createdAt);
return Mustache.render(template, {
roomName: roomName,
userCount: 1,
userList: userList,
insertDate: insertDate,
collaborationType: collaborationType,
isToday: true,
meetingId: meetingID,
createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime,
isOtherYear: false,
});
};
var addTextMessage = function (messageText, message, socketID) {
const messageTextWithSID = insertSID(messageText);
const messageSender = getUserInfoList(message.userId);
const shopMemberName = messageSender[0].shopMemberName;
const textMessageTemplate = getTextMessageTemplate(message.id === socketID);
const profileImagePath = CHAT.getProfileImgUrl(message.profileImagePath);
const html = renderTextMessage(
textMessageTemplate,
messageTextWithSID,
shopMemberName,
profileImagePath,
message.userId,
message.createdAt
);
$("#messages").append(html);
};
var renderTextMessage = function (
template,
text,
from,
profileImagePath,
userID,
createdAt
) {
let messageTime = CHAT_UTIL.formatDate(createdAt);
let dataInsertedTemplate = Mustache.render(template, {
text: text,
from: from,
profileImage: profileImagePath,
shopMemberId: userID,
createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime,
isToday: true,
});
// イメージの場合、img tagを追加する
if (text.includes("attachedImages") || text.includes("attachedVideos")) {
return CHAT_UTIL.htmlDecode(dataInsertedTemplate);
} else {
return dataInsertedTemplate;
}
};
var getUserInfoList = function (userID) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(CHAT_DB.getUserInfoList(userID));
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getUserInfoList(userID));
}
};
var cleanUpCollaborationMessage = function () {
$(".collabo_area.start").each(function (index, collaborationMessage) {
$(collaborationMessage).removeClass("start");
$(collaborationMessage).addClass("end");
$(collaborationMessage).addClass("disable");
$(collaborationMessage)
.find(".collaboation_join_button")
.attr("disabled", "disabled");
$(collaborationMessage)
.find(".collaboration_join_message")
.text(getLocalizedString("message_ended"));
});
};
var insertSID = function (text) {
let replacePath = text;
replacePath = replacePath.replaceAll(
"?fileName=",
"?sid=" + CHAT.globalLoginParameter.sid + "&fileName="
);
return replacePath;
};
var getTextMessageTemplate = function (isSenderMySelf) {
return getTemplate(
isSenderMySelf
? TemplateURL.MY_MESSAGE // ユーザーが送信したメッセージの場合、自分のメッセージ様式を適用して表示する
: TemplateURL.USER_MESSAGE
);
};
var bindOnRefreshGroupList = function () {
// Update Group List(Invite)
socket.on(SOCKET_KEY.REFRESH_GROUPLIST, function (groups, isInvite) {
const groupListElement = $("#group_list");
groupListElement.html("");
const template = $("#group-template").html();
if (groups.length === 0) {
groupListElement.append(
'<center class="text-secondary">' +
getLocalizedString(everyoneIsHere) +
"</center>"
);
}
addGroupNameAndNumberOfUsers(groups);
// Rotate
handleRotate();
updateTopBar();
// Set Title
updateTopBar(isInvite);
updateUserSelectionLength();
setupBackButton();
});
};
var addGroupNameAndNumberOfUsers = function (groups) {
// グループ名と人数を表記する。
groups.forEach(function (group) {
let html = Mustache.render(template, {
name: group.groupName,
info: group.memberCnt + getLocalizedString("people"),
});
// グループをクリックすると、該当グループのユーザーリストを読み込むようにイベントを与える
let obj = $(jQuery.parseHTML(html)).on("click", function () {
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
socket.emit("getUserListInGroup", group.groupId, isInvite);
$("#groupName").text(group.groupName);
});
groupListElement.append(obj);
});
};
var handleRotate = function () {
if (CHAT_UI.isLandscapeMode()) {
$(".group_list").addClass("col-6").removeClass("col-12");
}
};
var setupBackButton = function () {
const backButton = $("#backButton");
backButton.show();
backButton.off().on("click", function () {
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
if (isInvite) {
$("#pills-chat-tab").tab("show");
} else {
if (IS_ONLINE == "true") {
android.updateRoomList();
CHAT_UI.refreshRoomList(ChatRoomType.DM);
CHAT_UI.dismissLoadingIndicator();
}
}
});
};
var updateUserSelectionLength = function () {
const userSelectionLength = $("#userSelectionLength");
if (CHAT.globalSelectedUserList.length > 0) {
userSelectionLength.text(CHAT.globalSelectedUserList.length);
} else {
userSelectionLength.text("");
}
};
var updateTopBar = function (isInvite) {
// Set Title
let memberSelectTitle = getLocalizedString("groupSearch");
$("#pills-group-tab").tab("show");
const titleRoomName = $(".titleRoomName");
const userSelectionConfirmButton = $("#userSelectionConfirmBtn");
titleRoomName.text(memberSelectTitle);
if (isInvite) {
$("#newRoomName, .roomListIcon, .chatRoomIcon").hide();
} else {
$(".roomListIcon, .chatRoomIcon, #newRoomName").hide();
}
userSelectionConfirmButton.show();
userSelectionConfirmButton.off().on("click", function () {
CHAT_UI.setConfirmButtonEvent(isInvite);
});
};
var bindOnRefreshUserListInGroup = function () {
// Update User List(Invite)
// #36170
socket.on(
SOCKET_KEY.REFRESH_USERLIST_INGROUP,
function (users, groupId, isInvite) {
$("#user_list").html("");
// Set Title
updateTitle();
addUserList(users);
// Rotate
handleRotateOnUserListInGroup();
setupBackButtonOnUserListInGroup(isInvite);
setupUserSelectionConfirmButton(isInvite);
updateUIOnUserListInGroup();
}
);
};
var updateTitle = function () {
let memberSelectTitle = getLocalizedString("userSearch");
$(".titleRoomName").text(memberSelectTitle);
};
var addUserList = function (users) {
users.forEach(function (user) {
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
user.profileImagePath = CHAT.getProfileImgUrl(user.profileImagePath);
// クリックするとactive クラスを与え、チェック表示を出させる。
let obj = activateCheckUser(
user.loginId,
user.shopMemberId,
user.profileImagePath
);
let findObj = CHAT.globalSelectedUserList.find(function (selectedUser) {
return selectedUser.loginId == user.loginId;
});
if (findObj) {
$(obj).find(".userCheckBox").toggleClass("active");
}
$("#user_list").append(obj);
});
};
var renderUser = function (template, userID, profileImagePath, userName) {
return Mustache.render(template, {
id: userID,
profileImage: profileImagePath,
name: userName,
});
};
var activateCheckUser = function (loginID, shopMemberID, profileImagePath) {
const template = $("#user-template").html();
let html = renderUser(template, shopMemberID, profileImagePath, loginID);
return $(jQuery.parseHTML(html)).on("click", function () {
if ($(this).find(".userCheckBox.active").length > 0) {
// remove
CHAT.globalSelectedUserList = filterRemovedUser(loginID);
} else {
// add
addSelectedUser(loginID, shopMemberID, profileImagePath);
}
$(this).find(".userCheckBox").toggleClass("active");
updateUserSelectionLength();
});
};
var filterRemovedUser = function (userID) {
return CHAT.globalSelectedUserList.filter(function (element) {
return userID != element.loginId;
});
};
var addSelectedUser = function (loginID, shopMemberID, profileImagePath) {
CHAT.globalSelectedUserList.push({
loginId: loginID,
shopMemberId: shopMemberID,
profileImagePath: profileImagePath,
});
};
var handleRotateOnUserListInGroup = function () {
if (CHAT_UI.isLandscapeMode()) {
$(".user_list").addClass("col-6").removeClass("col-12");
$(".squareBoxContent span").addClass("landscape_span");
}
};
var setupBackButtonOnUserListInGroup = function (isInvite) {
const backButton = $("#backButton");
backButton.off().on("click", function () {
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
socket.emit("getGroupList", isInvite);
});
backButton.show();
};
var setupUserSelectionConfirmButton = function (isInvite) {
const userSelectionConfirmButton = $("#userSelectionConfirmBtn");
userSelectionConfirmButton.off().on("click", function () {
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
CHAT_UI.setConfirmButtonEvent(isInvite);
});
userSelectionConfirmButton.show();
};
var updateUIOnUserListInGroup = function () {
$(".roomListIcon, .chatRoomIcon").hide();
$(".userCheckBox").show();
$("#pills-user-tab").tab("show");
};
// 名前空間 // 名前空間
var CHAT_MAKE_ROOM = {}; var CHAT_MAKE_ROOM = {};
$(function() { document.addEventListener("DOMContentLoaded", function () {
// メンバー検索 // メンバー検索
$('#chatMakeRoom .search_form input[type="search"]').click(function(e) { searchMember();
let contactListTitle = getLocalizedString("userSearch");
$('#makeRoomTitle').text(contactListTitle);
});
$('#chatMakeRoom .search_form input[type="search"]').keyup(function(e) {
//画面タイトル設定
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
if (e.KeyCode == 13 || e.key == "Enter") {
if (keyword != '' && keyword.length != 0) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return false;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return false;
}
CHAT_MAKE_ROOM.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return;
}
});
// iOSキーボード変換検知用 // iOSキーボード変換検知用
$('#chatMakeRoom .search_form input[type="search"]').on('compositionend', function() { bindiOSKeyBoardEvent();
if (CHAT_UTIL.isIOS()) {
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
CHAT_MAKE_ROOM.searchUser(keyword);
}
});
}); });
// メンバー検索 // メンバー検索
CHAT_MAKE_ROOM.searchUser = function(keyword) { CHAT_MAKE_ROOM.searchUser = function (keyword) {
var isAllGroup = $('#tabAllGroupOnMakeRoom').is(':checked'); const overlayMessage = $(".overlay_src_msg");
$('.overlay_src_msg').empty(); const isAllGroup = $("#tabAllGroupOnMakeRoom").is(":checked");
let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面 //全グループ検索画面
if (isAllGroup) { if (isAllGroup) {
//グループデータ検索 //グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword); var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate; var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
$.get({ url: "./template/template_make_room_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
groupList.forEach(function(group) { groupList.forEach(function (group) {
let html = Mustache.render(groupTemplate, { renderRoomList(groupTemplate, group.groupName, group.groupId);
name: group.groupName,
id: group.groupId,
});
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); overlayMessage.append(obj);
}) });
//ユーザデータ検索 //ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword); var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
var userTemplate; searchUserData(userList);
$.get({ url: "./template/template_make_room_user_list.html", async: false } var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
, function(text) { let html = renderUser(userTemplate, userList);
userTemplate = text; let obj = jQuery.parseHTML(html);
}); overlayMessage.append(obj);
userList.forEach(function(user) { hasNoData = groupList.length == 0 && userList.length == 0;
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); //連絡先画面
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { } else {
return shopMemberId == user.shopMemberId; const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
}) searchUserData();
if (findObj) { var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
user.checked = 'checked'; let html = renderUser(userTemplate, userList);
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").html(obj);
hasNoData = userList.length == 0;
} }
if (hasNoData) {
const noResultMsg = getNoResultMessage();
overlayMessage.append(noResultMsg);
}
};
/** UTIL */
var searchMember = function () {
const searchInput = $('#chatMakeRoom .search_form input[type="search"]');
searchInput.click(function (e) {
let contactListTitle = getLocalizedString("userSearch");
$("#makeRoomTitle").text(contactListTitle);
}); });
let html = Mustache.render(userTemplate, { searchInput.keyup(function (e) {
userList: userList const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword != "" && keyword.length != 0;
//画面タイトル設定
var keyword = searchInput.val();
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return false;
}
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
return false;
}
CHAT_MAKE_ROOM.searchUser(keyword);
if (enterKeyPressed) {
searchInput.blur();
return;
}
}); });
let obj = jQuery.parseHTML(html); };
$('.overlay_src_msg').append(obj);
if (groupList.length == 0 && userList.length == 0) { var bindiOSKeyBoardEvent = function () {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); const searchInput = $('#chatMakeRoom .search_form input[type="search"]');
noResultMsg.append(getLocalizedString("noResult")) searchInput.on("compositionend", function () {
$('.overlay_src_msg').append(noResultMsg); if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
CHAT_MAKE_ROOM.searchUser(keyword);
} }
  //連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
}); });
userList.forEach(function(user) { };
var renderRoomList = function (url, groupName, groupID) {
return Mustache.render(url, {
name: groupName,
id: groupID,
});
};
var searchUserData = function (userList) {
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
return shopMemberId == user.shopMemberId; return shopMemberId == user.shopMemberId;
}) });
if (findObj) { if (findObj) {
user.checked = 'checked'; user.checked = "checked";
} }
}); });
let html = Mustache.render(userTemplate, { };
userList: userList
var renderUser = function (url, userList) {
return Mustache.render(url, {
userList: userList,
}); });
let obj = jQuery.parseHTML(html); };
$('.overlay_src_msg').html(obj);
if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
}
}
$(function () { document.addEventListener("DOMContentLoaded", function () {
// メニューオーバーレイ表示 // メニューオーバーレイ表示
$(".menu_btn").click(function () { $(".menu_btn").click(function () {
var w = $(this).width(); var w = $(this).width();
...@@ -8,7 +8,6 @@ $(function () { ...@@ -8,7 +8,6 @@ $(function () {
.toggleClass("slidein") .toggleClass("slidein")
.css({ transform: "translateX(" & -w & ")" }); .css({ transform: "translateX(" & -w & ")" });
$("#collabo_main").toggleClass("noscroll"); $("#collabo_main").toggleClass("noscroll");
}); });
// ユーザーリストオーバーレイ表示 // ユーザーリストオーバーレイ表示
...@@ -21,7 +20,6 @@ $(function () { ...@@ -21,7 +20,6 @@ $(function () {
.css({ transform: "translateX(" & -w & ")" }); .css({ transform: "translateX(" & -w & ")" });
$("#collabo_main").toggleClass("noscroll"); $("#collabo_main").toggleClass("noscroll");
if ($("#overlay_user_list.overlay").hasClass("noscroll")) { if ($("#overlay_user_list.overlay").hasClass("noscroll")) {
$("#overlay_user_list.overlay").removeClass("noscroll"); $("#overlay_user_list.overlay").removeClass("noscroll");
} else { } else {
...@@ -73,57 +71,63 @@ $(function () { ...@@ -73,57 +71,63 @@ $(function () {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
CHAT.globalSelectedUserList = []; CHAT.globalSelectedUserList = [];
CHAT_UI.refreshMyGroupForAddUserInCollaboration(); CHAT_UI.refreshMyGroupForAddUserInCollaboration();
$('#addUserConfirmBtnInCollaboration').off().on('click', function() { $("#addUserConfirmBtnInCollaboration")
$('#addUserInCollaboration').modal('hide'); .off()
if (typeof(android) != "undefined") { .on("click", function () {
$("#addUserInCollaboration").modal("hide");
if (typeof android != "undefined") {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(",")); android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
} else { } else {
webkit.messageHandlers.saveSelectedUserList.postMessage(CHAT.globalSelectedUserList.join(",")); webkit.messageHandlers.saveSelectedUserList.postMessage(
CHAT.globalSelectedUserList.join(",")
);
} }
CHAT_UI.confirmInviteUserListInCollaboration(); CHAT_UI.confirmInviteUserListInCollaboration();
}); });
}); });
$('#penBtn').click(function () { $("#penBtn").click(function () {
$('#coviewPenCtrBtn').click(); $("#coviewPenCtrBtn").click();
if ($('#penBtn').hasClass('bg_red')) { if ($("#penBtn").hasClass("bg_red")) {
$('#penBtn').removeClass('bg_red'); $("#penBtn").removeClass("bg_red");
$('#penBtn').addClass('bg_blue'); $("#penBtn").addClass("bg_blue");
} else { } else {
$('#penBtn').addClass('bg_red'); $("#penBtn").addClass("bg_red");
$('#penBtn').removeClass('bg_blue'); $("#penBtn").removeClass("bg_blue");
} }
}) });
$('#photo_open_place_holder').click(function () { $("#photo_open_place_holder").click(function () {
$("#open_file_upload").trigger("click"); $("#open_file_upload").trigger("click");
}) });
$('#eraserBtn').click(function () { $("#eraserBtn").click(function () {
$('#coviewEraserCtrBtn').click(); $("#coviewEraserCtrBtn").click();
}) });
$('#captureBtn').click(function () { $("#captureBtn").click(function () {
if ($('#recordBtn').hasClass('bg_red')) { if ($("#recordBtn").hasClass("bg_red")) {
screenLock(); screenLock();
recordStop(function() { recordStop(function () {
$('#screenLock').remove(); $("#screenLock").remove();
coview_api.Capture(CMS_SERVER_URL + '/chatapi/file/uploadArchive'); coview_api.Capture(CMS_SERVER_URL + "/chatapi/file/uploadArchive");
}); });
} else { } else {
coview_api.Capture(CMS_SERVER_URL + '/chatapi/file/uploadArchive'); coview_api.Capture(CMS_SERVER_URL + "/chatapi/file/uploadArchive");
} }
}) });
$('#captureRequestBtn').click(function () { $("#captureRequestBtn").click(function () {
fw.sendToMsg('others', 'CAPTURE_REQUEST', {"name": CHAT.globalLoginParameter.loginId}); fw.sendToMsg("others", "CAPTURE_REQUEST", {
}) name: CHAT.globalLoginParameter.loginId,
});
});
}); });
function penOff() { function penOff() {
if ($('#penBtn').hasClass('bg_blue')) { if ($("#penBtn").hasClass("bg_blue")) {
$('#coviewPenCtrBtn').click(); $("#coviewPenCtrBtn").click();
$('#penBtn').addClass('bg_red'); $("#penBtn").addClass("bg_red");
$('#penBtn').removeClass('bg_blue'); $("#penBtn").removeClass("bg_blue");
} }
}; }
function includeJs(jsFilePath) {
var js = document.createElement("script");
js.type = "text/javascript";
js.src = jsFilePath;
document.body.appendChild(js);
}
function getTemplate(url) {
var template;
$.get({ url: url, async: false }, function (text) {
template = text;
});
return template;
}
function getNoResultMessage() {
const noResultMsg = $("<div/>", {
width: "auto",
style: "text-align: center",
});
noResultMsg.append(getLocalizedString("noResult"));
return noResultMsg;
}
// アコーディオン // アコーディオン
$('.category').on('click', function() { $(".category").on("click", function () {
$(this).toggleClass("open"); $(this).toggleClass("open");
$(this).next().slideToggle(); $(this).next().slideToggle();
}); });
$('.home_btn').on('click', function() { $(".home_btn").on("click", function () {
if (CHAT_UTIL.isAndroid()) { if (CHAT_UTIL.isAndroid()) {
android.goHome(); android.goHome();
} else if (CHAT_UTIL.isIOS()) { } else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({}); webkit.messageHandlers.goHome.postMessage({});
} }
}); });
$(function() {
document.addEventListener("DOMContentLoaded", function () {
var h = $(window).height(); //画面の高さを取得 var h = $(window).height(); //画面の高さを取得
// ローディング表示 // ローディング表示
...@@ -29,41 +56,40 @@ $(function() { ...@@ -29,41 +56,40 @@ $(function() {
$('.search_form input[type="search"]').click(function () { $('.search_form input[type="search"]').click(function () {
$(this).addClass("focus"); $(this).addClass("focus");
// キャンセルボタン表示 // キャンセルボタン表示
$('.cancel').removeClass('none'); $(".cancel").removeClass("none");
$('.search_form form').addClass('d-flex flex-row h-100 align-items-center'); $(".search_form form").addClass("d-flex flex-row h-100 align-items-center");
$('.content').addClass('none'); $(".content").addClass("none");
$('.craeteRoomButton').addClass('none'); $(".craeteRoomButton").addClass("none");
}); });
// 共通検索フォーム キャンセルボタン押下イベント // 共通検索フォーム キャンセルボタン押下イベント
$('.search_form .cancel').click(function(){ $(".search_form .cancel").click(function () {
$(this).addClass('none'); $(this).addClass("none");
$('.search_form input').removeClass('focus'); $(".search_form input").removeClass("focus");
$('.search_form input').val(''); $(".search_form input").val("");
$('.search_form form').removeClass(); $(".search_form form").removeClass();
$('.content').removeClass('none'); $(".content").removeClass("none");
$('.overlay_src_msg').empty(); $(".overlay_src_msg").empty();
$('.craeteRoomButton').removeClass('none'); $(".craeteRoomButton").removeClass("none");
}); });
$('.message_input_form').on('focus',function(e){ $(".message_input_form").on("focus", function (e) {
setTimeout(function() { setTimeout(function () {
$('.message_input_send').removeClass('none'); $(".message_input_send").removeClass("none");
$('.attach_file').addClass('none'); $(".attach_file").addClass("none");
$('.footer_content_b').addClass('none'); $(".footer_content_b").addClass("none");
}, 10); }, 10);
}); });
$('.message_input_form').on('focusout',function(e){ $(".message_input_form").on("focusout", function (e) {
setTimeout(function() { setTimeout(function () {
if($(e.relatedTarget).hasClass('message_input_send')){ if ($(e.relatedTarget).hasClass("message_input_send")) {
CHAT_UI.sendMessage(); CHAT_UI.sendMessage();
} else { } else {
$('.message_input_send').addClass('none'); $(".message_input_send").addClass("none");
$('.attach_file').removeClass('none'); $(".attach_file").removeClass("none");
$('.footer_content_b').removeClass('none'); $(".footer_content_b").removeClass("none");
} }
}, 10); }, 10);
}); });
}); });
...@@ -9,64 +9,157 @@ const readyState = { ...@@ -9,64 +9,157 @@ const readyState = {
COMPLETED: 4, COMPLETED: 4,
}; };
const messageType = { const MessageType = {
TEXT : 0 , TEXT: 0,
IMAGE : 1 , IMAGE: 1,
VIDEO : 2 , VIDEO: 2,
SYSTEM : 3 , SYSTEM: 3,
COMMUNICATIONSTART : 4, COMMUNICATIONSTART: 4,
COMMUNICATIONEND : 5 COMMUNICATIONEND: 5,
} };
const userAPICmd = {
MYINFO : 9
}
const chatRoomType = {
DM : "1",
GROUP : "0",
ALL : "2"
}
const groupSearchFlg = {
ROOT : "0"
}
const nameCardAreaId = { const ChatRoomType = {
MY : "myNamecard", DM: "1",
USER : "userNamecard" GROUP: "0",
} ALL: "2",
};
const collaborationTypeKey = { const CollaborationTypeKey = {
AUDIO : "audio", AUDIO: "audio",
CAMERA : "camera", CAMERA: "camera",
VIDEO : "video" , VIDEO: "video",
DOCUMENT : "document", DOCUMENT: "document",
BOARD : "board" BOARD: "board",
} };
const COLLABORATION_TYPE = { const COLLABORATION_TYPE = {
AUDIO : 0, AUDIO: 0,
CAMERA : 2, CAMERA: 2,
VIDEO : 3, VIDEO: 3,
DOCUMENT : 4, DOCUMENT: 4,
BOARD : 5 BOARD: 5,
} };
const makeRoomFlg = { const MakeRoomFlag = {
NAME_CARD : 0, NAME_CARD: 0,
MAKE_ROOM : 1 MAKE_ROOM: 1,
} };
const ANDROID_SDK_VERSION = { const ANDROID_SDK_VERSION = {
O : 26 O: 26,
} };
const HOST_REQUEST_FLG = { const HostRequestFlag = {
DONE : 0, DONE: 0,
DOING : 1 DOING: 1,
} };
const messageSeperator = "<::split>"; const messageSeperator = "<::split>";
const DATA_MESSAGE_SCHEME = "::NOT_MESSAGE"; const DATA_MESSAGE_SCHEME = "::NOT_MESSAGE";
const FINISH_ALL_COLLABORATION_SIGNAL = "::ALL_COLLABORATION_END"; const FINISH_ALL_COLLABORATION_SIGNAL = "::ALL_COLLABORATION_END";
const TemplateURL = {
GROUP_PATH: "./template/template_group_path.html",
GROUP_LIST: "./template/template_group_list.html",
ARCHIVE_LIST: "./template/template_archive_list.html",
MAKE_ROOM_GROUP_LIST: "./template/template_make_room_group_list.html",
GROUP_USER_LIST: "./template/template_group_user_list.html",
ROOM_LIST: "./template/template_room_list.html",
SYSTEM_MESSAGE: "./template/template_system_message.html",
USER_LIST: "./template/template_user_list.html",
USER_NAME_CARD: "./template/template_user_name_card.html",
USER_MESSAGE: "./template/template_user_message.html",
MY_NAME_CARD: "./template/template_my_name_card.html",
MY_MESSAGE: "./template/template_my_message.html",
OPEN_COLLABORATION_MESSAGE:
"./template/template_open_collaboration_message.html",
CHATROOM_USER_LIST: "./template/template_chatroom_user_list.html",
CHATROOM_USER_FILTER_LIST:
"./template/template_chatroom_user_filter_list.html",
MAKE_ROOM_USER_LIST: "./template/template_make_room_user_list.html",
MAKE_ROOM_GROUP_USER_LIST:
"./template/template_make_room_group_user_list.html",
MAKE_ROOM_GROUP_PATH: "./template/template_make_room_group_path.html",
MAKE_ROOM_CONFIRM_USER_LIST:
"./template/template_make_room_confirm_user_list.html",
ADD_USER_CONFIRM_USER_LIST:
"./template/template_add_user_confirm_user_list.html",
ADD_USER_USER_LIST: "./template/template_add_user_user_list.html",
ADD_USER_USER_LIST_IN_COLLABORATION:
"./template/template_add_user_user_list_in_collaboration.html",
ADD_USER_GROUP_PATH: "./template/template_add_user_group_path.html",
ADD_USER_GROUP_LIST: "./template/template_add_user_group_list.html",
ADD_USER_GROUP_LIST_IN_COLLABORATION:
"./template/template_add_user_group_list_in_collaboration.html",
ADD_USER_GROUP_USER_LIST: "./template/template_add_user_group_user_list.html",
ADD_USER_GROUP_USER_LIST_IN_COLLABORATION:
"./template/template_add_user_group_user_list_in_collaboration.html",
ADD_USER_GROUP_PATH_IN_COLLABORATION:
"./template/template_add_user_group_path_in_collaboration.html",
};
const SOCKET_KEY = {
CONNECT: "connect",
DISCONNECT: "disconnect",
CONNECT_ERROR: "connect_error",
NEW_MESSAGE: "newMessage",
NEW_NOTIFICATION: "newNotification",
REFRESH_GROUPLIST: "refreshGroupList",
REFRESH_USERLIST_INGROUP: "refreshUserListInGroup",
SHOW_SERVER_ERROR: "showServerError",
RETRY_JOIN_PROCESS: "retryJoinProcess",
JOIN: "join",
};
const NATIVE_KEY_IOS = {
getBeforeRoomType: "getBeforeRoomType",
getRoomType: "getRoomType",
removeFavoriteUser: "removeFavoriteUser",
addFavoriteUser: "addFavoriteUser",
removeFavoriteGroup: "removeFavoriteGroup",
addFavoriteGroup: "addFavoriteGroup",
getCollaborationJoinFlg: "getCollaborationJoinFlg",
getUserInfoList: "getUserInfoList",
createContentView: "createContentView",
getToMoveGroupId: "getToMoveGroupId",
getJoinCollaborationType: "getJoinCollaborationType",
getHostRequestFlg: "getHostRequestFlg",
getRoomList: "getRoomList",
getMyInfo: "getMyInfo",
getMessages: "getMessages",
getFavoriteUsersNotInRoom: "getFavoriteUsersNotInRoom",
getFavoriteUsers: "getFavoriteUsers",
getFavoriteGroups: "getFavoriteGroups",
getMyGroupUsers: "getMyGroupUsers",
getGroupInfo: "getGroupInfo",
getGroupInfoForAddUser: "getGroupInfoForAddUser",
getSelectedUserList: "getSelectedUserList",
getNameCardData: "getNameCardData",
getMyGroupShopMemberByName: "getMyGroupShopMemberByName",
getMyGroupShopMemberNotInRoomByName: "getMyGroupShopMemberNotInRoomByName",
getAllGroupShopMemberByName: "getAllGroupShopMemberByName",
getAllGroupShopMemberNotInRoomByName: "getAllGroupShopMemberNotInRoomByName",
getGroupByName: "getGroupByName",
getUsersInRoom: "getUsersInRoom",
getArchiveList: "getArchiveList",
getArchiveByName: "getArchiveByName",
getArchiveDetail: "getArchiveDetail",
searchMessages: "searchMessages",
getMyGroupUsersNotInRoom: "getMyGroupUsersNotInRoom",
getUserInfo: "getUserInfo",
getUserListByLoginId: "getUserListByLoginId",
};
const POST_MESSAGE_KEY = {
COLLABORATION_TYPE: "collaborationType",
MEETING_ID: "meetingId",
ROOM_ID: "roomId",
ROOM_NAME: "roomName",
USER_ID_LIST: "userIdList",
GROUP_ID: "groupId",
ROOM_TYPE: "roomType",
SCREEN_FLAG: "screenFlag",
IS_VOICE: "isVoice",
JOIN_COLLABORATION_TYPE: "joinCollaborationType",
CHANGE_COLLABORATION_TYPE: "changeCollaborationType"
};
// 名前空間 // 名前空間
var CONTACT = {}; var CONTACT = {};
$(function () { document.addEventListener("DOMContentLoaded", function () {
// メンバー検索 // メンバー検索
$('#contact .search_form input[type="search"]').keyup(function(e) { bindMemeberSearch();
var keyword = $('#contact .search_form input[type="search"]').val();
if (e.key == "Enter" || e.KeyCode == 13) {
if (keyword != '' && keyword.length != 0) {
$('#contact .search_form input[type="search"]').blur();
return;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return;
}
CONTACT.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#contact .search_form input[type="search"]').blur();
return;
}
});
// iOSキーボード変換検知用 // iOSキーボード変換検知用
$('#contact .search_form input[type="search"]').on('compositionend', function() { bindiOSKeyBoardEvent();
if (CHAT_UTIL.isIOS()) {
var keyword = $('#contact .search_form input[type="search"]').val();
CONTACT.searchUser(keyword);
}
});
}); });
// ユーザー検索 // ユーザー検索
CONTACT.searchUser = function(keyword) { CONTACT.searchUser = function (keyword) {
var groupList; const overlayMessage = $(".overlay_src_msg");
$('.overlay_src_msg').empty(); const isAllGroup = $("#tabAllGroup").is(":checked");
var isAllGroup = $('#tabAllGroup').is(':checked'); let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面 //全グループ検索画面
if (isAllGroup) { if (isAllGroup) {
//グループデータ検索 //グループデータ検索
groupList = CHAT_DB.getGroupByName(keyword); const groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate; groupDataSearch(groupList);
$.get({ url: "./template/template_group_list.html", async: false }
, function(text) { //ユーザデータ検索
groupTemplate = text; const userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0;
}
if (hasNoData) {
const noResultMsg = getNoResultMessage();
overlayMessage.append(noResultMsg);
}
};
/** UTILS */
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#contact .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
CONTACT.searchUser(keyword);
}
}); });
};
groupList.forEach(function(group) { var bindMemeberSearch = function () {
let html = Mustache.render(groupTemplate, { const searchInput = $('#contact .search_form input[type="search"]');
name: group.groupName, searchInput.keyup(function (e) {
id: group.groupId, const keyword = searchInput.val();
isFavorite: group.isFavorite const enterKeyPressed = e.key == "Enter" || e.KeyCode == 13;
const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword != "" && keyword.length != 0;
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return;
}
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
return;
}
CONTACT.searchUser(keyword);
if (enterKeyPressed) {
searchInput.blur();
return;
}
}); });
};
var groupDataSearch = function (groupList) {
const groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
groupList.forEach(function (group) {
let html = renderGroupList(
groupTemplate,
group.groupName,
group.groupId,
group.isFavorite
);
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); $(".overlay_src_msg").append(obj);
}) });
};
//ユーザデータ検索 var renderGroupList = function (url, groupName, groupID, isFavorite) {
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword); return Mustache.render(url, {
var userTemplate; name: groupName,
$.get({ url: "./template/template_user_list.html", async: false } id: groupID,
, function(text) { isFavorite: isFavorite,
userTemplate = text;
}); });
userList.forEach(function(user) { };
var userDataSearch = function (userList) {
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
}); });
let html = Mustache.render(userTemplate, { var userTemplate = getTemplate(TemplateURL.USER_LIST);
userList: userList let html = renderUserList(userTemplate, userList);
});
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); $(".overlay_src_msg").append(obj);
if (userList.length == 0 && groupList.length == 0) { };
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult")) var renderUserList = function (url, userList) {
$('.overlay_src_msg').append(noResultMsg); return Mustache.render(url, {
} userList: userList,
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate;
$.get({ url: "./template/template_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(userTemplate, {
userList: userList
}); });
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').html(obj);
if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
}
}; };
\ No newline at end of file
$(window).on('load',function () { //読み込み完了したら実行する $(window).on("load", function () {
$('#loader-bg').delay(900).fadeOut(800);//ローディングを隠す //読み込み完了したら実行する
$('#loader').delay(600).fadeOut(300); $("#loader-bg").delay(900).fadeOut(800); //ローディングを隠す
$("#loader").delay(600).fadeOut(300);
}); });
$(function () { document.addEventListener('DOMContentLoaded', function() {
setTimeout("stopload()", 3000); //いつまでもローディング状態にならないように10秒で強制表示させる setTimeout("stopload()", 3000); //いつまでもローディング状態にならないように10秒で強制表示させる
}); });
......
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