Screw reply navigation, there are top and bottom links on 4chan itself. Also return guard.

This commit is contained in:
Nicolas Stepien 2013-02-17 21:57:20 +01:00
parent e001cd3c98
commit d546654cf2
4 changed files with 11 additions and 22 deletions

View File

@ -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);

View File

@ -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.']

View File

@ -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()

View File

@ -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