Merge branch 'v3' of git://github.com/MayhemYDG/4chan-x into v3

Conflicts:
	CHANGELOG.md
	Gruntfile.js
	LICENSE
	lib/$.coffee
	package.json
	src/banner.js
	src/config.coffee
	src/css/style.css
	src/features.coffee
	src/metadata.js
This commit is contained in:
Zixaphir 2013-04-26 00:31:19 -07:00
commit 6cc5ac8dd2
13 changed files with 4789 additions and 232 deletions

View File

@ -1,3 +1,7 @@
mayhemydg:
- Minor fixes.
- Chrome only: Due to technical limitations, Filter lists and Custom CSS will not by synchronized across devices anymore.
seaweedchan: seaweedchan:
- Allow thread watcher to load on catalog - Allow thread watcher to load on catalog

35
LICENSE
View File

@ -1,11 +1,9 @@
/* /*
* 4chan X - Version 1.1.0 - 2013-04-25 * 4chan X - Version 1.1.0 - 2013-04-26
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
* *
* Appchan X Copyright © 2013-2013 Zixaphir <zixaphirmoxphar@gmail.com>
* http://zixaphir.github.io/appchan-x/
* 4chan x Copyright © 2009-2011 James Campos <james.r.campos@gmail.com> * 4chan x Copyright © 2009-2011 James Campos <james.r.campos@gmail.com>
* https://github.com/aeosynth/4chan-x * https://github.com/aeosynth/4chan-x
* 4chan x Copyright © 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com> * 4chan x Copyright © 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com>
@ -14,12 +12,6 @@
* http://seaweedchan.github.io/4chan-x/ * http://seaweedchan.github.io/4chan-x/
* 4chan x Copyright © 2012-2013 ihavenoface * 4chan x Copyright © 2012-2013 ihavenoface
* http://ihavenoface.github.io/4chan-x/ * http://ihavenoface.github.io/4chan-x/
* OneeChan Copyright © 2011-2013 Jordan Bates <saudrapsmann@gmail.com>
* http://seaweedchan.github.io/oneechan/
* 4chan SS Copyright © 2011-2013 Ahodesuka
* https://github.com/ahodesuka/4chan-Style-Script/
* Raphael Icons Copyright © 2013 Dmitry Baranovskiy
* http://raphaeljs.com/icons/
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation * obtaining a copy of this software and associated documentation
@ -70,11 +62,24 @@
*/ */
/* /*
* Linkify based on: * Contains data from external sources:
* http://downloads.mozdev.org/greasemonkey/linkify.user.js *
* https://github.com/MayhemYDG/LinkifyPlusFork * audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/
* cc-by-nc-3.0
*
* 4chan/4chan-JS (https://github.com/4chan/4chan-JS)
* Copyright (c) 2012-2013, 4chan LLC
* All rights reserved.
*
* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
*
* Linkify: (http://userscripts.org/scripts/show/1352)
* Copyright (c) 2011, Anthony Lieuallen
* All rights reserved.
* Originally written by Anthony Lieuallen of http://arantius.com/
* Licensed for unlimited modification and redistribution as long as
* this notice is kept intact.
*
* license: http://userscripts.org/scripts/review/1352
* *
* Originally written by Anthony Lieuallen of http://arantius.com/
* Licensed for unlimited modification and redistribution as long as
* this notice is kept intact.
*/ */

View File

@ -3,11 +3,7 @@
// @version 1.1.0 // @version 1.1.0
// @namespace 4chan-X // @namespace 4chan-X
// @description Cross-browser userscript for maximum lurking on 4chan. // @description Cross-browser userscript for maximum lurking on 4chan.
// @copyright 2013-2013 Zixaphir <zixaphirmoxphar@gmail.com> // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
// @copyright 2013-2013 Jordan Bates <saudrapsmann@gmail.com>
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @copyright 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @match *://api.4chan.org/* // @match *://api.4chan.org/*
// @match *://boards.4chan.org/* // @match *://boards.4chan.org/*
// @match *://images.4chan.org/* // @match *://images.4chan.org/*
@ -22,13 +18,11 @@
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.1.0 - 2013-04-25 * 4chan X - Version 1.1.0 - 2013-04-26
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
* *
* Appchan X Copyright © 2013-2013 Zixaphir <zixaphirmoxphar@gmail.com>
* http://zixaphir.github.io/appchan-x/
* 4chan x Copyright © 2009-2011 James Campos <james.r.campos@gmail.com> * 4chan x Copyright © 2009-2011 James Campos <james.r.campos@gmail.com>
* https://github.com/aeosynth/4chan-x * https://github.com/aeosynth/4chan-x
* 4chan x Copyright © 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com> * 4chan x Copyright © 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com>
@ -37,12 +31,6 @@
* http://seaweedchan.github.io/4chan-x/ * http://seaweedchan.github.io/4chan-x/
* 4chan x Copyright © 2012-2013 ihavenoface * 4chan x Copyright © 2012-2013 ihavenoface
* http://ihavenoface.github.io/4chan-x/ * http://ihavenoface.github.io/4chan-x/
* OneeChan Copyright © 2011-2013 Jordan Bates <saudrapsmann@gmail.com>
* http://seaweedchan.github.io/oneechan/
* 4chan SS Copyright © 2011-2013 Ahodesuka
* https://github.com/ahodesuka/4chan-Style-Script/
* Raphael Icons Copyright © 2013 Dmitry Baranovskiy
* http://raphaeljs.com/icons/
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation * obtaining a copy of this software and associated documentation
@ -93,13 +81,26 @@
*/ */
/* /*
* Linkify based on: * Contains data from external sources:
* http://downloads.mozdev.org/greasemonkey/linkify.user.js *
* https://github.com/MayhemYDG/LinkifyPlusFork * audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/
* cc-by-nc-3.0
*
* 4chan/4chan-JS (https://github.com/4chan/4chan-JS)
* Copyright (c) 2012-2013, 4chan LLC
* All rights reserved.
*
* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
*
* Linkify: (http://userscripts.org/scripts/show/1352)
* Copyright (c) 2011, Anthony Lieuallen
* All rights reserved.
* Originally written by Anthony Lieuallen of http://arantius.com/
* Licensed for unlimited modification and redistribution as long as
* this notice is kept intact.
*
* license: http://userscripts.org/scripts/review/1352
* *
* Originally written by Anthony Lieuallen of http://arantius.com/
* Licensed for unlimited modification and redistribution as long as
* this notice is kept intact.
*/ */
(function() { (function() {
var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageReplace, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g, var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageReplace, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g,
@ -639,41 +640,28 @@
})); }));
}; };
$.open = (function() { $.open = function(URL) {
if (typeof GM_openInTab !== "undefined" && GM_openInTab !== null) { return window.open(URL, '_blank');
return function(URL) { };
var a;
a = $.el('a', {
href: URL
});
return GM_openInTab(a.href);
};
} else {
return function(URL) {
return window.open(URL, '_blank');
};
}
})();
$.debounce = function(wait, fn) { $.debounce = function(wait, fn) {
var args, exec, that, timeout; var args, exec, lastCall, that, timeout;
lastCall = 0;
timeout = null; timeout = null;
that = null; that = null;
args = null; args = null;
exec = function() { exec = function() {
fn.apply(that, args); lastCall = Date.now();
return timeout = null; return fn.apply(that, args);
}; };
return function() { return function() {
args = arguments; args = arguments;
that = this; that = this;
if (timeout) { if (lastCall < Date.now() - wait) {
clearTimeout(timeout); return exec();
} else {
exec();
} }
clearTimeout(timeout);
return timeout = setTimeout(exec, wait); return timeout = setTimeout(exec, wait);
}; };
}; };
@ -1459,7 +1447,7 @@
}); });
} }
now = Date.now(); now = Date.now();
if ((this.data.lastChecked || 0) < now - 12 * $.HOUR) { if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) {
this.data.lastChecked = now; this.data.lastChecked = now;
for (boardID in this.data.boards) { for (boardID in this.data.boards) {
this.ajaxClean(boardID); this.ajaxClean(boardID);
@ -8154,7 +8142,7 @@
QR.cooldown.auto = false; QR.cooldown.auto = false;
QR.status(); QR.status();
return QR.error($.el('span', { return QR.error($.el('span', {
innerHTML: 'Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>.' innerHTML: "Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>.\n[<a href=\"https://github.com/MayhemYDG/4chan-x/wiki/FAQ#what-does-connection-error-you-may-have-been-banned-mean\" target=_blank>FAQ</a>]"
})); }));
} }
}; };

View File

@ -3,11 +3,7 @@
// @version 1.1.0 // @version 1.1.0
// @namespace 4chan-X // @namespace 4chan-X
// @description Cross-browser userscript for maximum lurking on 4chan. // @description Cross-browser userscript for maximum lurking on 4chan.
// @copyright 2013-2013 Zixaphir <zixaphirmoxphar@gmail.com> // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
// @copyright 2013-2013 Jordan Bates <saudrapsmann@gmail.com>
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @copyright 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @match *://api.4chan.org/* // @match *://api.4chan.org/*
// @match *://boards.4chan.org/* // @match *://boards.4chan.org/*
// @match *://images.4chan.org/* // @match *://images.4chan.org/*

View File

@ -3,11 +3,7 @@
// @version 1.1.0 // @version 1.1.0
// @namespace 4chan-X // @namespace 4chan-X
// @description Cross-browser userscript for maximum lurking on 4chan. // @description Cross-browser userscript for maximum lurking on 4chan.
// @copyright 2013-2013 Zixaphir <zixaphirmoxphar@gmail.com> // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
// @copyright 2013-2013 Jordan Bates <saudrapsmann@gmail.com>
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @copyright 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @match *://api.4chan.org/* // @match *://api.4chan.org/*
// @match *://boards.4chan.org/* // @match *://boards.4chan.org/*
// @match *://images.4chan.org/* // @match *://images.4chan.org/*
@ -22,13 +18,11 @@
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.1.0 - 2013-04-25 * 4chan X - Version 1.1.0 - 2013-04-26
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
* *
* Appchan X Copyright © 2013-2013 Zixaphir <zixaphirmoxphar@gmail.com>
* http://zixaphir.github.io/appchan-x/
* 4chan x Copyright © 2009-2011 James Campos <james.r.campos@gmail.com> * 4chan x Copyright © 2009-2011 James Campos <james.r.campos@gmail.com>
* https://github.com/aeosynth/4chan-x * https://github.com/aeosynth/4chan-x
* 4chan x Copyright © 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com> * 4chan x Copyright © 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com>
@ -37,12 +31,6 @@
* http://seaweedchan.github.io/4chan-x/ * http://seaweedchan.github.io/4chan-x/
* 4chan x Copyright © 2012-2013 ihavenoface * 4chan x Copyright © 2012-2013 ihavenoface
* http://ihavenoface.github.io/4chan-x/ * http://ihavenoface.github.io/4chan-x/
* OneeChan Copyright © 2011-2013 Jordan Bates <saudrapsmann@gmail.com>
* http://seaweedchan.github.io/oneechan/
* 4chan SS Copyright © 2011-2013 Ahodesuka
* https://github.com/ahodesuka/4chan-Style-Script/
* Raphael Icons Copyright © 2013 Dmitry Baranovskiy
* http://raphaeljs.com/icons/
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation * obtaining a copy of this software and associated documentation
@ -93,13 +81,26 @@
*/ */
/* /*
* Linkify based on: * Contains data from external sources:
* http://downloads.mozdev.org/greasemonkey/linkify.user.js *
* https://github.com/MayhemYDG/LinkifyPlusFork * audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/
* cc-by-nc-3.0
*
* 4chan/4chan-JS (https://github.com/4chan/4chan-JS)
* Copyright (c) 2012-2013, 4chan LLC
* All rights reserved.
*
* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
*
* Linkify: (http://userscripts.org/scripts/show/1352)
* Copyright (c) 2011, Anthony Lieuallen
* All rights reserved.
* Originally written by Anthony Lieuallen of http://arantius.com/
* Licensed for unlimited modification and redistribution as long as
* this notice is kept intact.
*
* license: http://userscripts.org/scripts/review/1352
* *
* Originally written by Anthony Lieuallen of http://arantius.com/
* Licensed for unlimited modification and redistribution as long as
* this notice is kept intact.
*/ */
(function() { (function() {
var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageReplace, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g, var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageReplace, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g,
@ -636,41 +637,30 @@
})); }));
}; };
$.open = (function() { $.open = function(URL) {
if (typeof GM_openInTab !== "undefined" && GM_openInTab !== null) { return GM_openInTab(($.el('a', {
return function(URL) { href: URL
var a; })).href);
};
a = $.el('a', {
href: URL
});
return GM_openInTab(a.href);
};
} else {
return function(URL) {
return window.open(URL, '_blank');
};
}
})();
$.debounce = function(wait, fn) { $.debounce = function(wait, fn) {
var args, exec, that, timeout; var args, exec, lastCall, that, timeout;
lastCall = 0;
timeout = null; timeout = null;
that = null; that = null;
args = null; args = null;
exec = function() { exec = function() {
fn.apply(that, args); lastCall = Date.now();
return timeout = null; return fn.apply(that, args);
}; };
return function() { return function() {
args = arguments; args = arguments;
that = this; that = this;
if (timeout) { if (lastCall < Date.now() - wait) {
clearTimeout(timeout); return exec();
} else {
exec();
} }
clearTimeout(timeout);
return timeout = setTimeout(exec, wait); return timeout = setTimeout(exec, wait);
}; };
}; };
@ -1453,7 +1443,7 @@
}); });
} }
now = Date.now(); now = Date.now();
if ((this.data.lastChecked || 0) < now - 12 * $.HOUR) { if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) {
this.data.lastChecked = now; this.data.lastChecked = now;
for (boardID in this.data.boards) { for (boardID in this.data.boards) {
this.ajaxClean(boardID); this.ajaxClean(boardID);
@ -8174,7 +8164,7 @@
QR.cooldown.auto = false; QR.cooldown.auto = false;
QR.status(); QR.status();
return QR.error($.el('span', { return QR.error($.el('span', {
innerHTML: 'Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>.' innerHTML: "Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>.\n[<a href=\"https://github.com/MayhemYDG/4chan-x/wiki/FAQ#what-does-connection-error-you-may-have-been-banned-mean\" target=_blank>FAQ</a>]"
})); }));
} }
}; };

View File

@ -1,9 +1,9 @@
(function() { (function() {
var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageReplace, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g, var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageReplace, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
__slice = [].slice, __slice = [].slice,
__hasProp = {}.hasOwnProperty, __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
Config = { Config = {
main: { main: {
@ -533,41 +533,28 @@
})); }));
}; };
$.open = (function() { $.open = function(URL) {
if (typeof GM_openInTab !== "undefined" && GM_openInTab !== null) { return window.open(URL, '_blank');
return function(URL) { };
var a;
a = $.el('a', {
href: URL
});
return GM_openInTab(a.href);
};
} else {
return function(URL) {
return window.open(URL, '_blank');
};
}
})();
$.debounce = function(wait, fn) { $.debounce = function(wait, fn) {
var args, exec, that, timeout; var args, exec, lastCall, that, timeout;
lastCall = 0;
timeout = null; timeout = null;
that = null; that = null;
args = null; args = null;
exec = function() { exec = function() {
fn.apply(that, args); lastCall = Date.now();
return timeout = null; return fn.apply(that, args);
}; };
return function() { return function() {
args = arguments; args = arguments;
that = this; that = this;
if (timeout) { if (lastCall < Date.now() - wait) {
clearTimeout(timeout); return exec();
} else {
exec();
} }
clearTimeout(timeout);
return timeout = setTimeout(exec, wait); return timeout = setTimeout(exec, wait);
}; };
}; };
@ -650,12 +637,14 @@
return item; return item;
}; };
$.localKeys = ['name', 'uniqueID', 'tripcode', 'capcode', 'email', 'subject', 'comment', 'flag', 'filename', 'dimensions', 'filesize', 'MD5', 'usercss'];
$["delete"] = function(keys) { $["delete"] = function(keys) {
return chrome.storage.sync.remove(keys); return chrome.storage.sync.remove(keys);
}; };
$.get = function(key, val, cb) { $.get = function(key, val, cb) {
var items; var count, done, items, localItems, syncItems;
if (typeof cb === 'function') { if (typeof cb === 'function') {
items = $.item(key, val); items = $.item(key, val);
@ -663,15 +652,69 @@
items = key; items = key;
cb = val; cb = val;
} }
return chrome.storage.sync.get(items, cb); localItems = null;
syncItems = null;
for (key in items) {
val = items[key];
if (__indexOf.call($.localKeys, key) >= 0) {
(localItems || (localItems = {}))[key] = val;
} else {
(syncItems || (syncItems = {}))[key] = val;
}
}
items = {};
count = 0;
done = function(item) {
$.extend(items, item);
if (!--count) {
return cb(items);
}
};
if (localItems) {
count++;
chrome.storage.local.get(localItems, done);
}
if (syncItems) {
count++;
return chrome.storage.sync.get(syncItems, done);
}
}; };
$.set = function(key, val) { $.set = (function() {
var items; var items, localItems, set;
items = typeof key === 'string' ? $.item(key, val) : key; items = {};
return chrome.storage.sync.set(items); localItems = {};
}; set = $.debounce($.SECOND, function() {
var err, key, _i, _len, _ref;
_ref = $.localKeys;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
if (key in items) {
(localItems || (localItems = {}))[key] = items[key];
delete items[key];
}
}
try {
chrome.storage.local.set(localItems);
chrome.storage.sync.set(items);
items = {};
return localItems = {};
} catch (_error) {
err = _error;
return c.error(err);
}
});
return function(key, val) {
if (typeof key === 'string') {
items[key] = val;
} else {
$.extend(items, key);
}
return set();
};
})();
$$ = function(selector, root) { $$ = function(selector, root) {
if (root == null) { if (root == null) {
@ -1317,7 +1360,7 @@
}); });
} }
now = Date.now(); now = Date.now();
if ((this.data.lastChecked || 0) < now - 12 * $.HOUR) { if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) {
this.data.lastChecked = now; this.data.lastChecked = now;
for (boardID in this.data.boards) { for (boardID in this.data.boards) {
this.ajaxClean(boardID); this.ajaxClean(boardID);
@ -8019,7 +8062,7 @@
QR.cooldown.auto = false; QR.cooldown.auto = false;
QR.status(); QR.status();
return QR.error($.el('span', { return QR.error($.el('span', {
innerHTML: 'Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>.' innerHTML: "Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>.\n[<a href=\"https://github.com/MayhemYDG/4chan-x/wiki/FAQ#what-does-connection-error-you-may-have-been-banned-mean\" target=_blank>FAQ</a>]"
})); }));
} }
}; };

BIN
img/changelog/3.2.0/0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

4475
src/features.coffee Normal file

File diff suppressed because it is too large Load Diff

View File

@ -979,7 +979,10 @@ QR =
QR.cooldown.auto = false QR.cooldown.auto = false
QR.status() QR.status()
QR.error $.el 'span', QR.error $.el 'span',
innerHTML: 'Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>.' innerHTML: """
Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>.
[<a href="https://github.com/MayhemYDG/4chan-x/wiki/FAQ#what-does-connection-error-you-may-have-been-banned-mean" target=_blank>FAQ</a>]
"""
opts = opts =
cred: true cred: true
form: $.formData postData form: $.formData postData

View File

@ -207,31 +207,30 @@ $.off = (el, events, handler) ->
$.event = (event, detail, root=d) -> $.event = (event, detail, root=d) ->
root.dispatchEvent new CustomEvent event, {bubbles: true, detail} root.dispatchEvent new CustomEvent event, {bubbles: true, detail}
$.open = do -> $.open = (URL) ->
if GM_openInTab? <% if (type === 'userscript') { %>
(URL) -> # XXX fix GM opening file://// for protocol-less URLs.
# XXX fix GM opening file://// for protocol-less URLs. # https://github.com/greasemonkey/greasemonkey/issues/1719
a = $.el 'a', href: URL GM_openInTab ($.el 'a', href: URL).href
GM_openInTab a.href <% } else { %>
else window.open URL, '_blank'
(URL) -> window.open URL, '_blank' <% } %>
$.debounce = (wait, fn) -> $.debounce = (wait, fn) ->
timeout = null lastCall = 0
that = null timeout = null
args = null that = null
exec = -> args = null
exec = ->
lastCall = Date.now()
fn.apply that, args fn.apply that, args
timeout = null
-> ->
args = arguments args = arguments
that = this that = this
if timeout if lastCall < Date.now() - wait
# stop current reset return exec()
clearTimeout timeout # stop current reset
else clearTimeout timeout
exec()
# after wait, let next invocation execute immediately # after wait, let next invocation execute immediately
timeout = setTimeout exec, wait timeout = setTimeout exec, wait
@ -310,7 +309,25 @@ $.item = (key, val) ->
item[key] = val item[key] = val
item item
<% if (type === 'crx') { %> <% if (type === 'crx') { %>
# https://developer.chrome.com/extensions/storage.html $.localKeys = [
# filters
'name',
'uniqueID',
'tripcode',
'capcode',
'email',
'subject',
'comment',
'flag',
'filename',
'dimensions',
'filesize',
'MD5',
# custom css
'usercss'
]
# https://developer.chrome.com/extensions/storage.html
$.delete = (keys) -> $.delete = (keys) ->
chrome.storage.sync.remove keys chrome.storage.sync.remove keys
@ -321,14 +338,49 @@ $.get = (key, val, cb) ->
else else
items = key items = key
cb = val cb = val
chrome.storage.sync.get items, cb localItems = null
syncItems = null
for key, val of items
if key in $.localKeys
(localItems or= {})[key] = val
else
(syncItems or= {})[key] = val
$.set = (key, val) -> items = {}
items = if typeof key is 'string' count = 0
$.item key, val done = (item) ->
else $.extend items, item
key cb items unless --count
chrome.storage.sync.set items
if localItems
count++
chrome.storage.local.get localItems, done
if syncItems
count++
chrome.storage.sync.get syncItems, done
$.set = do ->
items = {}
localItems = {}
set = $.debounce $.SECOND, ->
for key in $.localKeys
if key of items
(localItems or= {})[key] = items[key]
delete items[key]
try
chrome.storage.local.set localItems
chrome.storage.sync.set items
items = {}
localItems = {}
catch err
c.error err
(key, val) ->
if typeof key is 'string'
items[key] = val
else
$.extend items, key
set()
<% } else if (type === 'userjs') { %> <% } else if (type === 'userjs') { %>
do -> do ->

View File

@ -63,7 +63,7 @@ class DataBoard
@deleteIfEmpty {boardID} @deleteIfEmpty {boardID}
now = Date.now() now = Date.now()
if (@data.lastChecked or 0) < now - 12 * $.HOUR if (@data.lastChecked or 0) < now - 2 * $.HOUR
@data.lastChecked = now @data.lastChecked = now
for boardID of @data.boards for boardID of @data.boards
@ajaxClean boardID @ajaxClean boardID

View File

@ -4,8 +4,6 @@
* Licensed under the MIT license. * Licensed under the MIT license.
* <%= meta.repo %>blob/master/LICENSE * <%= meta.repo %>blob/master/LICENSE
* *
* Appchan X Copyright © 2013-<%= grunt.template.today('yyyy') %> Zixaphir <zixaphirmoxphar@gmail.com>
* http://zixaphir.github.io/appchan-x/
* 4chan x Copyright © 2009-2011 James Campos <james.r.campos@gmail.com> * 4chan x Copyright © 2009-2011 James Campos <james.r.campos@gmail.com>
* https://github.com/aeosynth/4chan-x * https://github.com/aeosynth/4chan-x
* 4chan x Copyright © 2012-<%= grunt.template.today('yyyy') %> Nicolas Stepien <stepien.nicolas@gmail.com> * 4chan x Copyright © 2012-<%= grunt.template.today('yyyy') %> Nicolas Stepien <stepien.nicolas@gmail.com>
@ -14,12 +12,6 @@
* http://seaweedchan.github.io/4chan-x/ * http://seaweedchan.github.io/4chan-x/
* 4chan x Copyright © 2012-<%= grunt.template.today('yyyy') %> ihavenoface * 4chan x Copyright © 2012-<%= grunt.template.today('yyyy') %> ihavenoface
* http://ihavenoface.github.io/4chan-x/ * http://ihavenoface.github.io/4chan-x/
* OneeChan Copyright © 2011-<%= grunt.template.today('yyyy') %> Jordan Bates <saudrapsmann@gmail.com>
* http://seaweedchan.github.io/oneechan/
* 4chan SS Copyright © 2011-<%= grunt.template.today('yyyy') %> Ahodesuka
* https://github.com/ahodesuka/4chan-Style-Script/
* Raphael Icons Copyright © <%= grunt.template.today('yyyy') %> Dmitry Baranovskiy
* http://raphaeljs.com/icons/
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation * obtaining a copy of this software and associated documentation
@ -70,11 +62,24 @@
*/ */
/* /*
* Linkify based on: * Contains data from external sources:
* http://downloads.mozdev.org/greasemonkey/linkify.user.js *
* https://github.com/MayhemYDG/LinkifyPlusFork * audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/
* cc-by-nc-3.0
*
* 4chan/4chan-JS (https://github.com/4chan/4chan-JS)
* Copyright (c) 2012-2013, 4chan LLC
* All rights reserved.
*
* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
*
* Linkify: (http://userscripts.org/scripts/show/1352)
* Copyright (c) 2011, Anthony Lieuallen
* All rights reserved.
* Originally written by Anthony Lieuallen of http://arantius.com/
* Licensed for unlimited modification and redistribution as long as
* this notice is kept intact.
*
* license: http://userscripts.org/scripts/review/1352
* *
* Originally written by Anthony Lieuallen of http://arantius.com/
* Licensed for unlimited modification and redistribution as long as
* this notice is kept intact.
*/ */

View File

@ -3,11 +3,7 @@
// @version <%= version %> // @version <%= version %>
// @namespace <%= name %> // @namespace <%= name %>
// @description <%= description %> // @description <%= description %>
// @copyright 2013-<%= grunt.template.today('yyyy') %> Zixaphir <zixaphirmoxphar@gmail.com> // @license MIT; <%= meta.repo %>blob/<%= meta.mainBranch %>/LICENSE
// @copyright 2013-<%= grunt.template.today('yyyy') %> Jordan Bates <saudrapsmann@gmail.com>
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @copyright 2012-<%= grunt.template.today('yyyy') %> Nicolas Stepien <stepien.nicolas@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
<%= <%=
meta.matches.map(function(match) { meta.matches.map(function(match) {
return '// @match ' + match; return '// @match ' + match;