Commit 6fd316f9 by Kim Peace

Merge branch 'bug/#43889_namecard_and_favorite' into debug/console_logs

# Conflicts:
#	public_new/js/views/collaboration/collaboration.js
#	public_new/js/views/collaboration/share-event-listener.js
#	public_new/js/views/contact/namecard.js
parents 6dbdee16 485b0deb
......@@ -184,4 +184,5 @@ Common.startCollaboration = function (collaborationType) {
CHAT_SOCKET.emitCollaborationFinishMessage();
NativeBridgeDelegate.finishAllCollaboration();
NativeBridgeDelegate.startCollaboration(collaborationType);
Common.dismissLoadingIndicator();
};
......@@ -10,6 +10,10 @@ window.onscroll = function () {
return;
}
beforeScroll = window.scrollY;
ChatRoom.prependMessageWhenScrollIfNeeded();
};
ChatRoom.prependMessageWhenScrollIfNeeded = function () {
const beforeHeight = $(".room_container").height();
messageCount = $(".chat_message").length;
if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) {
......
......@@ -203,16 +203,6 @@ CollaborationUI.refreshForOffline = function () {
}
};
CollaborationUI.showLoadingIndicator = function () {
console.log("peacekim:: CollaborationUI.showLoadingIndicator");
$("#loadingIndicator").addClass("full_active");
};
CollaborationUI.hideLoadingIndicator = function () {
console.log("peacekim:: CollaborationUI.hideLoadingIndicator");
$("#loadingIndicator").removeClass("full_active");
};
CollaborationUI.displayAddUserButtonIfNeeded = function () {
console.log(
"peacekim:: CollaborationUI.displayAddUserButtonIfNeeded" +
......
......@@ -40,7 +40,6 @@ CoviewBridge.bindStartEvent = function () {
"peacekim:: CoviewBridge.bindStartEvent coview_api.addEventListener(start)"
);
CollaborationFeature.enableScrollLock();
CollaborationUI.hideLoadingIndicator();
});
};
......@@ -103,7 +102,6 @@ CoviewBridge.bindAllByeEvent = function () {
NativeBridgeDelegate.showExitHostAlert();
return;
}
CollaborationUI.hideLoadingIndicator();
});
};
......@@ -113,7 +111,6 @@ CoviewBridge.bindGuestByeEvent = function () {
console.log(
"peacekim:: CollaborationFeature.bindGuestByeEvent coview_api.addEventListener(guestbye)"
);
CollaborationUI.hideLoadingIndicator();
});
};
......@@ -126,7 +123,6 @@ CoviewBridge.bindDestroyEvent = function () {
CHAT_SOCKET.emitCollaborationFinishMessage();
alert(getLocalizedString("inform_exit_host_collaboration"));
CoviewBridge.exitCollaboration();
CollaborationUI.hideLoadingIndicator();
});
};
......@@ -281,7 +277,6 @@ CollaborationFeature.didReceivedJoinRoomInfoResponseMessage = function () {
alert(getLocalizedString("not_exist_sharing_call"));
coview_api.LeaveRoom();
$(".coview_share_area").hide();
CollaborationUI.hideLoadingIndicator();
NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName);
};
......@@ -577,7 +572,6 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
CollaborationUI.moveToVideoShareArea = function () {
console.log("peacekim:: CollaborationUI.moveToVideoShareArea");
CollaborationUI.showLoadingIndicator();
$(".coview_share_area").show();
$("#collabo_main").removeClass("none");
};
......@@ -143,9 +143,7 @@ Contact.refreshContactScreen = function () {
Contact.appendMyNamecard();
Contact.appendFavoritGroupList();
Contact.appendFavoritUsers();
Contact.reloadFavoriteList();
Contact.appendMyGroupList();
......@@ -173,6 +171,12 @@ Contact.appendMyNamecard = function () {
$("#myImg").attr("src", myInfo.profileImagePath);
};
Contact.reloadFavoriteList = function () {
$("#favoriteList").html("");
Contact.appendFavoritGroupList();
Contact.appendFavoritUsers();
};
Contact.appendFavoritGroupList = function () {
// グループの様式を読み込む
const groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
......@@ -221,37 +225,35 @@ Contact.appendMyGroupList = function () {
};
Contact.favoriteGroupChange = function (groupID, star) {
if ($(star).hasClass("active")) {
Contact.removeFavoriteGroup(groupID);
} else if ($(star).hasClass("disable")) {
Contact.insertFavoriteGroup(groupID);
const div = $(star);
if (div.hasClass("sp-circle")) {
return;
}
div.removeClass("star");
div.addClass("sp-circle");
setTimeout(() => {
if (div.hasClass("active")) {
Contact.removeFavoriteGroup(groupID, div);
} else if (div.hasClass("disable")) {
Contact.insertFavoriteGroup(groupID, div);
}
div.removeClass("sp-circle");
div.addClass("star");
Contact.reloadFavoriteList();
}, 0);
};
Contact.removeFavoriteGroup = function (groupID) {
Common.showLoadingIndicator();
var result = NativeBridgeDataSource.removeFavoriteGroup(groupID);
if (result) {
$(".group_" + groupID).removeClass("active");
$(".group_" + groupID).addClass("disable");
} else {
$(".group_" + groupID).addClass("active");
$(".group_" + groupID).removeClass("disable");
}
Common.dismissLoadingIndicator();
Contact.removeFavoriteGroup = function (groupID, div) {
const result = NativeBridgeDataSource.removeFavoriteGroup(groupID);
div.removeClass(result ? "active" : "disable");
div.addClass(result ? "disable" : "active");
};
Contact.insertFavoriteGroup = function (groupID) {
Common.showLoadingIndicator();
Contact.insertFavoriteGroup = function (groupID, div) {
const result = NativeBridgeDataSource.addFavoriteGroup(groupID);
if (result) {
$(".group_" + groupID).removeClass("disable");
$(".group_" + groupID).addClass("active");
} else {
$(".group_" + groupID).addClass("disable");
$(".group_" + groupID).removeClass("active");
}
Common.dismissLoadingIndicator();
div.removeClass(result ? "disable" : "active");
div.addClass(result ? "active" : "disable");
};
//全グループ検索画面表示。
......
var Namecard = {};
Namecard.makeNameCard = function (shopMemberID) {
console.log("peacekim:: Namecard.makeNameCard shopMemberID: "+ shopMemberID);
console.log("peacekim:: Namecard.makeNameCard shopMemberID: " + shopMemberID);
if (currentUserInfo.shopMemberID == shopMemberID) {
return;
}
......@@ -31,7 +31,12 @@ Namecard.makeNameCard = function (shopMemberID) {
// template_user_name_card.html
Namecard.startChat = function (userShopMemberID, userName) {
console.log("peacekim:: Namecard.startChat userShopMemberID: "+ userShopMemberID + ", userName: " + userName);
console.log(
"peacekim:: Namecard.startChat userShopMemberID: " +
userShopMemberID +
", userName: " +
userName
);
Common.showLoadingIndicator();
let userIDList = [];
userIDList.push(userShopMemberID);
......@@ -49,7 +54,12 @@ Namecard.startChat = function (userShopMemberID, userName) {
// template_user_name_card.html
Namecard.startVoice = function (userShopMemberID, userName) {
console.log("peacekim:: Namecard.startVoice userShopMemberID: "+ userShopMemberID + ", userName: "+userName);
console.log(
"peacekim:: Namecard.startVoice userShopMemberID: " +
userShopMemberID +
", userName: " +
userName
);
Common.showLoadingIndicator();
let userIDList = [];
userIDList.push(userShopMemberID);
......@@ -72,41 +82,47 @@ Namecard.favoriteUserChange = function (shopMemberID, star) {
", star: " +
star
);
if ($(star).hasClass("active")) {
Namecard.removeFavoriteUser(shopMemberID);
} else if ($(star).hasClass("disable")) {
Namecard.insertFavoriteUser(shopMemberID);
const div = $(star);
if (div.hasClass("sp-circle")) {
return;
}
div.removeClass("star");
div.addClass("sp-circle");
setTimeout(() => {
if (div.hasClass("active")) {
Namecard.removeFavoriteUser(shopMemberID, div);
} else if (div.hasClass("disable")) {
Namecard.insertFavoriteUser(shopMemberID, div);
}
div.removeClass("sp-circle");
div.addClass("star");
if (typeof Contact != "undefined") {
Contact.reloadFavoriteList();
}
if (div.hasClass("active")) {
window.scroll(0, window.scrollY + $(".my_info_sell").height());
} else if (div.hasClass("disable")) {
window.scroll(0, window.scrollY - $(".my_info_sell").height());
}
}, 0);
};
Namecard.removeFavoriteUser = function (shopMemberID) {
Common.showLoadingIndicator();
$("#userNameCard").modal("hide");
$("#myNameCard").modal("hide");
Namecard.removeFavoriteUser = function (shopMemberID, div) {
const result = NativeBridgeDataSource.removeFavoriteUser(shopMemberID);
if (result) {
$(".shopmember_" + shopMemberID).removeClass("active");
$(".shopmember_" + shopMemberID).addClass("disable");
} else {
$(".shopmember_" + shopMemberID).addClass("active");
$(".shopmember_" + shopMemberID).removeClass("disable");
}
Common.dismissLoadingIndicator();
div.removeClass(result ? "active" : "disable");
div.addClass(result ? "disable" : "active");
};
Namecard.insertFavoriteUser = function (shopMemberID) {
console.log("peacekim:: Namecard.insertFavoriteUser shopMemberID: "+ shopMemberID);
$("#userNameCard").modal("hide");
$("#myNameCard").modal("hide");
Namecard.insertFavoriteUser = function (shopMemberID, div) {
console.log(
"peacekim:: Namecard.insertFavoriteUser shopMemberID: " + shopMemberID
);
const result = NativeBridgeDataSource.addFavoriteUser(shopMemberID);
if (result) {
$(".shopmember_" + shopMemberID).removeClass("disable");
$(".shopmember_" + shopMemberID).addClass("active");
} else {
$(".shopmember_" + shopMemberID).addClass("disable");
$(".shopmember_" + shopMemberID).removeClass("active");
}
Common.dismissLoadingIndicator();
div.removeClass(result ? "disable" : "active");
div.addClass(result ? "active" : "disable");
};
Namecard.refreshForOnline = function () {
......@@ -121,11 +137,12 @@ Namecard.refreshForOffline = function () {
Namecard.moveContactPage = function (paramGroupID) {
const groupID = paramGroupID;
if (window.location.pathname.includes("chat_room") ||
window.location.pathname.includes("archive_detail"))
{
if (
window.location.pathname.includes("chat_room") ||
window.location.pathname.includes("archive_detail")
) {
if (groupID == "") return;
NativeBridgeDelegate.setToMoveGroupId(groupID);
window.location.href = "contact.html";
}
}
};
<!-- TODO: peacekim:: this file is not using-->
<div class="modal fade profile_modal" id="profileModal1" tabindex="-1" role="dialog" aria-labelledby="profileModal1"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
......
......@@ -19,21 +19,19 @@
</div>
<div class="modal-footer border-0 justify-content-center">
{{#isFavorite}}
<button type="button" class="border-0 bg_navy"
onclick="CollaborationUI.removeFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton">
<button type="button" class="border-0 bg_navy" id="favoriteButton">
<div class="d-flex flex-column">
<span class="star active shopmember_{{shopMemberId}}"
onclick="CHAT_UI.favoriteUserChange('{{shopMemberId}}',this)"></span>
onclick="CollaborationUI.removeFavoriteUserInCollaboration({{shopMemberId}})"></span>
<span>お気に入り解除</span>
</div>
</button>
{{/isFavorite}}
{{^isFavorite}}
<button type="button" class="border-0 bg_navy"
onclick="CollaborationUI.insertFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton">
<button type="button" class="border-0 bg_navy" id="favoriteButton">
<div class="d-flex flex-column">
<span class="star disable shopmember_{{shopMemberId}}"
onclick="Namecard.favoriteUserChange('{{shopMemberId}}',this)"></span>
onclick="CollaborationUI.insertFavoriteUserInCollaboration({{shopMemberId}})"></span>
<span>お気に入り登録</span>
</div>
</button>
......
{{#userList}}
<div class="user_item">
<a href="javascript:return false;" onclick="Namecard.makeNameCard({{shopMemberId}})">
<a href="#" onclick="Namecard.makeNameCard({{shopMemberId}})">
<div class="d-flex flex-column">
<div class="img_wrap">
<img src="{{profileUrl}}" onError="this.src='./img/noImage.png'">
......
......@@ -2,7 +2,7 @@
<ul class="p-0 chat_make_room_list">
{{#groupUserList}}
<li class="d-flex align-items-center">
<a href="javascript:return false;" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;">
<a href="#" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l">
<div class="thumbnail">
......@@ -21,10 +21,10 @@
<div class="chat_item_r">
<div class="d-flex flex-column">
{{#isFavorite}}
<span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span>
<span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
{{/isFavorite}}
{{^isFavorite}}
<span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span>
<span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
{{/isFavorite}}
</div>
</div>
......
<ul class="p-0 chat_make_room_list" style="margin-top: 0px !important;border-top: none !important;">
<ul class="p-0" style="margin-top: 0px !important;border-top: none !important;">
{{#userList}}
<li class="d-flex align-items-center">
<a href="javascript:return false;" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;">
<li class="d-flex align-items-center userCell">
<a href="#" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l">
<div class="thumbnail">
......@@ -20,10 +20,10 @@
<div class="chat_item_r">
<div class="d-flex flex-column">
{{#isFavorite}}
<span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span>
<span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
{{/isFavorite}}
{{^isFavorite}}
<span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span>
<span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
{{/isFavorite}}
</div>
</div>
......
......@@ -18,24 +18,20 @@
{{/groupPathList}}
</div>
<div class="modal-footer border-0 justify-content-center">
{{#isFavorite}}
<button type="button" class="border-0" onclick="Namecard.removeFavoriteUser({{shopMemberId}})"
id="favoriteButton">
<button type="button" class="border-0" id="favoriteButton">
<div class="d-flex flex-column">
<span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange('{{shopMemberId}}', this)"></span>
{{#isFavorite}}
<span class="star active shopmember_{{shopMemberId}}"
onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
<span>お気に入り解除</span>
</div>
</button>
{{/isFavorite}}
{{^isFavorite}}
<button type="button" class="border-0" onclick="Namecard.insertFavoriteUser({{shopMemberId}})"
id="favoriteButton">
<div class="d-flex flex-column">
<span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange('{{shopMemberId}}', this)"></span>
{{/isFavorite}}
{{^isFavorite}}
<span class="star disable shopmember_{{shopMemberId}}"
onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
<span>お気に入り登録</span>
{{/isFavorite}}
</div>
</button>
{{/isFavorite}}
<button type="button" class="border-0" onclick="Namecard.startVoice('{{shopMemberId}}','{{name}}');">
<div class="d-flex flex-column">
<div class="img_wrap">
......
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