Make an option for 'update stale index' functionality.

This commit is contained in:
Zixaphir 2014-07-17 15:32:38 -07:00
parent cc7d8f4069
commit 7dcd2aa858
4 changed files with 14 additions and 4 deletions

View File

@ -139,6 +139,7 @@
main: { main: {
'Miscellaneous': { 'Miscellaneous': {
'JSON Navigation': [true, 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'], 'JSON Navigation': [true, 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'],
'Update Stale Index': [true, 'Updates the board index if it hasn\'t been updated in five or more minutes when 4chan gains browser focus (like switching tabs or windows).'],
'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], 'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'],
'External Catalog': [false, 'Link to external catalog instead of the internal one.'], 'External Catalog': [false, 'Link to external catalog instead of the internal one.'],
'Desktop Notifications': [false, 'Enables desktop notifications across various appchan x features.'], 'Desktop Notifications': [false, 'Enables desktop notifications across various appchan x features.'],
@ -4772,7 +4773,9 @@
Rice.nodes(this.navLinks); Rice.nodes(this.navLinks);
this.currentPage = this.getCurrentPage(); this.currentPage = this.getCurrentPage();
$.on(d, 'scroll', this.scroll); $.on(d, 'scroll', this.scroll);
$.on(window, 'focus', this.updateIfNeeded); if (Conf['Update Stale Index']) {
$.on(window, 'focus', this.updateIfNeeded);
}
$.on(this.pagelist, 'click', this.cb.pageNav); $.on(this.pagelist, 'click', this.cb.pageNav);
returnLink = $.el('a', { returnLink = $.el('a', {
id: 'returnIcon', id: 'returnIcon',

View File

@ -114,6 +114,7 @@
main: { main: {
'Miscellaneous': { 'Miscellaneous': {
'JSON Navigation': [true, 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'], 'JSON Navigation': [true, 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'],
'Update Stale Index': [true, 'Updates the board index if it hasn\'t been updated in five or more minutes when 4chan gains browser focus (like switching tabs or windows).'],
'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], 'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'],
'External Catalog': [false, 'Link to external catalog instead of the internal one.'], 'External Catalog': [false, 'Link to external catalog instead of the internal one.'],
'Desktop Notifications': [false, 'Enables desktop notifications across various appchan x features.'], 'Desktop Notifications': [false, 'Enables desktop notifications across various appchan x features.'],
@ -4826,7 +4827,9 @@
Rice.nodes(this.navLinks); Rice.nodes(this.navLinks);
this.currentPage = this.getCurrentPage(); this.currentPage = this.getCurrentPage();
$.on(d, 'scroll', this.scroll); $.on(d, 'scroll', this.scroll);
$.on(window, 'focus', this.updateIfNeeded); if (Conf['Update Stale Index']) {
$.on(window, 'focus', this.updateIfNeeded);
}
$.on(this.pagelist, 'click', this.cb.pageNav); $.on(this.pagelist, 'click', this.cb.pageNav);
returnLink = $.el('a', { returnLink = $.el('a', {
id: 'returnIcon', id: 'returnIcon',

View File

@ -1,10 +1,14 @@
Config = Config =
main: main:
'Miscellaneous': 'Miscellaneous':
'JSON Navigation' : [ 'JSON Navigation': [
true true
'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.' 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'
] ]
'Update Stale Index': [
true
'Updates the board index if it hasn\'t been updated in five or more minutes when 4chan gains browser focus (like switching tabs or windows).'
]
'Catalog Links': [ 'Catalog Links': [
true true
'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.' 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'

View File

@ -115,7 +115,7 @@ Index =
@currentPage = @getCurrentPage() @currentPage = @getCurrentPage()
$.on d, 'scroll', @scroll $.on d, 'scroll', @scroll
$.on window, 'focus', @updateIfNeeded $.on window, 'focus', @updateIfNeeded if Conf['Update Stale Index']
$.on @pagelist, 'click', @cb.pageNav $.on @pagelist, 'click', @cb.pageNav
returnLink = $.el 'a', returnLink = $.el 'a',