From 6c3dbd6c452f81163b89c81f0f1e4babfd1df61e Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 10 Jul 2011 20:16:36 -0700 Subject: [PATCH] shuffle --- 4chan_x.user.js | 43 +++++++++++++++++++++---------------------- script.coffee | 36 +++++++++++++++--------------------- 2 files changed, 36 insertions(+), 43 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 9b64855c2..31909a9cd 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -61,11 +61,6 @@ (function() { var $, $$, Favicon, NAMESPACE, Recaptcha, Time, anonymize, config, cooldown, d, expandComment, expandThread, firstRun, g, imageHover, imgExpand, imgGif, imgPreloading, keybinds, log, main, nav, nodeInserted, options, qr, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, threadHiding, threadStats, threading, titlePost, ui, unread, updater, watcher, _config, _ref; var __slice = Array.prototype.slice; - if (typeof console !== "undefined" && console !== null) { - log = function(arg) { - return console.log(arg); - }; - } config = { main: { Posting: { @@ -168,6 +163,27 @@ return _config[parent] = obj; } })(null, config); + if (typeof console !== "undefined" && console !== null) { + log = function(arg) { + return console.log(arg); + }; + } + if (!Object.keys) { + Object.keys = function(o) { + var key, _i, _len, _results; + _results = []; + for (_i = 0, _len = o.length; _i < _len; _i++) { + key = o[_i]; + _results.push(key); + } + return _results; + }; + } + NAMESPACE = 'AEOS.4chan_x.'; + d = document; + g = { + callbacks: [] + }; ui = { dialog: function(id, position, html) { var el, left, top, _ref, _ref2; @@ -255,8 +271,6 @@ return $.hide(ui.el); } }; - d = document; - g = null; $ = function(selector, root) { if (root == null) { root = d.body; @@ -481,17 +495,6 @@ } }); } - if (!Object.keys) { - Object.keys = function(o) { - var key, _i, _len, _results; - _results = []; - for (_i = 0, _len = o.length; _i < _len; _i++) { - key = o[_i]; - _results.push(key); - } - return _results; - }; - } $$ = function(selector, root) { if (root == null) { root = d.body; @@ -2664,10 +2667,6 @@ return $.unbind(window, 'click', firstRun.close); } }; - NAMESPACE = 'AEOS.4chan_x.'; - g = { - callbacks: [] - }; main = { init: function() { var DAY, callback, canPost, cutoff, form, hiddenThreads, id, lastChecked, now, op, pathname, reply, table, temp, timestamp, tzOffset, _i, _j, _k, _l, _len, _len2, _len3, _len4, _ref2, _ref3, _ref4, _ref5, _ref6; diff --git a/script.coffee b/script.coffee index 68fc4fb40..cf111c909 100644 --- a/script.coffee +++ b/script.coffee @@ -1,8 +1,3 @@ -# XXX chrome can't into `{log} = console` -if console? - log = (arg) -> - console.log arg - config = main: Posting: @@ -96,6 +91,21 @@ _config = {} _config[parent] = obj ) null, config +# XXX chrome can't into `{log} = console` +if console? + log = (arg) -> + console.log arg + +# XXX opera cannot into Object.keys +if not Object.keys + Object.keys = (o) -> + key for key in o + +NAMESPACE = 'AEOS.4chan_x.' +d = document +g = + callbacks: [] + ui = dialog: (id, position, html) -> el = d.createElement 'div' @@ -175,11 +185,6 @@ ui = ui.el.style.top = 'auto' $.hide ui.el -#convenience -d = document -g = null #globals - -#utility $ = (selector, root=d.body) -> root.querySelector selector @@ -344,15 +349,9 @@ else name = NAMESPACE + name localStorage[name] = JSON.stringify value -# XXX opera cannot into Object.keys -if not Object.keys - Object.keys = (o) -> - key for key in o - $$ = (selector, root=d.body) -> Array::slice.call root.querySelectorAll selector -#funks expandComment = init: -> for a in $$ 'span.abbr a' @@ -2069,11 +2068,6 @@ firstRun = $.rm $ '#overlay' $.unbind window, 'click', firstRun.close -#main -NAMESPACE = 'AEOS.4chan_x.' -g = - callbacks: [] - main = init: -> pathname = location.pathname.substring(1).split('/')