Commit 2e8f8963 by Takuya Ogawa

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

- redmineのチャットについて

See merge request !47
parents 81855cfd 60f258c6
...@@ -104,7 +104,7 @@ img { ...@@ -104,7 +104,7 @@ img {
color: #707070; color: #707070;
font-size: 18px; font-size: 18px;
} }
.srch_bar .input-group-addon { margin: 0 0 0 -27px;} .srch_bar .input-group-addon { margin: 0 0 0 0px;}
.chat_ib h5, .group_ib h5, .user_ib h5 { .chat_ib h5, .group_ib h5, .user_ib h5 {
font-size:1rem; font-size:1rem;
...@@ -124,15 +124,15 @@ img { ...@@ -124,15 +124,15 @@ img {
max-height: calc(100vh - 92px); max-height: calc(100vh - 92px);
} }
.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{ border:1px solid #cdcdcd; border-width:0 0 1px 0; width:75%; padding:2px 0 4px 6px; background:none;}
.room_srch_bar .input-group-addon button { .room_srch_bar .input-group-addon button {
background: rgba(0, 0, 0, 0) none repeat scroll 0 0; background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
border: medium none; border: medium none;
padding: 0; padding: 1;
color: #707070; color: #707070;
font-size: 18px; font-size: 18px;
} }
.room_srch_bar .input-group-addon { margin: 0 0 0 -27px;} .room_srch_bar .input-group-addon { margin: 0 0 0 0px;}
.inbox_chat { .inbox_chat {
overflow-y: scroll; overflow-y: scroll;
......
...@@ -301,7 +301,7 @@ jQuery('#roomDeleteButton').on('click', function(e){ ...@@ -301,7 +301,7 @@ jQuery('#roomDeleteButton').on('click', function(e){
//loadingIndicatorを表示 //loadingIndicatorを表示
showLoadingIndicator(); showLoadingIndicator();
let roomId = jQuery(this).data('roomId'); let roomId = jQuery(this).data('roomId');
let roomName = jQuery(this).data('roomName'); let roomName = jQuery(this).data('roomname');
socket.emit('joinRoom', roomId, roomName, function (){ socket.emit('joinRoom', roomId, roomName, function (){
jQuery('#messages').html(''); jQuery('#messages').html('');
jQuery('.titleRoomName').text(roomName).data('roomName', roomName); jQuery('.titleRoomName').text(roomName).data('roomName', roomName);
...@@ -327,7 +327,8 @@ jQuery('#roomDeleteButton').on('click', function(e){ ...@@ -327,7 +327,8 @@ jQuery('#roomDeleteButton').on('click', function(e){
// チャットルームの削除アイコンにクリックイベントを与える // チャットルームの削除アイコンにクリックイベントを与える
jQuery('.deleteBox').off('click'); jQuery('.deleteBox').off('click');
jQuery('.deleteBox').on('click', function(e){ jQuery('.deleteBox').on('click', function(e){
if (window.confirm('Do you want to leave this room?')) { // #36128
if (window.confirm('Do you want to delete this room?')) {
//loadingIndicatorを表示 //loadingIndicatorを表示
showLoadingIndicator(); showLoadingIndicator();
// 現在接続されているチャットルームを離れるとメッセージテップを初期化する // 現在接続されているチャットルームを離れるとメッセージテップを初期化する
...@@ -338,7 +339,7 @@ jQuery('#roomDeleteButton').on('click', function(e){ ...@@ -338,7 +339,7 @@ jQuery('#roomDeleteButton').on('click', function(e){
// チャットルームから退場する // チャットルームから退場する
socket.emit('exitRoom', jQuery(this).data('roomId')); socket.emit('exitRoom', jQuery(this).data('roomId'));
// #36129に対応 // #36129に対応
let roomListTitle = getLocalizedString("roomListTitle") let roomListTitle = getLocalizedString("roomListTitle")
$('.titleRoomName').text(roomListTitle) $('.titleRoomName').text(roomListTitle)
} }
...@@ -959,6 +960,16 @@ socket.on('refreshUserListInGroup', function(users, isInvite){ ...@@ -959,6 +960,16 @@ socket.on('refreshUserListInGroup', function(users, isInvite){
jQuery('#pills-user-tab').tab('show'); jQuery('#pills-user-tab').tab('show');
}); });
// #36135, #36142
jQuery('#newRoomName').on('keyup', function(event) {
if ($('#newRoomName').val().trim().length >= 20) {
alert("Please enter room name less than 20 characters");
var inputText = $('#newRoomName').val();
$('#newRoomName').val(inputText.substr(0, $('#newRoomName').prop("maxlength")));
event.preventDefault();
}
})
// グループ画面での検索 // グループ画面での検索
jQuery('#groupListKeyword').on('input', function(event) { jQuery('#groupListKeyword').on('input', function(event) {
// data-name値で当該キーワードが入っているグループのみを表示する。 // data-name値で当該キーワードが入っているグループのみを表示する。
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<button class="btn btn-primary" type="button" id="backButton"> <button class="btn btn-primary" type="button" id="backButton">
<i class="fa fa-arrow-left"></i> <i class="fa fa-arrow-left"></i>
</button> </button>
<input class="form-control mr-sm-2" id="newRoomName" placeholder="Room name" aria-label="Search"> <input class="form-control mr-sm-2" id="newRoomName" placeholder="Room name" aria-label="Search" maxlength="20">
</ul> </ul>
<a class="navbar-brand col-6 mr-0 text-truncate titleRoomName text-center" href="#">Chat</a> <a class="navbar-brand col-6 mr-0 text-truncate titleRoomName text-center" href="#">Chat</a>
<ul class="navbar-nav col-3" id="navbarRight"> <ul class="navbar-nav col-3" id="navbarRight">
...@@ -41,10 +41,12 @@ ...@@ -41,10 +41,12 @@
</a> </a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="roomKeywordSearch"> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="roomKeywordSearch">
<div class="room_srch_bar"> <div class="room_srch_bar">
<div class="stylish-input-group"> <div class="input-group">
<input id="roomKeyword" type="text" class="search-bar" placeholder="Search"> <input id="roomKeyword" type="text" class="search-bar" placeholder="Search">
<span class="input-group-addon"> <span class="input-group-addon">
<button id="roomKeyButton" type="button"> <i class="fa fa-search" aria-hidden="true"></i> </button> <button id="roomKeyButton" type="button">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</span> </span>
</div> </div>
</div> </div>
......
...@@ -1430,4 +1430,7 @@ ...@@ -1430,4 +1430,7 @@
<string name="msg_error_chat_join">チャットサーバーと接続に失敗しました。\n再度操作してください。</string> <string name="msg_error_chat_join">チャットサーバーと接続に失敗しました。\n再度操作してください。</string>
<string name="msg_error_chat_text_length">メッセージの長さは0です。1文字以上を入力してください。</string> <string name="msg_error_chat_text_length">メッセージの長さは0です。1文字以上を入力してください。</string>
<string name="msg_error_chat_input_roomname">ルーム名を入力してください。</string> <string name="msg_error_chat_input_roomname">ルーム名を入力してください。</string>
<string name="msg_chat_confirm_member">選択したメンバーをリストから削除しますか?</string>
<string name="msg_chat_confirm_delete">このチャットルームを削除しますか?</string>
<string name="msg_error_chat_room_name_too_long">ルーム名は文字列20字以内に入力してください。</string>
</resources> </resources>
...@@ -1438,4 +1438,7 @@ ...@@ -1438,4 +1438,7 @@
<string name="msg_error_chat_join">채팅서버 접속에 실패했습니다.\n다시 접속을 시도해보시기 바랍니다.</string> <string name="msg_error_chat_join">채팅서버 접속에 실패했습니다.\n다시 접속을 시도해보시기 바랍니다.</string>
<string name="msg_error_chat_text_length">메시지 길이가 0입니다. 한글자 이상의 문자를 입력하십시오.</string> <string name="msg_error_chat_text_length">메시지 길이가 0입니다. 한글자 이상의 문자를 입력하십시오.</string>
<string name="msg_error_chat_input_roomname">방 제목을 입력해 주십시오.</string> <string name="msg_error_chat_input_roomname">방 제목을 입력해 주십시오.</string>
<string name="msg_chat_confirm_member">목록에서 선택된 멤버를 삭제하시겠습니까?</string>
<string name="msg_chat_confirm_delete">이 방을 삭제 하시겠습니까?</string>
<string name="msg_error_chat_room_name_too_long">방 제목은 20자 이내로 입력해 주세요.</string>
</resources> </resources>
\ No newline at end of file
...@@ -1436,4 +1436,7 @@ ...@@ -1436,4 +1436,7 @@
<string name="msg_error_chat_join">Failed to connect to chat server.\nplease try again.</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_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> <string name="msg_error_chat_input_roomname">Please enter a room name.</string>
<string name="msg_chat_confirm_member">Do you want to remove selected members from the list?</string>
<string name="msg_chat_confirm_delete">Do you want to delete this room?</string>
<string name="msg_error_chat_room_name_too_long">Please enter room name less than 20 characters.</string>
</resources> </resources>
\ No newline at end of file
...@@ -179,6 +179,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -179,6 +179,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
} else if (message.equals("Input RoomName")) { } else if (message.equals("Input RoomName")) {
message = getString(R.string.msg_error_chat_input_roomname); message = getString(R.string.msg_error_chat_input_roomname);
// #36130 end // #36130 end
// #36142
} else if (message.equals("Please enter room name less than 20 characters")) {
message = getString(R.string.msg_error_chat_room_name_too_long);
} else { } else {
message = message; message = message;
} }
...@@ -220,6 +223,11 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -220,6 +223,11 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) { public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
if (message.equals("Do you want to leave this room?")) { if (message.equals("Do you want to leave this room?")) {
message = getString(R.string.msg_chat_confirm_exit); message = getString(R.string.msg_chat_confirm_exit);
} else if (message.equals("Do you want to remove selected members from the list?")) {
message = getString(R.string.msg_chat_confirm_member);
// #36128
} else if (message.equals("Do you want to delete this room?")) {
message = getString(R.string.msg_chat_confirm_delete);
} else { } else {
message = "Confirm ?"; message = "Confirm ?";
} }
......
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