Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chat_webview
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abookCommunication
chat_webview
Commits
4a26e07d
Commit
4a26e07d
authored
Feb 19, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
プールダウンリスト
JS追加。
parent
8fc5ddaf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
17 deletions
+83
-17
public/js/chat-ui.js
+82
-17
public/js/chat-websocket.js
+1
-0
public/js/libs/collapsible.js
+0
-0
No files found.
public/js/chat-ui.js
View file @
4a26e07d
...
@@ -998,6 +998,86 @@ CHAT_UI.joinRoom = function(roomId,roomName) {
...
@@ -998,6 +998,86 @@ CHAT_UI.joinRoom = function(roomId,roomName) {
};
};
//CHAT_UI.loadMessages = function(messages, roomId, roomName) {
//
// $('#messages').html('');
// $('.titleRoomName').text(roomName).data('roomName', roomName);
// $('#pills-chat-tab').tab('show');
// $("#message-search").attr("placeholder", getLocalizedString("chat_search_placeholder"));
// let jQueryMessages = $('#messages');
// // スクロールの変化を防ぐため以前画面の高さを保存する
// let beforeHeight = jQueryMessages.prop('scrollHeight');
// // メッセージ文字列の生成
// let workVal = "";
// messages.forEach(function(message) {
// let template = $('#message-template').html();
// if (message.selfFlg == 1) {
// template = $('#message-template-me').html();
// }
// let messageTime = CHAT_UTIL.formatDate(message.insertDate);
//
// if (message.profileUrl) {
// message.profileImagePath = CHAT.getProfileImgUrl(message.profileUrl)
// } else {
// message.profileImagePath = CHAT.getProfileImgUrl("")
// }
//
// // #36147
// message.message = message.message.toString();
// var replacePath = message.message;
// replacePath = replacePath.replaceAll('/acms',CHAT_SERVER_URL+'/acms');
// message.message = replacePath;
// let html = Mustache.render(template, {
// text: message.message,
// from: message.loginId,
// profileImage: message.profileImagePath,
// createdAtDay: messageTime.createdAtDay,
// createdAtTime: messageTime.createdAtTime
// });
// html = message.message.includes('attachedImages') || message.message.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html;
// workVal = html + workVal;
// })
//
// // メッセージの画面描画
// jQueryMessages.prepend(workVal);
// if (beforeHeight !== 0) {
// // 追加のメッセージ読み込み時は読み込み前のスクロール位置を維持
// setTimeout(function () {
// jQueryMessages.scrollTop(jQueryMessages.prop('scrollHeight') - beforeHeight);
// }, 400);
// } else {
// // 新規に入室の場合は最下部へスクロール
// CHAT_UI.waitForLoadingImage(jQueryMessages, CHAT_UI.scrollToBottom);
// // タブレット等、画面サイズが大きい場合、スクロール出来なくならないよう追加で10件メッセージを取得
// if ($(window).height() > jQueryMessages.height()) {
// $('#messages').scroll();
// }
// }
//
// // ユーザ削除ボタン表示しない
// $("#userSelectionDeleteBtn").hide();
//
// CHAT_UI.dismissLoadingIndicator();// add some...
//
// // チャットに遷移する
// $('#pills-chat-tab').tab('show');
//};
var
coll
=
document
.
getElementsByClassName
(
"collapsible"
);
var
i
;
for
(
i
=
0
;
i
<
coll
.
length
;
i
++
)
{
coll
[
i
].
addEventListener
(
"click"
,
function
()
{
this
.
classList
.
toggle
(
"collapsible-active"
);
var
content
=
this
.
nextElementSibling
;
if
(
content
.
style
.
display
===
"block"
)
{
content
.
style
.
display
=
"none"
;
}
else
{
content
.
style
.
display
=
"block"
;
}
});
}
CHAT_UI
.
loadMessages
=
function
(
messages
,
roomId
,
roomName
)
{
CHAT_UI
.
loadMessages
=
function
(
messages
,
roomId
,
roomName
)
{
$
(
'#messages'
).
html
(
''
);
$
(
'#messages'
).
html
(
''
);
...
@@ -1061,19 +1141,4 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) {
...
@@ -1061,19 +1141,4 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) {
// チャットに遷移する
// チャットに遷移する
$
(
'#pills-chat-tab'
).
tab
(
'show'
);
$
(
'#pills-chat-tab'
).
tab
(
'show'
);
};
};
\ No newline at end of file
var
coll
=
document
.
getElementsByClassName
(
"collapsible"
);
var
i
;
for
(
i
=
0
;
i
<
coll
.
length
;
i
++
)
{
coll
[
i
].
addEventListener
(
"click"
,
function
()
{
this
.
classList
.
toggle
(
"collapsible-active"
);
var
content
=
this
.
nextElementSibling
;
if
(
content
.
style
.
display
===
"block"
)
{
content
.
style
.
display
=
"none"
;
}
else
{
content
.
style
.
display
=
"block"
;
}
});
}
\ No newline at end of file
public/js/chat-websocket.js
View file @
4a26e07d
...
@@ -3,6 +3,7 @@ connectSocket(IS_ONLINE);
...
@@ -3,6 +3,7 @@ connectSocket(IS_ONLINE);
function
connectSocket
(
isOnline
)
{
function
connectSocket
(
isOnline
)
{
console
.
log
(
isOnline
)
console
.
log
(
isOnline
)
CHAT_UI
.
dismissLoadingIndicator
();
if
(
isOnline
==
'true'
)
{
if
(
isOnline
==
'true'
)
{
socket
=
io
(
CHAT_SERVER_URL
);
socket
=
io
(
CHAT_SERVER_URL
);
console
.
log
(
'insOnline'
);
console
.
log
(
'insOnline'
);
...
...
public/js/libs/collapsible.js
0 → 100644
View file @
4a26e07d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment