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
9f6b13cc
Commit
9f6b13cc
authored
May 13, 2021
by
Kim Peace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed share.js as javascript indent
parent
0af9fdc9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
62 deletions
+81
-62
public_new/js/share.js
+81
-62
No files found.
public_new/js/share.js
View file @
9f6b13cc
...
...
@@ -4,25 +4,24 @@
let
coview_api
=
new
CoviewApi
();
var
isDocument
=
false
;
let
isLeaved
=
false
;
$
(
function
()
{
var
coviewApiActive
=
coview_api
.
Init
(
{
testSTRParam
:
"param1"
,
testNUMParam
:
77
,
testBOOLParam
:
false
,
$
(
function
()
{
var
coviewApiActive
=
coview_api
.
Init
(
{
testSTRParam
:
"param1"
,
testNUMParam
:
77
,
testBOOLParam
:
false
,
coview_api_srv_addr
:
"https://livetaskyell.abookcloud.com"
,
coview_wrap_id
:
"coviewShare"
,
coview_api_key
:
"8dda7092c5820d663"
}
);
coview_wrap_id
:
"coviewShare"
,
coview_api_key
:
"8dda7092c5820d663"
,
});
// special button IN Chat ui
$
(
"#coviewShareMainBtn"
).
on
(
"click"
,
function
(
e
)
{
$
(
"#coviewShareMainBtn"
).
on
(
"click"
,
function
(
e
)
{
e
.
stopPropagation
();
if
(
$
(
".coview_share_dropdown_bar"
).
is
(
':visible'
)
==
true
)
{
if
(
$
(
".coview_share_dropdown_bar"
).
is
(
":visible"
)
==
true
)
{
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
();
}
}
else
{
...
...
@@ -30,24 +29,22 @@ $(function() {
}
});
$
(
"#coviewShareCloseButton"
).
on
(
"click"
,
function
(
e
)
{
$
(
"#coviewShareCloseButton"
).
on
(
"click"
,
function
(
e
)
{
coview_api
.
LeaveRoom
();
$
(
".coview_share_area"
).
hide
();
});
$
(
"body"
).
on
(
"click"
,
function
()
{
$
(
"body"
).
on
(
"click"
,
function
()
{
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
();
}
else
{
$
(
".coview_share_dropdown_bar"
).
slideDown
();
}
});
$
(
document
).
on
(
"click"
,
".coview_share_request"
,
function
()
{
$
(
document
).
on
(
"click"
,
".coview_share_request"
,
function
()
{
console
.
log
(
"globalUserInfo"
,
globalUserInfo
);
if
(
$
(
this
).
hasClass
(
collaborationTypeKey
.
VIDEO
)
==
true
)
{
globalUserInfo
.
coWorkType
=
collaborationTypeKey
.
VIDEO
;
...
...
@@ -64,29 +61,25 @@ $(function() {
Coview_moveToVideoShareArea
();
});
/* --------------------------------------------------- */
/* Video, photo, chat, doc */
/* --------------------------------------------------- */
$
(
"#coviewShareChat"
).
on
(
"click"
,
function
()
{
$
(
"#coviewShareChat"
).
on
(
"click"
,
function
()
{
console
.
log
(
"ON click coviewShareChat"
);
});
$
(
"#coviewSharePhoto"
).
on
(
"click"
,
function
(
e
)
{
$
(
"#coviewSharePhoto"
).
on
(
"click"
,
function
(
e
)
{
e
.
stopPropagation
();
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
();
}
else
{
$
(
".coview_share_photo_select_bubble"
).
slideDown
();
}
});
$
(
"#coviewSharePhotoCamera"
).
on
(
"click"
,
function
()
{
$
(
"#coviewSharePhotoCamera"
).
on
(
"click"
,
function
()
{
$
(
".coview_share_photo_select_bubble"
).
hide
();
globalUserInfo
.
coWorkType
=
collaborationTypeKey
.
CAMERA
;
coview_api
.
CreateRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
...
...
@@ -94,7 +87,7 @@ $(function() {
$
(
".coview_share_title_name"
).
text
(
"カメラ"
);
});
$
(
"#coviewSharePhotoGallery"
).
on
(
"click"
,
function
()
{
$
(
"#coviewSharePhotoGallery"
).
on
(
"click"
,
function
()
{
$
(
".coview_share_photo_select_bubble"
).
hide
();
globalUserInfo
.
coWorkType
=
"gallery"
;
coview_api
.
CreateRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
...
...
@@ -103,12 +96,11 @@ $(function() {
$
(
".coview_share_title_name"
).
text
(
"ライブラリ"
);
});
$
(
"#coviewShareAudio"
).
on
(
"click"
,
function
()
{
$
(
"#coviewShareAudio"
).
on
(
"click"
,
function
()
{
Coview_connect_audio_collaboration
();
})
});
$
(
"#coviewShareLive"
).
on
(
"click"
,
function
()
{
$
(
"#coviewShareLive"
).
on
(
"click"
,
function
()
{
console
.
log
(
"ON click coviewShareLive"
);
globalUserInfo
.
coWorkType
=
"video"
;
console
.
log
(
"globalUserInfo"
,
globalUserInfo
);
...
...
@@ -119,62 +111,64 @@ $(function() {
$
(
".coview_share_title_name"
).
text
(
"LIVE"
);
});
// $("#coviewShareDoc").on("click", function(){
// console.log("ON click coviewShareDoc");
// alert("INTO a document share mode (only audio)");
// globalUserInfo.coWorkType = "audio";
// });
// $("#coviewShareDoc").on("click", function(){
// console.log("ON click coviewShareDoc");
// alert("INTO a document share mode (only audio)");
// globalUserInfo.coWorkType = "audio";
// });
coview_api
.
addEventListener
(
"ready"
,
function
()
{
coview_api
.
addEventListener
(
"ready"
,
function
()
{
console
.
log
(
"=============> READY : ready for coview api"
);
Coview_addLoginId
(
globalUserInfo
.
loginId
);
coview_api
.
Login
(
globalUserInfo
.
loginId
);
});
coview_api
.
addEventListener
(
"start"
,
function
()
{
coview_api
.
addEventListener
(
"start"
,
function
()
{
console
.
log
(
"=============> START : share start"
);
$
(
"#loadingIndicator"
).
removeClass
(
"full_active"
);
});
coview_api
.
addEventListener
(
"allbye"
,
function
()
{
coview_api
.
addEventListener
(
"allbye"
,
function
()
{
console
.
log
(
"=============> ALL BYE : share allbye"
);
$
(
"#loadingIndicator"
).
removeClass
(
"full_active"
);
});
coview_api
.
addEventListener
(
"guestbye"
,
function
()
{
coview_api
.
addEventListener
(
"guestbye"
,
function
()
{
console
.
log
(
"=============> GUEST BYE : share guestbye"
);
$
(
"#loadingIndicator"
).
removeClass
(
"full_active"
);
});
coview_api
.
addEventListener
(
"hostbye"
,
function
()
{
coview_api
.
addEventListener
(
"hostbye"
,
function
()
{
console
.
log
(
"=============> HOST BYE : share hostbye"
);
alert
(
getLocalizedString
(
"inform_exit_host_collaboration"
));
Coview_exitCollaboration
();
$
(
"#loadingIndicator"
).
removeClass
(
"full_active"
);
});
coview_api
.
addEventListener
(
"destroy"
,
function
()
{
coview_api
.
addEventListener
(
"destroy"
,
function
()
{
console
.
log
(
"=============> DESTROY : share destroy"
);
coview_api
.
LeaveRoom
();
$
(
".coview_share_area"
).
hide
();
$
(
"#loadingIndicator"
).
removeClass
(
"full_active"
);
});
var
meetingId
;
coview_api
.
addEventListener
(
"message"
,
async
function
(
event
,
json
)
{
coview_api
.
addEventListener
(
"message"
,
async
function
(
event
,
json
)
{
console
.
log
(
"+++ addEventListener"
,
json
);
console
.
log
(
"processMessage api = "
,
json
.
api
);
if
(
isLeaved
)
return
;
let
loginIdList
=
new
Array
();
switch
(
json
.
api
)
{
switch
(
json
.
api
)
{
case
"LoginResponse"
:
console
.
log
(
'------------------------------'
);
console
.
log
(
"------------------------------"
);
console
.
log
(
globalUserInfo
.
coWorkType
);
console
.
log
(
collaborationJoinFlg
);
if
(
globalUserInfo
.
coWorkType
==
collaborationTypeKey
.
DOCUMENT
)
{
isDocument
=
true
;
globalUserInfo
.
coWorkType
=
collaborationTypeKey
.
AUDIO
;
}
if
(
collaborationJoinFlg
==
'1'
)
{
if
(
collaborationJoinFlg
==
"1"
)
{
coview_api
.
JoinRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
if
(
isDocument
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
...
...
@@ -183,8 +177,11 @@ $(function() {
android
.
startContentView
(
meetingId
);
}
}
}
else
if
(
collaborationJoinFlg
==
'0'
)
{
coview_api
.
CreateRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
}
else
if
(
collaborationJoinFlg
==
"0"
)
{
coview_api
.
CreateRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
if
(
isDocument
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO 画面を縮小し、会議室に入場する処理
...
...
@@ -192,7 +189,7 @@ $(function() {
meetingId
=
android
.
createContentView
();
}
}
}
else
if
(
collaborationJoinFlg
==
'2'
)
{
}
else
if
(
collaborationJoinFlg
==
"2"
)
{
coview_api
.
JoinRoom
(
globalUserInfo
.
roomId
,
globalUserInfo
.
coWorkType
);
}
Coview_moveToVideoShareArea
();
...
...
@@ -201,21 +198,40 @@ $(function() {
if
(
json
.
resultCode
==
200
)
{
var
coviewInviteMessage
;
if
(
isDocument
)
{
coviewInviteMessage
=
""
+
messageSeperator
+
messageType
.
COMMUNICATIONSTART
+
messageSeperator
+
CHAT_UTIL
.
getCollaborationType
(
collaborationTypeKey
.
DOCUMENT
)
+
messageSeperator
+
meetingId
;
coviewInviteMessage
=
""
+
messageSeperator
+
messageType
.
COMMUNICATIONSTART
+
messageSeperator
+
CHAT_UTIL
.
getCollaborationType
(
collaborationTypeKey
.
DOCUMENT
)
+
messageSeperator
+
meetingId
;
}
else
{
coviewInviteMessage
=
""
+
messageSeperator
+
messageType
.
COMMUNICATIONSTART
+
messageSeperator
+
CHAT_UTIL
.
getCollaborationType
(
globalUserInfo
.
coWorkType
);
coviewInviteMessage
=
""
+
messageSeperator
+
messageType
.
COMMUNICATIONSTART
+
messageSeperator
+
CHAT_UTIL
.
getCollaborationType
(
globalUserInfo
.
coWorkType
);
}
socket
.
emit
(
'createMessage'
,
{
text
:
coviewInviteMessage
},
0
);
socket
.
emit
(
"createMessage"
,
{
text
:
coviewInviteMessage
,
},
0
);
}
else
{
}
break
;
case
"JoinRoomInfoResponse"
:
if
(
json
.
resultCode
==
200
)
{
}
else
{
alert
(
"Not exist sharing call ("
+
json
.
resultCode
+
")
\
nPlease using share menu."
);
alert
(
"Not exist sharing call ("
+
json
.
resultCode
+
")
\
nPlease using share menu."
);
coview_api
.
LeaveRoom
();
$
(
".coview_share_area"
).
hide
();
$
(
"#loadingIndicator"
).
removeClass
(
"full_active"
);
...
...
@@ -243,7 +259,7 @@ $(function() {
CHAT_UI
.
refreshJoinedCollaboration
(
loginIdList
);
break
;
default
:
console
.
log
(
'Unrecognized api'
,
json
);
console
.
log
(
"Unrecognized api"
,
json
);
break
;
}
});
...
...
@@ -257,7 +273,7 @@ function Coview_shareDropdownHide() {
function
Coview_moveToVideoShareArea
()
{
$
(
"#loadingIndicator"
).
addClass
(
"full_active"
);
$
(
".coview_share_area"
).
show
();
$
(
'#collabo_main'
).
removeClass
(
'none'
);
$
(
"#collabo_main"
).
removeClass
(
"none"
);
}
function
Coview_exitCollaboration
(
isDocument
=
false
)
{
...
...
@@ -270,10 +286,13 @@ function Coview_exitCollaboration(isDocument = false) {
}
coview_api
.
LeaveRoom
();
isLeaved
=
true
;
if
(
collaborationJoinFlg
!=
'2'
)
{
CHAT_UI
.
joinRoom
(
CHAT
.
globalLoginParameter
.
roomId
,
CHAT
.
globalLoginParameter
.
name
);
if
(
collaborationJoinFlg
!=
"2"
)
{
CHAT_UI
.
joinRoom
(
CHAT
.
globalLoginParameter
.
roomId
,
CHAT
.
globalLoginParameter
.
name
);
}
else
{
if
(
typeof
(
android
)
!=
"undefined"
)
{
if
(
typeof
android
!=
"undefined"
)
{
android
.
openCommunicationHome
();
}
else
{
webkit
.
messageHandlers
.
openCommunicationHome
.
postMessage
({});
...
...
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