Commit 41fff884 by Takatoshi Miura

Merge branch 'origin/#573_message' into 'release_sp3'

android追加修正分の適用

See merge request !62
parents 3d74fed4 1234b73c
......@@ -219,7 +219,7 @@ CHAT_DB.getArchiveDetail = function(archiveId) {
CHAT_DB.updateArchiveDetail = function(archiveId) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.updateArchiveDetail.postMessage({archiveId});
webkit.messageHandlers.updateArchiveDetail.postMessage(archiveId);
} else if (CHAT_UTIL.isAndroid()) {
android.updateArchiveDetail(archiveId);
}
......@@ -249,4 +249,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
......@@ -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');
}
......@@ -1344,7 +1352,11 @@ $('#addUserConfirmBtn').on('click', function(e) {
});
CHAT_UI.roomDisplayOff = function() {
if (typeof(android) != "undefined") {
android.roomDisplayOff();
} else {
webkit.messageHandlers.roomDisplayOff.postMessage({});
}
}
CHAT_UI.favoriteUserChange = function(shopMemberId, star) {
......@@ -1367,8 +1379,12 @@ 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);
result = android.removeFavoriteUser(shopMemberId);
} else {
result = CHAT_DB.removeFavoriteUser(shopMemberId);
}
if (!result) {
$('.shopmember_'+shopMemberId).addClass('active');
$('.shopmember_'+shopMemberId).removeClass('disable');
......@@ -1376,18 +1392,18 @@ CHAT_UI.removeFavoriteUser = function(shopMemberId) {
$('.shopmember_'+shopMemberId).removeClass('active');
$('.shopmember_'+shopMemberId).addClass('disable');
}
} else {
webkit.messageHandlers.removeFavoriteUser.postMessage({shopMemberId});
$('.shopmember_'+shopMemberId).removeClass('active');
$('.shopmember_'+shopMemberId).addClass('disable');
}
CHAT_UI.dismissLoadingIndicator();
};
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');
......@@ -1404,7 +1420,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');
......@@ -1413,7 +1429,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');
......@@ -1543,7 +1564,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);
};
......@@ -1711,9 +1732,7 @@ CHAT_UI.refreshArchiveDetailScreen = function(archiveId) {
// 参加ユーザ情報を表示
let attendUserList = archive.attendUserIds;
if (CHAT_UTIL.isAndroid()) {
attendUserList = JSON.parse(archive.attendUserIds);
}
attendUserList.forEach(function(user) {
......@@ -2028,8 +2047,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('-')
......@@ -2076,7 +2094,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});
}
}
});
......@@ -2111,7 +2129,11 @@ CHAT_UI.showAddUserConfirmView = function() {
selectedUserList.forEach(function(user){
userIdList.push(user.shopMemberId);
})
if (typeof(android) != "undefined") {
android.inviteUsers(userIdList.join(','));
} else {
webkit.messageHandlers.inviteUsers.postMessage({"userIdList": userIdList.join(',')});
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment