diff --git a/CHANGELOG.md b/CHANGELOG.md index f18e0f033..2661df7c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +**MayhemYDG**: +- Tiny fixes + +**seaweedchan**: +- New image expansion option: `Advance on contract`. Advances to next post unless Fappe Tyme is enabled (temporary) +- Change `.qr-link` to `.qr-link-container` and `.qr-link>a` to `.qr-link` + +**Wohlfe**: +- Add /pol/ archiving for FoolzaShit + ### v1.2.7 *2013-05-18* diff --git a/builds/4chan-X.js b/builds/4chan-X.js index d60a8397d..fbbea8171 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -441,7 +441,7 @@ }; $.ajax = function(url, callbacks, opts) { - var cred, form, headers, key, r, sync, type, upCallbacks, val; + var cred, err, form, headers, key, r, sync, type, upCallbacks, val; if (opts == null) { opts = {}; @@ -457,7 +457,11 @@ } $.extend(r, callbacks); $.extend(r.upload, upCallbacks); - r.withCredentials = cred; + try { + r.withCredentials = cred; + } catch (_error) { + err = _error; + } r.send(form); return r; }; @@ -471,7 +475,7 @@ if (req = reqs[url]) { if (req.readyState === 4) { - cb.call(req); + cb.call(req, req.evt); } else { req.callbacks.push(cb); } @@ -489,6 +493,7 @@ cb = _ref[_i]; cb.call(this, e); } + this.evt = e; return delete this.callbacks; }, onabort: rm, @@ -1315,7 +1320,7 @@ _ref = this.data.boards; for (boardID in _ref) { val = _ref[boardID]; - if (!val) { + if (typeof this.data.boards[boardID] !== 'object') { delete this.data.boards[boardID]; } else { this.deleteIfEmpty({ @@ -2073,7 +2078,7 @@ return; } clone = post.addClone(context); - Main.callbackNodes(Post, [clone]); + Main.callbackNodes(Clone, [clone]); nodes = clone.nodes; $.rmAll(nodes.root); $.add(nodes.root, nodes.post); @@ -6626,7 +6631,7 @@ open: function(post) { var node; - if (post.isDead) { + if (post.isDead || post.board.ID === 'q') { return false; } DeleteLink.post = post; @@ -6702,7 +6707,7 @@ return; } DeleteLink.cooldown.counting = post; - length = post.board.ID === 'q' ? 600 : 30; + length = 30; seconds = Math.ceil((length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND); return DeleteLink.cooldown.count(post, seconds, length, node); }, @@ -7875,7 +7880,7 @@ 'http': true, 'https': true, 'software': 'foolfuuka', - 'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y'], + 'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 'pol', 's', 's4s', 't', 'trv', 'y'], 'files': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y'] }, 'Install Gentoo': { @@ -7898,8 +7903,8 @@ 'domain': 'archive.heinessen.com', 'http': true, 'software': 'fuuka', - 'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'], - 'files': ['an', 'k', 'toy', 'x'] + 'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy'], + 'files': ['an', 'k', 'toy'] }, 'warosu': { 'domain': 'fuuka.warosu.org', @@ -10030,8 +10035,26 @@ Main = { init: function(items) { - var db, flatten, _i, _len; + var db, flatten, pathname, _i, _len, _ref; + pathname = location.pathname.split('/'); + g.BOARD = new Board(pathname[1]); + if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { + return; + } + g.VIEW = (function() { + switch (pathname[2]) { + case 'res': + return 'thread'; + case 'catalog': + return 'catalog'; + default: + return 'index'; + } + })(); + if (g.VIEW === 'thread') { + g.THREADID = +pathname[3]; + } flatten = function(parent, obj) { var key, val; @@ -10057,9 +10080,9 @@ $.get(Conf, Main.initFeatures); $.on(d, '4chanMainInit', Main.initStyle); return $.asap((function() { - var _ref; + var _ref1; - return d.head && $('link[rel="shortcut icon"]', d.head) || ((_ref = d.readyState) === 'interactive' || _ref === 'complete'); + return d.head && $('link[rel="shortcut icon"]', d.head) || ((_ref1 = d.readyState) === 'interactive' || _ref1 === 'complete'); }), Main.initStyle); }, initFeatures: function(items) { diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 0b43f6779..dc33acbc4 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -438,7 +438,7 @@ }; $.ajax = function(url, callbacks, opts) { - var cred, form, headers, key, r, sync, type, upCallbacks, val; + var cred, err, form, headers, key, r, sync, type, upCallbacks, val; if (opts == null) { opts = {}; @@ -454,7 +454,11 @@ } $.extend(r, callbacks); $.extend(r.upload, upCallbacks); - r.withCredentials = cred; + try { + r.withCredentials = cred; + } catch (_error) { + err = _error; + } r.send(form); return r; }; @@ -468,7 +472,7 @@ if (req = reqs[url]) { if (req.readyState === 4) { - cb.call(req); + cb.call(req, req.evt); } else { req.callbacks.push(cb); } @@ -486,6 +490,7 @@ cb = _ref[_i]; cb.call(this, e); } + this.evt = e; return delete this.callbacks; }, onabort: rm, @@ -1311,7 +1316,7 @@ _ref = this.data.boards; for (boardID in _ref) { val = _ref[boardID]; - if (!val) { + if (typeof this.data.boards[boardID] !== 'object') { delete this.data.boards[boardID]; } else { this.deleteIfEmpty({ @@ -2069,7 +2074,7 @@ return; } clone = post.addClone(context); - Main.callbackNodes(Post, [clone]); + Main.callbackNodes(Clone, [clone]); nodes = clone.nodes; $.rmAll(nodes.root); $.add(nodes.root, nodes.post); @@ -6635,7 +6640,7 @@ open: function(post) { var node; - if (post.isDead) { + if (post.isDead || post.board.ID === 'q') { return false; } DeleteLink.post = post; @@ -6711,7 +6716,7 @@ return; } DeleteLink.cooldown.counting = post; - length = post.board.ID === 'q' ? 600 : 30; + length = 30; seconds = Math.ceil((length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND); return DeleteLink.cooldown.count(post, seconds, length, node); }, @@ -7884,7 +7889,7 @@ 'http': true, 'https': true, 'software': 'foolfuuka', - 'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y'], + 'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 'pol', 's', 's4s', 't', 'trv', 'y'], 'files': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y'] }, 'Install Gentoo': { @@ -7907,8 +7912,8 @@ 'domain': 'archive.heinessen.com', 'http': true, 'software': 'fuuka', - 'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'], - 'files': ['an', 'k', 'toy', 'x'] + 'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy'], + 'files': ['an', 'k', 'toy'] }, 'warosu': { 'domain': 'fuuka.warosu.org', @@ -10041,8 +10046,26 @@ Main = { init: function(items) { - var db, flatten, _i, _len; + var db, flatten, pathname, _i, _len, _ref; + pathname = location.pathname.split('/'); + g.BOARD = new Board(pathname[1]); + if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { + return; + } + g.VIEW = (function() { + switch (pathname[2]) { + case 'res': + return 'thread'; + case 'catalog': + return 'catalog'; + default: + return 'index'; + } + })(); + if (g.VIEW === 'thread') { + g.THREADID = +pathname[3]; + } flatten = function(parent, obj) { var key, val; @@ -10068,9 +10091,9 @@ $.get(Conf, Main.initFeatures); $.on(d, '4chanMainInit', Main.initStyle); return $.asap((function() { - var _ref; + var _ref1; - return d.head && $('link[rel="shortcut icon"]', d.head) || ((_ref = d.readyState) === 'interactive' || _ref === 'complete'); + return d.head && $('link[rel="shortcut icon"]', d.head) || ((_ref1 = d.readyState) === 'interactive' || _ref1 === 'complete'); }), Main.initStyle); }, initFeatures: function(items) { diff --git a/builds/crx/script.js b/builds/crx/script.js index 4a0f5dc35..a7fc2a930 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -419,7 +419,7 @@ }; $.ajax = function(url, callbacks, opts) { - var cred, form, headers, key, r, sync, type, upCallbacks, val; + var cred, err, form, headers, key, r, sync, type, upCallbacks, val; if (opts == null) { opts = {}; @@ -435,7 +435,11 @@ } $.extend(r, callbacks); $.extend(r.upload, upCallbacks); - r.withCredentials = cred; + try { + r.withCredentials = cred; + } catch (_error) { + err = _error; + } r.send(form); return r; }; @@ -449,7 +453,7 @@ if (req = reqs[url]) { if (req.readyState === 4) { - cb.call(req); + cb.call(req, req.evt); } else { req.callbacks.push(cb); } @@ -467,6 +471,7 @@ cb = _ref[_i]; cb.call(this, e); } + this.evt = e; return delete this.callbacks; }, onabort: rm, @@ -1313,7 +1318,7 @@ _ref = this.data.boards; for (boardID in _ref) { val = _ref[boardID]; - if (!val) { + if (typeof this.data.boards[boardID] !== 'object') { delete this.data.boards[boardID]; } else { this.deleteIfEmpty({ @@ -2071,7 +2076,7 @@ return; } clone = post.addClone(context); - Main.callbackNodes(Post, [clone]); + Main.callbackNodes(Clone, [clone]); nodes = clone.nodes; $.rmAll(nodes.root); $.add(nodes.root, nodes.post); @@ -6613,7 +6618,7 @@ open: function(post) { var node; - if (post.isDead) { + if (post.isDead || post.board.ID === 'q') { return false; } DeleteLink.post = post; @@ -6689,7 +6694,7 @@ return; } DeleteLink.cooldown.counting = post; - length = post.board.ID === 'q' ? 600 : 30; + length = 30; seconds = Math.ceil((length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND); return DeleteLink.cooldown.count(post, seconds, length, node); }, @@ -7867,7 +7872,7 @@ 'http': true, 'https': true, 'software': 'foolfuuka', - 'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y'], + 'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 'pol', 's', 's4s', 't', 'trv', 'y'], 'files': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y'] }, 'Install Gentoo': { @@ -7890,8 +7895,8 @@ 'domain': 'archive.heinessen.com', 'http': true, 'software': 'fuuka', - 'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'], - 'files': ['an', 'k', 'toy', 'x'] + 'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy'], + 'files': ['an', 'k', 'toy'] }, 'warosu': { 'domain': 'fuuka.warosu.org', @@ -10022,8 +10027,26 @@ Main = { init: function(items) { - var db, flatten, _i, _len; + var db, flatten, pathname, _i, _len, _ref; + pathname = location.pathname.split('/'); + g.BOARD = new Board(pathname[1]); + if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { + return; + } + g.VIEW = (function() { + switch (pathname[2]) { + case 'res': + return 'thread'; + case 'catalog': + return 'catalog'; + default: + return 'index'; + } + })(); + if (g.VIEW === 'thread') { + g.THREADID = +pathname[3]; + } flatten = function(parent, obj) { var key, val; @@ -10049,9 +10072,9 @@ $.get(Conf, Main.initFeatures); $.on(d, '4chanMainInit', Main.initStyle); return $.asap((function() { - var _ref; + var _ref1; - return d.head && $('link[rel="shortcut icon"]', d.head) || ((_ref = d.readyState) === 'interactive' || _ref === 'complete'); + return d.head && $('link[rel="shortcut icon"]', d.head) || ((_ref1 = d.readyState) === 'interactive' || _ref1 === 'complete'); }), Main.initStyle); }, initFeatures: function(items) { diff --git a/package.json b/package.json index bcab2030c..34edad633 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "grunt-contrib-compress": "~0.5.0", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-watch": "~0.4.2", + "grunt-contrib-watch": "~0.4.3", "grunt-shell": "~0.2.2" }, "repository": { diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index cb2367c94..1936a9f1c 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -83,7 +83,7 @@ Redirect = 'http': true 'https': true 'software': 'foolfuuka' - 'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y'] + 'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 'pol', 's', 's4s', 't', 'trv', 'y'] 'files': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y'] 'Install Gentoo': @@ -106,8 +106,8 @@ Redirect = 'domain': 'archive.heinessen.com' 'http': true 'software': 'fuuka' - 'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'] - 'files': ['an', 'k', 'toy', 'x'] + 'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy'] + 'files': ['an', 'k', 'toy'] 'warosu': 'domain': 'fuuka.warosu.org' diff --git a/src/General/Get.coffee b/src/General/Get.coffee index b7332e5f6..8417d36f3 100644 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -78,7 +78,7 @@ Get = # Stop here if the container has been removed while loading. return unless root.parentNode clone = post.addClone context - Main.callbackNodes Post, [clone] + Main.callbackNodes Clone, [clone] # Get rid of the side arrows. {nodes} = clone diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 82e9c7a37..73cb74ebe 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -1,5 +1,19 @@ Main = init: (items) -> + pathname = location.pathname.split '/' + g.BOARD = new Board pathname[1] + return if g.BOARD.ID in ['z', 'fk'] + g.VIEW = + switch pathname[2] + when 'res' + 'thread' + when 'catalog' + 'catalog' + else + 'index' + if g.VIEW is 'thread' + g.THREADID = +pathname[3] + # flatten Config into Conf # and get saved or default values flatten = (parent, obj) -> diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index b8478ac87..ab438113c 100644 --- a/src/General/lib/$.coffee +++ b/src/General/lib/$.coffee @@ -81,7 +81,14 @@ $.ajax = (url, callbacks, opts={}) -> r.setRequestHeader key, val $.extend r, callbacks $.extend r.upload, upCallbacks - r.withCredentials = cred + try + # Firefox throws an error if you try + # to set this on a synchronous XHR. + # Only cookies from the remote domain + # are used in a request withCredentials. + r.withCredentials = cred + catch err + # do nothing r.send form r @@ -90,7 +97,7 @@ $.cache = do -> (url, cb) -> if req = reqs[url] if req.readyState is 4 - cb.call req + cb.call req, req.evt else req.callbacks.push cb return @@ -98,6 +105,7 @@ $.cache = do -> req = $.ajax url, onload: (e) -> cb.call @, e for cb in @callbacks + @evt = e delete @callbacks onabort: rm onerror: rm diff --git a/src/General/lib/databoard.class b/src/General/lib/databoard.class index efa033681..90742cb88 100644 --- a/src/General/lib/databoard.class +++ b/src/General/lib/databoard.class @@ -62,7 +62,7 @@ class DataBoard for boardID, val of @data.boards # XXX tmp fix for users that had the `null` # value for a board with the Unread features: - unless val + if typeof @data.boards[boardID] isnt 'object' delete @data.boards[boardID] else @deleteIfEmpty {boardID} diff --git a/src/Menu/DeleteLink.coffee b/src/Menu/DeleteLink.coffee index fa1b5c5fb..9427d4076 100644 --- a/src/Menu/DeleteLink.coffee +++ b/src/Menu/DeleteLink.coffee @@ -31,7 +31,7 @@ DeleteLink = el: div order: 40 open: (post) -> - return false if post.isDead + return false if post.isDead or post.board.ID is 'q' DeleteLink.post = post node = div.firstChild node.textContent = 'Delete' @@ -86,10 +86,7 @@ DeleteLink = delete DeleteLink.cooldown.counting return DeleteLink.cooldown.counting = post - length = if post.board.ID is 'q' - 600 - else - 30 + length = 30 seconds = Math.ceil (length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND DeleteLink.cooldown.count post, seconds, length, node count: (post, seconds, length, node) -> diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 9dae14212..2ddec7b1a 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -131,7 +131,7 @@ Unread = Unread.db.set boardID: Unread.thread.board.ID threadID: Unread.thread.ID - val: Unread.lastReadPost + val: Unread.lastReadPost setLine: (force) -> return unless d.hidden or force is true