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
0b9baea9
Commit
0b9baea9
authored
Feb 24, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
コードレビュー対応
parent
67e11f79
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
88 additions
and
23 deletions
+88
-23
public/css/chat.css
+20
-0
public/index.html
+26
-4
public/js/chat-ui.js
+25
-11
public/js/chat-websocket.js
+6
-8
public/js/chat.js
+0
-0
public/js/constant.js
+5
-0
public/js/language_en.js
+2
-0
public/js/language_ja.js
+2
-0
public/js/language_ko.js
+2
-0
public/js/libs/collapsible.js
+0
-0
No files found.
public/css/chat.css
View file @
0b9baea9
...
...
@@ -706,3 +706,23 @@ a.article:hover {
.chat-list-type-btn
{
width
:
30%
;
}
#my_info
>
div
>
div
{
padding-left
:
5%
;
}
#favorite_list
>
div
>
div
{
padding-left
:
5%
;
}
#my_group_list
>
div
>
div
{
padding-left
:
5%
;
}
.contact-seperator
{
width
:
100%
;
background-color
:
#095395
!important
;
color
:
white
;
margin-bottom
:
0px
;
}
public/index.html
View file @
0b9baea9
...
...
@@ -234,14 +234,14 @@
</div>
<div
id=
"my_info"
class=
"inbox_user row"
>
</div>
<div
class=
"collapsible-content"
>
<label
class=
"contact-seperator"
id=
"favorite-seperator"
>
Favorite
</label>
<div
id=
"favorite_list"
class=
"inbox_user row"
>
</div>
</div>
<div
class=
"collapsible-content"
>
<label
class=
"contact-seperator"
id=
"mygroup-seperator"
>
MY GROUP
</label>
<div
id=
"my_group_list"
class=
"inbox_user row"
>
</div>
</div>
</div>
</div>
...
...
@@ -458,6 +458,28 @@
<
/div
>
<
/div
>
</script>
<script
id=
"favorite-user-template"
type=
"text/template"
>
<
div
class
=
"user_list col-12"
data
-
name
=
"{{name}}"
>
<
div
class
=
"user_people"
>
<
div
class
=
"user_img"
>
<
img
src
=
"{{profileImage}}"
alt
=
""
>
<
/div
>
<
div
class
=
"user_ib"
>
<
h5
>
{{
name
}}
<
/h5
>
<
p
>
{{
info
}}
<
/p
>
<
/div
>
<
div
class
=
"squareBox userCheckBox"
data
-
name
=
"{{name}}"
data
-
id
=
"{{id}}"
>
<
div
class
=
"squareBoxContent"
>
<
div
>
<
span
>
<
i
class
=
"fas fa-check"
><
/i
>
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
</script>
<script
src=
"./socket.io/dist/socket.io.js"
></script>
<script
src=
"./js/libs/socket.io.js"
></script>
<script
src=
"./js/libs/jquery-3.3.1.min.js"
></script>
...
...
public/js/chat-ui.js
View file @
0b9baea9
...
...
@@ -133,7 +133,7 @@ $('#room-search').on('input', function(event) {
}
else
{
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateRoomList
();
CHAT_UI
.
refreshRoomList
(
"1"
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
dismissLoadingIndicator
();
}
}
...
...
@@ -401,7 +401,7 @@ $('a[data-toggle="pill"]').on('show.bs.tab', function (e) {
android
.
updateRoomList
();
});
}
CHAT_UI
.
refreshRoomList
(
"1"
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
dismissLoadingIndicator
();
});
console
.
log
(
"show #pills-chat"
)
...
...
@@ -826,6 +826,9 @@ CHAT_UI.htmlElementTextInitialize = function(languageCode) {
$
(
"#dmBtn"
).
text
(
getLocalizedString
(
"directMessageChatRoom"
))
$
(
"#groupBtn"
).
text
(
getLocalizedString
(
"groupChatRoom"
))
$
(
"#favorite-seperator"
).
text
(
getLocalizedString
(
"favorite"
))
$
(
"#mygroup-seperator"
).
text
(
getLocalizedString
(
"mygroup"
))
}
// 画像の読み込みが全て終わったタイミングでコールバック実行
...
...
@@ -854,6 +857,10 @@ $('#contactButton').on('click', function(event){
CHAT_UI
.
refreshContactScreen
();
});
$
(
'#chatButton'
).
on
(
'click'
,
function
(
event
){
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
});
CHAT_UI
.
refreshContactScreen
=
function
()
{
//loadingIndicatorを表示
$
(
'#my_info'
).
html
(
''
);
...
...
@@ -896,7 +903,9 @@ CHAT_UI.refreshContactScreen = function() {
$
(
'#my_info'
).
append
(
obj
);
var
groupUserList
=
CHAT_DB
.
getMyGroupUsers
();
console
.
log
(
groupUserList
);
groupUserList
.
forEach
(
function
(
groupUser
)
{
groupUser
.
profileImagePath
=
CHAT
.
getProfileImgUrl
(
groupUser
.
profileUrl
)
let
html
=
Mustache
.
render
(
userTemplate
,
{
id
:
groupUser
.
shopMemberId
,
profileImage
:
groupUser
.
profileImagePath
,
...
...
@@ -905,12 +914,11 @@ CHAT_UI.refreshContactScreen = function() {
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
//TODO need onClick Action
console
.
log
(
'groupUserClick'
);
});
$
(
'#my_group_list'
).
append
(
obj
);
})
var
favoriteCount
=
0
;
var
favoriteGroupList
=
CHAT_DB
.
getFavoriteGroups
();
favoriteGroupList
.
forEach
(
function
(
favoriteGroup
)
{
let
html
=
Mustache
.
render
(
groupTemplate
,
{
...
...
@@ -919,14 +927,14 @@ CHAT_UI.refreshContactScreen = function() {
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
//TODO need onClick Action
console
.
log
(
'groupClick'
);
});
favoriteCount
++
$
(
'#favorite_list'
).
append
(
obj
);
})
var
favoriteUserList
=
CHAT_DB
.
getFavoriteUsers
();
favoriteUserList
.
forEach
(
function
(
favoriteUser
)
{
favoriteUser
.
profileImagePath
=
CHAT
.
getProfileImgUrl
(
favoriteUser
.
profileUrl
)
let
html
=
Mustache
.
render
(
groupTemplate
,
{
id
:
favoriteUser
.
shopMemberId
,
profileImage
:
favoriteUser
.
profileImagePath
,
...
...
@@ -935,12 +943,18 @@ CHAT_UI.refreshContactScreen = function() {
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
(){
//TODO need onClick Action
console
.
log
(
'userClick'
);
});
favoriteCount
++
$
(
'#favorite_list'
).
append
(
obj
);
})
if
(
favoriteCount
==
0
)
{
$
(
'#favorite_list'
).
hide
();
$
(
'#favorite-seperator'
).
hide
();
}
else
{
$
(
'#favorite_list'
).
show
();
$
(
'#favorite-seperator'
).
show
();
}
console
.
log
(
'LOAD DONE CONTACT SCREEN'
);
CHAT_UI
.
dismissLoadingIndicator
();
}
...
...
@@ -1035,7 +1049,6 @@ CHAT_UI.joinRoom = function(roomId,roomName) {
android
.
updateMessages
(
roomId
);
socket
.
emit
(
'joinRoom'
,
roomId
,
roomName
,
function
()
{
});
}
else
{
}
var
messages
=
CHAT_DB
.
getMessages
(
roomId
);
console
.
log
(
messages
);
...
...
@@ -1110,9 +1123,9 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) {
$
(
'#dmBtn'
).
on
(
'click'
,
function
(
e
){
CHAT_UI
.
refreshRoomList
(
"1"
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
});
$
(
'#groupBtn'
).
on
(
'click'
,
function
(
e
){
CHAT_UI
.
refreshRoomList
(
"0"
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
GROUP
);
});
\ No newline at end of file
public/js/chat-websocket.js
View file @
0b9baea9
...
...
@@ -7,33 +7,31 @@ function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnlin
IS_MOBILE
=
isMobile
;
IS_ONLINE
=
isOnline
;
connectSocket
();
};
};
android
.
getGlobalParameter
();
function
connectSocket
()
{
CHAT_UI
.
dismissLoadingIndicator
();
if
(
IS_ONLINE
==
'true'
)
{
console
.
log
(
'isOnline'
);
socket
=
io
(
CHAT_SERVER_URL
);
console
.
log
(
'insOnline'
);
setSocketAction
();
android
.
updateRoomList
();
CHAT_UI
.
refreshRoomList
(
"1"
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
dismissLoadingIndicator
();
$
(
'#createChatRoom'
).
show
();
}
else
{
console
.
log
(
'i
n
sOffline'
);
console
.
log
(
'isOffline'
);
//オフラインの場合、DBからルーム一覧を表示。
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOSの場合
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
console
.
log
(
'insAnd'
);
//$('.overlay').removeClass('active undismissable');
// loadingIndicatorを表示
CHAT_UI
.
showLoadingIndicator
();
android
.
getLoginParameter
();
console
.
log
(
'init'
)
CHAT_UI
.
refreshRoomList
(
"1"
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
dismissLoadingIndicator
();
$
(
'#createChatRoom'
).
show
();
}
...
...
@@ -400,7 +398,7 @@ function setSocketAction () {
}
else
{
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateRoomList
();
CHAT_UI
.
refreshRoomList
(
"1"
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
dismissLoadingIndicator
();
}
}
...
...
public/js/chat.js
View file @
0b9baea9
public/js/constant.js
View file @
0b9baea9
...
...
@@ -20,3 +20,8 @@ const messageType = {
const
userAPICmd
=
{
MYINFO
:
9
}
const
chatRoomType
=
{
DM
:
"1"
,
GROUP
:
"0"
}
public/js/language_en.js
View file @
0b9baea9
...
...
@@ -56,5 +56,7 @@ $.lang.en = {
"contactListTitle"
:
"Contact"
,
"contactSearch"
:
"Contact search"
,
"directMessageChatRoom"
:
"DM"
,
"favorite"
:
"Favorite List"
,
"mygroup"
:
"My Group"
,
"groupChatRoom"
:
"Group"
}
public/js/language_ja.js
View file @
0b9baea9
...
...
@@ -56,5 +56,7 @@ $.lang.ja = {
"contactListTitle"
:
"コンタクト"
,
"contactSearch"
:
"コンタクト検索"
,
"directMessageChatRoom"
:
"DM"
,
"favorite"
:
"お気に入りリスト"
,
"mygroup"
:
"マイグループ"
,
"groupChatRoom"
:
"グループ"
}
public/js/language_ko.js
View file @
0b9baea9
...
...
@@ -56,5 +56,7 @@ $.lang.ko = {
"contactListTitle"
:
"연락처"
,
"contactSearch"
:
"연락처 검색"
,
"directMessageChatRoom"
:
"DM"
,
"favorite"
:
"즐겨찾기리스트"
,
"mygroup"
:
"마이그룹"
,
"groupChatRoom"
:
"그룹"
}
public/js/libs/collapsible.js
View file @
0b9baea9
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