Make disabling the native extension optional. #61

This commit is contained in:
ccd0 2014-12-27 19:13:31 -08:00
parent 108920c536
commit 1d47e2d4be
3 changed files with 20 additions and 14 deletions

View File

@ -108,7 +108,10 @@ Config =
false
'Prevent sounds on the page from autoplaying.'
]
'Disable Native Extension': [
true
'<%= meta.name %> is NOT designed to work with the native extension.'
]
'Linkification':
'Linkify': [
true

View File

@ -96,15 +96,17 @@ Header =
if a = $ "a[href*='/#{g.BOARD}/']", footer
a.className = 'current'
cs = $.el 'a',
href: 'javascript:;'
title: 'Catalog Settings'
className: 'fa fa-book'
textContent: 'Catalog Settings'
$.on cs, 'click', () ->
$.id('settingsWindowLink').click()
@addShortcut cs if g.VIEW is 'catalog'
if g.VIEW is 'catalog' or !Conf['Disable Native Extension']
cs = $.el 'a', href: 'javascript:;'
if g.VIEW is 'catalog'
cs.title = cs.textContent = 'Catalog Settings'
cs.className = 'fa fa-book'
else
cs.title = cs.textContent = '4chan Settings'
cs.className = 'fa fa-leaf'
$.on cs, 'click', () ->
$.id('settingsWindowLink').click()
@addShortcut cs
Header.setFooterVisibility Conf['Bottom Board List']
$.sync 'Bottom Board List', Header.setFooterVisibility

View File

@ -19,10 +19,11 @@ Settings =
$.on d, 'AddSettingsSection', Settings.addSection
$.on d, 'OpenSettings', (e) -> Settings.open e.detail
settings = JSON.parse(localStorage.getItem '4chan-settings') or {}
return if settings.disableAll
settings.disableAll = true
localStorage.setItem '4chan-settings', JSON.stringify settings
if Conf['Disable Native Extension']
settings = JSON.parse(localStorage.getItem '4chan-settings') or {}
return if settings.disableAll
settings.disableAll = true
localStorage.setItem '4chan-settings', JSON.stringify settings
open: (openSection) ->
return if Settings.dialog