formatting

This commit is contained in:
James Campos 2010-10-21 06:29:22 -07:00
parent 8bb9576474
commit d001dd3c9f

View File

@ -194,7 +194,7 @@ if location.hostname.split('.')[0] is 'sys'
GM_setValue('error', b.firstChild.textContent) GM_setValue('error', b.firstChild.textContent)
else else
GM_setValue('error', '') GM_setValue('error', '')
if getConfig('Auto Watch') if getConfig 'Auto Watch'
html = $('b').innerHTML html = $('b').innerHTML
[nop, thread, id] = html.match(/<!-- thread:(\d+),no:(\d+) -->/) [nop, thread, id] = html.match(/<!-- thread:(\d+),no:(\d+) -->/)
if thread is '0' if thread is '0'
@ -430,7 +430,7 @@ hideReply = (reply) ->
trip = $('span.postertrip', reply)?.textContent || '' trip = $('span.postertrip', reply)?.textContent || ''
table = x('ancestor::table', reply) table = x('ancestor::table', reply)
hide(table) hide(table)
if getConfig('Show Stubs') if getConfig 'Show Stubs'
a = n 'a', a = n 'a',
textContent: "[ + ] #{name} #{trip}" textContent: "[ + ] #{name} #{trip}"
className: 'pointer' className: 'pointer'
@ -466,7 +466,7 @@ iframeLoad = ->
className: 'error' className: 'error'
addTo qr, span addTo qr, span
$('input[title=autohide]:not(:checked)', qr)?.click() $('input[title=autohide]:not(:checked)', qr)?.click()
else if REPLY and getConfig('Persistent QR') else if REPLY and getConfig 'Persistent QR'
$('textarea', qr).value = '' $('textarea', qr).value = ''
$('input[name=recaptcha_response_field]', qr).value = '' $('input[name=recaptcha_response_field]', qr).value = ''
else else
@ -783,7 +783,7 @@ if getConfig 'Sauce'
addTo span, tn(' '), link addTo span, tn(' '), link
i++ i++
if getConfig('Reply Hiding') if getConfig 'Reply Hiding'
callbacks.push (root) -> callbacks.push (root) ->
tds = $$('td.doubledash', root) tds = $$('td.doubledash', root)
for td in tds for td in tds
@ -799,7 +799,7 @@ if getConfig('Reply Hiding')
if obj.id is id if obj.id is id
hideReply(next) hideReply(next)
if getConfig('Quick Reply') if getConfig 'Quick Reply'
iframe = n 'iframe', iframe = n 'iframe',
name: 'iframe' name: 'iframe'
listener: ['load', iframeLoad] listener: ['load', iframeLoad]
@ -815,7 +815,7 @@ if getConfig('Quick Reply')
recaptcha.id = '' recaptcha.id = ''
if getConfig('Quick Report') if getConfig 'Quick Report'
callbacks.push (root) -> callbacks.push (root) ->
arr = $$('span[id^=no]', root) arr = $$('span[id^=no]', root)
for el in arr for el in arr
@ -826,7 +826,7 @@ if getConfig('Quick Report')
inAfter el, a inAfter el, a
inAfter el, tn(' ') inAfter el, tn(' ')
if getConfig('Thread Watcher') if getConfig 'Thread Watcher'
#create watcher #create watcher
watcher = AEOS.makeDialog 'watcher', 'topleft' watcher = AEOS.makeDialog 'watcher', 'topleft'
watcher.innerHTML = '<div class="move">Thread Watcher</div><div></div>' watcher.innerHTML = '<div class="move">Thread Watcher</div><div></div>'
@ -851,7 +851,7 @@ if getConfig('Thread Watcher')
listener: ['click', watch] listener: ['click', watch]
inBefore input, img inBefore input, img
if getConfig('Anonymize') if getConfig 'Anonymize'
callbacks.push (root) -> callbacks.push (root) ->
names = $$('span.postername, span.commentpostername', root) names = $$('span.postername, span.commentpostername', root)
for name in names for name in names
@ -863,7 +863,7 @@ if getConfig('Anonymize')
else else
remove(trip) remove(trip)
if getConfig('Reply Navigation') if getConfig 'Reply Navigation'
callbacks.push (root) -> callbacks.push (root) ->
arr = $$('span[id^=norep]', root) arr = $$('span[id^=norep]', root)
for el in arr for el in arr
@ -880,7 +880,7 @@ if getConfig('Reply Navigation')
inAfter el, span inAfter el, span
if REPLY if REPLY
if getConfig('Quick Reply') and getConfig('Persistent QR') if getConfig('Quick Reply') and getConfig 'Persistent QR'
quickReply() quickReply()
$('#qr input[title=autohide]').click() $('#qr input[title=autohide]').click()
if getConfig 'Post in Title' if getConfig 'Post in Title'
@ -890,17 +890,17 @@ if REPLY
d.title = "/#{BOARD}/ - #{text}" d.title = "/#{BOARD}/ - #{text}"
else else
if getConfig('Thread Hiding') if getConfig 'Thread Hiding'
delform = $('form[name=delform]') delform = $('form[name=delform]')
#don't confuse other scripts #don't confuse other scripts
d.addEventListener('DOMNodeInserted', stopPropagation, true) d.addEventListener('DOMNodeInserted', stopPropagation, true)
threadF(delform.firstChild) threadF(delform.firstChild)
d.removeEventListener('DOMNodeInserted', stopPropagation, true) d.removeEventListener('DOMNodeInserted', stopPropagation, true)
if getConfig('Auto Watch') if getConfig 'Auto Watch'
$('form[name="post"]').addEventListener('submit', autoWatch, true) $('form[name="post"]').addEventListener('submit', autoWatch, true)
if getConfig('Thread Navigation') if getConfig 'Thread Navigation'
arr = $$('div > span.filesize, form > span.filesize') arr = $$('div > span.filesize, form > span.filesize')
i = 0 i = 0
l = arr.length l = arr.length
@ -940,7 +940,7 @@ else
if location.hash is '#1' if location.hash is '#1'
window.location = window.location window.location = window.location
if getConfig('Thread Expansion') if getConfig 'Thread Expansion'
omitted = $$('span.omittedposts') omitted = $$('span.omittedposts')
for span in omitted for span in omitted
a = n 'a', a = n 'a',
@ -949,11 +949,10 @@ else
listener: ['click', expandThread] listener: ['click', expandThread]
replace(span, a) replace(span, a)
if getConfig('Comment Expansion') if getConfig 'Comment Expansion'
as = $$('span.abbr a') as = $$('span.abbr a')
for a in as for a in as
a.addEventListener('click', expandComment, true) a.addEventListener('click', expandComment, true)
for callback in callbacks callback() for callback in callbacks
callback()
d.body.addEventListener('DOMNodeInserted', nodeInserted, true) d.body.addEventListener('DOMNodeInserted', nodeInserted, true)