Commit 2e76ee6a by Kim Peace

Fixed collaboration bug

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