From 996878b509ba4e92c55f8ec7eb57d08d809df00f Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 8 Apr 2013 01:20:15 +0200 Subject: [PATCH] Add a notice that v2 is outdated. --- 4chan_x.user.js | 15 +++++++++++---- script.coffee | 12 +++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index b81f550ce..0d93894a9 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2690,7 +2690,7 @@ return $.ready(Options.initReady); }, initReady: function() { - var a, setting, settings, _i, _len, _ref; + var a, notice, setting, settings, _i, _len, _ref; _ref = ['navtopright', 'navbotright']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { settings = _ref[_i]; @@ -2702,10 +2702,17 @@ $.on(a, 'click', Options.dialog); setting = $.id(settings); if (Conf['Disable 4chan\'s extension']) { - $.replace(setting.childNodes[1], a); - continue; + $.replace(setting.firstElementChild, a); + } else { + $.prepend(setting, [$.tn('['), a, $.tn('] ')]); } - $.prepend(setting, [$.tn('['), a, $.tn('] ')]); + notice = $.el('a', { + textContent: 'v2 is outdated.', + href: 'https://4chan-x.just-believe.in/', + target: '_blank' + }); + notice.style.color = 'red'; + $.prepend(setting, [$.tn('['), notice, $.tn('] ')]); } if (!$.get('firstrun')) { $.set('firstrun', true); diff --git a/script.coffee b/script.coffee index 16e019089..d9111b150 100644 --- a/script.coffee +++ b/script.coffee @@ -2155,9 +2155,15 @@ Options = $.on a, 'click', Options.dialog setting = $.id settings if Conf['Disable 4chan\'s extension'] - $.replace setting.childNodes[1], a - continue - $.prepend setting, [$.tn('['), a, $.tn('] ')] + $.replace setting.firstElementChild, a + else + $.prepend setting, [$.tn('['), a, $.tn('] ')] + notice = $.el 'a', + textContent: 'v2 is outdated.' + href: 'https://4chan-x.just-believe.in/' + target: '_blank' + notice.style.color = 'red' + $.prepend setting, [$.tn('['), notice, $.tn('] ')] unless $.get 'firstrun' $.set 'firstrun', true # Prevent race conditions