less stupidity

This commit is contained in:
James Campos 2011-05-15 10:23:51 -07:00
parent 5742127760
commit b00bc31097
2 changed files with 11 additions and 20 deletions

View File

@ -1760,17 +1760,13 @@
return $.after(this.parentNode, inline); return $.after(this.parentNode, inline);
} }
}, },
parse: function(req, id, threadID, oldInline) { parse: function(req, id, threadID, inline) {
var body, html, inline, op, reply, td, _i, _len, _ref; var body, clone, html, op, reply, _i, _len, _ref;
if (req.status !== 200) { if (req.status !== 200) {
oldInline.innerHTML = "" + req.status + " " + req.statusText; inline.innerHTML = "" + req.status + " " + req.statusText;
return; return;
} }
inline = $.el('table', { clone = inline.cloneNode(true);
className: 'inline',
innerHTML: '<tbody><tr><td class=reply></td></tr></tbody>'
});
td = $('td', inline);
body = $.el('body', { body = $.el('body', {
innerHTML: req.responseText innerHTML: req.responseText
}); });
@ -1787,8 +1783,8 @@
} }
} }
} }
td.innerHTML = html; $('td', clone).innerHTML = html;
return $.replace(oldInline, inline); return $.replace(inline, clone);
} }
}; };
quotePreview = { quotePreview = {

View File

@ -1396,17 +1396,12 @@ quoteInline =
$.hide $.x 'ancestor::table[1]', el $.hide $.x 'ancestor::table[1]', el
else else
$.after @parentNode, inline $.after @parentNode, inline
parse: (req, id, threadID, oldInline) -> parse: (req, id, threadID, inline) ->
if req.status isnt 200 if req.status isnt 200
oldInline.innerHTML = "#{req.status} #{req.statusText}" inline.innerHTML = "#{req.status} #{req.statusText}"
return return
#this is fucking stupid clone = inline.cloneNode true
inline = $.el 'table',
className: 'inline'
innerHTML: '<tbody><tr><td class=reply></td></tr></tbody>'
td = $ 'td', inline
body = $.el 'body', body = $.el 'body',
innerHTML: req.responseText innerHTML: req.responseText
if id == threadID #OP if id == threadID #OP
@ -1417,8 +1412,8 @@ quoteInline =
if reply.id == id if reply.id == id
html = reply.innerHTML html = reply.innerHTML
break break
td.innerHTML = html $('td', clone).innerHTML = html
$.replace oldInline, inline $.replace inline, clone
quotePreview = quotePreview =
init: -> init: ->