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
516bb765
Commit
516bb765
authored
Mar 18, 2021
by
Kang Donghun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'origin/develop_group_search_UI' into origin/develop_createRoom_UI
# Conflicts: # public/js/chat-ui.js
parents
ff1f6054
002226bf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
162 additions
and
34 deletions
+162
-34
public/index.html
+7
-2
public/js/chat-db.js
+10
-0
public/js/chat-ui.js
+145
-32
No files found.
public/index.html
View file @
516bb765
...
@@ -434,13 +434,18 @@
...
@@ -434,13 +434,18 @@
<
div
class
=
"text-center"
>
<
div
class
=
"text-center"
>
<
button
type
=
"button"
class
=
"btn btn-primary"
id
=
"nameCardChatBtn"
onclick
=
"CHAT_UI.startChat('{{loginId}}','{{name}}');"
>
{{
chat
}}
<
/button
>
<
button
type
=
"button"
class
=
"btn btn-primary"
id
=
"nameCardChatBtn"
onclick
=
"CHAT_UI.startChat('{{loginId}}','{{name}}');"
>
{{
chat
}}
<
/button
>
<
button
type
=
"button"
class
=
"btn btn-primary"
id
=
"nameCardVoiceBtn"
onclick
=
"CHAT_UI.startVoice();"
>
{{
voice
}}
<
/button
>
<
button
type
=
"button"
class
=
"btn btn-primary"
id
=
"nameCardVoiceBtn"
onclick
=
"CHAT_UI.startVoice();"
>
{{
voice
}}
<
/button
>
<
button
type
=
"button"
class
=
"btn btn-primary"
id
=
"nameCardFavoriteBtn"
onclick
=
"CHAT_UI.changeFavorite();"
>
{{
favorite
}}
<
/button
>
{{
#
isFavorite
}}
<
button
type
=
"button"
class
=
"btn btn-primary"
onclick
=
"CHAT_UI.changeFavorite();"
>
{{
favorite
}}
<
/button
>
{{
/
isFavorite
}}
{{
^
isFavotire
}}
<
button
type
=
"button"
class
=
"btn btn-primary"
onclick
=
"CHAT_UI.changeFavorite();"
>
{{
favorite
}}
<
/button
>
{{
/
isFavorite
}}
<
/div
>
<
/div
>
</script>
</script>
<script
id=
"message-template"
type=
"text/template"
>
<script
id=
"message-template"
type=
"text/template"
>
<
div
class
=
"incoming_msg"
>
<
div
class
=
"incoming_msg"
>
<
div
class
=
"incoming_msg_img"
>
<
div
class
=
"incoming_msg_img"
>
<
img
src
=
{{{
profileImage
}}}
alt
=
""
>
<
img
src
=
{{{
profileImage
}}}
alt
=
""
onclick
=
"CHAT_UI.makeNameCard({{shopMemberId}});"
>
<
/div
>
<
/div
>
<
div
class
=
"received_msg"
>
<
div
class
=
"received_msg"
>
<
div
class
=
"received_withd_msg"
>
<
div
class
=
"received_withd_msg"
>
...
...
public/js/chat-db.js
View file @
516bb765
...
@@ -69,3 +69,12 @@ CHAT_DB.getGroupInfo = function(groupId) {
...
@@ -69,3 +69,12 @@ CHAT_DB.getGroupInfo = function(groupId) {
return
JSON
.
parse
(
android
.
getGroupInfo
(
groupId
));
return
JSON
.
parse
(
android
.
getGroupInfo
(
groupId
));
}
}
};
};
CHAT_DB
.
getNameCardData
=
function
(
shopMemberId
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getNameCardData
(
shopMemberId
));
}
};
\ No newline at end of file
public/js/chat-ui.js
View file @
516bb765
...
@@ -801,15 +801,8 @@ CHAT_UI.showConfirmView = function(isInvite) {
...
@@ -801,15 +801,8 @@ CHAT_UI.showConfirmView = function(isInvite) {
// ルーム名のtrimmingした後、URIencodingを行う
// ルーム名のtrimmingした後、URIencodingを行う
const
encodedRoomName
=
encodeURIComponent
(
trimmedRoomName
);
const
encodedRoomName
=
encodeURIComponent
(
trimmedRoomName
);
socket
.
emit
(
'createNewRoom'
,
userIdList
,
encodedRoomName
,
function
(
newRoomId
)
{
android
.
createChatRoom
(
"1"
,
userIdList
.
join
(
','
),
encodedRoomName
);
socket
.
emit
(
'joinRoom'
,
newRoomId
,
trimmedRoomName
,
function
()
{
CHAT
.
saveRoomInfo
(
newRoomId
,
trimmedRoomName
);
$
(
'#messages'
).
html
(
''
);
$
(
'.titleRoomName'
).
text
(
trimmedRoomName
).
data
(
'roomName'
,
trimmedRoomName
);
$
(
"#userSelectionDeleteBtn"
).
hide
();
$
(
'#pills-chat-tab'
).
tab
(
'show'
);
});
});
}
}
}
}
}
}
...
@@ -1135,25 +1128,9 @@ CHAT_UI.refreshContactScreen = function(isCreate, isInvite) {
...
@@ -1135,25 +1128,9 @@ CHAT_UI.refreshContactScreen = function(isCreate, isInvite) {
});
});
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
// if (IS_ONLINE == 'true') {
// android.updateUserInfo(groupUser.shopMemberId);
// }
console
.
log
(
'click'
);
console
.
log
(
'click'
);
if
(
isCreate
!=
true
)
{
if
(
isCreate
!=
true
)
{
let
namecardHtml
=
Mustache
.
render
(
userNamecardTemplate
,
{
CHAT_UI
.
makeNameCard
(
groupUser
.
shopMemberId
);
loginId
:
groupUser
.
shopMemberId
,
profileImage
:
groupUser
.
profileImagePath
,
name
:
groupUser
.
shopMemberName
,
groupPathList
:
groupUser
.
groupPathList
,
chat
:
getLocalizedString
(
"chat"
),
voice
:
getLocalizedString
(
"voice"
),
favorite
:
getLocalizedString
(
"addFavorite"
)
});
console
.
log
(
namecardHtml
);
let
namecardObj
=
$
(
jQuery
.
parseHTML
(
namecardHtml
)).
on
(
'click'
,
function
(){
});
$
(
'#userNamecard'
).
html
(
namecardObj
);
CHAT_UI
.
showNamecard
(
'userNamecard'
);
}
else
{
}
else
{
if
(
$
(
this
).
find
(
'.userCheckBox.active'
).
length
>
0
)
{
if
(
$
(
this
).
find
(
'.userCheckBox.active'
).
length
>
0
)
{
// remove
// remove
...
@@ -1172,7 +1149,6 @@ CHAT_UI.refreshContactScreen = function(isCreate, isInvite) {
...
@@ -1172,7 +1149,6 @@ CHAT_UI.refreshContactScreen = function(isCreate, isInvite) {
$
(
'#userSelectionLength'
).
text
(
''
);
$
(
'#userSelectionLength'
).
text
(
''
);
}
}
}
}
});
});
let
findObj
=
CHAT
.
globalSelectedUserList
.
find
(
function
(
selectedUser
)
{
let
findObj
=
CHAT
.
globalSelectedUserList
.
find
(
function
(
selectedUser
)
{
...
@@ -1394,6 +1370,7 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) {
...
@@ -1394,6 +1370,7 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) {
let
html
=
Mustache
.
render
(
template
,
{
let
html
=
Mustache
.
render
(
template
,
{
text
:
message
.
message
,
text
:
message
.
message
,
from
:
message
.
loginId
,
from
:
message
.
loginId
,
shopMemberId
:
message
.
shopMemberId
,
profileImage
:
message
.
profileImagePath
,
profileImage
:
message
.
profileImagePath
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtTime
:
messageTime
.
createdAtTime
createdAtTime
:
messageTime
.
createdAtTime
...
@@ -1462,6 +1439,7 @@ $('#allGroupBtn').on('click', function (e){
...
@@ -1462,6 +1439,7 @@ $('#allGroupBtn').on('click', function (e){
});
});
CHAT_UI
.
refesshAllGroupSearch
=
function
(
groupId
)
{
CHAT_UI
.
refesshAllGroupSearch
=
function
(
groupId
)
{
const
userNamecardTemplate
=
$
(
'#namecard-template'
).
html
();
if
(
IS_ONLINE
==
'true'
)
{
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateGroupInfo
(
groupId
);
android
.
updateGroupInfo
(
groupId
);
}
}
...
@@ -1528,11 +1506,7 @@ CHAT_UI.refesshAllGroupSearch = function(groupId) {
...
@@ -1528,11 +1506,7 @@ CHAT_UI.refesshAllGroupSearch = function(groupId) {
});
});
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
//TODO need onClick Action
CHAT_UI
.
makeNameCard
(
groupUser
.
shopMemberId
);
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateUserInfo
(
groupUser
.
shopMemberId
);
}
});
});
$
(
'#userInGroupList'
).
append
(
obj
);
$
(
'#userInGroupList'
).
append
(
obj
);
...
@@ -1569,3 +1543,141 @@ CHAT_UI.changeFavorite = function () {
...
@@ -1569,3 +1543,141 @@ CHAT_UI.changeFavorite = function () {
console
.
log
(
"FavoriteClick"
);
console
.
log
(
"FavoriteClick"
);
};
};
CHAT_UI
.
removeFavoriteUser
=
function
(
shopMemberId
)
{
//add Android Chat click
console
.
log
(
"removeFU"
);
};
CHAT_UI
.
insertFavoriteUser
=
function
(
shopMemberId
)
{
//add Android Chat click
console
.
log
(
"insertFU"
);
};
CHAT_UI
.
changeFavorite
=
function
()
{
//add Android Chat click
console
.
log
(
"FavoriteClick"
);
};
CHAT_UI
.
makeNameCard
=
function
(
shopMemberId
)
{
console
.
log
(
'makeNameCard Click'
);
var
nameCardInfo
=
CHAT_DB
.
getNameCardData
(
shopMemberId
);
console
.
log
(
nameCardInfo
);
const
userNamecardTemplate
=
$
(
'#namecard-template'
).
html
();
let
namecardHtml
=
Mustache
.
render
(
userNamecardTemplate
,
{
loginId
:
nameCardInfo
.
shopMemberId
,
profileImage
:
nameCardInfo
.
profileImagePath
,
name
:
nameCardInfo
.
shopMemberName
,
groupPathList
:
nameCardInfo
.
groupPathList
,
chat
:
getLocalizedString
(
"chat"
),
voice
:
getLocalizedString
(
"voice"
),
favorite
:
getLocalizedString
(
"addFavorite"
)
});
let
namecardObj
=
$
(
jQuery
.
parseHTML
(
namecardHtml
)).
on
(
'click'
,
function
(){
});
$
(
'#userNamecard'
).
html
(
namecardObj
);
CHAT_UI
.
showNamecard
(
'userNamecard'
);
};
CHAT_UI
.
makeNameCardInChatRoom
=
function
(
chatRoomId
)
{
console
.
log
(
'makeNameCard Click'
);
var
nameCardInfo
=
CHAT_DB
.
getNameCardData
(
chatRoomId
);
console
.
log
(
nameCardInfo
);
const
userNamecardTemplate
=
$
(
'#namecard-template'
).
html
();
let
namecardHtml
=
Mustache
.
render
(
userNamecardTemplate
,
{
loginId
:
nameCardInfo
.
shopMemberId
,
profileImage
:
nameCardInfo
.
profileImagePath
,
name
:
nameCardInfo
.
shopMemberName
,
groupPathList
:
nameCardInfo
.
groupPathList
,
chat
:
getLocalizedString
(
"chat"
),
voice
:
getLocalizedString
(
"voice"
),
favorite
:
getLocalizedString
(
"addFavorite"
)
});
let
namecardObj
=
$
(
jQuery
.
parseHTML
(
namecardHtml
)).
on
(
'click'
,
function
(){
});
$
(
'#userNamecard'
).
html
(
namecardObj
);
CHAT_UI
.
showNamecard
(
'userNamecard'
);
};
CHAT_UI
.
refesshAllGroupSearchFaborite
=
function
(
groupId
)
{
const
userNamecardTemplate
=
$
(
'#namecard-template'
).
html
();
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateGroupInfo
(
groupId
);
}
$
(
'#rootGroupBtn'
).
off
();
$
(
'#parentGroupBtn'
).
off
();
var
result
=
CHAT_DB
.
getGroupInfo
(
groupId
);
$
(
'#childGroupList'
).
html
(
''
);
$
(
'#userInGroupList'
).
html
(
''
);
$
(
'#groupPathArea'
).
html
(
''
);
if
(
typeof
result
.
parentGroupId
!==
'undefined'
)
{
console
.
log
(
result
.
parentGroupId
);
$
(
'#parentGroupBtn'
).
on
(
'click'
,
function
()
{
CHAT_UI
.
refesshAllGroupSearch
(
result
.
parentGroupId
);
});
}
if
(
typeof
result
.
rootGroupId
!==
'undefined'
)
{
console
.
log
(
result
.
rootGroupId
);
$
(
'#rootGroupBtn'
).
on
(
'click'
,
function
()
{
CHAT_UI
.
refesshAllGroupSearch
(
result
.
rootGroupId
);
});
}
const
groupNaviTemplate
=
$
(
'#group-navigater-template'
).
html
();
var
groupCount
=
0
;
result
.
groupPathList
.
forEach
(
function
(
groupPath
)
{
if
(
groupCount
!=
0
)
{
$
(
'#groupPathArea'
).
append
(
"<label class='group-navigater'> > </label>"
);
}
let
html
=
Mustache
.
render
(
groupNaviTemplate
,
{
name
:
groupPath
.
groupName
,
id
:
groupPath
.
groupId
});
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
CHAT_UI
.
refesshAllGroupSearch
(
groupPath
.
groupId
);
});
groupCount
++
;
$
(
'#groupPathArea'
).
append
(
obj
);
})
const
groupTemplate
=
$
(
'#group-template'
).
html
();
result
.
childGroupList
.
forEach
(
function
(
childGroup
)
{
let
html
=
Mustache
.
render
(
groupTemplate
,
{
name
:
childGroup
.
groupName
,
id
:
childGroup
.
groupId
});
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
CHAT_UI
.
refesshAllGroupSearch
(
childGroup
.
groupId
);
});
$
(
'#childGroupList'
).
append
(
obj
);
})
const
userTemplate
=
$
(
'#user-template'
).
html
();
result
.
groupUserList
.
forEach
(
function
(
groupUser
)
{
groupUser
.
profileImagePath
=
CHAT
.
getProfileImgUrl
(
groupUser
.
profileUrl
)
let
html
=
Mustache
.
render
(
userTemplate
,
{
id
:
groupUser
.
shopMemberId
,
profileImage
:
groupUser
.
profileImagePath
,
name
:
groupUser
.
shopMemberName
});
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
CHAT_UI
.
makeNameCard
(
groupUser
.
shopMemberId
);
});
$
(
'#userInGroupList'
).
append
(
obj
);
})
$
(
'#myGroupArea'
).
hide
();
$
(
'#allGroupArea'
).
show
();
}
\ No newline at end of file
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