$.remove -> $.rm

This commit is contained in:
James Campos 2011-05-14 07:49:00 -07:00
parent 387c6b33b5
commit c638042de4
2 changed files with 26 additions and 26 deletions

View File

@ -263,7 +263,7 @@
textContent: "(" + code + ")()" textContent: "(" + code + ")()"
}); });
$.append(d.head, script); $.append(d.head, script);
return $.remove(script); return $.rm(script);
}, },
get: function(url, cb) { get: function(url, cb) {
var r; var r;
@ -322,7 +322,7 @@
removeClass: function(el, className) { removeClass: function(el, className) {
return el.className = el.className.replace(' ' + className, ''); return el.className = el.className.replace(' ' + className, '');
}, },
remove: function(el) { rm: function(el) {
return el.parentNode.removeChild(el); return el.parentNode.removeChild(el);
}, },
append: function() { append: function() {
@ -567,7 +567,7 @@
table = $.x("following::br[@clear][1]/preceding::table[" + num + "]", a); table = $.x("following::br[@clear][1]/preceding::table[" + num + "]", a);
_results = []; _results = [];
while ((prev = table.previousSibling) && (prev.nodeName === 'TABLE')) { while ((prev = table.previousSibling) && (prev.nodeName === 'TABLE')) {
_results.push($.remove(prev)); _results.push($.rm(prev));
} }
return _results; return _results;
} }
@ -576,7 +576,7 @@
var body, br, next, table, tables, _i, _len, _results; var body, br, next, table, tables, _i, _len, _results;
a.textContent = a.textContent.replace('X Loading...', '-'); a.textContent = a.textContent.replace('X Loading...', '-');
while ((next = a.nextSibling) && !next.clear) { while ((next = a.nextSibling) && !next.clear) {
$.remove(next); $.rm(next);
} }
br = next; br = next;
body = $.el('body', { body = $.el('body', {
@ -624,7 +624,7 @@
div = this.parentNode; div = this.parentNode;
table = div.nextSibling; table = div.nextSibling;
replyHiding.show(table); replyHiding.show(table);
return $.remove(div); return $.rm(div);
} }
}, },
hide: function(reply) { hide: function(reply) {
@ -694,7 +694,7 @@
switch (keybinds.key) { switch (keybinds.key) {
case '<Esc>': case '<Esc>':
e.preventDefault(); e.preventDefault();
return $.remove($('#qr')); return $.rm($('#qr'));
case '^s': case '^s':
ta = d.activeElement; ta = d.activeElement;
if (ta.nodeName !== 'TEXTAREA') { if (ta.nodeName !== 'TEXTAREA') {
@ -920,7 +920,7 @@
toggle: function() { toggle: function() {
var dialog; var dialog;
if (dialog = $('#options')) { if (dialog = $('#options')) {
return $.remove(dialog); return $.rm(dialog);
} else { } else {
return options.dialog(); return options.dialog();
} }
@ -1017,7 +1017,7 @@
if ($.config('Persistent QR')) { if ($.config('Persistent QR')) {
qr.refresh(dialog); qr.refresh(dialog);
} else { } else {
$.remove(dialog); $.rm(dialog);
} }
} }
if ($.config('Cooldown')) { if ($.config('Cooldown')) {
@ -1328,7 +1328,7 @@
}, },
show: function(thread) { show: function(thread) {
var hiddenThreads, id; var hiddenThreads, id;
$.remove($('div.block', thread)); $.rm($('div.block', thread));
$.removeClass(thread, 'stub'); $.removeClass(thread, 'stub');
$.show(thread); $.show(thread);
$.show(thread.nextSibling); $.show(thread.nextSibling);
@ -1505,7 +1505,7 @@
_ref = $$('div:not(.move)', dialog); _ref = $$('div:not(.move)', dialog);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
div = _ref[_i]; div = _ref[_i];
$.remove(div); $.rm(div);
} }
for (board in watched) { for (board in watched) {
_ref2 = watched[board]; _ref2 = watched[board];
@ -1588,9 +1588,9 @@
name.textContent = 'Anonymous'; name.textContent = 'Anonymous';
if (trip = $('span.postertrip', root)) { if (trip = $('span.postertrip', root)) {
if (trip.parentNode.nodeName === 'A') { if (trip.parentNode.nodeName === 'A') {
return $.remove(trip.parentNode); return $.rm(trip.parentNode);
} else { } else {
return $.remove(trip); return $.rm(trip);
} }
} }
} }
@ -2100,7 +2100,7 @@
}, },
contract: function(thumb) { contract: function(thumb) {
$.show(thumb); $.show(thumb);
return $.remove(thumb.nextSibling); return $.rm(thumb.nextSibling);
}, },
expand: function(thumb) { expand: function(thumb) {
var a, img; var a, img;

View File

@ -178,7 +178,7 @@ $.extend $,
script = $.el 'script', script = $.el 'script',
textContent: "(#{code})()" textContent: "(#{code})()"
$.append d.head, script $.append d.head, script
$.remove script $.rm script
get: (url, cb) -> get: (url, cb) ->
r = new XMLHttpRequest() r = new XMLHttpRequest()
r.onload = cb r.onload = cb
@ -214,7 +214,7 @@ $.extend $,
el.className += ' ' + className el.className += ' ' + className
removeClass: (el, className) -> removeClass: (el, className) ->
el.className = el.className.replace ' ' + className, '' el.className = el.className.replace ' ' + className, ''
remove: (el) -> rm: (el) ->
el.parentNode.removeChild el el.parentNode.removeChild el
append: (parent, children...) -> append: (parent, children...) ->
for child in children for child in children
@ -401,14 +401,14 @@ expandThread =
num = if g.BOARD is 'b' then 3 else 5 num = if g.BOARD is 'b' then 3 else 5
table = $.x "following::br[@clear][1]/preceding::table[#{num}]", a table = $.x "following::br[@clear][1]/preceding::table[#{num}]", a
while (prev = table.previousSibling) and (prev.nodeName is 'TABLE') while (prev = table.previousSibling) and (prev.nodeName is 'TABLE')
$.remove prev $.rm prev
expand: (html, thread, a) -> expand: (html, thread, a) ->
a.textContent = a.textContent.replace 'X Loading...', '-' a.textContent = a.textContent.replace 'X Loading...', '-'
# eat everything, then replace with fresh full posts # eat everything, then replace with fresh full posts
while (next = a.nextSibling) and not next.clear #br[clear] while (next = a.nextSibling) and not next.clear #br[clear]
$.remove next $.rm next
br = next br = next
body = $.el 'body', body = $.el 'body',
@ -446,7 +446,7 @@ replyHiding =
table = div.nextSibling table = div.nextSibling
replyHiding.show table replyHiding.show table
$.remove div $.rm div
hide: (reply) -> hide: (reply) ->
table = reply.parentNode.parentNode.parentNode table = reply.parentNode.parentNode.parentNode
@ -506,7 +506,7 @@ keybinds =
switch keybinds.key switch keybinds.key
when '<Esc>' when '<Esc>'
e.preventDefault() e.preventDefault()
$.remove $ '#qr' $.rm $ '#qr'
when '^s' when '^s'
ta = d.activeElement ta = d.activeElement
return unless ta.nodeName is 'TEXTAREA' return unless ta.nodeName is 'TEXTAREA'
@ -701,7 +701,7 @@ options =
toggle: -> toggle: ->
if dialog = $ '#options' if dialog = $ '#options'
$.remove dialog $.rm dialog
else else
options.dialog() options.dialog()
@ -780,7 +780,7 @@ qr =
if $.config 'Persistent QR' if $.config 'Persistent QR'
qr.refresh dialog qr.refresh dialog
else else
$.remove dialog $.rm dialog
if $.config 'Cooldown' if $.config 'Cooldown'
qr.cooldown true qr.cooldown true
@ -1073,7 +1073,7 @@ threadHiding =
$.hide thread.nextSibling $.hide thread.nextSibling
show: (thread) -> show: (thread) ->
$.remove $ 'div.block', thread $.rm $ 'div.block', thread
$.removeClass thread, 'stub' $.removeClass thread, 'stub'
$.show thread $.show thread
$.show thread.nextSibling $.show thread.nextSibling
@ -1227,7 +1227,7 @@ watcher =
refresh: (watched) -> refresh: (watched) ->
dialog = $ '#watcher' dialog = $ '#watcher'
for div in $$ 'div:not(.move)', dialog for div in $$ 'div:not(.move)', dialog
$.remove div $.rm div
for board of watched for board of watched
for id, props of watched[board] for id, props of watched[board]
div = $.el 'div' div = $.el 'div'
@ -1295,9 +1295,9 @@ anonymize =
name.textContent = 'Anonymous' name.textContent = 'Anonymous'
if trip = $ 'span.postertrip', root if trip = $ 'span.postertrip', root
if trip.parentNode.nodeName is 'A' if trip.parentNode.nodeName is 'A'
$.remove trip.parentNode $.rm trip.parentNode
else else
$.remove trip $.rm trip
sauce = sauce =
init: -> init: ->
@ -1613,7 +1613,7 @@ imgExpand =
contract: (thumb) -> contract: (thumb) ->
$.show thumb $.show thumb
$.remove thumb.nextSibling $.rm thumb.nextSibling
expand: (thumb) -> expand: (thumb) ->
$.hide thumb $.hide thumb