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

View File

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