diff --git a/CHANGELOG.md b/CHANGELOG.md index c7f9d280c..772fa3131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,23 @@ +**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` +- Update /q/'s posting cooldown +- Make "___ omitted. Click here to view." text change when thread is expanded. +- Restrict "Reply to Thread" click event to the link itself +- Fix Nyafuu being undefined +- New option `Captcha Warning Notifications` + - When disabled, shows a red border around the captcha to indicate captcha errors. Goes back to normal when any key is pressed. +- Color Quick Reply's inputs in Tomorrow to match the theme +- Revert some of Mayhem's changes that caused new bugs + +**Wohlfe**: +- Add /pol/ archiving for FoolzaShit + ### v2.0.4 *2013-05-15* - **MayhemYDG**: - Add new archive selection diff --git a/LICENSE b/LICENSE index 8bdeba5c0..20f8edcb1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* appchan x - Version 2.0.4 - 2013-05-15 +* appchan x - Version 2.0.4 - 2013-05-20 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE diff --git a/builds/appchan-x.js b/builds/appchan-x.js index 5457f406a..0474fbbc6 100644 --- a/builds/appchan-x.js +++ b/builds/appchan-x.js @@ -20,7 +20,7 @@ // ==/UserScript== /* -* appchan x - Version 2.0.4 - 2013-05-15 +* appchan x - Version 2.0.4 - 2013-05-20 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -227,7 +227,8 @@ 'Fit width': [true, ''], 'Fit height': [false, ''], 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand from here': [true, 'Expand all images only from current position to thread end.'] + 'Expand from here': [true, 'Expand all images only from current position to thread end.'], + 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] }, style: { Interface: { @@ -2756,7 +2757,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 = {}; @@ -2772,7 +2773,11 @@ } $.extend(r, callbacks); $.extend(r.upload, upCallbacks); - r.withCredentials = cred; + try { + r.withCredentials = cred; + } catch (_error) { + err = _error; + } r.send(form); return r; }; @@ -2782,11 +2787,11 @@ reqs = {}; return function(url, cb) { - var req, rm; + var err, req, rm; if (req = reqs[url]) { if (req.readyState === 4) { - cb.call(req); + cb.call(req, req.evt); } else { req.callbacks.push(cb); } @@ -2795,20 +2800,26 @@ rm = function() { return delete reqs[url]; }; - req = $.ajax(url, { - onload: function(e) { - var _i, _len, _ref; + try { + req = $.ajax(url, { + onload: function(e) { + var _i, _len, _ref; - _ref = this.callbacks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - cb = _ref[_i]; - cb.call(this, e); - } - return delete this.callbacks; - }, - onabort: rm, - onerror: rm - }); + _ref = this.callbacks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + cb = _ref[_i]; + cb.call(this, e); + } + this.evt = e; + return delete this.callbacks; + }, + onabort: rm, + onerror: rm + }); + } catch (_error) { + err = _error; + return; + } req.callbacks = [cb]; return reqs[url] = req; }; @@ -3628,7 +3639,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({ @@ -4325,7 +4336,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); @@ -7196,7 +7207,7 @@ })(), sage: board === 'q' ? 600 : 60, file: board === 'q' ? 300 : 30, - post: board === 'q' ? 60 : 30 + post: board === 'q' ? 150 : 30 }; QR.cooldown.upSpd = 0; QR.cooldown.upSpdAccuracy = .5; @@ -8471,7 +8482,7 @@ return; } ImageExpand.contract(post); - rect = post.nodes.root.getBoundingClientRect(); + rect = Conf['Advance on contract'] && !($.hasClass(doc, 'fappeTyme')) ? post.nodes.root.nextSibling.getBoundingClientRect() : post.nodes.root.getBoundingClientRect(); if (!(rect.top <= 0 || rect.left <= 0)) { return; } @@ -8915,7 +8926,7 @@ open: function(post) { var node; - if (post.isDead) { + if (post.isDead || post.board.ID === 'q') { return false; } DeleteLink.post = post; @@ -8991,7 +9002,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); }, @@ -10133,6 +10144,7 @@ 'files': ['hr', 'tg', 'tv', 'x'] }, 'Nyafuu': { + 'domain': 'archive.nyafuu.org', 'http': true, 'https': true, 'software': 'foolfuuka', @@ -10159,7 +10171,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': { @@ -10182,8 +10194,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', @@ -12332,7 +12344,7 @@ return; } thread.isExpanded = 'loading'; - a.textContent = a.textContent.replace('+', '× Loading...'); + a.textContent = a.textContent.replace('+', '...'); $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { return ExpandThread.parse(this, thread, a); }); @@ -12342,12 +12354,12 @@ if (!a) { return; } - a.textContent = a.textContent.replace('× Loading...', '+'); + a.textContent = a.textContent.replace('...', '+'); break; case true: thread.isExpanded = false; if (a) { - a.textContent = a.textContent.replace('-', '+'); + a.textContent = a.textContent.replace('-', '+').replace('hide', 'view').replace('expanded', 'omitted'); num = (function() { if (thread.isSticky) { return 1; @@ -12395,7 +12407,7 @@ return; } thread.isExpanded = true; - a.textContent = a.textContent.replace('× Loading...', '-'); + a.textContent = a.textContent.replace('...', '-').replace('view', 'hide').replace('omitted', 'expanded'); posts = JSON.parse(req.response).posts; if (spoilerRange = posts[0].custom_spoiler) { Build.spoilerRange[g.BOARD] = spoilerRange; @@ -14519,12 +14531,12 @@ return $.get(Conf, Main.initFeatures); }, initFeatures: function(items) { - var init, pathname; + var init, pathname, _ref; Conf = items; pathname = location.pathname.split('/'); g.BOARD = new Board(pathname[1]); - if (g.BOARD.ID === 'z') { + if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { return; } g.VIEW = (function() { diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 701576128..b120595a2 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -20,7 +20,7 @@ // ==/UserScript== /* -* appchan x - Version 2.0.4 - 2013-05-15 +* appchan x - Version 2.0.4 - 2013-05-20 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -228,7 +228,8 @@ 'Fit width': [true, ''], 'Fit height': [false, ''], 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand from here': [true, 'Expand all images only from current position to thread end.'] + 'Expand from here': [true, 'Expand all images only from current position to thread end.'], + 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] }, style: { Interface: { @@ -2753,7 +2754,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 = {}; @@ -2769,7 +2770,11 @@ } $.extend(r, callbacks); $.extend(r.upload, upCallbacks); - r.withCredentials = cred; + try { + r.withCredentials = cred; + } catch (_error) { + err = _error; + } r.send(form); return r; }; @@ -2779,11 +2784,11 @@ reqs = {}; return function(url, cb) { - var req, rm; + var err, req, rm; if (req = reqs[url]) { if (req.readyState === 4) { - cb.call(req); + cb.call(req, req.evt); } else { req.callbacks.push(cb); } @@ -2792,20 +2797,26 @@ rm = function() { return delete reqs[url]; }; - req = $.ajax(url, { - onload: function(e) { - var _i, _len, _ref; + try { + req = $.ajax(url, { + onload: function(e) { + var _i, _len, _ref; - _ref = this.callbacks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - cb = _ref[_i]; - cb.call(this, e); - } - return delete this.callbacks; - }, - onabort: rm, - onerror: rm - }); + _ref = this.callbacks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + cb = _ref[_i]; + cb.call(this, e); + } + this.evt = e; + return delete this.callbacks; + }, + onabort: rm, + onerror: rm + }); + } catch (_error) { + err = _error; + return; + } req.callbacks = [cb]; return reqs[url] = req; }; @@ -3624,7 +3635,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({ @@ -4321,7 +4332,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); @@ -7180,7 +7191,7 @@ })(), sage: board === 'q' ? 600 : 60, file: board === 'q' ? 300 : 30, - post: board === 'q' ? 60 : 30 + post: board === 'q' ? 150 : 30 }; QR.cooldown.upSpd = 0; QR.cooldown.upSpdAccuracy = .5; @@ -8480,7 +8491,7 @@ return; } ImageExpand.contract(post); - rect = post.nodes.root.getBoundingClientRect(); + rect = Conf['Advance on contract'] && !($.hasClass(doc, 'fappeTyme')) ? post.nodes.root.nextSibling.getBoundingClientRect() : post.nodes.root.getBoundingClientRect(); if (!(rect.top <= 0 || rect.left <= 0)) { return; } @@ -8924,7 +8935,7 @@ open: function(post) { var node; - if (post.isDead) { + if (post.isDead || post.board.ID === 'q') { return false; } DeleteLink.post = post; @@ -9000,7 +9011,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); }, @@ -10142,6 +10153,7 @@ 'files': ['hr', 'tg', 'tv', 'x'] }, 'Nyafuu': { + 'domain': 'archive.nyafuu.org', 'http': true, 'https': true, 'software': 'foolfuuka', @@ -10168,7 +10180,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': { @@ -10191,8 +10203,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', @@ -12341,7 +12353,7 @@ return; } thread.isExpanded = 'loading'; - a.textContent = a.textContent.replace('+', '× Loading...'); + a.textContent = a.textContent.replace('+', '...'); $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { return ExpandThread.parse(this, thread, a); }); @@ -12351,12 +12363,12 @@ if (!a) { return; } - a.textContent = a.textContent.replace('× Loading...', '+'); + a.textContent = a.textContent.replace('...', '+'); break; case true: thread.isExpanded = false; if (a) { - a.textContent = a.textContent.replace('-', '+'); + a.textContent = a.textContent.replace('-', '+').replace('hide', 'view').replace('expanded', 'omitted'); num = (function() { if (thread.isSticky) { return 1; @@ -12404,7 +12416,7 @@ return; } thread.isExpanded = true; - a.textContent = a.textContent.replace('× Loading...', '-'); + a.textContent = a.textContent.replace('...', '-').replace('view', 'hide').replace('omitted', 'expanded'); posts = JSON.parse(req.response).posts; if (spoilerRange = posts[0].custom_spoiler) { Build.spoilerRange[g.BOARD] = spoilerRange; @@ -14526,12 +14538,12 @@ return $.get(Conf, Main.initFeatures); }, initFeatures: function(items) { - var init, pathname; + var init, pathname, _ref; Conf = items; pathname = location.pathname.split('/'); g.BOARD = new Board(pathname[1]); - if (g.BOARD.ID === 'z') { + if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { return; } g.VIEW = (function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index 6443e917b..89dd801a8 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* appchan x - Version 2.0.4 - 2013-05-15 +* appchan x - Version 2.0.4 - 2013-05-20 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -208,7 +208,8 @@ 'Fit width': [true, ''], 'Fit height': [false, ''], 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand from here': [true, 'Expand all images only from current position to thread end.'] + 'Expand from here': [true, 'Expand all images only from current position to thread end.'], + 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] }, style: { Interface: { @@ -2733,7 +2734,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 = {}; @@ -2749,7 +2750,11 @@ } $.extend(r, callbacks); $.extend(r.upload, upCallbacks); - r.withCredentials = cred; + try { + r.withCredentials = cred; + } catch (_error) { + err = _error; + } r.send(form); return r; }; @@ -2759,11 +2764,11 @@ reqs = {}; return function(url, cb) { - var req, rm; + var err, req, rm; if (req = reqs[url]) { if (req.readyState === 4) { - cb.call(req); + cb.call(req, req.evt); } else { req.callbacks.push(cb); } @@ -2772,20 +2777,26 @@ rm = function() { return delete reqs[url]; }; - req = $.ajax(url, { - onload: function(e) { - var _i, _len, _ref; + try { + req = $.ajax(url, { + onload: function(e) { + var _i, _len, _ref; - _ref = this.callbacks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - cb = _ref[_i]; - cb.call(this, e); - } - return delete this.callbacks; - }, - onabort: rm, - onerror: rm - }); + _ref = this.callbacks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + cb = _ref[_i]; + cb.call(this, e); + } + this.evt = e; + return delete this.callbacks; + }, + onabort: rm, + onerror: rm + }); + } catch (_error) { + err = _error; + return; + } req.callbacks = [cb]; return reqs[url] = req; }; @@ -3625,7 +3636,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({ @@ -4322,7 +4333,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); @@ -7182,7 +7193,7 @@ })(), sage: board === 'q' ? 600 : 60, file: board === 'q' ? 300 : 30, - post: board === 'q' ? 60 : 30 + post: board === 'q' ? 150 : 30 }; QR.cooldown.upSpd = 0; QR.cooldown.upSpdAccuracy = .5; @@ -8457,7 +8468,7 @@ return; } ImageExpand.contract(post); - rect = post.nodes.root.getBoundingClientRect(); + rect = Conf['Advance on contract'] && !($.hasClass(doc, 'fappeTyme')) ? post.nodes.root.nextSibling.getBoundingClientRect() : post.nodes.root.getBoundingClientRect(); if (!(rect.top <= 0 || rect.left <= 0)) { return; } @@ -8901,7 +8912,7 @@ open: function(post) { var node; - if (post.isDead) { + if (post.isDead || post.board.ID === 'q') { return false; } DeleteLink.post = post; @@ -8977,7 +8988,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); }, @@ -10124,6 +10135,7 @@ 'files': ['hr', 'tg', 'tv', 'x'] }, 'Nyafuu': { + 'domain': 'archive.nyafuu.org', 'http': true, 'https': true, 'software': 'foolfuuka', @@ -10150,7 +10162,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': { @@ -10173,8 +10185,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', @@ -12323,7 +12335,7 @@ return; } thread.isExpanded = 'loading'; - a.textContent = a.textContent.replace('+', '× Loading...'); + a.textContent = a.textContent.replace('+', '...'); $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { return ExpandThread.parse(this, thread, a); }); @@ -12333,12 +12345,12 @@ if (!a) { return; } - a.textContent = a.textContent.replace('× Loading...', '+'); + a.textContent = a.textContent.replace('...', '+'); break; case true: thread.isExpanded = false; if (a) { - a.textContent = a.textContent.replace('-', '+'); + a.textContent = a.textContent.replace('-', '+').replace('hide', 'view').replace('expanded', 'omitted'); num = (function() { if (thread.isSticky) { return 1; @@ -12386,7 +12398,7 @@ return; } thread.isExpanded = true; - a.textContent = a.textContent.replace('× Loading...', '-'); + a.textContent = a.textContent.replace('...', '-').replace('view', 'hide').replace('omitted', 'expanded'); posts = JSON.parse(req.response).posts; if (spoilerRange = posts[0].custom_spoiler) { Build.spoilerRange[g.BOARD] = spoilerRange; @@ -14510,12 +14522,12 @@ return $.get(Conf, Main.initFeatures); }, initFeatures: function(items) { - var init, pathname; + var init, pathname, _ref; Conf = items; pathname = location.pathname.split('/'); g.BOARD = new Board(pathname[1]); - if (g.BOARD.ID === 'z') { + if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { return; } g.VIEW = (function() { diff --git a/package.json b/package.json index ed5b2b711..ddd4b5212 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,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 5d26adb35..1936a9f1c 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -56,6 +56,7 @@ Redirect = 'files': ['hr', 'tg', 'tv', 'x'] 'Nyafuu': + 'domain': 'archive.nyafuu.org' 'http': true 'https': true 'software': 'foolfuuka' @@ -82,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': @@ -105,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/Config.coffee b/src/General/Config.coffee index 1474604d2..1bb1cd516 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -373,6 +373,10 @@ Config = true 'Expand all images only from current position to thread end.' ] + 'Advance on contract': [ + false + 'Advance to next post when contracting an expanded image.' + ] style: 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 c49c04c85..d7d0435e7 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -32,7 +32,7 @@ Main = pathname = location.pathname.split '/' g.BOARD = new Board pathname[1] - return if g.BOARD.ID is 'z' + return if g.BOARD.ID in ['z', 'fk'] g.VIEW = switch pathname[2] when 'res' diff --git a/src/General/css/tomorrow.css b/src/General/css/tomorrow.css index 37b74e775..6f8d64b49 100644 --- a/src/General/css/tomorrow.css +++ b/src/General/css/tomorrow.css @@ -3,9 +3,6 @@ background-color: #282A2E; border-color: #111; } -:root.tomorrow .field:focus { - border-color: #000; -} /* Header */ :root.tomorrow #header-bar, :root.tomorrow #notifications { @@ -38,6 +35,15 @@ :root.tomorrow .qr-preview { background-color: rgba(255, 255, 255, .15); } +:root.tomorrow #qr .field { + background-color: rgb(26, 27, 29); + color: rgb(197,200,198); + border-color: rgb(40, 41, 42); +} +:root.tomorrow #qr .field:focus { + border-color: rgb(129, 162, 190) !important; + background-color: rgb(30,32,36); +} /* Menu */ :root.tomorrow #menu { diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index b8478ac87..ce7f84737 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,17 +97,21 @@ $.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 rm = -> delete reqs[url] - req = $.ajax url, - onload: (e) -> - cb.call @, e for cb in @callbacks - delete @callbacks - onabort: rm - onerror: rm + try + req = $.ajax url, + onload: (e) -> + cb.call @, e for cb in @callbacks + @evt = e + delete @callbacks + onabort: rm + onerror: rm + catch err + return req.callbacks = [cb] reqs[url] = req 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/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index 6c7436ede..63984dae8 100644 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -72,7 +72,10 @@ ImageExpand = ImageExpand.expand post return ImageExpand.contract post - rect = post.nodes.root.getBoundingClientRect() + rect = if Conf['Advance on contract'] and !($.hasClass doc, 'fappeTyme') + post.nodes.root.nextSibling.getBoundingClientRect() + else + post.nodes.root.getBoundingClientRect() return unless rect.top <= 0 or rect.left <= 0 {top} = rect 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/Miscellaneous/ExpandThread.coffee b/src/Miscellaneous/ExpandThread.coffee index b384ffecf..764d201ab 100644 --- a/src/Miscellaneous/ExpandThread.coffee +++ b/src/Miscellaneous/ExpandThread.coffee @@ -31,19 +31,19 @@ ExpandThread = thread.isExpanded = true return thread.isExpanded = 'loading' - a.textContent = a.textContent.replace '+', '× Loading...' + a.textContent = a.textContent.replace '+', '...' $.cache "//api.4chan.org/#{thread.board}/res/#{thread}.json", -> ExpandThread.parse @, thread, a when 'loading' thread.isExpanded = false return unless a - a.textContent = a.textContent.replace '× Loading...', '+' + a.textContent = a.textContent.replace '...', '+' when true thread.isExpanded = false if a - a.textContent = a.textContent.replace '-', '+' + a.textContent = a.textContent.replace('-', '+').replace('hide', 'view').replace('expanded', 'omitted') #goddamit moot num = if thread.isSticky 1 @@ -71,7 +71,7 @@ ExpandThread = return thread.isExpanded = true - a.textContent = a.textContent.replace '× Loading...', '-' + a.textContent = a.textContent.replace('...', '-').replace('view', 'hide').replace('omitted', 'expanded') posts = JSON.parse(req.response).posts if spoilerRange = posts[0].custom_spoiler 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 diff --git a/src/Posting/QuickReply.coffee b/src/Posting/QuickReply.coffee index 17a4468f8..79909909e 100644 --- a/src/Posting/QuickReply.coffee +++ b/src/Posting/QuickReply.coffee @@ -249,7 +249,7 @@ QR = else 300 sage: if board is 'q' then 600 else 60 file: if board is 'q' then 300 else 30 - post: if board is 'q' then 60 else 30 + post: if board is 'q' then 150 else 30 QR.cooldown.upSpd = 0 QR.cooldown.upSpdAccuracy = .5 $.get "cooldown.#{board}", {}, (item) ->