reply nav in replies
This commit is contained in:
parent
7f432d051e
commit
44ed5e8f56
@ -618,9 +618,12 @@ stopPropagation: (e) ->
|
|||||||
|
|
||||||
|
|
||||||
replyNav: ->
|
replyNav: ->
|
||||||
direction: if @textContent is '▲' then 'preceding' else 'following'
|
if REPLY
|
||||||
op: x("$direction::span[starts-with(@id, 'nothread')][1]", this).id
|
window.location: if @textContent is '▲' then '#navtop' else '#navbot'
|
||||||
window.location: "#$op"
|
else
|
||||||
|
direction: if @textContent is '▲' then 'preceding' else 'following'
|
||||||
|
op: x("$direction::span[starts-with(@id, 'nothread')][1]", this).id
|
||||||
|
window.location: "#$op"
|
||||||
|
|
||||||
|
|
||||||
if getValue('Reply Hiding')
|
if getValue('Reply Hiding')
|
||||||
@ -706,6 +709,26 @@ if getValue('Anonymize')
|
|||||||
remove(trip)
|
remove(trip)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if getValue('Reply Navigation')
|
||||||
|
callbacks.push((root) ->
|
||||||
|
arr: $$('span[id^=norep]', root)
|
||||||
|
for el in arr
|
||||||
|
span: tag('span')
|
||||||
|
up: tag('a')
|
||||||
|
up.textContent: '▲'
|
||||||
|
up.className: 'pointer'
|
||||||
|
up.addEventListener('click', replyNav, true)
|
||||||
|
down: tag('a')
|
||||||
|
down.textContent: '▼'
|
||||||
|
down.className: 'pointer'
|
||||||
|
down.addEventListener('click', replyNav, true)
|
||||||
|
span.appendChild(document.createTextNode(' '))
|
||||||
|
span.appendChild(up)
|
||||||
|
span.appendChild(document.createTextNode(' '))
|
||||||
|
span.appendChild(down)
|
||||||
|
inAfter(el, span)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if not REPLY
|
if not REPLY
|
||||||
if getValue('Thread Hiding')
|
if getValue('Thread Hiding')
|
||||||
@ -755,26 +778,6 @@ if not REPLY
|
|||||||
if location.hash is '#1'
|
if location.hash is '#1'
|
||||||
window.location: window.location
|
window.location: window.location
|
||||||
|
|
||||||
if getValue('Reply Navigation')
|
|
||||||
callbacks.push((root) ->
|
|
||||||
arr: $$('span[id^=norep]', root)
|
|
||||||
for el in arr
|
|
||||||
span: tag('span')
|
|
||||||
up: tag('a')
|
|
||||||
up.textContent: '▲'
|
|
||||||
up.className: 'pointer'
|
|
||||||
up.addEventListener('click', replyNav, true)
|
|
||||||
down: tag('a')
|
|
||||||
down.textContent: '▼'
|
|
||||||
down.className: 'pointer'
|
|
||||||
down.addEventListener('click', replyNav, true)
|
|
||||||
span.appendChild(document.createTextNode(' '))
|
|
||||||
span.appendChild(up)
|
|
||||||
span.appendChild(document.createTextNode(' '))
|
|
||||||
span.appendChild(down)
|
|
||||||
inAfter(el, span)
|
|
||||||
)
|
|
||||||
|
|
||||||
if getValue('Thread Expansion')
|
if getValue('Thread Expansion')
|
||||||
omitted: $$('span.omittedposts')
|
omitted: $$('span.omittedposts')
|
||||||
for span in omitted
|
for span in omitted
|
||||||
|
|||||||
@ -710,10 +710,15 @@ cursor: pointer; \
|
|||||||
};
|
};
|
||||||
replyNav = function replyNav() {
|
replyNav = function replyNav() {
|
||||||
var direction, op;
|
var direction, op;
|
||||||
direction = this.textContent === '▲' ? 'preceding' : 'following';
|
if (REPLY) {
|
||||||
op = x(("" + direction + "::span[starts-with(@id, 'nothread')][1]"), this).id;
|
window.location = this.textContent === '▲' ? '#navtop' : '#navbot';
|
||||||
window.location = ("#" + op);
|
return window.location;
|
||||||
return window.location;
|
} else {
|
||||||
|
direction = this.textContent === '▲' ? 'preceding' : 'following';
|
||||||
|
op = x(("" + direction + "::span[starts-with(@id, 'nothread')][1]"), this).id;
|
||||||
|
window.location = ("#" + op);
|
||||||
|
return window.location;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
getValue('Reply Hiding') ? callbacks.push(function(root) {
|
getValue('Reply Hiding') ? callbacks.push(function(root) {
|
||||||
var _c, _d, _e, _f, _g, _h, _i, _j, a, next, obj, td, tds;
|
var _c, _d, _e, _f, _g, _h, _i, _j, a, next, obj, td, tds;
|
||||||
@ -822,6 +827,31 @@ cursor: pointer; \
|
|||||||
}
|
}
|
||||||
return _l;
|
return _l;
|
||||||
}) : null;
|
}) : null;
|
||||||
|
getValue('Reply Navigation') ? callbacks.push(function(root) {
|
||||||
|
var _i, _j, _k, _l, arr, down, el, span, up;
|
||||||
|
arr = $$('span[id^=norep]', root);
|
||||||
|
_i = []; _k = arr;
|
||||||
|
for (_j = 0, _l = _k.length; _j < _l; _j++) {
|
||||||
|
el = _k[_j];
|
||||||
|
_i.push((function() {
|
||||||
|
span = tag('span');
|
||||||
|
up = tag('a');
|
||||||
|
up.textContent = '▲';
|
||||||
|
up.className = 'pointer';
|
||||||
|
up.addEventListener('click', replyNav, true);
|
||||||
|
down = tag('a');
|
||||||
|
down.textContent = '▼';
|
||||||
|
down.className = 'pointer';
|
||||||
|
down.addEventListener('click', replyNav, true);
|
||||||
|
span.appendChild(document.createTextNode(' '));
|
||||||
|
span.appendChild(up);
|
||||||
|
span.appendChild(document.createTextNode(' '));
|
||||||
|
span.appendChild(down);
|
||||||
|
return inAfter(el, span);
|
||||||
|
})());
|
||||||
|
}
|
||||||
|
return _i;
|
||||||
|
}) : null;
|
||||||
if (!REPLY) {
|
if (!REPLY) {
|
||||||
if (getValue('Thread Hiding')) {
|
if (getValue('Thread Hiding')) {
|
||||||
delform = $('form[name=delform]');
|
delform = $('form[name=delform]');
|
||||||
@ -871,31 +901,6 @@ cursor: pointer; \
|
|||||||
}
|
}
|
||||||
location.hash === '#1' ? (window.location = window.location) : null;
|
location.hash === '#1' ? (window.location = window.location) : null;
|
||||||
}
|
}
|
||||||
getValue('Reply Navigation') ? callbacks.push(function(root) {
|
|
||||||
var _l, _m, _n, _o;
|
|
||||||
arr = $$('span[id^=norep]', root);
|
|
||||||
_l = []; _n = arr;
|
|
||||||
for (_m = 0, _o = _n.length; _m < _o; _m++) {
|
|
||||||
el = _n[_m];
|
|
||||||
_l.push((function() {
|
|
||||||
span = tag('span');
|
|
||||||
up = tag('a');
|
|
||||||
up.textContent = '▲';
|
|
||||||
up.className = 'pointer';
|
|
||||||
up.addEventListener('click', replyNav, true);
|
|
||||||
down = tag('a');
|
|
||||||
down.textContent = '▼';
|
|
||||||
down.className = 'pointer';
|
|
||||||
down.addEventListener('click', replyNav, true);
|
|
||||||
span.appendChild(document.createTextNode(' '));
|
|
||||||
span.appendChild(up);
|
|
||||||
span.appendChild(document.createTextNode(' '));
|
|
||||||
span.appendChild(down);
|
|
||||||
return inAfter(el, span);
|
|
||||||
})());
|
|
||||||
}
|
|
||||||
return _l;
|
|
||||||
}) : null;
|
|
||||||
if (getValue('Thread Expansion')) {
|
if (getValue('Thread Expansion')) {
|
||||||
omitted = $$('span.omittedposts');
|
omitted = $$('span.omittedposts');
|
||||||
_m = omitted;
|
_m = omitted;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user