Commit 50c56bc6 by Lee Munkyeong

DM,GROUP検索

parent eefa57f7
......@@ -701,4 +701,8 @@ a.article:hover {
display: none;
overflow: hidden;
background-color: #f1f1f1;
}
.chat-list-type-btn {
width: 30%;
}
\ No newline at end of file
......@@ -22,15 +22,7 @@
let IS_MOBILE = true;
let IS_ONLINE = false;
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
};
android.getGlobalParameter();
</script>
</head>
<body>
......@@ -149,12 +141,17 @@
</div>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-chatlist" role="tabpanel" aria-labelledby="pills-chatlist-tab">
<div class="search-group">
<div class="input-group search-bar-fixed">
<input style="font-family:Arial, FontAwesome !important;" id="room-search" type="text" class="write_msg form-control" name="message" placeholder="&#xF002;" autocomplete="off">
</div>
</div>
<div class="text-center">
<button type="button" class="btn btn-primary chat-list-type-btn" id="dmBtn">Ok</button>
<button type="button" class="btn btn-primary chat-list-type-btn" id="groupBtn">Ok</button>
</div>
<div class="inbox_people">
<div id="room_list" class="inbox_chat row">
</div>
......@@ -163,6 +160,7 @@
</a>
</div>
</div>
<div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab">
...
</div>
......
......@@ -3,12 +3,12 @@ var CHAT_DB = {};
//ロカールDBからルーム一覧情報を取得
CHAT_DB.getRoomList = function(input) {
CHAT_DB.getRoomList = function(roomType) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList());
return JSON.parse(android.getRoomList(roomType));
}
};
......
......@@ -133,7 +133,7 @@ $('#room-search').on('input', function(event) {
} else {
if (IS_ONLINE == 'true') {
android.updateRoomList();
CHAT_UI.refreshRoomList();
CHAT_UI.refreshRoomList("1");
CHAT_UI.dismissLoadingIndicator();
}
}
......@@ -401,7 +401,7 @@ $('a[data-toggle="pill"]').on('show.bs.tab', function (e) {
android.updateRoomList();
});
}
CHAT_UI.refreshRoomList();
CHAT_UI.refreshRoomList("1");
CHAT_UI.dismissLoadingIndicator();
});
console.log("show #pills-chat")
......@@ -823,6 +823,9 @@ CHAT_UI.htmlElementTextInitialize = function(languageCode) {
$("#room-search").attr("placeholder",$("#room-search").attr("placeholder")+getLocalizedString("room_search_placeholder"));
$("#userListKeyword").attr("placeholder", getLocalizedString("userSearch"))
$("#newRoomName").attr("placeholder", getLocalizedString("newRoomName"))
$("#dmBtn").text(getLocalizedString("directMessageChatRoom"))
$("#groupBtn").text(getLocalizedString("groupChatRoom"))
}
// 画像の読み込みが全て終わったタイミングでコールバック実行
......@@ -900,8 +903,8 @@ CHAT_UI.refreshContactScreen = function() {
CHAT_UI.dismissLoadingIndicator();
}
CHAT_UI.refreshRoomList = function() {
var rooms = CHAT_DB.getRoomList();
CHAT_UI.refreshRoomList = function(roomType) {
var rooms = CHAT_DB.getRoomList(roomType);
CHAT.globalIsInvite = false;
activeRoomId = null;
// #36146に対応
......@@ -1061,4 +1064,13 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) {
// チャットに遷移する
$('#pills-chat-tab').tab('show');
};
\ No newline at end of file
};
$('#dmBtn').on('click', function (e){
CHAT_UI.refreshRoomList("1");
});
$('#groupBtn').on('click', function (e){
CHAT_UI.refreshRoomList("0");
});
\ No newline at end of file
var socket;
connectSocket(IS_ONLINE);
function connectSocket(isOnline) {
console.log(isOnline)
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
connectSocket();
};
android.getGlobalParameter();
function connectSocket() {
CHAT_UI.dismissLoadingIndicator();
if (isOnline == 'true') {
if (IS_ONLINE == 'true') {
socket = io(CHAT_SERVER_URL);
console.log('insOnline');
setSocketAction();
android.updateRoomList();
CHAT_UI.refreshRoomList();
CHAT_UI.refreshRoomList("1");
CHAT_UI.dismissLoadingIndicator();
$('#createChatRoom').show();
} else {
......@@ -18,12 +27,13 @@ function connectSocket(isOnline) {
if (CHAT_UTIL.isIOS()) {
//TODO IOSの場合
} else if (CHAT_UTIL.isAndroid()) {
console.log('insAnd');
//$('.overlay').removeClass('active undismissable');
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
android.getLoginParameter();
console.log('init')
CHAT_UI.refreshRoomList();
CHAT_UI.refreshRoomList("1");
CHAT_UI.dismissLoadingIndicator();
$('#createChatRoom').show();
}
......@@ -388,9 +398,9 @@ function setSocketAction () {
if (isInvite) {
$('#pills-chat-tab').tab('show');
} else {
if (isOnline == 'true') {
if (IS_ONLINE == 'true') {
android.updateRoomList();
CHAT_UI.refreshRoomList();
CHAT_UI.refreshRoomList("1");
CHAT_UI.dismissLoadingIndicator();
}
}
......
......@@ -54,5 +54,7 @@ $.lang.en = {
"photo":"Photo",
"video":"Video",
"contactListTitle":"Contact",
"contactSearch":"Contact search"
"contactSearch":"Contact search",
"directMessageChatRoom":"DM",
"groupChatRoom":"Group"
}
......@@ -54,5 +54,7 @@ $.lang.ja = {
"photo":"写真",
"video":"動画",
"contactListTitle":"コンタクト",
"contactSearch":"コンタクト検索"
"contactSearch":"コンタクト検索",
"directMessageChatRoom":"DM",
"groupChatRoom":"グループ"
}
......@@ -54,5 +54,7 @@ $.lang.ko = {
"photo":"사진",
"video":"동영상",
"contactListTitle":"연락처",
"contactSearch":"연락처 검색"
"contactSearch":"연락처 검색",
"directMessageChatRoom":"DM",
"groupChatRoom":"그룹"
}
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