Screw reply navigation, there are top and bottom links on 4chan itself. Also return guard.
This commit is contained in:
parent
e001cd3c98
commit
d546654cf2
@ -60,7 +60,6 @@
|
||||
'Comment Expansion': [true, 'Can expand too long comments.'],
|
||||
'Thread Expansion': [true, 'Can expand threads to view all replies.'],
|
||||
'Index Navigation': [false, 'Navigate to previous / next thread.'],
|
||||
'Reply Navigation': [false, 'Navigate to top / bottom of thread.'],
|
||||
'Check for Updates': [true, 'Check for updated versions of 4chan X Alpha.']
|
||||
},
|
||||
Filtering: {
|
||||
@ -2237,6 +2236,9 @@
|
||||
Nav = {
|
||||
init: function() {
|
||||
var next, prev, span;
|
||||
if (g.VIEW !== 'index' || !Conf['Index Navigation']) {
|
||||
return;
|
||||
}
|
||||
span = $.el('span', {
|
||||
id: 'navlinks'
|
||||
});
|
||||
@ -2256,18 +2258,10 @@
|
||||
});
|
||||
},
|
||||
prev: function() {
|
||||
if (g.VIEW === 'thread') {
|
||||
return window.scrollTo(0, 0);
|
||||
} else {
|
||||
return Nav.scroll(-1);
|
||||
}
|
||||
return Nav.scroll(-1);
|
||||
},
|
||||
next: function() {
|
||||
if (g.VIEW === 'thread') {
|
||||
return window.scrollTo(0, d.body.scrollHeight);
|
||||
} else {
|
||||
return Nav.scroll(+1);
|
||||
}
|
||||
return Nav.scroll(+1);
|
||||
},
|
||||
getThread: function(full) {
|
||||
var headRect, i, rect, thread, threads, topMargin, _i, _len;
|
||||
@ -6153,7 +6147,7 @@
|
||||
initFeature('Thread Stats', ThreadStats);
|
||||
initFeature('Thread Updater', ThreadUpdater);
|
||||
initFeature('Thread Watcher', ThreadWatcher);
|
||||
initFeature('Index/Reply Navigation', Nav);
|
||||
initFeature('Index Navigation', Nav);
|
||||
console.timeEnd('All initializations');
|
||||
$.on(d, '4chanMainInit', Main.initStyle);
|
||||
return $.ready(Main.initReady);
|
||||
|
||||
@ -10,7 +10,6 @@ Config =
|
||||
'Comment Expansion': [true, 'Can expand too long comments.']
|
||||
'Thread Expansion': [true, 'Can expand threads to view all replies.']
|
||||
'Index Navigation': [false, 'Navigate to previous / next thread.']
|
||||
'Reply Navigation': [false, 'Navigate to top / bottom of thread.']
|
||||
'Check for Updates': [true, 'Check for updated versions of <%= meta.name %>.']
|
||||
Filtering:
|
||||
'Anonymize': [false, 'Turn everyone Anonymous.']
|
||||
|
||||
@ -1027,6 +1027,8 @@ ArchiveLink =
|
||||
|
||||
Nav =
|
||||
init: ->
|
||||
return if g.VIEW isnt 'index' or !Conf['Index Navigation']
|
||||
|
||||
span = $.el 'span',
|
||||
id: 'navlinks'
|
||||
prev = $.el 'a',
|
||||
@ -1043,16 +1045,10 @@ Nav =
|
||||
$.on d, '4chanXInitFinished', -> $.add d.body, span
|
||||
|
||||
prev: ->
|
||||
if g.VIEW is 'thread'
|
||||
window.scrollTo 0, 0
|
||||
else
|
||||
Nav.scroll -1
|
||||
Nav.scroll -1
|
||||
|
||||
next: ->
|
||||
if g.VIEW is 'thread'
|
||||
window.scrollTo 0, d.body.scrollHeight
|
||||
else
|
||||
Nav.scroll +1
|
||||
Nav.scroll +1
|
||||
|
||||
getThread: (full) ->
|
||||
headRect = $.id('header-bar').getBoundingClientRect()
|
||||
|
||||
@ -344,7 +344,7 @@ Main =
|
||||
initFeature 'Thread Stats', ThreadStats
|
||||
initFeature 'Thread Updater', ThreadUpdater
|
||||
initFeature 'Thread Watcher', ThreadWatcher
|
||||
initFeature 'Index/Reply Navigation', Nav
|
||||
initFeature 'Index Navigation', Nav
|
||||
console.timeEnd 'All initializations'
|
||||
|
||||
$.on d, '4chanMainInit', Main.initStyle
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user