From bd974901584f1d043c2a09ba00bb332dc6730b30 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 4 Dec 2015 00:42:35 -0800 Subject: [PATCH] Show new warnings on upgrade. --- src/General/Settings.coffee | 35 +++++++++++++++++++++-------------- src/css/style.css | 5 ++++- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index ed8f15443..adf232636 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -96,6 +96,23 @@ Settings = section.scrollTop = 0 $.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 security reasons' + + ' you should block ads on 4chan.' + ) %> + main: (section) -> warnings = $.el 'fieldset', hidden: true @@ -104,22 +121,10 @@ Settings = addWarning = (item) -> $.add $('ul', warnings), item warnings.hidden = false + for key, warning of Settings.warnings + warning addWarning $.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 security reasons' + - ' you should block ads on 4chan.' - ) %> - items = {} inputs = {} for key, obj of Config.main @@ -326,6 +331,8 @@ Settings = if compareString < '00001.00011.00017.00006' if data['sauces']? 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 loadSettings: (data, cb) -> diff --git a/src/css/style.css b/src/css/style.css index dcc393617..3e5ec0071 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -279,7 +279,7 @@ audio.controls-added { .fixed.bottom-header #header-bar #scroll-marker { bottom: 100%; } -#header-bar a:not(.entry):not(.close) { +#board-list a, #shortcuts a:not(.entry) { text-decoration: none; padding: 1px; } @@ -436,6 +436,9 @@ audio.controls-added { overflow: auto; white-space: pre-line; } +.message a { + text-decoration: underline; +} /* Settings */ :root.fourchan-x body {