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);
......
...@@ -41,16 +41,19 @@ ...@@ -41,16 +41,19 @@
<!-- コンテンツ --> <!-- コンテンツ -->
<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>
</div> </label>
<input type="text" class="input_name_room" name="room_name" placeholder="ルーム名を入力してください" id="roomNameInput"
maxlength="20">
</div>
<!-- ルーム名変更ボタン --> <!-- ルーム名変更ボタン -->
<div class="change_room_name_btn"> <div class="change_room_name_btn">
<button type="button" name="button" id="roomNameChangeBtn">保存</button> <button type="button" name="button" id="roomNameChangeBtn">保存</button>
</div> </div>
</main> </main>
<div id="loadingArea"></div> <div id="loadingArea"></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("");
...@@ -205,4 +212,4 @@ ...@@ -205,4 +212,4 @@
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -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
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!-- Required meta tags --> <!-- Required meta tags -->
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" <meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1, user-scalable=0"> content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1, user-scalable=0">
<title>LiveTaskyell</title> <title>LiveTaskyell</title>
<link rel="stylesheet" href="./css/notosansjp.css"> <link rel="stylesheet" href="./css/notosansjp.css">
<link href="./fontawesome/css/all.css" rel="stylesheet"> <link href="./fontawesome/css/all.css" rel="stylesheet">
...@@ -20,78 +20,82 @@ ...@@ -20,78 +20,82 @@
</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>
<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 add_user_btn"></button> <button type="button" name="button" class="btn add_user_btn"></button>
<button type="button" name="button" class="btn menu_btn"></button> <button type="button" name="button" class="btn menu_btn"></button>
<button type="button" name="button" class="btn start_pip_btn" onclick="startPipMode();"></button> <button type="button" name="button" class="btn start_pip_btn" onclick="startPipMode();"></button>
</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/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="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="./js/chat-websocket-message.js"></script>
<script src="./js/share.js"></script> <script src="./js/chat-websocket-refresh-group-list.js"></script>
<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,8 +184,8 @@ ...@@ -180,8 +184,8 @@
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');
} }
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
...@@ -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,65 +131,70 @@ ...@@ -131,65 +131,70 @@
<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>
<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");
$("#modal_collabo_capture").load("./modal_collabo_capture.html"); $("#modal_collabo_capture").load("./modal_collabo_capture.html");
$("#modal_collabo_profile2").load("./modal_collabo_profile2.html"); $("#modal_collabo_profile2").load("./modal_collabo_profile2.html");
$("#collaboration_video_overlay_menu").load("./collaboration_video_overlay_menu.html"); $("#collaboration_video_overlay_menu").load("./collaboration_video_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html"); $("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html"); $("#zoom").load("./zoom.html");
let CHAT_SERVER_URL = ''; let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = ''; let CMS_SERVER_URL = '';
let ASSET_PATH = './'; let ASSET_PATH = './';
let PLATFORM = ''; let PLATFORM = '';
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
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();
} else { } else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({}); webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({}); webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
}
if (roomType == chatRoomType.DM) { async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
$('.add_user_btn').removeClass('none'); CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
} }
};
</script>
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = collaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
});
}
};
</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,8 +117,8 @@ ...@@ -113,8 +117,8 @@
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');
} }
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
...@@ -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,8 +176,8 @@ ...@@ -172,8 +176,8 @@
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');
} }
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
...@@ -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();
return; ARCHIVE_UI.refreshSearchScreen = function (keyword) {
} const archiveList = CHAT_DB.getArchiveByName(keyword);
} else if (keyword == '' || keyword.length < 2) { const typeImage = getArchiveTypeIconURL(archive.archiveType);
$('.overlay_src_msg').empty();
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 (keywordEmpty) {
$(".overlay_src_msg").empty();
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, { var renderArchiveTemplate = function (
archiveId: archive.archiveId, html,
fileName: archive.archiveName, archiveId,
insertDate: archive.archiveDate, archiveName,
typeImage: typeImage archiveDate,
}); typeImageURL
) {
let obj = jQuery.parseHTML(html); return Mustache.render(html, {
$('.overlay_src_msg').append(obj); 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キーボード変換検知用
let contactListTitle = getLocalizedString("userSearch"); bindiOSKeyBoardEvent();
$('#addUserTitle').text(contactListTitle); });
})
// ユーザー検索
$('#chat_add_user .search_form input[type="search"]').keyup(function(e){ CHAT_ADD_USER.searchUser = function (keyword) {
var keyword = $('#chat_add_user .search_form input[type="search"]').val(); const isAllGroup = $("#tabAllGroupOnAddUser").is(":checked");
if (e.key == "Enter" || e.KeyCode == 13) { const overlayMessage = $(".overlay_src_msg");
if (keyword != '' && keyword.length != 0) { let hasNoData = false;
$('#chat_add_user .search_form input[type="search"]').blur(); overlayMessage.empty();
return false;
} //全グループ検索画面
} else if (keyword == '' || keyword.length < 2) { if (isAllGroup) {
$('.overlay_src_msg').empty(); //グループデータ検索
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");
$("#addUserTitle").text(contactListTitle);
});
searchInput.keyup(function (e) {
const keyword = searchInput.val();
const enterKeyPressed = e.key == "Enter" || e.KeyCode == 13;
const keywordNotEmpty = keyword != "" && keyword.length != 0;
const keywordEmpty = keyword == "" || keyword.length < 2;
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return false; return false;
}
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
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) {
return; searchInput.blur();
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) {
let html = renderGroupTemplate(
//全グループ検索画面 groupTemplate,
if (isAllGroup) { group.groupName,
//グループデータ検索 group.groupId
var groupList = CHAT_DB.getGroupByName(keyword); );
var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false } let obj = jQuery.parseHTML(html);
, function(text) { overlayMessage.append(obj);
groupTemplate = text; });
}); };
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,
}); });
};
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); var searchUserData = function (userList) {
}) const userTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
userList.forEach(function (user) {
//ユーザデータ検索 setUserProfile(user);
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword); checkUser(user);
var userTemplate; });
$.get({ url: "./template/template_make_room_user_list.html", async: false } let html = renderUserTemplate(userTemplate, userList);
, function(text) { let obj = jQuery.parseHTML(html);
userTemplate = text; overlayMessage.append(obj);
}); };
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); var setUserProfile = function (user) {
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
return shopMemberId == user.shopMemberId; };
})
if (findObj) { var checkUser = function (user) {
user.checked = 'checked'; let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
} return shopMemberId == user.shopMemberId;
}); });
let html = Mustache.render(userTemplate, { if (findObj) {
userList: userList user.checked = "checked";
}); }
let obj = jQuery.parseHTML(html); };
$('.overlay_src_msg').append(obj);
if (userList.length == 0 && groupList.length == 0) { var renderUserTemplate = function (userTemplate, userList) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); return Mustache.render(userTemplate, {
noResultMsg.append(getLocalizedString("noResult")) userList: userList,
$('.overlay_src_msg').append(noResultMsg); });
}
  //連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == user.shopMemberId;
})
if (findObj) {
user.checked = 'checked';
}
});
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').html(obj);
if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
}
}; };
// 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()) {
android.goHome(); android.goHome();
} }
}); });
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()) {
android.reload(); android.reload();
} }
}); });
\ No newline at end of file
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;
} }
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.changeRoomName.postMessage(changeRoomName); webkit.messageHandlers.changeRoomName.postMessage(changeRoomName);
} 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;
} }
let rntDate = new Object(); let rntDate = new Object();
rntDate.createdAtDay = createdAtDay; rntDate.createdAtDay = createdAtDay;
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 uuid; return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
}
);
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
case COLLABORATION_TYPE.AUDIO: ) {
console.log(collaborationTypeKey.AUDIO); switch (joinCollaborationType) {
return collaborationTypeKey.AUDIO; case COLLABORATION_TYPE.AUDIO:
case COLLABORATION_TYPE.CAMERA: console.log(CollaborationTypeKey.AUDIO);
console.log(collaborationTypeKey.CAMERA); return CollaborationTypeKey.AUDIO;
return collaborationTypeKey.CAMERA; case COLLABORATION_TYPE.CAMERA:
case COLLABORATION_TYPE.VIDEO: console.log(CollaborationTypeKey.CAMERA);
return collaborationTypeKey.VIDEO; return CollaborationTypeKey.CAMERA;
case COLLABORATION_TYPE.DOCUMENT: case COLLABORATION_TYPE.VIDEO:
return collaborationTypeKey.DOCUMENT; return CollaborationTypeKey.VIDEO;
case COLLABORATION_TYPE.BOARD: case COLLABORATION_TYPE.DOCUMENT:
return collaborationTypeKey.BOARD; return CollaborationTypeKey.DOCUMENT;
default: case COLLABORATION_TYPE.BOARD:
return 0; return CollaborationTypeKey.BOARD;
} default:
} 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); // iOSキーボード変換検知用
}); bindiOSKeyBoardEvent();
$('#chatMakeRoom .search_form input[type="search"]').keyup(function(e) {
//画面タイトル設定
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
if (e.KeyCode == 13 || e.key == "Enter") {
if (keyword != '' && keyword.length != 0) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return false;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return false;
}
CHAT_MAKE_ROOM.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return;
}
});
// iOSキーボード変換検知用
$('#chatMakeRoom .search_form input[type="search"]').on('compositionend', function() {
if (CHAT_UTIL.isIOS()) {
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
CHAT_MAKE_ROOM.searchUser(keyword);
}
});
}); });
// メンバー検索 // メンバー検索
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) {
//グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) {
renderRoomList(groupTemplate, group.groupName, group.groupId);
let obj = jQuery.parseHTML(html);
overlayMessage.append(obj);
});
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList);
let obj = jQuery.parseHTML(html);
overlayMessage.append(obj);
hasNoData = groupList.length == 0 && userList.length == 0;
//連絡先画面
} else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
searchUserData();
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList);
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").html(obj);
//全グループ検索画面 hasNoData = userList.length == 0;
if (isAllGroup) { }
//グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
groupList.forEach(function(group) { if (hasNoData) {
let html = Mustache.render(groupTemplate, { const noResultMsg = getNoResultMessage();
name: group.groupName, overlayMessage.append(noResultMsg);
id: group.groupId, }
}); };
let obj = jQuery.parseHTML(html); /** UTIL */
$('.overlay_src_msg').append(obj);
})
//ユーザデータ検索 var searchMember = function () {
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword); const searchInput = $('#chatMakeRoom .search_form input[type="search"]');
var userTemplate; searchInput.click(function (e) {
$.get({ url: "./template/template_make_room_user_list.html", async: false } let contactListTitle = getLocalizedString("userSearch");
, function(text) { $("#makeRoomTitle").text(contactListTitle);
userTemplate = text; });
}); searchInput.keyup(function (e) {
userList.forEach(function(user) { const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); const keywordEmpty = keyword == "" || keyword.length < 2;
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { const keywordNotEmpty = keyword != "" && keyword.length != 0;
return shopMemberId == user.shopMemberId; //画面タイトル設定
}) var keyword = searchInput.val();
if (findObj) { if (enterKeyPressed) {
user.checked = 'checked'; if (keywordNotEmpty) {
} searchInput.blur();
}); return false;
let html = Mustache.render(userTemplate, { }
userList: userList } else if (keywordEmpty) {
}); $(".overlay_src_msg").empty();
let obj = jQuery.parseHTML(html); return false;
$('.overlay_src_msg').append(obj);
if (groupList.length == 0 && userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
  //連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == user.shopMemberId;
})
if (findObj) {
user.checked = 'checked';
}
});
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').html(obj);
if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
} }
} CHAT_MAKE_ROOM.searchUser(keyword);
if (enterKeyPressed) {
searchInput.blur();
return;
}
});
};
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#chatMakeRoom .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
CHAT_MAKE_ROOM.searchUser(keyword);
}
});
};
var renderRoomList = function (url, groupName, groupID) {
return Mustache.render(url, {
name: groupName,
id: groupID,
});
};
var searchUserData = function (userList) {
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
return shopMemberId == user.shopMemberId;
});
if (findObj) {
user.checked = "checked";
}
});
};
var renderUser = function (url, userList) {
return Mustache.render(url, {
userList: userList,
});
};
$(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 {
...@@ -33,7 +31,7 @@ $(function () { ...@@ -33,7 +31,7 @@ $(function () {
$(".footer_menu_btn").click(function () { $(".footer_menu_btn").click(function () {
var h_active = $("#collabo_footer").height(); var h_active = $("#collabo_footer").height();
var h_hide = h_active - $("#collabo_footer_menu").height(); var h_hide = h_active - $("#collabo_footer_menu").height();
// 非アクティブ時 // 非アクティブ時
if ($(this).hasClass("hide")) { if ($(this).hasClass("hide")) {
$(this).removeClass("hide"); $(this).removeClass("hide");
...@@ -70,60 +68,66 @@ $(function () { ...@@ -70,60 +68,66 @@ $(function () {
// ユーザー招待メンバー検索 // ユーザー招待メンバー検索
$(".add_user_btn").click(function () { $(".add_user_btn").click(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 () {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(",")); $("#addUserInCollaboration").modal("hide");
} else { if (typeof android != "undefined") {
webkit.messageHandlers.saveSelectedUserList.postMessage(CHAT.globalSelectedUserList.join(",")); android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
} } else {
CHAT_UI.confirmInviteUserListInCollaboration(); webkit.messageHandlers.saveSelectedUserList.postMessage(
CHAT.globalSelectedUserList.join(",")
);
}
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) { // iOSキーボード変換検知用
if (keyword != '' && keyword.length != 0) { bindiOSKeyBoardEvent();
$('#contact .search_form input[type="search"]').blur();
return;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return;
}
CONTACT.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#contact .search_form input[type="search"]').blur();
return;
}
});
// iOSキーボード変換検知用
$('#contact .search_form input[type="search"]').on('compositionend', function() {
if (CHAT_UTIL.isIOS()) {
var keyword = $('#contact .search_form input[type="search"]').val();
CONTACT.searchUser(keyword);
}
});
}); });
// ユーザー検索 // ユーザー検索
CONTACT.searchUser = function(keyword) { 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); //グループデータ検索
var groupTemplate; const groupList = CHAT_DB.getGroupByName(keyword);
$.get({ url: "./template/template_group_list.html", async: false } groupDataSearch(groupList);
, function(text) {
groupTemplate = text; //ユーザデータ検索
}); const userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
userDataSearch(userList);
groupList.forEach(function(group) {
let html = Mustache.render(groupTemplate, { hasNoData = userList.length == 0 && groupList.length == 0;
name: group.groupName,
id: group.groupId,
isFavorite: group.isFavorite
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
})
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
var userTemplate;
$.get({ url: "./template/template_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
if (userList.length == 0 && groupList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
//連絡先画面 //連絡先画面
} else { } else {
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword); const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate; userDataSearch(userList);
$.get({ url: "./template/template_user_list.html", async: false }
, function(text) { hasNoData = userList.length == 0;
userTemplate = text; }
});
userList.forEach(function(user) { if (hasNoData) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); const noResultMsg = getNoResultMessage();
}); overlayMessage.append(noResultMsg);
let html = Mustache.render(userTemplate, { }
userList: userList };
});
let obj = jQuery.parseHTML(html); /** UTILS */
$('.overlay_src_msg').html(obj);
if (userList.length == 0) { var bindiOSKeyBoardEvent = function () {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); const searchInput = $('#contact .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();
CONTACT.searchUser(keyword);
} }
});
}; };
var bindMemeberSearch = function () {
const searchInput = $('#contact .search_form input[type="search"]');
searchInput.keyup(function (e) {
const keyword = searchInput.val();
const enterKeyPressed = e.key == "Enter" || e.KeyCode == 13;
const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword != "" && keyword.length != 0;
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return;
}
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
return;
}
CONTACT.searchUser(keyword);
if (enterKeyPressed) {
searchInput.blur();
return;
}
});
};
var groupDataSearch = function (groupList) {
const groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
groupList.forEach(function (group) {
let html = renderGroupList(
groupTemplate,
group.groupName,
group.groupId,
group.isFavorite
);
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").append(obj);
});
};
var renderGroupList = function (url, groupName, groupID, isFavorite) {
return Mustache.render(url, {
name: groupName,
id: groupID,
isFavorite: isFavorite,
});
};
var userDataSearch = function (userList) {
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
var userTemplate = getTemplate(TemplateURL.USER_LIST);
let html = renderUserList(userTemplate, userList);
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").append(obj);
};
var renderUserList = function (url, userList) {
return Mustache.render(url, {
userList: userList,
});
};
\ No newline at end of file
$(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