Reduce redundant code for changing image links.
This commit is contained in:
parent
c5f175ed13
commit
b32735322f
@ -26,8 +26,7 @@ Build.Test =
|
||||
href = el.href
|
||||
href = href.replace /(^\w+:\/\/boards.4chan.org\/[^\/]+\/thread\/\d+)\/.*/, '$1'
|
||||
el.setAttribute 'href', href
|
||||
for el in $$ '.fileText > a, a.fileThumb', root2 when ImageHost.regex.test(el.hostname)
|
||||
el.hostname = 'i.4cdn.org'
|
||||
ImageHost.fixLinks $$('.fileText > a, a.fileThumb', root2)
|
||||
for el in $$ 'img[src]', root2
|
||||
el.src = el.src.replace /(spoiler-\w+)\d(\.png)$/, '$11$2'
|
||||
for el in $$ 'pre.prettyprinted', root2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user