diff --git a/4chan_x.user.js b/4chan_x.user.js index 9ffb0b44b..efe375f56 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -59,7 +59,7 @@ */ (function() { - var $, $$, Favicon, NAMESPACE, Recaptcha, Time, anonymize, config, cooldown, d, expandComment, expandThread, g, imageHover, imgExpand, imgGif, imgPreloading, keybinds, log, main, nav, nodeInserted, options, qr, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, sauce, threadHiding, threadStats, threading, titlePost, ui, unread, updater, watcher, _config, _ref; + var $, $$, Favicon, NAMESPACE, Recaptcha, Time, anonymize, config, cooldown, d, expandComment, expandThread, firstRun, g, imageHover, imgExpand, imgGif, imgPreloading, keybinds, log, main, nav, nodeInserted, options, qr, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, sauce, threadHiding, threadStats, threading, titlePost, ui, unread, updater, watcher, _config, _ref; var __slice = Array.prototype.slice; if (typeof console !== "undefined" && console !== null) { log = function(arg) { @@ -2473,6 +2473,32 @@ return style.className = 'height'; } }; + firstRun = { + init: function() { + var a, aa, css, dialog, style, _i, _len, _results; + css = " #navtopr, #navbotr { font-size: 3em; position: relative; z-index: 99999; } "; + style = $.addStyle(css); + style.className = 'firstrun'; + dialog = $.el('div', { + id: 'overlay', + innerHTML: "
Click the 4chan X link for options.
There is another link at the bottom of the page.
" + }); + $.append(d.body, dialog); + aa = $$('#navtopr a, navbotr a'); + _results = []; + for (_i = 0, _len = aa.length; _i < _len; _i++) { + a = aa[_i]; + _results.push($.bind(a, 'click', firstRun.click)); + } + return _results; + }, + click: function() { + $.setValue('firstrun', true); + $.rm($('style.firstrun', d.head)); + $.rm($('#overlay')); + return option.dialog(); + } + }; NAMESPACE = 'AEOS.4chan_x.'; g = { callbacks: [] @@ -2643,7 +2669,10 @@ } } $.bind(d.body, 'DOMNodeInserted', nodeInserted); - return options.init(); + options.init(); + if (!$.config('firstrun')) { + return firstRun.init(); + } }, css: '\ /* dialog styling */\ diff --git a/script.coffee b/script.coffee index 43879596a..22f25f525 100644 --- a/script.coffee +++ b/script.coffee @@ -1849,6 +1849,33 @@ imgExpand = style = $.addStyle "body.fitheight img[md5] + img { max-height: #{d.body.clientHeight}px }" style.className = 'height' +firstRun = + init: -> + css = " + #navtopr, #navbotr { + font-size: 3em; + position: relative; + z-index: 99999; + } + " + style = $.addStyle css + style.className = 'firstrun' + + dialog = $.el 'div', + id: 'overlay' + innerHTML: "
Click the 4chan X link for options.
There is another link at the bottom of the page.
" + $.append d.body, dialog + + aa = $$ '#navtopr a, navbotr a' + for a in aa + $.bind a, 'click', firstRun.click + + click: -> + $.setValue 'firstrun', true + $.rm $ 'style.firstrun', d.head + $.rm $ '#overlay' + option.dialog() + #main NAMESPACE = 'AEOS.4chan_x.' g = @@ -2006,6 +2033,9 @@ main = $.bind d.body, 'DOMNodeInserted', nodeInserted options.init() + unless $.config 'firstrun' + firstRun.init() + css: ' /* dialog styling */ div.dialog {