Commit a6499c0a 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
parents 569915e1 b4450c27
var lastscrollvalue;
window.onscroll = function() {
var scrollPosition = window.scrollY || document.documentElement.scrollTop;
if (scrollPosition == 0) {
console.log('Scroll on TOP!!');
//TODO add getMessages(newLine);
if (CHAT_UTIL.isIOS()) {
} else if (CHAT_UTIL.isAndroid()) {
//android.getMessages()
}
}
beforeScroll = window.scrollY;
}
$('#roomNameChangeBtn').click(function() {
......
......@@ -3,6 +3,14 @@ var socket;
// 名前空間
var CHAT_SOCKET = {};
CHAT_SOCKET.socketCheck = function () {
if(socket == null || socket.disconnected) {
window.location.reload();
}
}
CHAT_SOCKET.connectSocket = function () {
if (IS_ONLINE == 'true') {
socket = io(CHAT_SERVER_URL);
......
......@@ -11,6 +11,10 @@ CHAT.globalLoginParameter;
// fermi coview share
let globalUserInfo = new Object();
var beforeHeight = window.innerHeight;
var beforeWidth = window.innerWidth;
var beforeScroll;
CHAT.saveRoomInfo = function(roomId, roomName) {
CHAT.globalLoginParameter.roomId = roomId;
CHAT.globalLoginParameter.roomName = roomName;
......@@ -372,26 +376,38 @@ $(function() {
}
});
var beforeHeight;
var beforeScroll;
var footerHeight = $('.footer-wrap').height();
window.addEventListener("resize", function() {
console.log('aaaa');
var afterHeight = window.innerHeight;
if (beforeHeight > afterHeight) {
//キーボード表示時
var moreScroll = beforeHeight - afterHeight;
$('.room_container').css('margin-bottom', 0);
window.scrollTo(0, beforeScroll + moreScroll - $('.footer_content_b').height());
} else {
//キーボード非表示
var afterWidth = window.innerWidth;
var moreScroll = beforeHeight - afterHeight;
if (beforeHeight > afterHeight && (beforeHeight - afterHeight) > 50) {
if (beforeWidth == afterWidth) {
//キーボード表示時
$('.room_container').css('margin-bottom', 0);
window.scrollTo(0, beforeScroll + moreScroll - $('.footer_content_b').height());
} else {
//画面回転時
window.scrollTo(0, beforeScroll + (moreScroll * 2) - $('.footer_content_b').height());
}
} else if (beforeHeight < afterHeight) {
$('.room_container').css('margin-bottom', footerHeight);
window.scrollTo(0, beforeScroll);
if (beforeWidth == afterWidth) {
//キーボード非表示
window.scrollTo(0, beforeScroll + moreScroll + $('.footer_content_b').height());
} else {
//画面回転時
window.scrollTo(0, beforeScroll + (moreScroll * 2) + $('.footer_content_b').height());
}
}
beforeHeight = window.innerHeight;
beforeWidth = window.innerWidth;
});
$('#messageInput').focusin(function(e) {
beforeHeight = window.innerHeight;
beforeWidth = window.innerWidth;
beforeScroll = window.scrollY;
})
......
......@@ -199,7 +199,15 @@ $(function () {
})
$('#captureBtn').click(function () {
coview_api.Capture(CMS_SERVER_URL + '/chatapi/file/uploadArchive');
if ($('#recordBtn').hasClass('bg_red')) {
screenLock();
recordStop(function() {
$('#screenLock').remove();
coview_api.Capture(CMS_SERVER_URL + '/chatapi/file/uploadArchive');
});
} else {
coview_api.Capture(CMS_SERVER_URL + '/chatapi/file/uploadArchive');
}
})
$('#captureRequestBtn').click(function () {
......
......@@ -142,7 +142,9 @@ $(function () {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.joinChangedCollaboration.postMessage({"joinCollaborationType": joinCollaborationType, "meetingId": data.payload.newMeetingId});
webkit.messageHandlers.joinMeetingRoom.postMessage(data.payload.newMeetingId);
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
webkit.messageHandlers.joinMeetingRoom.postMessage(data.payload.newMeetingId);
}
} else if (CHAT_UTIL.isAndroid()) {
android.joinChangedCollaboration(joinCollaborationType, data.payload.newMeetingId);
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
......@@ -162,7 +164,15 @@ $(function () {
}
} else if (data.type === "CAPTURE_REQUEST" && g_isMainMan) {
if (confirm(data.payload.name + getLocalizedString("request_capture"))) {
captureAndShareImage(CMS_SERVER_URL + '/chatapi/file/uploadArchive', data.payload.name);
if ($('#recordBtn').hasClass('bg_red')) {
screenLock();
recordStop(function() {
$('#screenLock').remove();
captureAndShareImage(CMS_SERVER_URL + '/chatapi/file/uploadArchive', data.payload.name);
});
} else {
captureAndShareImage(CMS_SERVER_URL + '/chatapi/file/uploadArchive', data.payload.name);
}
}
} else if (data.type === "HOST_CHANGE_REQUEST") {
if (data.payload.loginId == globalUserInfo.loginId) {
......@@ -188,12 +198,16 @@ $(function () {
} 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);
if (g_isMainMan) {
if(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);
}
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(HOST_REQUEST_FLG.DONE);
fw.sendToMsg('others', 'HOST_REQUEST_REJECT', {"hostId": data.payload.hostId});
}
fw.sendToMsg('others', 'HOST_REQUEST_DONE', {"hostId": data.payload.hostId});
}
......@@ -203,6 +217,15 @@ $(function () {
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(HOST_REQUEST_FLG.DONE);
}
} else if (data.type === "HOST_REQUEST_REJECT") {
if (data.payload.hostId == CHAT.globalLoginParameter.loginId) {
alert('REJECT for owner user');
}
if (CHAT_UTIL.isAndroid()) {
android.setHostRequestFlg(HOST_REQUEST_FLG.DONE);
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(HOST_REQUEST_FLG.DONE);
}
}
});
});
......@@ -213,7 +236,13 @@ $(function () {
});
coview_api.addEventListener("allbye", function () {
console.log("=============> ALL BYE : share allbye");
console.log("=============> HOST BYE : share hostbye");
alert(getLocalizedString("inform_exit_host_collaboration"));
var isDocument = false;
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
isDocument = true;
}
Coview_exitCollaboration(isDocument);
$("#loadingIndicator").removeClass("full_active");
});
......@@ -224,22 +253,23 @@ $(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();
var isDocument = false;
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
isDocument = true;
}
Coview_exitCollaboration(isDocument);
$("#loadingIndicator").removeClass("full_active");
});
coview_api.addEventListener("destroy", function () {
console.log("=============> DESTROY : share destroy");
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && CHAT_UTIL.isAndroid()) {
android.exitMeetingRoom();
}
alert(getLocalizedString("inform_exit_host_collaboration"));
Coview_exitCollaboration();
$(".coview_share_area").hide();
var isDocument = false;
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
isDocument = true;
}
Coview_exitCollaboration(isDocument);
$("#loadingIndicator").removeClass("full_active");
});
......@@ -454,6 +484,18 @@ function changeCollaboration(changeCollaborationType) {
fw.sendToMsg('others', 'CHANGE_COLLABORATION', {"collaborationType": changeCollaborationType, "newMeetingId": newMeetingId});
}
document.addEventListener('touchmove', function (e) {
if (CHAT_UTIL.isIOS()) {
if ($(e.target).closest('.add_user_modal').length > 0
|| $(e.target).closest('#overlay_user_list').length > 0)
{
e.stopPropagation();
} else {
e.preventDefault();
}
}
}, {passive: false});
function initCollaborationUI(changeCollaborationType){
$('#coviewEraserCtrBtn').click();
if ($('.user_btn').hasClass("hide")) {
......@@ -755,4 +797,4 @@ function captureAndShareImage(urls, changeHostName) {
}
});
});
}
\ No newline at end of file
}
......@@ -5,7 +5,7 @@
<form id="addUserFormInCollaboration" action="chat_add_user_confirm.html" method="post">
<!-- ユーザー検索 -->
<!-- タブ -->
<nav class="nav-modal-add-user" style="width: 75%;">
<nav class="nav-modal-add-user" style="position: absolute;">
<div class="row h-100 align-items-center">
<div class="col-4 pr-0">
<div class="nav-item">
......
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