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
5495c67d
Commit
5495c67d
authored
Apr 26, 2021
by
Kang Donghun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release_sp3' into features/release_sp3_collaboration_audio
# Conflicts: # public_new/js/chat-db.js
parents
085672d4
3bcc0e4d
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
334 additions
and
238 deletions
+334
-238
public_new/chat_room.html
+1
-0
public_new/collaboration_documents.html
+3
-1
public_new/collaboration_picture.html
+1
-1
public_new/collaboration_video.html
+1
-1
public_new/collaboration_voice.html
+1
-1
public_new/css/chat.css
+0
-10
public_new/css/common.css
+4
-0
public_new/js/archive.js
+8
-2
public_new/js/chat-add-user.js
+28
-12
public_new/js/chat-db.js
+15
-2
public_new/js/chat-ui.js
+19
-11
public_new/js/chat.js
+136
-107
public_new/js/chatMakeRoom.js
+35
-24
public_new/js/contact.js
+80
-64
public_new/template/template_user_name_card.html
+2
-2
No files found.
public_new/chat_room.html
View file @
5495c67d
...
...
@@ -188,6 +188,7 @@
}
else
{
webkit
.
messageHandlers
.
loginInfoRequestMessageHandlerId
.
postMessage
({});
webkit
.
messageHandlers
.
getGlobalParameter
.
postMessage
({});
webkit
.
messageHandlers
.
saveSelectedUserList
.
postMessage
(
""
);
}
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
,
isOnline
)
{
...
...
public_new/collaboration_documents.html
View file @
5495c67d
...
...
@@ -191,6 +191,8 @@
android
.
getLoginParameter
();
android
.
getGlobalParameter
();
}
else
{
webkit
.
messageHandlers
.
loginInfoRequestMessageHandlerId
.
postMessage
({});
webkit
.
messageHandlers
.
getGlobalParameter
.
postMessage
({});
}
...
...
@@ -203,7 +205,7 @@
IS_ONLINE
=
isOnline
;
if
(
CHAT_UTIL
.
isIOS
())
{
collaborationJoinFlg
=
CHAT_DB
.
getCollaborationJoinFlg
();
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
collaborationJoinFlg
=
android
.
getCollaborationJoinFlg
();
console
.
log
(
collaborationJoinFlg
);
...
...
public_new/collaboration_picture.html
View file @
5495c67d
...
...
@@ -177,7 +177,7 @@
IS_MOBILE
=
isMobile
;
IS_ONLINE
=
isOnline
;
if
(
CHAT_UTIL
.
isIOS
())
{
collaborationJoinFlg
=
CHAT_DB
.
getCollaborationJoinFlg
();
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
collaborationJoinFlg
=
android
.
getCollaborationJoinFlg
();
console
.
log
(
collaborationJoinFlg
);
...
...
public_new/collaboration_video.html
View file @
5495c67d
...
...
@@ -174,7 +174,7 @@
IS_MOBILE
=
isMobile
;
IS_ONLINE
=
isOnline
;
if
(
CHAT_UTIL
.
isIOS
())
{
collaborationJoinFlg
=
CHAT_DB
.
getCollaborationJoinFlg
();
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
collaborationJoinFlg
=
android
.
getCollaborationJoinFlg
();
console
.
log
(
collaborationJoinFlg
);
...
...
public_new/collaboration_voice.html
View file @
5495c67d
...
...
@@ -119,7 +119,7 @@
IS_MOBILE
=
isMobile
;
IS_ONLINE
=
isOnline
;
if
(
CHAT_UTIL
.
isIOS
())
{
collaborationJoinFlg
=
CHAT_DB
.
getCollaborationJoinFlg
();
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
collaborationJoinFlg
=
android
.
getCollaborationJoinFlg
();
console
.
log
(
collaborationJoinFlg
);
...
...
public_new/css/chat.css
View file @
5495c67d
...
...
@@ -867,12 +867,3 @@ input[name="tab_item"] {
max-width
:
75%
;
}
}
/*************************** ネームカード *************************/
.prifile_name
{
padding-top
:
20px
;
padding-bottom
:
20px
;
line-height
:
1.2
;
font-size
:
16px
;
margin-left
:
auto
;
margin-right
:
auto
;
}
\ No newline at end of file
public_new/css/common.css
View file @
5495c67d
...
...
@@ -173,6 +173,10 @@ main {
.profile_modal
.modal-header
.profile_name
{
width
:
100%
;
text-align
:
center
;
line-height
:
1.2
;
font-size
:
16px
;
margin-left
:
auto
;
margin-right
:
auto
;
}
.modal-header
{
width
:
100%
;
...
...
public_new/js/archive.js
View file @
5495c67d
...
...
@@ -4,8 +4,6 @@ var ARCHIVE_UI = {};
$
(
function
()
{
// アーカイブ検索
$
(
'#archive .search_form input[type="search"]'
).
keyup
(
function
(
e
)
{
var
keyword
=
$
(
'#archive .search_form input[type="search"]'
).
val
();
if
(
e
.
KeyCode
==
13
||
e
.
key
==
"Enter"
)
{
if
(
keyword
.
length
!=
0
&&
keyword
!=
''
)
{
...
...
@@ -26,6 +24,14 @@ $(function() {
}
// 検索結果を表示
});
// iOSキーボード変換検知用
$
(
'#archive .search_form input[type="search"]'
).
on
(
'compositionend'
,
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
var
keyword
=
$
(
'#archive .search_form input[type="search"]'
).
val
();
$
(
'.overlay_src_msg'
).
empty
();
ARCHIVE_UI
.
refreshSearchScreen
(
keyword
);
}
});
});
ARCHIVE_UI
.
refreshSearchScreen
=
function
(
keyword
)
{
...
...
public_new/js/chat-add-user.js
View file @
5495c67d
// 名前空間
var
CHAT_ADD_USER
=
{};
$
(
function
()
{
// メンバー検索
$
(
'#chat_add_user .search_form input[type="search"]'
).
click
(
function
(
e
){
...
...
@@ -7,20 +10,38 @@ $(function() {
})
$
(
'#chat_add_user .search_form input[type="search"]'
).
keyup
(
function
(
e
){
var
keyword
=
$
(
'#chat_add_user .search_form input[type="search"]'
).
val
();
if
(
e
.
key
==
"Enter"
||
e
.
KeyCode
==
13
)
{
$
(
'#chat_add_user .search_form input[type="search"]'
).
blur
();
if
(
keyword
!=
''
&&
keyword
.
length
!=
0
)
{
$
(
'#chat_add_user .search_form input[type="search"]'
).
blur
();
return
false
;
}
}
else
if
(
keyword
==
''
||
keyword
.
length
<
2
)
{
$
(
'.overlay_src_msg'
).
empty
();
return
false
;
}
CHAT_ADD_USER
.
searchUser
(
keyword
);
if
(
e
.
key
==
"Enter"
||
e
.
KeyCode
==
13
)
{
$
(
'#chat_add_user .search_form input[type="search"]'
).
blur
();
return
;
}
});
// iOSキーボード変換検知用
$
(
'#chat_add_user .search_form input[type="search"]'
).
on
(
'compositionend'
,
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
var
keyword
=
$
(
'#chat_add_user .search_form input[type="search"]'
).
val
();
CHAT_ADD_USER
.
searchUser
(
keyword
);
}
});
});
// ユーザー検索
CHAT_ADD_USER
.
searchUser
=
function
(
keyword
)
{
var
isAllGroup
=
$
(
'#tabAllGroupOnAddUser'
).
is
(
':checked'
);
$
(
'.overlay_src_msg'
).
empty
();
//全グループ検索画面
if
(
isAllGroup
)
{
var
keyword
=
$
(
'#chat_add_user .search_form input[type="search"]'
).
val
();
if
(
keyword
==
''
)
{
return
;
}
//グループデータ検索
var
groupList
=
CHAT_DB
.
getGroupByName
(
keyword
);
var
groupTemplate
;
...
...
@@ -67,10 +88,6 @@ $(function() {
}
//連絡先画面
}
else
{
var
keyword
=
$
(
'#chat_add_user .search_form input[type="search"]'
).
val
();
if
(
keyword
==
''
)
{
return
;
}
var
userList
=
CHAT_DB
.
getMyGroupShopMemberNotInRoomByName
(
keyword
);
var
userTemplate
;
$
.
get
({
url
:
"./template/template_make_room_user_list.html"
,
async
:
false
}
...
...
@@ -97,5 +114,4 @@ $(function() {
$
(
'.overlay_src_msg'
).
append
(
noResultMsg
);
}
}
});
});
};
public_new/js/chat-db.js
View file @
5495c67d
...
...
@@ -329,4 +329,18 @@ CHAT_DB.getUserListByLoginId = function(loginIdList) {
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
return
JSON
.
parse
(
android
.
getUserListByLoginId
(
loginIdList
.
join
(
","
)));
}
}
\ No newline at end of file
}
CHAT_DB
.
getCollaborationJoinFlg
=
function
()
{
// Androidは実装不要
if
(
CHAT_UTIL
.
isIOS
())
{
return
callNativeApp
(
"getCollaborationJoinFlg"
,
{});
}
};
CHAT_DB
.
getUserInfoList
=
function
(
shopMemberId
)
{
// Androidは実装不要
if
(
CHAT_UTIL
.
isIOS
())
{
return
callNativeApp
(
"getUserInfoList"
,
{
"shopMemberId"
:
shopMemberId
});
}
};
public_new/js/chat-ui.js
View file @
5495c67d
...
...
@@ -269,13 +269,14 @@ $('#video-form').on('submit', function(e) {
var
fd
=
new
FormData
(
$
(
this
)[
0
]);
if
(
!
file
.
type
.
includes
(
"image"
))
{
// video 保存
CHAT
.
createVideoThumbnailAndUpload
(
file
,
function
(
resizeFile
,
thumbnailCreated
)
{
if
(
resizeFile
&&
thumbnailCreated
)
{
//ただ、画像の大きさが500pixel以下の場合はthumbnailは生成されない
fd
.
append
(
'thumb'
,
resizeFile
)
}
CHAT
.
uploadImage
(
fd
);
})
// CHAT.createVideoThumbnailAndUpload(file, function(resizeFile, thumbnailCreated) {
// if(resizeFile && thumbnailCreated) {
// //ただ、画像の大きさが500pixel以下の場合はthumbnailは生成されない
// fd.append('thumb', resizeFile)
// }
// CHAT.uploadImage(fd);
// })
CHAT
.
uploadImage
(
fd
);
return
;
}
}
...
...
@@ -1302,8 +1303,15 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
beforeDate
=
message
.
insertDate
;
if
(
message
.
messageType
==
messageType
.
COMMUNICATIONSTART
||
message
.
messageType
==
messageType
.
COMMUNICATIONEND
)
{
var
collaborationInfo
=
JSON
.
parse
(
message
.
message
);
var
userInCollaboration
=
JSON
.
parse
(
android
.
getUserInfoList
(
collaborationInfo
.
userList
));
var
collaborationInfo
;
var
userInCollaboration
;
if
(
CHAT_UTIL
.
isIOS
())
{
collaborationInfo
=
message
.
message
;
userInCollaboration
=
JSON
.
parse
(
CHAT_DB
.
getUserInfoList
(
collaborationInfo
.
userList
));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
collaborationInfo
=
JSON
.
parse
(
message
.
message
);
userInCollaboration
=
JSON
.
parse
(
android
.
getUserInfoList
(
collaborationInfo
.
userList
));
}
userInCollaboration
.
forEach
(
function
(
user
)
{
user
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
user
.
profileUrl
);
...
...
@@ -2459,7 +2467,7 @@ CHAT_UI.displayExistRoom = function(roomId) {
CHAT_UI
.
joinCollaboration
=
function
(
collaborationType
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS
webkit
.
messageHandlers
.
joinCollaboration
.
postMessage
(
collaborationType
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
android
.
joinCollaboration
(
collaborationType
);
}
...
...
@@ -2467,7 +2475,7 @@ CHAT_UI.joinCollaboration = function(collaborationType) {
CHAT_UI
.
startCollaboration
=
function
(
collaborationType
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS
webkit
.
messageHandlers
.
startCollaboration
.
postMessage
(
collaborationType
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
android
.
startCollaboration
(
collaborationType
);
}
...
...
public_new/js/chat.js
View file @
5495c67d
...
...
@@ -102,7 +102,11 @@ CHAT.uploadImage = function(formData) {
type
:
"post"
,
data
:
formData
,
contentType
:
false
,
processData
:
false
processData
:
false
,
error
:
function
()
{
alert
(
"読み込み失敗"
);
CHAT_UI
.
dismissLoadingIndicator
();
}
}).
done
(
function
(
res
)
{
var
imgPath
=
CMS_SERVER_URL
+
'/chatapi/file/getImage?fileName='
+
res
.
fileName
+
'&roomId='
+
CHAT
.
globalLoginParameter
.
roomId
;
var
imageName
=
res
.
fileName
...
...
@@ -361,62 +365,20 @@ $(function() {
$
(
'.overlay_src_msg'
).
empty
();
return
;
}
$
(
'.overlay_src_msg'
).
empty
();
rooms
=
CHAT_DB
.
getRoomList
(
chatRoomType
.
ALL
,
keyword
);
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
.
SYSTEM
)
displayMsg
=
room
.
message
;
if
(
room
.
messageType
==
messageType
.
IMAGE
)
displayMsg
=
getLocalizedString
(
"image"
);
if
(
room
.
messageType
==
messageType
.
VIDEO
)
displayMsg
=
getLocalizedString
(
"video"
);
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
);
$
(
'.overlay_src_msg'
).
append
(
obj
);
});
if
(
rooms
.
length
==
0
)
{
const
noResultMsg
=
$
(
'<div/>'
,{
width
:
'auto'
,
style
:
'text-align: center'
});
noResultMsg
.
append
(
getLocalizedString
(
"noResult"
))
$
(
'.overlay_src_msg'
).
append
(
noResultMsg
);
}
CHAT
.
searchRoom
(
keyword
,
rooms
);
if
(
e
.
KeyCode
==
13
||
e
.
key
==
"Enter"
)
{
$
(
'#chat .search_form input[type="search"]'
).
blur
();
return
;
}
});
// iOSキーボード変換検知用
$
(
'#chat .search_form input[type="search"]'
).
on
(
'compositionend'
,
function
(){
if
(
CHAT_UTIL
.
isIOS
())
{
var
rooms
;
var
keyword
=
$
(
'#chat .search_form input[type="search"]'
).
val
();
CHAT
.
searchRoom
(
keyword
,
rooms
);
}
});
var
beforeHeight
;
var
beforeScroll
;
...
...
@@ -444,6 +406,7 @@ $(function() {
// チャットルーム
// メッセージ検索イベント
$
(
'.chat_room_src_form input[type="search"]'
).
keyup
(
function
(
e
){
let
workVal
=
""
;
var
keyword
=
$
(
'.chat_room_src_form input[type="search"]'
).
val
();
if
(
e
.
key
==
"Enter"
||
e
.
KeyCode
==
13
)
{
if
(
keyword
!=
''
&&
keyword
.
length
!=
0
)
{
...
...
@@ -454,67 +417,22 @@ $(function() {
$
(
'.overlay_src_msg'
).
empty
();
return
;
}
let
workVal
=
""
;
$
(
'.overlay_src_msg'
).
empty
();
var
checkedUserList
=
[];
$
(
'.img_wrap.filter'
).
each
(
function
(
user
)
{
var
selectedUser
=
$
(
'.img_wrap.filter'
)[
user
];
checkedUserList
.
push
(
$
(
selectedUser
).
data
(
'user-id'
));
})
var
messages
=
CHAT_DB
.
searchMessages
(
keyword
,
checkedUserList
.
join
(
','
));
var
userMessageTemplate
;
$
.
get
({
url
:
"./template/template_user_message.html"
,
async
:
false
}
,
function
(
text
)
{
userMessageTemplate
=
text
;
});
var
myMessageTemplate
;
$
.
get
({
url
:
"./template/template_my_message.html"
,
async
:
false
}
,
function
(
text
)
{
myMessageTemplate
=
text
;
});
let
jQueryMessages
=
$
(
'.overlay_src_msg'
);
messages
.
forEach
(
function
(
message
)
{
let
template
=
userMessageTemplate
;
if
(
message
.
shopMemberId
==
CHAT
.
globalLoginParameter
.
shopMemberId
)
{
template
=
myMessageTemplate
;
}
if
(
message
.
messageType
==
messageType
.
SYSTEM
)
{
template
=
systemMessageTemplate
;
}
let
messageTime
=
CHAT_UTIL
.
formatDate
(
message
.
insertDate
);
if
(
message
.
profileUrl
)
{
message
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
message
.
profileUrl
)
}
else
{
message
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
""
)
}
message
.
message
=
message
.
message
.
toString
();
var
replacePath
=
message
.
message
;
replacePath
=
replacePath
.
replaceAll
(
'?fileName='
,
'?sid='
+
CHAT
.
globalLoginParameter
.
sid
+
'&fileName='
);
message
.
message
=
replacePath
;
let
html
=
Mustache
.
render
(
template
,
{
text
:
message
.
message
,
from
:
message
.
loginId
,
shopMemberId
:
message
.
shopMemberId
,
profileImage
:
message
.
profileUrl
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtTime
:
messageTime
.
createdAtTime
});
html
=
message
.
message
.
includes
(
'attachedImages'
)
||
message
.
message
.
includes
(
'attachedVideos'
)
?
CHAT_UTIL
.
htmlDecode
(
html
)
:
html
;
workVal
=
html
+
workVal
;
})
jQueryMessages
.
prepend
(
workVal
);
if
(
messages
.
length
==
0
)
{
const
noResultMsg
=
$
(
'<div/>'
,{
width
:
'auto'
,
style
:
'text-align: center'
});
noResultMsg
.
append
(
getLocalizedString
(
"noResult"
))
jQueryMessages
.
append
(
noResultMsg
);
}
CHAT
.
searchMessage
(
keyword
,
workVal
);
if
(
e
.
key
==
"Enter"
||
e
.
KeyCode
==
13
)
{
$
(
'#searchMessage'
).
removeClass
(
'onfocus'
);
$
(
'.chat_room_src_form input[type="search"]'
).
blur
();
return
;
}
});
// iOSキーボード変換検知用
$
(
'.chat_room_src_form input[type="search"]'
).
on
(
'compositionend'
,
function
(){
if
(
CHAT_UTIL
.
isIOS
())
{
let
workVal
=
""
;
var
keyword
=
$
(
'.chat_room_src_form input[type="search"]'
).
val
();
CHAT
.
searchMessage
(
keyword
,
workVal
);
}
});
$
(
document
).
on
(
'click'
,
'.filter_img'
,
function
(
event
)
{
let
workVal
=
""
;
...
...
@@ -574,3 +492,114 @@ $(function() {
jQueryMessages
.
prepend
(
workVal
);
});
});
// チャットルーム検索
CHAT
.
searchRoom
=
function
(
keyword
,
rooms
)
{
$
(
'.overlay_src_msg'
).
empty
();
rooms
=
CHAT_DB
.
getRoomList
(
chatRoomType
.
ALL
,
keyword
);
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
.
SYSTEM
)
displayMsg
=
room
.
message
;
if
(
room
.
messageType
==
messageType
.
IMAGE
)
displayMsg
=
getLocalizedString
(
"image"
);
if
(
room
.
messageType
==
messageType
.
VIDEO
)
displayMsg
=
getLocalizedString
(
"video"
);
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
);
$
(
'.overlay_src_msg'
).
append
(
obj
);
});
if
(
rooms
.
length
==
0
)
{
const
noResultMsg
=
$
(
'<div/>'
,{
width
:
'auto'
,
style
:
'text-align: center'
});
noResultMsg
.
append
(
getLocalizedString
(
"noResult"
))
$
(
'.overlay_src_msg'
).
append
(
noResultMsg
);
}
};
// メッセージ検索
CHAT
.
searchMessage
=
function
(
keyword
,
workVal
)
{
$
(
'.overlay_src_msg'
).
empty
();
var
checkedUserList
=
[];
$
(
'.img_wrap.filter'
).
each
(
function
(
user
)
{
var
selectedUser
=
$
(
'.img_wrap.filter'
)[
user
];
checkedUserList
.
push
(
$
(
selectedUser
).
data
(
'user-id'
));
})
var
messages
=
CHAT_DB
.
searchMessages
(
keyword
,
checkedUserList
.
join
(
','
));
var
userMessageTemplate
;
$
.
get
({
url
:
"./template/template_user_message.html"
,
async
:
false
}
,
function
(
text
)
{
userMessageTemplate
=
text
;
});
var
myMessageTemplate
;
$
.
get
({
url
:
"./template/template_my_message.html"
,
async
:
false
}
,
function
(
text
)
{
myMessageTemplate
=
text
;
});
let
jQueryMessages
=
$
(
'.overlay_src_msg'
);
messages
.
forEach
(
function
(
message
)
{
let
template
=
userMessageTemplate
;
if
(
message
.
shopMemberId
==
CHAT
.
globalLoginParameter
.
shopMemberId
)
{
template
=
myMessageTemplate
;
}
if
(
message
.
messageType
==
messageType
.
SYSTEM
)
{
template
=
systemMessageTemplate
;
}
let
messageTime
=
CHAT_UTIL
.
formatDate
(
message
.
insertDate
);
if
(
message
.
profileUrl
)
{
message
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
message
.
profileUrl
)
}
else
{
message
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
""
)
}
message
.
message
=
message
.
message
.
toString
();
var
replacePath
=
message
.
message
;
replacePath
=
replacePath
.
replaceAll
(
'?fileName='
,
'?sid='
+
CHAT
.
globalLoginParameter
.
sid
+
'&fileName='
);
message
.
message
=
replacePath
;
let
html
=
Mustache
.
render
(
template
,
{
text
:
message
.
message
,
from
:
message
.
loginId
,
shopMemberId
:
message
.
shopMemberId
,
profileImage
:
message
.
profileUrl
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtTime
:
messageTime
.
createdAtTime
});
html
=
message
.
message
.
includes
(
'attachedImages'
)
||
message
.
message
.
includes
(
'attachedVideos'
)
?
CHAT_UTIL
.
htmlDecode
(
html
)
:
html
;
workVal
=
html
+
workVal
;
})
jQueryMessages
.
prepend
(
workVal
);
if
(
messages
.
length
==
0
)
{
const
noResultMsg
=
$
(
'<div/>'
,{
width
:
'auto'
,
style
:
'text-align: center'
});
noResultMsg
.
append
(
getLocalizedString
(
"noResult"
))
jQueryMessages
.
append
(
noResultMsg
);
}
};
public_new/js/chatMakeRoom.js
View file @
5495c67d
$
(
function
()
{
// メンバー検索
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
click
(
function
(
e
)
{
let
contactListTitle
=
getLocalizedString
(
"userSearch"
);
$
(
'#makeRoomTitle'
).
text
(
contactListTitle
);
});
// 名前空間
var
CHAT_MAKE_ROOM
=
{};
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
keyup
(
function
(
e
)
{
//画面タイトル設定
var
keyword
=
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
val
();
if
(
e
.
KeyCode
==
13
||
e
.
key
==
"Enter"
)
{
if
(
keyword
!=
''
&&
keyword
.
length
!=
0
)
{
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
blur
();
$
(
function
()
{
// メンバー検索
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
click
(
function
(
e
)
{
let
contactListTitle
=
getLocalizedString
(
"userSearch"
);
$
(
'#makeRoomTitle'
).
text
(
contactListTitle
);
});
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
keyup
(
function
(
e
)
{
//画面タイトル設定
var
keyword
=
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
val
();
if
(
e
.
KeyCode
==
13
||
e
.
key
==
"Enter"
)
{
if
(
keyword
!=
''
&&
keyword
.
length
!=
0
)
{
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
blur
();
return
false
;
}
}
else
if
(
keyword
==
''
||
keyword
.
length
<
2
)
{
$
(
'.overlay_src_msg'
).
empty
();
return
false
;
}
}
else
if
(
keyword
==
''
||
keyword
.
length
<
2
)
{
$
(
'.overlay_src_msg'
).
empty
();
return
false
;
}
CHAT_MAKE_ROOM
.
searchUser
(
keyword
);
if
(
e
.
key
==
"Enter"
||
e
.
KeyCode
==
13
)
{
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
blur
();
return
;
}
});
// iOSキーボード変換検知用
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
on
(
'compositionend'
,
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
var
keyword
=
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
val
();
CHAT_MAKE_ROOM
.
searchUser
(
keyword
);
}
});
});
// メンバー検索
CHAT_MAKE_ROOM
.
searchUser
=
function
(
keyword
)
{
var
isAllGroup
=
$
(
'#tabAllGroupOnMakeRoom'
).
is
(
':checked'
);
$
(
'.overlay_src_msg'
).
empty
();
...
...
@@ -95,11 +112,5 @@ $(function() {
noResultMsg
.
append
(
getLocalizedString
(
"noResult"
))
$
(
'.overlay_src_msg'
).
append
(
noResultMsg
);
}
}
if
(
e
.
key
==
"Enter"
||
e
.
KeyCode
==
13
)
{
$
(
'#chatMakeRoom .search_form input[type="search"]'
).
blur
();
return
;
}
});
});
}
public_new/js/contact.js
View file @
5495c67d
// 名前空間
var
CONTACT
=
{};
$
(
function
()
{
// メンバー検索
$
(
'#contact .search_form input[type="search"]'
).
keyup
(
function
(
e
)
{
var
groupList
;
var
keyword
=
$
(
'#contact .search_form input[type="search"]'
).
val
();
if
(
e
.
key
==
"Enter"
||
e
.
KeyCode
==
13
)
{
if
(
keyword
!=
''
&&
keyword
.
length
!=
0
)
{
...
...
@@ -12,73 +14,87 @@ $(function () {
$
(
'.overlay_src_msg'
).
empty
();
return
;
}
$
(
'.overlay_src_msg'
).
empty
();
var
isAllGroup
=
$
(
'#tabAllGroup'
).
is
(
':checked'
);
//全グループ検索画面
if
(
isAllGroup
)
{
//グループデータ検索
groupList
=
CHAT_DB
.
getGroupByName
(
keyword
);
var
groupTemplate
;
$
.
get
({
url
:
"./template/template_group_list.html"
,
async
:
false
}
,
function
(
text
)
{
groupTemplate
=
text
;
});
CONTACT
.
searchUser
(
keyword
);
if
(
e
.
key
==
"Enter"
||
e
.
KeyCode
==
13
)
{
$
(
'#contact .search_form input[type="search"]'
).
blur
();
return
;
}
});
// iOSキーボード変換検知用
$
(
'#contact .search_form input[type="search"]'
).
on
(
'compositionend'
,
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
var
keyword
=
$
(
'#contact .search_form input[type="search"]'
).
val
();
CONTACT
.
searchUser
(
keyword
);
}
});
});
groupList
.
forEach
(
function
(
group
)
{
let
html
=
Mustache
.
render
(
groupTemplate
,
{
name
:
group
.
groupName
,
id
:
group
.
groupId
,
isFavorite
:
group
.
isFavorite
});
let
obj
=
jQuery
.
parseHTML
(
html
);
$
(
'.overlay_src_msg'
).
append
(
obj
);
})
// ユーザー検索
CONTACT
.
searchUser
=
function
(
keyword
)
{
var
groupList
;
$
(
'.overlay_src_msg'
).
empty
();
var
isAllGroup
=
$
(
'#tabAllGroup'
).
is
(
':checked'
);
//ユーザデータ検索
var
userList
=
CHAT_DB
.
getAllGroupShopMemberByName
(
keyword
);
var
userTemplate
;
$
.
get
({
url
:
"./template/template_user_list.html"
,
async
:
false
}
,
function
(
text
)
{
userTemplate
=
text
;
});
userList
.
forEach
(
function
(
user
)
{
user
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
user
.
profileUrl
);
});
let
html
=
Mustache
.
render
(
userTemplate
,
{
userList
:
userList
//全グループ検索画面
if
(
isAllGroup
)
{
//グループデータ検索
groupList
=
CHAT_DB
.
getGroupByName
(
keyword
);
var
groupTemplate
;
$
.
get
({
url
:
"./template/template_group_list.html"
,
async
:
false
}
,
function
(
text
)
{
groupTemplate
=
text
;
});
groupList
.
forEach
(
function
(
group
)
{
let
html
=
Mustache
.
render
(
groupTemplate
,
{
name
:
group
.
groupName
,
id
:
group
.
groupId
,
isFavorite
:
group
.
isFavorite
});
let
obj
=
jQuery
.
parseHTML
(
html
);
$
(
'.overlay_src_msg'
).
append
(
obj
);
if
(
userList
.
length
==
0
&&
groupList
.
length
==
0
)
{
const
noResultMsg
=
$
(
'<div/>'
,{
width
:
'auto'
,
style
:
'text-align: center'
});
noResultMsg
.
append
(
getLocalizedString
(
"noResult"
))
$
(
'.overlay_src_msg'
).
append
(
noResultMsg
);
}
//連絡先画面
}
else
{
var
userList
=
CHAT_DB
.
getMyGroupShopMemberByName
(
keyword
);
var
userTemplate
;
$
.
get
({
url
:
"./template/template_user_list.html"
,
async
:
false
}
,
function
(
text
)
{
userTemplate
=
text
;
});
userList
.
forEach
(
function
(
user
)
{
user
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
user
.
profileUrl
);
});
let
html
=
Mustache
.
render
(
userTemplate
,
{
userList
:
userList
});
let
obj
=
jQuery
.
parseHTML
(
html
);
$
(
'.overlay_src_msg'
).
html
(
obj
);
if
(
userList
.
length
==
0
)
{
const
noResultMsg
=
$
(
'<div/>'
,{
width
:
'auto'
,
style
:
'text-align: center'
});
noResultMsg
.
append
(
getLocalizedString
(
"noResult"
))
$
(
'.overlay_src_msg'
).
append
(
noResultMsg
);
}
})
//ユーザデータ検索
var
userList
=
CHAT_DB
.
getAllGroupShopMemberByName
(
keyword
);
var
userTemplate
;
$
.
get
({
url
:
"./template/template_user_list.html"
,
async
:
false
}
,
function
(
text
)
{
userTemplate
=
text
;
});
userList
.
forEach
(
function
(
user
)
{
user
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
user
.
profileUrl
);
});
let
html
=
Mustache
.
render
(
userTemplate
,
{
userList
:
userList
});
let
obj
=
jQuery
.
parseHTML
(
html
);
$
(
'.overlay_src_msg'
).
append
(
obj
);
if
(
userList
.
length
==
0
&&
groupList
.
length
==
0
)
{
const
noResultMsg
=
$
(
'<div/>'
,{
width
:
'auto'
,
style
:
'text-align: center'
});
noResultMsg
.
append
(
getLocalizedString
(
"noResult"
))
$
(
'.overlay_src_msg'
).
append
(
noResultMsg
);
}
if
(
e
.
key
==
"Enter"
||
e
.
KeyCode
==
13
)
{
$
(
'#contact .search_form input[type="search"]'
).
blur
();
return
;
//連絡先画面
}
else
{
var
userList
=
CHAT_DB
.
getMyGroupShopMemberByName
(
keyword
);
var
userTemplate
;
$
.
get
({
url
:
"./template/template_user_list.html"
,
async
:
false
}
,
function
(
text
)
{
userTemplate
=
text
;
});
userList
.
forEach
(
function
(
user
)
{
user
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
user
.
profileUrl
);
});
let
html
=
Mustache
.
render
(
userTemplate
,
{
userList
:
userList
});
let
obj
=
jQuery
.
parseHTML
(
html
);
$
(
'.overlay_src_msg'
).
html
(
obj
);
if
(
userList
.
length
==
0
)
{
const
noResultMsg
=
$
(
'<div/>'
,{
width
:
'auto'
,
style
:
'text-align: center'
});
noResultMsg
.
append
(
getLocalizedString
(
"noResult"
))
$
(
'.overlay_src_msg'
).
append
(
noResultMsg
);
}
}
);
}
)
;
}
};
public_new/template/template_user_name_card.html
View file @
5495c67d
...
...
@@ -5,9 +5,9 @@
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
<div
class=
"pr
ifile_desc
d-flex flex-row"
>
<div
class=
"pr
ofile_desc_
d-flex flex-row"
>
<img
src=
"{{profileUrl}}"
onError=
"this.src='./img/noImage.png'"
/>
<div
class=
"pr
i
file_name"
><span>
{{name}}
</span></div>
<div
class=
"pr
o
file_name"
><span>
{{name}}
</span></div>
</div>
</div>
<div
class=
"modal-body"
id=
"userNameCard-scroll"
>
...
...
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