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
54452c9b
Commit
54452c9b
authored
Apr 16, 2021
by
Takatoshi Miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
android修正分の適用
parent
e22d4630
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
23 deletions
+93
-23
public_new/js/chat-db.js
+52
-2
public_new/js/chat-ui.js
+41
-21
No files found.
public_new/js/chat-db.js
View file @
54452c9b
...
...
@@ -240,4 +240,54 @@ CHAT_DB.getUserInfo = function(shopMemberId) {
//String形式をJsonに変更してReturn
return
JSON
.
parse
(
android
.
getUserInfo
(
shopMemberId
));
}
}
\ No newline at end of file
};
CHAT_DB
.
getBeforeRoomType
=
function
()
{
// Androidは実装不要
if
(
CHAT_UTIL
.
isIOS
())
{
return
callNativeApp
(
"getBeforeRoomType"
,
{});
}
};
CHAT_DB
.
getRoomType
=
function
()
{
// Androidは実装不要
if
(
CHAT_UTIL
.
isIOS
())
{
return
callNativeApp
(
"getRoomType"
,
{});
}
};
CHAT_DB
.
removeFavoriteUser
=
function
(
shopMemberId
)
{
// Androidは実装不要
if
(
CHAT_UTIL
.
isIOS
())
{
var
result
=
callNativeApp
(
"removeFavoriteUser"
,
{
"shopMemberId"
:
shopMemberId
});
if
(
result
==
"true"
)
{
return
true
;
}
else
{
return
false
;
}
}
};
CHAT_DB
.
addFavoriteUser
=
function
(
shopMemberId
)
{
// Androidは実装不要
if
(
CHAT_UTIL
.
isIOS
())
{
var
result
=
callNativeApp
(
"addFavoriteUser"
,
{
"shopMemberId"
:
shopMemberId
});
if
(
result
==
"true"
)
{
return
true
;
}
else
{
return
false
;
}
}
};
CHAT_DB
.
addFavoriteGroup
=
function
(
groupId
)
{
// Androidは実装不要
if
(
CHAT_UTIL
.
isIOS
())
{
var
result
=
callNativeApp
(
"addFavoriteGroup"
,
{
"groupId"
:
groupId
});
if
(
result
==
"true"
)
{
return
true
;
}
else
{
return
false
;
}
}
};
\ No newline at end of file
public_new/js/chat-ui.js
View file @
54452c9b
...
...
@@ -693,7 +693,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
if
(
typeof
(
android
)
!=
"undefined"
)
{
android
.
createChatRoom
(
"1"
,
userIdList
.
join
(
','
),
newRoomName
,
makeRoomFlg
.
MAKE_ROOM
);
}
else
{
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
"1"
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
newRoomName
});
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
"1"
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
newRoomName
,
"screenFlg"
:
makeRoomFlg
.
MAKE_ROOM
});
}
...
...
@@ -787,8 +787,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
if
(
typeof
(
android
)
!=
"undefined"
)
{
android
.
createChatRoom
(
"1"
,
userIdList
.
join
(
','
),
encodedRoomName
,
makeRoomFlg
.
MAKE_ROOM
);
}
else
{
//TODO
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
"1"
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
encodedRoomName
});
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
"1"
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
newRoomName
,
"screenFlg"
:
makeRoomFlg
.
MAKE_ROOM
});
}
}
}
...
...
@@ -1025,11 +1024,15 @@ CHAT_UI.refreshRoomList = function(roomType) {
var
beforeRoomType
;
if
(
typeof
(
android
)
!=
"undefined"
)
{
beforeRoomType
=
android
.
getBeforeRoomType
();
}
else
{
beforeRoomType
=
CHAT_DB
.
getBeforeRoomType
();
}
if
(
beforeRoomType
!=
null
)
{
roomType
=
beforeRoomType
;
if
(
typeof
(
android
)
!=
"undefined"
)
{
android
.
clearBeforeRoomType
();
}
else
{
webkit
.
messageHandlers
.
clearBeforeRoomType
.
postMessage
({});
}
}
CHAT_UI
.
showLoadingIndicator
();
...
...
@@ -1149,7 +1152,12 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
}
else
{
CHAT_UI
.
refreshForOffline
();
}
var
roomType
=
android
.
getRoomType
();
var
roomType
;
if
(
typeof
(
android
)
!=
"undefined"
)
{
roomType
=
android
.
getRoomType
();
}
else
{
roomType
=
CHAT_DB
.
getRoomType
();
}
if
(
roomType
==
chatRoomType
.
DM
)
{
$
(
'#roomMenu'
).
removeClass
(
'none'
);
}
...
...
@@ -1337,7 +1345,11 @@ $('#addUserConfirmBtn').on('click', function(e) {
});
CHAT_UI
.
roomDisplayOff
=
function
()
{
android
.
roomDisplayOff
();
if
(
typeof
(
android
)
!=
"undefined"
)
{
android
.
roomDisplayOff
();
}
else
{
webkit
.
messageHandlers
.
roomDisplayOff
.
postMessage
({});
}
}
CHAT_UI
.
favoriteUserChange
=
function
(
shopMemberId
,
star
)
{
...
...
@@ -1360,17 +1372,16 @@ CHAT_UI.removeFavoriteUser = function(shopMemberId) {
CHAT_UI
.
showLoadingIndicator
();
$
(
'#userNameCard'
).
modal
(
'hide'
);
$
(
'#myNameCard'
).
modal
(
'hide'
);
var
result
;
if
(
typeof
(
android
)
!=
"undefined"
)
{
var
result
=
android
.
removeFavoriteUser
(
shopMemberId
);
if
(
!
result
)
{
$
(
'.shopmember_'
+
shopMemberId
).
addClass
(
'active'
);
$
(
'.shopmember_'
+
shopMemberId
).
removeClass
(
'disable'
);
}
else
{
$
(
'.shopmember_'
+
shopMemberId
).
removeClass
(
'active'
);
$
(
'.shopmember_'
+
shopMemberId
).
addClass
(
'disable'
);
}
result
=
android
.
removeFavoriteUser
(
shopMemberId
);
}
else
{
result
=
CHAT_DB
.
removeFavoriteUser
(
shopMemberId
);
}
if
(
!
result
)
{
$
(
'.shopmember_'
+
shopMemberId
).
addClass
(
'active'
);
$
(
'.shopmember_'
+
shopMemberId
).
removeClass
(
'disable'
);
}
else
{
webkit
.
messageHandlers
.
removeFavoriteUser
.
postMessage
({
shopMemberId
});
$
(
'.shopmember_'
+
shopMemberId
).
removeClass
(
'active'
);
$
(
'.shopmember_'
+
shopMemberId
).
addClass
(
'disable'
);
}
...
...
@@ -1380,7 +1391,12 @@ CHAT_UI.removeFavoriteUser = function(shopMemberId) {
CHAT_UI
.
insertFavoriteUser
=
function
(
shopMemberId
)
{
$
(
'#userNameCard'
).
modal
(
'hide'
);
$
(
'#myNameCard'
).
modal
(
'hide'
);
var
result
=
android
.
addFavoriteUser
(
shopMemberId
);
var
result
;
if
(
typeof
(
android
)
!=
"undefined"
)
{
result
=
android
.
addFavoriteUser
(
shopMemberId
);
}
else
{
result
=
CHAT_DB
.
addFavoriteUser
(
shopMemberId
);
}
if
(
!
result
)
{
$
(
'.shopmember_'
+
shopMemberId
).
addClass
(
'disable'
);
$
(
'.shopmember_'
+
shopMemberId
).
removeClass
(
'active'
);
...
...
@@ -1397,7 +1413,7 @@ CHAT_UI.removeFavoriteGroup = function(groupId) {
if
(
typeof
(
android
)
!=
"undefined"
)
{
android
.
removeFavoriteGroup
(
groupId
);
}
else
{
webkit
.
messageHandlers
.
removeFavoriteGroup
.
postMessage
(
{
groupId
}
);
webkit
.
messageHandlers
.
removeFavoriteGroup
.
postMessage
(
groupId
);
}
$
(
'.group_'
+
groupId
).
removeClass
(
'active'
);
$
(
'.group_'
+
groupId
).
addClass
(
'disable'
);
...
...
@@ -1406,7 +1422,12 @@ CHAT_UI.removeFavoriteGroup = function(groupId) {
CHAT_UI
.
insertFavoriteGroup
=
function
(
groupId
)
{
CHAT_UI
.
showLoadingIndicator
();
var
result
=
android
.
addFavoriteGroup
(
groupId
);
var
result
;
if
(
typeof
(
android
)
!=
"undefined"
)
{
result
=
android
.
addFavoriteGroup
(
groupId
);
}
else
{
result
=
CHAT_DB
.
addFavoriteGroup
(
groupId
);
}
if
(
!
result
)
{
$
(
'.group_'
+
groupId
).
addClass
(
'disable'
);
$
(
'.group_'
+
groupId
).
removeClass
(
'active'
);
...
...
@@ -1536,7 +1557,7 @@ CHAT_UI.startChat = function(userShopMemberId,userName) {
if
(
typeof
(
android
)
!=
"undefined"
)
{
android
.
createChatRoom
(
chatRoomType
.
DM
,
userIdList
.
join
(
','
),
newRoomName
,
makeRoomFlg
.
NAME_CARD
);
}
else
{
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
chatRoomType
.
DM
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
newRoomName
});
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
"1"
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
newRoomName
,
"screenFlg"
:
makeRoomFlg
.
NAME_CARD
});
}
CHAT_UI
.
hideNamecard
(
nameCardAreaId
.
USER
);
};
...
...
@@ -2021,8 +2042,7 @@ CHAT_UI.showMakeRoomConfirmView = function() {
if
(
typeof
(
android
)
!=
"undefined"
)
{
android
.
createChatRoom
(
"1"
,
userIdList
.
join
(
','
),
newRoomName
,
makeRoomFlg
.
MAKE_ROOM
);
}
else
{
//TODO
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
"1"
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
newRoomName
});
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
"1"
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
newRoomName
,
"screenFlg"
:
makeRoomFlg
.
MAKE_ROOM
});
}
}
else
if
(
trimmedRoomName
.
includes
(
';'
)
||
trimmedRoomName
.
includes
(
'/'
)
||
trimmedRoomName
.
includes
(
'?'
)
||
trimmedRoomName
.
includes
(
':'
)
||
trimmedRoomName
.
includes
(
"@"
)
||
trimmedRoomName
.
includes
(
'&'
)
||
trimmedRoomName
.
includes
(
'='
)
||
trimmedRoomName
.
includes
(
"+"
)
||
trimmedRoomName
.
includes
(
'$'
)
||
trimmedRoomName
.
includes
(
","
)
||
trimmedRoomName
.
includes
(
'-'
)
...
...
@@ -2069,7 +2089,7 @@ CHAT_UI.showMakeRoomConfirmView = function() {
if
(
typeof
(
android
)
!=
"undefined"
)
{
android
.
createChatRoom
(
"1"
,
userIdList
.
join
(
','
),
trimmedRoomName
,
makeRoomFlg
.
MAKE_ROOM
);
}
else
{
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
"1"
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
encodedRoomName
});
webkit
.
messageHandlers
.
createChatRoom
.
postMessage
({
"roomType"
:
"1"
,
"userIdList"
:
userIdList
.
join
(
','
),
"roomName"
:
newRoomName
,
"screenFlg"
:
makeRoomFlg
.
MAKE_ROOM
});
}
}
});
...
...
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