Commit bd686d1e 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 features/release_sp3_collaboration_document

# Conflicts:
#	public_new/js/share.js
parents 8bda2e4c 4f062177
...@@ -124,12 +124,10 @@ ...@@ -124,12 +124,10 @@
</a> </a>
</div> </div>
<!--リリース後開発予定--> <!--リリース後開発予定-->
<!--<div class="footer_item"> <div class="footer_item">
<a href="collaboration_whiteboard.html"> <img src="icon/icon_whiteboard_gray.png" alt="ホワイトボードアイコン" onclick="alert(getLocalizedString('notify_not_released'));">
<img src="icon/icon_whiteboad_gray.png" alt="ホワイトボードアイコン">
<p>ボード</p> <p>ボード</p>
</a> </div>
</div>-->
</div> </div>
</div> </div>
</div> </div>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<div class="item"> <div class="item">
<a href="collaboration_whiteboard.html" class="d-flex flex-column align-items-center"> <a href="collaboration_whiteboard.html" class="d-flex flex-column align-items-center">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_collabo_whiteboad.png" alt="落書き"> <img src="icon/icon_collabo_whiteboard.png" alt="落書き">
</div> </div>
<span>落書き</span> <span>落書き</span>
</a> </a>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<div class="item"> <div class="item">
<a href="collaboration_whiteboard.html" class="d-flex flex-column align-items-center"> <a href="collaboration_whiteboard.html" class="d-flex flex-column align-items-center">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_collabo_whiteboad.png" alt="落書き"> <img src="icon/icon_collabo_whiteboard.png" alt="落書き">
</div> </div>
<span>落書き</span> <span>落書き</span>
</a> </a>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<div class="item"> <div class="item">
<a href="collaboration_whiteboard.html" class="d-flex flex-column align-items-center"> <a href="collaboration_whiteboard.html" class="d-flex flex-column align-items-center">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_collabo_whiteboad.png" alt="落書き"> <img src="icon/icon_collabo_whiteboard.png" alt="落書き">
</div> </div>
<span>落書き</span> <span>落書き</span>
</a> </a>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<div class="item"> <div class="item">
<a href="collaboration_whiteboard.html" class="d-flex flex-column align-items-center"> <a href="collaboration_whiteboard.html" class="d-flex flex-column align-items-center">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_collabo_whiteboad.png" alt="落書き"> <img src="icon/icon_collabo_whiteboard.png" alt="落書き">
</div> </div>
<span>落書き</span> <span>落書き</span>
</a> </a>
......
...@@ -193,13 +193,13 @@ function setSocketAction () { ...@@ -193,13 +193,13 @@ function setSocketAction () {
} catch(e) { } catch(e) {
message.text = message.text message.text = message.text
} }
let messageType; let type;
let collaborationType; let collaborationType;
if ( message.text.includes(messageSeperator) ) { if ( message.text.includes(messageSeperator) ) {
let text = message.text.split(messageSeperator); let text = message.text.split(messageSeperator);
message.text = text[0]; message.text = text[0];
messageType = text[1]; type = text[1];
if (messageType == messageType.COMMUNICATIONSTART || messageType == messageType.COMMUNICATIONEND) { if (type == messageType.COMMUNICATIONSTART || type == messageType.COMMUNICATIONEND) {
collaborationType = text[2]; collaborationType = text[2];
var userInCollaboration; var userInCollaboration;
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
......
...@@ -4,25 +4,24 @@ ...@@ -4,25 +4,24 @@
let coview_api = new CoviewApi(); let coview_api = new CoviewApi();
var isDocument = false; var isDocument = false;
let isLeaved = false; let isLeaved = false;
$(function() {
var coviewApiActive = coview_api.Init( $(function () {
{ var coviewApiActive = coview_api.Init({
testSTRParam : "param1", testSTRParam: "param1",
testNUMParam : 77, testNUMParam: 77,
testBOOLParam : false, testBOOLParam: false,
coview_api_srv_addr: "https://livetaskyell.abookcloud.com", coview_api_srv_addr: "https://livetaskyell.abookcloud.com",
coview_wrap_id : "coviewShare", coview_wrap_id: "coviewShare",
coview_api_key: "8dda7092c5820d663" coview_api_key: "8dda7092c5820d663",
} });
);
// special button IN Chat ui // special button IN Chat ui
$("#coviewShareMainBtn").on("click", function(e) { $("#coviewShareMainBtn").on("click", function (e) {
e.stopPropagation(); e.stopPropagation();
if ($(".coview_share_dropdown_bar").is(':visible') == true) { if ($(".coview_share_dropdown_bar").is(":visible") == true) {
Coview_shareDropdownHide(); Coview_shareDropdownHide();
if ($(".coview_share_photo_select_bubble").is(':visible') == true) { if ($(".coview_share_photo_select_bubble").is(":visible") == true) {
$(".coview_share_photo_select_bubble").slideUp(); $(".coview_share_photo_select_bubble").slideUp();
} }
} else { } else {
...@@ -30,24 +29,22 @@ $(function() { ...@@ -30,24 +29,22 @@ $(function() {
} }
}); });
$("#coviewShareCloseButton").on("click", function(e) { $("#coviewShareCloseButton").on("click", function (e) {
coview_api.LeaveRoom(); coview_api.LeaveRoom();
$(".coview_share_area").hide(); $(".coview_share_area").hide();
}); });
$("body").on("click", function(){ $("body").on("click", function () {
Coview_shareDropdownHide(); Coview_shareDropdownHide();
if ($(".coview_share_photo_select_bubble").is(':visible') == true) { if ($(".coview_share_photo_select_bubble").is(":visible") == true) {
$(".coview_share_photo_select_bubble").slideUp(); $(".coview_share_photo_select_bubble").slideUp();
} else { } else {
$(".coview_share_dropdown_bar").slideDown(); $(".coview_share_dropdown_bar").slideDown();
} }
}); });
$(document).on("click", ".coview_share_request", function() { $(document).on("click", ".coview_share_request", function () {
console.log("globalUserInfo", globalUserInfo); console.log("globalUserInfo", globalUserInfo);
if ($(this).hasClass(collaborationTypeKey.VIDEO) == true) { if ($(this).hasClass(collaborationTypeKey.VIDEO) == true) {
globalUserInfo.coWorkType = collaborationTypeKey.VIDEO; globalUserInfo.coWorkType = collaborationTypeKey.VIDEO;
...@@ -64,29 +61,25 @@ $(function() { ...@@ -64,29 +61,25 @@ $(function() {
Coview_moveToVideoShareArea(); Coview_moveToVideoShareArea();
}); });
/* --------------------------------------------------- */ /* --------------------------------------------------- */
/* Video, photo, chat, doc */ /* Video, photo, chat, doc */
/* --------------------------------------------------- */ /* --------------------------------------------------- */
$("#coviewShareChat").on("click", function() { $("#coviewShareChat").on("click", function () {
console.log("ON click coviewShareChat"); console.log("ON click coviewShareChat");
}); });
$("#coviewSharePhoto").on("click", function(e) { $("#coviewSharePhoto").on("click", function (e) {
e.stopPropagation(); e.stopPropagation();
console.log("ON click coviewSharePhoto"); console.log("ON click coviewSharePhoto");
if ($(".coview_share_photo_select_bubble").is(':visible') == true) { if ($(".coview_share_photo_select_bubble").is(":visible") == true) {
$(".coview_share_photo_select_bubble").slideUp(); $(".coview_share_photo_select_bubble").slideUp();
} else { } else {
$(".coview_share_photo_select_bubble").slideDown(); $(".coview_share_photo_select_bubble").slideDown();
} }
}); });
$("#coviewSharePhotoCamera").on("click", function () {
$("#coviewSharePhotoCamera").on("click", function() {
$(".coview_share_photo_select_bubble").hide(); $(".coview_share_photo_select_bubble").hide();
globalUserInfo.coWorkType = collaborationTypeKey.CAMERA; globalUserInfo.coWorkType = collaborationTypeKey.CAMERA;
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType); coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
...@@ -94,7 +87,7 @@ $(function() { ...@@ -94,7 +87,7 @@ $(function() {
$(".coview_share_title_name").text("カメラ"); $(".coview_share_title_name").text("カメラ");
}); });
$("#coviewSharePhotoGallery").on("click", function() { $("#coviewSharePhotoGallery").on("click", function () {
$(".coview_share_photo_select_bubble").hide(); $(".coview_share_photo_select_bubble").hide();
globalUserInfo.coWorkType = "gallery"; globalUserInfo.coWorkType = "gallery";
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType); coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
...@@ -103,12 +96,11 @@ $(function() { ...@@ -103,12 +96,11 @@ $(function() {
$(".coview_share_title_name").text("ライブラリ"); $(".coview_share_title_name").text("ライブラリ");
}); });
$("#coviewShareAudio").on("click", function() { $("#coviewShareAudio").on("click", function () {
Coview_connect_audio_collaboration(); Coview_connect_audio_collaboration();
}) });
$("#coviewShareLive").on("click", function() { $("#coviewShareLive").on("click", function () {
console.log("ON click coviewShareLive"); console.log("ON click coviewShareLive");
globalUserInfo.coWorkType = "video"; globalUserInfo.coWorkType = "video";
console.log("globalUserInfo", globalUserInfo); console.log("globalUserInfo", globalUserInfo);
...@@ -119,72 +111,77 @@ $(function() { ...@@ -119,72 +111,77 @@ $(function() {
$(".coview_share_title_name").text("LIVE"); $(".coview_share_title_name").text("LIVE");
}); });
// $("#coviewShareDoc").on("click", function(){ // $("#coviewShareDoc").on("click", function(){
// console.log("ON click coviewShareDoc"); // console.log("ON click coviewShareDoc");
// alert("INTO a document share mode (only audio)"); // alert("INTO a document share mode (only audio)");
// globalUserInfo.coWorkType = "audio"; // globalUserInfo.coWorkType = "audio";
// }); // });
coview_api.addEventListener ("ready", function () { coview_api.addEventListener("ready", function () {
console.log("=============> READY : ready for coview api"); console.log("=============> READY : ready for coview api");
Coview_addLoginId(globalUserInfo.loginId); Coview_addLoginId(globalUserInfo.loginId);
coview_api.Login(globalUserInfo.loginId); coview_api.Login(globalUserInfo.loginId);
}); });
coview_api.addEventListener ("start", function () { coview_api.addEventListener("start", function () {
console.log("=============> START : share start"); console.log("=============> START : share start");
$("#loadingIndicator").removeClass("full_active"); $("#loadingIndicator").removeClass("full_active");
}); });
coview_api.addEventListener ("allbye", function () { coview_api.addEventListener("allbye", function () {
console.log("=============> ALL BYE : share allbye"); console.log("=============> ALL BYE : share allbye");
$("#loadingIndicator").removeClass("full_active"); $("#loadingIndicator").removeClass("full_active");
}); });
coview_api.addEventListener ("guestbye", function () { coview_api.addEventListener("guestbye", function () {
console.log("=============> GUEST BYE : share guestbye"); console.log("=============> GUEST BYE : share guestbye");
$("#loadingIndicator").removeClass("full_active"); $("#loadingIndicator").removeClass("full_active");
}); });
coview_api.addEventListener ("hostbye", function () { coview_api.addEventListener("hostbye", function () {
console.log("=============> HOST BYE : share hostbye"); console.log("=============> HOST BYE : share hostbye");
alert(getLocalizedString("inform_exit_host_collaboration")); alert(getLocalizedString("inform_exit_host_collaboration"));
Coview_exitCollaboration(); Coview_exitCollaboration();
$("#loadingIndicator").removeClass("full_active"); $("#loadingIndicator").removeClass("full_active");
}); });
coview_api.addEventListener ("destroy", function () { coview_api.addEventListener("destroy", function () {
console.log("=============> DESTROY : share destroy"); console.log("=============> DESTROY : share destroy");
coview_api.LeaveRoom(); coview_api.LeaveRoom();
$(".coview_share_area").hide(); $(".coview_share_area").hide();
$("#loadingIndicator").removeClass("full_active"); $("#loadingIndicator").removeClass("full_active");
}); });
var meetingId; var meetingId;
coview_api.addEventListener ("message", async function (event, json) {
coview_api.addEventListener("message", async function (event, json) {
console.log("+++ addEventListener", json); console.log("+++ addEventListener", json);
console.log("processMessage api = ", json.api); console.log("processMessage api = ", json.api);
if (isLeaved) return; if (isLeaved) return;
let loginIdList = new Array(); let loginIdList = new Array();
switch (json.api){ switch (json.api) {
case "LoginResponse": case "LoginResponse":
console.log('------------------------------'); console.log("------------------------------");
console.log(globalUserInfo.coWorkType); console.log(globalUserInfo.coWorkType);
console.log(collaborationJoinFlg); console.log(collaborationJoinFlg);
if (globalUserInfo.coWorkType == collaborationTypeKey.DOCUMENT) { if (globalUserInfo.coWorkType == collaborationTypeKey.DOCUMENT) {
isDocument = true; isDocument = true;
globalUserInfo.coWorkType = collaborationTypeKey.AUDIO; globalUserInfo.coWorkType = collaborationTypeKey.AUDIO;
} }
if (collaborationJoinFlg == '1') { if (collaborationJoinFlg == "1") {
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType); coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
if (isDocument) { if (isDocument) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO 画面を縮小し、会議室に入場する処理 //TODO 画面を縮小し、会議室に入場する処理
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
android.startContentView(); android.startContentView(meetingId);
} }
} }
} else if (collaborationJoinFlg == '0') { } else if (collaborationJoinFlg == "0") {
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType); coview_api.CreateRoom(
globalUserInfo.roomId,
globalUserInfo.coWorkType
);
if (isDocument) { if (isDocument) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO 画面を縮小し、会議室に入場する処理 //TODO 画面を縮小し、会議室に入場する処理
...@@ -192,7 +189,7 @@ $(function() { ...@@ -192,7 +189,7 @@ $(function() {
meetingId = android.createContentView(); meetingId = android.createContentView();
} }
} }
} else if (collaborationJoinFlg == '2') { } else if (collaborationJoinFlg == "2") {
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType); coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
} }
Coview_moveToVideoShareArea(); Coview_moveToVideoShareArea();
...@@ -201,50 +198,33 @@ $(function() { ...@@ -201,50 +198,33 @@ $(function() {
if (json.resultCode == 200) { if (json.resultCode == 200) {
var coviewInviteMessage; var coviewInviteMessage;
if (isDocument) { if (isDocument) {
coviewInviteMessage = "" + messageSeperator + messageType.COMMUNICATIONSTART + messageSeperator + CHAT_UTIL.getCollaborationType(collaborationTypeKey.DOCUMENT) + messageSeperator + meetingId; coviewInviteMessage =
} else { "" +
coviewInviteMessage = "" + messageSeperator + messageType.COMMUNICATIONSTART + messageSeperator + CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType); messageSeperator +
} messageType.COMMUNICATIONSTART +
socket.emit('createMessage', { messageSeperator +
text: coviewInviteMessage CHAT_UTIL.getCollaborationType(collaborationTypeKey.DOCUMENT) +
}, 0); messageSeperator +
meetingId;
} else { } else {
coviewInviteMessage =
"" +
messageSeperator +
messageType.COMMUNICATIONSTART +
messageSeperator +
CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType);
} }
break; socket.emit(
case "JoinRoomInfoResponse": "createMessage",
if (json.resultCode == 200) { {
} else { text: coviewInviteMessage,
alert("Not exist sharing call (" + json.resultCode + ")\nPlease using share menu."); },
coview_api.LeaveRoom(); 0
$(".coview_share_area").hide(); );
$("#loadingIndicator").removeClass("full_active");
}
break;
case "JoinRoomResponse":
if (json.resultCode == 200) {
for (let key in g_participants) {
loginIdList.push(key);
}
CHAT_UI.refreshJoinedCollaboration(loginIdList);
} else { } else {
} }
break; break;
case "RoomMemberJoinedEvent":
for (let key in g_participants) {
loginIdList.push(key);
}
CHAT_UI.refreshJoinedCollaboration(loginIdList);
break;
case "RoomMemberLeavedEvent":
for (let key in g_participants) {
loginIdList.push(key);
}
CHAT_UI.refreshJoinedCollaboration(loginIdList);
break;
default:
console.log('Unrecognized api', json);
break;
} }
}); });
}); });
...@@ -257,7 +237,7 @@ function Coview_shareDropdownHide() { ...@@ -257,7 +237,7 @@ function Coview_shareDropdownHide() {
function Coview_moveToVideoShareArea() { function Coview_moveToVideoShareArea() {
$("#loadingIndicator").addClass("full_active"); $("#loadingIndicator").addClass("full_active");
$(".coview_share_area").show(); $(".coview_share_area").show();
$('#collabo_main').removeClass('none'); $("#collabo_main").removeClass("none");
} }
function Coview_exitCollaboration(isDocument = false) { function Coview_exitCollaboration(isDocument = false) {
...@@ -270,10 +250,13 @@ function Coview_exitCollaboration(isDocument = false) { ...@@ -270,10 +250,13 @@ function Coview_exitCollaboration(isDocument = false) {
} }
coview_api.LeaveRoom(); coview_api.LeaveRoom();
isLeaved = true; isLeaved = true;
if (collaborationJoinFlg != '2') { if (collaborationJoinFlg != "2") {
CHAT_UI.joinRoom(CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.name); CHAT_UI.joinRoom(
CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name
);
} else { } else {
if (typeof(android) != "undefined") { if (typeof android != "undefined") {
android.openCommunicationHome(); android.openCommunicationHome();
} else { } else {
webkit.messageHandlers.openCommunicationHome.postMessage({}); webkit.messageHandlers.openCommunicationHome.postMessage({});
......
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