Now with Scriptish support!

This commit is contained in:
Zixaphir 2013-03-12 06:37:50 -07:00
parent 611377152e
commit ba43ab52dc
4 changed files with 16 additions and 8 deletions

View File

@ -190,7 +190,7 @@
d = document; d = document;
doc = d.documentElement; doc = null;
g = { g = {
VERSION: '3.0.0', VERSION: '3.0.0',
@ -5835,9 +5835,6 @@
} }
Misc.clearThreads("yourPosts." + g.BOARD); Misc.clearThreads("yourPosts." + g.BOARD);
this.syncYourPosts(); this.syncYourPosts();
if (Conf['Hide Original Post Form']) {
$.addClass(doc, 'hide-original-post-form');
}
$.on(d, '4chanXInitFinished', this.initReady); $.on(d, '4chanXInitFinished', this.initReady);
return Post.prototype.callbacks.push({ return Post.prototype.callbacks.push({
name: 'Quick Reply', name: 'Quick Reply',
@ -5850,6 +5847,9 @@
if (!QR.postingIsEnabled) { if (!QR.postingIsEnabled) {
return; return;
} }
if (Conf['Hide Original Post Form']) {
$.addClass(doc, 'hide-original-post-form');
}
link = $.el('a', { link = $.el('a', {
className: 'qr-shortcut', className: 'qr-shortcut',
textContent: 'Quick Reply', textContent: 'Quick Reply',
@ -7364,6 +7364,11 @@
Main = { Main = {
init: function() { init: function() {
var flatten, initFeature, key, pathname, val; var flatten, initFeature, key, pathname, val;
$.asap((function() {
return d.documentElement;
}), function() {
return doc = d.documentElement;
});
flatten = function(parent, obj) { flatten = function(parent, obj) {
var key, val; var key, val;
if (obj instanceof Array) { if (obj instanceof Array) {

View File

@ -4,7 +4,7 @@ return unless /^(boards|images|sys)\.4chan\.org$/.test location.hostname
Conf = {} Conf = {}
d = document d = document
doc = d.documentElement doc = null
g = g =
VERSION: '<%= version %>' VERSION: '<%= version %>'
NAMESPACE: "<%= meta.name %>." NAMESPACE: "<%= meta.name %>."

View File

@ -260,6 +260,9 @@ class Clone extends Post
Main = Main =
init: -> init: ->
$.asap (-> d.documentElement), ->
doc = d.documentElement
# flatten Config into Conf # flatten Config into Conf
# and get saved or default values # and get saved or default values
flatten = (parent, obj) -> flatten = (parent, obj) ->

View File

@ -5,9 +5,6 @@ QR =
Misc.clearThreads "yourPosts.#{g.BOARD}" Misc.clearThreads "yourPosts.#{g.BOARD}"
@syncYourPosts() @syncYourPosts()
if Conf['Hide Original Post Form']
$.addClass doc, 'hide-original-post-form'
$.on d, '4chanXInitFinished', @initReady $.on d, '4chanXInitFinished', @initReady
Post::callbacks.push Post::callbacks.push
@ -18,6 +15,9 @@ QR =
QR.postingIsEnabled = !!$.id 'postForm' QR.postingIsEnabled = !!$.id 'postForm'
return unless QR.postingIsEnabled return unless QR.postingIsEnabled
if Conf['Hide Original Post Form']
$.addClass doc, 'hide-original-post-form'
link = $.el 'a', link = $.el 'a',
className: 'qr-shortcut' className: 'qr-shortcut'
textContent: 'Quick Reply' textContent: 'Quick Reply'