diff --git a/4chan_x.user.js b/4chan_x.user.js index 58309cfd8..8fca7d626 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1204,7 +1204,6 @@ }); $.on($('a', link), 'click', qr.open); form = d.forms[0]; - form.hidden = true; $.before(form, link); } g.callbacks.push(function(root) { @@ -3494,6 +3493,10 @@ if (conf['Quote Backlinks']) quoteBacklink.init(); if (conf['Indicate OP quote']) quoteOP.init(); if (conf['Indicate Cross-thread Quotes']) quoteDR.init(); + if (conf['Quick Reply'] && conf['Hide Original Post Form']) { + Main.css += 'form[name=post] { display: none; }'; + } + Main.addStyle(); return $.ready(Main.ready); }, ready: function() { @@ -3504,7 +3507,6 @@ } if (!$.id('navtopr')) return; $.addClass(d.body, engine); - $.addStyle(Main.css); threading.init(); Favicon.init(); if (conf['Quick Reply']) qr.init(); @@ -3539,6 +3541,14 @@ } return $.on(form, 'DOMNodeInserted', Main.node); }, + addStyle: function() { + $.off(d, 'DOMNodeInserted', Main.addStyle); + if (d.head) { + return $.addStyle(Main.css); + } else { + return $.on(d, 'DOMNodeInserted', Main.addStyle); + } + }, message: function(e) { var data, version; data = e.data; @@ -3894,7 +3904,8 @@ img[md5], img[md5] + img {\ }\ .filtered {\ text-decoration: line-through;\ -}' +}\ +' }; Main.init(); diff --git a/changelog b/changelog index b08c04753..73932bdff 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- aeosynth + prevent post form flicker - Mayhem Increase Sauce linking possibilites: Thumbnails, full images, MD5 hashes. diff --git a/script.coffee b/script.coffee index 8994a342f..6d7a7f3ef 100644 --- a/script.coffee +++ b/script.coffee @@ -871,7 +871,6 @@ qr = link = $.el 'h1', innerHTML: "#{if g.REPLY then 'Open the Quick Reply' else 'Create a New Thread'}" $.on $('a', link), 'click', qr.open form = d.forms[0] - form.hidden = true $.before form, link g.callbacks.push (root) -> $.on $('.quotejs + .quotejs', root), 'click', qr.quote @@ -2730,6 +2729,10 @@ Main = if conf['Indicate Cross-thread Quotes'] quoteDR.init() + if conf['Quick Reply'] and conf['Hide Original Post Form'] + Main.css += 'form[name=post] { display: none; }' + + Main.addStyle() $.ready Main.ready @@ -2740,7 +2743,6 @@ Main = if not $.id 'navtopr' return $.addClass d.body, engine - $.addStyle Main.css threading.init() Favicon.init() @@ -2797,6 +2799,13 @@ Main = alert err $.on form, 'DOMNodeInserted', Main.node + addStyle: -> + $.off d, 'DOMNodeInserted', Main.addStyle + if d.head + $.addStyle Main.css + else # XXX fox + $.on d, 'DOMNodeInserted', Main.addStyle + message: (e) -> {data} = e {version} = data @@ -3143,6 +3152,7 @@ img[md5], img[md5] + img { } .filtered { text-decoration: line-through; -}' +} +' Main.init()