Refactor options.init.

This commit is contained in:
Nicolas Stepien 2012-02-11 18:22:59 +01:00
parent 7e4435d1c2
commit eb0b2399b6
2 changed files with 17 additions and 27 deletions

View File

@ -1994,21 +1994,17 @@
options = {
init: function() {
var a, home;
home = $('#navtopr a');
a = $.el('a', {
textContent: '4chan X',
href: 'javascript:;'
});
$.on(a, 'click', options.dialog);
$.replace(home, a);
home = $('#navbotr a');
a = $.el('a', {
textContent: '4chan X',
href: 'javascript:;'
});
$.on(a, 'click', options.dialog);
$.replace(home, a);
var a, home, _i, _len, _ref;
_ref = [$.id('navtopr'), $.id('navbotr')];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
home = _ref[_i];
a = $.el('a', {
textContent: '4chan X',
href: 'javascript:;'
});
$.on(a, 'click', options.dialog);
$.replace(home.firstElementChild, a);
}
if (!$.get('firstrun')) {
$.set('firstrun', true);
return options.dialog();

View File

@ -1539,18 +1539,12 @@ qr =
options =
init: ->
home = $ '#navtopr a'
a = $.el 'a',
textContent: '4chan X'
href: 'javascript:;'
$.on a, 'click', options.dialog
$.replace home, a
home = $ '#navbotr a'
a = $.el 'a',
textContent: '4chan X'
href: 'javascript:;'
$.on a, 'click', options.dialog
$.replace home, a
for home in [$.id('navtopr'), $.id('navbotr')]
a = $.el 'a',
textContent: '4chan X'
href: 'javascript:;'
$.on a, 'click', options.dialog
$.replace home.firstElementChild, a
unless $.get 'firstrun'
$.set 'firstrun', true
options.dialog()