Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chat_webview
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abookCommunication
chat_webview
Commits
52e466d4
Commit
52e466d4
authored
Jul 19, 2021
by
Kim Peace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed for collaboration
parent
a6846c4b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
191 additions
and
206 deletions
+191
-206
public_new/footer_collabo.html
+1
-1
public_new/js/Models/coview-userinfo.js
+2
-2
public_new/js/Models/deviceinfo.js
+3
-0
public_new/js/common/native-bridge-delegate.js
+11
-5
public_new/js/views/collaboration/collaboration.js
+0
-2
public_new/js/views/collaboration/share-event-listener.js
+173
-192
public_new/js/views/collaboration/share.js
+1
-4
No files found.
public_new/footer_collabo.html
View file @
52e466d4
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
</a>
</a>
</div>
</div>
<div
class=
"footer_item mx-md-3"
>
<div
class=
"footer_item mx-md-3"
>
<a
href=
"javascript:CoviewBridge.exitCollaboration(
isDocument
);"
>
<a
href=
"javascript:CoviewBridge.exitCollaboration();"
>
<div
class=
"img_wrap bg_red mx-1"
>
<div
class=
"img_wrap bg_red mx-1"
>
<img
src=
"icon/icon_close_white.png"
alt=
"閉じる"
>
<img
src=
"icon/icon_close_white.png"
alt=
"閉じる"
>
</div>
</div>
...
...
public_new/js/Models/coview-userinfo.js
View file @
52e466d4
...
@@ -38,9 +38,9 @@ var CoviewUserInfo = class {
...
@@ -38,9 +38,9 @@ var CoviewUserInfo = class {
case
COLLABORATION_TYPE
.
VIDEO
:
case
COLLABORATION_TYPE
.
VIDEO
:
return
COLLABORATION_TYPE
.
VIDEO
;
return
COLLABORATION_TYPE
.
VIDEO
;
case
COLLABORATION_TYPE
.
DOCUMENT
:
case
COLLABORATION_TYPE
.
DOCUMENT
:
return
COLLABORATION_TYPE
.
DOCUMENT
;
return
COLLABORATION_TYPE
.
AUDIO
;
case
COLLABORATION_TYPE
.
BOARD
:
case
COLLABORATION_TYPE
.
BOARD
:
return
COLLABORATION_TYPE
.
BOARD
;
return
COLLABORATION_TYPE
.
AUDIO
;
}
}
}
}
...
...
public_new/js/Models/deviceinfo.js
View file @
52e466d4
...
@@ -33,3 +33,6 @@ var DeviceInfo = class {
...
@@ -33,3 +33,6 @@ var DeviceInfo = class {
};
};
var
deviceInfo
=
new
DeviceInfo
(
NativeBridgeDataSource
.
getDeviceInfo
());
var
deviceInfo
=
new
DeviceInfo
(
NativeBridgeDataSource
.
getDeviceInfo
());
// WARN:: this variable is only for use in coview. and should request not to use this.
var
isIos
=
deviceInfo
.
isiOS
();
public_new/js/common/native-bridge-delegate.js
View file @
52e466d4
...
@@ -212,10 +212,11 @@ NativeBridgeDelegate.changeRoomName = function (newRoomName) {
...
@@ -212,10 +212,11 @@ NativeBridgeDelegate.changeRoomName = function (newRoomName) {
};
};
NativeBridgeDelegate
.
startCollaboration
=
function
(
type
)
{
NativeBridgeDelegate
.
startCollaboration
=
function
(
type
)
{
const
collaborationNumber
=
CHAT_UTIL
.
getCollaborationTypeNumber
(
type
);
if
(
deviceInfo
.
isiOS
())
{
if
(
deviceInfo
.
isiOS
())
{
webkit
.
messageHandlers
.
startCollaboration
.
postMessage
(
type
);
webkit
.
messageHandlers
.
startCollaboration
.
postMessage
(
collaborationNumber
);
}
else
if
(
deviceInfo
.
isAndroid
())
{
}
else
if
(
deviceInfo
.
isAndroid
())
{
android
.
startCollaboration
(
type
);
android
.
startCollaboration
(
collaborationNumber
);
}
}
};
};
...
@@ -347,14 +348,19 @@ NativeBridgeDelegate.startContentView = function () {
...
@@ -347,14 +348,19 @@ NativeBridgeDelegate.startContentView = function () {
}
}
};
};
NativeBridgeDelegate
.
changeCollaboration
=
function
(
type
,
meetingID
)
{
NativeBridgeDelegate
.
changeCollaboration
=
function
(
collaborationType
,
meetingID
)
{
const
collaborationNumber
=
CHAT_UTIL
.
getCollaborationTypeNumber
(
collaborationType
);
if
(
deviceInfo
.
isiOS
())
{
if
(
deviceInfo
.
isiOS
())
{
webkit
.
messageHandlers
.
changeCollaboration
.
postMessage
({
webkit
.
messageHandlers
.
changeCollaboration
.
postMessage
({
changeCollaborationType
:
type
,
changeCollaborationType
:
collaborationNumber
,
meetingId
:
meetingID
,
meetingId
:
meetingID
,
});
});
}
else
if
(
deviceInfo
.
isAndroid
())
{
}
else
if
(
deviceInfo
.
isAndroid
())
{
android
.
changeCollaboration
(
type
,
meetingID
);
android
.
changeCollaboration
(
collaborationNumber
,
meetingID
);
}
}
};
};
...
...
public_new/js/views/collaboration/collaboration.js
View file @
52e466d4
...
@@ -29,8 +29,6 @@ document.addEventListener("DOMContentLoaded", function () {
...
@@ -29,8 +29,6 @@ document.addEventListener("DOMContentLoaded", function () {
********************************/
********************************/
CollaborationUI
.
bindMenuButton
=
function
()
{
CollaborationUI
.
bindMenuButton
=
function
()
{
$
(
".menu_btn"
).
click
(
function
()
{
$
(
".menu_btn"
).
click
(
function
()
{
var
w
=
$
(
this
).
width
();
$
(
this
).
toggleClass
(
"hide"
);
$
(
this
).
toggleClass
(
"hide"
);
$
(
"#overlay_menu .item"
).
toggleClass
(
"hide"
);
$
(
"#overlay_menu .item"
).
toggleClass
(
"hide"
);
});
});
...
...
public_new/js/views/collaboration/share-event-listener.js
View file @
52e466d4
...
@@ -3,7 +3,7 @@ var CollaborationFeature = {};
...
@@ -3,7 +3,7 @@ var CollaborationFeature = {};
CoviewBridge
.
bindReadyEvent
=
function
()
{
CoviewBridge
.
bindReadyEvent
=
function
()
{
coview_api
.
addEventListener
(
"ready"
,
function
()
{
coview_api
.
addEventListener
(
"ready"
,
function
()
{
CoviewBridge
.
addLoginI
d
(
globalUserInfo
.
loginId
);
CoviewBridge
.
addLoginI
D
(
globalUserInfo
.
loginId
);
coview_api
.
Login
(
globalUserInfo
.
loginId
);
coview_api
.
Login
(
globalUserInfo
.
loginId
);
updateCollaborationUI
(
globalUserInfo
.
collaborationType
);
updateCollaborationUI
(
globalUserInfo
.
collaborationType
);
NativeBridgeDelegate
.
setHostRequestFlg
(
HostRequestFlag
.
DONE
);
NativeBridgeDelegate
.
setHostRequestFlg
(
HostRequestFlag
.
DONE
);
...
@@ -18,6 +18,9 @@ CoviewBridge.bindStartEvent = function () {
...
@@ -18,6 +18,9 @@ CoviewBridge.bindStartEvent = function () {
});
});
};
};
/**************
* Scroll Lock
**************/
CollaborationFeature
.
scrollLock
=
function
(
e
)
{
CollaborationFeature
.
scrollLock
=
function
(
e
)
{
if
(
deviceInfo
.
isiOS
())
{
if
(
deviceInfo
.
isiOS
())
{
if
(
if
(
...
@@ -87,124 +90,38 @@ CoviewBridge.bindDestroyEvent = function () {
...
@@ -87,124 +90,38 @@ CoviewBridge.bindDestroyEvent = function () {
};
};
CoviewBridge
.
bindMessageEvent
=
function
()
{
CoviewBridge
.
bindMessageEvent
=
function
()
{
let
meetingId
;
coview_api
.
addEventListener
(
"message"
,
async
function
(
event
,
json
)
{
coview_api
.
addEventListener
(
"message"
,
async
function
(
event
,
json
)
{
if
(
globalUserInfo
.
isLeaved
)
{
if
(
globalUserInfo
.
isLeaved
)
{
return
;
return
;
}
}
let
loginI
d
List
=
new
Array
();
let
loginI
D
List
=
new
Array
();
switch
(
json
.
api
)
{
switch
(
json
.
api
)
{
case
"LoginResponse"
:
case
"LoginResponse"
:
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
DOCUMENT
)
{
CollaborationFeature
.
didReceiveLoginResponseMessage
();
isDocument
=
true
;
globalUserInfo
.
collaborationType
=
COLLABORATION_TYPE
.
AUDIO
;
}
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
BOARD
)
{
isBoard
=
true
;
globalUserInfo
.
collaborationType
=
COLLABORATION_TYPE
.
AUDIO
;
}
hostSearchInterval
();
switch
(
globalUserInfo
.
joinType
)
{
case
COLLABORATION_JOIN_TYPE
.
ATTENDEE
:
coview_api
.
JoinRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
if
(
isDocument
)
{
NativeBridgeDelegate
.
startContentView
();
}
break
;
case
COLLABORATION_JOIN_TYPE
.
HOST
:
let
deleteRoomResult
=
JSON
.
parse
(
await
deleteRoomApi
(
globalUserInfo
.
roomId
)
);
if
(
deleteRoomResult
.
resultCode
==
200
)
{
waitMillisecond
(
3000
);
}
coview_api
.
CreateRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
if
(
isDocument
)
{
meetingId
=
NativeBridgeDataSource
.
createContentView
();
globalUserInfo
.
meetingID
=
meetingId
;
}
break
;
case
COLLABORATION_JOIN_TYPE
.
INVITED
:
coview_api
.
JoinRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
break
;
default
:
break
;
}
moveToVideoShareArea
();
break
;
break
;
case
"CreateRoomResponse"
:
case
"CreateRoomResponse"
:
if
(
json
.
resultCode
==
200
)
{
if
(
json
.
resultCode
==
200
)
{
var
coviewInviteMessage
;
CollaborationFeature
.
didReceiveCreateRoomResponseMessage
();
if
(
isDocument
)
{
coviewInviteMessage
=
""
+
messageSeperator
+
MessageType
.
COMMUNICATIONSTART
+
messageSeperator
+
CHAT_UTIL
.
getCollaborationTypeNumber
(
COLLABORATION_TYPE
.
DOCUMENT
)
+
messageSeperator
+
meetingId
;
}
else
if
(
isBoard
)
{
coviewInviteMessage
=
""
+
messageSeperator
+
MessageType
.
COMMUNICATIONSTART
+
messageSeperator
+
COLLABORATION_TYPE
.
BOARD
;
}
else
{
coviewInviteMessage
=
""
+
messageSeperator
+
MessageType
.
COMMUNICATIONSTART
+
messageSeperator
+
CHAT_UTIL
.
getCollaborationTypeNumber
(
globalUserInfo
.
collaborationType
);
}
CHAT_SOCKET
.
emitCreateMessage
(
coviewInviteMessage
,
0
);
}
}
break
;
break
;
case
"joinRoomInfoResponse"
:
case
"joinRoomInfoResponse"
:
if
(
json
.
resultCode
==
200
)
{
if
(
json
.
resultCode
!=
200
)
{
}
else
{
CollaborationFeature
.
didReceivedJoinRoomInfoResponseMessage
();
alert
(
getLocalizedString
(
"not_exist_sharing_call"
));
coview_api
.
LeaveRoom
();
$
(
".coview_share_area"
).
hide
();
CollaborationUI
.
hideLoadingIndicator
();
NativeBridgeDelegate
.
joinRoom
(
roomInfo
.
roomID
,
roomInfo
.
roomName
);
}
}
break
;
break
;
case
"JoinRoomResponse"
:
case
"JoinRoomResponse"
:
if
(
json
.
resultCode
==
200
)
{
if
(
json
.
resultCode
!=
200
)
{
hostSearchInterval
();
break
;
for
(
let
key
in
g_participants
)
{
loginIdList
.
push
(
key
);
}
CollaborationUI
.
refreshJoinedCollaboration
(
loginIdList
);
}
}
break
;
CollaborationFeature
.
searchHostIntervally
();
// fall through
case
"RoomMemberJoinedEvent"
:
case
"RoomMemberJoinedEvent"
:
for
(
let
key
in
g_participants
)
{
// fall through
loginIdList
.
push
(
key
);
}
CollaborationUI
.
refreshJoinedCollaboration
(
loginIdList
);
break
;
case
"RoomMemberLeavedEvent"
:
case
"RoomMemberLeavedEvent"
:
for
(
let
key
in
g_participants
)
{
for
(
let
key
in
g_participants
)
{
loginI
d
List
.
push
(
key
);
loginI
D
List
.
push
(
key
);
}
}
CollaborationUI
.
refreshJoinedCollaboration
(
loginI
d
List
);
CollaborationUI
.
refreshJoinedCollaboration
(
loginI
D
List
);
break
;
break
;
case
"HostRequest"
:
case
"HostRequest"
:
// to be called by
// to be called by
...
@@ -232,12 +149,74 @@ CoviewBridge.bindMessageEvent = function () {
...
@@ -232,12 +149,74 @@ CoviewBridge.bindMessageEvent = function () {
});
});
};
};
CollaborationFeature
.
didReceiveLoginResponseMessage
=
async
function
()
{
CollaborationFeature
.
searchHostIntervally
();
switch
(
globalUserInfo
.
joinType
)
{
case
COLLABORATION_JOIN_TYPE
.
INVITED
:
// fall through
case
COLLABORATION_JOIN_TYPE
.
ATTENDEE
:
coview_api
.
JoinRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
break
;
case
COLLABORATION_JOIN_TYPE
.
HOST
:
let
deleteRoomResult
=
JSON
.
parse
(
await
deleteRoom
(
globalUserInfo
.
roomId
)
);
if
(
deleteRoomResult
.
resultCode
==
200
)
{
waitMillisecond
(
3000
);
}
coview_api
.
CreateRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
break
;
default
:
break
;
}
const
isDocument
=
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
DOCUMENT
;
const
isAttendee
=
globalUserInfo
.
joinType
==
COLLABORATION_JOIN_TYPE
.
ATTENDEE
;
const
isHost
=
globalUserInfo
.
joinType
==
COLLABORATION_JOIN_TYPE
.
HOST
;
if
(
isDocument
)
{
if
(
isAttendee
)
{
NativeBridgeDelegate
.
startContentView
();
}
else
if
(
isHost
)
{
globalUserInfo
.
meetingID
=
NativeBridgeDataSource
.
createContentView
();
}
}
CollaborationUI
.
moveToVideoShareArea
();
};
CollaborationFeature
.
didReceiveCreateRoomResponseMessage
=
function
()
{
let
coviewInviteMessage
=
""
+
messageSeperator
+
MessageType
.
COMMUNICATIONSTART
+
messageSeperator
+
CHAT_UTIL
.
getCollaborationTypeNumber
(
globalUserInfo
.
collaborationType
);
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
DOCUMENT
)
{
coviewInviteMessage
+=
messageSeperator
+
globalUserInfo
.
meetingID
;
}
CHAT_SOCKET
.
emitCreateMessage
(
coviewInviteMessage
,
0
);
};
CollaborationFeature
.
didReceivedJoinRoomInfoResponseMessage
=
function
()
{
alert
(
getLocalizedString
(
"not_exist_sharing_call"
));
coview_api
.
LeaveRoom
();
$
(
".coview_share_area"
).
hide
();
CollaborationUI
.
hideLoadingIndicator
();
NativeBridgeDelegate
.
joinRoom
(
roomInfo
.
roomID
,
roomInfo
.
roomName
);
};
CoviewBridge
.
changeHost
=
function
(
userID
)
{
CoviewBridge
.
changeHost
=
function
(
userID
)
{
// call in agent_app.js
// call in agent_app.js
changeOwnerSend
(
userID
);
changeOwnerSend
(
userID
);
};
};
CoviewBridge
.
addLoginI
d
=
function
(
loginID
)
{
CoviewBridge
.
addLoginI
D
=
function
(
loginID
)
{
const
url
=
"https://biztaskyell.abookcloud.com/auth/getuser"
;
const
url
=
"https://biztaskyell.abookcloud.com/auth/getuser"
;
$
.
ajax
({
$
.
ajax
({
url
:
url
,
url
:
url
,
...
@@ -256,66 +235,75 @@ CoviewBridge.addLoginId = function (loginID) {
...
@@ -256,66 +235,75 @@ CoviewBridge.addLoginId = function (loginID) {
});
});
};
};
function
hostSearchInterval
()
{
CollaborationFeature
.
searchHostIntervally
=
function
()
{
let
hostName
=
""
;
let
hostName
=
""
;
function
hostSearch
()
{
function
searchHost
()
{
if
(
g_isMainMan
)
{
if
(
g_isMainMan
)
{
$
(
"#collaboration_user_"
+
currentUserInfo
.
loginID
).
addClass
(
"host"
);
CollaborationUI
.
showHostButtons
();
$
(
".host_contents"
).
removeClass
(
"none"
);
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
CAMERA
)
{
$
(
".photo_select_button"
).
removeClass
(
"none"
);
}
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
VIDEO
)
{
$
(
".video_contents_host"
).
removeClass
(
"none"
);
$
(
".video_contents_user"
).
addClass
(
"none"
);
}
if
(
deviceInfo
.
isiOS
())
isIos
=
true
;
}
else
{
}
else
{
$
(
"#collaboration_user_"
+
currentUserInfo
.
loginID
).
removeClass
(
"host"
);
CollaborationUI
.
hideHostButtons
();
$
(
".host_contents"
).
addClass
(
"none"
);
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
CAMERA
)
{
$
(
".photo_select_button"
).
addClass
(
"none"
);
}
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
VIDEO
)
{
$
(
".video_contents_user"
).
removeClass
(
"none"
);
$
(
".video_contents_host"
).
addClass
(
"none"
);
}
}
}
CollaborationUI
.
showHostMark
(
hostName
);
if
(
hostName
!=
g_isMainManUsername
)
{
if
(
hostName
!=
g_isMainManUsername
)
{
if
(
hostName
!=
""
)
{
$
(
"#collaboration_user_"
+
getReplacedLoginId
(
hostName
)).
removeClass
(
"host"
);
}
$
(
"#collaboration_user_"
+
getReplacedLoginId
(
g_isMainManUsername
)
).
addClass
(
"host"
);
hostName
=
g_isMainManUsername
;
hostName
=
g_isMainManUsername
;
}
else
{
if
(
hostName
==
""
)
{
if
(
!
$
(
"#collaboration_user_"
+
currentUserInfo
.
loginID
).
hasClass
(
"host"
)
&&
coview_api
.
getRoomUsers
()
)
{
$
(
"#collaboration_user_"
+
currentUserInfo
.
loginID
).
addClass
(
"host"
);
}
}
else
{
if
(
!
$
(
"#collaboration_user_"
+
getReplacedLoginId
(
hostName
)).
hasClass
(
"host"
)
)
{
$
(
"#collaboration_user_"
+
getReplacedLoginId
(
hostName
)).
addClass
(
"host"
);
}
}
}
}
}
}
timeInterval
=
setInterval
(
hostSearch
,
2000
);
timeInterval
=
setInterval
(
searchHost
,
2000
);
}
};
CollaborationUI
.
showHostButtons
=
function
()
{
$
(
"#collaboration_user_"
+
currentUserInfo
.
loginID
).
addClass
(
"host"
);
$
(
".host_contents"
).
removeClass
(
"none"
);
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
CAMERA
)
{
$
(
".photo_select_button"
).
removeClass
(
"none"
);
}
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
VIDEO
)
{
$
(
".video_contents_host"
).
removeClass
(
"none"
);
$
(
".video_contents_user"
).
addClass
(
"none"
);
}
};
CollaborationUI
.
hideHostButtons
=
function
()
{
$
(
"#collaboration_user_"
+
currentUserInfo
.
loginID
).
removeClass
(
"host"
);
$
(
".host_contents"
).
addClass
(
"none"
);
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
CAMERA
)
{
$
(
".photo_select_button"
).
addClass
(
"none"
);
}
if
(
globalUserInfo
.
collaborationType
==
COLLABORATION_TYPE
.
VIDEO
)
{
$
(
".video_contents_user"
).
removeClass
(
"none"
);
$
(
".video_contents_host"
).
addClass
(
"none"
);
}
};
CollaborationUI
.
showHostMark
=
function
(
hostName
)
{
const
currentUserLoginIDDiv
=
$
(
"#collaboration_user_"
+
currentUserInfo
.
loginID
);
const
replaceHostIDDiv
=
$
(
"#collaboration_user_"
+
getReplacedLoginId
(
hostName
)
);
const
replacedMainManUserID
=
$
(
"#collaboration_user_"
+
getReplacedLoginId
(
g_isMainManUsername
)
);
if
(
hostName
!=
g_isMainManUsername
)
{
if
(
hostName
!=
""
)
{
replaceHostIDDiv
.
removeClass
(
"host"
);
}
replacedMainManUserID
.
addClass
(
"host"
);
return
;
}
if
(
hostName
==
""
)
{
if
(
!
currentUserLoginIDDiv
.
hasClass
(
"host"
)
&&
coview_api
.
getRoomUsers
())
{
currentUserLoginIDDiv
.
addClass
(
"host"
);
}
}
else
{
if
(
!
replaceHostIDDiv
.
hasClass
(
"host"
))
{
replaceHostIDDiv
.
addClass
(
"host"
);
}
}
};
function
captureAndShareImage
(
urls
,
changeHostName
)
{
function
captureAndShareImage
(
urls
,
changeHostName
)
{
addCaptureEffect
();
addCaptureEffect
();
...
@@ -337,62 +325,32 @@ function captureAndShareImage(urls, changeHostName) {
...
@@ -337,62 +325,32 @@ function captureAndShareImage(urls, changeHostName) {
}
}
canvas
.
toBlob
(
function
(
blob
)
{
canvas
.
toBlob
(
function
(
blob
)
{
var
newImg
=
document
.
createElement
(
"img"
);
var
url
=
URL
.
createObjectURL
(
blob
);
canvasRemote
.
style
.
backgroundImage
=
canvasRemote
.
style
.
backgroundImage
=
"url('"
+
URL
.
createObjectURL
(
blob
)
+
"')"
;
"url('"
+
URL
.
createObjectURL
(
blob
)
+
"')"
;
canvasRemote
.
style
.
backgroundSize
=
"contain"
;
canvasRemote
.
style
.
backgroundSize
=
"contain"
;
$
(
canvasRemote
).
attr
(
$
(
canvasRemote
).
attr
(
"height"
,
"height"
,
$
(
snapshots
[
cpatureViewIndex
]).
attr
(
"height"
)
$
(
snapshots
[
cpatureViewIndex
]).
attr
(
"height"
)
);
);
$
(
canvasRemote
).
attr
(
"width"
,
$
(
snapshots
[
cpatureViewIndex
]).
attr
(
"width"
));
$
(
canvasRemote
).
attr
(
"width"
,
$
(
snapshots
[
cpatureViewIndex
]).
attr
(
"width"
));
if
(
$
(
".canvas_wrap"
).
css
(
"width"
).
replace
(
"px"
,
""
)
/
CollaborationUI
.
configureCanvasSize
(
$
(
canvas
));
$
(
".canvas_wrap"
).
css
(
"height"
).
replace
(
"px"
,
""
)
<
$
(
canvas
).
attr
(
"width"
)
/
$
(
canvas
).
attr
(
"height"
)
)
{
var
h
=
$
(
".canvas_wrap"
).
css
(
"width"
).
replace
(
"px"
,
""
)
*
(
$
(
canvas
).
attr
(
"height"
)
/
$
(
canvas
).
attr
(
"width"
));
var
w
=
$
(
".canvas_wrap"
).
css
(
"width"
).
replace
(
"px"
,
""
);
$
(
canvasRemote
).
css
(
"height"
,
h
);
$
(
canvasRemote
).
css
(
"width"
,
w
);
$
(
canvasRemote
).
css
(
"margin-top"
,
-
h
/
2
);
$
(
canvasRemote
).
css
(
"margin-left"
,
-
w
/
2
);
}
else
{
var
h
=
$
(
".canvas_wrap"
).
css
(
"height"
).
replace
(
"px"
,
""
);
var
w
=
$
(
".canvas_wrap"
).
css
(
"height"
).
replace
(
"px"
,
""
)
/
(
$
(
canvas
).
attr
(
"height"
)
/
$
(
canvas
).
attr
(
"width"
));
$
(
canvasRemote
).
css
(
"height"
,
h
);
$
(
canvasRemote
).
css
(
"width"
,
w
);
$
(
canvasRemote
).
css
(
"margin-top"
,
-
h
/
2
);
$
(
canvasRemote
).
css
(
"margin-left"
,
-
w
/
2
);
}
$
(
".canvas_wrap"
).
css
(
"background-color"
,
"#000"
);
$
(
".canvas_wrap"
).
css
(
"background-color"
,
"#000"
);
$
(
".clear_img"
).
show
();
$
(
".clear_img"
).
show
();
SetShareMenuState
(
"on"
);
SetShareMenuState
(
"on"
);
WithImageShareBtnState
(
"on"
);
WithImageShareBtnState
(
"on"
);
//Fermi側にイメージ保存。
//Fermi側にイメージ保存。
var
formData
=
new
FormData
();
let
formData
=
new
FormData
();
var
uploadFileName
=
const
uploadFileName
=
"capture_share_"
+
g_webroom
+
"_"
+
g_shareCount
+
".png"
;
"capture_share_"
+
g_webroom
+
"_"
+
g_shareCount
+
".png"
;
g_shareCount
++
;
g_shareCount
++
;
formData
.
append
(
"imgFile"
,
blob
,
uploadFileName
);
formData
.
append
(
"imgFile"
,
blob
,
uploadFileName
);
var
uploadUrl
=
location
.
protocol
+
"//"
+
location
.
hostname
+
":"
+
location
.
port
+
"/upload/create"
;
if
(
!
location
.
port
)
{
uploadUrl
=
location
.
protocol
+
"//"
+
location
.
hostname
+
"/upload/create"
;
}
$
.
ajax
({
$
.
ajax
({
type
:
"post"
,
type
:
"post"
,
url
:
g_coviewapiserverADDR
+
"/upload/create"
,
url
:
g_coviewapiserverADDR
+
"/upload/create"
,
...
@@ -416,6 +374,29 @@ function captureAndShareImage(urls, changeHostName) {
...
@@ -416,6 +374,29 @@ function captureAndShareImage(urls, changeHostName) {
});
});
}
}
CollaborationUI
.
configureCanvasSize
=
function
(
canvas
)
{
const
canvasWrap
=
$
(
".canvas_wrap"
);
const
canvasWidth
=
$
(
canvas
).
attr
(
"width"
);
const
canvasHeight
=
$
(
canvas
).
attr
(
"height"
);
const
canvasRatio
=
canvasWidth
/
canvasHeight
;
const
reversedCanvasRatio
=
canvasHeight
/
canvasWidth
;
const
canvasWidthValue
=
canvasWrap
.
css
(
"width"
).
replace
(
"px"
,
""
);
const
canvasHeightValue
=
canvasWrap
.
css
(
"height"
).
replace
(
"px"
,
""
);
let
h
;
let
w
;
if
(
canvasWidthValue
/
canvasHeightValue
<
canvasRatio
)
{
h
=
canvasWidthValue
*
reversedCanvasRatio
;
w
=
canvasWidthValue
;
}
else
{
h
=
canvasHeightValue
;
w
=
canvasHeightValue
/
reversedCanvasRatio
;
}
$
(
canvasRemote
).
css
(
"height"
,
h
);
$
(
canvasRemote
).
css
(
"width"
,
w
);
$
(
canvasRemote
).
css
(
"margin-top"
,
-
h
/
2
);
$
(
canvasRemote
).
css
(
"margin-left"
,
-
w
/
2
);
};
function
getReplacedLoginId
(
loginId
)
{
function
getReplacedLoginId
(
loginId
)
{
return
loginId
.
replaceAll
(
globalUserInfo
.
shopName
+
"_"
,
""
);
return
loginId
.
replaceAll
(
globalUserInfo
.
shopName
+
"_"
,
""
);
}
}
...
@@ -495,8 +476,8 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
...
@@ -495,8 +476,8 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
Common
.
dismissLoadingIndicator
();
Common
.
dismissLoadingIndicator
();
};
};
function
moveToVideoShareArea
()
{
CollaborationUI
.
moveToVideoShareArea
=
function
()
{
CollaborationUI
.
showLoadingIndicator
();
CollaborationUI
.
showLoadingIndicator
();
$
(
".coview_share_area"
).
show
();
$
(
".coview_share_area"
).
show
();
$
(
"#collabo_main"
).
removeClass
(
"none"
);
$
(
"#collabo_main"
).
removeClass
(
"none"
);
}
}
;
public_new/js/views/collaboration/share.js
View file @
52e466d4
...
@@ -2,11 +2,9 @@
...
@@ -2,11 +2,9 @@
/* Functions */
/* Functions */
/* --------------------------------------------------- */
/* --------------------------------------------------- */
let
coview_api
=
new
CoviewApi
();
let
coview_api
=
new
CoviewApi
();
var
isDocument
=
false
;
var
isBoard
=
false
;
var
isBoard
=
false
;
let
timeInterval
=
null
;
let
timeInterval
=
null
;
var
backgroundFileName
;
var
backgroundFileName
;
var
isIos
;
document
.
addEventListener
(
"DOMContentLoaded"
,
function
()
{
document
.
addEventListener
(
"DOMContentLoaded"
,
function
()
{
coview_api
.
Init
({
coview_api
.
Init
({
...
@@ -153,8 +151,7 @@ function screenLock() {
...
@@ -153,8 +151,7 @@ function screenLock() {
element
.
style
.
zIndex
=
"9999"
;
element
.
style
.
zIndex
=
"9999"
;
element
.
style
.
opacity
=
"0"
;
element
.
style
.
opacity
=
"0"
;
const
objBody
=
document
.
getElementsByTagName
(
"body"
).
item
(
0
);
document
.
getElementsByTagName
(
"body"
).
item
(
0
).
appendChild
(
element
);
objBody
.
appendChild
(
element
);
}
}
async
function
waitMillisecond
(
millesecond
)
{
async
function
waitMillisecond
(
millesecond
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment