Merge branch 'v3'

Conflicts:
	CHANGELOG.md
	LICENSE
	builds/4chan-X.js
	builds/4chan-X.meta.js
	builds/4chan-X.user.js
	builds/crx/manifest.json
	builds/crx/script.js
	latest.js
	package.json
	src/General/Config.coffee
	src/General/Main.coffee
	src/General/css/style.css
	src/Posting/QuickReply.coffee
This commit is contained in:
Zixaphir 2013-05-20 17:06:30 -07:00
commit 7ef6aa71fd
18 changed files with 209 additions and 134 deletions

View File

@ -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

View File

@ -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

View File

@ -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() {

View File

@ -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() {

View File

@ -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() {

View File

@ -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": {

View File

@ -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'

View File

@ -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:

View File

@ -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

View File

@ -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'

View File

@ -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 {

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -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) ->

View File

@ -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

View File

@ -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

View File

@ -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) ->