Start first run dialog.

This commit is contained in:
Nicolas Stepien 2011-06-17 23:54:08 +02:00
parent 148dd165d1
commit b8e02d4eec
2 changed files with 61 additions and 2 deletions

View File

@ -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: "<div id=options><div class='reply dialog'>Click the <strong>4chan X</strong> link for options.<br>There is another link at the bottom of the page.</div></div>"
});
$.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 */\

View File

@ -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: "<div id=options><div class='reply dialog'>Click the <strong>4chan X</strong> link for options.<br>There is another link at the bottom of the page.</div></div>"
$.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 {