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
4c63bc20
Commit
4c63bc20
authored
Mar 31, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
コード整理及びメッセージロード修正。
parent
cdf37962
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
15 deletions
+28
-15
public_new/js/chat-room.js
+26
-11
public_new/js/chat-ui.js
+1
-1
public_new/js/chat-websocket.js
+0
-2
public_new/js/chat.js
+1
-1
No files found.
public_new/js/chat-room.js
View file @
4c63bc20
var
lastscrollvalue
;
var
lastscrollvalue
;
window
.
onscroll
=
function
()
{
window
.
onscroll
=
function
()
{
var
a
=
$
(
'#messages'
);
var
scrollPosition
=
window
.
scrollY
||
document
.
documentElement
.
scrollTop
;
if
(
lastscrollvalue
==
undefined
)
{
if
(
scrollPosition
==
0
)
{
lastscrollvalue
=
a
.
scrollTop
;
console
.
log
(
'Scroll on TOP!!'
);
// sets lastscrollvalue
//TODO add getMessages(newLine);
}
else
if
(
a
.
scrollTop
>
lastscrollvalue
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
// downscroll rules will be here
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
lastscrollvalue
=
a
.
scrollTop
;
//android.getMessages()
}
}
else
if
(
a
.
scrollTop
<
lastscrollvalue
)
{
// upscroll rules will be here
lastscrollvalue
=
a
.
scrollTop
;
}
}
}
}
/*
$('#messages').scroll(function() {
console.log('messagescroll');
if ($(this).scrollTop() === 0) {
if (!$('#chatLoader').is(':visible')) {
// 現在、メッセージの個数以前をメッセージを読み込む
// ローディングアイコンを追加する
let loader = $('<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>')
$('#messages').prepend(loader)
loader.remove();
// socket.emit('getMessages', $(this).children().length, function() {
// // ローディングアイコンを削除する
// loader.remove();
// });
}
}
});*/
public_new/js/chat-ui.js
View file @
4c63bc20
...
@@ -1193,7 +1193,7 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
...
@@ -1193,7 +1193,7 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
$
(
'#messages'
).
scroll
();
$
(
'#messages'
).
scroll
();
}
}
}
}
CHAT_UI
.
waitForLoadingImage
(
jQueryMessages
,
CHAT_UI
.
scrollToBottom
);
// ユーザ削除ボタン表示しない
// ユーザ削除ボタン表示しない
$
(
"#userSelectionDeleteBtn"
).
hide
();
$
(
"#userSelectionDeleteBtn"
).
hide
();
CHAT_UI
.
scrollToBottom
();
CHAT_UI
.
scrollToBottom
();
...
...
public_new/js/chat-websocket.js
View file @
4c63bc20
...
@@ -163,8 +163,6 @@ function setSocketAction () {
...
@@ -163,8 +163,6 @@ function setSocketAction () {
// New Message
// New Message
// #36170
// #36170
socket
.
on
(
'newMessage'
,
function
(
message
,
roomId
,
roomName
)
{
socket
.
on
(
'newMessage'
,
function
(
message
,
roomId
,
roomName
)
{
console
.
log
(
'newMessage'
);
let
messageTime
=
CHAT_UTIL
.
formatDate
(
message
.
createdAt
);
let
messageTime
=
CHAT_UTIL
.
formatDate
(
message
.
createdAt
);
var
userMessageTemplate
;
var
userMessageTemplate
;
$
.
get
({
url
:
"./template/template_user_message.html"
,
async
:
false
}
$
.
get
({
url
:
"./template/template_user_message.html"
,
async
:
false
}
...
...
public_new/js/chat.js
View file @
4c63bc20
...
@@ -335,7 +335,7 @@ $(function() {
...
@@ -335,7 +335,7 @@ $(function() {
$
(
this
).
toggleClass
(
"filter"
);
$
(
this
).
toggleClass
(
"filter"
);
});
});
$
(
'#chat .search_form input[type="search"]'
).
keyup
(
function
(){
$
(
'#chat .search_form input[type="search"]'
).
click
(
function
(){
let
roomListTitle
=
getLocalizedString
(
"room_search_placeholder"
);
let
roomListTitle
=
getLocalizedString
(
"room_search_placeholder"
);
$
(
'#chatTitle'
).
text
(
roomListTitle
);
$
(
'#chatTitle'
).
text
(
roomListTitle
);
});
});
...
...
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