Commit f779067b by Kim Peace

Merge branch 'refactoring/javascript_arrangement' into 'develop'

Refactoring/javascript arrangement

See merge request !192
parents d10b9423 2e76ee6a
......@@ -15,12 +15,6 @@
<link rel="stylesheet" href="./css/footer.css">
<link rel="stylesheet" href="./css/loading.css">
<link rel="stylesheet" href="./css/font-awesome.css">
<script>
window.addEventListener('DOMContentLoaded', function() {
CHAT_UI.refreshArchiveScreen();
});
</script>
</head>
<body>
......@@ -50,9 +44,9 @@
<main id="archive">
<!-- 検索 -->
<div class="search_form">
<input type="search" name="search" placeholder="検索" maxlength="50">
<span class="src_icon"></span>
<a href="#" class="cancel none">キャンセル</a>
<input type="search" name="search" placeholder="検索" maxlength="50">
<span class="src_icon"></span>
<a href="#" class="cancel none">キャンセル</a>
</div>
<!-- アーカイブリスト -->
<div class="archive_list content">
......@@ -91,76 +85,41 @@
</div>
</footer>
<div id="loadingArea"></div>
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/moment.js"></script>
<script src="./js/libs/bootstrap.min.js"></script>
<script src="./js/libs/jquery.mark.min.js"></script>
<script src="./js/libs/mustache.min.js"></script>
<script src="./js/archive.js"></script>
<script src="./js/common.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/constant.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>
<div id="loadingArea"></div>
<script id="archive-template" type="text/template">
<li class="d-flex align-items-center">
<a href="archive_detail.html?archiveId={{archiveId}}" class="w-100">
<div class="archive_item d-flex flex-row align-items-center w-100">
<div class="arhive_img">
<div class="img_wrap bg_blue">
<img src="{{typeImage}}" alt="動画" />
</div>
</div>
<div class="archive_desc">
<div class="archive_name">
<span>{{fileName}}</span>
</div>
<div class="archive_date">
<span>{{insertDate}}</span>
</div>
</div>
</div>
</a>
</li>
</script>
<script>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
}
<!-- Library -->
<script src="./js/libs/jquery-3.3.1.min.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>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<!-- view -->
<script src="./js/views/archive/archive.js"></script>
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
$("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html");
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
<script>
$("#loadingArea").load("./loading.html");
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
CHAT_UI.refreshArchiveScreen();
};
</script>
window.addEventListener('DOMContentLoaded', function () {
ArchiveUI.refreshArchiveScreen();
});
</script>
</body>
</html>
\ No newline at end of file
......@@ -17,21 +17,6 @@
<link rel="stylesheet" href="./css/font-awesome.css">
</head>
<script>
var archiveId;
window.addEventListener('DOMContentLoaded', function () {
var urlPrm = new Object;
var urlSearch = location.search.substring(1).split('&');
var kv = urlSearch[0].split('=');
urlPrm[kv[0]] = kv[1];
archiveId = urlPrm.archiveId
if (typeof (android) != "undefined") {
} else {
CHAT_UI.refreshArchiveDetailScreen(urlPrm.archiveId);
}
});
</script>
<body>
<!-- ナビメニュー -->
......@@ -65,6 +50,7 @@
<!-- ローディング -->
<div id="userProfileModal"></div>
<!-- Library -->
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/moment.js"></script>
<script src="./js/libs/locale/ko.js" charset="UTF-8"></script>
......@@ -72,146 +58,36 @@
<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/archive.js"></script>
<script src="./js/common.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/constant.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 id="archive-detail-template" type="text/template">
<div id="archive_player" class="player">
</div>
<div class="archive_detail_desc">
<div class="archive_detail_fl_nm item">
<h2 class="ttl" id="archiveFileName">FileName</h2>
<span>{{fileName}}</span>
</div>
<div class="archive_detail_sv_date item">
<h2 class="ttl" id="archiveInsertDate">InsertDate</h2>
<span>{{insertDate}}</span>
</div>
<div class="archive_detail_room_nm item">
<h2 class="ttl" id="archiveRoomName">ChatRoomName</h2>
<span class="archive_chat_room">{{chatRoomName}}</span>
<button id="joinChatRoom">
<img src="icon/icon_join_room.png" alt="">
</button>
</div>
<div class="archive_detail_sv_user item">
<h2 class="ttl" id="archiveSaveUser">SaveUser</h2>
<div class="d-flex flex-row">
<div class="d-flex flex-column">
<img src="{{profileImage}}" alt="プロフィール画像" onclick="CHAT_UI.makeNameCard({{userId}})" >
<p>{{userName}}</p>
</div>
</div>
</div>
<div class="archive_detail_user_list item">
<h2 class="ttl" id="archiveAttendUser">AttendUser</h2>
<ul class="d-flex flex-row" id="attendUser">
</ul>
</div>
</div>
</script>
<script id="archive-user-template" type="text/template">
<li class="archive_user">
<img src="{{profileImage}}" alt="">
<p>{{userName}}</p>
</li>
</script>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<!-- view -->
<script src="./js/views/contact/namecard.js"></script>
<script src="./js/views/archive/archive.js"></script>
<script id="archive-namecard-template" type="text/template">
<div class="modal fade profile_modal" id="userNameCard" tabindex="-1" role="dialog" aria-labelledby="userNameCard" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header border-0">
<div class="profile_desc d-flex flex-row">
<img src="{{profileImage}}" onError="this.src='./img/noImage.png'"/>
<div class="profile_name d-flex justify-content-center align-items-center"><span>{{name}}</span></div>
</div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
{{#groupPathList}}
<li style="display: block;">{{.}}</li>
{{/groupPathList}}
</div>
<div class="modal-footer border-0 justify-content-center">
{{#isFavorite}}
<button type="button" class="border-0 bg_navy" onclick="CHAT_UI.removeFavoriteUser({{shopMemberId}})">
<div class="d-flex flex-column">
<div class="img_wrap">
<img src="icon/icon_profile_favorite.png" alt="お気に入り">
</div>
<span>お気に入り解除</span>
</div>
</button>
{{/isFavorite}}
{{^isFavorite}}
<button type="button" class="border-0 bg_navy" onclick="CHAT_UI.insertFavoriteUser({{shopMemberId}})">
<div class="d-flex flex-column">
<div class="img_wrap">
<img src="icon/icon_profile_favorite_white.png" alt="お気に入り">
</div>
<span>お気に入り登録</span>
</div>
</button>
{{/isFavorite}}
<button type="button" class="border-0 bg_green" >
<div class="d-flex flex-column">
<div class="img_wrap">
<img src="icon/icon_profile_phone.png" alt="通話">
</div>
<span>通話</span>
</div>
</button>
<button type="button" class="border-0 bg_blue">
<div class="d-flex flex-column">
<div class="img_wrap">
<img src="icon/icon_profile_chat.png" alt="チャット">
</div>
<span>チャット</span>
</div>
</button>
</div>
</div>
</div>
</div>
</script>
<script>
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
var archiveId;
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
CHAT_UI.refreshArchiveDetailScreen(archiveId);
};
window.addEventListener('DOMContentLoaded', function () {
let urlPrm = new Object;
const urlSearch = location.search.substring(1).split('&');
const kv = urlSearch[0].split('=');
urlPrm[kv[0]] = kv[1];
archiveId = urlPrm.archiveId
ArchiveUI.refreshArchiveDetailScreen(urlPrm.archiveId);
});
</script>
</body>
......
......@@ -47,9 +47,9 @@
<main id="chat">
<!-- ユーザー検索 -->
<div class="search_form">
<input type="search" name="search" placeholder="ルーム検索" maxlength="20">
<span class="src_icon"></span>
<a href="#" class="cancel none">キャンセル</a>
<input type="search" name="search" placeholder="ルーム検索" maxlength="20">
<span class="src_icon"></span>
<a href="#" class="cancel none">キャンセル</a>
</div>
<!-- タブ -->
<div class="content tabs">
......@@ -97,61 +97,48 @@
</div>
</div>
</footer>
<div id="loadingArea"></div>
<script src="./js/libs/jquery-3.3.1.min.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/common.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/constant.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>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
<div id="loadingArea"></div>
<!-- Library -->
<script src="./js/libs/jquery-3.3.1.min.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>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<!-- View -->
<script src="./js/views/chats/chat-list.js"></script>
<script>
$("#loadingArea").load("./loading.html");
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
android.saveSelectedUserList("");
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
webkit.messageHandlers.saveSelectedUserList.postMessage("");
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isAndroid()) {
var needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
}
if (deviceInfo.isAndroid()) {
const needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
}
CHAT_UI.refreshRoomList(ChatRoomType.GROUP);
CHAT_UI.dismissLoadingIndicator();
};
</script>
}
ChatList.refreshRoomList(ChatRoomType.GROUP);
NativeBridgeDelegate.saveSelectedUserList("");
Common.dismissLoadingIndicator();
</script>
</body>
</html>
\ No newline at end of file
......@@ -57,52 +57,35 @@
</form>
</main>
<!-- Library -->
<script src="./js/libs/jquery-3.3.1.min.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/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/common.js"></script>
<script src="./js/loading.js"></script>
<script src="./js/constant.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>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/common/loading.js"></script>
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
//CHAT_UI.showMakeRoomConfirmView();
CHAT_UI.showAddUserConfirmView();
};
<script>
ChatManagementCommon.showAddUserConfirmView();
</script>
</body>
......
......@@ -56,56 +56,37 @@
</div>
</main>
<!-- Library -->
<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/common.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/constant.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/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>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<!-- View -->
<script src="./js/views/chats/chat-room.js"></script>
<script src="./js/views/chats/chat-room-search.js"></script>
<script src="./js/views/chats/chat-room-message.js"></script>
<script src="./js/views/chats/management/chat-room-change.js"></script>
<script>
String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let roomId = 0;
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
};
</script>
</body>
......
......@@ -60,7 +60,9 @@
<div class="tab_content" id="tab1_content">
<div class="chat_list">
<!-- お気に入りグループ -->
<div class="category"><div class="category_name"><span>お気に入り</span></div></div>
<div class="category">
<div class="category_name"><span>お気に入り</span></div>
</div>
<div id="favoriteListForMakeRoom"></div>
<div id="myGroupListForMakeRoom"></div>
</div>
......@@ -125,6 +127,8 @@
</div>
</form>
</main>
<!-- Library -->
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/moment.js"></script>
<script src="./js/libs/locale/ko.js" charset="UTF-8"></script>
......@@ -132,58 +136,40 @@
<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/common.js"></script>
<script src="./js/loading.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/constant.js"></script>
<script src="./js/chatMakeRoom.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>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/views/chats/management/chat-make-room.js"></script>
<script src="./js/common/loading.js"></script>
<script>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
}
if (NativeBridgeDataSource.loadSelectedUsers() != "") {
let selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
selectedUsers.forEach(function (user) {
ChatManagementCommon.selectedUserList.push(user.shopMemberId);
})
};
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
if (ChatManagementCommon.selectedUserList.length > 0) {
$('.select_member_num').text(ChatManagementCommon.selectedUserList.length);
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
$('.select_member_num').text('0');
}
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_DB.loadSelectedUsers() != "") {
let selectedUsers = CHAT_DB.loadSelectedUsers();
selectedUsers.forEach(function(user) {
CHAT.globalSelectedUserList.push(user.shopMemberId);
})
};
if (CHAT.globalSelectedUserList.length > 0) {
$('.select_member_num').text(CHAT.globalSelectedUserList.length);
} else {
$('.select_member_num').text('0');
}
CHAT_UI.refreshMyGroupForMakeRoom();
};
ChatMakeRoom.refreshMyGroupForMakeRoom();
</script>
</body>
......
......@@ -41,27 +41,30 @@
<!-- コンテンツ -->
<main id="chat_make_room_confirm">
<!-- ルーム名入力 -->
<div class="room_name">
<label><h2>ルーム名</h2></label>
<input type="text" class="input_name_room" name="room_name" id="newRoomName" placeholder="ルーム名を入力してください" maxlength="20">
</div>
<!-- ルーム名入力 -->
<div class="room_name">
<label>
<h2>ルーム名</h2>
</label>
<input type="text" class="input_name_room" name="room_name" id="newRoomName" placeholder="ルーム名を入力してください"
maxlength="20">
</div>
<!-- 参加者一覧 -->
<div class="chat_list">
<h2>参加者</h2>
<ul class="p-0 chat_make_room_list">
<div id="selectedUserList"></div>
</ul>
</div>
<!-- ルーム解説ボタン -->
<div class="make_room_btn" id="makeRoomBtn">
<button type="button" name="button">
チャット開始</button>
</div>
<!-- 参加者一覧 -->
<div class="chat_list">
<h2>参加者</h2>
<ul class="p-0 chat_make_room_list">
<div id="selectedUserList"></div>
</ul>
</div>
<!-- ルーム解説ボタン -->
<div class="make_room_btn" id="makeRoomBtn">
<button type="button" name="button">
チャット開始</button>
</div>
</main>
<!-- Library -->
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/moment.js"></script>
<script src="./js/libs/locale/ko.js" charset="UTF-8"></script>
......@@ -69,46 +72,29 @@
<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/common.js"></script>
<script src="./js/loading.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/constant.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>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
}
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/common/loading.js"></script>
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
<script>
ChatManagementCommon.showMakeRoomConfirmView();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
CHAT_UI.showMakeRoomConfirmView();
};
$("#newRoomName").attr("placeholder", getLocalizedString("newRoomName"));
</script>
</body>
......
......@@ -53,18 +53,13 @@
<!-- コンテンツ -->
<main id="chat_room">
<div id="user_list" class="user_list d-flex flex-row">
</div>
<div id="user_list" class="user_list d-flex flex-row"> </div>
<!-- フィルター -->
<div id="filter" class="user_list filter d-flex flex-row none"></div>
<div class="chat_list none" id="searchList">
<ul class="overlay_src_msg">
</ul>
</div>
<!-- チャット内容 -->
<div class="room_container">
<div class="room_contents scroll">
......@@ -72,7 +67,6 @@
</div>
</div>
</main>
<!-- フッター -->
<footer class="chat_room_footer">
<!-- フッター上 -->
......@@ -98,39 +92,39 @@
<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>
onclick="ChatRoom.sendMessage(this);">送信</button>
</div>
</div>
<!-- フッター下 -->
<div class="footer_content_b">
<div class="d-flex flex-row justify-content-around h-100">
<div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.AUDIO);">
<a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.AUDIO);">
<img src="icon/icon_phone.png" alt="通話アイコン">
<p>通話</p>
</a>
</div>
<div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.DOCUMENT);">
<a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.DOCUMENT);">
<img src="icon/icon_paste.png" alt="文書アイコン">
<p>文書</p>
</a>
</div>
<div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.CAMERA);">
<a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.CAMERA);">
<img src="icon/icon_photo.png" alt="画像アイコン">
<p>画像</p>
</a>
</div>
<div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.VIDEO);">
<a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.VIDEO);">
<img src="icon/icon_movie.png" alt="動画アイコン">
<p>動画</p>
</a>
</div>
<!--リリース後開発予定-->
<div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.BOARD);">
<a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.BOARD);">
<img src="icon/icon_whiteboard_gray.png" alt="ホワイトボードアイコン">
<p>ボード</p>
</a>
......@@ -144,78 +138,63 @@
<div id="chatMenuModal"></div>
<div id="pictureModal"></div>
<!-- Library -->
<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/common.js"></script>
<script src="./js/language.js"></script>
<script src="./js/loading.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/constant.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/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/libs/socket.io.js"></script>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<!-- View -->
<script src="./js/utils/chat-media-handler.js"></script>
<script src="./js/views/chats/chat-room.js"></script>
<script src="./js/views/chats/chat-room-search.js"></script>
<script src="./js/views/chats/chat-room-message.js"></script>
<script src="./js/views/contact/namecard.js"></script>
<script src="./js/common/loading.js"></script>
<script>
function imageModal(image) {
$('#modal_image').attr('src', image.src);
$('#pictureModalCenter').modal('show');
}
String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let androidVersion = 0;
let roomName;
$("#pictureModal").load("./modal_chat_picture.html");
$("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html");
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
android.saveSelectedUserList("");
androidVersion = android.getAndroidVersion();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
webkit.messageHandlers.saveSelectedUserList.postMessage("");
if (deviceInfo.isAndroid()) {
const needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
}
}
ChatRoom.loadMessages(roomInfo.roomID, roomInfo.roomName);
NativeBridgeDelegate.saveSelectedUserList("");
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isAndroid()) {
var needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
}
}
CHAT_UI.loadMessages(CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomName);
};
</script>
</body>
......
......@@ -29,7 +29,8 @@
<div class="text-right d-flex align-items-center">
<button type="button" name="button" class="btn add_user_btn"></button>
<button type="button" name="button" class="btn menu_btn"></button>
<button type="button" name="button" class="btn start_pip_btn" onclick="startPipMode();"></button>
<button type="button" name="button" class="btn start_pip_btn"
onclick="NativeBridgeDelegate.startPIPMode();"></button>
</div>
</div>
</div>
......@@ -64,37 +65,45 @@
<!-- フッター -->
<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 class="pip_indicator none" onclick="NativeBridgeDelegate.finishPIPMode();">
<div style="vertical-align: middle;display: table-cell;">協業中</div>
</div>
<!-- Library -->
<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 src="./js/libs/socket.io.js"></script>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/views/collaboration/collaboration.js"></script>
<script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="./js/common/loading.js"></script>
<script src="./js/views/contact/namecard.js"></script>
<script>
$("#footer_collabo").load("./footer_collabo.html");
$("#modal_collabo_host_request").load("./modal_collabo_host_request.html");
......@@ -105,55 +114,14 @@
$("#collaboration_voice_overlay_menu").load("./collaboration_voice_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function startPipMode() {
if (typeof (android) != "undefined") {
android.startPipMode();
} else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.startPipMode.postMessage({});
}
}
globalUserInfo.collaborationType = COLLABORATION_TYPE.DOCUMENT;
CHAT_SOCKET.initialJoin();
function finishPipMode() {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.finishPipMode.postMessage({});
}
NativeBridgeDelegate.finishPIPMode();
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
}
globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT;
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
};
</script>
</body>
</html>
\ No newline at end of file
......@@ -2,7 +2,8 @@
<div class="user_list d-flex flex-wrap">
{{#joinedUserList}}
<div class="user_item " id="collaboration_user_{{loginId}}">
<a href="#" data-toggle="modal" data-target="#profileModal1" onclick="CHAT_UI.makeNameCardInCollaboration({{shopMemberId}})">
<a href="#" data-toggle="modal" data-target="#profileModal1"
onclick="CollaborationUI.makeNameCard({{shopMemberId}})">
<div class="img_wrap"><img src="{{profileUrl}}" alt="this.src='./img/noImage.png'" /></div>
<span class="name">{{shopMemberName}}</span>
</a>
......
......@@ -29,7 +29,7 @@
<button type="button" name="button" class="btn user_btn"></button>
<button type="button" name="button" class="btn menu_btn"></button>
<button type="button" name="button" class="btn add_user_btn none"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="Coview_exitCollaboration();"></button> -->
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div>
</div>
</div>
......@@ -45,14 +45,6 @@
</div>
</main>
<div class="coview_share_photo_select_bubble none">
<button id="coviewSharePhotoCamera" class="coview_share_photo_select_bubble_in_button cam">
</button>
<BR>
<button id="coviewSharePhotoGallery" class="coview_share_photo_select_bubble_in_button gal">
</button>
</div>
<!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div>
<div id="modal_add_user_confirm"></div>
......@@ -129,32 +121,47 @@
<!-- フッター -->
<div id="footer_collabo"></div>
<!-- Library -->
<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/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="./js/libs/socket.io.js"></script>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/views/collaboration/collaboration.js"></script>
<script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
<script src="./js/views/collaboration/share.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-message-handler.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-bridge.js"></script>
<script src="./js/views/collaboration/share-bind-button-action.js"></script>
<script src="./js/views/collaboration/share-event-listener.js"></script>
<script src="./js/views/contact/namecard.js"></script>
<script>
$("#footer_collabo").load("./footer_collabo.html");
$("#modal_collabo_host_request").load("./modal_collabo_host_request.html");
......@@ -165,48 +172,10 @@
$("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
let roomType;
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType();
}
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
globalUserInfo.collaborationType = COLLABORATION_TYPE.CAMERA;
if (globalUserInfo.joinType != COLLABORATION_JOIN_TYPE.INVITED) {
CHAT_SOCKET.initialJoin();
}
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.CAMERA;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
}
};
</script>
</body>
......
......@@ -32,7 +32,7 @@
<div class="menu-bar menu-bar2"></div>
<div class="menu-bar menu-bar3"></div>
</div>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="Coview_exitCollaboration();"></button> -->
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div>
</div>
</div>
......@@ -48,14 +48,6 @@
</div>
</main>
<div class="coview_share_photo_select_bubble none">
<button id="coviewSharePhotoCamera" class="coview_share_photo_select_bubble_in_button cam">
</button>
<BR>
<button id="coviewSharePhotoGallery" class="coview_share_photo_select_bubble_in_button gal">
</button>
</div>
<!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div>
<div id="modal_add_user_confirm"></div>
......@@ -119,32 +111,47 @@
<!-- フッター -->
<div id="footer_collabo"></div>
<!-- Library -->
<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/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="./js/libs/socket.io.js"></script>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/views/collaboration/collaboration.js"></script>
<script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
<script src="./js/views/collaboration/share.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-message-handler.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-bridge.js"></script>
<script src="./js/views/collaboration/share-bind-button-action.js"></script>
<script src="./js/views/collaboration/share-event-listener.js"></script>
<script src="./js/views/contact/namecard.js"></script>
</body>
<script>
$("#footer_collabo").load("./footer_collabo.html");
......@@ -156,48 +163,12 @@
$("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
let roomType;
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType();
}
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
globalUserInfo.collaborationType = COLLABORATION_TYPE.VIDEO;
if (globalUserInfo.joinType != COLLABORATION_JOIN_TYPE.INVITED) {
CHAT_SOCKET.initialJoin();
}
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>
\ No newline at end of file
......@@ -63,32 +63,48 @@
<!-- フッター -->
<div id="footer_collabo"></div>
<!-- Library -->
<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/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="./js/libs/socket.io.js"></script>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/views/collaboration/collaboration.js"></script>
<script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
<script src="./js/views/collaboration/share.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-message-handler.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-bridge.js"></script>
<script src="./js/views/collaboration/share-bind-button-action.js"></script>
<script src="./js/views/collaboration/share-event-listener.js"></script>
<script src="./js/views/contact/namecard.js"></script>
<script>
$("#footer_collabo").load("./footer_collabo.html");
$("#modal_collabo_host_request").load("./modal_collabo_host_request.html");
......@@ -98,48 +114,10 @@
$("#collaboration_voice_overlay_menu").load("./collaboration_voice_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
let roomType;
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType();
}
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
globalUserInfo.collaborationType = COLLABORATION_TYPE.AUDIO;
if (globalUserInfo.joinType != COLLABORATION_JOIN_TYPE.INVITED) {
CHAT_SOCKET.initialJoin();
}
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.AUDIO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
}
};
</script>
</body>
......
......@@ -28,7 +28,7 @@
<button type="button" name="button" class="btn user_btn"></button>
<button type="button" name="button" class="btn add_user_btn none"></button>
<button type="button" name="button" class="btn menu_btn"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="Coview_exitCollaboration();"></button> -->
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div>
</div>
</div>
......@@ -44,14 +44,6 @@
</div>
</main>
<div class="coview_share_photo_select_bubble none">
<button id="coviewSharePhotoCamera" class="coview_share_photo_select_bubble_in_button cam">
</button>
<BR>
<button id="coviewSharePhotoGallery" class="coview_share_photo_select_bubble_in_button gal">
</button>
</div>
<!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div>
<div id="modal_add_user_confirm"></div>
......@@ -121,32 +113,47 @@
<!-- フッター -->
<div id="footer_collabo"></div>
<!-- Library -->
<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/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="./js/libs/socket.io.js"></script>
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
<!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/views/collaboration/collaboration.js"></script>
<script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
<script src="./js/views/collaboration/share.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-message-handler.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-bridge.js"></script>
<script src="./js/views/collaboration/share-bind-button-action.js"></script>
<script src="./js/views/collaboration/share-event-listener.js"></script>
<script src="./js/views/contact/namecard.js"></script>
<script>
$("#footer_collabo").load("./footer_collabo.html");
$("#modal_collabo_host_request").load("./modal_collabo_host_request.html");
......@@ -157,47 +164,10 @@
$("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
let roomType;
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType();
}
if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none');
globalUserInfo.collaborationType = COLLABORATION_TYPE.BOARD;
if (globalUserInfo.joinType != COLLABORATION_JOIN_TYPE.INVITED) {
CHAT_SOCKET.initialJoin();
}
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();
}
globalUserInfo.coWorkType = CollaborationTypeKey.BOARD;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
}
};
</script>
</body>
......
......@@ -31,7 +31,7 @@
</div>
<div class="col-4 p-0">
<div class="nav-item p-0">
<h1 class="nav-ttl" id="title" >コンタクト</h1>
<h1 class="nav-ttl" id="title">コンタクト</h1>
</div>
</div>
<div class="col-4 pl-0">
......@@ -45,9 +45,9 @@
<main id="contact">
<!-- ユーザー検索 -->
<div class="search_form">
<input type="search" name="search" id="contactSearch" placeholder="ユーザー検索" maxlength="30">
<span class="src_icon"></span>
<a href="#" class="cancel none">キャンセル</a>
<input type="search" name="search" id="contactSearch" placeholder="ユーザー検索" maxlength="30">
<span class="src_icon"></span>
<a href="#" class="cancel none">キャンセル</a>
</div>
<div class="content tabs">
......@@ -65,7 +65,8 @@
<div class="chat_item d-flex flex-row align-items-center" style="background: none !important;">
<div class="chat_item_l">
<div class="thumbnail">
<div class="img_wrap"><img id="myImg" src="img/noImage.png" onError="this.src='./img/noImage.png'" /></div>
<div class="img_wrap"><img id="myImg" src="img/noImage.png"
onError="this.src='./img/noImage.png'" /></div>
</div>
</div>
<div class="chat_item_m px-0">
......@@ -82,7 +83,9 @@
</div>
<div class="chat_list" id="myContactList">
<!-- お気に入りグループ -->
<div class="category"><div class="category_name"><span>お気に入り</span></div></div>
<div class="category">
<div class="category_name"><span>お気に入り</span></div>
</div>
<div id="favoriteList"></div>
<div id="myGroupList"></div>
......@@ -172,6 +175,8 @@
<div id="loadingArea"></div>
<div id="myProfileModal"></div>
<div id="userProfileModal"></div>
<!-- Library -->
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/moment.js"></script>
<script src="./js/libs/locale/ko.js" charset="UTF-8"></script>
......@@ -179,63 +184,38 @@
<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/contact.js"></script>
<script src="./js/common.js"></script>
<script src="./js/loading.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/constant.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>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
}
<!-- Language -->
<script src="./js/languages/language.js"></script>
<script src="./js/languages/language_ko.js" charset="UTF-8"></script>
<script src="./js/languages/language_ja.js" charset="UTF-8"></script>
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.js"></script>
<script src="./js/common/common.js"></script>
<script src="./js/utils/chat-util.js"></script>
<!-- Models -->
<script src="./js/Models/deviceinfo.js"></script>
<script src="./js/Models/serverinfo.js"></script>
<script src="./js/Models/userinfo.js"></script>
<!-- View -->
<script src="./js/views/contact/contact.js"></script>
<script src="./js/views/contact/namecard.js"></script>
<script src="./js/common/loading.js"></script>
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
<script>
$("#loadingArea").load("./loading.html");
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
const groupID = NativeBridgeDataSource.getToMoveGroupId();
if (groupID != "" && groupID != undefined) {
Contact.refreshAllGroupSearch(groupID);
NativeBridgeDelegate.setToMoveGroupId("");
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
Contact.refreshContactScreen();
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
let groupId;
if (typeof(android) != "undefined") {
groupId = android.getToMoveGroupId();
} else {
groupId = CHAT_DB.getToMoveGroupId();
}
if (groupId != "" && groupId != undefined) {
CHAT_UI.refreshAllGroupSearch(groupId);
if (typeof(android) != "undefined") {
android.setToMoveGroupId("");
} else {
webkit.messageHandlers.setToMoveGroupId.postMessage("");
}
} else {
CHAT_UI.refreshContactScreen();
}
};
</script>
</body>
......
#coviewShareMainBtn{
padding-top: 9px;
}
.white_board #canvasRemote {
background-color: white !important;
......@@ -32,34 +30,6 @@
display: none !important;
}
.coview_share_dropdown_bar{
display: none;
list-style: none;
padding: unset;
margin: unset;
/* padding-top: 58px; */
background: #000;
position: absolute;
width: 100%;
top: 57px;
left: 0px;
padding-top: 10px;
}
.coview_share_dropdown_bar ul{
list-style: none;
padding: unset;
margin: unset;
}
.coview_share_dropdown_bar li{
display: inline-block;
width: 24%;
height: 75px;
line-height: 52px;
margin: unset;
padding: unset;
background: #000;
text-align: center;
}
.coview_share_dropdown_btn{
background: transparent;
border: none;
......@@ -92,51 +62,7 @@
margin-top: 4px;
color: #fff;
}
.coview_share_title_name{
display: inline-block;
height: 58px;
line-height: 58px;
padding: 0;
margin: 0;
color: #fff;
}
.coview_share_photo_select_bubble{
display: none;
position: absolute;
padding: 2px;
background: #3e3e3e;
border-radius: 5px;
margin-top: 156px;
margin-left: 117px;
font-size: 12px;
}
.coview_share_photo_select_bubble:after{
border-top: 0 solid transparent;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 10px solid #3e3e3e;
content: "";
position: absolute;
top: -10px;
left: 22px;
}
.coview_share_photo_select_bubble_in_button{
width: 106px;
height: 39px;
border: none;
text-align: left;
}
.coview_share_photo_select_bubble_in_button.cam{
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.coview_share_photo_select_bubble_in_button.gal{
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-top: solid 0.7px #000;
}
.coview_share_photo_select_bubble_in_button_img{
width: 27%;
}
......@@ -144,15 +70,6 @@
margin-left: 5px;
}
.coview_share_request{
width: 100%;
height: 4em;
background-image: linear-gradient(to top, #82b127, #30c8d2);
color: #fff;
border: none;
border-radius: 5px;
}
.coview_on_screen_btn_area {
display: none !important;
}
......
......@@ -2,7 +2,7 @@
<div class="footer-wrap">
<div class="d-flex justify-content-around h-100">
<div class="footer_item mx-md-3 photo_select_button collaboration_contents picture_contents">
<a href="javascript:photo_open_place_holderToggle();">
<a href="javascript:togglePhotoOpenPlaceHolder();">
<div class="d-flex flex-column justify-content-center" id="photo_open_place_holder">
<div class="t-icon picture my-0"></div>
<span class="text-white txt">ピクチャ</span>
......@@ -10,7 +10,7 @@
</a>
</div>
<div class="footer_item mx-md-3 collaboration_contents picture_contents video_contents document_contents board_contents">
<a href="javascript:penToggle();">
<a href="javascript:togglePen();">
<div class="d-flex flex-column justify-content-center" id="penBtn">
<div class="t-icon pen disable my-0"></div>
<span class="text-white txt">ペン</span>
......@@ -18,7 +18,7 @@
</a>
</div>
<div class="footer_item mx-md-3 collaboration_contents picture_contents video_contents document_contents board_contents">
<a href="javascript:eraserToggle();">
<a href="javascript:toggleEraser();">
<div class="d-flex flex-column justify-content-center" id="eraserBtn">
<div class="t-icon delete my-0"></div>
<span class="text-white txt">削除</span>
......@@ -26,7 +26,7 @@
</a>
</div>
<div class="footer_item mx-md-3 collaboration_contents video_contents_host">
<a href="javascript:captureToggle();">
<a href="javascript:toggleCapture();">
<div class="d-flex flex-column justify-content-center" id="captureBtn">
<div class="t-icon capture my-0"></div>
<span class="text-white txt">キャプチャ</span>
......@@ -34,7 +34,7 @@
</a>
</div>
<div class="footer_item mx-md-3 collaboration_contents video_contents_user">
<a href="javascript:captureRequestToggle();">
<a href="javascript:toggleCaptureRequest();">
<div class="d-flex flex-column justify-content-center" id="captureRequestBtn">
<div class="t-icon capture my-0"></div>
<span class="text-white txt">キャプチャリクエスト</span>
......@@ -42,7 +42,7 @@
</a>
</div>
<div class="footer_item mx-md-3">
<a href="javascript:micTogle();">
<a href="javascript:toggleMic();">
<div class="d-flex flex-column justify-content-center" id="micBtn">
<div class="t-icon voice my-0"></div>
<span class="text-white txt">マイク</span>
......@@ -50,7 +50,7 @@
</a>
</div>
<div class="footer_item mx-md-3 none host_contents">
<a href="javascript:recordTogle();">
<a href="javascript:toggleRecord();">
<div class="d-flex flex-column justify-content-center" id="recordBtn">
<div class="t-icon record my-0"></div>
<span class="text-white txt">録音</span>
......@@ -59,7 +59,7 @@
</a>
</div>
<div class="footer_item mx-md-3">
<a href="javascript:Coview_exitCollaboration(isDocument);">
<a href="javascript:CoviewBridge.exitCollaboration();">
<div class="img_wrap bg_red mx-1">
<img src="icon/icon_close_white.png" alt="閉じる">
</div>
......
NativeBridgeDataSource.getCollaborationJoinFlg = function () {
if (typeof android != "undefined") {
return android.getCollaborationJoinFlg();
} else {
return callNativeApp(NATIVE_KEY_IOS.getCollaborationJoinFlg, {});
}
};
var CoviewUserInfo = class {
sid;
loginId;
roomId;
shopName;
collaborationType;
joinType;
isLeaved;
meetingID;
constructor(sid, loginId, roomId, shopName) {
this.sid = sid;
this.loginId = loginId;
this.roomId = roomId;
this.shopName = shopName;
const unwrappedType = NativeBridgeDataSource.getJoinCollaborationType();
this.collaborationType = this.parseNumberToCoworkType(unwrappedType);
this.joinType = NativeBridgeDataSource.getCollaborationJoinFlg();
this.isLeaved = false;
this.meetingID = 0;
}
get coWorkType() {
switch (this.collaborationType) {
case COLLABORATION_TYPE.AUDIO:
return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE.CAMERA:
return COLLABORATION_TYPE.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return COLLABORATION_TYPE.VIDEO;
case COLLABORATION_TYPE.DOCUMENT:
return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE.BOARD:
return COLLABORATION_TYPE.AUDIO;
}
}
isInvited() {
this.joinType == COLLABORATION_JOIN_TYPE.INVITED;
}
parseNumberToCoworkType(type) {
switch (type) {
case COLLABORATION_TYPE_NUMBER.AUDIO:
return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE_NUMBER.CAMERA:
return COLLABORATION_TYPE.CAMERA;
case COLLABORATION_TYPE_NUMBER.VIDEO:
return COLLABORATION_TYPE.VIDEO;
case COLLABORATION_TYPE_NUMBER.DOCUMENT:
return COLLABORATION_TYPE.DOCUMENT;
case COLLABORATION_TYPE_NUMBER.BOARD:
return COLLABORATION_TYPE.BOARD;
default:
return 0;
}
}
getCollaborarionTypeAsNumber() {
return this.parseCoworkTypeToNumber(this.collaborationType);
}
parseCoworkTypeToNumber(type) {
switch (type) {
case COLLABORATION_TYPE.AUDIO:
return COLLABORATION_TYPE_NUMBER.AUDIO;
case COLLABORATION_TYPE.CAMERA:
return COLLABORATION_TYPE_NUMBER.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return COLLABORATION_TYPE_NUMBER.VIDEO;
case COLLABORATION_TYPE.DOCUMENT:
return COLLABORATION_TYPE_NUMBER.DOCUMENT;
case COLLABORATION_TYPE.BOARD:
return COLLABORATION_TYPE_NUMBER.BOARD;
default:
return 0;
}
}
};
// variable name for legacy connection to agent_app.js in coview library
var globalUserInfo = new CoviewUserInfo(
currentUserInfo.sid,
currentUserInfo.loginID,
roomInfo.roomID,
currentUserInfo.shopName
);
NativeBridgeDataSource.getDeviceInfo = function () {
if (typeof android != "undefined") {
return JSON.parse(android.getDeviceInfo());
} else {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getDeviceInfo, {}));
}
};
var DeviceInfo = class {
isMoble; // iphone or iPad
platform; // ios or android
androidVersion;
constructor(deviceInfo) {
this.isMoble = deviceInfo.isMoble;
this.platform = deviceInfo.platform;
if (typeof android != "undefined") {
this.androidVersion = android.getAndroidVersion();
}
}
isiOS() {
return this.platform == "ios";
}
isAndroid() {
return this.platform == "android";
}
isMobile() {
return this.isMoble == "true";
}
};
var deviceInfo = new DeviceInfo(NativeBridgeDataSource.getDeviceInfo());
// WARN:: this variable is only for use in coview. and should request not to use this.
var isIos = deviceInfo.isiOS();
NativeBridgeDataSource.getRoomInfo = function () {
if (typeof android != "undefined") {
return JSON.parse(android.getRoomInfo());
} else {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getRoomInfo, {}));
}
};
var RoomInfo = class {
roomID;
roomName;
roomType;
constructor(roomInfo) {
this.roomID = roomInfo.roomID;
this.roomName = roomInfo.roomName;
this.roomType = roomInfo.roomType;
}
};
var roomInfo = new RoomInfo(NativeBridgeDataSource.getRoomInfo());
NativeBridgeDataSource.getServerInfo = function () {
if (typeof android != "undefined") {
return JSON.parse(android.getServerInfo());
} else {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getServerInfo, {}));
}
};
var ServerInfo = class {
chatURL;
cmsURL;
isOnline;
constructor(serverInfo) {
this.chatURL = serverInfo.chatURL;
this.cmsURL = serverInfo.cmsURL;
this.isOnline = serverInfo.isOnline;
}
};
var serverInfo = new ServerInfo(NativeBridgeDataSource.getServerInfo());
var JoinInfo = class {
sid;
loginId;
shopName;
roomId;
roomName;
shopMemberId;
constructor(sid, loginId, shopName, roomId, roomName, shopMemberId) {
this.sid = sid;
this.loginId = loginId;
this.shopName = shopName;
this.roomId = roomId;
this.roomName = roomName;
this.shopMemberId = shopMemberId;
}
};
NativeBridgeDataSource.getMyUserInfo = function () {
if (typeof android != "undefined") {
return JSON.parse(android.removeFavoriteGroup(groupID));
} else {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.currentUserInfo, {}));
}
};
var CurrentUserInfo = class {
sid;
loginID;
shopName;
shopMemberID;
languageCode;
constructor(userInfo) {
this.sid = userInfo.sid;
this.loginID = userInfo.loginId;
this.shopName = userInfo.shopName;
this.shopMemberID = userInfo.shopMemberId;
if (userInfo.languageCode == undefined) {
userInfo.languageCode = "jp";
}
this.languageCode = userInfo.languageCode;
}
configureLanguage(languageCode = undefined) {
if (languageCode == undefined) {
languageCode = this.languageCode;
}
moment.locale(languageCode);
setLanguage(languageCode);
}
};
var currentUserInfo = new CurrentUserInfo(
NativeBridgeDataSource.getMyUserInfo()
);
currentUserInfo.configureLanguage();
// 名前空間
var ARCHIVE_UI = {};
document.addEventListener("DOMContentLoaded", function () {
// アーカイブ検索
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 (keywordEmpty) {
$(".overlay_src_msg").empty();
return;
}
$(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword);
if (enterKeyPressed) {
searchInput.blur();
return;
}
// 検索結果を表示
});
};
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#archive .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
$(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword);
}
});
};
var renderArchiveTemplate = function (
html,
archiveId,
archiveName,
archiveDate,
typeImageURL
) {
return Mustache.render(html, {
archiveId: archiveId,
fileName: archiveName,
insertDate: archiveDate,
typeImage: typeImageURL,
});
};
// 名前空間
var CHAT_ADD_USER = {};
document.addEventListener("DOMContentLoaded", function () {
// メンバー検索
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, overlayMessage);
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList, overlayMessage);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList, overlayMessage);
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;
}
} else if (keywordEmpty) {
$(".overlay_src_msg").empty();
return false;
}
CHAT_ADD_USER.searchUser(keyword);
if (enterKeyPressed) {
searchInput.blur();
return;
}
});
};
var bindiOSKeyBoardEvent = function () {
const searchInput = $('#chat_add_user .search_form input[type="search"]');
searchInput.on("compositionend", function () {
if (CHAT_UTIL.isIOS()) {
var keyword = searchInput.val();
CHAT_ADD_USER.searchUser(keyword);
}
});
};
var searchGroupData = function (groupList, overlayMessage) {
const groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) {
let html = renderGroupTemplate(
groupTemplate,
group.groupName,
group.groupId
);
let obj = jQuery.parseHTML(html);
overlayMessage.append(obj);
});
};
var renderGroupTemplate = function (groupTemplate, groupName, groupID) {
return Mustache.render(groupTemplate, {
name: groupName,
id: groupID,
});
};
var searchUserData = function (userList, overlayMessage) {
const userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
userList.forEach(function (user) {
setUserProfile(user);
checkUser(user);
});
let html = renderUserTemplate(userTemplate, userList);
let obj = jQuery.parseHTML(html);
overlayMessage.append(obj);
};
var setUserProfile = function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
};
var checkUser = function (user) {
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
return shopMemberId == user.shopMemberId;
});
if (findObj) {
user.checked = "checked";
}
};
var renderUserTemplate = function (userTemplate, userList) {
return Mustache.render(userTemplate, {
userList: userList,
});
};
// 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);
}
};
// 名前空間
var CHAT_DB = {};
includeJs("./js/chat-db-foriOS.js");
//ロカールDBからルーム一覧情報を取得
CHAT_DB.getRoomList = function (roomType, keyWord) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, {
roomType: roomType,
keyWord: keyWord,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getRoomList(roomType, keyWord));
}
};
CHAT_DB.callGetRoomList = function (roomType) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, { roomType: roomType })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList(roomType));
}
};
//ロカールDBからログインしたユーザのデータを取得する。
CHAT_DB.getMyInfo = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyInfo, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyInfo());
}
};
CHAT_DB.getMessages = function (roomId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessages, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMessageList(roomId));
}
};
CHAT_DB.getMessagesWithMessageId = function (messageId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessageListFromMessageId, {
messageId: messageId
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getMessageListFromMessageId(messageId));
}
};
CHAT_DB.getFavoriteUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getFavoriteUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsersNotInRoom());
}
};
CHAT_DB.getFavoriteUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsers());
}
};
CHAT_DB.getFavoriteGroups = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteGroups, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteGroups());
}
};
CHAT_DB.getMyGroupUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyGroupUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsers());
}
};
CHAT_DB.getGroupInfo = function (groupId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfo, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfo(groupId));
}
};
CHAT_DB.getGroupInfoForAddUser = function (groupId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfoForAddUser, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfoForAddUser(groupId));
}
};
CHAT_DB.loadSelectedUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getSelectedUserList, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
console.log(JSON.parse(android.getSelectedUserList()));
return JSON.parse(android.getSelectedUserList());
}
};
CHAT_DB.getNameCardData = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getNameCardData, {
shopMemberId: shopMemberId,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getNameCardData(shopMemberId));
}
};
CHAT_DB.getMyGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupShopMemberByName(shopMemberName));
}
};
CHAT_DB.getMyGroupShopMemberNotInRoomByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getMyGroupShopMemberNotInRoomByName(shopMemberName)
);
}
};
CHAT_DB.getAllGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getAllGroupShopMemberByName(shopMemberName));
}
};
CHAT_DB.getAllGroupShopMemberNotInRoomByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getAllGroupShopMemberNotInRoomByName(shopMemberName)
);
}
};
CHAT_DB.getGroupByName = function (groupName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupByName, { groupName: groupName })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupByName(groupName));
}
};
CHAT_DB.getUsersInRoom = function (roomId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUsersInRoom, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUsersInRoom(roomId));
}
};
// アーカイブ一覧
CHAT_DB.getArchiveList = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getArchiveList, {}));
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveList());
}
};
CHAT_DB.updateArchiveList = function () {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.updateArchiveList.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.updateArchiveList();
}
};
// アーカイブ一覧検索
CHAT_DB.getArchiveByName = function (archiveName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveByName, {
archiveName: archiveName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveListByName(archiveName));
}
};
// アーカイブ詳細
CHAT_DB.getArchiveDetail = function (archiveId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveDetail, { archiveId: archiveId })
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveDetail(archiveId));
}
};
CHAT_DB.updateArchiveDetail = function (archiveId) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.updateArchiveDetail.postMessage(archiveId);
} else if (CHAT_UTIL.isAndroid()) {
android.updateArchiveDetail(archiveId);
}
};
CHAT_DB.searchMessages = function (keyword, userList) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.searchMessages, {
keyWord: keyword,
userList: userList,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.searchMessages(keyword, userList));
}
};
CHAT_DB.getMyGroupUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsersNotInRoom());
}
};
CHAT_DB.getUserInfo = function (shopMemberId) {
if (shopMemberId == "") {
return;
}
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserInfo, { shopMemberId: shopMemberId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUserInfo(shopMemberId));
}
};
CHAT_DB.getUserListByLoginId = function (loginIdList) {
console.log(loginIdList);
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserListByLoginId, {
loginIdList: loginIdList.join(","),
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getUserListByLoginId(loginIdList.join(",")));
}
};
jQuery("#homeButton").on("click", function () {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.goHome();
}
});
jQuery("#reloadButton").on("click", function () {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要。
} else if (CHAT_UTIL.isAndroid()) {
android.reload();
}
});
var lastscrollvalue;
window.onscroll = function () {
if (beforeScroll == window.scrollY) {
return;
}
beforeScroll = window.scrollY;
const beforeHeight = $(".room_container").height();
messageCount = $(".chat_message").length;
if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) {
if (!$("#chatLoader").is(":visible")) {
let loader = $(
'<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>'
);
$("#messages").prepend(loader);
const messageId = $($(".chat_message").get(0)).data("messageid");
let messages;
if (typeof android != "undefined") {
if (IS_ONLINE == "true") {
android.updatePreMessage(messageId);
}
} else {
// 追加メッセージUpdate、get
webkit.messageHandlers.updatePreMessage.postMessage({ messageId: messageId });
}
messages = CHAT_DB.getMessagesWithMessageId(messageId);
CHAT_UI.prependMessage(messages);
loader.remove();
var afterHeight = $(".room_container").height();
window.scroll(0, afterHeight - beforeHeight);
}
}
};
$("#roomNameChangeBtn").click(function () {
var changeRoomName = $("#roomNameInput").val();
var trimmedRoomName = $("#roomNameInput").val().trim();
if (trimmedRoomName.length == 0) {
alert(getLocalizedString("error_empty_room_name"));
return;
}
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.changeRoomName.postMessage(changeRoomName);
} else if (CHAT_UTIL.isAndroid()) {
android.changeRoomName(changeRoomName);
}
});
/*
$('#messages').scroll(function() {
console.log('messagescroll');
if ($(this).scrollTop() === 0) {
if (!$('#chatLoader').is(':visible')) {
// 現在、メッセージの個数以前をメッセージを読み込む
// ローディングアイコンを追加する
let loader = $('<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>')
$('#messages').prepend(loader)
loader.remove();
// socket.emit('getMessages', $(this).children().length, function() {
// // ローディングアイコンを削除する
// loader.remove();
// });
}
}
});*/
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 = {};
document.addEventListener("DOMContentLoaded", function () {
// メンバー検索
searchMember();
// iOSキーボード変換検知用
bindiOSKeyBoardEvent();
});
// メンバー検索
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 = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) {
let html = 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(userList);
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);
});
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 != "" && keyword.length != 0;
//画面タイトル設定
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;
}
});
};
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,
});
};
document.addEventListener("DOMContentLoaded", function () {
no_scroll();
// メニューオーバーレイ表示
$(".menu_btn").click(function () {
var w = $(this).width();
$(this).toggleClass("hide");
$('#overlay_menu .item').toggleClass('hide');
});
// ユーザーリストオーバーレイ表示
$(".user_btn").click(function () {
var w = $(this).width();
$(this).toggleClass("hide");
$("#overlay_user_list.overlay")
.toggleClass("slidein")
.css({ transform: "translateX(" & -w & ")" });
if($(this).hasClass('hide')){
return_scroll();
}else{
scrollTo(0, 0);
no_scroll();
}
});
// モーダルonモーダル(前のモーダルを非表示に)
// ホスト変更ボタン押下イベント
$(".ch_host_btn").click(function () {
var target = $(this).val();
changeModal(target, "changeHostModal");
});
/* モーダルの切り替え */
function changeModal(beforeModal, afterModal) {
$(beforeModal).modal("hide");
$(afterModal).modal("show");
}
// 閉じるイベント
$(".close_btn").click(function () {
$("#overlay_add_user_list").addClass("none");
no_scroll();
});
// ユーザー追加イベント
$(".inv_btn").click(function () {
$("#overlay_add_user_list").addClass("none");
});
// ユーザー招待メンバー検索
$(".add_user_btn").click(function () {
return_scroll();
CHAT_UI.showLoadingIndicator();
CHAT.globalSelectedUserList = [];
CHAT_UI.refreshMyGroupForAddUserInCollaboration();
$("#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(",")
);
}
CHAT_UI.confirmInviteUserListInCollaboration();
});
});
});
function penOff() {
if (!$("#penBtn .pen").hasClass("disable")) {
$("#coviewPenCtrBtn").click();
$("#penBtn .pen").addClass("disable");
}
}
function no_scroll() {
document.addEventListener("mousewheel", scroll_control, { passive: false });
document.addEventListener("touchmove", scroll_control, { passive: false });
}
// スクロール禁止解除
function return_scroll() {
document.removeEventListener("mousewheel", scroll_control, { passive: false });
document.removeEventListener('touchmove', scroll_control, { passive: false });
}
function scroll_control(event) {
if(event.cancelable){
event.preventDefault();
}
}
\ No newline at end of file
String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest);
}
function includeJs(jsFilePath) {
var js = document.createElement("script");
......@@ -31,11 +35,7 @@ $(".category").on("click", function () {
});
$(".home_btn").on("click", function () {
if (CHAT_UTIL.isAndroid()) {
android.goHome();
} else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({});
}
NativeBridgeDelegate.goHome();
});
document.addEventListener("DOMContentLoaded", function () {
......@@ -72,24 +72,71 @@ document.addEventListener("DOMContentLoaded", function () {
$(".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");
}, 10);
});
var Common = {};
$(".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");
}
}, 10);
});
});
//loadingIndicatorを表示
Common.showLoadingIndicator = function () {
const h = $(window).height();
$("#loader-bg ,#loader").height(h).css("display", "block");
};
//loadingIndicatorを表示しない
Common.dismissLoadingIndicator = function () {
const h = $(window).height();
$("#loader-bg ,#loader").height(h).css("display", "none");
};
Common.refreshForOnline = function () {
serverInfo.isOnline = "true";
$(".footer_item a").removeClass("ui-state-disabled");
if (typeof ChatList != "undefined") {
ChatList.refreshForOnline();
}
if (typeof ChatRoom != "undefined") {
ChatRoom.refreshForOnline();
}
if (typeof Namecard != "undefined") {
Namecard.refreshForOnline();
}
};
Common.refreshForOffline = function () {
serverInfo.isOnline = "false";
$(".footer_item a").addClass("ui-state-disabled");
if (typeof ChatList != "undefined") {
ChatList.refreshForOffline();
}
if (typeof ChatRoom != "undefined") {
ChatRoom.refreshForOffline();
}
if (typeof CollaborationUI != "undefined") {
CollaborationUI.refreshForOffline();
}
if (typeof Namecard != "undefined") {
Namecard.refreshForOffline();
}
};
// #36170 画像パスが存在しない場合はデフォルトの画像を返す
// 存在する場合はプロフィール画像取得用APIのURLを生成して返す
Common.getProfileImgUrl = function (path) {
if (path == undefined || path == "") {
return "./img/noImage.png";
} else if (path.includes("/mnt")) {
const userInfo = path.split("/").reverse();
return (
serverInfo.cmsURL +
"/chatapi/user?profileFileName=" +
userInfo[0] +
"&profileGetLoginId=" +
userInfo[1] +
"&sid=" +
currentUserInfo.sid +
"&cmd=12"
);
} else {
return path;
}
};
......@@ -24,7 +24,7 @@ const ChatRoomType = {
ALL: "2",
};
const CollaborationTypeKey = {
const COLLABORATION_TYPE = {
AUDIO: "audio",
CAMERA: "camera",
VIDEO: "video",
......@@ -32,7 +32,7 @@ const CollaborationTypeKey = {
BOARD: "board",
};
const COLLABORATION_TYPE = {
const COLLABORATION_TYPE_NUMBER = {
AUDIO: 0,
CAMERA: 2,
VIDEO: 3,
......@@ -55,7 +55,7 @@ const HostRequestFlag = {
};
const PagingSize = {
MESSAGE: 100
MESSAGE: 100,
};
const InvitedFlag = {
......@@ -63,6 +63,19 @@ const InvitedFlag = {
INVITED: 1,
};
const COLLABORATION_JOIN_TYPE = {
HOST: "0",
ATTENDEE: "1",
INVITED: "2",
};
const ARCHIVE_TYPE = {
PICTURE: 0,
VIDEO: 1,
VOICE: 2,
DOCUMENT: 3,
};
const messageSeperator = "<::split>";
const DATA_MESSAGE_SCHEME = "::NOT_MESSAGE";
const FINISH_ALL_COLLABORATION_SIGNAL = "::ALL_COLLABORATION_END";
......@@ -78,6 +91,9 @@ const TemplateURL = {
USER_LIST: "./template/template_user_list.html",
USER_NAME_CARD: "./template/template_user_name_card.html",
USER_MESSAGE: "./template/template_user_message.html",
ARCHIVE: "./template/template_archive.html",
ARCHIVE_DETAIL: "./template/template_archive_detail.html",
ARCHIVE_USER: "./template/template_archive_user.html",
MY_NAME_CARD: "./template/template_my_name_card.html",
MY_MESSAGE: "./template/template_my_message.html",
OPEN_COLLABORATION_MESSAGE:
......@@ -105,6 +121,9 @@ const TemplateURL = {
"./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",
COLLABORATION_PROFILE: "./modal_collabo_profile.html",
COLLABORATION_OVERLAY_USER_LIST: "collaboration_overlay_user_list.html",
MODAL_ADD_USER_CONFIRM: "./modal_add_user_confirm.html",
};
const SOCKET_KEY = {
......@@ -118,9 +137,16 @@ const SOCKET_KEY = {
SHOW_SERVER_ERROR: "showServerError",
RETRY_JOIN_PROCESS: "retryJoinProcess",
JOIN: "join",
CREATE_MESSAGE: "createMessage",
GET_GROUP_LIST: "getGroupList",
LEAVE_ROOM: "leaveRoom",
};
const NATIVE_KEY_IOS = {
currentUserInfo: "currentUserInfo",
getDeviceInfo: "getDeviceInfo",
getServerInfo: "getServerInfo",
getRoomInfo: "getRoomInfo",
getBeforeRoomType: "getBeforeRoomType",
getRoomType: "getRoomType",
removeFavoriteUser: "removeFavoriteUser",
......@@ -160,3 +186,5 @@ const NATIVE_KEY_IOS = {
getMessageListFromMessageId: "getMessageListFromMessageId",
updatePreMessage: "updatePreMessage",
};
const BIZ_TASK_YELL_URL = "https://biztaskyell.abookcloud.com";
\ No newline at end of file
// 名前空間
var CONTACT = {};
document.addEventListener("DOMContentLoaded", function () {
// メンバー検索
bindMemeberSearch();
// iOSキーボード変換検知用
bindiOSKeyBoardEvent();
});
// ユーザー検索
CONTACT.searchUser = function (keyword) {
const overlayMessage = $(".overlay_src_msg");
const isAllGroup = $("#tabAllGroup").is(":checked");
let hasNoData = false;
overlayMessage.empty();
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
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);
}
});
};
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
......@@ -2,8 +2,6 @@ $.lang.en = {
"chat_placeholder":"Type message",
"chat_search_placeholder":" Search Message",
"room_search_placeholder":" Search Room",
"participants":"Member List",
"exitRoom":"Exit ",
"roomListTitle":"Room List",
"deleteRoomTitle":"Delete Room",
"inviteUsersButton":"invite",
......@@ -21,18 +19,12 @@ $.lang.en = {
"orderByTime":"OrderByTime",
"orderByUnread":"OrderByUnread",
"roomKeywordPlaceHolder":"Search",
"okayLabel":"Okay!",
"completeLabel":"Complete.",
"thankLabel":"Thank you",
"startToWorkLabel":"Start to work",
"groupListKeyword":"Search",
"userSearch":"User Search",
"groupSearch":"Group Search",
"groupPageSubtitle":"Groups",
"noMessages":"No Messages",
"image":"Image",
"chatKeyword":"Search",
"userListKeyword":"Search",
"newRoomName":"Please input Room Name",
"everyoneIsHere":"Everyone is in the chat.",
"people":"people",
......
......@@ -2,8 +2,6 @@ $.lang.ja = {
"chat_placeholder":"メッセージを入力",
"chat_search_placeholder":" メッセージ検索",
"room_search_placeholder":" ルーム検索",
"participants":"メンバーリスト",
"exitRoom":"退出 ",
"roomListTitle":"チャット",
"deleteRoomTitle":"ルーム削除",
"inviteUsersButton":"招待",
......@@ -20,18 +18,12 @@ $.lang.ja = {
"orderByTime":"新着順",
"orderByUnread":"未読優先",
"roomKeywordPlaceHolder":"検索",
"okayLabel":"了解しました。",
"completeLabel":"完了しました。",
"thankLabel":"ありがとうございます。",
"startToWorkLabel":"作業開始します。",
"userSearch":"ユーザー検索",
"groupSearch":"グループ検索",
"groupListKeyword":"検索",
"groupPageSubtitle":"グループ",
"noMessages":"メッセージがありません。",
"image":"画像",
"chatKeyword":"検索",
"userListKeyword":"検索",
"invitedUser":"参加者",
"newRoomName":"ルーム名を入力してください",
"everyoneIsHere":"招待可能なメンバーがいません。",
......
......@@ -2,8 +2,6 @@ $.lang.ko = {
"chat_placeholder":"메시지를 입력하세요.",
"chat_search_placeholder":" 메세지검색",
"room_search_placeholder":" 채팅방 검색",
"participants":"멤버 리스트",
"exitRoom":"나가기 ",
"roomListTitle":"채팅 리스트",
"deleteRoomTitle":"채팅방 삭제",
"inviteUsersButton":"유저 초대",
......@@ -21,18 +19,12 @@ $.lang.ko = {
"orderByTime":"최신순",
"orderByUnread":"안 읽은 순",
"roomKeywordPlaceHolder":"검색",
"okayLabel":"알겠습니다.",
"completeLabel":"작업이 끝났습니다.",
"thankLabel":"감사합니다.",
"startToWorkLabel":"작업을 시작합니다.",
"groupListKeyword":"검색",
"userSearch":"유저 검색",
"groupSearch":"그룹 검색",
"groupPageSubtitle":"그룹",
"noMessages":"메시지가 없습니다.",
"image":"이미지",
"chatKeyword":"검색",
"userListKeyword":"검색",
"newRoomName":"방 이름을 입력해주세요.",
"everyoneIsHere":"초대가능한 유저가 없습니다.",
"people":"명",
......
var bindOnNewMessage = function () {
// New Message
// #36170
socket.on(SOCKET_KEY.NEW_MESSAGE, function (message, roomId, roomName) {
console.log(message);
socket.on(SOCKET_KEY.NEW_MESSAGE, function (message, roomID, roomName) {
const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
const unwrappedMessageInfo = decodeMessage(message.text);
......@@ -35,10 +34,12 @@ var bindOnNewMessage = function () {
}
}
// 画像、動画の描画を待ってからスクロール
setTimeout(function () {
CHAT_UI.scrollToBottom();
}, 300);
if (typeof ChatRoom !== "undefined") {
// 画像、動画の描画を待ってからスクロール
setTimeout(function () {
ChatRoom.scrollToBottom();
}, 300);
}
});
};
......@@ -57,12 +58,14 @@ var addCollaborationMessage = function (
insertDate,
createdAt
) {
const collaborationType = messageInfo[2];
const collaborationType = CHAT_UTIL.getCollaborationType(messageInfo[2]);
const meetingID = getMeetingID(collaborationType, messageInfo);
const userInCollaboration = getUserInfoList(userID);
const userInCollaboration = JSON.parse(
NativeBridgeDataSource.getUserInfoList(userID)
);
userInCollaboration.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
});
const openCollaborationMessageTemplate = getTemplate(
......@@ -83,10 +86,7 @@ var addCollaborationMessage = function (
};
var getMeetingID = function (collaborationType, messageInfo) {
if (
collaborationType ==
CHAT_UTIL.getCollaborationType(CollaborationTypeKey.DOCUMENT)
) {
if (collaborationType == COLLABORATION_TYPE.DOCUMENT) {
return messageInfo[3];
} else {
return 0;
......@@ -120,10 +120,12 @@ var renderCollaborationMessage = function (
var addTextMessage = function (messageText, message, socketID) {
const messageTextWithSID = insertSID(messageText);
const messageSender = getUserInfoList(message.userId);
const messageSender = JSON.parse(
NativeBridgeDataSource.getUserInfoList(message.userId)
);
const shopMemberName = messageSender[0].shopMemberName;
const textMessageTemplate = getTextMessageTemplate(message.id === socketID);
const profileImagePath = CHAT.getProfileImgUrl(message.profileImagePath);
const profileImagePath = Common.getProfileImgUrl(message.profileImagePath);
const html = renderTextMessage(
textMessageTemplate,
messageTextWithSID,
......@@ -164,11 +166,7 @@ var renderTextMessage = function (
};
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));
}
return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
};
var cleanUpCollaborationMessage = function () {
......@@ -189,7 +187,7 @@ var insertSID = function (text) {
let replacePath = text;
replacePath = replacePath.replaceAll(
"?fileName=",
"?sid=" + CHAT.globalLoginParameter.sid + "&fileName="
"?sid=" + currentUserInfo.sid + "&fileName="
);
return replacePath;
};
......
......@@ -3,10 +3,6 @@ var socket;
// 名前空間
var CHAT_SOCKET = {};
includeJs("./js/chat-websocket-message.js");
includeJs("./js/chat-websocket-refresh-group-list.js");
includeJs("./js/chat-websocket-refresh-user-list-in-group.js");
CHAT_SOCKET.socketCheck = function () {
if (socket == null || socket.disconnected) {
window.location.reload();
......@@ -14,14 +10,14 @@ CHAT_SOCKET.socketCheck = function () {
};
CHAT_SOCKET.connectSocket = function () {
if (IS_ONLINE == "true") {
socket = io(CHAT_SERVER_URL);
if (serverInfo.isOnline == "true") {
socket = io(serverInfo.chatURL);
setSocketAction();
} else {
//オフラインの場合、DBからルーム一覧を表示。
if (CHAT_UTIL.isIOS()) {
if (deviceInfo.isiOS()) {
//TODO IOSの場合
} else if (CHAT_UTIL.isAndroid()) {
} else if (deviceInfo.isAndroid()) {
}
}
};
......@@ -53,33 +49,20 @@ var bindOnConnect = function () {
socket.on(SOCKET_KEY.CONNECT, function () {
// socketが接続されたらチャット画面で画面を更新する
$(".overlay").removeClass("active undismissable");
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
requestLoginInfo();
CHAT_UI.dismissLoadingIndicator();
});
};
var requestLoginInfo = function () {
// チャットルームに入場する際、sid, loginId, shopName, roomId, roomNameの情報を取得しNodeJsに渡す
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.getLoginParameter();
}
};
var bindOnDisconnect = function () {
socket.on(SOCKET_KEY.DISCONNECT, function () {
//socketが切断されたら黒画面で画面を更新する
$(".overlay").addClass("active undismissable");
CHAT_UI.dismissLoadingIndicator();
Common.dismissLoadingIndicator();
});
};
var bindOnConnectError = function () {
socket.on(SOCKET_KEY.CONNECT_ERROR, function () {
CHAT_UI.dismissLoadingIndicator();
Common.dismissLoadingIndicator();
});
};
......@@ -97,6 +80,24 @@ var bindOnNewNotification = function () {
});
};
var bindOnRefreshGroupList = function () {
// Update Group List(Invite)
socket.on(SOCKET_KEY.REFRESH_GROUPLIST, function (groups, isInvite) {
const groupListElement = $("#group_list");
groupListElement.html("");
if (groups.length === 0) {
groupListElement.append(
'<center class="text-secondary">' +
getLocalizedString(everyoneIsHere) +
"</center>"
);
}
$("#newRoomName").hide();
});
};
var bindOnShowServerError = function () {
socket.on(SOCKET_KEY.SHOW_SERVER_ERROR, function (message) {
// #36215
......@@ -120,41 +121,42 @@ var bindOnShowServerError = function () {
keyboard: false,
})
.on("click", "#customAlertOk", function (e) {});
CHAT_UI.dismissLoadingIndicator();
Common.dismissLoadingIndicator();
if (message == "Room not found") {
CHAT.saveRoomInfo();
CHAT_SOCKET.saveRoomInfo();
}
});
};
var bindOnRetryJoinProcess = function () {
socket.on(SOCKET_KEY.RETRY_JOIN_PROCESS, function () {
var ua = window.navigator.userAgent.toLowerCase();
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.getLoginParameter();
} else {
CHAT_UI.htmlElementTextInitialize("ko");
// webでのsocket connect
emitJoin();
}
currentUserInfo.configureLanguage();
// webでのsocket connect
CHAT_SOCKET.emitJoin(params, true, true);
});
};
var emitJoin = function () {
socket.emit(SOCKET_KEY.JOIN, params, function (err) {
CHAT_SOCKET.emitJoin = function (
joinInfo,
needsDismissLoadingIndicator,
needsHandlingError
) {
socket.emit(SOCKET_KEY.JOIN, joinInfo, function (err) {
if (err) {
errorHandlingForEmitJoin();
CHAT_UI.dismissLoadingIndicator();
if (needsHandlingError) {
errorHandlingForEmitJoin();
}
if (needsDismissLoadingIndicator) {
Common.dismissLoadingIndicator();
}
return;
}
updateRoomName(params.roomName);
// loadingIndicatorを表示しない
CHAT_UI.dismissLoadingIndicator();
if (needsDismissLoadingIndicator) {
// loadingIndicatorを表示しない
Common.dismissLoadingIndicator();
}
});
};
......@@ -173,12 +175,54 @@ var errorHandlingForEmitJoin = function () {
.on("click", "#customAlertOk", function (e) {});
};
var updateRoomName = function (roomName) {
const titleRoomName = $(".titleRoomName");
if (roomName != undefined) {
titleRoomName.text(roomName).data("roomName", roomName);
} else {
let roomListTitle = getLocalizedString("roomListTitle");
titleRoomName.text(roomListTitle);
var bindOnRefreshUserListInGroup = function () {
// Update User List(Invite)
// #36170
socket.on(
SOCKET_KEY.REFRESH_USERLIST_INGROUP,
function (users, groupId, isInvite) {
console.debug(
SOCKET_KEY.REFRESH_USERLIST_INGROUP +
"message received but it does nothing."
);
}
);
};
CHAT_SOCKET.emitCreateMessage = function (sendData, offset) {
socket.emit(SOCKET_KEY.CREATE_MESSAGE, { text: sendData }, offset);
};
CHAT_SOCKET.emitCollaborationFinishMessage = function () {
if (socket != null && socket.connected) {
const sendData = DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL;
CHAT_SOCKET.emitCreateMessage(sendData, 0);
}
}
CHAT_SOCKET.emitGetGroupList = function (isInvite) {
socket.emit(SOCKET_KEY.GET_GROUP_LIST, isInvite);
};
CHAT_SOCKET.emitLeaveRoom = function () {
socket.emit(SOCKET_KEY.LEAVE_ROOM, function () {});
};
CHAT_SOCKET.saveRoomInfo = function (roomID, roomName) {
roomInfo.roomID = roomID;
roomInfo.roomName = roomName;
NativeBridgeDelegate.saveVisitRoomInfo(roomID, roomName);
};
CHAT_SOCKET.initialJoin = function () {
CHAT_SOCKET.connectSocket();
const joinInfo = new JoinInfo(
currentUserInfo.sid,
currentUserInfo.loginID,
currentUserInfo.shopName,
roomInfo.roomID,
roomInfo.roomName,
currentUserInfo.shopMemberID
);
CHAT_SOCKET.emitJoin(joinInfo, false, false);
};
// 名前空間
var CHAT_UTIL = {};
CHAT_UTIL.isAndroid = function () {
return PLATFORM == "android";
};
CHAT_UTIL.isIOS = function () {
return PLATFORM == "ios";
};
CHAT_UTIL.isMobile = function () {
return IS_MOBILE == "true";
};
CHAT_UTIL.formatDate = function (date) {
const REFERENCE = moment();
const TODAY = REFERENCE.clone().startOf("day");
......@@ -120,37 +108,40 @@ function updateDuration() {
});
}
CHAT_UTIL.getCollaborationType = function (key) {
switch (key) {
case CollaborationTypeKey.AUDIO:
CHAT_UTIL.getCollaborationType = function (collaborationNumber) {
switch (collaborationNumber) {
case COLLABORATION_TYPE_NUMBER.AUDIO: // fall through
case COLLABORATION_TYPE_NUMBER.AUDIO.toString():
return COLLABORATION_TYPE.AUDIO;
case CollaborationTypeKey.CAMERA:
case COLLABORATION_TYPE_NUMBER.CAMERA:
case COLLABORATION_TYPE_NUMBER.CAMERA.toString(): // fall through
return COLLABORATION_TYPE.CAMERA;
case CollaborationTypeKey.VIDEO:
case COLLABORATION_TYPE_NUMBER.VIDEO:
case COLLABORATION_TYPE_NUMBER.VIDEO.toString(): // fall through
return COLLABORATION_TYPE.VIDEO;
case CollaborationTypeKey.DOCUMENT:
case COLLABORATION_TYPE_NUMBER.DOCUMENT:
case COLLABORATION_TYPE_NUMBER.DOCUMENT.toString(): // fall through
return COLLABORATION_TYPE.DOCUMENT;
case COLLABORATION_TYPE_NUMBER.BOARD:
case COLLABORATION_TYPE_NUMBER.BOARD.toString(): // fall through
return COLLABORATION_TYPE.BOARD;
default:
return 0;
}
};
CHAT_UTIL.getCoviewTypeFromCollaborationType = function (
joinCollaborationType
) {
switch (joinCollaborationType) {
CHAT_UTIL.getCollaborationTypeNumber = function (collaborationType) {
switch (collaborationType) {
case COLLABORATION_TYPE.AUDIO:
console.log(CollaborationTypeKey.AUDIO);
return CollaborationTypeKey.AUDIO;
return COLLABORATION_TYPE_NUMBER.AUDIO;
case COLLABORATION_TYPE.CAMERA:
console.log(CollaborationTypeKey.CAMERA);
return CollaborationTypeKey.CAMERA;
return COLLABORATION_TYPE_NUMBER.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return CollaborationTypeKey.VIDEO;
return COLLABORATION_TYPE_NUMBER.VIDEO;
case COLLABORATION_TYPE.DOCUMENT:
return CollaborationTypeKey.DOCUMENT;
return COLLABORATION_TYPE_NUMBER.DOCUMENT;
case COLLABORATION_TYPE.BOARD:
return CollaborationTypeKey.BOARD;
return COLLABORATION_TYPE_NUMBER.BOARD;
default:
return 0;
}
......
var ChatList = {};
$("#tabDM").on("click", function (e) {
ChatList.refreshRoomList(ChatRoomType.DM);
});
$("#tabGroup").on("click", function (e) {
ChatList.refreshRoomList(ChatRoomType.GROUP);
});
document.addEventListener("DOMContentLoaded", function () {
ChatList.bindChatSearch();
Common.dismissLoadingIndicator();
});
ChatList.bindChatSearch = function () {
const chatSearchInput = $('#chat .search_form input[type="search"]');
const chatSearchCancel = $("#chat .search_form .cancel");
chatSearchInput.click(function () {
let roomListTitle = getLocalizedString("room_search_placeholder");
$("#chatTitle").text(roomListTitle);
});
chatSearchCancel.click(function () {
let roomListTitle = getLocalizedString("roomListTitle");
$("#chatTitle").text(roomListTitle);
});
// チャットメンバー検索
chatSearchInput.keyup(function (e) {
var rooms;
var keyword = chatSearchInput.val();
const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
if (enterKeyPressed) {
if (keyword.length != 0 && keyword != "") {
chatSearchInput.blur();
return;
}
} else if (keyword == "" || keyword.length < 2) {
$(".overlay_src_msg").empty();
return;
}
ChatList.searchRoom(keyword, rooms);
if (enterKeyPressed) {
chatSearchInput.blur();
return;
}
});
// iOSキーボード変換検知用
chatSearchInput.on("compositionend", function () {
if (deviceInfo.isIOS()) {
var rooms;
var keyword = chatSearchInput.val();
ChatList.searchRoom(keyword, rooms);
}
});
};
ChatList.refreshRoomList = function (roomType) {
if (serverInfo.isOnline == "true") {
Common.refreshForOnline();
} else {
Common.refreshForOffline();
}
const selectedRoomTypeInRoomList = NativeBridgeDataSource.getBeforeRoomType();
if (selectedRoomTypeInRoomList != null) {
roomType = selectedRoomTypeInRoomList;
NativeBridgeDelegate.clearBeforeRoomType();
}
Common.showLoadingIndicator();
// select tab as room type
ChatList.selectTab(roomType);
// update room info in native db
if (serverInfo.isOnline == "true") {
NativeBridgeDelegate.updateRoomList();
}
// get room list from native db
const rooms = NativeBridgeDataSource.getRoomList(roomType, null);
// Room list 初期化
ChatList.initializeRoomList();
// set room title
ChatList.setRoomTitle();
// メッセージがない時、最新メッセージにempty messageを追加
if (rooms.length === 0) {
ChatList.addEmptyRoomListLabel(roomType);
}
// リストにルームを追加
ChatList.appendRoomList(rooms);
Common.dismissLoadingIndicator();
};
ChatList.addEmptyRoomListLabel = function (roomType) {
// 検索結果がない場合のメッセージを追加
const emptyListString = getLocalizedString("roomListEmptyString");
switch (roomType) {
case ChatRoomType.GROUP:
$("#groupChatList").append(
`<center class="text-secondary">${emptyListString}</center>`
);
break;
case ChatRoomType.DM:
$("#dmChatList").append(
`<center class="text-secondary">${emptyListString}</center>`
);
break;
default:
}
};
ChatList.selectTab = function (roomType) {
if (roomType == ChatRoomType.DM) {
$("#tabDM").prop("checked", true);
} else {
$("#tabGroup").prop("checked", true);
}
};
ChatList.initializeRoomList = function () {
// #36146に対応
$("#groupChatList").empty();
$("#dmChatList").empty();
};
ChatList.setRoomTitle = function () {
let roomListTitle = getLocalizedString("roomListTitle");
$("#chatTitle").text(roomListTitle);
};
ChatList.appendRoomList = function (rooms) {
const template = getTemplate(TemplateURL.ROOM_LIST);
rooms.forEach(function (room) {
let html = ChatList.renderRoom(template, room);
let obj = jQuery.parseHTML(html);
if (room.type.toString() == ChatRoomType.GROUP) {
$("#groupChatList").append(obj);
} else if (room.type.toString() == ChatRoomType.DM) {
$("#dmChatList").append(obj);
}
});
};
ChatList.getDefaultChatRoomName = function (roomAttendUsers) {
let attendUserName = [];
roomAttendUsers.forEach(function (user) {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
attendUserName.push(user.shopMemberName);
});
return attendUserName.join(", ");
};
ChatList.getUnreadCount = function (roomUnreadCount) {
if (roomUnreadCount == 0) {
return "";
} else if (roomUnreadCount > 999) {
return "999+";
}
return roomUnreadCount;
};
// チャットルーム検索
ChatList.searchRoom = function (keyword, rooms) {
const overlayMessage = $(".overlay_src_msg");
overlayMessage.empty();
rooms = NativeBridgeDataSource.getRoomList(ChatRoomType.ALL, keyword);
let roomListTitle = getLocalizedString("room_search_placeholder");
$("#chatTitle").text(roomListTitle);
const template = getTemplate(TemplateURL.ROOM_LIST);
rooms.forEach(function (room) {
let html = ChatList.renderRoom(template, room);
// Click event
let obj = jQuery.parseHTML(html);
overlayMessage.append(obj);
});
if (rooms.length == 0) {
const noResultMsg = getNoResultMessage();
overlayMessage.append(noResultMsg);
}
};
ChatList.getRoomMessage = function (message) {
if (message) {
return message.toString();
} else {
return getLocalizedString("noMessages");
}
};
ChatList.getDisplayMessage = function (messageType, roomMessage) {
switch (messageType) {
case MessageType.TEXT:
return roomMessage;
case MessageType.SYSTEM:
return roomMessage;
case MessageType.IMAGE:
return getLocalizedString("image");
case MessageType.VIDEO:
return getLocalizedString("video");
case MessageType.COMMUNICATIONSTART:
return getLocalizedString("collaboration_start");
case MessageType.COMMUNICATIONEND:
return getLocalizedString("collaboration_end");
default:
return roomMessage;
}
};
ChatList.renderRoom = function (template, room) {
// thumbnail counts
const thumbnailCount = Math.min(room.attendUsers.length, 4);
// set room name
if (room.chatRoomName == "") {
room.chatRoomName = ChatList.getDefaultChatRoomName(room.attendUsers);
}
// set profile images
room.profileImagePath = "./images/user-profile.png";
room.attendUsers.forEach(function (user) {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
});
// set room messages
const roomMessage = ChatList.getRoomMessage(room.message);
const displayMessage = ChatList.getDisplayMessage(
room.messageType,
roomMessage
);
// set date string
const time = room.insertDate
? CHAT_UTIL.formatDate(room.insertDate).createdAt
: "";
const messageUnreadCount = ChatList.getUnreadCount(room.unreadCount);
return Mustache.render(template, {
thumbnailCount: thumbnailCount,
roomName: room.chatRoomName,
roomId: room.chatRoomId,
profileImage: room.profileImagePath,
lastMessage: displayMessage,
time: time,
unreadMsgCnt: messageUnreadCount,
userCnt: room.attendUsers.length + 1,
attendUsers: room.attendUsers.splice(0, thumbnailCount),
});
};
ChatList.refreshForOnline = function () {
$(".craeteRoomButton").off("click", ChatList.offlineHandler);
$(".craeteRoomButton").css("opacity", "1.0");
};
ChatList.refreshForOffline = function () {
$(".craeteRoomButton").on("click", ChatList.offlineHandler);
$(".craeteRoomButton").css("opacity", "0.3");
};
ChatList.offlineHandler = function (e) {
e.preventDefault();
};
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