Release 4chan X v1.7.36.
This commit is contained in:
parent
7f900ce3d4
commit
8a18db8361
@ -1,3 +1,6 @@
|
|||||||
|
### v1.7.36
|
||||||
|
*2014-05-13*
|
||||||
|
|
||||||
**ccd0**
|
**ccd0**
|
||||||
- Fix an issue that allowed Javascript running on the page access to the Greasemonkey / Chrome extension APIs.
|
- Fix an issue that allowed Javascript running on the page access to the Greasemonkey / Chrome extension APIs.
|
||||||
- Minor fixes.
|
- Minor fixes.
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.7.35 - 2014-05-12
|
* 4chan X - Version 1.7.36 - 2014-05-13
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
|
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.7.35
|
// @version 1.7.36
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.7.35
|
// @version 1.7.36
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -24,7 +24,7 @@
|
|||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.7.35 - 2014-05-12
|
* 4chan X - Version 1.7.36 - 2014-05-13
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
|
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
|
||||||
@ -372,7 +372,7 @@
|
|||||||
doc = d.documentElement;
|
doc = d.documentElement;
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.7.35',
|
VERSION: '1.7.36',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
boards: {}
|
boards: {}
|
||||||
};
|
};
|
||||||
@ -3056,7 +3056,7 @@
|
|||||||
threshold = isReply ? 30 : 40;
|
threshold = isReply ? 30 : 40;
|
||||||
ext = filename.match(/\.?[^\.]*$/)[0];
|
ext = filename.match(/\.?[^\.]*$/)[0];
|
||||||
if (filename.length - ext.length > threshold) {
|
if (filename.length - ext.length > threshold) {
|
||||||
return "" + filename.slice(0, threshold - 5) + "(...)." + ext;
|
return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
|
||||||
} else {
|
} else {
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
@ -3397,6 +3397,7 @@
|
|||||||
$.cache(url, function() {
|
$.cache(url, function() {
|
||||||
return Get.archivedPost(this, boardID, postID, root, context);
|
return Get.archivedPost(this, boardID, postID, root, context);
|
||||||
}, {
|
}, {
|
||||||
|
responseType: 'json',
|
||||||
withCredentials: url.archive.withCredentials
|
withCredentials: url.archive.withCredentials
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -4896,12 +4897,9 @@
|
|||||||
QuoteBacklink = {
|
QuoteBacklink = {
|
||||||
containers: {},
|
containers: {},
|
||||||
init: function() {
|
init: function() {
|
||||||
var format;
|
|
||||||
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
|
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
format = Conf['backlink'].replace(/%id/g, "' + id + '");
|
|
||||||
this.funk = Function('id', "return '" + format + "'");
|
|
||||||
Post.callbacks.push({
|
Post.callbacks.push({
|
||||||
name: 'Quote Backlinking Part 1',
|
name: 'Quote Backlinking Part 1',
|
||||||
cb: this.firstNode
|
cb: this.firstNode
|
||||||
@ -4924,7 +4922,7 @@
|
|||||||
a = $.el('a', {
|
a = $.el('a', {
|
||||||
href: "/" + this.board + "/thread/" + this.thread + "#p" + this,
|
href: "/" + this.board + "/thread/" + this.thread + "#p" + this,
|
||||||
className: this.isHidden ? 'filtered backlink' : 'backlink',
|
className: this.isHidden ? 'filtered backlink' : 'backlink',
|
||||||
textContent: (QuoteBacklink.funk(this.ID)) + (markYours ? '\u00A0(You)' : '')
|
textContent: (Conf['backlink'].replace(/%id/, this.ID)) + (markYours ? '\u00A0(You)' : '')
|
||||||
});
|
});
|
||||||
_ref = this.quotes;
|
_ref = this.quotes;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
@ -8381,7 +8379,7 @@
|
|||||||
link = _ref[_i];
|
link = _ref[_i];
|
||||||
try {
|
try {
|
||||||
if (link[0] !== '#') {
|
if (link[0] !== '#') {
|
||||||
links.push(this.createSauceLink(link.trim()));
|
links.push(link.trim());
|
||||||
}
|
}
|
||||||
} catch (_error) {
|
} catch (_error) {
|
||||||
err = _error;
|
err = _error;
|
||||||
@ -8399,21 +8397,34 @@
|
|||||||
cb: this.node
|
cb: this.node
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
createSauceLink: function(link) {
|
createSauceLink: function(link, post, a) {
|
||||||
var m, text;
|
var i, m, parts, text, _i, _ref;
|
||||||
link = link.replace(/%(T?URL|MD5|board|name)/g, function(parameter) {
|
text = (m = link.match(/;text:(.+)$/)) ? m[1] : ((_ref = link.match(/(\w+)\.\w+\//)) != null ? _ref[1] : void 0) || '?';
|
||||||
var type;
|
|
||||||
return ((type = {
|
|
||||||
'%TURL': 'post.file.thumbURL',
|
|
||||||
'%URL': 'post.file.URL',
|
|
||||||
'%MD5': 'post.file.MD5',
|
|
||||||
'%board': 'post.board',
|
|
||||||
'%name': 'post.file.name'
|
|
||||||
}[parameter]) ? "' + encodeURIComponent(" + type + ") + '" : parameter);
|
|
||||||
});
|
|
||||||
text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
|
|
||||||
link = link.replace(/;text:.+$/, '');
|
link = link.replace(/;text:.+$/, '');
|
||||||
return Function('post', 'a', "a.href = '" + link + "';\na.textContent = '" + text + "';\nreturn a;");
|
parts = [link, text];
|
||||||
|
for (i = _i = 0; _i <= 1; i = ++_i) {
|
||||||
|
parts[i] = parts[i].replace(/%(T?URL|MD5|board|name)/g, function(parameter) {
|
||||||
|
var type;
|
||||||
|
if (type = {
|
||||||
|
'%TURL': post.file.thumbURL,
|
||||||
|
'%URL': post.file.URL,
|
||||||
|
'%MD5': post.file.MD5,
|
||||||
|
'%board': post.board,
|
||||||
|
'%name': post.file.name
|
||||||
|
}[parameter]) {
|
||||||
|
if (i === 0) {
|
||||||
|
return encodeURIComponent(type);
|
||||||
|
} else {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return parameter;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
a.href = parts[0];
|
||||||
|
a.textContent = parts[1];
|
||||||
|
return a;
|
||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
var link, nodes, _i, _len, _ref;
|
var link, nodes, _i, _len, _ref;
|
||||||
@ -8424,7 +8435,7 @@
|
|||||||
_ref = Sauce.links;
|
_ref = Sauce.links;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
link = _ref[_i];
|
link = _ref[_i];
|
||||||
nodes.push($.tn('\u00A0'), link(this, Sauce.link.cloneNode(true)));
|
nodes.push($.tn('\u00A0'), Sauce.createSauceLink(link, this, Sauce.link.cloneNode(true)));
|
||||||
}
|
}
|
||||||
return $.add(this.file.text, nodes);
|
return $.add(this.file.text, nodes);
|
||||||
}
|
}
|
||||||
@ -10756,7 +10767,7 @@
|
|||||||
}
|
}
|
||||||
return Redirect.data = o;
|
return Redirect.data = o;
|
||||||
},
|
},
|
||||||
archives: [{"uid":0,"name":"Foolz","domain":"archive.foolz.us","http":true,"https":true,"software":"foolfuuka","boards":["a","biz","co","diy","gd","jp","m","sci","sp","tg","tv","vg","vp","vr","wsg"],"files":["a","biz","diy","gd","jp","m","sci","tg","vg","vp","vr","wsg"]},{"uid":1,"name":"NSFW Foolz","domain":"nsfw.foolz.us","http":true,"https":true,"software":"foolfuuka","boards":["u"],"files":["u"]},{"uid":2,"name":"The Dark Cave","domain":"archive.thedarkcave.org","http":true,"https":true,"software":"foolfuuka","boards":["c","int","out","po"],"files":["c","po"]},{"uid":3,"name":"4plebs Archive","domain":"archive.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["adv","hr","o","pol","s4s","tg","trv","tv","x"],"files":["adv","hr","o","pol","s4s","tg","trv","tv","x"]},{"uid":18,"name":"4plebs Flash Archive","domain":"flash.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["f"],"files":["f"]},{"uid":4,"name":"Nyafuu","domain":"archive.nyafuu.org","http":true,"https":true,"software":"foolfuuka","boards":["c","e","w","wg"],"files":["c","e","w","wg"]},{"uid":5,"name":"Love is Over","domain":"archive.loveisover.me","http":true,"https":true,"software":"foolfuuka","boards":["d","i","lgbt"],"files":["d","i","lgbt"]},{"uid":8,"name":"Rebecca Black Tech","domain":"rbt.asia","http":false,"https":true,"software":"fuuka","boards":["cgl","g","mu","w"],"files":["cgl","g","mu","w"]},{"uid":9,"name":"Heinessen","domain":"archive.heinessen.com","http":true,"https":false,"software":"fuuka","boards":["an","fit","k","mlp","r9k","toy"],"files":["an","fit","k","mlp","r9k","toy"]},{"uid":10,"name":"warosu","domain":"fuuka.warosu.org","http":false,"https":true,"software":"fuuka","boards":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"],"files":["3","biz","cgl","ck","diy","fa","ic","jp","lit","sci","tg","vr"]},{"uid":15,"name":"fgts","domain":"fgts.eu","http":true,"https":true,"software":"foolfuuka","boards":["asp","cm","h","hc","hm","n","p","r","s","soc","y"],"files":["asp","cm","h","hc","hm","n","p","r","s","soc","y"]},{"uid":16,"name":"maware","domain":"archive.mawa.re","http":true,"https":false,"software":"foolfuuka","boards":["t"],"files":["t"]},{"uid":17,"name":"installgentoo.com","domain":"chan.installgentoo.com","http":true,"https":false,"software":"foolfuuka","boards":["g","t"],"files":["g","t"]},{"uid":19,"name":"Innovandalism Archive","domain":"boards.innovandalism.eu","http":true,"https":false,"software":"foolfuuka","boards":["v"],"files":[]},{"uid":13,"name":"Foolz Beta","domain":"beta.foolz.us","http":true,"https":true,"withCredentials":true,"software":"foolfuuka","boards":["a","biz","co","d","diy","gd","h","i","jp","m","mlp","s4s","sci","sp","tg","tv","u","v","vg","vp","vr","wsg"],"files":[]}],
|
archives: [{"uid":0,"name":"Foolz","domain":"archive.foolz.us","http":true,"https":true,"software":"foolfuuka","boards":["a","biz","co","diy","gd","jp","m","sci","sp","tg","tv","vg","vp","vr","wsg"],"files":["a","biz","diy","gd","jp","m","sci","tg","vg","vp","vr","wsg"]},{"uid":1,"name":"NSFW Foolz","domain":"nsfw.foolz.us","http":true,"https":true,"software":"foolfuuka","boards":["u"],"files":["u"]},{"uid":2,"name":"The Dark Cave","domain":"archive.thedarkcave.org","http":true,"https":true,"software":"foolfuuka","boards":["c","int","out","po"],"files":["c","po"]},{"uid":3,"name":"4plebs Archive","domain":"archive.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["adv","hr","o","pol","s4s","tg","trv","tv","x"],"files":["adv","hr","o","pol","s4s","tg","trv","tv","x"]},{"uid":18,"name":"4plebs Flash Archive","domain":"flash.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["f"],"files":["f"]},{"uid":4,"name":"Nyafuu","domain":"archive.nyafuu.org","http":true,"https":true,"software":"foolfuuka","boards":["c","e","w","wg"],"files":["c","e","w","wg"]},{"uid":5,"name":"Love is Over","domain":"archive.loveisover.me","http":true,"https":true,"software":"foolfuuka","boards":["d","i","lgbt"],"files":["d","i","lgbt"]},{"uid":8,"name":"Rebecca Black Tech","domain":"rbt.asia","http":false,"https":true,"software":"fuuka","boards":["cgl","g","mu","w"],"files":["cgl","g","mu","w"]},{"uid":9,"name":"Heinessen","domain":"archive.heinessen.com","http":true,"https":false,"software":"fuuka","boards":["an","fit","k","mlp","r9k","toy"],"files":["an","fit","k","mlp","r9k","toy"]},{"uid":10,"name":"warosu","domain":"fuuka.warosu.org","http":false,"https":true,"software":"fuuka","boards":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"],"files":["3","biz","cgl","ck","diy","fa","ic","jp","lit","sci","tg","vr"]},{"uid":15,"name":"fgts","domain":"fgts.eu","http":true,"https":true,"software":"foolfuuka","boards":["asp","b","cm","h","hc","hm","n","p","r","s","soc","y"],"files":["asp","cm","h","hc","hm","n","p","r","s","soc","y"]},{"uid":16,"name":"maware","domain":"archive.mawa.re","http":true,"https":false,"software":"foolfuuka","boards":["t"],"files":["t"]},{"uid":17,"name":"installgentoo.com","domain":"chan.installgentoo.com","http":true,"https":false,"software":"foolfuuka","boards":["g","t"],"files":["g","t"]},{"uid":19,"name":"Innovandalism Archive","domain":"boards.innovandalism.eu","http":true,"https":false,"software":"foolfuuka","boards":["v"],"files":[]},{"uid":13,"name":"Foolz Beta","domain":"beta.foolz.us","http":true,"https":true,"withCredentials":true,"software":"foolfuuka","boards":["a","biz","co","d","diy","gd","h","i","jp","m","mlp","s4s","sci","sp","tg","tv","u","v","vg","vp","vr","wsg"],"files":[]}],
|
||||||
to: function(dest, data) {
|
to: function(dest, data) {
|
||||||
var archive;
|
var archive;
|
||||||
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
|
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
|
||||||
@ -11023,65 +11034,10 @@
|
|||||||
return CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
|
return CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
|
||||||
},
|
},
|
||||||
external: function(board) {
|
external: function(board) {
|
||||||
switch (board) {
|
if (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt') {
|
||||||
case 'a':
|
return "http://catalog.neet.tv/" + board;
|
||||||
case 'c':
|
} else {
|
||||||
case 'g':
|
return "/" + board + "/catalog";
|
||||||
case 'co':
|
|
||||||
case 'k':
|
|
||||||
case 'm':
|
|
||||||
case 'o':
|
|
||||||
case 'p':
|
|
||||||
case 'v':
|
|
||||||
case 'vg':
|
|
||||||
case 'w':
|
|
||||||
case 'cm':
|
|
||||||
case '3':
|
|
||||||
case 'adv':
|
|
||||||
case 'an':
|
|
||||||
case 'cgl':
|
|
||||||
case 'ck':
|
|
||||||
case 'diy':
|
|
||||||
case 'fa':
|
|
||||||
case 'fit':
|
|
||||||
case 'int':
|
|
||||||
case 'jp':
|
|
||||||
case 'mlp':
|
|
||||||
case 'lit':
|
|
||||||
case 'mu':
|
|
||||||
case 'n':
|
|
||||||
case 'po':
|
|
||||||
case 'sci':
|
|
||||||
case 'toy':
|
|
||||||
case 'trv':
|
|
||||||
case 'tv':
|
|
||||||
case 'vp':
|
|
||||||
case 'x':
|
|
||||||
case 'q':
|
|
||||||
return "http://catalog.neet.tv/" + board;
|
|
||||||
case 'd':
|
|
||||||
case 'e':
|
|
||||||
case 'gif':
|
|
||||||
case 'h':
|
|
||||||
case 'hr':
|
|
||||||
case 'hc':
|
|
||||||
case 'r9k':
|
|
||||||
case 's':
|
|
||||||
case 'pol':
|
|
||||||
case 'soc':
|
|
||||||
case 'u':
|
|
||||||
case 'i':
|
|
||||||
case 'ic':
|
|
||||||
case 'hm':
|
|
||||||
case 'r':
|
|
||||||
case 'w':
|
|
||||||
case 'wg':
|
|
||||||
case 'wsg':
|
|
||||||
case 't':
|
|
||||||
case 'y':
|
|
||||||
return "http://4index.gropes.us/" + board;
|
|
||||||
default:
|
|
||||||
return "/" + board + "/catalog";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -11459,7 +11415,6 @@
|
|||||||
if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) {
|
if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.funk = this.createFunc(Conf['fileInfo']);
|
|
||||||
return Post.callbacks.push({
|
return Post.callbacks.push({
|
||||||
name: 'File Info Formatting',
|
name: 'File Info Formatting',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
@ -11469,18 +11424,16 @@
|
|||||||
if (!this.file || this.isClone) {
|
if (!this.file || this.isClone) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return this.file.text.innerHTML = "<span class=file-info>" + (FileInfo.funk(FileInfo, this)) + "</span>";
|
return this.file.text.innerHTML = "<span class=file-info>" + (FileInfo.format(Conf['fileInfo'], this)) + "</span>";
|
||||||
},
|
},
|
||||||
createFunc: function(format) {
|
format: function(formatString, post) {
|
||||||
var code;
|
return formatString.replace(/%([A-Za-z])/g, function(s, c) {
|
||||||
code = format.replace(/%(.)/g, function(s, c) {
|
|
||||||
if (c in FileInfo.formatters) {
|
if (c in FileInfo.formatters) {
|
||||||
return "' + FileInfo.formatters." + c + ".call(post) + '";
|
return FileInfo.formatters[c].call(post);
|
||||||
} else {
|
} else {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return Function('FileInfo', 'post', "return '" + code + "'");
|
|
||||||
},
|
},
|
||||||
convertUnit: function(size, unit) {
|
convertUnit: function(size, unit) {
|
||||||
var i;
|
var i;
|
||||||
@ -11495,22 +11448,28 @@
|
|||||||
return "" + size + " " + unit;
|
return "" + size + " " + unit;
|
||||||
},
|
},
|
||||||
escape: function(name) {
|
escape: function(name) {
|
||||||
return name.replace(/<|>/g, function(c) {
|
return name.replace(/[&"'<>]/g, function(c) {
|
||||||
return c === '<' && '<' || '>';
|
return {
|
||||||
|
'&': '&',
|
||||||
|
"'": ''',
|
||||||
|
'"': '"',
|
||||||
|
'<': '<',
|
||||||
|
'>': '>'
|
||||||
|
}[c];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
formatters: {
|
formatters: {
|
||||||
t: function() {
|
t: function() {
|
||||||
return this.file.URL.match(/\d+\..+$/)[0];
|
return FileInfo.escape(this.file.URL.match(/\d+\..+$/)[0]);
|
||||||
},
|
},
|
||||||
T: function() {
|
T: function() {
|
||||||
return "<a href=" + this.file.URL + " target=_blank>" + (FileInfo.formatters.t.call(this)) + "</a>";
|
return "<a href=" + (FileInfo.escape(this.file.URL)) + " target=_blank>" + (FileInfo.formatters.t.call(this)) + "</a>";
|
||||||
},
|
},
|
||||||
l: function() {
|
l: function() {
|
||||||
return "<a href=" + this.file.URL + " target=_blank>" + (FileInfo.formatters.n.call(this)) + "</a>";
|
return "<a href=" + (FileInfo.escape(this.file.URL)) + " target=_blank>" + (FileInfo.formatters.n.call(this)) + "</a>";
|
||||||
},
|
},
|
||||||
L: function() {
|
L: function() {
|
||||||
return "<a href=" + this.file.URL + " target=_blank>" + (FileInfo.formatters.N.call(this)) + "</a>";
|
return "<a href=" + (FileInfo.escape(this.file.URL)) + " target=_blank>" + (FileInfo.formatters.N.call(this)) + "</a>";
|
||||||
},
|
},
|
||||||
n: function() {
|
n: function() {
|
||||||
var fullname, shortname;
|
var fullname, shortname;
|
||||||
@ -11533,7 +11492,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
s: function() {
|
s: function() {
|
||||||
return this.file.size;
|
return FileInfo.escape(this.file.size);
|
||||||
},
|
},
|
||||||
B: function() {
|
B: function() {
|
||||||
return FileInfo.convertUnit(this.file.sizeInBytes, 'B');
|
return FileInfo.convertUnit(this.file.sizeInBytes, 'B');
|
||||||
@ -11545,11 +11504,7 @@
|
|||||||
return FileInfo.convertUnit(this.file.sizeInBytes, 'MB');
|
return FileInfo.convertUnit(this.file.sizeInBytes, 'MB');
|
||||||
},
|
},
|
||||||
r: function() {
|
r: function() {
|
||||||
if (this.file.isImage || this.file.isVideo) {
|
return FileInfo.escape(this.file.dimensions || 'PDF');
|
||||||
return this.file.dimensions;
|
|
||||||
} else {
|
|
||||||
return 'PDF';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -12320,7 +12275,6 @@
|
|||||||
if (g.VIEW === 'catalog' || !Conf['Time Formatting']) {
|
if (g.VIEW === 'catalog' || !Conf['Time Formatting']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.funk = this.createFunc(Conf['time']);
|
|
||||||
return Post.callbacks.push({
|
return Post.callbacks.push({
|
||||||
name: 'Time Formatting',
|
name: 'Time Formatting',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
@ -12330,18 +12284,16 @@
|
|||||||
if (this.isClone) {
|
if (this.isClone) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return this.nodes.date.textContent = Time.funk(Time, this.info.date);
|
return this.nodes.date.textContent = Time.format(Conf['time'], this.info.date);
|
||||||
},
|
},
|
||||||
createFunc: function(format) {
|
format: function(formatString, date) {
|
||||||
var code;
|
return formatString.replace(/%([A-Za-z])/g, function(s, c) {
|
||||||
code = format.replace(/%([A-Za-z])/g, function(s, c) {
|
|
||||||
if (c in Time.formatters) {
|
if (c in Time.formatters) {
|
||||||
return "' + Time.formatters." + c + ".call(date) + '";
|
return Time.formatters[c].call(date);
|
||||||
} else {
|
} else {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return Function('Time', 'date', "return '" + code + "'");
|
|
||||||
},
|
},
|
||||||
day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
||||||
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||||
@ -13330,15 +13282,13 @@
|
|||||||
return Header.generateBoardList(this.value);
|
return Header.generateBoardList(this.value);
|
||||||
},
|
},
|
||||||
time: function() {
|
time: function() {
|
||||||
var funk;
|
return this.nextElementSibling.textContent = Time.format(this.value, new Date());
|
||||||
funk = Time.createFunc(this.value);
|
|
||||||
return this.nextElementSibling.textContent = funk(Time, new Date());
|
|
||||||
},
|
},
|
||||||
backlink: function() {
|
backlink: function() {
|
||||||
return this.nextElementSibling.textContent = this.value.replace(/%id/, '123456789');
|
return this.nextElementSibling.textContent = this.value.replace(/%id/, '123456789');
|
||||||
},
|
},
|
||||||
fileInfo: function() {
|
fileInfo: function() {
|
||||||
var data, funk;
|
var data;
|
||||||
data = {
|
data = {
|
||||||
isReply: true,
|
isReply: true,
|
||||||
file: {
|
file: {
|
||||||
@ -13351,8 +13301,7 @@
|
|||||||
isSpoiler: true
|
isSpoiler: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
funk = FileInfo.createFunc(this.value);
|
return this.nextElementSibling.innerHTML = FileInfo.format(this.value, data);
|
||||||
return this.nextElementSibling.innerHTML = funk(FileInfo, data);
|
|
||||||
},
|
},
|
||||||
favicon: function() {
|
favicon: function() {
|
||||||
Favicon["switch"]();
|
Favicon["switch"]();
|
||||||
|
|||||||
BIN
builds/crx.crx
BIN
builds/crx.crx
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "4chan X",
|
"name": "4chan X",
|
||||||
"version": "1.7.35",
|
"version": "1.7.36",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
||||||
"icons": {
|
"icons": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.7.35 - 2014-05-12
|
* 4chan X - Version 1.7.36 - 2014-05-13
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
|
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
|
||||||
@ -348,7 +348,7 @@
|
|||||||
doc = d.documentElement;
|
doc = d.documentElement;
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.7.35',
|
VERSION: '1.7.36',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
boards: {}
|
boards: {}
|
||||||
};
|
};
|
||||||
@ -3097,7 +3097,7 @@
|
|||||||
threshold = isReply ? 30 : 40;
|
threshold = isReply ? 30 : 40;
|
||||||
ext = filename.match(/\.?[^\.]*$/)[0];
|
ext = filename.match(/\.?[^\.]*$/)[0];
|
||||||
if (filename.length - ext.length > threshold) {
|
if (filename.length - ext.length > threshold) {
|
||||||
return "" + filename.slice(0, threshold - 5) + "(...)." + ext;
|
return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
|
||||||
} else {
|
} else {
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
@ -3438,6 +3438,7 @@
|
|||||||
$.cache(url, function() {
|
$.cache(url, function() {
|
||||||
return Get.archivedPost(this, boardID, postID, root, context);
|
return Get.archivedPost(this, boardID, postID, root, context);
|
||||||
}, {
|
}, {
|
||||||
|
responseType: 'json',
|
||||||
withCredentials: url.archive.withCredentials
|
withCredentials: url.archive.withCredentials
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -4930,12 +4931,9 @@
|
|||||||
QuoteBacklink = {
|
QuoteBacklink = {
|
||||||
containers: {},
|
containers: {},
|
||||||
init: function() {
|
init: function() {
|
||||||
var format;
|
|
||||||
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
|
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
format = Conf['backlink'].replace(/%id/g, "' + id + '");
|
|
||||||
this.funk = Function('id', "return '" + format + "'");
|
|
||||||
Post.callbacks.push({
|
Post.callbacks.push({
|
||||||
name: 'Quote Backlinking Part 1',
|
name: 'Quote Backlinking Part 1',
|
||||||
cb: this.firstNode
|
cb: this.firstNode
|
||||||
@ -4958,7 +4956,7 @@
|
|||||||
a = $.el('a', {
|
a = $.el('a', {
|
||||||
href: "/" + this.board + "/thread/" + this.thread + "#p" + this,
|
href: "/" + this.board + "/thread/" + this.thread + "#p" + this,
|
||||||
className: this.isHidden ? 'filtered backlink' : 'backlink',
|
className: this.isHidden ? 'filtered backlink' : 'backlink',
|
||||||
textContent: (QuoteBacklink.funk(this.ID)) + (markYours ? '\u00A0(You)' : '')
|
textContent: (Conf['backlink'].replace(/%id/, this.ID)) + (markYours ? '\u00A0(You)' : '')
|
||||||
});
|
});
|
||||||
_ref = this.quotes;
|
_ref = this.quotes;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
@ -8378,7 +8376,7 @@
|
|||||||
link = _ref[_i];
|
link = _ref[_i];
|
||||||
try {
|
try {
|
||||||
if (link[0] !== '#') {
|
if (link[0] !== '#') {
|
||||||
links.push(this.createSauceLink(link.trim()));
|
links.push(link.trim());
|
||||||
}
|
}
|
||||||
} catch (_error) {
|
} catch (_error) {
|
||||||
err = _error;
|
err = _error;
|
||||||
@ -8396,21 +8394,34 @@
|
|||||||
cb: this.node
|
cb: this.node
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
createSauceLink: function(link) {
|
createSauceLink: function(link, post, a) {
|
||||||
var m, text;
|
var i, m, parts, text, _i, _ref;
|
||||||
link = link.replace(/%(T?URL|MD5|board|name)/g, function(parameter) {
|
text = (m = link.match(/;text:(.+)$/)) ? m[1] : ((_ref = link.match(/(\w+)\.\w+\//)) != null ? _ref[1] : void 0) || '?';
|
||||||
var type;
|
|
||||||
return ((type = {
|
|
||||||
'%TURL': 'post.file.thumbURL',
|
|
||||||
'%URL': 'post.file.URL',
|
|
||||||
'%MD5': 'post.file.MD5',
|
|
||||||
'%board': 'post.board',
|
|
||||||
'%name': 'post.file.name'
|
|
||||||
}[parameter]) ? "' + encodeURIComponent(" + type + ") + '" : parameter);
|
|
||||||
});
|
|
||||||
text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
|
|
||||||
link = link.replace(/;text:.+$/, '');
|
link = link.replace(/;text:.+$/, '');
|
||||||
return Function('post', 'a', "a.href = '" + link + "';\na.textContent = '" + text + "';\nreturn a;");
|
parts = [link, text];
|
||||||
|
for (i = _i = 0; _i <= 1; i = ++_i) {
|
||||||
|
parts[i] = parts[i].replace(/%(T?URL|MD5|board|name)/g, function(parameter) {
|
||||||
|
var type;
|
||||||
|
if (type = {
|
||||||
|
'%TURL': post.file.thumbURL,
|
||||||
|
'%URL': post.file.URL,
|
||||||
|
'%MD5': post.file.MD5,
|
||||||
|
'%board': post.board,
|
||||||
|
'%name': post.file.name
|
||||||
|
}[parameter]) {
|
||||||
|
if (i === 0) {
|
||||||
|
return encodeURIComponent(type);
|
||||||
|
} else {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return parameter;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
a.href = parts[0];
|
||||||
|
a.textContent = parts[1];
|
||||||
|
return a;
|
||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
var link, nodes, _i, _len, _ref;
|
var link, nodes, _i, _len, _ref;
|
||||||
@ -8421,7 +8432,7 @@
|
|||||||
_ref = Sauce.links;
|
_ref = Sauce.links;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
link = _ref[_i];
|
link = _ref[_i];
|
||||||
nodes.push($.tn('\u00A0'), link(this, Sauce.link.cloneNode(true)));
|
nodes.push($.tn('\u00A0'), Sauce.createSauceLink(link, this, Sauce.link.cloneNode(true)));
|
||||||
}
|
}
|
||||||
return $.add(this.file.text, nodes);
|
return $.add(this.file.text, nodes);
|
||||||
}
|
}
|
||||||
@ -10759,7 +10770,7 @@
|
|||||||
}
|
}
|
||||||
return Redirect.data = o;
|
return Redirect.data = o;
|
||||||
},
|
},
|
||||||
archives: [{"uid":0,"name":"Foolz","domain":"archive.foolz.us","http":true,"https":true,"software":"foolfuuka","boards":["a","biz","co","diy","gd","jp","m","sci","sp","tg","tv","vg","vp","vr","wsg"],"files":["a","biz","diy","gd","jp","m","sci","tg","vg","vp","vr","wsg"]},{"uid":1,"name":"NSFW Foolz","domain":"nsfw.foolz.us","http":true,"https":true,"software":"foolfuuka","boards":["u"],"files":["u"]},{"uid":2,"name":"The Dark Cave","domain":"archive.thedarkcave.org","http":true,"https":true,"software":"foolfuuka","boards":["c","int","out","po"],"files":["c","po"]},{"uid":3,"name":"4plebs Archive","domain":"archive.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["adv","hr","o","pol","s4s","tg","trv","tv","x"],"files":["adv","hr","o","pol","s4s","tg","trv","tv","x"]},{"uid":18,"name":"4plebs Flash Archive","domain":"flash.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["f"],"files":["f"]},{"uid":4,"name":"Nyafuu","domain":"archive.nyafuu.org","http":true,"https":true,"software":"foolfuuka","boards":["c","e","w","wg"],"files":["c","e","w","wg"]},{"uid":5,"name":"Love is Over","domain":"archive.loveisover.me","http":true,"https":true,"software":"foolfuuka","boards":["d","i","lgbt"],"files":["d","i","lgbt"]},{"uid":8,"name":"Rebecca Black Tech","domain":"rbt.asia","http":false,"https":true,"software":"fuuka","boards":["cgl","g","mu","w"],"files":["cgl","g","mu","w"]},{"uid":9,"name":"Heinessen","domain":"archive.heinessen.com","http":true,"https":false,"software":"fuuka","boards":["an","fit","k","mlp","r9k","toy"],"files":["an","fit","k","mlp","r9k","toy"]},{"uid":10,"name":"warosu","domain":"fuuka.warosu.org","http":false,"https":true,"software":"fuuka","boards":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"],"files":["3","biz","cgl","ck","diy","fa","ic","jp","lit","sci","tg","vr"]},{"uid":15,"name":"fgts","domain":"fgts.eu","http":true,"https":true,"software":"foolfuuka","boards":["asp","cm","h","hc","hm","n","p","r","s","soc","y"],"files":["asp","cm","h","hc","hm","n","p","r","s","soc","y"]},{"uid":16,"name":"maware","domain":"archive.mawa.re","http":true,"https":false,"software":"foolfuuka","boards":["t"],"files":["t"]},{"uid":17,"name":"installgentoo.com","domain":"chan.installgentoo.com","http":true,"https":false,"software":"foolfuuka","boards":["g","t"],"files":["g","t"]},{"uid":19,"name":"Innovandalism Archive","domain":"boards.innovandalism.eu","http":true,"https":false,"software":"foolfuuka","boards":["v"],"files":[]},{"uid":13,"name":"Foolz Beta","domain":"beta.foolz.us","http":true,"https":true,"withCredentials":true,"software":"foolfuuka","boards":["a","biz","co","d","diy","gd","h","i","jp","m","mlp","s4s","sci","sp","tg","tv","u","v","vg","vp","vr","wsg"],"files":[]}],
|
archives: [{"uid":0,"name":"Foolz","domain":"archive.foolz.us","http":true,"https":true,"software":"foolfuuka","boards":["a","biz","co","diy","gd","jp","m","sci","sp","tg","tv","vg","vp","vr","wsg"],"files":["a","biz","diy","gd","jp","m","sci","tg","vg","vp","vr","wsg"]},{"uid":1,"name":"NSFW Foolz","domain":"nsfw.foolz.us","http":true,"https":true,"software":"foolfuuka","boards":["u"],"files":["u"]},{"uid":2,"name":"The Dark Cave","domain":"archive.thedarkcave.org","http":true,"https":true,"software":"foolfuuka","boards":["c","int","out","po"],"files":["c","po"]},{"uid":3,"name":"4plebs Archive","domain":"archive.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["adv","hr","o","pol","s4s","tg","trv","tv","x"],"files":["adv","hr","o","pol","s4s","tg","trv","tv","x"]},{"uid":18,"name":"4plebs Flash Archive","domain":"flash.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["f"],"files":["f"]},{"uid":4,"name":"Nyafuu","domain":"archive.nyafuu.org","http":true,"https":true,"software":"foolfuuka","boards":["c","e","w","wg"],"files":["c","e","w","wg"]},{"uid":5,"name":"Love is Over","domain":"archive.loveisover.me","http":true,"https":true,"software":"foolfuuka","boards":["d","i","lgbt"],"files":["d","i","lgbt"]},{"uid":8,"name":"Rebecca Black Tech","domain":"rbt.asia","http":false,"https":true,"software":"fuuka","boards":["cgl","g","mu","w"],"files":["cgl","g","mu","w"]},{"uid":9,"name":"Heinessen","domain":"archive.heinessen.com","http":true,"https":false,"software":"fuuka","boards":["an","fit","k","mlp","r9k","toy"],"files":["an","fit","k","mlp","r9k","toy"]},{"uid":10,"name":"warosu","domain":"fuuka.warosu.org","http":false,"https":true,"software":"fuuka","boards":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"],"files":["3","biz","cgl","ck","diy","fa","ic","jp","lit","sci","tg","vr"]},{"uid":15,"name":"fgts","domain":"fgts.eu","http":true,"https":true,"software":"foolfuuka","boards":["asp","b","cm","h","hc","hm","n","p","r","s","soc","y"],"files":["asp","cm","h","hc","hm","n","p","r","s","soc","y"]},{"uid":16,"name":"maware","domain":"archive.mawa.re","http":true,"https":false,"software":"foolfuuka","boards":["t"],"files":["t"]},{"uid":17,"name":"installgentoo.com","domain":"chan.installgentoo.com","http":true,"https":false,"software":"foolfuuka","boards":["g","t"],"files":["g","t"]},{"uid":19,"name":"Innovandalism Archive","domain":"boards.innovandalism.eu","http":true,"https":false,"software":"foolfuuka","boards":["v"],"files":[]},{"uid":13,"name":"Foolz Beta","domain":"beta.foolz.us","http":true,"https":true,"withCredentials":true,"software":"foolfuuka","boards":["a","biz","co","d","diy","gd","h","i","jp","m","mlp","s4s","sci","sp","tg","tv","u","v","vg","vp","vr","wsg"],"files":[]}],
|
||||||
to: function(dest, data) {
|
to: function(dest, data) {
|
||||||
var archive;
|
var archive;
|
||||||
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
|
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
|
||||||
@ -11026,65 +11037,10 @@
|
|||||||
return CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
|
return CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
|
||||||
},
|
},
|
||||||
external: function(board) {
|
external: function(board) {
|
||||||
switch (board) {
|
if (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt') {
|
||||||
case 'a':
|
return "http://catalog.neet.tv/" + board;
|
||||||
case 'c':
|
} else {
|
||||||
case 'g':
|
return "/" + board + "/catalog";
|
||||||
case 'co':
|
|
||||||
case 'k':
|
|
||||||
case 'm':
|
|
||||||
case 'o':
|
|
||||||
case 'p':
|
|
||||||
case 'v':
|
|
||||||
case 'vg':
|
|
||||||
case 'w':
|
|
||||||
case 'cm':
|
|
||||||
case '3':
|
|
||||||
case 'adv':
|
|
||||||
case 'an':
|
|
||||||
case 'cgl':
|
|
||||||
case 'ck':
|
|
||||||
case 'diy':
|
|
||||||
case 'fa':
|
|
||||||
case 'fit':
|
|
||||||
case 'int':
|
|
||||||
case 'jp':
|
|
||||||
case 'mlp':
|
|
||||||
case 'lit':
|
|
||||||
case 'mu':
|
|
||||||
case 'n':
|
|
||||||
case 'po':
|
|
||||||
case 'sci':
|
|
||||||
case 'toy':
|
|
||||||
case 'trv':
|
|
||||||
case 'tv':
|
|
||||||
case 'vp':
|
|
||||||
case 'x':
|
|
||||||
case 'q':
|
|
||||||
return "http://catalog.neet.tv/" + board;
|
|
||||||
case 'd':
|
|
||||||
case 'e':
|
|
||||||
case 'gif':
|
|
||||||
case 'h':
|
|
||||||
case 'hr':
|
|
||||||
case 'hc':
|
|
||||||
case 'r9k':
|
|
||||||
case 's':
|
|
||||||
case 'pol':
|
|
||||||
case 'soc':
|
|
||||||
case 'u':
|
|
||||||
case 'i':
|
|
||||||
case 'ic':
|
|
||||||
case 'hm':
|
|
||||||
case 'r':
|
|
||||||
case 'w':
|
|
||||||
case 'wg':
|
|
||||||
case 'wsg':
|
|
||||||
case 't':
|
|
||||||
case 'y':
|
|
||||||
return "http://4index.gropes.us/" + board;
|
|
||||||
default:
|
|
||||||
return "/" + board + "/catalog";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -11462,7 +11418,6 @@
|
|||||||
if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) {
|
if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.funk = this.createFunc(Conf['fileInfo']);
|
|
||||||
return Post.callbacks.push({
|
return Post.callbacks.push({
|
||||||
name: 'File Info Formatting',
|
name: 'File Info Formatting',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
@ -11472,18 +11427,16 @@
|
|||||||
if (!this.file || this.isClone) {
|
if (!this.file || this.isClone) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return this.file.text.innerHTML = "<span class=file-info>" + (FileInfo.funk(FileInfo, this)) + "</span>";
|
return this.file.text.innerHTML = "<span class=file-info>" + (FileInfo.format(Conf['fileInfo'], this)) + "</span>";
|
||||||
},
|
},
|
||||||
createFunc: function(format) {
|
format: function(formatString, post) {
|
||||||
var code;
|
return formatString.replace(/%([A-Za-z])/g, function(s, c) {
|
||||||
code = format.replace(/%(.)/g, function(s, c) {
|
|
||||||
if (c in FileInfo.formatters) {
|
if (c in FileInfo.formatters) {
|
||||||
return "' + FileInfo.formatters." + c + ".call(post) + '";
|
return FileInfo.formatters[c].call(post);
|
||||||
} else {
|
} else {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return Function('FileInfo', 'post', "return '" + code + "'");
|
|
||||||
},
|
},
|
||||||
convertUnit: function(size, unit) {
|
convertUnit: function(size, unit) {
|
||||||
var i;
|
var i;
|
||||||
@ -11498,22 +11451,28 @@
|
|||||||
return "" + size + " " + unit;
|
return "" + size + " " + unit;
|
||||||
},
|
},
|
||||||
escape: function(name) {
|
escape: function(name) {
|
||||||
return name.replace(/<|>/g, function(c) {
|
return name.replace(/[&"'<>]/g, function(c) {
|
||||||
return c === '<' && '<' || '>';
|
return {
|
||||||
|
'&': '&',
|
||||||
|
"'": ''',
|
||||||
|
'"': '"',
|
||||||
|
'<': '<',
|
||||||
|
'>': '>'
|
||||||
|
}[c];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
formatters: {
|
formatters: {
|
||||||
t: function() {
|
t: function() {
|
||||||
return this.file.URL.match(/\d+\..+$/)[0];
|
return FileInfo.escape(this.file.URL.match(/\d+\..+$/)[0]);
|
||||||
},
|
},
|
||||||
T: function() {
|
T: function() {
|
||||||
return "<a href=" + this.file.URL + " target=_blank>" + (FileInfo.formatters.t.call(this)) + "</a>";
|
return "<a href=" + (FileInfo.escape(this.file.URL)) + " target=_blank>" + (FileInfo.formatters.t.call(this)) + "</a>";
|
||||||
},
|
},
|
||||||
l: function() {
|
l: function() {
|
||||||
return "<a href=" + this.file.URL + " target=_blank>" + (FileInfo.formatters.n.call(this)) + "</a>";
|
return "<a href=" + (FileInfo.escape(this.file.URL)) + " target=_blank>" + (FileInfo.formatters.n.call(this)) + "</a>";
|
||||||
},
|
},
|
||||||
L: function() {
|
L: function() {
|
||||||
return "<a href=" + this.file.URL + " target=_blank>" + (FileInfo.formatters.N.call(this)) + "</a>";
|
return "<a href=" + (FileInfo.escape(this.file.URL)) + " target=_blank>" + (FileInfo.formatters.N.call(this)) + "</a>";
|
||||||
},
|
},
|
||||||
n: function() {
|
n: function() {
|
||||||
var fullname, shortname;
|
var fullname, shortname;
|
||||||
@ -11536,7 +11495,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
s: function() {
|
s: function() {
|
||||||
return this.file.size;
|
return FileInfo.escape(this.file.size);
|
||||||
},
|
},
|
||||||
B: function() {
|
B: function() {
|
||||||
return FileInfo.convertUnit(this.file.sizeInBytes, 'B');
|
return FileInfo.convertUnit(this.file.sizeInBytes, 'B');
|
||||||
@ -11548,11 +11507,7 @@
|
|||||||
return FileInfo.convertUnit(this.file.sizeInBytes, 'MB');
|
return FileInfo.convertUnit(this.file.sizeInBytes, 'MB');
|
||||||
},
|
},
|
||||||
r: function() {
|
r: function() {
|
||||||
if (this.file.isImage || this.file.isVideo) {
|
return FileInfo.escape(this.file.dimensions || 'PDF');
|
||||||
return this.file.dimensions;
|
|
||||||
} else {
|
|
||||||
return 'PDF';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -12323,7 +12278,6 @@
|
|||||||
if (g.VIEW === 'catalog' || !Conf['Time Formatting']) {
|
if (g.VIEW === 'catalog' || !Conf['Time Formatting']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.funk = this.createFunc(Conf['time']);
|
|
||||||
return Post.callbacks.push({
|
return Post.callbacks.push({
|
||||||
name: 'Time Formatting',
|
name: 'Time Formatting',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
@ -12333,18 +12287,16 @@
|
|||||||
if (this.isClone) {
|
if (this.isClone) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return this.nodes.date.textContent = Time.funk(Time, this.info.date);
|
return this.nodes.date.textContent = Time.format(Conf['time'], this.info.date);
|
||||||
},
|
},
|
||||||
createFunc: function(format) {
|
format: function(formatString, date) {
|
||||||
var code;
|
return formatString.replace(/%([A-Za-z])/g, function(s, c) {
|
||||||
code = format.replace(/%([A-Za-z])/g, function(s, c) {
|
|
||||||
if (c in Time.formatters) {
|
if (c in Time.formatters) {
|
||||||
return "' + Time.formatters." + c + ".call(date) + '";
|
return Time.formatters[c].call(date);
|
||||||
} else {
|
} else {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return Function('Time', 'date', "return '" + code + "'");
|
|
||||||
},
|
},
|
||||||
day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
||||||
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||||
@ -13335,15 +13287,13 @@
|
|||||||
return Header.generateBoardList(this.value);
|
return Header.generateBoardList(this.value);
|
||||||
},
|
},
|
||||||
time: function() {
|
time: function() {
|
||||||
var funk;
|
return this.nextElementSibling.textContent = Time.format(this.value, new Date());
|
||||||
funk = Time.createFunc(this.value);
|
|
||||||
return this.nextElementSibling.textContent = funk(Time, new Date());
|
|
||||||
},
|
},
|
||||||
backlink: function() {
|
backlink: function() {
|
||||||
return this.nextElementSibling.textContent = this.value.replace(/%id/, '123456789');
|
return this.nextElementSibling.textContent = this.value.replace(/%id/, '123456789');
|
||||||
},
|
},
|
||||||
fileInfo: function() {
|
fileInfo: function() {
|
||||||
var data, funk;
|
var data;
|
||||||
data = {
|
data = {
|
||||||
isReply: true,
|
isReply: true,
|
||||||
file: {
|
file: {
|
||||||
@ -13356,8 +13306,7 @@
|
|||||||
isSpoiler: true
|
isSpoiler: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
funk = FileInfo.createFunc(this.value);
|
return this.nextElementSibling.innerHTML = FileInfo.format(this.value, data);
|
||||||
return this.nextElementSibling.innerHTML = funk(FileInfo, data);
|
|
||||||
},
|
},
|
||||||
favicon: function() {
|
favicon: function() {
|
||||||
Favicon["switch"]();
|
Favicon["switch"]();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||||
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/crx.crx' version='1.7.35' />
|
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/crx.crx' version='1.7.36' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "4chan-X",
|
"name": "4chan-X",
|
||||||
"version": "1.7.35",
|
"version": "1.7.36",
|
||||||
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
||||||
"meta": {
|
"meta": {
|
||||||
"name": "4chan X",
|
"name": "4chan X",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user