Show new warnings on upgrade.
This commit is contained in:
parent
b3d3a5a94a
commit
bd97490158
@ -96,6 +96,23 @@ Settings =
|
|||||||
section.scrollTop = 0
|
section.scrollTop = 0
|
||||||
$.event 'OpenSettings', null, section
|
$.event 'OpenSettings', null, section
|
||||||
|
|
||||||
|
warnings:
|
||||||
|
localStorage: (cb) ->
|
||||||
|
if $.cantSync
|
||||||
|
why = if $.cantSet then 'save your settings' else 'synchronize settings between tabs'
|
||||||
|
cb $.el 'li',
|
||||||
|
textContent: """
|
||||||
|
<%= meta.name %> needs local storage to #{why}.
|
||||||
|
Enable it on boards.4chan.org in your browser's privacy settings (may be listed as part of "local data" or "cookies").
|
||||||
|
"""
|
||||||
|
ads: (cb) ->
|
||||||
|
$.onExists doc, '.ad-cnt', true, (ad) -> $.onExists ad, 'img', true, ->
|
||||||
|
cb $.el 'li',
|
||||||
|
<%= html(
|
||||||
|
'For <a href="//boards.4chan.org/qa/thread/362590" target="_blank">security reasons</a>' +
|
||||||
|
' you should <a href="https://github.com/gorhill/uBlock" target="_blank">block ads</a> on 4chan.'
|
||||||
|
) %>
|
||||||
|
|
||||||
main: (section) ->
|
main: (section) ->
|
||||||
warnings = $.el 'fieldset',
|
warnings = $.el 'fieldset',
|
||||||
hidden: true
|
hidden: true
|
||||||
@ -104,22 +121,10 @@ Settings =
|
|||||||
addWarning = (item) ->
|
addWarning = (item) ->
|
||||||
$.add $('ul', warnings), item
|
$.add $('ul', warnings), item
|
||||||
warnings.hidden = false
|
warnings.hidden = false
|
||||||
|
for key, warning of Settings.warnings
|
||||||
|
warning addWarning
|
||||||
$.add section, warnings
|
$.add section, warnings
|
||||||
|
|
||||||
if $.cantSync
|
|
||||||
why = if $.cantSet then 'save your settings' else 'synchronize settings between tabs'
|
|
||||||
addWarning $.el 'li',
|
|
||||||
textContent: """
|
|
||||||
<%= meta.name %> needs local storage to #{why}.
|
|
||||||
Enable it on boards.4chan.org in your browser's privacy settings (may be listed as part of "local data" or "cookies").
|
|
||||||
"""
|
|
||||||
$.onExists d.body, '.ad-cnt', true, (ad) -> $.onExists ad, 'img', true, ->
|
|
||||||
addWarning $.el 'li',
|
|
||||||
<%= html(
|
|
||||||
'For <a href="//boards.4chan.org/qa/thread/362590" target="_blank">security reasons</a>' +
|
|
||||||
' you should <a href="https://github.com/gorhill/uBlock" target="_blank">block ads</a> on 4chan.'
|
|
||||||
) %>
|
|
||||||
|
|
||||||
items = {}
|
items = {}
|
||||||
inputs = {}
|
inputs = {}
|
||||||
for key, obj of Config.main
|
for key, obj of Config.main
|
||||||
@ -326,6 +331,8 @@ Settings =
|
|||||||
if compareString < '00001.00011.00017.00006'
|
if compareString < '00001.00011.00017.00006'
|
||||||
if data['sauces']?
|
if data['sauces']?
|
||||||
changes['sauces'] = data['sauces'].replace /(#?\s*)http:\/\/iqdb\.org\//g, '$1//iqdb.org/'
|
changes['sauces'] = data['sauces'].replace /(#?\s*)http:\/\/iqdb\.org\//g, '$1//iqdb.org/'
|
||||||
|
if compareString < '00001.00011.00019.00003' and not Settings.overlay
|
||||||
|
$.queueTask -> Settings.warnings.ads (item) -> new Notice 'warning', [item.childNodes...]
|
||||||
changes
|
changes
|
||||||
|
|
||||||
loadSettings: (data, cb) ->
|
loadSettings: (data, cb) ->
|
||||||
|
|||||||
@ -279,7 +279,7 @@ audio.controls-added {
|
|||||||
.fixed.bottom-header #header-bar #scroll-marker {
|
.fixed.bottom-header #header-bar #scroll-marker {
|
||||||
bottom: 100%;
|
bottom: 100%;
|
||||||
}
|
}
|
||||||
#header-bar a:not(.entry):not(.close) {
|
#board-list a, #shortcuts a:not(.entry) {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
}
|
}
|
||||||
@ -436,6 +436,9 @@ audio.controls-added {
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
}
|
}
|
||||||
|
.message a {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
/* Settings */
|
/* Settings */
|
||||||
:root.fourchan-x body {
|
:root.fourchan-x body {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user