appendChild -> addTo
This commit is contained in:
parent
b523134964
commit
d86bde6f4f
@ -226,7 +226,7 @@ if not favicon = $('link[rel="shortcut icon"]', head)#/f/
|
|||||||
rel: 'shortcut icon'
|
rel: 'shortcut icon'
|
||||||
href: 'http://static.4chan.org/image/favicon.ico'
|
href: 'http://static.4chan.org/image/favicon.ico'
|
||||||
}
|
}
|
||||||
head.appendChild(favicon)
|
addTo head, favicon
|
||||||
favNormal = favicon.href
|
favNormal = favicon.href
|
||||||
favEmpty = 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='
|
favEmpty = 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='
|
||||||
|
|
||||||
@ -343,7 +343,7 @@ options = ->
|
|||||||
$('input[type="button"]', div).addEventListener('click', clearHidden, true)
|
$('input[type="button"]', div).addEventListener('click', clearHidden, true)
|
||||||
$('a[name="save"]', div).addEventListener('click', optionsSave, true)
|
$('a[name="save"]', div).addEventListener('click', optionsSave, true)
|
||||||
$('a[name="cancel"]', div).addEventListener('click', close, true)
|
$('a[name="cancel"]', div).addEventListener('click', close, true)
|
||||||
document.body.appendChild(div)
|
addTo document.body, div
|
||||||
|
|
||||||
|
|
||||||
showThread = ->
|
showThread = ->
|
||||||
@ -390,13 +390,13 @@ threadF = (current) ->
|
|||||||
className: 'pointer'
|
className: 'pointer'
|
||||||
listener: ['click', hideThread]
|
listener: ['click', hideThread]
|
||||||
}
|
}
|
||||||
div.appendChild(a)
|
addTo div, a
|
||||||
|
|
||||||
inBefore(current, div)
|
inBefore(current, div)
|
||||||
while (!current.clear)#<br clear>
|
while (!current.clear)#<br clear>
|
||||||
div.appendChild(current)
|
addTo div, current
|
||||||
current = div.nextSibling
|
current = div.nextSibling
|
||||||
div.appendChild(current)
|
addTo div, current
|
||||||
current = div.nextSibling
|
current = div.nextSibling
|
||||||
|
|
||||||
id = $('input[value="delete"]', div).name
|
id = $('input[value="delete"]', div).name
|
||||||
@ -441,7 +441,7 @@ hideReply = (reply) ->
|
|||||||
listener: ['click', showReply]
|
listener: ['click', showReply]
|
||||||
}
|
}
|
||||||
div = n 'div'
|
div = n 'div'
|
||||||
div.appendChild(a)
|
addTo div, a
|
||||||
inBefore(table, div)
|
inBefore(table, div)
|
||||||
|
|
||||||
|
|
||||||
@ -470,7 +470,7 @@ iframeLoad = ->
|
|||||||
textContent: error
|
textContent: error
|
||||||
className: 'error'
|
className: 'error'
|
||||||
}
|
}
|
||||||
qr.appendChild(span)
|
addTo qr, span
|
||||||
else if REPLY and getConfig('Persistent QR')
|
else if REPLY and getConfig('Persistent QR')
|
||||||
$('textarea', qr).value = ''
|
$('textarea', qr).value = ''
|
||||||
$('input[name=recaptcha_response_field]', qr).value = ''
|
$('input[name=recaptcha_response_field]', qr).value = ''
|
||||||
@ -492,7 +492,7 @@ submit = (e) ->
|
|||||||
className: 'error'
|
className: 'error'
|
||||||
textContent: 'You forgot to type in the verification.'
|
textContent: 'You forgot to type in the verification.'
|
||||||
}
|
}
|
||||||
@parentNode.appendChild span
|
addTo @parentNode, span
|
||||||
alert 'You forgot to type in the verification.'
|
alert 'You forgot to type in the verification.'
|
||||||
recaptcha.focus()
|
recaptcha.focus()
|
||||||
|
|
||||||
@ -521,7 +521,7 @@ quickReply = (e) ->
|
|||||||
className: 'move'
|
className: 'move'
|
||||||
listener: ['mousedown', AEOS.move]
|
listener: ['mousedown', AEOS.move]
|
||||||
}
|
}
|
||||||
qr.appendChild(div)
|
addTo qr, div
|
||||||
|
|
||||||
autohideB = n 'input', {
|
autohideB = n 'input', {
|
||||||
type: 'checkbox'
|
type: 'checkbox'
|
||||||
@ -551,9 +551,9 @@ quickReply = (e) ->
|
|||||||
name: 'resto'
|
name: 'resto'
|
||||||
value: x(xpath, this).name
|
value: x(xpath, this).name
|
||||||
}
|
}
|
||||||
clone.appendChild(input)
|
addTo clone, input
|
||||||
qr.appendChild(clone)
|
addTo qr, clone
|
||||||
document.body.appendChild(qr)
|
addTo document.body, qr
|
||||||
|
|
||||||
if e
|
if e
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@ -642,7 +642,7 @@ onloadThread = (responseText, span) ->
|
|||||||
else#threading
|
else#threading
|
||||||
div = span.parentNode
|
div = span.parentNode
|
||||||
for reply in replies
|
for reply in replies
|
||||||
div.appendChild(x('ancestor::table', reply))
|
addTo div, x('ancestor::table', reply)
|
||||||
|
|
||||||
|
|
||||||
expandThread = ->
|
expandThread = ->
|
||||||
@ -784,7 +784,7 @@ if getConfig('Quick Reply')
|
|||||||
listener: ['load', iframeLoad]
|
listener: ['load', iframeLoad]
|
||||||
}
|
}
|
||||||
hide(iframe)
|
hide(iframe)
|
||||||
document.body.appendChild(iframe)
|
addTo document.body, iframe
|
||||||
|
|
||||||
callbacks.push((root) ->
|
callbacks.push((root) ->
|
||||||
quotes = $$('a.quotejs:not(:first-child)', root)
|
quotes = $$('a.quotejs:not(:first-child)', root)
|
||||||
@ -818,7 +818,7 @@ if getConfig('Thread Watcher')
|
|||||||
}
|
}
|
||||||
position(watcher)
|
position(watcher)
|
||||||
$('div', watcher).addEventListener('mousedown', AEOS.move, true)
|
$('div', watcher).addEventListener('mousedown', AEOS.move, true)
|
||||||
document.body.appendChild(watcher)
|
addTo document.body, watcher
|
||||||
watcherUpdate()
|
watcherUpdate()
|
||||||
|
|
||||||
#add buttons
|
#add buttons
|
||||||
|
|||||||
30
4chan_x.js
30
4chan_x.js
@ -281,7 +281,7 @@
|
|||||||
rel: 'shortcut icon',
|
rel: 'shortcut icon',
|
||||||
href: 'http://static.4chan.org/image/favicon.ico'
|
href: 'http://static.4chan.org/image/favicon.ico'
|
||||||
});
|
});
|
||||||
head.appendChild(favicon);
|
addTo(head, favicon);
|
||||||
}
|
}
|
||||||
favNormal = favicon.href;
|
favNormal = favicon.href;
|
||||||
favEmpty = 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==';
|
favEmpty = 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==';
|
||||||
@ -398,7 +398,7 @@
|
|||||||
$('input[type="button"]', div).addEventListener('click', clearHidden, true);
|
$('input[type="button"]', div).addEventListener('click', clearHidden, true);
|
||||||
$('a[name="save"]', div).addEventListener('click', optionsSave, true);
|
$('a[name="save"]', div).addEventListener('click', optionsSave, true);
|
||||||
$('a[name="cancel"]', div).addEventListener('click', close, true);
|
$('a[name="cancel"]', div).addEventListener('click', close, true);
|
||||||
return document.body.appendChild(div);
|
return addTo(document.body, div);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
showThread = function() {
|
showThread = function() {
|
||||||
@ -449,13 +449,13 @@
|
|||||||
className: 'pointer',
|
className: 'pointer',
|
||||||
listener: ['click', hideThread]
|
listener: ['click', hideThread]
|
||||||
});
|
});
|
||||||
div.appendChild(a);
|
addTo(div, a);
|
||||||
inBefore(current, div);
|
inBefore(current, div);
|
||||||
while ((!current.clear)) {
|
while ((!current.clear)) {
|
||||||
div.appendChild(current);
|
addTo(div, current);
|
||||||
current = div.nextSibling;
|
current = div.nextSibling;
|
||||||
}
|
}
|
||||||
div.appendChild(current);
|
addTo(div, current);
|
||||||
current = div.nextSibling;
|
current = div.nextSibling;
|
||||||
id = $('input[value="delete"]', div).name;
|
id = $('input[value="delete"]', div).name;
|
||||||
div.id = id;
|
div.id = id;
|
||||||
@ -500,7 +500,7 @@
|
|||||||
listener: ['click', showReply]
|
listener: ['click', showReply]
|
||||||
});
|
});
|
||||||
div = n('div');
|
div = n('div');
|
||||||
div.appendChild(a);
|
addTo(div, a);
|
||||||
return inBefore(table, div);
|
return inBefore(table, div);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -533,7 +533,7 @@
|
|||||||
textContent: error,
|
textContent: error,
|
||||||
className: 'error'
|
className: 'error'
|
||||||
});
|
});
|
||||||
qr.appendChild(span);
|
addTo(qr, span);
|
||||||
} else if (REPLY && getConfig('Persistent QR')) {
|
} else if (REPLY && getConfig('Persistent QR')) {
|
||||||
$('textarea', qr).value = '';
|
$('textarea', qr).value = '';
|
||||||
$('input[name=recaptcha_response_field]', qr).value = '';
|
$('input[name=recaptcha_response_field]', qr).value = '';
|
||||||
@ -556,7 +556,7 @@
|
|||||||
className: 'error',
|
className: 'error',
|
||||||
textContent: 'You forgot to type in the verification.'
|
textContent: 'You forgot to type in the verification.'
|
||||||
});
|
});
|
||||||
this.parentNode.appendChild(span);
|
addTo(this.parentNode, span);
|
||||||
alert('You forgot to type in the verification.');
|
alert('You forgot to type in the verification.');
|
||||||
return recaptcha.focus();
|
return recaptcha.focus();
|
||||||
}
|
}
|
||||||
@ -585,7 +585,7 @@
|
|||||||
className: 'move',
|
className: 'move',
|
||||||
listener: ['mousedown', AEOS.move]
|
listener: ['mousedown', AEOS.move]
|
||||||
});
|
});
|
||||||
qr.appendChild(div);
|
addTo(qr, div);
|
||||||
autohideB = n('input', {
|
autohideB = n('input', {
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
className: 'pointer',
|
className: 'pointer',
|
||||||
@ -615,10 +615,10 @@
|
|||||||
name: 'resto',
|
name: 'resto',
|
||||||
value: x(xpath, this).name
|
value: x(xpath, this).name
|
||||||
});
|
});
|
||||||
clone.appendChild(input);
|
addTo(clone, input);
|
||||||
}
|
}
|
||||||
qr.appendChild(clone);
|
addTo(qr, clone);
|
||||||
document.body.appendChild(qr);
|
addTo(document.body, qr);
|
||||||
}
|
}
|
||||||
if (e) {
|
if (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -720,7 +720,7 @@
|
|||||||
_result = []; _ref2 = replies;
|
_result = []; _ref2 = replies;
|
||||||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
||||||
reply = _ref2[_i];
|
reply = _ref2[_i];
|
||||||
_result.push(div.appendChild(x('ancestor::table', reply)));
|
_result.push(addTo(div, x('ancestor::table', reply)));
|
||||||
}
|
}
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
@ -886,7 +886,7 @@
|
|||||||
listener: ['load', iframeLoad]
|
listener: ['load', iframeLoad]
|
||||||
});
|
});
|
||||||
hide(iframe);
|
hide(iframe);
|
||||||
document.body.appendChild(iframe);
|
addTo(document.body, iframe);
|
||||||
callbacks.push(function(root) {
|
callbacks.push(function(root) {
|
||||||
var _j, _len2, _ref2, _result, quote, quotes;
|
var _j, _len2, _ref2, _result, quote, quotes;
|
||||||
quotes = $$('a.quotejs:not(:first-child)', root);
|
quotes = $$('a.quotejs:not(:first-child)', root);
|
||||||
@ -927,7 +927,7 @@
|
|||||||
});
|
});
|
||||||
position(watcher);
|
position(watcher);
|
||||||
$('div', watcher).addEventListener('mousedown', AEOS.move, true);
|
$('div', watcher).addEventListener('mousedown', AEOS.move, true);
|
||||||
document.body.appendChild(watcher);
|
addTo(document.body, watcher);
|
||||||
watcherUpdate();
|
watcherUpdate();
|
||||||
threads = watched[BOARD] || [];
|
threads = watched[BOARD] || [];
|
||||||
inputs = $$('form > input[value="delete"], div > input[value="delete"]');
|
inputs = $$('form > input[value="delete"], div > input[value="delete"]');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user