Add mechanism for disabling features for certain site software.
This commit is contained in:
parent
2d14dd5a61
commit
d1d448d93e
@ -183,6 +183,7 @@ Main =
|
|||||||
|
|
||||||
# c.time 'All initializations'
|
# c.time 'All initializations'
|
||||||
for [name, feature] in Main.features
|
for [name, feature] in Main.features
|
||||||
|
continue if Site.disabledFeatures and name in Site.disabledFeatures
|
||||||
# c.time "#{name} initialization"
|
# c.time "#{name} initialization"
|
||||||
try
|
try
|
||||||
feature.init()
|
feature.init()
|
||||||
@ -281,7 +282,7 @@ Main =
|
|||||||
new Notice 'warning', msg
|
new Notice 'warning', msg
|
||||||
|
|
||||||
# Parse HTML or skip it and start building from JSON.
|
# Parse HTML or skip it and start building from JSON.
|
||||||
unless Conf['JSON Index'] and g.VIEW is 'index'
|
unless Index.enabled
|
||||||
Main.initThread()
|
Main.initThread()
|
||||||
else
|
else
|
||||||
Main.expectInitFinished = true
|
Main.expectInitFinished = true
|
||||||
|
|||||||
@ -1,6 +1,40 @@
|
|||||||
SW.tinyboard =
|
SW.tinyboard =
|
||||||
isOPContainerThread: true
|
isOPContainerThread: true
|
||||||
|
|
||||||
|
disabledFeatures: [
|
||||||
|
'Board Configuration'
|
||||||
|
'Normalize URL'
|
||||||
|
'Captcha Configuration'
|
||||||
|
'Image Host Rewriting'
|
||||||
|
'Redirect'
|
||||||
|
'Index Generator'
|
||||||
|
'Announcement Hiding'
|
||||||
|
'Fourchan thingies'
|
||||||
|
'Custom CSS'
|
||||||
|
'Resurrect Quotes'
|
||||||
|
'Quick Reply Personas'
|
||||||
|
'Quick Reply'
|
||||||
|
'Cooldown'
|
||||||
|
'Pass Link'
|
||||||
|
'Index Generator (Menu)'
|
||||||
|
'Edit Link'
|
||||||
|
'Archive Link'
|
||||||
|
'Quote Inlining'
|
||||||
|
'Quote Previewing'
|
||||||
|
'Quote Backlinks'
|
||||||
|
'Comment Expansion'
|
||||||
|
'Thread Expansion'
|
||||||
|
'Thread Stats'
|
||||||
|
'Thread Updater'
|
||||||
|
'Mark New IPs'
|
||||||
|
'Banner'
|
||||||
|
'Flash Features'
|
||||||
|
'Reply Pruning'
|
||||||
|
<% if (readJSON('/.tests_enabled')) { %>
|
||||||
|
'Build Test'
|
||||||
|
<% } %>
|
||||||
|
]
|
||||||
|
|
||||||
detect: ->
|
detect: ->
|
||||||
for script in $$ 'script:not([src])', d.head
|
for script in $$ 'script:not([src])', d.head
|
||||||
return true if /\bvar configRoot=".*?"/.test(script.textContent)
|
return true if /\bvar configRoot=".*?"/.test(script.textContent)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user