Commit 63a5d405 by Lee Munkyeong

Merge branch 'develop' of gitlab.agentec.jp:abookCommunication/chat_webview into…

Merge branch 'develop' of gitlab.agentec.jp:abookCommunication/chat_webview into feature/finish_all_collaboration

# Conflicts:
#	public_new/js/language_en.js
#	public_new/js/language_ja.js
#	public_new/js/language_ko.js
parents 5c7defaa bd11c0f8
......@@ -108,8 +108,10 @@
</a>
</div>
<div class="footer_item">
<img src="icon/icon_paste.png" alt="文書アイコン" onclick="CHAT_UI.startCollaboration(COLLABORATION_TYPE.DOCUMENT);">
<a href="javascript:CHAT_UI.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);">
......@@ -125,8 +127,10 @@
</div>
<!--リリース後開発予定-->
<div class="footer_item">
<img src="icon/icon_whiteboard_gray.png" alt="ホワイトボードアイコン" onclick="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.BOARD);">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.BOARD);">
<img src="icon/icon_whiteboard_gray.png" alt="ホワイトボードアイコン">
<p>ボード</p>
</a>
</div>
</div>
</div>
......
......@@ -23,12 +23,13 @@
<header id="collabo_header">
<div class="d-flex align-items-center h-100">
<div class="collabo_nav_l text-left w-100">
通話中
</div>
<div class="collabo_nav_r">
<div class="text-right d-flex align-items-center">
<button type="button" name="button" class="btn user_btn collaboration_contents picture_contents video_contents board_contents"></button>
<button type="button" name="button" class="btn menu_btn host_contents"></button>
<button type="button" name="button" class="btn add_user_btn none"></button>
<button type="button" name="button" class="btn menu_btn host_contents"></button>
<button type="button" name="button" class="btn start_pip_btn collaboration_contents document_contents" onclick="startPipMode();"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="Coview_exitCollaboration();"></button> -->
</div>
......@@ -225,6 +226,10 @@
}
}
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
......
......@@ -332,7 +332,6 @@ input[name="tab_item"] {
color: #fff;
border: none;
font-size: 18px;
max-width: 1280px;
}
.select_member {
font-size: 14px;
......@@ -443,6 +442,7 @@ input[name="tab_item"] {
/* ユーザーリストフィルター */
#filter .user_item .img_wrap {
position: relative;
cursor: pointer;
}
#filter .user_item .img_wrap.filter:after {
position: absolute;
......@@ -454,6 +454,7 @@ input[name="tab_item"] {
left: 5px;
background: #0070ca82;
border-radius: 50%;
cursor: pointer;
}
.user_list .user_item img {
......
......@@ -2,7 +2,6 @@
/**************************** footer *************************/
footer {
max-width: 1280px;
background: #F9F9F9;
margin-top: 20px;
border-top: 1px solid #CCCCCC;
......
@charset "UTF-8";
/**************************** header *************************/
#collabo_header {
max-width: 1280px;
height: 60px;
position: fixed;
top: 0;
......@@ -138,6 +137,10 @@
transition: 0.3s;
background-image: url("../icon/icon_member_blue.png");
}
.btn.menu_btn.hide {
transition: 0.3s;
background-image: url("../icon/icon_close.png");
}
.overlay {
transition: 0.7s;
position: absolute;
......@@ -162,7 +165,6 @@
height: 100vh;
z-index: 5;
width: 100%;
max-width: 1280px;
margin: 0 auto;
}
......@@ -198,7 +200,6 @@
background: white;
height: 70%;
width: 80%;
max-width: 1280px;
}
#add_user_list .user_list li {
list-style: none;
......@@ -336,7 +337,6 @@
/**************************** footer *************************/
#collabo_footer {
max-width: 1280px;
background: #1d1d1d;
height: 120px;
margin-top: 20px;
......@@ -364,7 +364,6 @@
/**************************** footer-menu *************************/
#collabo_footer_menu {
transition: 0.7s;
max-width: 1280px;
height: 70px;
position: fixed;
width: 100%;
......@@ -781,7 +780,6 @@ input[name="tab_item"] {
color: #fff;
border: none;
font-size: 18px;
max-width: 1280px;
}
.modal-content .select_member {
font-size: 14px;
......@@ -873,7 +871,6 @@ input[name="tab_item"] {
color: #fff;
border: none;
font-size: 18px;
max-width: 1280px;
}
.pip_indicator {
......
......@@ -2,7 +2,6 @@
@import url(./notosansjp.css);
body {
max-width: 1280px;
font-family: "Noto Sans JP", sans-serif;
margin: 0 auto;
color: #323743;
......@@ -20,7 +19,6 @@ a:link {
}
/**************************** nav *************************/
nav {
max-width: 1280px;
height: 60px;
position: fixed;
top: 0;
......
......@@ -2,7 +2,6 @@
/**************************** footer *************************/
footer {
max-width: 1280px;
background: #f9f9f9;
height: 70px;
margin-top: 20px;
......
......@@ -365,3 +365,10 @@ CHAT_DB.getJoinCollaborationType = function() {
return parseInt(callNativeApp("getJoinCollaborationType", {}), 10);
}
};
CHAT_DB.getHostRequestFlg = function() {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp("getHostRequestFlg", {}), 10);
}
};
......@@ -228,10 +228,14 @@ $('#videoUploadButton').on('click', function() {
$('#imageInputTag').on('change', function() {
$('#image-form').submit();
// reset the value of form
$('#imageInputTag').val("");
});
$('#videoInputTag').on('change', function() {
$('#video-form').submit();
// reset the value of form
$('#videoInputTag').val("");
});
$('#image-form').on('submit', function(e) {
......@@ -243,7 +247,7 @@ $('#image-form').on('submit', function(e) {
$('.loader').addClass('active');
CHAT_UI.showLoadingIndicator();
var fd = new FormData($(this)[0]);
console.log($(this)[0]);
//画像の大きさが500pixelより大きかったら、thumbnailを生成
CHAT.createThumbnailAndUpload(file, function(resizeFile, thumbnailCreated) {
if (resizeFile && thumbnailCreated) {
......@@ -825,6 +829,95 @@ CHAT_UI.deleteButtonAction = function(isInvite) {
CHAT_UI.showConfirmView(isInvite)
$('#select_user_list .user_list').find('.userCheckBox').show();
}
var GetFileBlobUsingURL = function (url, convertBlob) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.responseType = "blob";
xhr.addEventListener('load', function() {
console.log(xhr.response);
convertBlob(xhr.response);
});
xhr.send();
};
var blobToFile = function (blob, name) {
blob.lastModifiedDate = new Date();
blob.name = name;
return blob;
};
var GetFileObjectFromURL = function(filePathOrUrl, convertBlob) {
GetFileBlobUsingURL(filePathOrUrl, function (blob) {
convertBlob(blobToFile(blob, 'testFile.mp4'));
});
};
CHAT_UI.videoEncodeFail = function() {
alert(getLocalizedString('error_send_video'));
CHAT_UI.dismissLoadingIndicator();
}
CHAT_UI.videoEncodeEnd = function(encodedUri) {
var fileName = encodedUri.split('/')[encodedUri.split('/').length-1];
var fileURL = 'file:'+encodedUri;
var xhr = new XMLHttpRequest();
xhr.open("GET", fileURL);
xhr.responseType = "blob";
xhr.addEventListener('load', function() {
var formData = new FormData();
formData.append("image", xhr.response, fileName);
formData.append('sid', CHAT.globalLoginParameter.sid);
formData.append('roomId', CHAT.globalLoginParameter.roomId);
jQuery.ajax({
async: true,
url: CMS_SERVER_URL + "/chatapi/file/upload",
type: "post",
data: formData,
contentType: false,
processData: false,
error: function () {
alert(getLocalizedString('error_send_video'));
CHAT_UI.dismissLoadingIndicator();
}
}).done(function(res) {
if (CHAT_UTIL.isAndroid()) {
android.removeEncodedVideo(encodedUri);
}
var imgPath = CMS_SERVER_URL + '/chatapi/file/getImage?fileName=' + res.fileName + '&roomId=' + CHAT.globalLoginParameter.roomId;
var imageName = res.fileName;
// uploadFileの判断
var extension = imageName.substr(imageName.lastIndexOf('.') + 1).toLowerCase();
if (res.thumbnailPath && res.thumbnailPath.length > 0) {
imgPath = CMS_SERVER_URL + '/chatapi/file/getImage?fileName=' + res.thumbImageFileName + '&roomId=' + CHAT.globalLoginParameter.roomId;
}
let downloadPath = CMS_SERVER_URL + '/chatapi/file/download?fileName=' + imageName + '&roomId=' + CHAT.globalLoginParameter.roomId;
var videoSrc = CMS_SERVER_URL + '/chatapi/file/getImage?fileName=' + res.fileName + '&roomId=' + CHAT.globalLoginParameter.roomId;
const totalDiv = $('<div/>', {id:"attachedImages"});
const videoTag = $('<video/>', {controls:"true", width:'auto', style:'max-width:100%'});
const source = $('<source/>', {src:videoSrc});
const downloadIcon = $('<a/>',{href:downloadPath, class:'fa fa-download', download:res.fileName});
videoTag.append(source);
totalDiv.append(videoTag);
totalDiv.append(downloadIcon);
let text = totalDiv.prop('outerHTML');
let encodedText
try {
encodedText = encodeURIComponent(text)
} catch(e) {
encodedText = text;
}
socket.emit('createMessage', {
text: encodedText + messageSeperator + messageType.VIDEO
}, 1);
$('.overlay').removeClass('active undismissable');
$('.loader').removeClass('active');
CHAT_UI.dismissLoadingIndicator();
})
});
xhr.send();
};
CHAT_UI.htmlElementTextInitialize = function(languageCode) {
moment.locale(languageCode);
......@@ -2441,7 +2534,8 @@ CHAT_UI.refreshAllGroupForAddUser = function(paramGroupId) {
CHAT_UI.refreshForOnline = function() {
IS_ONLINE = 'true';
$('.craeteRoomButton').show();
$('.craeteRoomButton').off('click', CHAT_UI.offlineHandler);
$('.craeteRoomButton').css('opacity','1.0');
$('.footer_item a').removeClass('ui-state-disabled');
$('#videoUploadButton').removeClass('ui-state-disabled');
$('#imageInputButton').removeClass('ui-state-disabled');
......@@ -2449,7 +2543,8 @@ CHAT_UI.refreshForOnline = function() {
$('#messageInput').prop('disabled', false);
$('#messageInput').prop('placeholder', 'メッセージを入力してください');
$('#favoriteButton').prop('disabled', false);
$('#roomMenu').show();
$('#room_name_change_button').removeClass('ui-state-disabled');
$('#add_user_button').removeClass('ui-state-disabled');
$('.fa-download').show();
if (typeof $('#roomTitle').val() != 'undefined') {
CHAT_SOCKET.connectSocket();
......@@ -2460,7 +2555,8 @@ CHAT_UI.refreshForOnline = function() {
CHAT_UI.refreshForOffline = function() {
IS_ONLINE = 'false';
$('.craeteRoomButton').hide();
$('.craeteRoomButton').on('click', CHAT_UI.offlineHandler);
$('.craeteRoomButton').css('opacity','0.3');
$('.footer_item a').addClass('ui-state-disabled');
$('#videoUploadButton').addClass('ui-state-disabled');
$('#imageInputButton').addClass('ui-state-disabled');
......@@ -2468,8 +2564,33 @@ CHAT_UI.refreshForOffline = function() {
$('#messageInput').prop('disabled', true);
$('#messageInput').prop('placeholder', '');
$('#favoriteButton').prop('disabled', true);
$('#roomMenu').hide();
$('#room_name_change_button').addClass('ui-state-disabled');
$('#add_user_button').addClass('ui-state-disabled');
$('.fa-download').hide();
if (typeof coview_api == "undefined") { return }
var alertString = "";
if (g_isMainMan) {
alertString = getLocalizedString("err_weak_network_exit_collaboration")
} else {
alertString = getLocalizedString("err_weak_network_exit_collaboration")
}
alert(alertString);
if (collaborationJoinFlg != '2') {
CHAT_UI.joinRoom(
CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name
);
} else {
if (typeof android != "undefined") {
android.openCommunicationHome();
} else {
webkit.messageHandlers.openCommunicationHome.postMessage({});
}
}
}
CHAT_UI.offlineHandler = function(e) {
e.preventDefault();
}
CHAT_UI.displayExistRoom = function(roomId) {
......@@ -2523,6 +2644,11 @@ CHAT_UI.startCollaboration = function(collaborationType) {
CHAT_UI.refreshJoinedCollaboration = function(loginIdList) {
for (var count = 0 ; count < loginIdList.length ; count++) {
loginIdList[count] = loginIdList[count].replaceAll(globalUserInfo.shopName + '_','');
}
CHAT_UI.showLoadingIndicator();
$('#collaboration_overlay_user_list').html('');
......
......@@ -233,11 +233,15 @@ function setSocketAction () {
var replacePath = message.text;
replacePath = replacePath.replaceAll('?fileName=', '?sid=' + CHAT.globalLoginParameter.sid + '&fileName=');
message.text = replacePath;
//TODO newMessageの際にDB格納が必要。
var messageSender;
if (CHAT_UTIL.isIOS()) {
messageSender = JSON.parse(CHAT_DB.getUserInfoList(message.userId));
} else if (CHAT_UTIL.isAndroid()) {
messageSender = JSON.parse(android.getUserInfoList(message.userId));
}
let html = Mustache.render(template, {
text: message.text,
from: message.from,
from: messageSender[0].shopMemberName,
profileImage: message.profileImagePath,
shopMemberId: message.userId,
createdAtDay: messageTime.createdAtDay,
......
......@@ -251,7 +251,7 @@ getLoginParameter = function(sid, loginId, shopName, roomId = undefined, roomNam
// fermi coview share
globalUserInfo.sid = sid;
globalUserInfo.loginId = loginId;
globalUserInfo.loginId = shopName + '_' + loginId;
globalUserInfo.shopName = shopName;
globalUserInfo.roomId = roomId;
globalUserInfo.roomName = roomName;
......
......@@ -4,10 +4,84 @@ function recordStart() {
$('#recordBtn').addClass('bg_red');
}
function recordStop() {
MainManRecord('stop', CMS_SERVER_URL + '/chatapi/file/uploadArchive');
function recordStop(callback) {
// アーカイブ保存中は画面操作不可(協業終了,協業切り替え防止)
screenLock();
// アーカイブ保存処理
MainManRecordWithCollaboration('stop', CMS_SERVER_URL + '/chatapi/file/uploadArchive', callback);
}
function MainManRecordWithCollaboration(action, url, callback) {
mediaRecorder.stop();
console.log('Recorded Blobs: ', recordedBlobs);
setTimeout(function() {
console.log("Recoding File upload..");
const blob = new Blob(recordedBlobs, {type: 'video/webm'});
console.log(blob)
var uploadFileName = "record_" + g_webroom + "_" + g_shareCount + ".webm";
g_shareCount++;
var formData = new FormData();
formData.append("fileData",blob,uploadFileName);
formData.append('sid', globalUserInfo.sid);
formData.append('roomId', globalUserInfo.roomId);
if (joinCollaborationType == COLLABORATION_TYPE.VIDEO) {
formData.append('archiveType', 1);
} else {
formData.append('archiveType', 2);
}
console.log(uploadFileName)
$.ajax({
type :'post',
url,
data : formData,
contentType: false,
processData: false,
success : function(res) {
recordFinished();
callback();
console.log(res)
}
,error : function(err){
recordFinished();
callback();
console.log(err);
}
});
}, 1000);
}
function screenLock(){
// ロック用のdivを生成
var element = document.createElement('div');
element.id = "screenLock";
// ロック用のスタイル
element.style.height = '100%';
element.style.left = '0px';
element.style.position = 'fixed';
element.style.top = '0px';
element.style.width = '100%';
element.style.zIndex = '9999';
element.style.opacity = '0';
var objBody = document.getElementsByTagName("body").item(0);
objBody.appendChild(element);
}
// div削除関数
function delete_dom_obj(id_name) {
var dom_obj = document.getElementById(id_name);
var dom_obj_parent = dom_obj.parentNode;
dom_obj_parent.removeChild(dom_obj);
}
function recordFinished() {
$('#recordBtn').addClass('bg_gray');
$('#recordBtn').removeClass('bg_red');
// ロック画面の削除
delete_dom_obj('screenLock');
}
$(function () {
......@@ -118,11 +192,9 @@ $(function () {
$('#micBtn').click(function () {
$('#coviewMicCtrBtn').click();
if ($('#micBtn').hasClass('bg_red')) {
$('#micBtn').removeClass('bg_red');
$('#micBtn').addClass('bg_blue');
micOn();
} else {
$('#micBtn').removeClass('bg_blue');
$('#micBtn').addClass('bg_red');
micOff();
}
})
......@@ -138,7 +210,7 @@ $(function () {
if ($('#recordBtn').hasClass('bg_gray')) {
recordStart();
} else {
recordStop();
recordStop(null);
}
})
});
......@@ -150,3 +222,15 @@ function penOff() {
$('#penBtn').removeClass('bg_blue');
}
};
function micOn() {
coview_api.MicMuteControl('off');
$('#micBtn').addClass('bg_blue');
$('#micBtn').removeClass('bg_red');
};
function micOff() {
coview_api.MicMuteControl('on');
$('#micBtn').removeClass('bg_blue');
$('#micBtn').addClass('bg_red');
};
......@@ -62,5 +62,10 @@ const ANDROID_SDK_VERSION = {
O : 26
}
const HOST_REQUEST_FLG = {
DONE : 0,
DOING : 1
}
const messageSeperator = "<::split>";
const dataMessageScheme = "::NOT_MESSAGE";
......@@ -94,11 +94,14 @@ $.lang.en = {
"notify_not_released" : "It will be released later.",
"error_empty_room_name" : "Please input room name.",
"inform_exit_host_collaboration" : "The host has terminated the collaboration.",
"request_capture" : " request Screen capture.(if you confirm this request, capture the screen and change the host)",
"request_capture" : " request Screen capture.",
"host_change_notify" : "host changed to %@",
"not_support_version" : "did not support this device version.",
"err_target_android_version_not_support" : "did not support document collaboration on this user's device version.",
"err_not_exist_room" : "this room is not exist.",
"norify_request_host_change" : "%@ request host permission \ndo you want to approve?",
"already_exist_collaboration" : "already exist collaboration. do you want finish already exist collaboration and start new one?"
"already_exist_collaboration" : "already exist collaboration. do you want finish already exist collaboration and start new one?",
"error_send_video": "Fail to send.",
"already_processing_host_request" : "already processing host request",
"err_weak_network_exit_collaboration" : "network is weak. end Collaboration"
}
......@@ -94,11 +94,14 @@ $.lang.ja = {
"notify_not_released" : "今後リリース予定です。",
"error_empty_room_name" : "ルーム名を入力してください。",
"inform_exit_host_collaboration" : "ホストが協業を終了しました。",
"request_capture" : "様がキャプチャーをリクエストしました。(確認時画面をキャプチャーし、ホストを変更します。)",
"request_capture" : "様がキャプチャーをリクエストしました。",
"host_change_notify" : "ホストが%@様に変更されました。",
"not_support_version" : "現在の端末バージョンでは利用できません。",
"err_target_android_version_not_support" : "対象ユーザの端末バージョンでは文書協業が利用できません。",
"err_not_exist_room" : "該当のルームが存在しません。",
"norify_request_host_change" : "%@様からホスト変更リクエストがあります。\n承認しますか?",
"already_exist_collaboration" : "現在進行中の協業があります。進行中の協業を終了し、新たな協業を開始しますか?"
"already_exist_collaboration" : "現在進行中の協業があります。進行中の協業を終了し、新たな協業を開始しますか?",
"error_send_video": "送信に失敗しました。",
"already_processing_host_request" : "既にホストリクエストが進行中です。",
"err_weak_network_exit_collaboration" : "ネットワーク信号が弱いです。協業を終了します。"
}
\ No newline at end of file
......@@ -94,11 +94,14 @@ $.lang.ko = {
"notify_not_released" : "추후 공개예정입니다.",
"error_empty_room_name" : "룸명을 입력해주세요.",
"inform_exit_host_collaboration" : "호스트가 협업을 종료하였습니다.",
"request_capture" : "님이 화면캡처를 요청하셨습니다.(확인시 화면을캡처하고 호스트를 변경합니다.)",
"request_capture" : "님이 화면캡처를 요청하셨습니다.",
"host_change_notify" : "호스트가 %@님으로 변경되었습니다.",
"not_support_version" : "현재단말버전에서는 지원되지않는기능입니다.",
"err_target_android_version_not_support" : "해당 유저의 단말버전에서는 문서협업이 이용불가능합니다.",
"err_not_exist_room" : "해당 룸이 존재하지않습니다.",
"norify_request_host_change" : "%@님이 호스트변경을 요청하셨습니다.\n승인하시겠습니까?",
"already_exist_collaboration" : "현재 진행중인 협업이 있습니다. 진행중인 협업을 강제종료하고 새로 개시하시겠습니까?"
"already_exist_collaboration" : "현재 진행중인 협업이 있습니다. 진행중인 협업을 강제종료하고 새로 개시하시겠습니까?",
"error_send_video": "전송에 실패했습니다.",
"already_processing_host_request" : "이미 호스트요청이 진행중입니다.",
"err_weak_network_exit_collaboration" : "네트워크신호가 약합니다. 협업을 정리하겠습니다."
}
......@@ -165,7 +165,7 @@ $(function () {
captureAndShareImage(CMS_SERVER_URL + '/chatapi/file/uploadArchive', data.payload.name);
}
} else if (data.type === "HOST_CHANGE_REQUEST") {
if (data.payload.loginId == CHAT.globalLoginParameter.loginId) {
if (data.payload.loginId == globalUserInfo.loginId) {
fw.sendToMsg('others', 'HOST_CHANGE_RESPONSE', {"isAndroid": CHAT_UTIL.isAndroid(), "isAble" : androidVersion >= ANDROID_SDK_VERSION.O, "loginId": CHAT.globalLoginParameter.loginId});
}
} else if (data.type === "HOST_CHANGE_RESPONSE") {
......@@ -173,17 +173,35 @@ $(function () {
var isAble = data.payload.isAble
if (g_isMainMan && isAndroid && !isAble && joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
alert(getLocalizedString('err_target_android_version_not_support'));
} else {
Coview_changeHost(data.payload.loginId);
} else if (g_isMainMan){
Coview_changeHost(getFermiLoginId(data.payload.loginId));
}
} else if (data.type === "API_SEND_OWNER_CHANGE_COMPLETE") {
if ($('#recordBtn').hasClass('bg_red')) {
recordStop();
recordStop(penOff);
} else {
penOff();
}
penOff();
} else if (data.type === "CHANGE_HOST_APPLY") {
if(confirm(getLocalizedString('norify_request_host_change',data.payload.hostId))) {
Coview_changeHost(data.payload.hostId);
if (CHAT_UTIL.isAndroid()) {
android.setHostRequestFlg(HOST_REQUEST_FLG.DOING);
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(HOST_REQUEST_FLG.DOING);
}
if(g_isMainMan && confirm(getLocalizedString('norify_request_host_change', data.payload.hostId))) {
Coview_changeHost(getFermiLoginId(data.payload.hostId));
if (CHAT_UTIL.isAndroid()) {
android.setHostRequestFlg(HOST_REQUEST_FLG.DONE);
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(HOST_REQUEST_FLG.DONE);
}
fw.sendToMsg('others', 'HOST_REQUEST_DONE', {"hostId": data.payload.hostId});
}
} else if (data.type === "HOST_REQUEST_DONE") {
if (CHAT_UTIL.isAndroid()) {
android.setHostRequestFlg(HOST_REQUEST_FLG.DONE);
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(HOST_REQUEST_FLG.DONE);
}
}
});
......@@ -206,6 +224,9 @@ $(function () {
coview_api.addEventListener("hostbye", function () {
console.log("=============> HOST BYE : share hostbye");
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && CHAT_UTIL.isAndroid()) {
android.exitMeetingRoom();
}
alert(getLocalizedString("inform_exit_host_collaboration"));
Coview_exitCollaboration();
$("#loadingIndicator").removeClass("full_active");
......@@ -213,7 +234,11 @@ $(function () {
coview_api.addEventListener("destroy", function () {
console.log("=============> DESTROY : share destroy");
coview_api.LeaveRoom();
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && CHAT_UTIL.isAndroid()) {
android.exitMeetingRoom();
}
alert(getLocalizedString("inform_exit_host_collaboration"));
Coview_exitCollaboration();
$(".coview_share_area").hide();
$("#loadingIndicator").removeClass("full_active");
});
......@@ -233,7 +258,7 @@ $(function () {
}
if (globalUserInfo.coWorkType == collaborationTypeKey.BOARD) {
isBoard = true;
globalUserInfo.coWorkType = collaborationTypeKey.CAMERA;
globalUserInfo.coWorkType = collaborationTypeKey.AUDIO;
}
hostSearchInterval();
if (collaborationJoinFlg == "1") {
......@@ -297,11 +322,6 @@ $(function () {
},
0
);
if (isBoard) {
$('#open_file_upload').on("click",function(e){
e.preventDefault();
});
}
} else {
}
break;
......@@ -346,6 +366,7 @@ $(function () {
console.log("consoleLog", json);
break;
case "fileChange":
if (joinCollaborationType != COLLABORATION_TYPE.CAMERA) { break; }
LoadMobileShareFile(json.fileName);
backgroundFileName = json.fileName;
console.log("fileChange", json);
......@@ -393,7 +414,7 @@ function changeCollaboration(changeCollaborationType) {
}
joinCollaborationType = changeCollaborationType;
if ($('#recordBtn').hasClass('bg_red')) {
recordStop();
recordStop(null);
}
initCollaborationUI(changeCollaborationType);
switch (changeCollaborationType) {
......@@ -419,6 +440,11 @@ function changeCollaboration(changeCollaborationType) {
coview_api.ChangeCollaboration('audio');
break;
}
if ($('#micBtn').hasClass('bg_red')) {
micOff();
} else {
micOn();
}
penOff();
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.changeCollaboration.postMessage({"changeCollaborationType": changeCollaborationType, "meetingId": newMeetingId});
......@@ -429,6 +455,7 @@ function changeCollaboration(changeCollaborationType) {
}
function initCollaborationUI(changeCollaborationType){
$('#coviewEraserCtrBtn').click();
if ($('.user_btn').hasClass("hide")) {
$('.user_btn').click();
}
......@@ -503,8 +530,13 @@ function Coview_exitCollaboration(isDocument = false) {
}
}
if ($('#recordBtn').hasClass('bg_red')) {
recordStop();
recordStop(Coview_finishCollaboration);
} else {
Coview_finishCollaboration();
}
}
function Coview_finishCollaboration() {
clearInterval(timeInterval);
coview_api.LeaveRoom();
if (coview_api.getRoomUsers()) {
......@@ -560,6 +592,21 @@ function applyForHostChange() {
alert(getLocalizedString('not_support_version'));
return;
}
var hostRequestFlg = 0;
if (CHAT_UTIL.isAndroid()) {
hostRequestFlg = android.getHostRequestFlg();
} else {
hostRequestFlg = CHAT_DB.getHostRequestFlg();
}
if (hostRequestFlg == HOST_REQUEST_FLG.DOING) {
alert(getLocalizedString('already_processing_host_request'));
return;
}
if (CHAT_UTIL.isAndroid()) {
android.setHostRequestFlg(HOST_REQUEST_FLG.DOING);
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(HOST_REQUEST_FLG.DOING);
}
fw.sendToMsg('others', 'CHANGE_HOST_APPLY', {"hostId": CHAT.globalLoginParameter.loginId});
};
......@@ -598,9 +645,9 @@ function hostSearchInterval() {
}
if (hostName != g_isMainManUsername) {
if (hostName != "") {
$("#collaboration_user_" + hostName).removeClass("host");
$("#collaboration_user_" + getReplacedLoginId(hostName)).removeClass("host");
}
$("#collaboration_user_" + g_isMainManUsername).addClass("host");
$("#collaboration_user_" + getReplacedLoginId(g_isMainManUsername)).addClass("host");
hostName = g_isMainManUsername;
} else {
if (hostName == "") {
......@@ -608,8 +655,8 @@ function hostSearchInterval() {
$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).addClass("host");
}
} else {
if (!$("#collaboration_user_" + hostName).hasClass('host')) {
$("#collaboration_user_" + hostName).addClass("host");
if (!$("#collaboration_user_" + getReplacedLoginId(hostName)).hasClass('host')) {
$("#collaboration_user_" + getReplacedLoginId(hostName)).addClass("host");
}
}
......@@ -619,7 +666,15 @@ function hostSearchInterval() {
}
function hostChangeRequest(loginId) {
fw.sendToMsg('others', 'HOST_CHANGE_REQUEST', {"loginId": loginId});
fw.sendToMsg('others', 'HOST_CHANGE_REQUEST', {"loginId": getFermiLoginId(loginId)});
}
function getFermiLoginId(loginId) {
return globalUserInfo.shopName + '_' + loginId;
}
function getReplacedLoginId(loginId) {
return loginId.replaceAll(globalUserInfo.shopName + '_', '');
}
function captureAndShareImage(urls, changeHostName) {
......
......@@ -34,7 +34,7 @@
</ul>
</div>
</div>
<div class="modal-footer border-0 justify-content-center" style="bottom: 35px;position: fixed;width: 85.5%;background-color: white;">
<div class="modal-footer border-0 justify-content-center" style="position: relative;width: 100%;background-color: white;">
<button type="button" id="cancelAddUserBtn" class="profile_favorite_btn bg_white border_gray text_blue cancel_add_user_btn">
<div class="d-flex flex-column">
<span>キャンセル</span>
......
......@@ -81,7 +81,7 @@
</div>
<!-- ルーム解説ボタン -->
<div class="add_user_confirm_btn content" id="addUserConfirmBtnInCollaboration" style="position: fixed;">
<button type="button" name="button" id="buttonAddUser" style="top: 455px; width: 75%;">
<button type="button" name="button" id="buttonAddUser" style="top: 455px; width: 75.3%;">
確認<br>
<span class="select_member_num"></span><span class="select_member">名 選択中</span></button>
</div>
......
......@@ -10,10 +10,10 @@
</div>
<div class="modal-body">
<ul>
<li><a href="chat_change_room_name.html"><img src="icon/icon_change_room_name.png" alt="ルーム名変更">ルーム名変更</a>
<li><a id="room_name_change_button" href="chat_change_room_name.html"><img src="icon/icon_change_room_name.png" alt="ルーム名変更">ルーム名変更</a>
</li>
<li><a href="chat_add_user.html"><img src="icon/icon_add_user.png" alt="ユーザー招待">ユーザー招待</a></li>
<li ><a href="javascript:return false;" onclick="CHAT_UI.roomDisplayOff();"><img src="icon/icon_display_off_chatroom.png" alt="ユーザー招待">部屋非表示</a></li>
<li><a id="add_user_button" href="chat_add_user.html"><img src="icon/icon_add_user.png" alt="ユーザー招待">ユーザー招待</a></li>
<li ><a id="display_off_button" href="javascript:return false;" onclick="CHAT_UI.roomDisplayOff();"><img src="icon/icon_display_off_chatroom.png" alt="ユーザー招待">部屋非表示</a></li>
</ul>
</div>
</div>
......
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