diff --git a/4chan_x.user.js b/4chan_x.user.js index 18ddec5e0..9b318a25c 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -688,7 +688,7 @@ var a, div, id, name, table, trip, _ref; table = reply.parentNode.parentNode.parentNode; $.hide(table); - if ($.config('Show Stubs')) { + if (conf['Show Stubs']) { name = $('span.commentpostername', reply).textContent; trip = ((_ref = $('span.postertrip', reply)) != null ? _ref.textContent : void 0) || ''; a = $.el('a', { @@ -1051,7 +1051,7 @@ var arr, checked, description, dialog, hiddenNum, hiddenThreads, hidingul, html, input, key, li, link, main, obj, overlay, ul, _i, _j, _k, _len, _len2, _len3, _ref, _ref2, _ref3, _ref4; hiddenThreads = $.getValue("hiddenThreads/" + g.BOARD + "/", {}); hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length; - html = "

"; + html = "

"; dialog = $.el('div', { id: 'options', innerHTML: html @@ -1068,7 +1068,7 @@ } for (key in obj) { arr = obj[key]; - checked = $.config(key) ? "checked" : ""; + checked = conf[key] ? "checked" : ""; description = arr[1]; li = $.el('li', { innerHTML: ": " + description + "" @@ -1275,13 +1275,13 @@ return; } if (qr.el) { - if (g.REPLY && $.config('Persistent QR')) { + if (g.REPLY && conf['Persistent QR']) { qr.refresh(); } else { qr.close(); } } - if ($.config('Cooldown')) { + if (conf['Cooldown']) { duration = qr.sage ? 60 : 30; $.setValue(g.BOARD + '/cooldown', Date.now() + duration * 1000); return cooldown.start(); @@ -1299,7 +1299,7 @@ }, submit: function(e) { var id, inputfile, isQR, op; - if ($.config('Auto Watch Reply') && $.config('Thread Watcher')) { + if (conf['Auto Watch Reply'] && conf['Thread Watcher']) { if (g.REPLY && $('img.favicon').src === Favicon.empty) { watcher.watch(null, g.THREAD_ID); } else { @@ -1522,7 +1522,7 @@ }, hideHide: function(thread) { var a, div, name, num, span, text, trip, _ref; - if ($.config('Show Stubs')) { + if (conf['Show Stubs']) { if (span = $('.omittedposts', thread)) { num = Number(span.textContent.match(/\d+/)[0]); } else { @@ -1562,17 +1562,17 @@ updater = { init: function() { var autoUpT, checked, dialog, html, input, interva, name, title, updNow, verbose, _i, _len, _ref; - updater.interval = $.config('Interval'); - updater.ircUpd = $.config('IRC Updating'); - updater.verbose = $.config('Verbose'); + updater.interval = conf['Interval']; + updater.ircUpd = conf['IRC Updating']; + updater.verbose = conf['Verbose']; html = "
-" + updater.interval + "
"; conf = config.updater.checkbox; for (name in conf) { title = conf[name][1]; - checked = $.config(name) ? 'checked' : ''; + checked = conf[name] ? 'checked' : ''; html += "
"; } - checked = $.config('Auto Update') ? 'checked' : ''; + checked = conf['Auto Update'] ? 'checked' : ''; html += "
"; dialog = ui.dialog('updater', { bottom: '0', @@ -1813,7 +1813,7 @@ var prefix, s; sauce.prefixes = (function() { var _i, _len, _ref, _results; - _ref = $.config('flavors').split('\n'); + _ref = conf['flavors'].split('\n'); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { s = _ref[_i]; @@ -1892,7 +1892,7 @@ }, foo: function() { var code; - code = $.config('time').replace(/%([A-Za-z])/g, function(s, c) { + code = conf['time'].replace(/%([A-Za-z])/g, function(s, c) { switch (c) { case 'a': case 'A': @@ -1978,9 +1978,9 @@ }; quoteBacklink = { init: function() { - quoteBacklink.opbl = !$.config('OP Backlinks'); - quoteBacklink.qp = $.config('Quote Preview'); - quoteBacklink.qi = $.config('Quote Inline'); + quoteBacklink.opbl = !conf['OP Backlinks']; + quoteBacklink.qp = conf['Quote Preview']; + quoteBacklink.qi = conf['Quote Inline']; return g.callbacks.push(function(root) { var container, el, id, link, qid, quote, quotes, _i, _len, _ref, _results; if (/inline/.test(root.className)) { @@ -2133,7 +2133,7 @@ }; quotePreview = { init: function() { - quotePreview.hl = $.config('Quote Highlighting'); + quotePreview.hl = conf['Quote Highlighting']; return g.callbacks.push(function(root) { var quote, _i, _len, _ref, _results; _ref = $$('a.quotelink, a.backlink', root); @@ -2652,7 +2652,7 @@ qr.sys(); return; } - if ($.config('404 Redirect') && d.title === '4chan - 404' && /^\d+$/.test(g.THREAD_ID)) { + if (conf['404 Redirect'] && d.title === '4chan - 404' && /^\d+$/.test(g.THREAD_ID)) { redirect(); return; } @@ -2696,99 +2696,99 @@ $.bind(form, 'submit', qr.submit); } threading.init(); - if ($.config('Auto Noko')) { + if (conf['Auto Noko']) { $('.postarea form').action += '?auto_noko'; } - if ($.config('Cooldown')) { + if (conf['Cooldown']) { cooldown.init(); } - if ($.config('Image Expansion')) { + if (conf['Image Expansion']) { imgExpand.init(); } - if ($.config('Image Auto-Gif')) { + if (conf['Image Auto-Gif']) { imgGif.init(); } - if ($.config('Time Formatting')) { + if (conf['Time Formatting']) { Time.init(); } - if ($.config('Sauce')) { + if (conf['Sauce']) { sauce.init(); } - if ($.config('Reveal Spoilers')) { + if (conf['Reveal Spoilers']) { revealSpoilers.init(); } - if ($.config('Anonymize')) { + if (conf['Anonymize']) { anonymize.init(); } - if ($.config('Image Hover')) { + if (conf['Image Hover']) { imgHover.init(); } - if ($.config('Reply Hiding')) { + if (conf['Reply Hiding']) { replyHiding.init(); } - if (canPost && $.config('Quick Reply')) { + if (canPost && conf['Quick Reply']) { qr.init(); } - if ($.config('Report Button')) { + if (conf['Report Button']) { reportButton.init(); } - if ($.config('Quote Backlinks')) { + if (conf['Quote Backlinks']) { quoteBacklink.init(); } - if ($.config('Quote Inline')) { + if (conf['Quote Inline']) { quoteInline.init(); } - if ($.config('Quote Preview')) { + if (conf['Quote Preview']) { quotePreview.init(); } - if ($.config('Indicate OP quote')) { + if (conf['Indicate OP quote']) { quoteOP.init(); } - if ($.config('Thread Watcher')) { + if (conf['Thread Watcher']) { watcher.init(); } - if ($.config('Keybinds')) { + if (conf['Keybinds']) { keybinds.init(); } if (g.REPLY) { - if ($.config('Thread Updater')) { + if (conf['Thread Updater']) { updater.init(); } - if ($.config('Image Preloading')) { + if (conf['Image Preloading']) { imgPreloading.init(); } - if ($.config('Quick Reply') && $.config('Persistent QR')) { + if (conf['Quick Reply'] && conf['Persistent QR']) { qr.persist(); } - if ($.config('Post in Title')) { + if (conf['Post in Title']) { titlePost.init(); } - if ($.config('Thread Stats')) { + if (conf['Thread Stats']) { threadStats.init(); } - if ($.config('Unread Count')) { + if (conf['Unread Count']) { unread.init(); } - if ($.config('Reply Navigation')) { + if (conf['Reply Navigation']) { nav.init(); } - if ($.config('Auto Watch') && $.config('Thread Watcher') && location.hash === '#watch' && $('img.favicon').src === Favicon.empty) { + if (conf['Auto Watch'] && conf['Thread Watcher'] && location.hash === '#watch' && $('img.favicon').src === Favicon.empty) { watcher.watch(null, g.THREAD_ID); } } else { - if ($.config('Index Navigation')) { + if (conf['Index Navigation']) { nav.init(); } - if ($.config('Thread Hiding')) { + if (conf['Thread Hiding']) { threadHiding.init(); } - if ($.config('Thread Expansion')) { + if (conf['Thread Expansion']) { expandThread.init(); } - if ($.config('Comment Expansion')) { + if (conf['Comment Expansion']) { expandComment.init(); } - if ($.config('Auto Watch')) { + if (conf['Auto Watch']) { $('.postarea form').action += '?auto_watch'; } } diff --git a/script.coffee b/script.coffee index 4b76ffb77..894803b9f 100644 --- a/script.coffee +++ b/script.coffee @@ -486,7 +486,7 @@ replyHiding = table = reply.parentNode.parentNode.parentNode $.hide table - if $.config 'Show Stubs' + if conf['Show Stubs'] name = $('span.commentpostername', reply).textContent trip = $('span.postertrip', reply)?.textContent or '' a = $.el 'a', @@ -793,9 +793,9 @@ options =
- +