Refactor options.init.
This commit is contained in:
parent
7e4435d1c2
commit
eb0b2399b6
@ -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();
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user