Release 4chan X v1.10.4.4.
This commit is contained in:
parent
1c3d4b3d91
commit
441abd792b
@ -4,6 +4,10 @@ The links to individual versions below are to copies of the script with the upda
|
||||
|
||||
### v1.10.4
|
||||
|
||||
**v1.10.4.4** *(2015-03-13)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.4/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.4/builds/4chan-X-noupdate.crx "Chromium version")]
|
||||
- Update Strawpoll, Loopvid embedding; remove MediaCrush.
|
||||
- API bug fix.
|
||||
|
||||
**v1.10.4.3** *(2015-03-10)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.3/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.3/builds/4chan-X-noupdate.crx "Chromium version")]
|
||||
- Fix false-positive deleted posts again.
|
||||
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X beta
|
||||
// @version 1.10.4.3
|
||||
// @version 1.10.4.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Generated by CoffeeScript
|
||||
// ==UserScript==
|
||||
// @name 4chan X beta
|
||||
// @version 1.10.4.3
|
||||
// @version 1.10.4.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
@ -395,7 +395,7 @@
|
||||
doc = d.documentElement;
|
||||
|
||||
g = {
|
||||
VERSION: '1.10.4.3',
|
||||
VERSION: '1.10.4.4',
|
||||
NAMESPACE: '4chan X.',
|
||||
NAME: '4chan X',
|
||||
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
|
||||
@ -11005,75 +11005,6 @@
|
||||
el.setAttribute("allowfullscreen", "true");
|
||||
return el;
|
||||
}
|
||||
}, {
|
||||
key: 'MediaCrush',
|
||||
regExp: /^\w+:\/\/(?:www\.)?mediacru\.sh\/([\w\-]+)/,
|
||||
style: '',
|
||||
el: function(a) {
|
||||
var el;
|
||||
el = $.el('div');
|
||||
$.queueTask(function() {
|
||||
return $.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
|
||||
var embed, ext, file, files, i, k, len1, len2, len3, q, ref, ref1, status, type, u;
|
||||
if (!doc.contains(el)) {
|
||||
return;
|
||||
}
|
||||
status = this.status;
|
||||
if (status !== 200 && status !== 304) {
|
||||
return el.textContent = "ERROR " + status;
|
||||
}
|
||||
files = this.response.files;
|
||||
ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
type = ref[k];
|
||||
for (q = 0, len2 = files.length; q < len2; q++) {
|
||||
file = files[q];
|
||||
if (file.type === type) {
|
||||
embed = file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (embed) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!embed) {
|
||||
return el.textContent = "ERROR: Not a valid filetype";
|
||||
}
|
||||
switch (embed.type) {
|
||||
case 'video/mp4':
|
||||
case 'video/webm':
|
||||
case 'video/ogv':
|
||||
$.extend(el, {
|
||||
innerHTML: "<video controls loop style=\"max-width: 80vw; max-height: 80vh;\"><source type=\"video/mp4\"><source type=\"video/webm\"></video>"
|
||||
});
|
||||
ref1 = ['mp4', 'webm'];
|
||||
for (i = u = 0, len3 = ref1.length; u < len3; i = ++u) {
|
||||
ext = ref1[i];
|
||||
el.firstChild.children[i].src = "https://mediacru.sh/" + a.dataset.uid + "." + ext;
|
||||
}
|
||||
break;
|
||||
case 'image/svg+xml':
|
||||
case 'image/png':
|
||||
case 'image/gif':
|
||||
case 'image/jpeg':
|
||||
$.extend(el, {
|
||||
innerHTML: "<a target=\"_blank\" href=\"" + E(a.dataset.href) + "\"><img src=\"https://mediacru.sh/" + E(file.file) + "\" style=\"max-width: 80vw; max-height: 80vh;\"></a>"
|
||||
});
|
||||
break;
|
||||
case 'audio/mpeg':
|
||||
case 'audio/ogg':
|
||||
$.extend(el, {
|
||||
innerHTML: "<audio controls><source type=\"audio/ogg\" src=\"https://mediacru.sh/" + E(a.dataset.uid) + ".ogg\"></audio>"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
el.textContent = "ERROR: No valid filetype.";
|
||||
}
|
||||
});
|
||||
});
|
||||
return el;
|
||||
}
|
||||
}, {
|
||||
key: 'Pastebin',
|
||||
regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
|
||||
@ -11113,11 +11044,10 @@
|
||||
}, {
|
||||
key: 'StrawPoll',
|
||||
regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
|
||||
httpOnly: true,
|
||||
style: 'border: 0; width: 600px; height: 406px;',
|
||||
el: function(a) {
|
||||
return $.el('iframe', {
|
||||
src: "http://strawpoll.me/embed_1/" + a.dataset.uid
|
||||
src: "//strawpoll.me/embed_1/" + a.dataset.uid
|
||||
});
|
||||
}
|
||||
}, {
|
||||
@ -11230,7 +11160,7 @@
|
||||
}
|
||||
}, {
|
||||
key: 'Loopvid',
|
||||
regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/((?:pf|kd|lv|mc|gd|gh|db|nn)\/[\w\-]+(,[\w\-]+)*|fc\/\w+\/\d+)/,
|
||||
regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
|
||||
style: 'max-width: 80vw; max-height: 80vh;',
|
||||
el: function(a) {
|
||||
var _, base, el, host, k, len1, len2, name, names, q, ref, ref1, type, types, url;
|
||||
@ -11240,7 +11170,18 @@
|
||||
loop: true
|
||||
});
|
||||
ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
|
||||
types = host === 'gd' || host === 'fc' ? [''] : ['.webm', '.mp4'];
|
||||
types = (function() {
|
||||
switch (host) {
|
||||
case 'gd':
|
||||
case 'wu':
|
||||
case 'fc':
|
||||
return [''];
|
||||
case 'gc':
|
||||
return ['giant', 'fat', 'zippy'];
|
||||
default:
|
||||
return ['.webm', '.mp4'];
|
||||
}
|
||||
})();
|
||||
ref1 = names.split(',');
|
||||
for (k = 0, len1 = ref1.length; k < len1; k++) {
|
||||
name = ref1[k];
|
||||
@ -11250,23 +11191,33 @@
|
||||
url = (function() {
|
||||
switch (host) {
|
||||
case 'pf':
|
||||
return "http://a.pomf.se/" + base;
|
||||
return "https://a.pomf.se/" + base;
|
||||
case 'kd':
|
||||
return "http://kastden.org/loopvid/" + base;
|
||||
return "http://2.kastden.org/loopvid/" + base;
|
||||
case 'lv':
|
||||
return "http://loopvid.mooo.com/videos/" + base;
|
||||
case 'mc':
|
||||
return "https://cdn.mediacru.sh/" + base;
|
||||
case 'gd':
|
||||
return "https://docs.google.com/uc?export=download&id=" + base;
|
||||
case 'gh':
|
||||
return "https://googledrive.com/host/" + base;
|
||||
case 'db':
|
||||
return "https://googledrive.com/host/" + base;
|
||||
case 'fc':
|
||||
return "//i.4cdn.org/" + base + ".webm";
|
||||
return "https://dl.dropboxusercontent.com/u/" + base;
|
||||
case 'dx':
|
||||
return "https://dl.dropboxusercontent.com/" + base;
|
||||
case 'nn':
|
||||
return "http://naenara.eu/loopvids/" + base;
|
||||
case 'cp':
|
||||
return "https://copy.com/" + base;
|
||||
case 'wu':
|
||||
return "http://webmup.com/" + base + "/vid.webm";
|
||||
case 'ig':
|
||||
return "https://i.imgur.com/" + base;
|
||||
case 'ky':
|
||||
return "https://kiyo.me/" + base;
|
||||
case 'fc':
|
||||
return "//i.4cdn.org/" + base + ".webm";
|
||||
case 'gc':
|
||||
return "https://" + type + ".gfycat.com/" + name + ".webm";
|
||||
}
|
||||
})();
|
||||
$.add(el, $.el('source', {
|
||||
@ -11814,16 +11765,17 @@
|
||||
},
|
||||
node: function() {
|
||||
MarkNewIPs.ipCount = this.ipCount;
|
||||
MarkNewIPs.postCount = this.posts.keys.length;
|
||||
return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
|
||||
},
|
||||
onUpdate: function(e) {
|
||||
var deletedPosts, fullID, i, ipCount, k, len1, len2, newPosts, q, ref;
|
||||
ref = e.detail, ipCount = ref.ipCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
|
||||
var deletedPosts, fullID, i, ipCount, k, len1, len2, newPosts, postCount, q, ref;
|
||||
ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
|
||||
if (ipCount == null) {
|
||||
return;
|
||||
}
|
||||
switch (ipCount - MarkNewIPs.ipCount) {
|
||||
case newPosts.length:
|
||||
case postCount - MarkNewIPs.postCount + deletedPosts.length:
|
||||
i = MarkNewIPs.ipCount;
|
||||
for (k = 0, len1 = newPosts.length; k < len1; k++) {
|
||||
fullID = newPosts[k];
|
||||
@ -11836,7 +11788,8 @@
|
||||
MarkNewIPs.markOld(g.posts[fullID]);
|
||||
}
|
||||
}
|
||||
return MarkNewIPs.ipCount = ipCount;
|
||||
MarkNewIPs.ipCount = ipCount;
|
||||
return MarkNewIPs.postCount = postCount;
|
||||
},
|
||||
markNew: function(post, ipCount) {
|
||||
var counter, suffix;
|
||||
@ -12349,11 +12302,11 @@
|
||||
if (ID <= lastPost) {
|
||||
continue;
|
||||
}
|
||||
newPosts.push(board + "." + ID);
|
||||
if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
|
||||
post.resurrect();
|
||||
continue;
|
||||
}
|
||||
newPosts.push(board + "." + ID);
|
||||
node = Build.postFromObject(postObject, board.ID);
|
||||
posts.push(new Post(node, thread, board));
|
||||
if (ThreadUpdater.postID === ID) {
|
||||
|
||||
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
// Generated by CoffeeScript
|
||||
// ==UserScript==
|
||||
// @name 4chan X
|
||||
// @version 1.10.4.3
|
||||
// @version 1.10.4.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
@ -394,7 +394,7 @@
|
||||
doc = d.documentElement;
|
||||
|
||||
g = {
|
||||
VERSION: '1.10.4.3',
|
||||
VERSION: '1.10.4.4',
|
||||
NAMESPACE: '4chan X.',
|
||||
NAME: '4chan X',
|
||||
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
|
||||
@ -11004,75 +11004,6 @@
|
||||
el.setAttribute("allowfullscreen", "true");
|
||||
return el;
|
||||
}
|
||||
}, {
|
||||
key: 'MediaCrush',
|
||||
regExp: /^\w+:\/\/(?:www\.)?mediacru\.sh\/([\w\-]+)/,
|
||||
style: '',
|
||||
el: function(a) {
|
||||
var el;
|
||||
el = $.el('div');
|
||||
$.queueTask(function() {
|
||||
return $.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
|
||||
var embed, ext, file, files, i, k, len1, len2, len3, q, ref, ref1, status, type, u;
|
||||
if (!doc.contains(el)) {
|
||||
return;
|
||||
}
|
||||
status = this.status;
|
||||
if (status !== 200 && status !== 304) {
|
||||
return el.textContent = "ERROR " + status;
|
||||
}
|
||||
files = this.response.files;
|
||||
ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
type = ref[k];
|
||||
for (q = 0, len2 = files.length; q < len2; q++) {
|
||||
file = files[q];
|
||||
if (file.type === type) {
|
||||
embed = file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (embed) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!embed) {
|
||||
return el.textContent = "ERROR: Not a valid filetype";
|
||||
}
|
||||
switch (embed.type) {
|
||||
case 'video/mp4':
|
||||
case 'video/webm':
|
||||
case 'video/ogv':
|
||||
$.extend(el, {
|
||||
innerHTML: "<video controls loop style=\"max-width: 80vw; max-height: 80vh;\"><source type=\"video/mp4\"><source type=\"video/webm\"></video>"
|
||||
});
|
||||
ref1 = ['mp4', 'webm'];
|
||||
for (i = u = 0, len3 = ref1.length; u < len3; i = ++u) {
|
||||
ext = ref1[i];
|
||||
el.firstChild.children[i].src = "https://mediacru.sh/" + a.dataset.uid + "." + ext;
|
||||
}
|
||||
break;
|
||||
case 'image/svg+xml':
|
||||
case 'image/png':
|
||||
case 'image/gif':
|
||||
case 'image/jpeg':
|
||||
$.extend(el, {
|
||||
innerHTML: "<a target=\"_blank\" href=\"" + E(a.dataset.href) + "\"><img src=\"https://mediacru.sh/" + E(file.file) + "\" style=\"max-width: 80vw; max-height: 80vh;\"></a>"
|
||||
});
|
||||
break;
|
||||
case 'audio/mpeg':
|
||||
case 'audio/ogg':
|
||||
$.extend(el, {
|
||||
innerHTML: "<audio controls><source type=\"audio/ogg\" src=\"https://mediacru.sh/" + E(a.dataset.uid) + ".ogg\"></audio>"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
el.textContent = "ERROR: No valid filetype.";
|
||||
}
|
||||
});
|
||||
});
|
||||
return el;
|
||||
}
|
||||
}, {
|
||||
key: 'Pastebin',
|
||||
regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
|
||||
@ -11112,11 +11043,10 @@
|
||||
}, {
|
||||
key: 'StrawPoll',
|
||||
regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
|
||||
httpOnly: true,
|
||||
style: 'border: 0; width: 600px; height: 406px;',
|
||||
el: function(a) {
|
||||
return $.el('iframe', {
|
||||
src: "http://strawpoll.me/embed_1/" + a.dataset.uid
|
||||
src: "//strawpoll.me/embed_1/" + a.dataset.uid
|
||||
});
|
||||
}
|
||||
}, {
|
||||
@ -11229,7 +11159,7 @@
|
||||
}
|
||||
}, {
|
||||
key: 'Loopvid',
|
||||
regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/((?:pf|kd|lv|mc|gd|gh|db|nn)\/[\w\-]+(,[\w\-]+)*|fc\/\w+\/\d+)/,
|
||||
regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
|
||||
style: 'max-width: 80vw; max-height: 80vh;',
|
||||
el: function(a) {
|
||||
var _, base, el, host, k, len1, len2, name, names, q, ref, ref1, type, types, url;
|
||||
@ -11239,7 +11169,18 @@
|
||||
loop: true
|
||||
});
|
||||
ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
|
||||
types = host === 'gd' || host === 'fc' ? [''] : ['.webm', '.mp4'];
|
||||
types = (function() {
|
||||
switch (host) {
|
||||
case 'gd':
|
||||
case 'wu':
|
||||
case 'fc':
|
||||
return [''];
|
||||
case 'gc':
|
||||
return ['giant', 'fat', 'zippy'];
|
||||
default:
|
||||
return ['.webm', '.mp4'];
|
||||
}
|
||||
})();
|
||||
ref1 = names.split(',');
|
||||
for (k = 0, len1 = ref1.length; k < len1; k++) {
|
||||
name = ref1[k];
|
||||
@ -11249,23 +11190,33 @@
|
||||
url = (function() {
|
||||
switch (host) {
|
||||
case 'pf':
|
||||
return "http://a.pomf.se/" + base;
|
||||
return "https://a.pomf.se/" + base;
|
||||
case 'kd':
|
||||
return "http://kastden.org/loopvid/" + base;
|
||||
return "http://2.kastden.org/loopvid/" + base;
|
||||
case 'lv':
|
||||
return "http://loopvid.mooo.com/videos/" + base;
|
||||
case 'mc':
|
||||
return "https://cdn.mediacru.sh/" + base;
|
||||
case 'gd':
|
||||
return "https://docs.google.com/uc?export=download&id=" + base;
|
||||
case 'gh':
|
||||
return "https://googledrive.com/host/" + base;
|
||||
case 'db':
|
||||
return "https://googledrive.com/host/" + base;
|
||||
case 'fc':
|
||||
return "//i.4cdn.org/" + base + ".webm";
|
||||
return "https://dl.dropboxusercontent.com/u/" + base;
|
||||
case 'dx':
|
||||
return "https://dl.dropboxusercontent.com/" + base;
|
||||
case 'nn':
|
||||
return "http://naenara.eu/loopvids/" + base;
|
||||
case 'cp':
|
||||
return "https://copy.com/" + base;
|
||||
case 'wu':
|
||||
return "http://webmup.com/" + base + "/vid.webm";
|
||||
case 'ig':
|
||||
return "https://i.imgur.com/" + base;
|
||||
case 'ky':
|
||||
return "https://kiyo.me/" + base;
|
||||
case 'fc':
|
||||
return "//i.4cdn.org/" + base + ".webm";
|
||||
case 'gc':
|
||||
return "https://" + type + ".gfycat.com/" + name + ".webm";
|
||||
}
|
||||
})();
|
||||
$.add(el, $.el('source', {
|
||||
@ -11813,16 +11764,17 @@
|
||||
},
|
||||
node: function() {
|
||||
MarkNewIPs.ipCount = this.ipCount;
|
||||
MarkNewIPs.postCount = this.posts.keys.length;
|
||||
return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
|
||||
},
|
||||
onUpdate: function(e) {
|
||||
var deletedPosts, fullID, i, ipCount, k, len1, len2, newPosts, q, ref;
|
||||
ref = e.detail, ipCount = ref.ipCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
|
||||
var deletedPosts, fullID, i, ipCount, k, len1, len2, newPosts, postCount, q, ref;
|
||||
ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
|
||||
if (ipCount == null) {
|
||||
return;
|
||||
}
|
||||
switch (ipCount - MarkNewIPs.ipCount) {
|
||||
case newPosts.length:
|
||||
case postCount - MarkNewIPs.postCount + deletedPosts.length:
|
||||
i = MarkNewIPs.ipCount;
|
||||
for (k = 0, len1 = newPosts.length; k < len1; k++) {
|
||||
fullID = newPosts[k];
|
||||
@ -11835,7 +11787,8 @@
|
||||
MarkNewIPs.markOld(g.posts[fullID]);
|
||||
}
|
||||
}
|
||||
return MarkNewIPs.ipCount = ipCount;
|
||||
MarkNewIPs.ipCount = ipCount;
|
||||
return MarkNewIPs.postCount = postCount;
|
||||
},
|
||||
markNew: function(post, ipCount) {
|
||||
var counter, suffix;
|
||||
@ -12348,11 +12301,11 @@
|
||||
if (ID <= lastPost) {
|
||||
continue;
|
||||
}
|
||||
newPosts.push(board + "." + ID);
|
||||
if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
|
||||
post.resurrect();
|
||||
continue;
|
||||
}
|
||||
newPosts.push(board + "." + ID);
|
||||
node = Build.postFromObject(postObject, board.ID);
|
||||
posts.push(new Post(node, thread, board));
|
||||
if (ThreadUpdater.postID === ID) {
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X
|
||||
// @version 1.10.4.3
|
||||
// @version 1.10.4.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Generated by CoffeeScript
|
||||
// ==UserScript==
|
||||
// @name 4chan X
|
||||
// @version 1.10.4.3
|
||||
// @version 1.10.4.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
@ -395,7 +395,7 @@
|
||||
doc = d.documentElement;
|
||||
|
||||
g = {
|
||||
VERSION: '1.10.4.3',
|
||||
VERSION: '1.10.4.4',
|
||||
NAMESPACE: '4chan X.',
|
||||
NAME: '4chan X',
|
||||
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
|
||||
@ -11005,75 +11005,6 @@
|
||||
el.setAttribute("allowfullscreen", "true");
|
||||
return el;
|
||||
}
|
||||
}, {
|
||||
key: 'MediaCrush',
|
||||
regExp: /^\w+:\/\/(?:www\.)?mediacru\.sh\/([\w\-]+)/,
|
||||
style: '',
|
||||
el: function(a) {
|
||||
var el;
|
||||
el = $.el('div');
|
||||
$.queueTask(function() {
|
||||
return $.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
|
||||
var embed, ext, file, files, i, k, len1, len2, len3, q, ref, ref1, status, type, u;
|
||||
if (!doc.contains(el)) {
|
||||
return;
|
||||
}
|
||||
status = this.status;
|
||||
if (status !== 200 && status !== 304) {
|
||||
return el.textContent = "ERROR " + status;
|
||||
}
|
||||
files = this.response.files;
|
||||
ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
type = ref[k];
|
||||
for (q = 0, len2 = files.length; q < len2; q++) {
|
||||
file = files[q];
|
||||
if (file.type === type) {
|
||||
embed = file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (embed) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!embed) {
|
||||
return el.textContent = "ERROR: Not a valid filetype";
|
||||
}
|
||||
switch (embed.type) {
|
||||
case 'video/mp4':
|
||||
case 'video/webm':
|
||||
case 'video/ogv':
|
||||
$.extend(el, {
|
||||
innerHTML: "<video controls loop style=\"max-width: 80vw; max-height: 80vh;\"><source type=\"video/mp4\"><source type=\"video/webm\"></video>"
|
||||
});
|
||||
ref1 = ['mp4', 'webm'];
|
||||
for (i = u = 0, len3 = ref1.length; u < len3; i = ++u) {
|
||||
ext = ref1[i];
|
||||
el.firstChild.children[i].src = "https://mediacru.sh/" + a.dataset.uid + "." + ext;
|
||||
}
|
||||
break;
|
||||
case 'image/svg+xml':
|
||||
case 'image/png':
|
||||
case 'image/gif':
|
||||
case 'image/jpeg':
|
||||
$.extend(el, {
|
||||
innerHTML: "<a target=\"_blank\" href=\"" + E(a.dataset.href) + "\"><img src=\"https://mediacru.sh/" + E(file.file) + "\" style=\"max-width: 80vw; max-height: 80vh;\"></a>"
|
||||
});
|
||||
break;
|
||||
case 'audio/mpeg':
|
||||
case 'audio/ogg':
|
||||
$.extend(el, {
|
||||
innerHTML: "<audio controls><source type=\"audio/ogg\" src=\"https://mediacru.sh/" + E(a.dataset.uid) + ".ogg\"></audio>"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
el.textContent = "ERROR: No valid filetype.";
|
||||
}
|
||||
});
|
||||
});
|
||||
return el;
|
||||
}
|
||||
}, {
|
||||
key: 'Pastebin',
|
||||
regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
|
||||
@ -11113,11 +11044,10 @@
|
||||
}, {
|
||||
key: 'StrawPoll',
|
||||
regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
|
||||
httpOnly: true,
|
||||
style: 'border: 0; width: 600px; height: 406px;',
|
||||
el: function(a) {
|
||||
return $.el('iframe', {
|
||||
src: "http://strawpoll.me/embed_1/" + a.dataset.uid
|
||||
src: "//strawpoll.me/embed_1/" + a.dataset.uid
|
||||
});
|
||||
}
|
||||
}, {
|
||||
@ -11230,7 +11160,7 @@
|
||||
}
|
||||
}, {
|
||||
key: 'Loopvid',
|
||||
regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/((?:pf|kd|lv|mc|gd|gh|db|nn)\/[\w\-]+(,[\w\-]+)*|fc\/\w+\/\d+)/,
|
||||
regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
|
||||
style: 'max-width: 80vw; max-height: 80vh;',
|
||||
el: function(a) {
|
||||
var _, base, el, host, k, len1, len2, name, names, q, ref, ref1, type, types, url;
|
||||
@ -11240,7 +11170,18 @@
|
||||
loop: true
|
||||
});
|
||||
ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
|
||||
types = host === 'gd' || host === 'fc' ? [''] : ['.webm', '.mp4'];
|
||||
types = (function() {
|
||||
switch (host) {
|
||||
case 'gd':
|
||||
case 'wu':
|
||||
case 'fc':
|
||||
return [''];
|
||||
case 'gc':
|
||||
return ['giant', 'fat', 'zippy'];
|
||||
default:
|
||||
return ['.webm', '.mp4'];
|
||||
}
|
||||
})();
|
||||
ref1 = names.split(',');
|
||||
for (k = 0, len1 = ref1.length; k < len1; k++) {
|
||||
name = ref1[k];
|
||||
@ -11250,23 +11191,33 @@
|
||||
url = (function() {
|
||||
switch (host) {
|
||||
case 'pf':
|
||||
return "http://a.pomf.se/" + base;
|
||||
return "https://a.pomf.se/" + base;
|
||||
case 'kd':
|
||||
return "http://kastden.org/loopvid/" + base;
|
||||
return "http://2.kastden.org/loopvid/" + base;
|
||||
case 'lv':
|
||||
return "http://loopvid.mooo.com/videos/" + base;
|
||||
case 'mc':
|
||||
return "https://cdn.mediacru.sh/" + base;
|
||||
case 'gd':
|
||||
return "https://docs.google.com/uc?export=download&id=" + base;
|
||||
case 'gh':
|
||||
return "https://googledrive.com/host/" + base;
|
||||
case 'db':
|
||||
return "https://googledrive.com/host/" + base;
|
||||
case 'fc':
|
||||
return "//i.4cdn.org/" + base + ".webm";
|
||||
return "https://dl.dropboxusercontent.com/u/" + base;
|
||||
case 'dx':
|
||||
return "https://dl.dropboxusercontent.com/" + base;
|
||||
case 'nn':
|
||||
return "http://naenara.eu/loopvids/" + base;
|
||||
case 'cp':
|
||||
return "https://copy.com/" + base;
|
||||
case 'wu':
|
||||
return "http://webmup.com/" + base + "/vid.webm";
|
||||
case 'ig':
|
||||
return "https://i.imgur.com/" + base;
|
||||
case 'ky':
|
||||
return "https://kiyo.me/" + base;
|
||||
case 'fc':
|
||||
return "//i.4cdn.org/" + base + ".webm";
|
||||
case 'gc':
|
||||
return "https://" + type + ".gfycat.com/" + name + ".webm";
|
||||
}
|
||||
})();
|
||||
$.add(el, $.el('source', {
|
||||
@ -11814,16 +11765,17 @@
|
||||
},
|
||||
node: function() {
|
||||
MarkNewIPs.ipCount = this.ipCount;
|
||||
MarkNewIPs.postCount = this.posts.keys.length;
|
||||
return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
|
||||
},
|
||||
onUpdate: function(e) {
|
||||
var deletedPosts, fullID, i, ipCount, k, len1, len2, newPosts, q, ref;
|
||||
ref = e.detail, ipCount = ref.ipCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
|
||||
var deletedPosts, fullID, i, ipCount, k, len1, len2, newPosts, postCount, q, ref;
|
||||
ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
|
||||
if (ipCount == null) {
|
||||
return;
|
||||
}
|
||||
switch (ipCount - MarkNewIPs.ipCount) {
|
||||
case newPosts.length:
|
||||
case postCount - MarkNewIPs.postCount + deletedPosts.length:
|
||||
i = MarkNewIPs.ipCount;
|
||||
for (k = 0, len1 = newPosts.length; k < len1; k++) {
|
||||
fullID = newPosts[k];
|
||||
@ -11836,7 +11788,8 @@
|
||||
MarkNewIPs.markOld(g.posts[fullID]);
|
||||
}
|
||||
}
|
||||
return MarkNewIPs.ipCount = ipCount;
|
||||
MarkNewIPs.ipCount = ipCount;
|
||||
return MarkNewIPs.postCount = postCount;
|
||||
},
|
||||
markNew: function(post, ipCount) {
|
||||
var counter, suffix;
|
||||
@ -12349,11 +12302,11 @@
|
||||
if (ID <= lastPost) {
|
||||
continue;
|
||||
}
|
||||
newPosts.push(board + "." + ID);
|
||||
if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
|
||||
post.resurrect();
|
||||
continue;
|
||||
}
|
||||
newPosts.push(board + "." + ID);
|
||||
node = Build.postFromObject(postObject, board.ID);
|
||||
posts.push(new Post(node, thread, board));
|
||||
if (ThreadUpdater.postID === ID) {
|
||||
|
||||
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.10.4.3' />
|
||||
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.10.4.4' />
|
||||
</app>
|
||||
</gupdate>
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.10.4.3' />
|
||||
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.10.4.4' />
|
||||
</app>
|
||||
</gupdate>
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
||||
"meta": {
|
||||
"name": "4chan X",
|
||||
"version": "1.10.4.3",
|
||||
"date": "2015-03-11T06:53:35.481Z",
|
||||
"version": "1.10.4.4",
|
||||
"date": "2015-03-14T02:01:27.291Z",
|
||||
"repo": "https://github.com/ccd0/4chan-x/",
|
||||
"page": "https://github.com/ccd0/4chan-x",
|
||||
"downloads": "https://ccd0.github.io/4chan-x/builds/",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user