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
558f93ca
Commit
558f93ca
authored
Apr 08, 2021
by
Lee Daehyun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release_sp3' into 'bugFix/#42192操作改善1'
# Conflicts: # public_new/chat_room.html
parents
0a563678
42b78026
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
125 additions
and
102 deletions
+125
-102
public_new/archive.html
+20
-1
public_new/archive_detail.html
+1
-1
public_new/chat.html
+2
-0
public_new/chat_room.html
+2
-6
public_new/contact.html
+3
-0
public_new/css/chat.css
+12
-3
public_new/css/common.css
+7
-6
public_new/js/chat-db.js
+36
-75
public_new/js/chat-ui.js
+26
-1
public_new/js/chat-websocket.js
+1
-0
public_new/js/chat.js
+9
-5
public_new/template/template_user_message.html
+3
-1
public_new/template/template_user_name_card.html
+3
-3
No files found.
public_new/archive.html
View file @
558f93ca
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<script>
<script>
window
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
window
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
CHAT_DB
.
callG
etArchiveList
();
CHAT_DB
.
g
etArchiveList
();
});
});
</script>
</script>
</head>
</head>
...
@@ -135,12 +135,31 @@
...
@@ -135,12 +135,31 @@
<
/li
>
<
/li
>
</script>
</script>
<script>
<script>
String
.
prototype
.
replaceAll
=
function
(
org
,
dest
)
{
return
this
.
split
(
org
).
join
(
dest
);
}
let
CHAT_SERVER_URL
=
''
;
let
CHAT_SERVER_URL
=
''
;
let
CMS_SERVER_URL
=
''
;
let
CMS_SERVER_URL
=
''
;
let
ASSET_PATH
=
'./'
;
let
ASSET_PATH
=
'./'
;
let
PLATFORM
=
''
;
let
PLATFORM
=
''
;
let
IS_MOBILE
=
true
;
let
IS_MOBILE
=
true
;
let
IS_ONLINE
=
false
;
let
IS_ONLINE
=
false
;
$
(
"#chatMenuModal"
).
load
(
"./modal_chat_menu.html"
);
$
(
"#loadingArea"
).
load
(
"./loading.html"
);
android
.
getLoginParameter
();
android
.
getGlobalParameter
();
webkit
.
messageHandlers
.
loginInfoRequestMessageHandlerId
.
postMessage
({});
webkit
.
messageHandlers
.
getGlobalParameter
.
postMessage
({});
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
,
isOnline
)
{
CHAT_SERVER_URL
=
chatServerUrl
;
CMS_SERVER_URL
=
cmsServerUrl
;
PLATFORM
=
platform
;
IS_MOBILE
=
isMobile
;
IS_ONLINE
=
isOnline
;
CHAT_UI
.
loadMessages
(
CHAT
.
globalLoginParameter
.
roomId
,
CHAT
.
globalLoginParameter
.
roomName
);
};
</script>
</script>
</body>
</body>
...
...
public_new/archive_detail.html
View file @
558f93ca
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
var
urlSearch
=
location
.
search
.
substring
(
1
).
split
(
'&'
);
var
urlSearch
=
location
.
search
.
substring
(
1
).
split
(
'&'
);
var
kv
=
urlSearch
[
0
].
split
(
'='
);
var
kv
=
urlSearch
[
0
].
split
(
'='
);
urlPrm
[
kv
[
0
]]
=
kv
[
1
];
urlPrm
[
kv
[
0
]]
=
kv
[
1
];
CHAT_DB
.
callG
etArchiveDetail
(
urlPrm
.
archiveId
);
CHAT_DB
.
g
etArchiveDetail
(
urlPrm
.
archiveId
);
});
});
</script>
</script>
</head>
</head>
...
...
public_new/chat.html
View file @
558f93ca
...
@@ -129,6 +129,8 @@
...
@@ -129,6 +129,8 @@
android
.
getLoginParameter
();
android
.
getLoginParameter
();
android
.
getGlobalParameter
();
android
.
getGlobalParameter
();
android
.
saveSelectedUserList
(
""
);
android
.
saveSelectedUserList
(
""
);
webkit
.
messageHandlers
.
loginInfoRequestMessageHandlerId
.
postMessage
({});
webkit
.
messageHandlers
.
getGlobalParameter
.
postMessage
({});
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
,
isOnline
)
{
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
,
isOnline
)
{
CHAT_SERVER_URL
=
chatServerUrl
;
CHAT_SERVER_URL
=
chatServerUrl
;
...
...
public_new/chat_room.html
View file @
558f93ca
...
@@ -138,12 +138,6 @@
...
@@ -138,12 +138,6 @@
<div
id=
"userProfileModal"
></div>
<div
id=
"userProfileModal"
></div>
<div
id=
"chatMenuModal"
></div>
<div
id=
"chatMenuModal"
></div>
<div
id=
"pictureModal"
></div>
<div
id=
"pictureModal"
></div>
<!-- メニューモーダル -->
<!--#include virtual="modal_chat_menu.html" -->
<!-- プロフィールモーダル -->
<!--#include virtual="modal_chat_profile.html" -->
<!-- 写真メッセージーモーダル -->
<!--#include virtual="modal_chat_picture.html" -->
<script
src=
"./js/libs/jquery-3.3.1.min.js"
></script>
<script
src=
"./js/libs/jquery-3.3.1.min.js"
></script>
<script
src=
"./js/libs/socket.io.js"
></script>
<script
src=
"./js/libs/socket.io.js"
></script>
...
@@ -186,6 +180,8 @@
...
@@ -186,6 +180,8 @@
$
(
"#loadingArea"
).
load
(
"./loading.html"
);
$
(
"#loadingArea"
).
load
(
"./loading.html"
);
android
.
getLoginParameter
();
android
.
getLoginParameter
();
android
.
getGlobalParameter
();
android
.
getGlobalParameter
();
webkit
.
messageHandlers
.
loginInfoRequestMessageHandlerId
.
postMessage
({});
webkit
.
messageHandlers
.
getGlobalParameter
.
postMessage
();
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
,
isOnline
)
{
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
,
isOnline
)
{
CHAT_SERVER_URL
=
chatServerUrl
;
CHAT_SERVER_URL
=
chatServerUrl
;
...
...
public_new/contact.html
View file @
558f93ca
...
@@ -229,6 +229,9 @@
...
@@ -229,6 +229,9 @@
$
(
"#loadingArea"
).
load
(
"./loading.html"
);
$
(
"#loadingArea"
).
load
(
"./loading.html"
);
android
.
getLoginParameter
();
android
.
getLoginParameter
();
android
.
getGlobalParameter
();
android
.
getGlobalParameter
();
webkit
.
messageHandlers
.
loginInfoRequestMessageHandlerId
.
postMessage
({});
webkit
.
messageHandlers
.
getGlobalParameter
.
postMessage
({});
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
,
isOnline
)
{
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
,
isOnline
)
{
CHAT_SERVER_URL
=
chatServerUrl
;
CHAT_SERVER_URL
=
chatServerUrl
;
CMS_SERVER_URL
=
cmsServerUrl
;
CMS_SERVER_URL
=
cmsServerUrl
;
...
...
public_new/css/chat.css
View file @
558f93ca
...
@@ -558,6 +558,7 @@ input[name="tab_item"] {
...
@@ -558,6 +558,7 @@ input[name="tab_item"] {
border-radius
:
8px
;
border-radius
:
8px
;
background-color
:
#ffffff
;
background-color
:
#ffffff
;
font-size
:
18px
;
font-size
:
18px
;
word-break
:
break-word
;
}
}
.room_left-text.latest
.text
,
.room_left-text.latest
.text
,
.room_left-text.latest
.img_wrap
{
.room_left-text.latest
.img_wrap
{
...
@@ -623,6 +624,7 @@ input[name="tab_item"] {
...
@@ -623,6 +624,7 @@ input[name="tab_item"] {
margin
:
0
;
margin
:
0
;
margin-left
:
80px
;
margin-left
:
80px
;
font-size
:
18px
;
font-size
:
18px
;
word-break
:
break-word
;
}
}
/* 吹き出し */
/* 吹き出し */
.room_right
.text
::after
{
.room_right
.text
::after
{
...
@@ -742,9 +744,6 @@ input[name="tab_item"] {
...
@@ -742,9 +744,6 @@ input[name="tab_item"] {
/**************************** modal *************************/
/**************************** modal *************************/
/* メニューモーダル */
/* メニューモーダル */
.modal-body
{
padding-left
:
0.6rem
;
}
.modal-body
#modal_image
{
.modal-body
#modal_image
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
...
@@ -844,3 +843,12 @@ input[name="tab_item"] {
...
@@ -844,3 +843,12 @@ input[name="tab_item"] {
max-width
:
75%
;
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 @
558f93ca
...
@@ -152,16 +152,17 @@ main {
...
@@ -152,16 +152,17 @@ main {
}
}
.profile_modal
#userNameCard-scroll
{
.profile_modal
#userNameCard-scroll
{
height
:
20
0px
;
height
:
15
0px
;
overflow
:
auto
;
overflow
:
scroll
;
padding-top
:
0rem
;
padding-top
:
0rem
;
padding-right
:
0
rem
;
padding-right
:
1
rem
;
margin-top
:
1rem
;
margin-top
:
1rem
;
}
}
.profile_modal
.modal-header
{
display
:
table
;
}
.profile_modal
.modal-header
,
.profile_modal
.modal-body
{
padding-bottom
:
0
;
}
.profile_modal
.modal-header
,
.profile_modal
.modal-body
{
padding-bottom
:
0
;
}
.profile_modal
.modal-footer
button
{
width
:
33%
;
padding
:
5px
;}
.profile_modal
.modal-footer
button
{
width
:
33%
;
padding
:
5px
;
}
.profile_modal.w_50
.modal-footer
button
{
width
:
50%
;
padding
:
5px
;}
.profile_modal.w_50
.modal-footer
button
{
width
:
50%
;
padding
:
5px
;
}
.profile_modal
.modal-header
.profile_desc
{
width
:
100%
;
}
.profile_modal
.modal-header
.profile_desc
{
width
:
100%
;
}
.profile_modal
.modal-header
.profile_name
{
.profile_modal
.modal-header
.profile_name
{
width
:
100%
;
width
:
100%
;
text-align
:
center
;
text-align
:
center
;
...
...
public_new/js/chat-db.js
View file @
558f93ca
// 名前空間
// 名前空間
var
CHAT_DB
=
{};
var
CHAT_DB
=
{};
// ios用
function
callNativeApp
(
iosKey
,
jsonData
)
{
console
.
log
(
"callNativeApp called"
);
var
result
;
try
{
var
key
=
iosKey
;
var
data
=
jsonData
;
var
payload
=
{
key
:
key
,
data
:
data
};
// payloadの形 {"type":"SJbridge","data":{"name":"abc","role":"dev"}}
// resにObjective-cからのレスポンスが返る
result
=
prompt
(
JSON
.
stringify
(
payload
));
console
.
log
(
result
);
}
catch
(
err
)
{
console
.
log
(
'The native context does not exist yet'
);
}
return
result
;
}
//ロカールDBからルーム一覧情報を取得
//ロカールDBからルーム一覧情報を取得
CHAT_DB
.
getRoomList
=
function
(
roomType
,
keyWord
)
{
CHAT_DB
.
getRoomList
=
function
(
roomType
,
keyWord
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
return
JSON
.
parse
(
iosRoomList
);
return
JSON
.
parse
(
callNativeApp
(
"getRoomList"
,
{
"roomType"
:
roomType
,
"keyWord"
:
keyWord
}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
return
JSON
.
parse
(
android
.
getRoomList
(
roomType
,
keyWord
));
return
JSON
.
parse
(
android
.
getRoomList
(
roomType
,
keyWord
));
}
}
};
};
var
iosRoomList
;
CHAT_DB
.
getIosRoomList
=
function
(
roomList
)
{
iosRoomList
=
roomList
;
CHAT_DB
.
getRoomList
(
0
);
};
CHAT_DB
.
callGetRoomList
=
function
(
roomType
)
{
CHAT_DB
.
callGetRoomList
=
function
(
roomType
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
webkit
.
messageHandlers
.
getRoomList
.
postMessage
({
roomType
}
);
return
JSON
.
parse
(
callNativeApp
(
"getRoomList"
,
{
"roomType"
:
roomType
})
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getRoomList
(
roomType
));
return
JSON
.
parse
(
android
.
getRoomList
(
roomType
));
...
@@ -27,10 +38,9 @@ CHAT_DB.callGetRoomList = function(roomType) {
...
@@ -27,10 +38,9 @@ CHAT_DB.callGetRoomList = function(roomType) {
}
}
//ロカールDBからログインしたユーザのデータを取得する。
//ロカールDBからログインしたユーザのデータを取得する。
CHAT_DB
.
getMyInfo
=
function
(
input
)
{
CHAT_DB
.
getMyInfo
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getMyInfo"
,
{}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getMyInfo
());
return
JSON
.
parse
(
android
.
getMyInfo
());
...
@@ -39,7 +49,7 @@ CHAT_DB.getMyInfo = function(input) {
...
@@ -39,7 +49,7 @@ CHAT_DB.getMyInfo = function(input) {
CHAT_DB
.
getMessages
=
function
(
roomId
)
{
CHAT_DB
.
getMessages
=
function
(
roomId
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getMessages"
,
{
"roomId"
:
roomId
}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getMessageList
(
roomId
));
return
JSON
.
parse
(
android
.
getMessageList
(
roomId
));
...
@@ -57,7 +67,7 @@ CHAT_DB.getFavoriteUsersNotInRoom = function() {
...
@@ -57,7 +67,7 @@ CHAT_DB.getFavoriteUsersNotInRoom = function() {
CHAT_DB
.
getFavoriteUsers
=
function
()
{
CHAT_DB
.
getFavoriteUsers
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getFavoriteUsers"
,
{}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getFavoriteUsers
());
return
JSON
.
parse
(
android
.
getFavoriteUsers
());
...
@@ -66,7 +76,7 @@ CHAT_DB.getFavoriteUsers = function() {
...
@@ -66,7 +76,7 @@ CHAT_DB.getFavoriteUsers = function() {
CHAT_DB
.
getFavoriteGroups
=
function
()
{
CHAT_DB
.
getFavoriteGroups
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getFavoriteGroups"
,
{}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getFavoriteGroups
());
return
JSON
.
parse
(
android
.
getFavoriteGroups
());
...
@@ -75,7 +85,7 @@ CHAT_DB.getFavoriteGroups = function() {
...
@@ -75,7 +85,7 @@ CHAT_DB.getFavoriteGroups = function() {
CHAT_DB
.
getMyGroupUsers
=
function
()
{
CHAT_DB
.
getMyGroupUsers
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getMyGroupUsers"
,
{}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getMyGroupUsers
());
return
JSON
.
parse
(
android
.
getMyGroupUsers
());
...
@@ -84,7 +94,7 @@ CHAT_DB.getMyGroupUsers = function() {
...
@@ -84,7 +94,7 @@ CHAT_DB.getMyGroupUsers = function() {
CHAT_DB
.
getGroupInfo
=
function
(
groupId
)
{
CHAT_DB
.
getGroupInfo
=
function
(
groupId
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getGroupInfo"
,
{
"groupId"
:
groupId
}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getGroupInfo
(
groupId
));
return
JSON
.
parse
(
android
.
getGroupInfo
(
groupId
));
...
@@ -103,7 +113,7 @@ CHAT_DB.loadSelectedUsers = function() {
...
@@ -103,7 +113,7 @@ CHAT_DB.loadSelectedUsers = function() {
CHAT_DB
.
getNameCardData
=
function
(
shopMemberId
)
{
CHAT_DB
.
getNameCardData
=
function
(
shopMemberId
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getNameCardData"
,
{
"shopMemberId"
:
shopMemberId
}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
return
JSON
.
parse
(
android
.
getNameCardData
(
shopMemberId
));
return
JSON
.
parse
(
android
.
getNameCardData
(
shopMemberId
));
}
}
...
@@ -111,7 +121,7 @@ CHAT_DB.getNameCardData = function(shopMemberId) {
...
@@ -111,7 +121,7 @@ CHAT_DB.getNameCardData = function(shopMemberId) {
CHAT_DB
.
getMyGroupShopMemberByName
=
function
(
shopMemberName
)
{
CHAT_DB
.
getMyGroupShopMemberByName
=
function
(
shopMemberName
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getMyGroupShopMemberByName"
,
{
"shopMemberName"
:
shopMemberName
}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getMyGroupShopMemberByName
(
shopMemberName
));
return
JSON
.
parse
(
android
.
getMyGroupShopMemberByName
(
shopMemberName
));
...
@@ -129,7 +139,7 @@ CHAT_DB.getMyGroupShopMemberNotInRoomByName = function(shopMemberName) {
...
@@ -129,7 +139,7 @@ CHAT_DB.getMyGroupShopMemberNotInRoomByName = function(shopMemberName) {
CHAT_DB
.
getAllGroupShopMemberByName
=
function
(
shopMemberName
)
{
CHAT_DB
.
getAllGroupShopMemberByName
=
function
(
shopMemberName
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getAllGroupShopMemberByName"
,
{
"shopMemberName"
:
shopMemberName
}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getAllGroupShopMemberByName
(
shopMemberName
));
return
JSON
.
parse
(
android
.
getAllGroupShopMemberByName
(
shopMemberName
));
...
@@ -147,7 +157,7 @@ CHAT_DB.getAllGroupShopMemberNotInRoomByName = function(shopMemberName) {
...
@@ -147,7 +157,7 @@ CHAT_DB.getAllGroupShopMemberNotInRoomByName = function(shopMemberName) {
CHAT_DB
.
getGroupByName
=
function
(
groupName
)
{
CHAT_DB
.
getGroupByName
=
function
(
groupName
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getGroupByName"
,
{
"groupName"
:
groupName
}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getGroupByName
(
groupName
));
return
JSON
.
parse
(
android
.
getGroupByName
(
groupName
));
...
@@ -156,7 +166,7 @@ CHAT_DB.getGroupByName = function(groupName) {
...
@@ -156,7 +166,7 @@ CHAT_DB.getGroupByName = function(groupName) {
CHAT_DB
.
getUsersInRoom
=
function
(
roomId
)
{
CHAT_DB
.
getUsersInRoom
=
function
(
roomId
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要
return
JSON
.
parse
(
callNativeApp
(
"getUsersInRoom"
,
{
"roomId"
:
roomId
}));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
//String形式をJsonに変更してReturn
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getUsersInRoom
(
roomId
));
return
JSON
.
parse
(
android
.
getUsersInRoom
(
roomId
));
...
@@ -164,25 +174,9 @@ CHAT_DB.getUsersInRoom = function(roomId) {
...
@@ -164,25 +174,9 @@ CHAT_DB.getUsersInRoom = function(roomId) {
}
}
// アーカイブ一覧
// アーカイブ一覧
var
iosArchiveList
;
CHAT_DB
.
callGetArchiveList
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
iosArchiveList
=
""
;
webkit
.
messageHandlers
.
getArchiveList
.
postMessage
();
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
CHAT_UI
.
refreshArchiveScreen
();
}
};
CHAT_DB
.
getIosArchiveList
=
function
(
archiveList
)
{
iosArchiveList
=
archiveList
;
CHAT_UI
.
refreshArchiveScreen
();
};
CHAT_DB
.
getArchiveList
=
function
()
{
CHAT_DB
.
getArchiveList
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
return
JSON
.
parse
(
iosArchiveList
);
return
JSON
.
parse
(
callNativeApp
(
"getArchiveList"
,
{})
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
// TODO
// TODO
}
}
...
@@ -190,58 +184,25 @@ CHAT_DB.getArchiveList = function() {
...
@@ -190,58 +184,25 @@ CHAT_DB.getArchiveList = function() {
CHAT_DB
.
updateArchiveList
=
function
()
{
CHAT_DB
.
updateArchiveList
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
webkit
.
messageHandlers
.
updateArchiveList
.
postMessage
();
webkit
.
messageHandlers
.
updateArchiveList
.
postMessage
(
{}
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
// TODO
// TODO
}
}
};
};
// アーカイブ一覧検索
// アーカイブ一覧検索
var
iosSearchArchiveList
;
var
searchWord
;
CHAT_DB
.
callGetArchiveByName
=
function
(
keyword
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
iosSearchArchiveList
=
""
;
searchWord
=
keyword
;
webkit
.
messageHandlers
.
getArchiveByName
.
postMessage
({
keyword
});
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
ARCHIVE_UI
.
refreshSearchScreen
(
keyword
);
}
};
CHAT_DB
.
getIosSearchArchiveList
=
function
(
archiveList
)
{
iosSearchArchiveList
=
archiveList
;
ARCHIVE_UI
.
refreshSearchScreen
(
searchWord
);
};
CHAT_DB
.
getArchiveByName
=
function
(
archiveName
)
{
CHAT_DB
.
getArchiveByName
=
function
(
archiveName
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
return
JSON
.
parse
(
iosSearchArchiveList
);
return
JSON
.
parse
(
callNativeApp
(
"getArchiveByName"
,
{
"archiveName"
:
archiveName
})
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
// TODO
// TODO
}
}
};
};
// アーカイブ詳細
// アーカイブ詳細
var
iosArchiveDetail
;
CHAT_DB
.
getArchiveDetail
=
function
(
archiveId
)
{
CHAT_DB
.
getIosArchiveDetail
=
function
(
archiveDetail
)
{
iosArchiveDetail
=
archiveDetail
;
CHAT_DB
.
callGetArchiveDetail
(
archiveDetail
.
archiveId
);
};
CHAT_DB
.
callGetArchiveDetail
=
function
(
archiveId
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
iosArchiveDetail
=
""
;
webkit
.
messageHandlers
.
getArchiveDetail
.
postMessage
({
archiveId
});
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
CHAT_UI
.
refreshArchiveDetailScreen
(
archiveId
);
}
};
CHAT_DB
.
getArchiveDetail
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
return
JSON
.
parse
(
iosArchiveDetail
);
return
JSON
.
parse
(
callNativeApp
(
"getArchiveDetail"
,
{
"archiveId"
:
archiveId
})
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
// TODO
// TODO
}
}
...
...
public_new/js/chat-ui.js
View file @
558f93ca
...
@@ -126,6 +126,7 @@ $('#room-search').on('input', function(event) {
...
@@ -126,6 +126,7 @@ $('#room-search').on('input', function(event) {
}
else
{
}
else
{
if
(
IS_ONLINE
==
'true'
)
{
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateRoomList
();
android
.
updateRoomList
();
webkit
.
messageHandlers
.
updateRoomList
.
postMessage
({});
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
dismissLoadingIndicator
();
CHAT_UI
.
dismissLoadingIndicator
();
}
}
...
@@ -417,6 +418,7 @@ $('a[data-toggle="pill"]').on('show.bs.tab', function(e) {
...
@@ -417,6 +418,7 @@ $('a[data-toggle="pill"]').on('show.bs.tab', function(e) {
if
(
IS_ONLINE
==
'true'
)
{
if
(
IS_ONLINE
==
'true'
)
{
socket
.
emit
(
'leaveRoom'
,
function
()
{
socket
.
emit
(
'leaveRoom'
,
function
()
{
android
.
updateRoomList
();
android
.
updateRoomList
();
webkit
.
messageHandlers
.
updateRoomList
.
postMessage
({});
});
});
}
}
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
CHAT_UI
.
refreshRoomList
(
chatRoomType
.
DM
);
...
@@ -684,6 +686,17 @@ CHAT_UI.showConfirmView = function(isInvite) {
...
@@ -684,6 +686,17 @@ CHAT_UI.showConfirmView = function(isInvite) {
//todo android create room api
//todo android create room api
android
.
createChatRoom
(
"1"
,
userIdList
.
join
(
','
),
newRoomName
);
android
.
createChatRoom
(
"1"
,
userIdList
.
join
(
','
),
newRoomName
);
if
(
CHAT_UTIL
.
isIOS
())
{
// TODO
var
roomDic
=
{
roomType
:
"1"
,
userIdList
:
userIdList
.
join
(
','
),
roomName
:
newRoomName
};
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
roomDic
});
}
/*socket.emit('createNewRoom', userIdList, encodedRoomName, function(newRoomId) {
/*socket.emit('createNewRoom', userIdList, encodedRoomName, function(newRoomId) {
socket.emit('joinRoom', newRoomId, newRoomName, function() {
socket.emit('joinRoom', newRoomId, newRoomName, function() {
...
@@ -932,6 +945,11 @@ CHAT_UI.refreshContactScreen = function() {
...
@@ -932,6 +945,11 @@ CHAT_UI.refreshContactScreen = function() {
android
.
updateMyInfo
();
android
.
updateMyInfo
();
android
.
updateGroupUser
();
android
.
updateGroupUser
();
android
.
updateFavorite
();
android
.
updateFavorite
();
webkit
.
messageHandlers
.
updateGroupInfo
.
postMessage
({
'0'
});
webkit
.
messageHandlers
.
updateMyInfo
.
postMessage
({});
webkit
.
messageHandlers
.
updateGroupUser
.
postMessage
({});
webkit
.
messageHandlers
.
updateFavorite
.
postMessage
({});
}
}
var
myInfo
=
CHAT_DB
.
getMyInfo
();
var
myInfo
=
CHAT_DB
.
getMyInfo
();
...
@@ -1007,6 +1025,7 @@ CHAT_UI.refreshRoomList = function(roomType) {
...
@@ -1007,6 +1025,7 @@ CHAT_UI.refreshRoomList = function(roomType) {
if
(
IS_ONLINE
==
'true'
)
{
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateRoomList
();
android
.
updateRoomList
();
webkit
.
messageHandlers
.
updateRoomList
.
postMessage
({});
}
}
var
rooms
=
CHAT_DB
.
getRoomList
(
roomType
,
null
);
var
rooms
=
CHAT_DB
.
getRoomList
(
roomType
,
null
);
CHAT
.
globalIsInvite
=
false
;
CHAT
.
globalIsInvite
=
false
;
...
@@ -1044,7 +1063,7 @@ CHAT_UI.refreshRoomList = function(roomType) {
...
@@ -1044,7 +1063,7 @@ CHAT_UI.refreshRoomList = function(roomType) {
var
displayMsg
;
var
displayMsg
;
//TODO 協業の場合処理追加必要
//TODO 協業の場合処理追加必要
if
(
room
.
messageType
==
messageType
.
TEXT
||
room
.
messageType
==
messageType
.
TEXT
)
displayMsg
=
room
.
message
;
if
(
room
.
messageType
==
messageType
.
TEXT
||
room
.
messageType
==
messageType
.
TEXT
)
displayMsg
=
room
.
message
;
if
(
room
.
messageType
==
messageType
.
IMAGE
||
room
.
messageType
==
messageType
.
SYSTEM
)
displayMsg
=
getLocalizedString
(
"image"
);
if
(
room
.
messageType
==
messageType
.
IMAGE
||
room
.
messageType
==
messageType
.
VIDEO
)
displayMsg
=
getLocalizedString
(
"image"
);
var
attendUserName
=
[];
var
attendUserName
=
[];
room
.
attendUsers
.
forEach
(
function
(
user
)
{
room
.
attendUsers
.
forEach
(
function
(
user
)
{
user
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
user
.
profileUrl
);
user
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
user
.
profileUrl
);
...
@@ -1094,12 +1113,14 @@ CHAT_UI.refreshRoomList = function(roomType) {
...
@@ -1094,12 +1113,14 @@ CHAT_UI.refreshRoomList = function(roomType) {
CHAT_UI
.
joinRoom
=
function
(
roomId
,
roomName
)
{
CHAT_UI
.
joinRoom
=
function
(
roomId
,
roomName
)
{
//native側に入場対象のroomId,roomNameを保存。(ルーム詳細画面初期化の時に使用。)
//native側に入場対象のroomId,roomNameを保存。(ルーム詳細画面初期化の時に使用。)
android
.
joinRoom
(
roomId
,
roomName
);
android
.
joinRoom
(
roomId
,
roomName
);
webkit
.
messageHandlers
.
roomInfosaveMessageHandlerId
.
postMessage
({
"roomId"
:
roomId
,
"roomName"
:
roomName
});
};
};
CHAT_UI
.
loadMessages
=
function
(
roomId
,
roomName
)
{
CHAT_UI
.
loadMessages
=
function
(
roomId
,
roomName
)
{
if
(
IS_ONLINE
==
'true'
)
{
if
(
IS_ONLINE
==
'true'
)
{
CHAT_SOCKET
.
connectSocket
();
CHAT_SOCKET
.
connectSocket
();
android
.
updateMessages
(
roomId
);
android
.
updateMessages
(
roomId
);
webkit
.
messageHandlers
.
updateMessages
.
postMessage
({
roomId
});
socket
.
emit
(
'exitRoom'
,
roomId
);
socket
.
emit
(
'exitRoom'
,
roomId
);
socket
.
emit
(
'joinRoom'
,
roomId
,
roomName
,
function
()
{
socket
.
emit
(
'joinRoom'
,
roomId
,
roomName
,
function
()
{
});
});
...
@@ -1290,6 +1311,7 @@ CHAT_UI.removeFavoriteUser = function(shopMemberId) {
...
@@ -1290,6 +1311,7 @@ CHAT_UI.removeFavoriteUser = function(shopMemberId) {
$
(
'#userNameCard'
).
modal
(
'hide'
);
$
(
'#userNameCard'
).
modal
(
'hide'
);
$
(
'#myNameCard'
).
modal
(
'hide'
);
$
(
'#myNameCard'
).
modal
(
'hide'
);
android
.
removeFavoriteUser
(
shopMemberId
);
android
.
removeFavoriteUser
(
shopMemberId
);
webkit
.
messageHandlers
.
removeFavoriteUser
.
postMessage
({
shopMemberId
});
$
(
'.shopmember_'
+
shopMemberId
).
removeClass
(
'active'
);
$
(
'.shopmember_'
+
shopMemberId
).
removeClass
(
'active'
);
$
(
'.shopmember_'
+
shopMemberId
).
addClass
(
'disable'
);
$
(
'.shopmember_'
+
shopMemberId
).
addClass
(
'disable'
);
CHAT_UI
.
dismissLoadingIndicator
();
CHAT_UI
.
dismissLoadingIndicator
();
...
@@ -1313,6 +1335,7 @@ CHAT_UI.insertFavoriteUser = function(shopMemberId) {
...
@@ -1313,6 +1335,7 @@ CHAT_UI.insertFavoriteUser = function(shopMemberId) {
CHAT_UI
.
removeFavoriteGroup
=
function
(
groupId
)
{
CHAT_UI
.
removeFavoriteGroup
=
function
(
groupId
)
{
android
.
removeFavoriteGroup
(
groupId
);
android
.
removeFavoriteGroup
(
groupId
);
webkit
.
messageHandlers
.
removeFavoriteGroup
.
postMessage
({
groupId
});
$
(
'.group_'
+
groupId
).
removeClass
(
'active'
);
$
(
'.group_'
+
groupId
).
removeClass
(
'active'
);
$
(
'.group_'
+
groupId
).
addClass
(
'disable'
);
$
(
'.group_'
+
groupId
).
addClass
(
'disable'
);
CHAT_UI
.
dismissLoadingIndicator
();
CHAT_UI
.
dismissLoadingIndicator
();
...
@@ -1350,6 +1373,7 @@ CHAT_UI.refreshAllGroupSearch = function(paramGroupId) {
...
@@ -1350,6 +1373,7 @@ CHAT_UI.refreshAllGroupSearch = function(paramGroupId) {
//オンライン状態であればサーバから情報更新。
//オンライン状態であればサーバから情報更新。
if
(
IS_ONLINE
==
'true'
)
{
if
(
IS_ONLINE
==
'true'
)
{
android
.
updateGroupInfo
(
groupId
);
android
.
updateGroupInfo
(
groupId
);
webkit
.
messageHandlers
.
updateGroupInfo
.
postMessage
({
groupId
});
}
}
//画面エリアを初期化。
//画面エリアを初期化。
...
@@ -1443,6 +1467,7 @@ CHAT_UI.startChat = function(userShopMemberId,userName) {
...
@@ -1443,6 +1467,7 @@ CHAT_UI.startChat = function(userShopMemberId,userName) {
// 参加ユーザ名でルーム名を生成
// 参加ユーザ名でルーム名を生成
let
newRoomName
=
CHAT
.
globalLoginParameter
.
loginId
+
','
+
userName
;
let
newRoomName
=
CHAT
.
globalLoginParameter
.
loginId
+
','
+
userName
;
android
.
createChatRoom
(
chatRoomType
.
DM
,
userIdList
.
join
(
','
),
newRoomName
);
android
.
createChatRoom
(
chatRoomType
.
DM
,
userIdList
.
join
(
','
),
newRoomName
);
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
chatRoomType
.
DM
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
newRoomName
});
CHAT_UI
.
hideNamecard
(
nameCardAreaId
.
USER
);
CHAT_UI
.
hideNamecard
(
nameCardAreaId
.
USER
);
};
};
...
...
public_new/js/chat-websocket.js
View file @
558f93ca
...
@@ -199,6 +199,7 @@ function setSocketAction () {
...
@@ -199,6 +199,7 @@ function setSocketAction () {
text
:
message
.
text
,
text
:
message
.
text
,
from
:
message
.
from
,
from
:
message
.
from
,
profileImage
:
message
.
profileImagePath
,
profileImage
:
message
.
profileImagePath
,
shopMemberId
:
message
.
userId
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtTime
:
messageTime
.
createdAtTime
,
createdAtTime
:
messageTime
.
createdAtTime
,
isToday
:
true
isToday
:
true
...
...
public_new/js/chat.js
View file @
558f93ca
...
@@ -135,14 +135,18 @@ CHAT.uploadImage = function(formData) {
...
@@ -135,14 +135,18 @@ CHAT.uploadImage = function(formData) {
}
}
let
downloadPath
=
CMS_SERVER_URL
+
'/chatapi/file/download?fileName='
+
imageName
+
'&roomId='
+
CHAT
.
globalLoginParameter
.
roomId
;
let
downloadPath
=
CMS_SERVER_URL
+
'/chatapi/file/download?fileName='
+
imageName
+
'&roomId='
+
CHAT
.
globalLoginParameter
.
roomId
;
const
aTag
=
$
(
'<a/>'
,
{
id
:
"attachedImages"
})
const
image
=
$
(
'<img/>'
,{
src
:
imgPath
,
width
:
'auto'
,
style
:
'max-width:100%'
});
var
videoSrc
=
CMS_SERVER_URL
+
'/chatapi/file/getImage?fileName='
+
res
.
fileName
+
'&roomId='
+
CHAT
.
globalLoginParameter
.
roomId
;
const
totalDiv
=
$
(
'<div/>'
,
{
id
:
"attachedImages"
});
const
videoTag
=
$
(
'<video/>'
,
{
controls
:
"true"
,
width
:
'auto'
,
style
:
'max-width:100%'
});
const
source
=
$
(
'<source/>'
,
{
src
:
videoSrc
});
const
downloadIcon
=
$
(
'<a/>'
,{
href
:
downloadPath
,
class
:
'fa fa-download'
,
download
:
res
.
fileName
});
const
downloadIcon
=
$
(
'<a/>'
,{
href
:
downloadPath
,
class
:
'fa fa-download'
,
download
:
res
.
fileName
});
aTag
.
append
(
image
);
videoTag
.
append
(
source
);
aTag
.
append
(
downloadIcon
);
totalDiv
.
append
(
videoTag
);
totalDiv
.
append
(
downloadIcon
);
let
text
=
aTag
.
prop
(
'outerHTML'
);
let
text
=
totalDiv
.
prop
(
'outerHTML'
);
let
encodedText
let
encodedText
try
{
try
{
encodedText
=
encodeURIComponent
(
text
)
encodedText
=
encodeURIComponent
(
text
)
...
...
public_new/template/template_user_message.html
View file @
558f93ca
<div
class=
"room_left"
>
<div
class=
"room_left"
>
<figure>
<figure>
<a
href=
"#"
data-toggle=
"modal"
data-target=
"#profileModal1"
><img
src=
"{{profileImage}}"
onError=
"this.src='./img/noImage.png'"
></a>
<a
href=
"#"
data-toggle=
"modal"
data-target=
"#profileModal1"
>
<img
src=
"{{profileImage}}"
onError=
"this.src='./img/noImage.png'"
onclick=
"CHAT_UI.makeNameCard({{shopMemberId}})"
>
</a>
</figure>
</figure>
<div
class=
"room_left-text"
>
<div
class=
"room_left-text"
>
<div
class=
"name"
>
{{from}}
</div>
<div
class=
"name"
>
{{from}}
</div>
...
...
public_new/template/template_user_name_card.html
View file @
558f93ca
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
<div
class=
"modal-dialog modal-dialog-centered"
role=
"document"
>
<div
class=
"modal-dialog modal-dialog-centered"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header border-0"
>
<div
class=
"modal-header border-0"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
<div
class=
"prifile_desc d-flex flex-row"
>
<div
class=
"prifile_desc d-flex flex-row"
>
<img
src=
"{{profileUrl}}"
onError=
"this.src='./img/noImage.png'"
/>
<img
src=
"{{profileUrl}}"
onError=
"this.src='./img/noImage.png'"
/>
<div
class=
"prifile_name"
><span>
{{name}}
</span></div>
<div
class=
"prifile_name"
><span>
{{name}}
</span></div>
</div>
</div>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
</div>
<div
class=
"modal-body"
id=
"userNameCard-scroll"
>
<div
class=
"modal-body"
id=
"userNameCard-scroll"
>
{{#groupPathList}}
{{#groupPathList}}
...
...
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