Commit 81855cfd by Takuya Ogawa

Merge branch 'features/1.3.0_chat' into 'features/1.3.0'

- redmineのチャットについて

See merge request !45
parents 5016151a 9b701f9b
......@@ -123,15 +123,16 @@ img {
-webkit-overflow-scrolling: touch;
max-height: calc(100vh - 92px);
}
.srch_bar input{ border:1px solid #cdcdcd; border-width:0 0 1px 0; width:80%; padding:2px 0 4px 6px; background:none;}
.srch_bar .input-group-addon button {
.room_srch_bar input{ border:1px solid #cdcdcd; border-width:0 0 1px 0; width:100%; padding:2px 0 4px 6px; background:none;}
.room_srch_bar .input-group-addon button {
background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
border: medium none;
padding: 0;
color: #707070;
font-size: 18px;
}
.srch_bar .input-group-addon { margin: 0 0 0 -27px;}
.room_srch_bar .input-group-addon { margin: 0 0 0 -27px;}
.inbox_chat {
overflow-y: scroll;
......@@ -557,3 +558,16 @@ a.article:hover {
white-space: pre-wrap;
word-wrap: break-word;
}
.dropdown-item-checked::before {
position: absolute;
left: .4rem;
content: '✓';
font-weight: 600;
}
.room_srch_bar {
display: inline-block;
text-align: left;
width: 100%;
}
\ No newline at end of file
......@@ -174,19 +174,30 @@ socket.on('refreshRoomList', function(rooms, activeRoomId = null){
// チャットルームリストを削除する
jQuery('#room_list').html('');
// #36146に対応
let roomListTitle = getLocalizedString("roomListTitle")
$('.titleRoomName').text(roomListTitle)
let keywordSearchMode = false;
if(jQuery('#roomKeyword').val().length > 0) {
keywordSearchMode = true;
}
if (rooms.length === 0) {
// #36146に対応
// 検索結果がない場合のメッセージを追加
if (!keywordSearchMode) {
let emptyListString = getLocalizedString("roomListEmptyString")
jQuery('#room_list').append(`<center class="text-secondary">${emptyListString}</center>`);
} else {
let emptyListString = getLocalizedString("searchRoomListEmptyString")
jQuery('#room_list').append(`<center class="text-secondary">${emptyListString}</center>`);
}
}
// チャットルームの様式を読み込む
const template = jQuery('#room-template').html();
let keywordSearchMode = false;
if(jQuery('#roomKeyword').val().length > 0) {
keywordSearchMode = true;
}
rooms.forEach( function(room) {
room.profileImagePath = './images/user-profile.png'
......@@ -232,11 +243,24 @@ socket.on('refreshRoomList', function(rooms, activeRoomId = null){
jQuery('#room_list').append(obj);
});
if(rooms.length > 0){
jQuery('.roomListIcon').show()
// #36146に対応
if(rooms.length > 0) {
if(!keywordSearchMode) {
$(".roomListIcon").show()
$('#roomDeleteButton, #arrangeRooms').show()
} else {
$(".roomListIcon").show()
$('#roomDeleteButton, #arrangeRooms').hide()
}
} else {
jQuery('.roomListIcon').hide()
if(!keywordSearchMode) {
$(".roomListIcon").hide()
} else {
$(".roomListIcon").show()
$('#roomDeleteButton, #arrangeRooms').hide()
}
}
jQuery('#createChatRoom').show()
// Rotate
......@@ -294,12 +318,12 @@ jQuery('#roomDeleteButton').on('click', function(e){
} else {
// チャットルーム削除アイコンが表示されていない場合、表示する
jQuery('.deleteBox').finish().hide().fadeTo('slow',1).show();
// #36129に対応
let deleteRoomTitle = getLocalizedString("deleteRoomTitle")
$('.titleRoomName').text(deleteRoomTitle)
// 重複処理を防ぐためにチャットリストのクリックイベントを消す
jQuery('.chat_list').off('click');
let roomListTitle = getLocalizedString("deleteRoomTitle")
$('.titleRoomName').text(roomListTitle)
// チャットルームの削除アイコンにクリックイベントを与える
jQuery('.deleteBox').off('click');
jQuery('.deleteBox').on('click', function(e){
......@@ -313,6 +337,10 @@ jQuery('#roomDeleteButton').on('click', function(e){
}
// チャットルームから退場する
socket.emit('exitRoom', jQuery(this).data('roomId'));
// #36129に対応
let roomListTitle = getLocalizedString("roomListTitle")
$('.titleRoomName').text(roomListTitle)
}
});
}
......@@ -320,6 +348,9 @@ jQuery('#roomDeleteButton').on('click', function(e){
// チャットルームのリストを未確認順で整列したデータを要請
jQuery('#orderByUnread').on('click', function(event){
// #36145
jQuery('#orderByTime').removeClass('dropdown-item-checked')
jQuery('#orderByUnread').removeClass('dropdown-item-checked').addClass('dropdown-item-checked')
//loadingIndicatorを表示
showLoadingIndicator();
event.preventDefault();
......@@ -328,6 +359,9 @@ jQuery('#orderByUnread').on('click', function(event){
// メッセージの送信時間順で整列したデータを要請
jQuery('#orderByTime').on('click', function(event){
// #36145
jQuery('#orderByTime').removeClass('dropdown-item-checked').addClass('dropdown-item-checked')
jQuery('#orderByUnread').removeClass('dropdown-item-checked')
//loadingIndicatorを表示
showLoadingIndicator();
event.preventDefault();
......@@ -340,14 +374,15 @@ jQuery('#roomKeywordSearch').on('shown.bs.dropdown', function (e){
jQuery('#roomKeyword').focus();
});
jQuery('#roomKeyword').on('input', function(event) {
// #36145
jQuery('#roomKeyButton').on('click', function(event) {
// キーワード検索の値が変更し、検索を行う
if (!jQuery(this).val()) {
if (!jQuery('#roomKeyword').val()) {
// 検索結果がない場合、チャットルームのリストを表示する
socket.emit('getRoomList');
} else {
// 検索結果が有る場合、結果を表示する
socket.emit('roomSearch', jQuery(this).val());
socket.emit('roomSearch', jQuery('#roomKeyword').val());
}
});
......@@ -1001,6 +1036,9 @@ jQuery('a[data-toggle="pill"]').on('show.bs.tab', function (e) {
jQuery('#newRoomName').val('');
jQuery('#userSelectionLength').text('');
globalSelectedUserList = [];
// #36145
jQuery('#orderByTime').removeClass('dropdown-item-checked').addClass('dropdown-item-checked')
jQuery('#orderByUnread').removeClass('dropdown-item-checked')
break;
case '#pills-user':
jQuery("#backButton").show();
......@@ -1204,7 +1242,13 @@ function showConfirmView(isInvite){
}
} else {
if (jQuery('#select_user_list .user_list').find('.userCheckBox').length > 0) {
if (jQuery('#newRoomName').val().length > 0) {
// #36130に対応
const trimmedRoomName = jQuery('#newRoomName').val().trim()
if(trimmedRoomName.length == 0) {
//ルーム名を入力しなかったら、ルーム名textFieldにfocusを置く
jQuery('#newRoomName').focus();
alert("Input RoomName");
} else {
//loadingIndicatorを表示
showLoadingIndicator();
let userIdList = jQuery.makeArray(jQuery('#select_user_list .user_list').find('.userCheckBox')).map(function (e) {
......@@ -1222,9 +1266,6 @@ function showConfirmView(isInvite){
jQuery('#pills-chat-tab').tab('show');
});
});
} else {
//ルーム名を入力しなかったら、ルーム名textFieldにfocusを置く
jQuery('#newRoomName').focus();
}
}
}
......@@ -1277,7 +1318,7 @@ function htmlElementTextInitialize(languageCode) {
$("#groupPageSubtitle").text(getLocalizedString("groupPageSubtitle"))
$("#chatKeywordSearch").attr("placeholder", getLocalizedString("chatKeywordSearch"))
$("#chatKeyword").attr("placeholder", getLocalizedString("roomKeywordPlaceHolder"))
$("#userListKeyword").attr("placeholder", getLocalizedString("userListKeyword"))
$("#newRoomName").attr("placeholder", getLocalizedString("newRoomName"))
}
......
......@@ -30,5 +30,6 @@ $.lang.en = {
"newRoomName":"Enter Roomname",
"everyoneIsHere":"Everyone is in the chat.",
"people":"people",
"searchResult":"Results"
"searchResult":"Results",
"searchRoomListEmptyString":"No search results."
}
......@@ -3,7 +3,7 @@ $.lang.ja = {
"participants":"メンバーリスト",
"exitRoom":"退出 ",
"roomListTitle":"ルーム一覧",
"deleteRoomTitle":"ルーム削除",
"deleteRoomTitle":"ルーム削除",
"inviteUsersButton":"招待",
"inviteUsersTitle":"メンバー追加",
"createRoomSubtitle":"ルーム生成",
......@@ -30,5 +30,6 @@ $.lang.ja = {
"newRoomName":"ルーム名を入力",
"everyoneIsHere":"招待可能なメンバーがいません。",
"people":"人",
"searchResult":"件のトーク"
"searchResult":"件のトーク",
"searchRoomListEmptyString":"検索結果がありません。"
}
......@@ -2,7 +2,7 @@ $.lang.ko = {
"chat_placeholder":"메시지를 입력하세요.",
"participants":"대화상대",
"exitRoom":"나가기 ",
"roomListTitle":"채팅",
"roomListTitle":"채팅 리스트",
"deleteRoomTitle":"채팅방 삭제",
"inviteUsersButton":"유저 초대",
"inviteUsersTitle":"대화상대 추가",
......@@ -30,5 +30,6 @@ $.lang.ko = {
"newRoomName":"방제목 입력",
"everyoneIsHere":"초대가능한 유저가 없습니다.",
"people":"명",
"searchResult":"건의 결과"
"searchResult":"건의 결과",
"searchRoomListEmptyString":"검색 결과가 없습니다."
}
......@@ -31,7 +31,7 @@
<i class="fa fa-sort-amount-down"></i>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="arrangeRooms">
<a id="orderByTime" class="dropdown-item" href="#">OrderByTime</a>
<a id="orderByTime" class="dropdown-item dropdown-item-checked" href="#">OrderByTime</a>
<a id="orderByUnread" class="dropdown-item" href="#">OrderByUnread</a>
</div>
</li>
......@@ -40,7 +40,14 @@
<i class="fa fa-search"></i>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="roomKeywordSearch">
<input id="roomKeyword" class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<div class="room_srch_bar">
<div class="stylish-input-group">
<input id="roomKeyword" type="text" class="search-bar" placeholder="Search">
<span class="input-group-addon">
<button id="roomKeyButton" type="button"> <i class="fa fa-search" aria-hidden="true"></i> </button>
</span>
</div>
</div>
</div>
</li>
<!-- Chat Room Icons -->
......@@ -49,7 +56,7 @@
<i class="fa fa-search"></i>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="chatKeywordSearch">
<input id="chatKeyword" class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<input id="chatKeyword" class="form-control mr-sm-2" type="search-bar" placeholder="Search" aria-label="Search">
</div>
</li>
<li class="nav-item">
......
......@@ -1429,4 +1429,5 @@
<string name="msg_error_chat_500">チャットサーバーでシステムエラーが発生しました。</string>
<string name="msg_error_chat_join">チャットサーバーと接続に失敗しました。\n再度操作してください。</string>
<string name="msg_error_chat_text_length">メッセージの長さは0です。1文字以上を入力してください。</string>
<string name="msg_error_chat_input_roomname">ルーム名を入力してください。</string>
</resources>
......@@ -1437,4 +1437,5 @@
<string name="msg_error_chat_500">채팅 서버에서 시스템 오류가 발생했습니다.</string>
<string name="msg_error_chat_join">채팅서버 접속에 실패했습니다.\n다시 접속을 시도해보시기 바랍니다.</string>
<string name="msg_error_chat_text_length">메시지 길이가 0입니다. 한글자 이상의 문자를 입력하십시오.</string>
<string name="msg_error_chat_input_roomname">방 제목을 입력해 주십시오.</string>
</resources>
\ No newline at end of file
......@@ -1435,4 +1435,5 @@
<string name="msg_error_chat_500">System error occurred on the chat server.</string>
<string name="msg_error_chat_join">Failed to connect to chat server.\nplease try again.</string>
<string name="msg_error_chat_text_length">Message length is 0. please type 1 or more character.</string>
<string name="msg_error_chat_input_roomname">Please enter a room name.</string>
</resources>
\ No newline at end of file
......@@ -233,7 +233,7 @@
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:src="@drawable/ic_communication_push_message_list"
android:src="@drawable/ic_communication_chat_list"
android:visibility="visible" />
<TextView
......
......@@ -175,6 +175,10 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
message = getString(R.string.msg_error_chat_join);
} else if (message.equals("Message length error")) {
message = getString(R.string.msg_error_chat_text_length);
// #36130 start
} else if (message.equals("Input RoomName")) {
message = getString(R.string.msg_error_chat_input_roomname);
// #36130 end
} else {
message = message;
}
......
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