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
4c630ccd
Commit
4c630ccd
authored
Mar 30, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
バグ修正、チャットUI
parent
5cb24459
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
93 additions
and
37 deletions
+93
-37
public_new/chat.html
+6
-4
public_new/chat_room.html
+1
-0
public_new/contact.html
+1
-1
public_new/js/chat-db.js
+3
-2
public_new/js/chat-room.js
+20
-0
public_new/js/chat-ui.js
+5
-5
public_new/js/chat.js
+50
-20
public_new/js/constant.js
+2
-1
public_new/js/contact.js
+3
-2
public_new/js/language_ja.js
+1
-1
public_new/template/template_user_name_card.html
+1
-1
No files found.
public_new/chat.html
View file @
4c630ccd
...
...
@@ -45,16 +45,16 @@
<!-- ユーザー検索 -->
<div
class=
"search_form"
>
<form>
<input
type=
"search"
name=
"search"
placeholder=
"
ユーザー
検索"
>
<input
type=
"search"
name=
"search"
placeholder=
"
ルーム
検索"
>
<span
class=
"src_icon"
></span>
<a
href=
"#"
class=
"cancel none"
>
キャンセル
</a>
</form>
</div>
<!-- タブ -->
<div
class=
"content tabs"
>
<input
id=
"tabGroup"
type=
"radio"
name=
"tab_item"
>
<input
id=
"tabGroup"
type=
"radio"
name=
"tab_item"
checked
>
<label
class=
"tab_item"
for=
"tabGroup"
>
グループ
</label>
<input
id=
"tabDM"
type=
"radio"
name=
"tab_item"
checked
>
<input
id=
"tabDM"
type=
"radio"
name=
"tab_item"
>
<label
class=
"tab_item"
for=
"tabDM"
>
DM
</label>
<div
class=
"tab_content"
id=
"tab1_content"
>
<div
class=
"chat_list"
id=
"groupChatList"
>
...
...
@@ -68,6 +68,8 @@
<!-- オーバーレイ -->
<div
class=
"chat_list"
>
<ul
class=
"overlay_src_msg"
>
</ul>
</div>
</main>
...
...
@@ -139,7 +141,7 @@
IS_MOBILE
=
isMobile
;
IS_ONLINE
=
isOnline
;
console
.
log
(
"onChat"
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
GROUP
);
};
</script>
</body>
...
...
public_new/chat_room.html
View file @
4c630ccd
...
...
@@ -189,6 +189,7 @@
<script
src=
"./js/chat-util.js"
></script>
<script
src=
"./js/chat-db.js"
></script>
<script
src=
"./js/chat-websocket.js"
></script>
<script
src=
"./js/chat-room.js"
></script>
<script>
String
.
prototype
.
replaceAll
=
function
(
org
,
dest
)
{
return
this
.
split
(
org
).
join
(
dest
);
...
...
public_new/contact.html
View file @
4c630ccd
...
...
@@ -51,7 +51,7 @@
<div
class=
"content chat_list"
>
<ul
class=
"p-0 chat_make_room_list"
>
<li
class=
"d-flex align-items-center"
>
<a
href=
"#"
data-toggle=
"modal"
data-target=
"#myNameCard"
style=
"width: 100%;"
>
<a
href=
"#"
style=
"width: 100%;"
>
<div
class=
"chat_item d-flex flex-row align-items-center"
>
<div
class=
"chat_item_l"
>
<div
class=
"thubnail"
>
...
...
public_new/js/chat-db.js
View file @
4c630ccd
...
...
@@ -3,12 +3,12 @@ var CHAT_DB = {};
//ロカールDBからルーム一覧情報を取得
CHAT_DB
.
getRoomList
=
function
(
roomType
)
{
CHAT_DB
.
getRoomList
=
function
(
roomType
,
keyWord
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getRoomList
(
roomType
));
return
JSON
.
parse
(
android
.
getRoomList
(
roomType
,
keyWord
));
}
};
...
...
@@ -75,6 +75,7 @@ CHAT_DB.getNameCardData = function(shopMemberId) {
//TODO IOS処理追加必要
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
console
.
log
(
android
.
getNameCardData
(
shopMemberId
));
return
JSON
.
parse
(
android
.
getNameCardData
(
shopMemberId
));
}
};
...
...
public_new/js/chat-room.js
0 → 100644
View file @
4c630ccd
var
lastscrollvalue
;
window
.
onscroll
=
function
()
{
console
.
log
(
'scroll'
);
var
a
=
$
(
'#messages'
);
if
(
lastscrollvalue
==
undefined
)
{
console
.
log
(
'first'
)
lastscrollvalue
=
a
.
scrollTop
;
// sets lastscrollvalue
}
else
if
(
a
.
scrollTop
>
lastscrollvalue
)
{
console
.
log
(
'up'
);
// downscroll rules will be here
lastscrollvalue
=
a
.
scrollTop
;
}
else
if
(
a
.
scrollTop
<
lastscrollvalue
)
{
console
.
log
(
'down'
);
// upscroll rules will be here
lastscrollvalue
=
a
.
scrollTop
;
}
}
\ No newline at end of file
public_new/js/chat-ui.js
View file @
4c630ccd
...
...
@@ -1018,7 +1018,7 @@ CHAT_UI.refreshRoomList = function(roomType) {
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateRoomList
();
}
var
rooms
=
CHAT_DB
.
getRoomList
(
roomType
);
var
rooms
=
CHAT_DB
.
getRoomList
(
roomType
,
null
);
CHAT
.
globalIsInvite
=
false
;
activeRoomId
=
null
;
console
.
log
(
rooms
);
...
...
@@ -1286,7 +1286,7 @@ CHAT_UI.insertFavoriteGroup = function(groupId) {
//全グループ検索画面表示。
CHAT_UI
.
refreshAllGroupSearch
=
function
(
groupId
)
{
$
(
'#userNameCard'
).
modal
(
'hide'
);
$
(
'.cancel'
).
addClass
(
'none'
);
$
(
'.search_form input'
).
removeClass
(
'focus'
);
$
(
'.search_form input'
).
val
(
''
);
...
...
@@ -1399,16 +1399,16 @@ CHAT_UI.startVoice = function() {
CHAT_UI
.
makeNameCard
=
function
(
shopMemberId
)
{
var
nameCardInfo
=
CHAT_DB
.
getNameCardData
(
shopMemberId
);
console
.
log
(
nameCardInfo
);
var
namecardTemplate
;
$
.
get
({
url
:
"./template/template_user_name_card.html"
,
async
:
false
}
,
function
(
text
)
{
namecardTemplate
=
text
;
});
nameCardInfo
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
nameCardInfo
.
profileUrl
);
let
namecardHtml
=
Mustache
.
render
(
namecardTemplate
,
{
shopMemberId
:
nameCardInfo
.
shopMemberId
,
profile
Image
:
nameCardInfo
.
profileImagePath
,
profile
Url
:
nameCardInfo
.
profileUrl
,
name
:
nameCardInfo
.
shopMemberName
,
groupPathList
:
nameCardInfo
.
groupPathList
,
chat
:
getLocalizedString
(
"chat"
),
...
...
public_new/js/chat.js
View file @
4c630ccd
...
...
@@ -275,19 +275,6 @@ CHAT.leaveRoom = function() {
});
}
CHAT
.
requestMyinfo
=
function
()
{
jQuery
.
ajax
({
async
:
true
,
url
:
CMS_SERVER_URL
+
"/chatapi/user?sid="
+
CHAT
.
globalLoginParameter
.
sid
+
"&cmd="
+
userAPICmd
.
MYINFO
,
type
:
"get"
,
processData
:
false
,
contentType
:
false
}).
done
(
function
(
res
)
{
console
.
log
(
res
);
return
res
;
})
}
$
(
function
()
{
// ルーム開設メンバー数カウント
$
(
'input:checkbox'
).
change
(
function
()
{
...
...
@@ -354,13 +341,56 @@ $(function() {
// チャットメンバー検索
$
(
'#chat .search_form input[type="search"]'
).
keyup
(
function
(){
$
.
ajax
({
url
:
'search_message_user_list.html'
,
type
:
'POST'
,
datatype
:
'html'
}).
done
(
function
(
data
)
{
$
(
'.overlay_src_msg'
).
html
(
data
);
})
console
.
log
(
$
(
'#chat .search_form input[type="search"]'
).
val
());
var
keyword
=
$
(
'#chat .search_form input[type="search"]'
).
val
();
var
rooms
=
CHAT_DB
.
getRoomList
(
chatRoomType
.
ALL
,
keyword
);
console
.
log
(
rooms
);
let
roomListTitle
=
getLocalizedString
(
"room_search_placeholder"
);
$
(
'#chatTitle'
).
text
(
roomListTitle
);
var
template
;
$
.
get
({
url
:
"./template/template_room_list.html"
,
async
:
false
}
,
function
(
text
)
{
template
=
text
;
});
rooms
.
forEach
(
function
(
room
)
{
room
.
profileImagePath
=
ASSET_PATH
+
'images/user-profile.png'
if
(
room
.
message
)
{
room
.
message
=
room
.
message
.
toString
()
}
else
{
room
.
message
=
getLocalizedString
(
"noMessages"
)
}
var
displayMsg
;
if
(
room
.
messageType
==
messageType
.
TEXT
||
room
.
messageType
==
messageType
.
TEXT
)
displayMsg
=
room
.
message
;
if
(
room
.
messageType
==
messageType
.
IMAGE
||
room
.
messageType
==
messageType
.
SYSTEM
)
displayMsg
=
getLocalizedString
(
"image"
);
var
attendUserName
=
[];
room
.
attendUsers
.
forEach
(
function
(
user
)
{
user
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
user
.
profileUrl
);
attendUserName
.
push
(
user
.
shopMemberName
);
});
var
thumbnailCount
=
room
.
attendUsers
.
length
>
4
?
4
:
room
.
attendUsers
.
length
;
if
(
room
.
chatRoomName
==
""
)
{
room
.
chatRoomName
=
attendUserName
.
join
(
', '
);
}
let
html
=
Mustache
.
render
(
template
,
{
thumbnailCount
:
thumbnailCount
,
roomName
:
room
.
chatRoomName
,
roomId
:
room
.
chatRoomId
,
profileImage
:
room
.
profileImagePath
,
lastMessage
:
displayMsg
,
time
:
room
.
insertDate
?
CHAT_UTIL
.
formatDate
(
room
.
insertDate
).
createdAt
:
''
,
unreadMsgCnt
:
room
.
unreadCount
==
0
?
''
:
room
.
unreadCount
,
userCnt
:
room
.
attendUsers
.
length
+
1
,
attendUsers
:
room
.
attendUsers
});
// Click event
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
()
{
});
$
(
'.overlay_src_msg'
).
append
(
obj
);
});
if
(
CHAT_UI
.
isLandscapeMode
())
{
$
(
".chat_list"
).
removeClass
(
"col-12"
).
addClass
(
"col-6"
);
}
});
// ルームメンバー検索
$
(
'#chat_room .search_form input[type="search"]'
).
keyup
(
function
(){
...
...
public_new/js/constant.js
View file @
4c630ccd
...
...
@@ -23,7 +23,8 @@ const userAPICmd = {
const
chatRoomType
=
{
DM
:
"1"
,
GROUP
:
"0"
GROUP
:
"0"
,
ALL
:
"2"
}
const
nameCardAreaId
=
{
...
...
public_new/js/contact.js
View file @
4c630ccd
$
(
function
()
{
// メンバー検索
$
(
'#contact .search_form input[type="search"]'
).
keyup
(
function
(){
$
(
'#contact .search_form input[type="search"]'
).
keyup
(
function
(
e
){
console
.
log
(
e
);
var
isAllGroup
=
$
(
'#tabAllGroup'
).
is
(
':checked'
);
$
(
'.overlay_src_msg'
).
empty
();
//全グループ検索画面
if
(
isAllGroup
)
{
var
keyword
=
$
(
'#contact .search_form input[type="search"]'
).
val
();
if
(
keyword
==
''
)
{
if
(
keyword
==
''
||
keyword
.
leght
<
2
)
{
return
;
}
...
...
public_new/js/language_ja.js
View file @
4c630ccd
...
...
@@ -4,7 +4,7 @@ $.lang.ja = {
"room_search_placeholder"
:
" ルーム検索"
,
"participants"
:
"メンバーリスト"
,
"exitRoom"
:
"退出 "
,
"roomListTitle"
:
"
ルーム一覧
"
,
"roomListTitle"
:
"
チャット
"
,
"deleteRoomTitle"
:
"ルーム削除"
,
"inviteUsersButton"
:
"招待"
,
"inviteUsersTitle"
:
"メンバー追加"
,
...
...
public_new/template/template_user_name_card.html
View file @
4c630ccd
...
...
@@ -12,7 +12,7 @@
</div>
<div
class=
"modal-body"
>
{{#groupPathList}}
<li
><b>
{{.
}}
</b></li>
<li
onclick=
"CHAT_UI.refreshAllGroupSearch({{groupId}});"
><b>
{{groupPath
}}
</b></li>
{{/groupPathList}}
</div>
<div
class=
"modal-footer border-0 justify-content-center"
>
...
...
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