Don't depend on prototype.toString()

This commit is contained in:
Nicolas Stepien 2011-09-26 22:03:56 +02:00
parent baf5a4ec13
commit 5dcff904a8
2 changed files with 4 additions and 14 deletions

View File

@ -532,11 +532,6 @@
callbacks: [],
init: function() {
var filter, key, m, regx, _i, _len;
HTMLBlockquoteElement.prototype.toString = function() {
return ($.el('a', {
innerHTML: this.innerHTML.replace(/<br>/g, '\n')
})).textContent;
};
for (key in config.filter) {
if (!(m = conf[key].match(/(.+)/g))) {
continue;
@ -616,7 +611,9 @@
},
com: function(root) {
var com;
if (com = $('blockquote', root).toString()) {
if (com = ($.el('a', {
innerHTML: $('blockquote', root).innerHTML.replace(/<br>/g, '\n')
})).textContent) {
return filter.test('com', com);
}
},

View File

@ -388,13 +388,6 @@ filter =
regexps: {}
callbacks: []
init: ->
HTMLQuoteElement.prototype.toString = ->
return ($.el 'a', innerHTML: @innerHTML.replace /<br>/g, '\n').textContent
#to remove when both chrom, ff and oprah will define blockquotes as HTMLQuoteElement
if HTMLBlockquoteElement
HTMLBlockquoteElement.prototype.toString = ->
return ($.el 'a', innerHTML: @innerHTML.replace /<br>/g, '\n').textContent
for key of config.filter
unless m = conf[key].match /(.+)/g
continue
@ -436,7 +429,7 @@ filter =
if (sub = if root.className is 'op' then $('.filetitle', root).textContent else $('.replytitle', root).textContent)
filter.test 'sub', sub
com: (root) ->
if com = $('blockquote', root).toString()
if com = ($.el 'a', innerHTML: $('blockquote', root).innerHTML.replace /<br>/g, '\n').textContent
filter.test 'com', com
file: (root) ->
if file = $ '.filesize span', root