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
ff1f6054
Commit
ff1f6054
authored
Mar 12, 2021
by
Kang Donghun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
チャット開設画面修正
parent
2a599b1d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
36 deletions
+115
-36
public/css/chat.css
+2
-1
public/js/chat-ui.js
+113
-35
No files found.
public/css/chat.css
View file @
ff1f6054
...
...
@@ -98,6 +98,7 @@ img {
float
:
left
;
padding
:
0
0
0
15px
;
width
:
85%
;
padding-top
:
6px
;
}
#room_list
,
#group_list
,
#user_list
,
#select_user_list
{
...
...
@@ -506,7 +507,7 @@ a.article:hover {
padding-left
:
12%
;
}
.userCheckBox
{
margin-left
:
-12
%
;
margin-left
:
80
%
;
}
.nav-item
.dropdown-toggle
::after
{
...
...
public/js/chat-ui.js
View file @
ff1f6054
...
...
@@ -667,7 +667,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
$
(
'#backButton'
).
off
().
on
(
'click'
,
function
()
{
//loadingIndicatorを表示
CHAT_UI
.
showLoadingIndicator
();
socket
.
emit
(
'getGroupList'
,
isInvite
)
CHAT_UI
.
refreshGroupSearch
(
"0"
,
isInvite
);
});
$
(
"#userSelectionConfirmBtn"
).
off
().
on
(
'click'
,
function
(){
...
...
@@ -709,12 +709,9 @@ CHAT_UI.showConfirmView = function(isInvite) {
// ルーム名のURIencodingを行う
//const encodedRoomName = encodeURIComponent(newRoomName);
console
.
log
(
"kdh check IdList = "
+
userIdList
.
toString
);
console
.
log
(
"kdh check newRoomName = "
+
newRoomName
);
//todo android create room api
android
.
createChatRoom
(
"1"
,
userIdList
.
join
(
','
),
newRoomName
);
android
.
createChatRoom
(
"1"
,
userIdList
.
join
(
','
),
newRoomName
);
/*socket.emit('createNewRoom', userIdList, encodedRoomName, function(newRoomId) {
...
...
@@ -916,7 +913,9 @@ CHAT_UI.waitForLoadingImage = function(div, callback) {
}
$
(
'#contactButton'
).
on
(
'click'
,
function
(
event
){
CHAT_UI
.
refreshContactScreen
();
let
isCreate
=
false
;
let
isInvite
=
false
;
CHAT_UI
.
refreshContactScreen
(
isCreate
,
isInvite
);
});
$
(
'#chatButton'
).
on
(
'click'
,
function
(
event
){
...
...
@@ -928,8 +927,8 @@ CHAT_UI.refreshGroupSearch = function(groupId, isInvite) {
$
(
'#pills-contact-tab'
).
tab
(
'show'
);
//画面タイトル設定
let
contactListTitle
=
getLocalizedString
(
"contactListTitle"
);
$
(
'.titleRoomName'
).
text
(
contactLis
tTitle
);
let
memberSelectTitle
=
getLocalizedString
(
"userSearch"
)
$
(
'.titleRoomName'
).
text
(
memberSelec
tTitle
);
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateGroupInfo
(
groupId
);
...
...
@@ -939,19 +938,13 @@ CHAT_UI.refreshGroupSearch = function(groupId, isInvite) {
$
(
'#backButton'
).
show
();
$
(
'#homeButton'
).
hide
();
if
(
isInvite
)
{
$
(
'#newRoomName, .roomListIcon, .chatRoomIcon'
).
hide
();
$
(
'#userSelectionConfirmBtn'
).
show
();
$
(
"#userSelectionConfirmBtn"
).
off
().
on
(
'click'
,
function
(){
CHAT_UI
.
setConfirmButtonEvent
(
isInvite
);
});
}
else
{
$
(
'.roomListIcon, .chatRoomIcon, #newRoomName'
).
hide
();
$
(
'#userSelectionConfirmBtn'
).
show
();
$
(
"#userSelectionConfirmBtn"
).
off
().
on
(
'click'
,
function
(){
CHAT_UI
.
setConfirmButtonEvent
(
isInvite
);
});
}
var
result
=
CHAT_DB
.
getGroupInfo
(
groupId
);
$
(
'#childGroupList'
).
html
(
''
);
...
...
@@ -1015,28 +1008,30 @@ CHAT_UI.refreshGroupSearch = function(groupId, isInvite) {
if
(
IS_ONLINE
==
'true'
)
{
if
(
$
(
this
).
find
(
'.userCheckBox.active'
).
length
>
0
)
{
// remove
console
.
log
(
"kdh check1"
);
CHAT
.
globalSelectedUserList
=
CHAT
.
globalSelectedUserList
.
filter
(
function
(
element
)
{
return
groupUser
.
shopMemberId
!=
element
.
shopMemberId
;
});
}
else
{
// add
console
.
log
(
"kdh check2"
);
CHAT
.
globalSelectedUserList
.
push
({
shopMemberName
:
groupUser
.
shopMemberName
,
shopMemberId
:
groupUser
.
shopMemberId
,
profileImagePath
:
groupUser
.
profileImagePath
});
}
console
.
log
(
"kdh check active"
);
$
(
this
).
find
(
'.userCheckBox'
).
toggleClass
(
'active'
);
if
(
CHAT
.
globalSelectedUserList
.
length
>
0
)
{
console
.
log
(
"kdh check3"
);
$
(
'#userSelectionLength'
).
text
(
CHAT
.
globalSelectedUserList
.
length
);
}
else
{
console
.
log
(
"kdh check4"
);
$
(
'#userSelectionLength'
).
text
(
''
);
}
}
});
let
findObj
=
CHAT
.
globalSelectedUserList
.
find
(
function
(
selectedUser
)
{
return
selectedUser
.
shopMemberId
==
groupUser
.
shopMemberId
;
})
if
(
findObj
)
{
$
(
obj
).
find
(
'.userCheckBox'
).
toggleClass
(
'active'
);
}
$
(
'#userInGroupList'
).
append
(
obj
);
})
...
...
@@ -1049,29 +1044,42 @@ CHAT_UI.refreshGroupSearch = function(groupId, isInvite) {
}
else
{
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateRoomList
();
CHAT_UI
.
refresh
GroupSearch
(
"0"
,
isInvite
);
CHAT_UI
.
refresh
RoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
dismissLoadingIndicator
();
}
}
});
$
(
'#myGroupBtn'
).
off
().
on
(
'click'
,
function
()
{
let
isCreate
=
true
;
CHAT_UI
.
refreshContactScreen
(
isCreate
,
isInvite
);
});
CHAT_UI
.
dismissLoadingIndicator
();
$
(
'.userCheckBox'
).
show
();
$
(
'#myGroupArea'
).
hide
();
$
(
'#groupButtonArea'
).
hide
();
$
(
'#groupButtonArea'
).
show
();
$
(
'#allGroupArea'
).
show
();
$
(
'#myGroupArea'
).
hide
();
}
CHAT_UI
.
refreshContactScreen
=
function
()
{
CHAT_UI
.
refreshContactScreen
=
function
(
isCreate
,
isInvite
)
{
//loadingIndicatorを表示
$
(
'#my_info'
).
html
(
''
);
$
(
'#favorite_list'
).
html
(
''
);
$
(
'#my_group_list'
).
html
(
''
);
CHAT_UI
.
showLoadingIndicator
();
if
(
isCreate
!=
true
)
{
$
(
'#pills-contact-tab'
).
tab
(
'show'
);
//画面タイトル設定
let
contactListTitle
=
getLocalizedString
(
"contactListTitle"
);
$
(
'.titleRoomName'
).
text
(
contactListTitle
);
$
(
'#backButton'
).
hide
();
$
(
'#homeButton'
).
show
();
$
(
'#userSelectionConfirmBtn'
).
hide
();
}
$
(
'#myGroupArea'
).
show
();
$
(
'#allGroupArea'
).
hide
();
// グループの様式を読み込む
const
groupTemplate
=
$
(
'#group-template'
).
html
();
...
...
@@ -1086,6 +1094,7 @@ CHAT_UI.refreshContactScreen = function() {
android
.
updateGroupUser
();
}
if
(
isCreate
!=
true
)
{
var
myInfo
=
CHAT_DB
.
getMyInfo
();
myInfo
.
profileImagePath
=
CHAT
.
getProfileImgUrl
(
myInfo
.
profileUrl
)
...
...
@@ -1114,6 +1123,7 @@ CHAT_UI.refreshContactScreen = function() {
});
$
(
'#my_info'
).
append
(
obj
);
}
var
groupUserList
=
CHAT_DB
.
getMyGroupUsers
();
groupUserList
.
forEach
(
function
(
groupUser
)
{
...
...
@@ -1129,6 +1139,7 @@ CHAT_UI.refreshContactScreen = function() {
// android.updateUserInfo(groupUser.shopMemberId);
// }
console
.
log
(
'click'
);
if
(
isCreate
!=
true
)
{
let
namecardHtml
=
Mustache
.
render
(
userNamecardTemplate
,
{
loginId
:
groupUser
.
shopMemberId
,
profileImage
:
groupUser
.
profileImagePath
,
...
...
@@ -1143,9 +1154,35 @@ CHAT_UI.refreshContactScreen = function() {
});
$
(
'#userNamecard'
).
html
(
namecardObj
);
CHAT_UI
.
showNamecard
(
'userNamecard'
);
}
else
{
if
(
$
(
this
).
find
(
'.userCheckBox.active'
).
length
>
0
)
{
// remove
CHAT
.
globalSelectedUserList
=
CHAT
.
globalSelectedUserList
.
filter
(
function
(
element
)
{
return
groupUser
.
shopMemberId
!=
element
.
shopMemberId
;
});
}
else
{
// add
CHAT
.
globalSelectedUserList
.
push
({
shopMemberName
:
groupUser
.
shopMemberName
,
shopMemberId
:
groupUser
.
shopMemberId
,
profileImagePath
:
groupUser
.
profileImagePath
});
}
$
(
this
).
find
(
'.userCheckBox'
).
toggleClass
(
'active'
);
if
(
CHAT
.
globalSelectedUserList
.
length
>
0
)
{
$
(
'#userSelectionLength'
).
text
(
CHAT
.
globalSelectedUserList
.
length
);
}
else
{
$
(
'#userSelectionLength'
).
text
(
''
);
}
}
});
let
findObj
=
CHAT
.
globalSelectedUserList
.
find
(
function
(
selectedUser
)
{
return
selectedUser
.
shopMemberId
==
groupUser
.
shopMemberId
;
})
if
(
findObj
)
{
$
(
obj
).
find
(
'.userCheckBox'
).
toggleClass
(
'active'
);
}
$
(
'#my_group_list'
).
append
(
obj
);
})
var
favoriteCount
=
0
;
...
...
@@ -1157,6 +1194,10 @@ CHAT_UI.refreshContactScreen = function() {
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
//TODO need onClick Action
if
(
isCreate
!=
true
)
{
}
else
{
CHAT_UI
.
refreshGroupSearch
(
favoriteGroup
.
groupId
,
isInvite
);
}
});
favoriteCount
++
$
(
'#favorite_list'
).
append
(
obj
);
...
...
@@ -1173,7 +1214,34 @@ CHAT_UI.refreshContactScreen = function() {
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
//TODO need onClick Action
if
(
isCreate
!=
true
)
{
}
else
{
if
(
$
(
this
).
find
(
'.userCheckBox.active'
).
length
>
0
)
{
// remove
CHAT
.
globalSelectedUserList
=
CHAT
.
globalSelectedUserList
.
filter
(
function
(
element
)
{
return
favoriteUser
.
shopMemberId
!=
element
.
shopMemberId
;
});
}
else
{
// add
CHAT
.
globalSelectedUserList
.
push
({
shopMemberName
:
favoriteUser
.
shopMemberName
,
shopMemberId
:
favoriteUser
.
shopMemberId
,
profileImagePath
:
favoriteUser
.
profileImagePath
});
}
$
(
this
).
find
(
'.userCheckBox'
).
toggleClass
(
'active'
);
if
(
CHAT
.
globalSelectedUserList
.
length
>
0
)
{
$
(
'#userSelectionL ength'
).
text
(
CHAT
.
globalSelectedUserList
.
length
);
}
else
{
$
(
'#userSelectionLength'
).
text
(
''
);
}
}
});
let
findObj
=
CHAT
.
globalSelectedUserList
.
find
(
function
(
selectedUser
)
{
return
selectedUser
.
shopMemberId
==
favoriteUser
.
shopMemberId
;
})
if
(
findObj
)
{
$
(
obj
).
find
(
'.userCheckBox'
).
toggleClass
(
'active'
);
}
favoriteCount
++
$
(
'#favorite_list'
).
append
(
obj
);
})
...
...
@@ -1185,6 +1253,19 @@ CHAT_UI.refreshContactScreen = function() {
$
(
'#favorite_list'
).
show
();
$
(
'#favorite-seperator'
).
show
();
}
if
(
isCreate
==
true
)
{
$
(
'.userCheckBox'
).
show
();
$
(
'#allGroupBtn'
).
off
().
on
(
'click'
,
function
()
{
CHAT_UI
.
refreshGroupSearch
(
"0"
,
isInvite
);
});
}
else
{
$
(
'.userCheckBox'
).
hide
();
$
(
'#allGroupBtn'
).
off
().
on
(
'click'
,
function
()
{
CHAT_UI
.
refesshAllGroupSearch
(
"0"
);
});
};
CHAT_UI
.
dismissLoadingIndicator
();
}
...
...
@@ -1284,10 +1365,8 @@ CHAT_UI.joinRoom = function(roomId,roomName) {
};
CHAT_UI
.
loadMessages
=
function
(
messages
,
roomId
,
roomName
)
{
$
(
'#messages'
).
html
(
''
);
$
(
'.titleRoomName'
).
text
(
roomName
).
data
(
'roomName'
,
roomName
);
$
(
'#pills-chat-tab'
).
tab
(
'show'
);
$
(
"#message-search"
).
attr
(
"placeholder"
,
getLocalizedString
(
"chat_search_placeholder"
));
let
jQueryMessages
=
$
(
'#messages'
);
// スクロールの変化を防ぐため以前画面の高さを保存する
...
...
@@ -1378,18 +1457,11 @@ CHAT_UI.showUserNamecard = function(shopMemberId) {
// })
}
$
(
'#myGroupBtn'
).
on
(
'click'
,
function
(
e
){
$
(
'#myGroupArea'
).
show
();
$
(
'#allGroupArea'
).
hide
();
});
$
(
'#allGroupBtn'
).
on
(
'click'
,
function
(
e
){
CHAT_UI
.
refesshAllGroupSearch
(
'0'
)
});
CHAT_UI
.
refesshAllGroupSearch
=
function
(
groupId
)
{
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateGroupInfo
(
groupId
);
}
...
...
@@ -1465,6 +1537,12 @@ CHAT_UI.refesshAllGroupSearch = function(groupId) {
$
(
'#userInGroupList'
).
append
(
obj
);
})
$
(
'#myGroupBtn'
).
off
().
on
(
'click'
,
function
(
e
){
$
(
'#myGroupArea'
).
show
();
$
(
'#allGroupArea'
).
hide
();
});
$
(
'.userCheckBox'
).
hide
();
$
(
'#myGroupArea'
).
hide
();
$
(
'#allGroupArea'
).
show
();
...
...
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