Commit 2e76ee6a by Kim Peace

Fixed collaboration bug

parent 52e466d4
...@@ -182,8 +182,6 @@ ...@@ -182,8 +182,6 @@
} }
} }
updateCollaborationUI(globalUserInfo.collaborationType);
if (globalUserInfo.joinType != COLLABORATION_JOIN_TYPE.INVITED) { if (globalUserInfo.joinType != COLLABORATION_JOIN_TYPE.INVITED) {
CHAT_SOCKET.initialJoin(); CHAT_SOCKET.initialJoin();
} }
......
...@@ -186,3 +186,5 @@ const NATIVE_KEY_IOS = { ...@@ -186,3 +186,5 @@ const NATIVE_KEY_IOS = {
getMessageListFromMessageId: "getMessageListFromMessageId", getMessageListFromMessageId: "getMessageListFromMessageId",
updatePreMessage: "updatePreMessage", updatePreMessage: "updatePreMessage",
}; };
const BIZ_TASK_YELL_URL = "https://biztaskyell.abookcloud.com";
\ No newline at end of file
...@@ -94,14 +94,14 @@ NativeBridgeDelegate.updateGroupInfo = function (groupID) { ...@@ -94,14 +94,14 @@ NativeBridgeDelegate.updateGroupInfo = function (groupID) {
NativeBridgeDelegate.joinCollaboration = function ( NativeBridgeDelegate.joinCollaboration = function (
collaborationType, collaborationType,
meetingId = 0 meetingID = 0
) { ) {
const collaborationTypeNumber = const collaborationTypeNumber =
CHAT_UTIL.getCollaborationTypeNumber(collaborationType); CHAT_UTIL.getCollaborationTypeNumber(collaborationType);
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
webkit.messageHandlers.joinCollaboration.postMessage({ webkit.messageHandlers.joinCollaboration.postMessage({
collaborationType: collaborationTypeNumber, collaborationType: collaborationTypeNumber,
meetingId: meetingId, meetingId: meetingID,
}); });
} else if (deviceInfo.isAndroid()) { } else if (deviceInfo.isAndroid()) {
if ( if (
...@@ -111,7 +111,7 @@ NativeBridgeDelegate.joinCollaboration = function ( ...@@ -111,7 +111,7 @@ NativeBridgeDelegate.joinCollaboration = function (
alert(getLocalizedString("not_support_version")); alert(getLocalizedString("not_support_version"));
return; return;
} }
android.joinCollaboration(collaborationTypeNumber, meetingId); android.joinCollaboration(collaborationTypeNumber, meetingID);
} }
}; };
......
...@@ -5,7 +5,6 @@ var bindOnNewMessage = function () { ...@@ -5,7 +5,6 @@ var bindOnNewMessage = function () {
const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE); const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
const unwrappedMessageInfo = decodeMessage(message.text); const unwrappedMessageInfo = decodeMessage(message.text);
if ( if (
unwrappedMessageInfo == unwrappedMessageInfo ==
DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL
......
...@@ -110,14 +110,21 @@ function updateDuration() { ...@@ -110,14 +110,21 @@ function updateDuration() {
CHAT_UTIL.getCollaborationType = function (collaborationNumber) { CHAT_UTIL.getCollaborationType = function (collaborationNumber) {
switch (collaborationNumber) { switch (collaborationNumber) {
case COLLABORATION_TYPE_NUMBER.AUDIO: case COLLABORATION_TYPE_NUMBER.AUDIO: // fall through
case COLLABORATION_TYPE_NUMBER.AUDIO.toString():
return COLLABORATION_TYPE.AUDIO; return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE_NUMBER.CAMERA: case COLLABORATION_TYPE_NUMBER.CAMERA:
case COLLABORATION_TYPE_NUMBER.CAMERA.toString(): // fall through
return COLLABORATION_TYPE.CAMERA; return COLLABORATION_TYPE.CAMERA;
case COLLABORATION_TYPE_NUMBER.VIDEO: case COLLABORATION_TYPE_NUMBER.VIDEO:
case COLLABORATION_TYPE_NUMBER.VIDEO.toString(): // fall through
return COLLABORATION_TYPE.VIDEO; return COLLABORATION_TYPE.VIDEO;
case COLLABORATION_TYPE_NUMBER.DOCUMENT: case COLLABORATION_TYPE_NUMBER.DOCUMENT:
case COLLABORATION_TYPE_NUMBER.DOCUMENT.toString(): // fall through
return COLLABORATION_TYPE.DOCUMENT; return COLLABORATION_TYPE.DOCUMENT;
case COLLABORATION_TYPE_NUMBER.BOARD:
case COLLABORATION_TYPE_NUMBER.BOARD.toString(): // fall through
return COLLABORATION_TYPE.BOARD;
default: default:
return 0; return 0;
} }
......
CollaborationUI.bindAddUserButton = function () { CollaborationUI.initialBindAddUserButton = function () {
// ユーザー招待メンバー検索 // ユーザー招待メンバー検索
$(".add_user_btn").click(function () { $(".add_user_btn").click(function () {
CollaborationUI.enableScroll(); CollaborationUI.enableScroll();
......
...@@ -19,9 +19,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -19,9 +19,7 @@ document.addEventListener("DOMContentLoaded", function () {
// ユーザー追加イベント // ユーザー追加イベント
CollaborationUI.bindInviteButton(); CollaborationUI.bindInviteButton();
CollaborationUI.bindAddUserButton(); CollaborationUI.initialBindAddUserButton();
CollaborationUI.displayAddUserButtonIfNeeded();
}); });
/********************************* /*********************************
...@@ -123,7 +121,7 @@ CollaborationUI.makeNameCard = function (shopMemberID) { ...@@ -123,7 +121,7 @@ CollaborationUI.makeNameCard = function (shopMemberID) {
"host" "host"
); );
let namecardHtml = Mustache.render(namecardTemplate, { let namecardHTML = Mustache.render(namecardTemplate, {
shopMemberId: nameCardInfo.shopMemberId, shopMemberId: nameCardInfo.shopMemberId,
profileUrl: nameCardInfo.profileUrl, profileUrl: nameCardInfo.profileUrl,
loginId: nameCardInfo.loginId, loginId: nameCardInfo.loginId,
...@@ -134,7 +132,7 @@ CollaborationUI.makeNameCard = function (shopMemberID) { ...@@ -134,7 +132,7 @@ CollaborationUI.makeNameCard = function (shopMemberID) {
whosHost: whosHost, whosHost: whosHost,
}); });
let namecardObj = $(jQuery.parseHTML(namecardHtml)).on( let namecardObj = $(jQuery.parseHTML(namecardHTML)).on(
"click", "click",
function () {} function () {}
); );
......
...@@ -84,5 +84,4 @@ FermiWebSocketBridge.changeHostApply = function () { ...@@ -84,5 +84,4 @@ FermiWebSocketBridge.changeHostApply = function () {
fw.sendToMsg("others", "CHANGE_HOST_APPLY", { fw.sendToMsg("others", "CHANGE_HOST_APPLY", {
hostId: currentUserInfo.loginID, hostId: currentUserInfo.loginID,
}); });
} };
...@@ -31,6 +31,9 @@ FermiWebSocketMessageHandler.handleMessagesToHost = function (data) { ...@@ -31,6 +31,9 @@ FermiWebSocketMessageHandler.handleMessagesToHost = function (data) {
FermiWebSocketMessageHandler.shareFileHost(); FermiWebSocketMessageHandler.shareFileHost();
} }
break; break;
case "CHANGE_HOST_APPLY":
FermiWebSocketMessageHandler.changeHostApplyForHost(data);
break;
default: default:
break; break;
} }
...@@ -55,7 +58,7 @@ FermiWebSocketMessageHandler.handleMessagesToSelf = function (data) { ...@@ -55,7 +58,7 @@ FermiWebSocketMessageHandler.handleMessagesToSelf = function (data) {
} }
}; };
FermiWebSocketMessageHandler.handleMessagesToAll = function () { FermiWebSocketMessageHandler.handleMessagesToAll = function (data) {
switch (data.type) { switch (data.type) {
case "CHANGE_COLLABORATION": case "CHANGE_COLLABORATION":
FermiWebSocketMessageHandler.changeCollaboration(data); FermiWebSocketMessageHandler.changeCollaboration(data);
...@@ -74,7 +77,7 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function () { ...@@ -74,7 +77,7 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function () {
} }
break; break;
case "CHANGE_HOST_APPLY": case "CHANGE_HOST_APPLY":
FermiWebSocketMessageHandler.changeHostApply(data); FermiWebSocketMessageHandler.changeHostApplyForNotHost(data);
break; break;
case "HOST_REQUEST_DONE": case "HOST_REQUEST_DONE":
FermiWebSocketMessageHandler.hostRequestDone(); FermiWebSocketMessageHandler.hostRequestDone();
...@@ -110,8 +113,10 @@ FermiWebSocketMessageHandler.changeCollaboration = function (data) { ...@@ -110,8 +113,10 @@ FermiWebSocketMessageHandler.changeCollaboration = function (data) {
FermiWebSocketMessageHandler.updateJoinChangeCollaboration( FermiWebSocketMessageHandler.updateJoinChangeCollaboration(
data.payload.collaborationType data.payload.collaborationType
); );
globalUserInfo.meetingID = newMeetingID; globalUserInfo.meetingID = newMeetingID;
updateCollaborationUI(globalUserInfo.collaborationType);
CollaborationUI.updateScreen(globalUserInfo.collaborationType);
NativeBridgeDelegate.joinChangedCollaboration( NativeBridgeDelegate.joinChangedCollaboration(
globalUserInfo.collaborationType, globalUserInfo.collaborationType,
...@@ -125,14 +130,14 @@ FermiWebSocketMessageHandler.changeCollaboration = function (data) { ...@@ -125,14 +130,14 @@ FermiWebSocketMessageHandler.changeCollaboration = function (data) {
// SHARE_FILE // SHARE_FILE
FermiWebSocketMessageHandler.shareFile = function () { FermiWebSocketMessageHandler.shareFile = function () {
updateCollaborationUI(COLLABORATION_TYPE.CAMERA); CollaborationUI.updateScreen(COLLABORATION_TYPE.CAMERA);
globalUserInfo.collaborationType = COLLABORATION_TYPE.CAMERA; globalUserInfo.collaborationType = COLLABORATION_TYPE.CAMERA;
FermiWebSocketBridge.shareFileHost(COLLABORATION_TYPE.CAMERA); FermiWebSocketBridge.shareFileHost(COLLABORATION_TYPE.CAMERA);
}; };
// SHARE_FILE_HOST // SHARE_FILE_HOST
FermiWebSocketMessageHandler.shareFileHost = function () { FermiWebSocketMessageHandler.shareFileHost = function () {
updateCollaborationUI(COLLABORATION_TYPE.CAMERA); CollaborationUI.updateScreen(COLLABORATION_TYPE.CAMERA);
globalUserInfo.collaborationType = COLLABORATION_TYPE.CAMERA; globalUserInfo.collaborationType = COLLABORATION_TYPE.CAMERA;
}; };
...@@ -213,33 +218,34 @@ FermiWebSocketMessageHandler.apiSendOwnerChangeConfirm = function () { ...@@ -213,33 +218,34 @@ FermiWebSocketMessageHandler.apiSendOwnerChangeConfirm = function () {
}; };
// CHANGE_HOST_APPLY // CHANGE_HOST_APPLY
FermiWebSocketMessageHandler.changeHostApply = function (data) { FermiWebSocketMessageHandler.changeHostApplyForNotHost = function (data) {
if (g_isMainMan) { NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING);
coview_api.HeartBeatUser(globalUserInfo.loginId); waitMillisecond(500);
NativeBridgeDelegate.finishPIPMode(true); };
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none"); // CHANGE_HOST_APPLY
} FermiWebSocketMessageHandler.changeHostApplyForHost = function (data) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
NativeBridgeDelegate.finishPIPMode(true);
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING); NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING);
waitMillisecond(500); waitMillisecond(500);
if ( if (
confirm( confirm(
getLocalizedString("norify_request_host_change", data.payload.hostId) getLocalizedString("norify_request_host_change", data.payload.hostId)
) )
) { ) {
CoviewBridge.changeHost(getFermiLoginId(data.payload.hostId)); CoviewBridge.changeHost(getFermiLoginId(data.payload.hostId));
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE); NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
} else {
FermiWebSocketBridge.hostRequestReject(data.payload.hostId);
}
FermiWebSocketBridge.hostRequestDone(data.payload.hostId);
} else { } else {
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING); FermiWebSocketBridge.hostRequestReject(data.payload.hostId);
waitMillisecond(500);
} }
FermiWebSocketBridge.hostRequestDone(data.payload.hostId);
}; };
// HOST_REQUEST_DONE // HOST_REQUEST_DONE
...@@ -266,7 +272,7 @@ FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) { ...@@ -266,7 +272,7 @@ FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) {
data.payload.collaborationType data.payload.collaborationType
); );
globalUserInfo.meetingID = data.payload.newMeetingId; globalUserInfo.meetingID = data.payload.newMeetingId;
updateCollaborationUI(globalUserInfo.collaborationType); CollaborationUI.updateScreen(globalUserInfo.collaborationType);
NativeBridgeDelegate.joinChangedCollaboration( NativeBridgeDelegate.joinChangedCollaboration(
globalUserInfo.collaborationType, globalUserInfo.collaborationType,
......
...@@ -3,10 +3,18 @@ var CollaborationFeature = {}; ...@@ -3,10 +3,18 @@ var CollaborationFeature = {};
CoviewBridge.bindReadyEvent = function () { CoviewBridge.bindReadyEvent = function () {
coview_api.addEventListener("ready", function () { coview_api.addEventListener("ready", function () {
CoviewBridge.bindFermiWebSocketOpenned();
// add login ID if not exist
CoviewBridge.addLoginID(globalUserInfo.loginId); CoviewBridge.addLoginID(globalUserInfo.loginId);
coview_api.Login(globalUserInfo.loginId); coview_api.Login(globalUserInfo.loginId);
updateCollaborationUI(globalUserInfo.collaborationType); CollaborationUI.updateScreen(globalUserInfo.collaborationType);
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE); NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
});
};
CoviewBridge.bindFermiWebSocketOpenned = function () {
wc_api.addEventListener("open", async function (event) {
FermiWebSocketMessageHandler.bindWebSocketMessage(); FermiWebSocketMessageHandler.bindWebSocketMessage();
}); });
}; };
...@@ -217,7 +225,7 @@ CoviewBridge.changeHost = function (userID) { ...@@ -217,7 +225,7 @@ CoviewBridge.changeHost = function (userID) {
}; };
CoviewBridge.addLoginID = function (loginID) { CoviewBridge.addLoginID = function (loginID) {
const url = "https://biztaskyell.abookcloud.com/auth/getuser"; const url = BIZ_TASK_YELL_URL + "/auth/getuser";
$.ajax({ $.ajax({
url: url, url: url,
method: "post", method: "post",
......
...@@ -8,7 +8,7 @@ var backgroundFileName; ...@@ -8,7 +8,7 @@ var backgroundFileName;
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
coview_api.Init({ coview_api.Init({
coview_api_srv_addr: "https://biztaskyell.abookcloud.com", coview_api_srv_addr: BIZ_TASK_YELL_URL,
coview_wrap_id: "coviewShare", coview_wrap_id: "coviewShare",
coview_api_key: "8dda7092c5820d663", coview_api_key: "8dda7092c5820d663",
}); });
...@@ -29,14 +29,15 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -29,14 +29,15 @@ document.addEventListener("DOMContentLoaded", function () {
// call from collaboration_overlay_menu.html and collaboration.html // call from collaboration_overlay_menu.html and collaboration.html
function changeCollaboration(collaborationType) { function changeCollaboration(collaborationType) {
recordStop(function () { recordStop(function () {
var newMeetingId = 0; var newMeetingID = 0;
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT) { if (globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.exitMeetingRoom(); NativeBridgeDelegate.exitMeetingRoom();
} }
NativeBridgeDelegate.setJoinCollaborationType(collaborationType); NativeBridgeDelegate.setJoinCollaborationType(collaborationType);
globalUserInfo.collaborationType = collaborationType; globalUserInfo.collaborationType = collaborationType;
updateCollaborationUI(collaborationType); CollaborationUI.updateScreen(collaborationType);
switch (collaborationType) { switch (collaborationType) {
case COLLABORATION_TYPE.AUDIO: case COLLABORATION_TYPE.AUDIO:
coview_api.ChangeCollaboration("audio"); coview_api.ChangeCollaboration("audio");
...@@ -50,7 +51,7 @@ function changeCollaboration(collaborationType) { ...@@ -50,7 +51,7 @@ function changeCollaboration(collaborationType) {
break; break;
case COLLABORATION_TYPE.DOCUMENT: case COLLABORATION_TYPE.DOCUMENT:
coview_api.ChangeCollaboration("audio"); coview_api.ChangeCollaboration("audio");
newMeetingId = NativeBridgeDataSource.createContentView(); newMeetingID = NativeBridgeDataSource.createContentView();
break; break;
case COLLABORATION_TYPE.BOARD: case COLLABORATION_TYPE.BOARD:
coview_api.ChangeCollaboration("audio"); coview_api.ChangeCollaboration("audio");
...@@ -63,15 +64,14 @@ function changeCollaboration(collaborationType) { ...@@ -63,15 +64,14 @@ function changeCollaboration(collaborationType) {
micOn(); micOn();
} }
NativeBridgeDelegate.changeCollaboration(collaborationType, newMeetingId); globalUserInfo.meetingID = newMeetingID;
globalUserInfo.meetingID = newMeetingId;
FermiWebSocketBridge.changeCollaboration(); NativeBridgeDelegate.changeCollaboration(collaborationType, newMeetingID);
FermiWebSocketBridge.changeCollaboration(collaborationType, newMeetingID);
}); });
} }
async function updateCollaborationUI(collaborationType) { CollaborationUI.updateScreen = async function (collaborationType) {
$("#coviewEraserCtrBtn").click(); $("#coviewEraserCtrBtn").click();
if ($(".user_btn").hasClass("hide")) { if ($(".user_btn").hasClass("hide")) {
$(".user_btn").click(); $(".user_btn").click();
...@@ -84,25 +84,22 @@ async function updateCollaborationUI(collaborationType) { ...@@ -84,25 +84,22 @@ async function updateCollaborationUI(collaborationType) {
$("link[href='./css/collaboration_board.css']").remove(); $("link[href='./css/collaboration_board.css']").remove();
$(".collaboration_contents").addClass("none");
switch (collaborationType) { switch (collaborationType) {
case COLLABORATION_TYPE.AUDIO: case COLLABORATION_TYPE.AUDIO:
$(".collaboration_contents").addClass("none");
$(".voice_contents").removeClass("none"); $(".voice_contents").removeClass("none");
break; break;
case COLLABORATION_TYPE.CAMERA: case COLLABORATION_TYPE.CAMERA:
$(".collaboration_contents").addClass("none");
$(".picture_contents").removeClass("none"); $(".picture_contents").removeClass("none");
break; break;
case COLLABORATION_TYPE.VIDEO: case COLLABORATION_TYPE.VIDEO:
$(".collaboration_contents").addClass("none");
$(".video_contents").removeClass("none"); $(".video_contents").removeClass("none");
break; break;
case COLLABORATION_TYPE.DOCUMENT: case COLLABORATION_TYPE.DOCUMENT:
$(".collaboration_contents").addClass("none");
$(".document_contents").removeClass("none"); $(".document_contents").removeClass("none");
break; break;
case COLLABORATION_TYPE.BOARD: case COLLABORATION_TYPE.BOARD:
$(".collaboration_contents").addClass("none");
$(".board_contents").removeClass("none"); $(".board_contents").removeClass("none");
$("head").append( $("head").append(
'<link rel="stylesheet" href="./css/collaboration_board.css">' '<link rel="stylesheet" href="./css/collaboration_board.css">'
...@@ -111,7 +108,7 @@ async function updateCollaborationUI(collaborationType) { ...@@ -111,7 +108,7 @@ async function updateCollaborationUI(collaborationType) {
} }
await waitMillisecond(1000); await waitMillisecond(1000);
$(".before_loading_indicator").addClass("none"); $(".before_loading_indicator").addClass("none");
} };
// call from modal_collabo_host_request.html // call from modal_collabo_host_request.html
function applyForHostChange() { function applyForHostChange() {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
</div> </div>
<div class="collabo_btn"> <div class="collabo_btn">
<button class="collaboation_join_button" type="button" name="button" onclick="NativeBridgeDelegate.joinCollaboration({{collaborationType}}, {{meetingId}})" {{#isEnded}} disabled {{/isEnded}}> <button class="collaboation_join_button" type="button" name="button" onclick="NativeBridgeDelegate.joinCollaboration('{{collaborationType}}', {{meetingId}})" {{#isEnded}} disabled {{/isEnded}}>
<img src="icon/icon_profile_phone.png" alt="通話"> <img src="icon/icon_profile_phone.png" alt="通話">
{{#isEnded}} {{#isEnded}}
<span class="collaboration_join_message">終了しました</span> <span class="collaboration_join_message">終了しました</span>
......
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