aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/static/scripts.js
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src/main/static/scripts.js')
-rw-r--r--juick-www/src/main/static/scripts.js60
1 files changed, 1 insertions, 59 deletions
diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js
index 588e4fdb..c6293266 100644
--- a/juick-www/src/main/static/scripts.js
+++ b/juick-www/src/main/static/scripts.js
@@ -187,11 +187,6 @@ function wsShutdown() {
}
}
-function isTreeMode() {
- // relies on UserThread.printReplies implementation TODO keep this in cookie or something
- return document.querySelector('.title2-right > a').href.match(/\?view=(\w+)/)[1] == 'list';
-}
-
function wsIncomingReply(msg) {
let content = document.getElementById('content');
if (!content) { return; }
@@ -234,15 +229,7 @@ function wsIncomingReply(msg) {
killy.embedLinksToX(li.querySelector('.msg-cont'), '.msg-links', '.msg-txt a');
- if (isTreeMode() && (msg.replyto > 0)) {
- let p = document.getElementById(msg.replyto);
- let m = parseInt(p.style.marginLeft) + 20;
- while (p.nextElementSibling && (parseInt(p.nextElementSibling.style.marginLeft) >= m)) { p = p.nextElementSibling; }
- li.style.marginLeft = m + 'px';
- p.parentNode.insertBefore(li, p.nextSibling);
- } else {
- document.getElementById('replies').appendChild(li);
- }
+ document.getElementById('replies').appendChild(li);
updateRepliesCounter();
}
@@ -309,29 +296,6 @@ function newMessage(evt) {
}
}
-function showMoreReplies(el, id) {
- var foldedReplies = el.closest('li').querySelector('.msg-comments');
- if (!foldedReplies) { return; }
- foldedReplies.style.display = 'none';
-
- var replies = document.querySelectorAll('#replies>li'),
- flagshow = 0,
- i = 0;
- for (; i < replies.length; i += 1) {
- if (flagshow == 1) {
- if (replies[i].style.display == 'none') {
- replies[i].style.display = 'block';
- } else {
- break;
- }
- }
- if (replies[i].id == id) {
- flagshow = 1;
- }
- }
- return false;
-}
-
function showCommentForm(mid, rid) {
let reply = document.getElementById(rid);
let formTarget = reply.querySelector('div.msg-cont .msg-comment-target');
@@ -422,19 +386,6 @@ function attachMessagePhoto(div) {
}
}
-function unfoldReply() {
- var anchor = window.location.hash.substring(1);
- if ((0 + anchor) > 0) {
- var el = document.getElementById(anchor);
- if (!el) { return; }
- while (el.style.display === 'none') {
- el = el.previousElementSibling;
- }
- showMoreReplies(el, el.getAttribute('id'));
- window.location.replace(window.location.hash);
- }
-}
-
function showMessageLinksDialog(mid, rid) {
let hlink = window.location.protocol + '//juick.com/' + mid;
let mlink = '#' + mid;
@@ -667,13 +618,6 @@ ready(function () {
var pageMID = content.getAttribute('data-mid');
if (pageMID > 0) {
document.querySelectorAll('li.msg').forEach(li => {
- let showMoreBtn = li.querySelector('.msg-comments');
- if (showMoreBtn) {
- showMoreBtn.addEventListener('click', function (e) {
- showMoreReplies(e.target, li.id);
- e.preventDefault();
- });
- }
let showReplyFormBtn = li.querySelector('.a-thread-comment');
if (showReplyFormBtn) {
showReplyFormBtn.addEventListener('click', function (e) {
@@ -784,9 +728,7 @@ ready(function () {
article.classList.add('nsfw');
}
});
- unfoldReply();
initWS();
- window.addEventListener('hashchange', unfoldReply);
window.addEventListener('pagehide', wsShutdown);