inBefore -> $.before
This commit is contained in:
parent
1751525e58
commit
2b7afae938
21
4chan_x.js
21
4chan_x.js
@ -56,7 +56,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var $, $$, DAY, a, arr, as, autoWatch, callback, changeCheckbox, changeValue, clearHidden, closeQR, config, cooldown, cutoff, d, delform, down, editSauce, el, expand, expandComment, expandThread, g, getConfig, getThread, getTime, hide, hideReply, hideThread, href, html, i, id, imageClick, imageExpand, imageExpandClick, imageHover, imageResize, imageThumb, imageToggle, imageType, imageTypeChange, img, inAfter, inBefore, input, inputs, keyModeInsert, keyModeNormal, keydown, keypress, l1, lastChecked, log, mv, navbotr, navtopr, nodeInserted, now, omitted, onloadComment, onloadThread, option, options, parseResponse, pathname, qr, recaptcha, recaptchaListener, recaptchaReload, redirect, replace, replyNav, report, request, scroll, scrollThread, show, showReply, showThread, slice, span, src, start, stopPropagation, temp, text, textContent, threadF, threads, tn, tzOffset, ui, up, updateAuto, updateCallback, updateFavicon, updateInterval, updateNow, updateTime, updateTitle, updateVerbose, updaterMake, watch, watchX, watcher, watcherUpdate, x, zeroPad, _i, _j, _k, _l, _len, _len2, _len3, _len4, _len5, _len6, _len7, _m, _n, _ref, _ref2, _ref3, _ref4;
|
var $, $$, DAY, a, arr, as, autoWatch, callback, changeCheckbox, changeValue, clearHidden, closeQR, config, cooldown, cutoff, d, delform, down, editSauce, el, expand, expandComment, expandThread, g, getConfig, getThread, getTime, hide, hideReply, hideThread, href, html, i, id, imageClick, imageExpand, imageExpandClick, imageHover, imageResize, imageThumb, imageToggle, imageType, imageTypeChange, img, inAfter, input, inputs, keyModeInsert, keyModeNormal, keydown, keypress, l1, lastChecked, log, mv, navbotr, navtopr, nodeInserted, now, omitted, onloadComment, onloadThread, option, options, parseResponse, pathname, qr, recaptcha, recaptchaListener, recaptchaReload, redirect, replace, replyNav, report, request, scroll, scrollThread, show, showReply, showThread, slice, span, src, start, stopPropagation, temp, text, textContent, threadF, threads, tn, tzOffset, ui, up, updateAuto, updateCallback, updateFavicon, updateInterval, updateNow, updateTime, updateTitle, updateVerbose, updaterMake, watch, watchX, watcher, watcherUpdate, x, zeroPad, _i, _j, _k, _l, _len, _len2, _len3, _len4, _len5, _len6, _len7, _m, _n, _ref, _ref2, _ref3, _ref4;
|
||||||
var __slice = Array.prototype.slice;
|
var __slice = Array.prototype.slice;
|
||||||
if (typeof console != "undefined" && console !== null) {
|
if (typeof console != "undefined" && console !== null) {
|
||||||
log = console.log;
|
log = console.log;
|
||||||
@ -348,9 +348,6 @@
|
|||||||
inAfter = function(root, el) {
|
inAfter = function(root, el) {
|
||||||
return root.parentNode.insertBefore(el, root.nextSibling);
|
return root.parentNode.insertBefore(el, root.nextSibling);
|
||||||
};
|
};
|
||||||
inBefore = function(root, el) {
|
|
||||||
return root.parentNode.insertBefore(el, root);
|
|
||||||
};
|
|
||||||
replace = function(root, el) {
|
replace = function(root, el) {
|
||||||
return root.parentNode.replaceChild(el, root);
|
return root.parentNode.replaceChild(el, root);
|
||||||
};
|
};
|
||||||
@ -511,7 +508,7 @@
|
|||||||
$.bind(a, 'click', showReply);
|
$.bind(a, 'click', showReply);
|
||||||
div = $.el('div');
|
div = $.el('div');
|
||||||
mv(a, div);
|
mv(a, div);
|
||||||
return inBefore(table, div);
|
return $.before(table, div);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
hideThread = function(div) {
|
hideThread = function(div) {
|
||||||
@ -540,7 +537,7 @@
|
|||||||
className: 'pointer'
|
className: 'pointer'
|
||||||
});
|
});
|
||||||
$.bind(a, 'click', showThread);
|
$.bind(a, 'click', showThread);
|
||||||
return inBefore(div, a);
|
return $.before(div, a);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
imageHover = {
|
imageHover = {
|
||||||
@ -906,7 +903,7 @@
|
|||||||
_results = [];
|
_results = [];
|
||||||
for (_i = 0, _len = replies.length; _i < _len; _i++) {
|
for (_i = 0, _len = replies.length; _i < _len; _i++) {
|
||||||
reply = replies[_i];
|
reply = replies[_i];
|
||||||
_results.push(inBefore(next, x('ancestor::table', reply)));
|
_results.push($.before(next, x('ancestor::table', reply)));
|
||||||
}
|
}
|
||||||
return _results;
|
return _results;
|
||||||
} else {
|
} else {
|
||||||
@ -1284,7 +1281,7 @@
|
|||||||
});
|
});
|
||||||
$.bind(a, 'click', hideThread);
|
$.bind(a, 'click', hideThread);
|
||||||
mv(a, div);
|
mv(a, div);
|
||||||
inBefore(current, div);
|
$.before(current, div);
|
||||||
while (!current.clear) {
|
while (!current.clear) {
|
||||||
mv(current, div);
|
mv(current, div);
|
||||||
current = div.nextSibling;
|
current = div.nextSibling;
|
||||||
@ -1359,7 +1356,7 @@
|
|||||||
}
|
}
|
||||||
while (reply = arr.pop()) {
|
while (reply = arr.pop()) {
|
||||||
table = x('ancestor::table', reply);
|
table = x('ancestor::table', reply);
|
||||||
inBefore(root, table);
|
$.before(root, table);
|
||||||
}
|
}
|
||||||
return timer.textContent = -1 * GM_getValue('Interval', 10);
|
return timer.textContent = -1 * GM_getValue('Interval', 10);
|
||||||
};
|
};
|
||||||
@ -1732,7 +1729,7 @@
|
|||||||
$("select", expand).addEventListener('change', changeValue, true);
|
$("select", expand).addEventListener('change', changeValue, true);
|
||||||
$("select", expand).addEventListener('change', imageTypeChange, true);
|
$("select", expand).addEventListener('change', imageTypeChange, true);
|
||||||
$("input", expand).addEventListener('click', imageExpandClick, true);
|
$("input", expand).addEventListener('click', imageExpandClick, true);
|
||||||
inBefore(delform.firstChild, expand);
|
$.before(delform.firstChild, expand);
|
||||||
g.callbacks.push(function(root) {
|
g.callbacks.push(function(root) {
|
||||||
var thumb, thumbs, _i, _len, _results;
|
var thumb, thumbs, _i, _len, _results;
|
||||||
thumbs = $$('img[md5]', root);
|
thumbs = $$('img[md5]', root);
|
||||||
@ -1899,7 +1896,7 @@
|
|||||||
className: 'pointer'
|
className: 'pointer'
|
||||||
});
|
});
|
||||||
$.bind(img, 'click', watch);
|
$.bind(img, 'click', watch);
|
||||||
inBefore(input, img);
|
$.before(input, img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getConfig('Anonymize')) {
|
if (getConfig('Anonymize')) {
|
||||||
@ -2037,7 +2034,7 @@
|
|||||||
href: href
|
href: href
|
||||||
});
|
});
|
||||||
mv(up, tn(' '), down, span);
|
mv(up, tn(' '), down, span);
|
||||||
inBefore(el, span);
|
$.before(el, span);
|
||||||
}
|
}
|
||||||
if (location.hash === '#p0') {
|
if (location.hash === '#p0') {
|
||||||
window.location = window.location;
|
window.location = window.location;
|
||||||
|
|||||||
@ -226,8 +226,6 @@ hide = (el) ->
|
|||||||
el.style.display = 'none'
|
el.style.display = 'none'
|
||||||
inAfter = (root, el) ->
|
inAfter = (root, el) ->
|
||||||
root.parentNode.insertBefore el, root.nextSibling
|
root.parentNode.insertBefore el, root.nextSibling
|
||||||
inBefore = (root, el) ->
|
|
||||||
root.parentNode.insertBefore el, root
|
|
||||||
replace = (root, el) ->
|
replace = (root, el) ->
|
||||||
root.parentNode.replaceChild el, root
|
root.parentNode.replaceChild el, root
|
||||||
show = (el) ->
|
show = (el) ->
|
||||||
@ -358,7 +356,7 @@ hideReply = (reply) ->
|
|||||||
$.bind a, 'click', showReply
|
$.bind a, 'click', showReply
|
||||||
div = $.el 'div'
|
div = $.el 'div'
|
||||||
mv a, div
|
mv a, div
|
||||||
inBefore table, div
|
$.before table, div
|
||||||
|
|
||||||
hideThread = (div) ->
|
hideThread = (div) ->
|
||||||
if p = @parentNode
|
if p = @parentNode
|
||||||
@ -382,7 +380,7 @@ hideThread = (div) ->
|
|||||||
textContent: "[ + ] #{name}#{trip} (#{text})"
|
textContent: "[ + ] #{name}#{trip} (#{text})"
|
||||||
className: 'pointer'
|
className: 'pointer'
|
||||||
$.bind a, 'click', showThread
|
$.bind a, 'click', showThread
|
||||||
inBefore div, a
|
$.before div, a
|
||||||
|
|
||||||
imageHover =
|
imageHover =
|
||||||
init: ->
|
init: ->
|
||||||
@ -668,7 +666,7 @@ onloadThread = (responseText, span) ->
|
|||||||
$.remove next
|
$.remove next
|
||||||
if next
|
if next
|
||||||
for reply in replies
|
for reply in replies
|
||||||
inBefore next, x('ancestor::table', reply)
|
$.before next, x('ancestor::table', reply)
|
||||||
else#threading
|
else#threading
|
||||||
div = span.parentNode
|
div = span.parentNode
|
||||||
for reply in replies
|
for reply in replies
|
||||||
@ -958,7 +956,7 @@ threadF = (current) ->
|
|||||||
className: 'pointer'
|
className: 'pointer'
|
||||||
$.bind a, 'click', hideThread
|
$.bind a, 'click', hideThread
|
||||||
mv a, div
|
mv a, div
|
||||||
inBefore current, div
|
$.before current, div
|
||||||
while (!current.clear)#<br clear>
|
while (!current.clear)#<br clear>
|
||||||
mv current, div
|
mv current, div
|
||||||
current = div.nextSibling
|
current = div.nextSibling
|
||||||
@ -1020,7 +1018,7 @@ updateCallback = ->
|
|||||||
#insert replies in order, so backlinks resolve
|
#insert replies in order, so backlinks resolve
|
||||||
while reply = arr.pop()
|
while reply = arr.pop()
|
||||||
table = x 'ancestor::table', reply
|
table = x 'ancestor::table', reply
|
||||||
inBefore root, table
|
$.before root, table
|
||||||
|
|
||||||
timer.textContent = -1 * GM_getValue 'Interval', 10
|
timer.textContent = -1 * GM_getValue 'Interval', 10
|
||||||
|
|
||||||
@ -1356,7 +1354,7 @@ if getConfig 'Image Expansion'
|
|||||||
$("select", expand).addEventListener 'change', changeValue, true
|
$("select", expand).addEventListener 'change', changeValue, true
|
||||||
$("select", expand).addEventListener 'change', imageTypeChange, true
|
$("select", expand).addEventListener 'change', imageTypeChange, true
|
||||||
$("input", expand).addEventListener 'click', imageExpandClick, true
|
$("input", expand).addEventListener 'click', imageExpandClick, true
|
||||||
inBefore delform.firstChild, expand
|
$.before delform.firstChild, expand
|
||||||
|
|
||||||
g.callbacks.push (root) ->
|
g.callbacks.push (root) ->
|
||||||
thumbs = $$ 'img[md5]', root
|
thumbs = $$ 'img[md5]', root
|
||||||
@ -1469,7 +1467,7 @@ if getConfig 'Thread Watcher'
|
|||||||
src: src
|
src: src
|
||||||
className: 'pointer'
|
className: 'pointer'
|
||||||
$.bind img, 'click', watch
|
$.bind img, 'click', watch
|
||||||
inBefore input, img
|
$.before input, img
|
||||||
|
|
||||||
if getConfig 'Anonymize'
|
if getConfig 'Anonymize'
|
||||||
g.callbacks.push (root) ->
|
g.callbacks.push (root) ->
|
||||||
@ -1571,7 +1569,7 @@ else #not reply
|
|||||||
textContent: textContent
|
textContent: textContent
|
||||||
href: href
|
href: href
|
||||||
mv up, tn(' '), down, span
|
mv up, tn(' '), down, span
|
||||||
inBefore el, span
|
$.before el, span
|
||||||
if location.hash is '#p0'
|
if location.hash is '#p0'
|
||||||
window.location = window.location
|
window.location = window.location
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user