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
6f694ccd
Commit
6f694ccd
authored
Mar 24, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
コードレビュー対応。
parent
78f28fa1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
public_new/js/chat-db.js
+0
-0
public_new/js/chat-websocket.js
+15
-15
No files found.
public_new/js/chat-db.js
View file @
6f694ccd
public_new/js/chat-websocket.js
View file @
6f694ccd
...
@@ -45,7 +45,7 @@ function setSocketAction () {
...
@@ -45,7 +45,7 @@ function setSocketAction () {
CHAT_UI
.
dismissLoadingIndicator
();
CHAT_UI
.
dismissLoadingIndicator
();
});
});
socket
.
on
(
'disconnect'
,
function
()
{
socket
.
on
(
'disconnect'
,
function
()
{
console
.
log
(
'disconnect'
);
console
.
log
(
'disconnect'
);
//socketが切断されたら黒画面で画面を更新する
//socketが切断されたら黒画面で画面を更新する
$
(
'.overlay'
).
addClass
(
'active undismissable'
);
$
(
'.overlay'
).
addClass
(
'active undismissable'
);
...
@@ -53,7 +53,7 @@ function setSocketAction () {
...
@@ -53,7 +53,7 @@ function setSocketAction () {
CHAT_UI
.
dismissLoadingIndicator
();
CHAT_UI
.
dismissLoadingIndicator
();
});
});
socket
.
on
(
'connect_error'
,
function
()
{
socket
.
on
(
'connect_error'
,
function
()
{
console
.
log
(
'connect_error'
);
console
.
log
(
'connect_error'
);
CHAT_UI
.
dismissLoadingIndicator
();
CHAT_UI
.
dismissLoadingIndicator
();
});
});
...
@@ -171,7 +171,7 @@ function setSocketAction () {
...
@@ -171,7 +171,7 @@ function setSocketAction () {
// New Message
// New Message
// #36170
// #36170
socket
.
on
(
'newMessage'
,
function
(
message
,
roomId
,
roomName
)
{
socket
.
on
(
'newMessage'
,
function
(
message
,
roomId
,
roomName
)
{
let
template
=
$
(
'#message-template'
).
html
();
let
template
=
$
(
'#message-template'
).
html
();
if
(
message
.
id
===
socket
.
id
)
{
if
(
message
.
id
===
socket
.
id
)
{
// ユーザーが送信したメッセージの場合、自分のメッセージ様式を適用して表示する
// ユーザーが送信したメッセージの場合、自分のメッセージ様式を適用して表示する
...
@@ -204,7 +204,7 @@ function setSocketAction () {
...
@@ -204,7 +204,7 @@ function setSocketAction () {
});
});
// Notification
// Notification
socket
.
on
(
'newNotification'
,
function
(
keyword
,
event
){
socket
.
on
(
'newNotification'
,
function
(
keyword
,
event
)
{
var
notificationString
=
getLocalizedString
(
event
,
keyword
)
var
notificationString
=
getLocalizedString
(
event
,
keyword
)
$
(
'#messageNotification'
).
finish
().
text
(
notificationString
).
delay
(
500
).
slideDown
().
delay
(
1500
).
slideUp
();
$
(
'#messageNotification'
).
finish
().
text
(
notificationString
).
delay
(
500
).
slideDown
().
delay
(
1500
).
slideUp
();
});
});
...
@@ -280,13 +280,13 @@ function setSocketAction () {
...
@@ -280,13 +280,13 @@ function setSocketAction () {
// Update User List In Room
// Update User List In Room
// サイドバーのユーザーリストアップデート。
// サイドバーのユーザーリストアップデート。
socket
.
on
(
'updateUserList'
,
function
(
users
,
onlineUsers
){
socket
.
on
(
'updateUserList'
,
function
(
users
,
onlineUsers
)
{
if
(
users
.
length
>
0
)
{
if
(
users
.
length
>
0
)
{
$
(
'#users'
).
removeData
();
$
(
'#users'
).
removeData
();
$
(
'#users'
).
data
(
users
);
$
(
'#users'
).
data
(
users
);
}
else
{
}
else
{
const
data
=
$
(
'#users'
).
data
();
const
data
=
$
(
'#users'
).
data
();
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
){
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
)
{
users
=
Object
.
keys
(
data
).
map
(
function
(
key
)
{
users
=
Object
.
keys
(
data
).
map
(
function
(
key
)
{
return
data
[
key
];
return
data
[
key
];
});
});
...
@@ -297,7 +297,7 @@ function setSocketAction () {
...
@@ -297,7 +297,7 @@ function setSocketAction () {
// ユーザーリストを入れる前にユーザー招待ボタンを入れてくれる。
// ユーザーリストを入れる前にユーザー招待ボタンを入れてくれる。
let
inviteString
=
getLocalizedString
(
"inviteUsersButton"
)
let
inviteString
=
getLocalizedString
(
"inviteUsersButton"
)
ul
.
append
(
$
(
'<li/>'
).
append
(
`<a>
${
inviteString
}
<i class='fa fa-user-plus'><i/></a>`
).
on
(
'click'
,
function
(
event
){
ul
.
append
(
$
(
'<li/>'
).
append
(
`<a>
${
inviteString
}
<i class='fa fa-user-plus'><i/></a>`
).
on
(
'click'
,
function
(
event
)
{
$
(
'#dismiss'
).
click
();
$
(
'#dismiss'
).
click
();
// loadingIndicatorを表示
// loadingIndicatorを表示
CHAT_UI
.
showLoadingIndicator
();
CHAT_UI
.
showLoadingIndicator
();
...
@@ -321,7 +321,7 @@ function setSocketAction () {
...
@@ -321,7 +321,7 @@ function setSocketAction () {
});
});
// Update Group List(Invite)
// Update Group List(Invite)
socket
.
on
(
'refreshGroupList'
,
function
(
groups
,
isInvite
){
socket
.
on
(
'refreshGroupList'
,
function
(
groups
,
isInvite
)
{
$
(
'#group_list'
).
html
(
''
);
$
(
'#group_list'
).
html
(
''
);
const
template
=
$
(
'#group-template'
).
html
();
const
template
=
$
(
'#group-template'
).
html
();
if
(
groups
.
length
===
0
)
{
if
(
groups
.
length
===
0
)
{
...
@@ -359,14 +359,14 @@ function setSocketAction () {
...
@@ -359,14 +359,14 @@ function setSocketAction () {
$
(
'.titleRoomName'
).
text
(
memberSelectTitle
);
$
(
'.titleRoomName'
).
text
(
memberSelectTitle
);
$
(
'#newRoomName, .roomListIcon, .chatRoomIcon'
).
hide
();
$
(
'#newRoomName, .roomListIcon, .chatRoomIcon'
).
hide
();
$
(
'#userSelectionConfirmBtn'
).
show
();
$
(
'#userSelectionConfirmBtn'
).
show
();
$
(
"#userSelectionConfirmBtn"
).
off
().
on
(
'click'
,
function
(){
$
(
"#userSelectionConfirmBtn"
).
off
().
on
(
'click'
,
function
()
{
CHAT_UI
.
setConfirmButtonEvent
(
isInvite
);
CHAT_UI
.
setConfirmButtonEvent
(
isInvite
);
});
});
}
else
{
}
else
{
$
(
'.titleRoomName'
).
text
(
memberSelectTitle
);
$
(
'.titleRoomName'
).
text
(
memberSelectTitle
);
$
(
'.roomListIcon, .chatRoomIcon, #newRoomName'
).
hide
();
$
(
'.roomListIcon, .chatRoomIcon, #newRoomName'
).
hide
();
$
(
'#userSelectionConfirmBtn'
).
show
();
$
(
'#userSelectionConfirmBtn'
).
show
();
$
(
"#userSelectionConfirmBtn"
).
off
().
on
(
'click'
,
function
(){
$
(
"#userSelectionConfirmBtn"
).
off
().
on
(
'click'
,
function
()
{
CHAT_UI
.
setConfirmButtonEvent
(
isInvite
);
CHAT_UI
.
setConfirmButtonEvent
(
isInvite
);
});
});
}
}
...
@@ -394,7 +394,7 @@ function setSocketAction () {
...
@@ -394,7 +394,7 @@ function setSocketAction () {
// Update User List(Invite)
// Update User List(Invite)
// #36170
// #36170
socket
.
on
(
'refreshUserListInGroup'
,
function
(
users
,
groupId
,
isInvite
){
socket
.
on
(
'refreshUserListInGroup'
,
function
(
users
,
groupId
,
isInvite
)
{
$
(
'#user_list'
).
html
(
''
);
$
(
'#user_list'
).
html
(
''
);
const
template
=
$
(
'#user-template'
).
html
();
const
template
=
$
(
'#user-template'
).
html
();
...
@@ -415,7 +415,7 @@ function setSocketAction () {
...
@@ -415,7 +415,7 @@ function setSocketAction () {
});
});
// クリックするとactive クラスを与え、チェック表示を出させる。
// クリックするとactive クラスを与え、チェック表示を出させる。
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
()
{
if
(
$
(
this
).
find
(
'.userCheckBox.active'
).
length
>
0
)
{
if
(
$
(
this
).
find
(
'.userCheckBox.active'
).
length
>
0
)
{
// remove
// remove
CHAT
.
globalSelectedUserList
=
CHAT
.
globalSelectedUserList
.
filter
(
function
(
element
)
{
CHAT
.
globalSelectedUserList
=
CHAT
.
globalSelectedUserList
.
filter
(
function
(
element
)
{
...
@@ -458,7 +458,7 @@ function setSocketAction () {
...
@@ -458,7 +458,7 @@ function setSocketAction () {
socket
.
emit
(
'getGroupList'
,
isInvite
)
socket
.
emit
(
'getGroupList'
,
isInvite
)
});
});
$
(
"#userSelectionConfirmBtn"
).
off
().
on
(
'click'
,
function
(){
$
(
"#userSelectionConfirmBtn"
).
off
().
on
(
'click'
,
function
()
{
// loadingIndicatorを表示
// loadingIndicatorを表示
CHAT_UI
.
showLoadingIndicator
();
CHAT_UI
.
showLoadingIndicator
();
CHAT_UI
.
setConfirmButtonEvent
(
isInvite
);
CHAT_UI
.
setConfirmButtonEvent
(
isInvite
);
...
@@ -475,7 +475,7 @@ function setSocketAction () {
...
@@ -475,7 +475,7 @@ function setSocketAction () {
/* Show Error Log */
/* Show Error Log */
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
socket
.
on
(
'showServerError'
,
function
(
message
)
{
socket
.
on
(
'showServerError'
,
function
(
message
)
{
// #36174
// #36174
// #36215
// #36215
...
@@ -501,7 +501,7 @@ function setSocketAction () {
...
@@ -501,7 +501,7 @@ function setSocketAction () {
});
});
CHAT_UI
.
dismissLoadingIndicator
();
CHAT_UI
.
dismissLoadingIndicator
();
if
(
message
==
"Room not found"
){
if
(
message
==
"Room not found"
)
{
CHAT
.
saveRoomInfo
();
CHAT
.
saveRoomInfo
();
}
}
});
});
...
...
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