Commit 6d617479 by Kim Peace

Merge branch 'refactoring/prettier' into 'develop'

Refactoring/prettier

See merge request !172
parents b8fab3f1 a1bee735
......@@ -108,6 +108,7 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script id="archive-template" type="text/template">
<li class="d-flex align-items-center">
......
......@@ -82,6 +82,7 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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">
<div id="archive_player" class="player">
......
......@@ -115,6 +115,7 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
......@@ -142,7 +143,7 @@
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
console.log("onChat");
CHAT_UI.refreshRoomList(chatRoomType.GROUP);
CHAT_UI.refreshRoomList(ChatRoomType.GROUP);
CHAT_UI.dismissLoadingIndicator();
};
</script>
......
......@@ -142,6 +142,7 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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>
String.prototype.replaceAll = function(org, dest) {
......
......@@ -75,6 +75,7 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
......
......@@ -43,8 +43,11 @@
<main id="chat_change_room_name">
<!-- ルーム名入力 -->
<div class="room_name">
<label for="room_name"><h2>ルーム名</h2></label>
<input type="text" class="input_name_room" name="room_name" placeholder="ルーム名を入力してください" id="roomNameInput" maxlength="20">
<label for="room_name">
<h2>ルーム名</h2>
</label>
<input type="text" class="input_name_room" name="room_name" placeholder="ルーム名を入力してください" id="roomNameInput"
maxlength="20">
</div>
<!-- ルーム名変更ボタン -->
......@@ -72,10 +75,14 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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-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>
String.prototype.replaceAll = function(org, dest) {
String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
......@@ -86,7 +93,7 @@
let IS_ONLINE = false;
let roomId = 0;
$("#loadingArea").load("./loading.html");
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
......
......@@ -144,6 +144,7 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
......
......@@ -80,6 +80,7 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
......
......@@ -44,7 +44,8 @@
<div class="col-4 pl-0">
<div class="nav-item text-right">
<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><!-- .col -->
</div><!-- .row -->
......@@ -94,8 +95,10 @@
<input class="d-none" type="file" name="image" id="videoInputTag" accept="video/mp4">
</form>
</div>
<input type="text" name="message" class="message_input_form" id="messageInput" placeholder="メッセージを入力してください" maxlength="600">
<button type="button" name="button" class="message_input_send none" id="messageSend" onclick="CHAT_UI.sendMessage(this);">送信</button>
<input type="text" name="message" class="message_input_form" id="messageInput" placeholder="メッセージを入力してください"
maxlength="600">
<button type="button" name="button" class="message_input_send none" id="messageSend"
onclick="CHAT_UI.sendMessage(this);">送信</button>
</div>
</div>
<!-- フッター下 -->
......@@ -160,7 +163,11 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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-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>
function imageModal(image) {
......@@ -168,7 +175,7 @@
$('#pictureModalCenter').modal('show');
}
String.prototype.replaceAll = function(org, dest) {
String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest);
}
......@@ -183,7 +190,7 @@
$("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html");
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
android.saveSelectedUserList("");
......
......@@ -27,10 +27,12 @@
</div>
<div class="collabo_nav_r">
<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 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> -->
</div>
</div>
......@@ -57,7 +59,7 @@
<!-- ユーザー追加オーバーレイ -->
<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>
......@@ -169,11 +171,15 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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_ko.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/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="./js/share.js"></script>
<script>
......@@ -198,7 +204,7 @@
let joinMeetingId = 0;
let androidVersion = 0;
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
......@@ -208,12 +214,12 @@
roomType = CHAT_DB.getRoomType();
}
if (roomType == chatRoomType.DM) {
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
}
function startPipMode() {
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.startPipMode();
} else {
webkit.messageHandlers.startPipMode.postMessage({});
......@@ -226,7 +232,7 @@
}
}
String.prototype.replaceAll = function(org, dest) {
String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest);
}
......@@ -253,10 +259,11 @@
globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType);
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
socket.emit('join', CHAT.globalLoginParameter, function () {
});
}
};
</script>
</body>
</html>
\ No newline at end of file
......@@ -20,8 +20,8 @@
</head>
<body>
<!-- ナビメニュー -->
<header id="collabo_header">
<!-- ナビメニュー -->
<header id="collabo_header">
<div class="d-flex align-items-center h-100">
<div class="collabo_nav_l text-left w-100">
</div>
......@@ -33,65 +33,69 @@
</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="coview_share_body coview_share_area" id="coviewShare" style="z-index: 1;">
</div>
</div>
</main>
</main>
<!-- オーバーレイ メニュー -->
<div id="collaboration_voice_overlay_menu"></div>
<!-- オーバーレイ ユーザーリスト -->
<div id="overlay_user_list" class="overlay slidein" style="z-index: 3;">
<!-- オーバーレイ メニュー -->
<div id="collaboration_voice_overlay_menu"></div>
<!-- オーバーレイ ユーザーリスト -->
<div id="overlay_user_list" class="overlay slidein" style="z-index: 3;">
<div id="collaboration_overlay_user_list"></div>
</div>
</div>
<!-- プロフィールモーダル -->
<div id="userProfileModalInCollaboration"></div>
<div id="modal_collabo_profile2"></div>
<div id="add_user_list" ></div>
<div id="modal_add_user_confirm" ></div>
<!-- ホスト変更モーダル -->
<div id="modal_collabo_change_host"></div>
<!-- プロフィールモーダル -->
<div id="userProfileModalInCollaboration"></div>
<div id="modal_collabo_profile2"></div>
<div id="add_user_list"></div>
<div id="modal_add_user_confirm"></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="loadingArea"></div>
<div class="pip_indicator none" onclick="finishPipMode();">
<!-- フッター -->
<div id="footer_collabo"></div>
<div id="loadingArea"></div>
<div class="pip_indicator none" onclick="finishPipMode();">
<div style="vertical-align: middle;display: table-cell;">協業中
</div>
</div>
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/socket.io.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/ja.js" charset="UTF-8"></script>
<script src="./js/libs/mustache.min.js"></script>
<script src="./js/libs/bootstrap.min.js"></script>
<script src="./js/libs/jquery.mark.min.js"></script>
<script src="./js/constant.js"></script>
<script src="./js/collaboration.js"></script>
<script src="./js/common.js"></script>
<script src="./js/loading.js"></script>
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script>
<script src="./js/language.js"></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_en.js" charset="UTF-8"></script>
<script src="./js/chat-websocket.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
<script>
</div>
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/socket.io.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/ja.js" charset="UTF-8"></script>
<script src="./js/libs/mustache.min.js"></script>
<script src="./js/libs/bootstrap.min.js"></script>
<script src="./js/libs/jquery.mark.min.js"></script>
<script src="./js/constant.js"></script>
<script src="./js/collaboration.js"></script>
<script src="./js/common.js"></script>
<script src="./js/loading.js"></script>
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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_ko.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/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="./js/share.js"></script>
<script>
$("#footer_collabo").load("./footer_collabo.html");
$("#modal_collabo_host_request").load("./modal_collabo_host_request.html");
$("#modal_collabo_change_host").load("./modal_collabo_change_host.html");
......@@ -109,7 +113,7 @@
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
......@@ -118,7 +122,7 @@
}
function startPipMode() {
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.startPipMode();
} else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.startPipMode.postMessage({});
......@@ -142,9 +146,9 @@
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
}
globalUserInfo.coWorkType = collaborationTypeKey.DOCUMENT;
globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT;
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
socket.emit('join', CHAT.globalLoginParameter, function () {
});
};
......
......@@ -55,7 +55,7 @@
<!-- ユーザー追加オーバーレイ -->
<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>
......@@ -144,11 +144,15 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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_ko.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/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="./js/share.js"></script>
<script>
......@@ -170,7 +174,7 @@
let collaborationJoinFlg = 0;
let roomType;
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
......@@ -180,7 +184,7 @@
roomType = CHAT_DB.getRoomType();
}
if (roomType == chatRoomType.DM) {
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
}
......@@ -196,13 +200,14 @@
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = collaborationTypeKey.CAMERA;
globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
socket.emit('join', CHAT.globalLoginParameter, function () {
});
}
};
</script>
</body>
</html>
\ No newline at end of file
......@@ -54,7 +54,7 @@
<!-- ユーザー追加オーバーレイ -->
<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>
......@@ -102,7 +102,7 @@
</div>
<div class="d-flex align-items-center h-100">
<div class="footer_menu_item">
<!-- <a href="#" data-toggle="modal" data-target="#captyaModal">-->
<!-- <a href="#" data-toggle="modal" data-target="#captyaModal">-->
<a href="#">
<div class="img_wrap wide bg_blue" id="captureBtn">
<img src="icon/icon_collabo_capture.png" alt="キャプチャ">
......@@ -131,11 +131,15 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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_ko.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/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="./js/share.js"></script>
</body>
......@@ -158,7 +162,7 @@
let collaborationJoinFlg = 0;
let roomType;
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
......@@ -168,7 +172,7 @@
roomType = CHAT_DB.getRoomType();
}
if (roomType == chatRoomType.DM) {
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
}
......@@ -184,12 +188,13 @@
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = collaborationTypeKey.VIDEO;
globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
socket.emit('join', CHAT.globalLoginParameter, function () {
});
}
};
</script>
</script>
</html>
\ No newline at end of file
......@@ -54,7 +54,7 @@
<div id="userProfileModalInCollaboration"></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_collabo_change_host"></div>
......@@ -78,11 +78,15 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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_ko.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/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="./js/share.js"></script>
<script>
......@@ -103,7 +107,7 @@
let collaborationJoinFlg = 0;
let roomType;
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
......@@ -113,7 +117,7 @@
roomType = CHAT_DB.getRoomType();
}
if (roomType == chatRoomType.DM) {
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
}
......@@ -129,10 +133,10 @@
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = collaborationTypeKey.AUDIO;
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
socket.emit('join', CHAT.globalLoginParameter, function () {
});
}
};
......
......@@ -54,7 +54,7 @@
<!-- ユーザー追加オーバーレイ -->
<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>
......@@ -136,11 +136,15 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.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_ko.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/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="./js/share.js"></script>
<script>
......@@ -162,7 +166,7 @@
let collaborationJoinFlg = 0;
let roomType;
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
......@@ -172,7 +176,7 @@
roomType = CHAT_DB.getRoomType();
}
if (roomType == chatRoomType.DM) {
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
}
......@@ -187,10 +191,10 @@
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
}
globalUserInfo.coWorkType = collaborationTypeKey.BOARD;
globalUserInfo.coWorkType = CollaborationTypeKey.BOARD;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
socket.emit('join', CHAT.globalLoginParameter, function () {
});
}
};
......
......@@ -191,6 +191,7 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<script>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
......
// 名前空間
var ARCHIVE_UI = {};
$(function() {
document.addEventListener("DOMContentLoaded", function () {
// アーカイブ検索
$('#archive .search_form input[type="search"]').keyup(function(e) {
var keyword = $('#archive .search_form input[type="search"]').val();
if (e.KeyCode == 13 || e.key == "Enter") {
if (keyword.length != 0 && keyword != '') {
$('#archive .search_form input[type="search"]').blur();
bindArchiveSearch();
// iOSキーボード変換検知用
bindiOSKeyBoardEvent();
});
ARCHIVE_UI.refreshSearchScreen = function (keyword) {
const archiveList = CHAT_DB.getArchiveByName(keyword);
const typeImage = getArchiveTypeIconURL(archive.archiveType);
getArchiveTemplate().then(function (archiveTemplate) {
archiveList.forEach(function (archive) {
let html = renderArchiveTemplate(
archiveTemplate,
archive.archiveId,
archive.archiveName,
archive.archiveDate,
typeImage
);
let obj = jQuery.parseHTML(html);
$(".overlay_src_msg").append(obj);
});
});
};
//* UTILS *//
const ARCHIVE_TYPE = {
PICTURE: 0,
VIDEO: 1,
VOICE: 2,
DOCUMENT: 3,
};
var getArchiveTypeIconURL = function (type) {
switch (type) {
case ARCHIVE_TYPE.PICTURE:
return "icon/icon_collabo_picture.png";
case ARCHIVE_TYPE.VIDEO:
return "icon/icon_collabo_videocam.png";
case ARCHIVE_TYPE.VOICE:
return "icon/icon_collabo_headset.png";
case ARCHIVE_TYPE.DOCUMENT:
return "icon/icon_collabo_document.png";
default:
return "";
}
};
var getArchiveTemplate = function () {
return new Promise(function (resolve, reject) {
$.get({ url: TemplateURL.ARCHIVE_LIST, async: false }, function (text) {
resolve(text);
});
});
};
var bindArchiveSearch = function () {
const searchInput = $('#archive .search_form input[type="search"]');
searchInput.keyup(function (e) {
var keyword = searchInput.val();
const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword.length != 0 && keyword != "";
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
return;
}
$('.overlay_src_msg').empty();
$(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword);
if (e.KeyCode == 13 || e.key == "Enter") {
$('#archive .search_form input[type="search"]').blur();
if (enterKeyPressed) {
searchInput.blur();
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()) {
var keyword = $('#archive .search_form input[type="search"]').val();
$('.overlay_src_msg').empty();
var keyword = searchInput.val();
$(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword);
}
});
});
ARCHIVE_UI.refreshSearchScreen = function(keyword) {
var archiveList = CHAT_DB.getArchiveByName(keyword);
var archiveTemplate;
$.get({ url: "./template/template_archive_list.html", async: false }
, function(text) {
archiveTemplate = text;
});
archiveList.forEach(function(archive) {
var typeImage = "";
switch(archive.archiveType) {
case 0: // 画像
typeImage = "icon/icon_collabo_picture.png";
break;
case 1: // 動画
typeImage = "icon/icon_collabo_videocam.png";
break;
case 2: // 音声
typeImage = "icon/icon_collabo_headset.png";
break;
case 3: // 文書
typeImage = "icon/icon_collabo_document.png";
break;
default: // その他
typeImage = "";
}
let html = Mustache.render(archiveTemplate, {
archiveId: archive.archiveId,
fileName: archive.archiveName,
insertDate: archive.archiveDate,
typeImage: typeImage
});
};
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
var renderArchiveTemplate = function (
html,
archiveId,
archiveName,
archiveDate,
typeImageURL
) {
return Mustache.render(html, {
archiveId: archiveId,
fileName: archiveName,
insertDate: archiveDate,
typeImage: typeImageURL,
});
};
// 名前空間
var CHAT_ADD_USER = {};
$(function() {
document.addEventListener("DOMContentLoaded", function () {
// メンバー検索
$('#chat_add_user .search_form input[type="search"]').click(function(e){
bindMemberSearch();
// iOSキーボード変換検知用
bindiOSKeyBoardEvent();
});
// ユーザー検索
CHAT_ADD_USER.searchUser = function (keyword) {
const isAllGroup = $("#tabAllGroupOnAddUser").is(":checked");
const overlayMessage = $(".overlay_src_msg");
let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
const groupList = CHAT_DB.getGroupByName(keyword);
searchGroupData(groupList);
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList);
hasNoData = userList.length == 0;
}
// Set NoResult
if (hasNoData) {
const noResultMessage = getNoResultMessage();
overlayMessage.append(noResultMessage);
}
};
/** UTILS */
var bindMemberSearch = function () {
const searchInput = $('#chat_add_user .search_form input[type="search"]');
searchInput.click(function (e) {
//画面タイトル設定
let contactListTitle = getLocalizedString("userSearch");
$('#addUserTitle').text(contactListTitle);
})
$('#chat_add_user .search_form input[type="search"]').keyup(function(e){
var keyword = $('#chat_add_user .search_form input[type="search"]').val();
if (e.key == "Enter" || e.KeyCode == 13) {
if (keyword != '' && keyword.length != 0) {
$('#chat_add_user .search_form input[type="search"]').blur();
$("#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;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
return false;
}
CHAT_ADD_USER.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#chat_add_user .search_form input[type="search"]').blur();
if (enterKeyPressed) {
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()) {
var keyword = $('#chat_add_user .search_form input[type="search"]').val();
var keyword = searchInput.val();
CHAT_ADD_USER.searchUser(keyword);
}
});
});
};
// ユーザー検索
CHAT_ADD_USER.searchUser = function(keyword) {
var isAllGroup = $('#tabAllGroupOnAddUser').is(':checked');
$('.overlay_src_msg').empty();
var searchGroupData = function (groupList) {
const groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false }
, function(text) {
groupTemplate = text;
groupList.forEach(function (group) {
let html = renderGroupTemplate(
groupTemplate,
group.groupName,
group.groupId
);
let obj = jQuery.parseHTML(html);
overlayMessage.append(obj);
});
};
groupList.forEach(function(group) {
let html = Mustache.render(groupTemplate, {
name: group.groupName,
id: group.groupId,
var renderGroupTemplate = function (groupTemplate, groupName, groupID) {
return Mustache.render(groupTemplate, {
name: groupName,
id: groupID,
});
};
var searchUserData = function (userList) {
const userTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
userList.forEach(function (user) {
setUserProfile(user);
checkUser(user);
});
let html = renderUserTemplate(userTemplate, userList);
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
})
overlayMessage.append(obj);
};
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
var setUserProfile = function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
};
var checkUser = function (user) {
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
return shopMemberId == user.shopMemberId;
})
if (findObj) {
user.checked = 'checked';
}
});
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
if (userList.length == 0 && groupList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
  //連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == user.shopMemberId;
})
if (findObj) {
user.checked = 'checked';
user.checked = "checked";
}
};
var renderUserTemplate = function (userTemplate, userList) {
return Mustache.render(userTemplate, {
userList: userList,
});
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').html(obj);
if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
}
};
// ios用
function callNativeApp(iosKey, jsonData) {
console.log("callNativeApp called");
var result;
try {
var key = iosKey;
var data = jsonData;
var payload = { key: key, data: data };
// payloadの形 {"type":"SJbridge","data":{"name":"abc","role":"dev"}}
// resにObjective-cからのレスポンスが返る
result = prompt(JSON.stringify(payload));
console.log(result);
} catch (err) {
console.log("The native context does not exist yet");
}
return result;
}
CHAT_DB.getBeforeRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getBeforeRoomType, {});
}
};
CHAT_DB.getRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getRoomType, {}), 10);
}
};
CHAT_DB.removeFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.removeFavoriteGroup = function (groupId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteGroup, {
groupId: groupId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteGroup = function (groupId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteGroup, {
groupId: groupId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.getCollaborationJoinFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getCollaborationJoinFlg, {});
}
};
CHAT_DB.getUserInfoList = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getUserInfoList, {
shopMemberId: shopMemberId,
});
}
};
CHAT_DB.createContentView = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.createContentView, {}));
}
};
CHAT_DB.getToMoveGroupId = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getToMoveGroupId, {});
}
};
CHAT_DB.getJoinCollaborationType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(
callNativeApp(NATIVE_KEY_IOS.getJoinCollaborationType, {}),
10
);
}
};
CHAT_DB.getHostRequestFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getHostRequestFlg, {}), 10);
}
};
jQuery('#homeButton').on('click', function() {
jQuery("#homeButton").on("click", function () {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
......@@ -6,7 +6,7 @@ jQuery('#homeButton').on('click', function() {
}
});
jQuery('#reloadButton').on('click', function() {
jQuery("#reloadButton").on("click", function () {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要。
} else if (CHAT_UTIL.isAndroid()) {
......
var lastscrollvalue;
window.onscroll = function() {
window.onscroll = function () {
beforeScroll = window.scrollY;
}
};
$('#roomNameChangeBtn').click(function() {
var changeRoomName = $('#roomNameInput').val();
var trimmedRoomName = $('#roomNameInput').val().trim();
$("#roomNameChangeBtn").click(function () {
var changeRoomName = $("#roomNameInput").val();
var trimmedRoomName = $("#roomNameInput").val().trim();
if (trimmedRoomName.length == 0) {
alert(getLocalizedString("error_empty_room_name"));
return;
......@@ -15,7 +15,7 @@ $('#roomNameChangeBtn').click(function() {
} else if (CHAT_UTIL.isAndroid()) {
android.changeRoomName(changeRoomName);
}
})
});
/*
$('#messages').scroll(function() {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
// 名前空間
var CHAT_UTIL = {};
CHAT_UTIL.isAndroid = function() {
return PLATFORM == 'android';
CHAT_UTIL.isAndroid = function () {
return PLATFORM == "android";
};
CHAT_UTIL.isIOS = function() {
return PLATFORM == 'ios';
CHAT_UTIL.isIOS = function () {
return PLATFORM == "ios";
};
CHAT_UTIL.isMobile = function() {
return IS_MOBILE == 'true';
CHAT_UTIL.isMobile = function () {
return IS_MOBILE == "true";
};
CHAT_UTIL.formatDate = function(date) {
CHAT_UTIL.formatDate = function (date) {
const REFERENCE = moment();
const TODAY = REFERENCE.clone().startOf('day');
const TODAY = REFERENCE.clone().startOf("day");
let createdAt = moment(date);
if (date.length == 14) {
createdAt = moment(date,'YYYYMMDDhhmmss');
createdAt = moment(date, "YYYYMMDDhhmmss");
} else {
createdAt = moment(date);
}
// #36171
const createdAtDay = createdAt.format('MMM Do');
const createdAtTime = createdAt.format('HH:mm');
if (createdAt.isSame(TODAY, 'd')) {
const createdAtDay = createdAt.format("MMM Do");
const createdAtTime = createdAt.format("HH:mm");
if (createdAt.isSame(TODAY, "d")) {
createdAt = createdAtTime;
} else {
createdAt = createdAtDay;
......@@ -36,59 +36,62 @@ CHAT_UTIL.formatDate = function(date) {
rntDate.createdAtTime = createdAtTime;
rntDate.createdAt = createdAt;
return rntDate;
}
};
CHAT_UTIL.htmlDecode = function(input) {
var e = document.createElement('textarea');
CHAT_UTIL.htmlDecode = function (input) {
var e = document.createElement("textarea");
e.innerHTML = input;
// handle case of empty input
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
}
};
//generates a unique id, not obligator a UUID
CHAT_UTIL.generateUUID = function() {
CHAT_UTIL.generateUUID = function () {
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c=='x' ? r : (r&0x3|0x8)).toString(16);
});
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
/[xy]/g,
function (c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
}
);
return uuid;
};
CHAT_UTIL.systemDay = function(date) {
CHAT_UTIL.systemDay = function (date) {
let createdAt = moment(date);
createdAt = moment(date,'YYYYMMDDhhmmss');
const createdAtDow = createdAt.format('YYYY-MM-DD');
createdAt = moment(date, "YYYYMMDDhhmmss");
const createdAtDow = createdAt.format("YYYY-MM-DD");
let systemDay = new Object();
systemDay.year = createdAt.format('YYYY');
systemDay.month = createdAt.format('MM');
systemDay.day = createdAt.format('DD');
systemDay.year = createdAt.format("YYYY");
systemDay.month = createdAt.format("MM");
systemDay.day = createdAt.format("DD");
systemDay.dow = moment(createdAtDow).day();
return systemDay;
}
};
CHAT_UTIL.findDow = function(data) {
CHAT_UTIL.findDow = function (data) {
let dow = "";
if (data == 0) {
dow = getLocalizedString('sunday');
dow = getLocalizedString("sunday");
} else if (data == 1) {
dow = getLocalizedString('monday');
dow = getLocalizedString("monday");
} else if (data == 2) {
dow = getLocalizedString('thusday');
dow = getLocalizedString("thusday");
} else if (data == 3) {
dow = getLocalizedString('wednesday');
dow = getLocalizedString("wednesday");
} else if (data == 4) {
dow = getLocalizedString('thursday');
dow = getLocalizedString("thursday");
} else if (data == 5) {
dow = getLocalizedString('friday');
dow = getLocalizedString("friday");
} else if (data == 6) {
dow = getLocalizedString('sunday');
dow = getLocalizedString("sunday");
}
return dow;
}
};
function msToTime(s) {
var ms = s % 1000;
......@@ -98,55 +101,57 @@ function msToTime(s) {
var mins = s % 60;
var hrs = (s - mins) / 60;
return hrs + ':' + mins + ':' + secs;
return hrs + ":" + mins + ":" + secs;
}
function updateDuration() {
var now = new Date();
$('.collaboration_duration').each(function(index, item) {
var insertDateString = $(item).data('insertdate');
$(".collaboration_duration").each(function (index, item) {
var insertDateString = $(item).data("insertdate");
insertDateString = insertDateString.toString();
var year = insertDateString.substring(0,4);
var month = insertDateString.substring(4,6);
var day = insertDateString.substring(6,8);
var hour = insertDateString.substring(8,10);
var min = insertDateString.substring(10,12);
var sec = insertDateString.substring(12,14);
var insertDate = new Date(year, month-1 , day, hour, min, sec);
var year = insertDateString.substring(0, 4);
var month = insertDateString.substring(4, 6);
var day = insertDateString.substring(6, 8);
var hour = insertDateString.substring(8, 10);
var min = insertDateString.substring(10, 12);
var sec = insertDateString.substring(12, 14);
var insertDate = new Date(year, month - 1, day, hour, min, sec);
$(item).html(msToTime(now - insertDate));
});
}
CHAT_UTIL.getCollaborationType = function(key) {
switch(key) {
case collaborationTypeKey.AUDIO:
CHAT_UTIL.getCollaborationType = function (key) {
switch (key) {
case CollaborationTypeKey.AUDIO:
return COLLABORATION_TYPE.AUDIO;
case collaborationTypeKey.CAMERA:
case CollaborationTypeKey.CAMERA:
return COLLABORATION_TYPE.CAMERA;
case collaborationTypeKey.VIDEO:
case CollaborationTypeKey.VIDEO:
return COLLABORATION_TYPE.VIDEO;
case collaborationTypeKey.DOCUMENT:
case CollaborationTypeKey.DOCUMENT:
return COLLABORATION_TYPE.DOCUMENT;
default:
return 0;
}
}
};
CHAT_UTIL.getCoviewTypeFromCollaborationType = function(joinCollaborationType) {
switch(joinCollaborationType) {
CHAT_UTIL.getCoviewTypeFromCollaborationType = function (
joinCollaborationType
) {
switch (joinCollaborationType) {
case COLLABORATION_TYPE.AUDIO:
console.log(collaborationTypeKey.AUDIO);
return collaborationTypeKey.AUDIO;
console.log(CollaborationTypeKey.AUDIO);
return CollaborationTypeKey.AUDIO;
case COLLABORATION_TYPE.CAMERA:
console.log(collaborationTypeKey.CAMERA);
return collaborationTypeKey.CAMERA;
console.log(CollaborationTypeKey.CAMERA);
return CollaborationTypeKey.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return collaborationTypeKey.VIDEO;
return CollaborationTypeKey.VIDEO;
case COLLABORATION_TYPE.DOCUMENT:
return collaborationTypeKey.DOCUMENT;
return CollaborationTypeKey.DOCUMENT;
case COLLABORATION_TYPE.BOARD:
return collaborationTypeKey.BOARD;
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 = {};
$(function() {
document.addEventListener("DOMContentLoaded", function () {
// メンバー検索
$('#chatMakeRoom .search_form input[type="search"]').click(function(e) {
let contactListTitle = getLocalizedString("userSearch");
$('#makeRoomTitle').text(contactListTitle);
});
$('#chatMakeRoom .search_form input[type="search"]').keyup(function(e) {
//画面タイトル設定
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
if (e.KeyCode == 13 || e.key == "Enter") {
if (keyword != '' && keyword.length != 0) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return false;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return false;
}
CHAT_MAKE_ROOM.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return;
}
});
searchMember();
// 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);
}
});
bindiOSKeyBoardEvent();
});
// メンバー検索
CHAT_MAKE_ROOM.searchUser = function(keyword) {
var isAllGroup = $('#tabAllGroupOnMakeRoom').is(':checked');
$('.overlay_src_msg').empty();
CHAT_MAKE_ROOM.searchUser = function (keyword) {
const overlayMessage = $(".overlay_src_msg");
const isAllGroup = $("#tabAllGroupOnMakeRoom").is(":checked");
let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function(group) {
let html = Mustache.render(groupTemplate, {
name: group.groupName,
id: group.groupId,
});
groupList.forEach(function (group) {
renderRoomList(groupTemplate, group.groupName, group.groupId);
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
})
overlayMessage.append(obj);
});
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == user.shopMemberId;
})
if (findObj) {
user.checked = 'checked';
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 (hasNoData) {
const noResultMsg = getNoResultMessage();
overlayMessage.append(noResultMsg);
}
};
/** UTIL */
var searchMember = function () {
const searchInput = $('#chatMakeRoom .search_form input[type="search"]');
searchInput.click(function (e) {
let contactListTitle = getLocalizedString("userSearch");
$("#makeRoomTitle").text(contactListTitle);
});
let html = Mustache.render(userTemplate, {
userList: userList
searchInput.keyup(function (e) {
const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword != "" && keyword.length != 0;
//画面タイトル設定
var keyword = searchInput.val();
if (enterKeyPressed) {
if (keywordNotEmpty) {
searchInput.blur();
return false;
}
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
return false;
}
CHAT_MAKE_ROOM.searchUser(keyword);
if (enterKeyPressed) {
searchInput.blur();
return;
}
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
if (groupList.length == 0 && userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
};
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);
}
  //連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
};
var renderRoomList = function (url, groupName, groupID) {
return Mustache.render(url, {
name: groupName,
id: groupID,
});
};
var searchUserData = function (userList) {
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
return shopMemberId == user.shopMemberId;
})
});
if (findObj) {
user.checked = 'checked';
user.checked = "checked";
}
});
let html = Mustache.render(userTemplate, {
userList: userList
};
var renderUser = function (url, userList) {
return Mustache.render(url, {
userList: userList,
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').html(obj);
if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
}
}
};
$(function () {
document.addEventListener("DOMContentLoaded", function () {
// メニューオーバーレイ表示
$(".menu_btn").click(function () {
var w = $(this).width();
......@@ -8,7 +8,6 @@ $(function () {
.toggleClass("slidein")
.css({ transform: "translateX(" & -w & ")" });
$("#collabo_main").toggleClass("noscroll");
});
// ユーザーリストオーバーレイ表示
......@@ -21,7 +20,6 @@ $(function () {
.css({ transform: "translateX(" & -w & ")" });
$("#collabo_main").toggleClass("noscroll");
if ($("#overlay_user_list.overlay").hasClass("noscroll")) {
$("#overlay_user_list.overlay").removeClass("noscroll");
} else {
......@@ -73,57 +71,63 @@ $(function () {
CHAT_UI.showLoadingIndicator();
CHAT.globalSelectedUserList = [];
CHAT_UI.refreshMyGroupForAddUserInCollaboration();
$('#addUserConfirmBtnInCollaboration').off().on('click', function() {
$('#addUserInCollaboration').modal('hide');
if (typeof(android) != "undefined") {
$("#addUserConfirmBtnInCollaboration")
.off()
.on("click", function () {
$("#addUserInCollaboration").modal("hide");
if (typeof android != "undefined") {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
} else {
webkit.messageHandlers.saveSelectedUserList.postMessage(CHAT.globalSelectedUserList.join(","));
webkit.messageHandlers.saveSelectedUserList.postMessage(
CHAT.globalSelectedUserList.join(",")
);
}
CHAT_UI.confirmInviteUserListInCollaboration();
});
});
$('#penBtn').click(function () {
$('#coviewPenCtrBtn').click();
if ($('#penBtn').hasClass('bg_red')) {
$('#penBtn').removeClass('bg_red');
$('#penBtn').addClass('bg_blue');
$("#penBtn").click(function () {
$("#coviewPenCtrBtn").click();
if ($("#penBtn").hasClass("bg_red")) {
$("#penBtn").removeClass("bg_red");
$("#penBtn").addClass("bg_blue");
} else {
$('#penBtn').addClass('bg_red');
$('#penBtn').removeClass('bg_blue');
$("#penBtn").addClass("bg_red");
$("#penBtn").removeClass("bg_blue");
}
})
});
$('#photo_open_place_holder').click(function () {
$("#photo_open_place_holder").click(function () {
$("#open_file_upload").trigger("click");
})
});
$('#eraserBtn').click(function () {
$('#coviewEraserCtrBtn').click();
})
$("#eraserBtn").click(function () {
$("#coviewEraserCtrBtn").click();
});
$('#captureBtn').click(function () {
if ($('#recordBtn').hasClass('bg_red')) {
$("#captureBtn").click(function () {
if ($("#recordBtn").hasClass("bg_red")) {
screenLock();
recordStop(function() {
$('#screenLock').remove();
coview_api.Capture(CMS_SERVER_URL + '/chatapi/file/uploadArchive');
recordStop(function () {
$("#screenLock").remove();
coview_api.Capture(CMS_SERVER_URL + "/chatapi/file/uploadArchive");
});
} else {
coview_api.Capture(CMS_SERVER_URL + '/chatapi/file/uploadArchive');
coview_api.Capture(CMS_SERVER_URL + "/chatapi/file/uploadArchive");
}
})
});
$('#captureRequestBtn').click(function () {
fw.sendToMsg('others', 'CAPTURE_REQUEST', {"name": CHAT.globalLoginParameter.loginId});
})
$("#captureRequestBtn").click(function () {
fw.sendToMsg("others", "CAPTURE_REQUEST", {
name: CHAT.globalLoginParameter.loginId,
});
});
});
function penOff() {
if ($('#penBtn').hasClass('bg_blue')) {
$('#coviewPenCtrBtn').click();
$('#penBtn').addClass('bg_red');
$('#penBtn').removeClass('bg_blue');
if ($("#penBtn").hasClass("bg_blue")) {
$("#coviewPenCtrBtn").click();
$("#penBtn").addClass("bg_red");
$("#penBtn").removeClass("bg_blue");
}
};
}
function 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).next().slideToggle();
});
$('.home_btn').on('click', function() {
$(".home_btn").on("click", function () {
if (CHAT_UTIL.isAndroid()) {
android.goHome();
} else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({});
}
});
$(function() {
document.addEventListener("DOMContentLoaded", function () {
var h = $(window).height(); //画面の高さを取得
// ローディング表示
......@@ -29,41 +56,40 @@ $(function() {
$('.search_form input[type="search"]').click(function () {
$(this).addClass("focus");
// キャンセルボタン表示
$('.cancel').removeClass('none');
$('.search_form form').addClass('d-flex flex-row h-100 align-items-center');
$('.content').addClass('none');
$('.craeteRoomButton').addClass('none');
$(".cancel").removeClass("none");
$(".search_form form").addClass("d-flex flex-row h-100 align-items-center");
$(".content").addClass("none");
$(".craeteRoomButton").addClass("none");
});
// 共通検索フォーム キャンセルボタン押下イベント
$('.search_form .cancel').click(function(){
$(this).addClass('none');
$('.search_form input').removeClass('focus');
$('.search_form input').val('');
$('.search_form form').removeClass();
$('.content').removeClass('none');
$('.overlay_src_msg').empty();
$('.craeteRoomButton').removeClass('none');
$(".search_form .cancel").click(function () {
$(this).addClass("none");
$(".search_form input").removeClass("focus");
$(".search_form input").val("");
$(".search_form form").removeClass();
$(".content").removeClass("none");
$(".overlay_src_msg").empty();
$(".craeteRoomButton").removeClass("none");
});
$('.message_input_form').on('focus',function(e){
setTimeout(function() {
$('.message_input_send').removeClass('none');
$('.attach_file').addClass('none');
$('.footer_content_b').addClass('none');
$(".message_input_form").on("focus", function (e) {
setTimeout(function () {
$(".message_input_send").removeClass("none");
$(".attach_file").addClass("none");
$(".footer_content_b").addClass("none");
}, 10);
});
$('.message_input_form').on('focusout',function(e){
setTimeout(function() {
if($(e.relatedTarget).hasClass('message_input_send')){
$(".message_input_form").on("focusout", function (e) {
setTimeout(function () {
if ($(e.relatedTarget).hasClass("message_input_send")) {
CHAT_UI.sendMessage();
} else {
$('.message_input_send').addClass('none');
$('.attach_file').removeClass('none');
$('.footer_content_b').removeClass('none');
$(".message_input_send").addClass("none");
$(".attach_file").removeClass("none");
$(".footer_content_b").removeClass("none");
}
}, 10);
});
});
......@@ -9,64 +9,157 @@ const readyState = {
COMPLETED: 4,
};
const messageType = {
TEXT : 0 ,
IMAGE : 1 ,
VIDEO : 2 ,
SYSTEM : 3 ,
COMMUNICATIONSTART : 4,
COMMUNICATIONEND : 5
}
const userAPICmd = {
MYINFO : 9
}
const chatRoomType = {
DM : "1",
GROUP : "0",
ALL : "2"
}
const groupSearchFlg = {
ROOT : "0"
}
const MessageType = {
TEXT: 0,
IMAGE: 1,
VIDEO: 2,
SYSTEM: 3,
COMMUNICATIONSTART: 4,
COMMUNICATIONEND: 5,
};
const nameCardAreaId = {
MY : "myNamecard",
USER : "userNamecard"
}
const ChatRoomType = {
DM: "1",
GROUP: "0",
ALL: "2",
};
const collaborationTypeKey = {
AUDIO : "audio",
CAMERA : "camera",
VIDEO : "video" ,
DOCUMENT : "document",
BOARD : "board"
}
const CollaborationTypeKey = {
AUDIO: "audio",
CAMERA: "camera",
VIDEO: "video",
DOCUMENT: "document",
BOARD: "board",
};
const COLLABORATION_TYPE = {
AUDIO : 0,
CAMERA : 2,
VIDEO : 3,
DOCUMENT : 4,
BOARD : 5
}
AUDIO: 0,
CAMERA: 2,
VIDEO: 3,
DOCUMENT: 4,
BOARD: 5,
};
const makeRoomFlg = {
NAME_CARD : 0,
MAKE_ROOM : 1
}
const MakeRoomFlag = {
NAME_CARD: 0,
MAKE_ROOM: 1,
};
const ANDROID_SDK_VERSION = {
O : 26
}
O: 26,
};
const HOST_REQUEST_FLG = {
DONE : 0,
DOING : 1
}
const HostRequestFlag = {
DONE: 0,
DOING: 1,
};
const messageSeperator = "<::split>";
const DATA_MESSAGE_SCHEME = "::NOT_MESSAGE";
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 = {};
$(function () {
document.addEventListener("DOMContentLoaded", function () {
// メンバー検索
$('#contact .search_form input[type="search"]').keyup(function(e) {
var keyword = $('#contact .search_form input[type="search"]').val();
if (e.key == "Enter" || e.KeyCode == 13) {
if (keyword != '' && keyword.length != 0) {
$('#contact .search_form input[type="search"]').blur();
return;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return;
}
CONTACT.searchUser(keyword);
if (e.key == "Enter" || e.KeyCode == 13) {
$('#contact .search_form input[type="search"]').blur();
return;
}
});
bindMemeberSearch();
// 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);
}
});
bindiOSKeyBoardEvent();
});
// ユーザー検索
CONTACT.searchUser = function(keyword) {
var groupList;
$('.overlay_src_msg').empty();
var isAllGroup = $('#tabAllGroup').is(':checked');
CONTACT.searchUser = function (keyword) {
const overlayMessage = $(".overlay_src_msg");
const isAllGroup = $("#tabAllGroup").is(":checked");
let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate;
$.get({ url: "./template/template_group_list.html", async: false }
, function(text) {
groupTemplate = text;
const groupList = CHAT_DB.getGroupByName(keyword);
groupDataSearch(groupList);
//ユーザデータ検索
const userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0;
}
if (hasNoData) {
const noResultMsg = getNoResultMessage();
overlayMessage.append(noResultMsg);
}
};
/** UTILS */
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#contact .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
CONTACT.searchUser(keyword);
}
});
};
groupList.forEach(function(group) {
let html = Mustache.render(groupTemplate, {
name: group.groupName,
id: group.groupId,
isFavorite: group.isFavorite
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);
})
$(".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;
var renderGroupList = function (url, groupName, groupID, isFavorite) {
return Mustache.render(url, {
name: groupName,
id: groupID,
isFavorite: isFavorite,
});
userList.forEach(function(user) {
};
var userDataSearch = function (userList) {
userList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(userTemplate, {
userList: userList
});
var userTemplate = getTemplate(TemplateURL.USER_LIST);
let html = renderUserList(userTemplate, userList);
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
if (userList.length == 0 && groupList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate;
$.get({ url: "./template/template_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(userTemplate, {
userList: userList
$(".overlay_src_msg").append(obj);
};
var renderUserList = function (url, userList) {
return Mustache.render(url, {
userList: userList,
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').html(obj);
if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
}
};
\ No newline at end of file
$(window).on('load',function () { //読み込み完了したら実行する
$('#loader-bg').delay(900).fadeOut(800);//ローディングを隠す
$('#loader').delay(600).fadeOut(300);
$(window).on("load", function () {
//読み込み完了したら実行する
$("#loader-bg").delay(900).fadeOut(800); //ローディングを隠す
$("#loader").delay(600).fadeOut(300);
});
$(function () {
document.addEventListener('DOMContentLoaded', function() {
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