Release 4chan X v1.13.2.0.
This commit is contained in:
parent
4c33ff2142
commit
9c2b64ea84
10
CHANGELOG.md
10
CHANGELOG.md
@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
-Sometimes the changelog has notes (not comprehensive) acknowledging people's work. This does not mean the changes are their fault, only that their code was used. All changes to the script are chosen by and the fault of the maintainer (ccd0).
|
-Sometimes the changelog has notes (not comprehensive) acknowledging people's work. This does not mean the changes are their fault, only that their code was used. All changes to the script are chosen by and the fault of the maintainer (ccd0).
|
||||||
|
|
||||||
|
### v1.13.2
|
||||||
|
|
||||||
|
**v1.13.2.0** *(2016-11-27)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.2.0/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.2.0/builds/4chan-X-noupdate.crx)]
|
||||||
|
- Based on v1.13.1.12.
|
||||||
|
- (ihavenoface) Add `Cover Preview` function: Show preview of supported links on hover.
|
||||||
|
- Currently supported: Youtube and Dailymotion.
|
||||||
|
- (ihavenoface) Keep floating embeds visible while moving the window.
|
||||||
|
- Various embedding-related bugfixes, including performance issue from v1.13.0.0 when switching to catalog.
|
||||||
|
- Make floating updater draggable by any edge so it doesn't get stuck at the top. #1031
|
||||||
|
|
||||||
### v1.13.1
|
### v1.13.1
|
||||||
|
|
||||||
**v1.13.1.12** *(2016-11-27)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.1.12/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.1.12/builds/4chan-X-noupdate.crx)]
|
**v1.13.1.12** *(2016-11-27)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.1.12/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.1.12/builds/4chan-X-noupdate.crx)]
|
||||||
|
|||||||
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X beta
|
// @name 4chan X beta
|
||||||
// @version 1.13.1.12
|
// @version 1.13.2.0
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X beta
|
// @name 4chan X beta
|
||||||
// @version 1.13.1.12
|
// @version 1.13.2.0
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -147,7 +147,7 @@ docSet = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.13.1.12',
|
VERSION: '1.13.2.0',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
boards: {}
|
boards: {}
|
||||||
};
|
};
|
||||||
@ -224,6 +224,7 @@ Config = (function() {
|
|||||||
'Linkification': {
|
'Linkification': {
|
||||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||||
'Link Title': [true, 'Replace the link of a supported site with its actual title.', 1],
|
'Link Title': [true, 'Replace the link of a supported site with its actual title.', 1],
|
||||||
|
'Cover Preview': [true, 'Show preview of supported links on hover.', 1],
|
||||||
'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1],
|
'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1],
|
||||||
'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2],
|
'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2],
|
||||||
'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2]
|
'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2]
|
||||||
@ -2201,10 +2202,11 @@ span.hide-announcement {\n\
|
|||||||
}\n\
|
}\n\
|
||||||
#updater > .move {\n\
|
#updater > .move {\n\
|
||||||
position: absolute;\n\
|
position: absolute;\n\
|
||||||
left: 0;\n\
|
|
||||||
top: -5px;\n\
|
top: -5px;\n\
|
||||||
width: 100%;\n\
|
bottom: -5px;\n\
|
||||||
height: 5px;\n\
|
left: -5px;\n\
|
||||||
|
right: -5px;\n\
|
||||||
|
z-index: -1;\n\
|
||||||
}\n\
|
}\n\
|
||||||
#updater > div:last-child {\n\
|
#updater > div:last-child {\n\
|
||||||
text-align: center;\n\
|
text-align: center;\n\
|
||||||
@ -3203,9 +3205,7 @@ a:only-of-type > .remove {\n\
|
|||||||
cursor: text !important;\n\
|
cursor: text !important;\n\
|
||||||
}\n\
|
}\n\
|
||||||
/* Embedding */\n\
|
/* Embedding */\n\
|
||||||
.embedder:not(.embedded) > span,\n\
|
.embedder:not(.embedded) > span {\n\
|
||||||
:root.catalog-mode .embedder > span,\n\
|
|
||||||
:root.catalog-mode .board .media-embed {\n\
|
|
||||||
display: none;\n\
|
display: none;\n\
|
||||||
}\n\
|
}\n\
|
||||||
#embedding {\n\
|
#embedding {\n\
|
||||||
@ -6107,7 +6107,8 @@ Post = (function() {
|
|||||||
fileRoot: $('.file', post),
|
fileRoot: $('.file', post),
|
||||||
comment: $('.postMessage', post),
|
comment: $('.postMessage', post),
|
||||||
quotelinks: [],
|
quotelinks: [],
|
||||||
archivelinks: []
|
archivelinks: [],
|
||||||
|
embedlinks: []
|
||||||
};
|
};
|
||||||
if ($.engine === 'edge') {
|
if ($.engine === 'edge') {
|
||||||
Object.defineProperty(nodes, 'backlinks', {
|
Object.defineProperty(nodes, 'backlinks', {
|
||||||
@ -9294,6 +9295,7 @@ Index = (function() {
|
|||||||
if (!Conf['JSON Index']) {
|
if (!Conf['JSON Index']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.enabled = true;
|
||||||
Callbacks.Post.push({
|
Callbacks.Post.push({
|
||||||
name: 'Index Page Numbers',
|
name: 'Index Page Numbers',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
@ -13959,18 +13961,19 @@ Volume = (function() {
|
|||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
Embedding = (function() {
|
Embedding = (function() {
|
||||||
var Embedding;
|
var Embedding,
|
||||||
|
slice = [].slice;
|
||||||
|
|
||||||
Embedding = {
|
Embedding = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var j, len, ref, type;
|
var j, len, ref, ref1, type;
|
||||||
if (!(Conf['Embedding'] || Conf['Link Title'])) {
|
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Linkify'] && (Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview']))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.types = {};
|
this.types = {};
|
||||||
ref = this.ordered_types;
|
ref1 = this.ordered_types;
|
||||||
for (j = 0, len = ref.length; j < len; j++) {
|
for (j = 0, len = ref1.length; j < len; j++) {
|
||||||
type = ref[j];
|
type = ref1[j];
|
||||||
this.types[type.key] = type;
|
this.types[type.key] = type;
|
||||||
}
|
}
|
||||||
if (Conf['Embedding']) {
|
if (Conf['Embedding']) {
|
||||||
@ -13979,14 +13982,28 @@ Embedding = (function() {
|
|||||||
});
|
});
|
||||||
this.media = $('#media-embed', this.dialog);
|
this.media = $('#media-embed', this.dialog);
|
||||||
$.one(d, '4chanXInitFinished', this.ready);
|
$.one(d, '4chanXInitFinished', this.ready);
|
||||||
|
$.on(d, 'IndexRefreshInternal', function() {
|
||||||
|
return g.posts.forEach(function(post) {
|
||||||
|
var embed, k, l, len1, len2, ref2, ref3;
|
||||||
|
ref2 = [post].concat(slice.call(post.clones));
|
||||||
|
for (k = 0, len1 = ref2.length; k < len1; k++) {
|
||||||
|
post = ref2[k];
|
||||||
|
ref3 = post.nodes.embedlinks;
|
||||||
|
for (l = 0, len2 = ref3.length; l < len2; l++) {
|
||||||
|
embed = ref3[l];
|
||||||
|
Embedding.cb.catalogRemove.call(embed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (Conf['Link Title']) {
|
if (Conf['Link Title']) {
|
||||||
return $.on(d, '4chanXInitFinished PostsInserted', function() {
|
return $.on(d, '4chanXInitFinished PostsInserted', function() {
|
||||||
var key, ref1, ref2, service;
|
var key, ref2, ref3, service;
|
||||||
ref1 = Embedding.types;
|
ref2 = Embedding.types;
|
||||||
for (key in ref1) {
|
for (key in ref2) {
|
||||||
service = ref1[key];
|
service = ref2[key];
|
||||||
if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
|
if ((ref3 = service.title) != null ? ref3.batchSize : void 0) {
|
||||||
Embedding.flushTitles(service.title);
|
Embedding.flushTitles(service.title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13994,22 +14011,29 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
events: function(post) {
|
events: function(post) {
|
||||||
var el, i, items;
|
var data, el, i, items;
|
||||||
if (!Conf['Embedding']) {
|
if (Conf['Embedding']) {
|
||||||
return;
|
i = 0;
|
||||||
|
items = post.nodes.embedlinks = $$('.embedder', post.nodes.comment);
|
||||||
|
while (el = items[i++]) {
|
||||||
|
$.on(el, 'click', Embedding.cb.click);
|
||||||
|
if ($.hasClass(el, 'embedded')) {
|
||||||
|
Embedding.cb.toggle.call(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i = 0;
|
if (Conf['Cover Preview']) {
|
||||||
items = $$('.embedder', post.nodes.comment);
|
i = 0;
|
||||||
while (el = items[i++]) {
|
items = $$('.linkify', post.nodes.comment);
|
||||||
$.on(el, 'click', Embedding.cb.click);
|
while (el = items[i++]) {
|
||||||
if ($.hasClass(el, 'embedded')) {
|
data = Embedding.services(el);
|
||||||
Embedding.cb.toggle.call(el);
|
Embedding.preview(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
process: function(link, post) {
|
process: function(link, post) {
|
||||||
var data;
|
var data;
|
||||||
if (!(Conf['Embedding'] || Conf['Link Title'])) {
|
if (!(Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($.x('ancestor::pre', link)) {
|
if ($.x('ancestor::pre', link)) {
|
||||||
@ -14021,7 +14045,10 @@ Embedding = (function() {
|
|||||||
Embedding.embed(data);
|
Embedding.embed(data);
|
||||||
}
|
}
|
||||||
if (Conf['Link Title']) {
|
if (Conf['Link Title']) {
|
||||||
return Embedding.title(data);
|
Embedding.title(data);
|
||||||
|
}
|
||||||
|
if (Conf['Cover Preview']) {
|
||||||
|
return Embedding.preview(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -14042,7 +14069,7 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
embed: function(data) {
|
embed: function(data) {
|
||||||
var autoEmbed, embed, href, key, link, name, options, post, ref, uid, value;
|
var embed, href, key, link, name, options, post, ref, uid, value;
|
||||||
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
||||||
href = link.href;
|
href = link.href;
|
||||||
if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
|
if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
|
||||||
@ -14067,15 +14094,13 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
$.on(embed, 'click', Embedding.cb.click);
|
$.on(embed, 'click', Embedding.cb.click);
|
||||||
$.after(link, [$.tn(' '), embed]);
|
$.after(link, [$.tn(' '), embed]);
|
||||||
|
post.nodes.embedlinks.push(embed);
|
||||||
if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {
|
if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {
|
||||||
autoEmbed = function() {
|
if ($.hasClass(doc, 'catalog-mode')) {
|
||||||
if (doc.contains(embed) && !$.hasClass(doc, 'catalog-mode')) {
|
return $.addClass(embed, 'embed-removed');
|
||||||
$.off(d, 'PostsInserted', autoEmbed);
|
} else {
|
||||||
return Embedding.cb.toggle.call(embed);
|
return Embedding.cb.toggle.call(embed);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
$.on(d, 'PostsInserted', autoEmbed);
|
|
||||||
return autoEmbed();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ready: function() {
|
ready: function() {
|
||||||
@ -14103,12 +14128,12 @@ Embedding = (function() {
|
|||||||
if (Embedding.dragEmbed.mouseup) {
|
if (Embedding.dragEmbed.mouseup) {
|
||||||
$.off(d, 'mouseup', Embedding.dragEmbed);
|
$.off(d, 'mouseup', Embedding.dragEmbed);
|
||||||
Embedding.dragEmbed.mouseup = false;
|
Embedding.dragEmbed.mouseup = false;
|
||||||
style.visibility = '';
|
style.pointerEvents = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$.on(d, 'mouseup', Embedding.dragEmbed);
|
$.on(d, 'mouseup', Embedding.dragEmbed);
|
||||||
Embedding.dragEmbed.mouseup = true;
|
Embedding.dragEmbed.mouseup = true;
|
||||||
return style.visibility = 'hidden';
|
return style.pointerEvents = 'none';
|
||||||
},
|
},
|
||||||
title: function(data) {
|
title: function(data) {
|
||||||
var key, link, options, post, service, uid;
|
var key, link, options, post, service, uid;
|
||||||
@ -14167,11 +14192,35 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
preview: function(data) {
|
||||||
|
var key, link, service, uid;
|
||||||
|
key = data.key, uid = data.uid, link = data.link;
|
||||||
|
if (!(service = Embedding.types[key].preview)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return $.on(link, 'mouseover', function(e) {
|
||||||
|
var el, height, src;
|
||||||
|
src = service.url(uid);
|
||||||
|
height = service.height;
|
||||||
|
el = $.el('img', {
|
||||||
|
src: src,
|
||||||
|
id: 'ihover'
|
||||||
|
});
|
||||||
|
$.add(d.body, el);
|
||||||
|
return UI.hover({
|
||||||
|
root: link,
|
||||||
|
el: el,
|
||||||
|
latestEvent: e,
|
||||||
|
endEvents: 'mouseout click',
|
||||||
|
height: height
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
cb: {
|
cb: {
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
var div;
|
var div;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode')) {
|
if (!$.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode'))) {
|
||||||
if (!(div = Embedding.media.firstChild)) {
|
if (!(div = Embedding.media.firstChild)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -14199,6 +14248,14 @@ Embedding = (function() {
|
|||||||
el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
|
el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
|
catalogRemove: function() {
|
||||||
|
var isCatalog;
|
||||||
|
isCatalog = $.hasClass(doc, 'catalog-mode');
|
||||||
|
if ((isCatalog && $.hasClass(this, 'embedded')) || (!isCatalog && $.hasClass(this, 'embed-removed'))) {
|
||||||
|
Embedding.cb.toggle.call(this);
|
||||||
|
return $.toggleClass(this, 'embed-removed');
|
||||||
|
}
|
||||||
|
},
|
||||||
title: function(req, data) {
|
title: function(req, data) {
|
||||||
var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
|
var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
|
||||||
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
||||||
@ -14312,6 +14369,12 @@ Embedding = (function() {
|
|||||||
text: function(_) {
|
text: function(_) {
|
||||||
return _.title;
|
return _.title;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
preview: {
|
||||||
|
url: function(uid) {
|
||||||
|
return "https://www.dailymotion.com/thumbnail/video/" + uid;
|
||||||
|
},
|
||||||
|
height: 240
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'Gfycat',
|
key: 'Gfycat',
|
||||||
@ -14527,10 +14590,25 @@ Embedding = (function() {
|
|||||||
}, {
|
}, {
|
||||||
key: 'Twitter',
|
key: 'Twitter',
|
||||||
regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
|
regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
|
||||||
|
style: 'border: none; width: 550px; height: 250px; max-height: 80vh;',
|
||||||
el: function(a) {
|
el: function(a) {
|
||||||
return $.el('iframe', {
|
var el, onMessage;
|
||||||
src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
|
el = $.el('iframe');
|
||||||
|
$.on(el, 'load', function() {
|
||||||
|
return this.contentWindow.postMessage({
|
||||||
|
element: 't',
|
||||||
|
query: 'height'
|
||||||
|
}, 'https://twitframe.com');
|
||||||
});
|
});
|
||||||
|
onMessage = function(e) {
|
||||||
|
if (e.source === el.contentWindow && e.origin === 'https://twitframe.com') {
|
||||||
|
$.off(window, 'message', onMessage);
|
||||||
|
return el.style.height = (+e.data.height) + "px";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$.on(window, 'message', onMessage);
|
||||||
|
el.src = "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid;
|
||||||
|
return el;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'Vimeo',
|
key: 'Vimeo',
|
||||||
@ -14612,6 +14690,12 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
return 'Not Found';
|
return 'Not Found';
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
preview: {
|
||||||
|
url: function(uid) {
|
||||||
|
return "https://img.youtube.com/vi/" + uid + "/0.jpg";
|
||||||
|
},
|
||||||
|
height: 360
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -14685,6 +14769,9 @@ Linkify = (function() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (saved.parentElement.nodeName === "A" && !Linkify.regString.test(word)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
endNode = saved;
|
endNode = saved;
|
||||||
data = saved.data;
|
data = saved.data;
|
||||||
if (end = space.exec(data)) {
|
if (end = space.exec(data)) {
|
||||||
@ -17859,7 +17946,7 @@ ThreadUpdater = (function() {
|
|||||||
Header.addShortcut('updater', sc, 100);
|
Header.addShortcut('updater', sc, 100);
|
||||||
} else {
|
} else {
|
||||||
this.dialog = sc = UI.dialog('updater', {
|
this.dialog = sc = UI.dialog('updater', {
|
||||||
innerHTML: "<div class=\"move\"></div><span id=\"update-status\"></span><span id=\"update-timer\" title=\"Update now\"></span>"
|
innerHTML: "<div class=\"move\"></div><span id=\"update-status\" class=\"empty\"></span><span id=\"update-timer\" class=\"empty\" title=\"Update now\"></span>"
|
||||||
});
|
});
|
||||||
$.addClass(doc, 'float');
|
$.addClass(doc, 'float');
|
||||||
$.ready(function() {
|
$.ready(function() {
|
||||||
|
|||||||
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.13.1.12
|
// @version 1.13.2.0
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -147,7 +147,7 @@ docSet = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.13.1.12',
|
VERSION: '1.13.2.0',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
boards: {}
|
boards: {}
|
||||||
};
|
};
|
||||||
@ -224,6 +224,7 @@ Config = (function() {
|
|||||||
'Linkification': {
|
'Linkification': {
|
||||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||||
'Link Title': [true, 'Replace the link of a supported site with its actual title.', 1],
|
'Link Title': [true, 'Replace the link of a supported site with its actual title.', 1],
|
||||||
|
'Cover Preview': [true, 'Show preview of supported links on hover.', 1],
|
||||||
'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1],
|
'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1],
|
||||||
'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2],
|
'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2],
|
||||||
'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2]
|
'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2]
|
||||||
@ -2201,10 +2202,11 @@ span.hide-announcement {\n\
|
|||||||
}\n\
|
}\n\
|
||||||
#updater > .move {\n\
|
#updater > .move {\n\
|
||||||
position: absolute;\n\
|
position: absolute;\n\
|
||||||
left: 0;\n\
|
|
||||||
top: -5px;\n\
|
top: -5px;\n\
|
||||||
width: 100%;\n\
|
bottom: -5px;\n\
|
||||||
height: 5px;\n\
|
left: -5px;\n\
|
||||||
|
right: -5px;\n\
|
||||||
|
z-index: -1;\n\
|
||||||
}\n\
|
}\n\
|
||||||
#updater > div:last-child {\n\
|
#updater > div:last-child {\n\
|
||||||
text-align: center;\n\
|
text-align: center;\n\
|
||||||
@ -3203,9 +3205,7 @@ a:only-of-type > .remove {\n\
|
|||||||
cursor: text !important;\n\
|
cursor: text !important;\n\
|
||||||
}\n\
|
}\n\
|
||||||
/* Embedding */\n\
|
/* Embedding */\n\
|
||||||
.embedder:not(.embedded) > span,\n\
|
.embedder:not(.embedded) > span {\n\
|
||||||
:root.catalog-mode .embedder > span,\n\
|
|
||||||
:root.catalog-mode .board .media-embed {\n\
|
|
||||||
display: none;\n\
|
display: none;\n\
|
||||||
}\n\
|
}\n\
|
||||||
#embedding {\n\
|
#embedding {\n\
|
||||||
@ -6107,7 +6107,8 @@ Post = (function() {
|
|||||||
fileRoot: $('.file', post),
|
fileRoot: $('.file', post),
|
||||||
comment: $('.postMessage', post),
|
comment: $('.postMessage', post),
|
||||||
quotelinks: [],
|
quotelinks: [],
|
||||||
archivelinks: []
|
archivelinks: [],
|
||||||
|
embedlinks: []
|
||||||
};
|
};
|
||||||
if ($.engine === 'edge') {
|
if ($.engine === 'edge') {
|
||||||
Object.defineProperty(nodes, 'backlinks', {
|
Object.defineProperty(nodes, 'backlinks', {
|
||||||
@ -9294,6 +9295,7 @@ Index = (function() {
|
|||||||
if (!Conf['JSON Index']) {
|
if (!Conf['JSON Index']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.enabled = true;
|
||||||
Callbacks.Post.push({
|
Callbacks.Post.push({
|
||||||
name: 'Index Page Numbers',
|
name: 'Index Page Numbers',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
@ -13959,18 +13961,19 @@ Volume = (function() {
|
|||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
Embedding = (function() {
|
Embedding = (function() {
|
||||||
var Embedding;
|
var Embedding,
|
||||||
|
slice = [].slice;
|
||||||
|
|
||||||
Embedding = {
|
Embedding = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var j, len, ref, type;
|
var j, len, ref, ref1, type;
|
||||||
if (!(Conf['Embedding'] || Conf['Link Title'])) {
|
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Linkify'] && (Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview']))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.types = {};
|
this.types = {};
|
||||||
ref = this.ordered_types;
|
ref1 = this.ordered_types;
|
||||||
for (j = 0, len = ref.length; j < len; j++) {
|
for (j = 0, len = ref1.length; j < len; j++) {
|
||||||
type = ref[j];
|
type = ref1[j];
|
||||||
this.types[type.key] = type;
|
this.types[type.key] = type;
|
||||||
}
|
}
|
||||||
if (Conf['Embedding']) {
|
if (Conf['Embedding']) {
|
||||||
@ -13979,14 +13982,28 @@ Embedding = (function() {
|
|||||||
});
|
});
|
||||||
this.media = $('#media-embed', this.dialog);
|
this.media = $('#media-embed', this.dialog);
|
||||||
$.one(d, '4chanXInitFinished', this.ready);
|
$.one(d, '4chanXInitFinished', this.ready);
|
||||||
|
$.on(d, 'IndexRefreshInternal', function() {
|
||||||
|
return g.posts.forEach(function(post) {
|
||||||
|
var embed, k, l, len1, len2, ref2, ref3;
|
||||||
|
ref2 = [post].concat(slice.call(post.clones));
|
||||||
|
for (k = 0, len1 = ref2.length; k < len1; k++) {
|
||||||
|
post = ref2[k];
|
||||||
|
ref3 = post.nodes.embedlinks;
|
||||||
|
for (l = 0, len2 = ref3.length; l < len2; l++) {
|
||||||
|
embed = ref3[l];
|
||||||
|
Embedding.cb.catalogRemove.call(embed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (Conf['Link Title']) {
|
if (Conf['Link Title']) {
|
||||||
return $.on(d, '4chanXInitFinished PostsInserted', function() {
|
return $.on(d, '4chanXInitFinished PostsInserted', function() {
|
||||||
var key, ref1, ref2, service;
|
var key, ref2, ref3, service;
|
||||||
ref1 = Embedding.types;
|
ref2 = Embedding.types;
|
||||||
for (key in ref1) {
|
for (key in ref2) {
|
||||||
service = ref1[key];
|
service = ref2[key];
|
||||||
if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
|
if ((ref3 = service.title) != null ? ref3.batchSize : void 0) {
|
||||||
Embedding.flushTitles(service.title);
|
Embedding.flushTitles(service.title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13994,22 +14011,29 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
events: function(post) {
|
events: function(post) {
|
||||||
var el, i, items;
|
var data, el, i, items;
|
||||||
if (!Conf['Embedding']) {
|
if (Conf['Embedding']) {
|
||||||
return;
|
i = 0;
|
||||||
|
items = post.nodes.embedlinks = $$('.embedder', post.nodes.comment);
|
||||||
|
while (el = items[i++]) {
|
||||||
|
$.on(el, 'click', Embedding.cb.click);
|
||||||
|
if ($.hasClass(el, 'embedded')) {
|
||||||
|
Embedding.cb.toggle.call(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i = 0;
|
if (Conf['Cover Preview']) {
|
||||||
items = $$('.embedder', post.nodes.comment);
|
i = 0;
|
||||||
while (el = items[i++]) {
|
items = $$('.linkify', post.nodes.comment);
|
||||||
$.on(el, 'click', Embedding.cb.click);
|
while (el = items[i++]) {
|
||||||
if ($.hasClass(el, 'embedded')) {
|
data = Embedding.services(el);
|
||||||
Embedding.cb.toggle.call(el);
|
Embedding.preview(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
process: function(link, post) {
|
process: function(link, post) {
|
||||||
var data;
|
var data;
|
||||||
if (!(Conf['Embedding'] || Conf['Link Title'])) {
|
if (!(Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($.x('ancestor::pre', link)) {
|
if ($.x('ancestor::pre', link)) {
|
||||||
@ -14021,7 +14045,10 @@ Embedding = (function() {
|
|||||||
Embedding.embed(data);
|
Embedding.embed(data);
|
||||||
}
|
}
|
||||||
if (Conf['Link Title']) {
|
if (Conf['Link Title']) {
|
||||||
return Embedding.title(data);
|
Embedding.title(data);
|
||||||
|
}
|
||||||
|
if (Conf['Cover Preview']) {
|
||||||
|
return Embedding.preview(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -14042,7 +14069,7 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
embed: function(data) {
|
embed: function(data) {
|
||||||
var autoEmbed, embed, href, key, link, name, options, post, ref, uid, value;
|
var embed, href, key, link, name, options, post, ref, uid, value;
|
||||||
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
||||||
href = link.href;
|
href = link.href;
|
||||||
if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
|
if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
|
||||||
@ -14067,15 +14094,13 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
$.on(embed, 'click', Embedding.cb.click);
|
$.on(embed, 'click', Embedding.cb.click);
|
||||||
$.after(link, [$.tn(' '), embed]);
|
$.after(link, [$.tn(' '), embed]);
|
||||||
|
post.nodes.embedlinks.push(embed);
|
||||||
if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {
|
if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {
|
||||||
autoEmbed = function() {
|
if ($.hasClass(doc, 'catalog-mode')) {
|
||||||
if (doc.contains(embed) && !$.hasClass(doc, 'catalog-mode')) {
|
return $.addClass(embed, 'embed-removed');
|
||||||
$.off(d, 'PostsInserted', autoEmbed);
|
} else {
|
||||||
return Embedding.cb.toggle.call(embed);
|
return Embedding.cb.toggle.call(embed);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
$.on(d, 'PostsInserted', autoEmbed);
|
|
||||||
return autoEmbed();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ready: function() {
|
ready: function() {
|
||||||
@ -14103,12 +14128,12 @@ Embedding = (function() {
|
|||||||
if (Embedding.dragEmbed.mouseup) {
|
if (Embedding.dragEmbed.mouseup) {
|
||||||
$.off(d, 'mouseup', Embedding.dragEmbed);
|
$.off(d, 'mouseup', Embedding.dragEmbed);
|
||||||
Embedding.dragEmbed.mouseup = false;
|
Embedding.dragEmbed.mouseup = false;
|
||||||
style.visibility = '';
|
style.pointerEvents = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$.on(d, 'mouseup', Embedding.dragEmbed);
|
$.on(d, 'mouseup', Embedding.dragEmbed);
|
||||||
Embedding.dragEmbed.mouseup = true;
|
Embedding.dragEmbed.mouseup = true;
|
||||||
return style.visibility = 'hidden';
|
return style.pointerEvents = 'none';
|
||||||
},
|
},
|
||||||
title: function(data) {
|
title: function(data) {
|
||||||
var key, link, options, post, service, uid;
|
var key, link, options, post, service, uid;
|
||||||
@ -14167,11 +14192,35 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
preview: function(data) {
|
||||||
|
var key, link, service, uid;
|
||||||
|
key = data.key, uid = data.uid, link = data.link;
|
||||||
|
if (!(service = Embedding.types[key].preview)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return $.on(link, 'mouseover', function(e) {
|
||||||
|
var el, height, src;
|
||||||
|
src = service.url(uid);
|
||||||
|
height = service.height;
|
||||||
|
el = $.el('img', {
|
||||||
|
src: src,
|
||||||
|
id: 'ihover'
|
||||||
|
});
|
||||||
|
$.add(d.body, el);
|
||||||
|
return UI.hover({
|
||||||
|
root: link,
|
||||||
|
el: el,
|
||||||
|
latestEvent: e,
|
||||||
|
endEvents: 'mouseout click',
|
||||||
|
height: height
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
cb: {
|
cb: {
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
var div;
|
var div;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode')) {
|
if (!$.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode'))) {
|
||||||
if (!(div = Embedding.media.firstChild)) {
|
if (!(div = Embedding.media.firstChild)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -14199,6 +14248,14 @@ Embedding = (function() {
|
|||||||
el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
|
el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
|
catalogRemove: function() {
|
||||||
|
var isCatalog;
|
||||||
|
isCatalog = $.hasClass(doc, 'catalog-mode');
|
||||||
|
if ((isCatalog && $.hasClass(this, 'embedded')) || (!isCatalog && $.hasClass(this, 'embed-removed'))) {
|
||||||
|
Embedding.cb.toggle.call(this);
|
||||||
|
return $.toggleClass(this, 'embed-removed');
|
||||||
|
}
|
||||||
|
},
|
||||||
title: function(req, data) {
|
title: function(req, data) {
|
||||||
var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
|
var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
|
||||||
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
||||||
@ -14312,6 +14369,12 @@ Embedding = (function() {
|
|||||||
text: function(_) {
|
text: function(_) {
|
||||||
return _.title;
|
return _.title;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
preview: {
|
||||||
|
url: function(uid) {
|
||||||
|
return "https://www.dailymotion.com/thumbnail/video/" + uid;
|
||||||
|
},
|
||||||
|
height: 240
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'Gfycat',
|
key: 'Gfycat',
|
||||||
@ -14527,10 +14590,25 @@ Embedding = (function() {
|
|||||||
}, {
|
}, {
|
||||||
key: 'Twitter',
|
key: 'Twitter',
|
||||||
regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
|
regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
|
||||||
|
style: 'border: none; width: 550px; height: 250px; max-height: 80vh;',
|
||||||
el: function(a) {
|
el: function(a) {
|
||||||
return $.el('iframe', {
|
var el, onMessage;
|
||||||
src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
|
el = $.el('iframe');
|
||||||
|
$.on(el, 'load', function() {
|
||||||
|
return this.contentWindow.postMessage({
|
||||||
|
element: 't',
|
||||||
|
query: 'height'
|
||||||
|
}, 'https://twitframe.com');
|
||||||
});
|
});
|
||||||
|
onMessage = function(e) {
|
||||||
|
if (e.source === el.contentWindow && e.origin === 'https://twitframe.com') {
|
||||||
|
$.off(window, 'message', onMessage);
|
||||||
|
return el.style.height = (+e.data.height) + "px";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$.on(window, 'message', onMessage);
|
||||||
|
el.src = "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid;
|
||||||
|
return el;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'Vimeo',
|
key: 'Vimeo',
|
||||||
@ -14612,6 +14690,12 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
return 'Not Found';
|
return 'Not Found';
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
preview: {
|
||||||
|
url: function(uid) {
|
||||||
|
return "https://img.youtube.com/vi/" + uid + "/0.jpg";
|
||||||
|
},
|
||||||
|
height: 360
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -14685,6 +14769,9 @@ Linkify = (function() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (saved.parentElement.nodeName === "A" && !Linkify.regString.test(word)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
endNode = saved;
|
endNode = saved;
|
||||||
data = saved.data;
|
data = saved.data;
|
||||||
if (end = space.exec(data)) {
|
if (end = space.exec(data)) {
|
||||||
@ -17859,7 +17946,7 @@ ThreadUpdater = (function() {
|
|||||||
Header.addShortcut('updater', sc, 100);
|
Header.addShortcut('updater', sc, 100);
|
||||||
} else {
|
} else {
|
||||||
this.dialog = sc = UI.dialog('updater', {
|
this.dialog = sc = UI.dialog('updater', {
|
||||||
innerHTML: "<div class=\"move\"></div><span id=\"update-status\"></span><span id=\"update-timer\" title=\"Update now\"></span>"
|
innerHTML: "<div class=\"move\"></div><span id=\"update-status\" class=\"empty\"></span><span id=\"update-timer\" class=\"empty\" title=\"Update now\"></span>"
|
||||||
});
|
});
|
||||||
$.addClass(doc, 'float');
|
$.addClass(doc, 'float');
|
||||||
$.ready(function() {
|
$.ready(function() {
|
||||||
|
|||||||
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.13.1.12
|
// @version 1.13.2.0
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.13.1.12
|
// @version 1.13.2.0
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -147,7 +147,7 @@ docSet = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.13.1.12',
|
VERSION: '1.13.2.0',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
boards: {}
|
boards: {}
|
||||||
};
|
};
|
||||||
@ -224,6 +224,7 @@ Config = (function() {
|
|||||||
'Linkification': {
|
'Linkification': {
|
||||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||||
'Link Title': [true, 'Replace the link of a supported site with its actual title.', 1],
|
'Link Title': [true, 'Replace the link of a supported site with its actual title.', 1],
|
||||||
|
'Cover Preview': [true, 'Show preview of supported links on hover.', 1],
|
||||||
'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1],
|
'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1],
|
||||||
'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2],
|
'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2],
|
||||||
'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2]
|
'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2]
|
||||||
@ -2201,10 +2202,11 @@ span.hide-announcement {\n\
|
|||||||
}\n\
|
}\n\
|
||||||
#updater > .move {\n\
|
#updater > .move {\n\
|
||||||
position: absolute;\n\
|
position: absolute;\n\
|
||||||
left: 0;\n\
|
|
||||||
top: -5px;\n\
|
top: -5px;\n\
|
||||||
width: 100%;\n\
|
bottom: -5px;\n\
|
||||||
height: 5px;\n\
|
left: -5px;\n\
|
||||||
|
right: -5px;\n\
|
||||||
|
z-index: -1;\n\
|
||||||
}\n\
|
}\n\
|
||||||
#updater > div:last-child {\n\
|
#updater > div:last-child {\n\
|
||||||
text-align: center;\n\
|
text-align: center;\n\
|
||||||
@ -3203,9 +3205,7 @@ a:only-of-type > .remove {\n\
|
|||||||
cursor: text !important;\n\
|
cursor: text !important;\n\
|
||||||
}\n\
|
}\n\
|
||||||
/* Embedding */\n\
|
/* Embedding */\n\
|
||||||
.embedder:not(.embedded) > span,\n\
|
.embedder:not(.embedded) > span {\n\
|
||||||
:root.catalog-mode .embedder > span,\n\
|
|
||||||
:root.catalog-mode .board .media-embed {\n\
|
|
||||||
display: none;\n\
|
display: none;\n\
|
||||||
}\n\
|
}\n\
|
||||||
#embedding {\n\
|
#embedding {\n\
|
||||||
@ -6107,7 +6107,8 @@ Post = (function() {
|
|||||||
fileRoot: $('.file', post),
|
fileRoot: $('.file', post),
|
||||||
comment: $('.postMessage', post),
|
comment: $('.postMessage', post),
|
||||||
quotelinks: [],
|
quotelinks: [],
|
||||||
archivelinks: []
|
archivelinks: [],
|
||||||
|
embedlinks: []
|
||||||
};
|
};
|
||||||
if ($.engine === 'edge') {
|
if ($.engine === 'edge') {
|
||||||
Object.defineProperty(nodes, 'backlinks', {
|
Object.defineProperty(nodes, 'backlinks', {
|
||||||
@ -9294,6 +9295,7 @@ Index = (function() {
|
|||||||
if (!Conf['JSON Index']) {
|
if (!Conf['JSON Index']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.enabled = true;
|
||||||
Callbacks.Post.push({
|
Callbacks.Post.push({
|
||||||
name: 'Index Page Numbers',
|
name: 'Index Page Numbers',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
@ -13959,18 +13961,19 @@ Volume = (function() {
|
|||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
Embedding = (function() {
|
Embedding = (function() {
|
||||||
var Embedding;
|
var Embedding,
|
||||||
|
slice = [].slice;
|
||||||
|
|
||||||
Embedding = {
|
Embedding = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var j, len, ref, type;
|
var j, len, ref, ref1, type;
|
||||||
if (!(Conf['Embedding'] || Conf['Link Title'])) {
|
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Linkify'] && (Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview']))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.types = {};
|
this.types = {};
|
||||||
ref = this.ordered_types;
|
ref1 = this.ordered_types;
|
||||||
for (j = 0, len = ref.length; j < len; j++) {
|
for (j = 0, len = ref1.length; j < len; j++) {
|
||||||
type = ref[j];
|
type = ref1[j];
|
||||||
this.types[type.key] = type;
|
this.types[type.key] = type;
|
||||||
}
|
}
|
||||||
if (Conf['Embedding']) {
|
if (Conf['Embedding']) {
|
||||||
@ -13979,14 +13982,28 @@ Embedding = (function() {
|
|||||||
});
|
});
|
||||||
this.media = $('#media-embed', this.dialog);
|
this.media = $('#media-embed', this.dialog);
|
||||||
$.one(d, '4chanXInitFinished', this.ready);
|
$.one(d, '4chanXInitFinished', this.ready);
|
||||||
|
$.on(d, 'IndexRefreshInternal', function() {
|
||||||
|
return g.posts.forEach(function(post) {
|
||||||
|
var embed, k, l, len1, len2, ref2, ref3;
|
||||||
|
ref2 = [post].concat(slice.call(post.clones));
|
||||||
|
for (k = 0, len1 = ref2.length; k < len1; k++) {
|
||||||
|
post = ref2[k];
|
||||||
|
ref3 = post.nodes.embedlinks;
|
||||||
|
for (l = 0, len2 = ref3.length; l < len2; l++) {
|
||||||
|
embed = ref3[l];
|
||||||
|
Embedding.cb.catalogRemove.call(embed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (Conf['Link Title']) {
|
if (Conf['Link Title']) {
|
||||||
return $.on(d, '4chanXInitFinished PostsInserted', function() {
|
return $.on(d, '4chanXInitFinished PostsInserted', function() {
|
||||||
var key, ref1, ref2, service;
|
var key, ref2, ref3, service;
|
||||||
ref1 = Embedding.types;
|
ref2 = Embedding.types;
|
||||||
for (key in ref1) {
|
for (key in ref2) {
|
||||||
service = ref1[key];
|
service = ref2[key];
|
||||||
if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
|
if ((ref3 = service.title) != null ? ref3.batchSize : void 0) {
|
||||||
Embedding.flushTitles(service.title);
|
Embedding.flushTitles(service.title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13994,22 +14011,29 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
events: function(post) {
|
events: function(post) {
|
||||||
var el, i, items;
|
var data, el, i, items;
|
||||||
if (!Conf['Embedding']) {
|
if (Conf['Embedding']) {
|
||||||
return;
|
i = 0;
|
||||||
|
items = post.nodes.embedlinks = $$('.embedder', post.nodes.comment);
|
||||||
|
while (el = items[i++]) {
|
||||||
|
$.on(el, 'click', Embedding.cb.click);
|
||||||
|
if ($.hasClass(el, 'embedded')) {
|
||||||
|
Embedding.cb.toggle.call(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i = 0;
|
if (Conf['Cover Preview']) {
|
||||||
items = $$('.embedder', post.nodes.comment);
|
i = 0;
|
||||||
while (el = items[i++]) {
|
items = $$('.linkify', post.nodes.comment);
|
||||||
$.on(el, 'click', Embedding.cb.click);
|
while (el = items[i++]) {
|
||||||
if ($.hasClass(el, 'embedded')) {
|
data = Embedding.services(el);
|
||||||
Embedding.cb.toggle.call(el);
|
Embedding.preview(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
process: function(link, post) {
|
process: function(link, post) {
|
||||||
var data;
|
var data;
|
||||||
if (!(Conf['Embedding'] || Conf['Link Title'])) {
|
if (!(Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($.x('ancestor::pre', link)) {
|
if ($.x('ancestor::pre', link)) {
|
||||||
@ -14021,7 +14045,10 @@ Embedding = (function() {
|
|||||||
Embedding.embed(data);
|
Embedding.embed(data);
|
||||||
}
|
}
|
||||||
if (Conf['Link Title']) {
|
if (Conf['Link Title']) {
|
||||||
return Embedding.title(data);
|
Embedding.title(data);
|
||||||
|
}
|
||||||
|
if (Conf['Cover Preview']) {
|
||||||
|
return Embedding.preview(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -14042,7 +14069,7 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
embed: function(data) {
|
embed: function(data) {
|
||||||
var autoEmbed, embed, href, key, link, name, options, post, ref, uid, value;
|
var embed, href, key, link, name, options, post, ref, uid, value;
|
||||||
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
||||||
href = link.href;
|
href = link.href;
|
||||||
if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
|
if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
|
||||||
@ -14067,15 +14094,13 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
$.on(embed, 'click', Embedding.cb.click);
|
$.on(embed, 'click', Embedding.cb.click);
|
||||||
$.after(link, [$.tn(' '), embed]);
|
$.after(link, [$.tn(' '), embed]);
|
||||||
|
post.nodes.embedlinks.push(embed);
|
||||||
if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {
|
if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {
|
||||||
autoEmbed = function() {
|
if ($.hasClass(doc, 'catalog-mode')) {
|
||||||
if (doc.contains(embed) && !$.hasClass(doc, 'catalog-mode')) {
|
return $.addClass(embed, 'embed-removed');
|
||||||
$.off(d, 'PostsInserted', autoEmbed);
|
} else {
|
||||||
return Embedding.cb.toggle.call(embed);
|
return Embedding.cb.toggle.call(embed);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
$.on(d, 'PostsInserted', autoEmbed);
|
|
||||||
return autoEmbed();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ready: function() {
|
ready: function() {
|
||||||
@ -14103,12 +14128,12 @@ Embedding = (function() {
|
|||||||
if (Embedding.dragEmbed.mouseup) {
|
if (Embedding.dragEmbed.mouseup) {
|
||||||
$.off(d, 'mouseup', Embedding.dragEmbed);
|
$.off(d, 'mouseup', Embedding.dragEmbed);
|
||||||
Embedding.dragEmbed.mouseup = false;
|
Embedding.dragEmbed.mouseup = false;
|
||||||
style.visibility = '';
|
style.pointerEvents = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$.on(d, 'mouseup', Embedding.dragEmbed);
|
$.on(d, 'mouseup', Embedding.dragEmbed);
|
||||||
Embedding.dragEmbed.mouseup = true;
|
Embedding.dragEmbed.mouseup = true;
|
||||||
return style.visibility = 'hidden';
|
return style.pointerEvents = 'none';
|
||||||
},
|
},
|
||||||
title: function(data) {
|
title: function(data) {
|
||||||
var key, link, options, post, service, uid;
|
var key, link, options, post, service, uid;
|
||||||
@ -14167,11 +14192,35 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
preview: function(data) {
|
||||||
|
var key, link, service, uid;
|
||||||
|
key = data.key, uid = data.uid, link = data.link;
|
||||||
|
if (!(service = Embedding.types[key].preview)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return $.on(link, 'mouseover', function(e) {
|
||||||
|
var el, height, src;
|
||||||
|
src = service.url(uid);
|
||||||
|
height = service.height;
|
||||||
|
el = $.el('img', {
|
||||||
|
src: src,
|
||||||
|
id: 'ihover'
|
||||||
|
});
|
||||||
|
$.add(d.body, el);
|
||||||
|
return UI.hover({
|
||||||
|
root: link,
|
||||||
|
el: el,
|
||||||
|
latestEvent: e,
|
||||||
|
endEvents: 'mouseout click',
|
||||||
|
height: height
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
cb: {
|
cb: {
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
var div;
|
var div;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode')) {
|
if (!$.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode'))) {
|
||||||
if (!(div = Embedding.media.firstChild)) {
|
if (!(div = Embedding.media.firstChild)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -14199,6 +14248,14 @@ Embedding = (function() {
|
|||||||
el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
|
el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
|
catalogRemove: function() {
|
||||||
|
var isCatalog;
|
||||||
|
isCatalog = $.hasClass(doc, 'catalog-mode');
|
||||||
|
if ((isCatalog && $.hasClass(this, 'embedded')) || (!isCatalog && $.hasClass(this, 'embed-removed'))) {
|
||||||
|
Embedding.cb.toggle.call(this);
|
||||||
|
return $.toggleClass(this, 'embed-removed');
|
||||||
|
}
|
||||||
|
},
|
||||||
title: function(req, data) {
|
title: function(req, data) {
|
||||||
var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
|
var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
|
||||||
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
|
||||||
@ -14312,6 +14369,12 @@ Embedding = (function() {
|
|||||||
text: function(_) {
|
text: function(_) {
|
||||||
return _.title;
|
return _.title;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
preview: {
|
||||||
|
url: function(uid) {
|
||||||
|
return "https://www.dailymotion.com/thumbnail/video/" + uid;
|
||||||
|
},
|
||||||
|
height: 240
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'Gfycat',
|
key: 'Gfycat',
|
||||||
@ -14527,10 +14590,25 @@ Embedding = (function() {
|
|||||||
}, {
|
}, {
|
||||||
key: 'Twitter',
|
key: 'Twitter',
|
||||||
regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
|
regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
|
||||||
|
style: 'border: none; width: 550px; height: 250px; max-height: 80vh;',
|
||||||
el: function(a) {
|
el: function(a) {
|
||||||
return $.el('iframe', {
|
var el, onMessage;
|
||||||
src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
|
el = $.el('iframe');
|
||||||
|
$.on(el, 'load', function() {
|
||||||
|
return this.contentWindow.postMessage({
|
||||||
|
element: 't',
|
||||||
|
query: 'height'
|
||||||
|
}, 'https://twitframe.com');
|
||||||
});
|
});
|
||||||
|
onMessage = function(e) {
|
||||||
|
if (e.source === el.contentWindow && e.origin === 'https://twitframe.com') {
|
||||||
|
$.off(window, 'message', onMessage);
|
||||||
|
return el.style.height = (+e.data.height) + "px";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$.on(window, 'message', onMessage);
|
||||||
|
el.src = "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid;
|
||||||
|
return el;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'Vimeo',
|
key: 'Vimeo',
|
||||||
@ -14612,6 +14690,12 @@ Embedding = (function() {
|
|||||||
}
|
}
|
||||||
return 'Not Found';
|
return 'Not Found';
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
preview: {
|
||||||
|
url: function(uid) {
|
||||||
|
return "https://img.youtube.com/vi/" + uid + "/0.jpg";
|
||||||
|
},
|
||||||
|
height: 360
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -14685,6 +14769,9 @@ Linkify = (function() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (saved.parentElement.nodeName === "A" && !Linkify.regString.test(word)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
endNode = saved;
|
endNode = saved;
|
||||||
data = saved.data;
|
data = saved.data;
|
||||||
if (end = space.exec(data)) {
|
if (end = space.exec(data)) {
|
||||||
@ -17859,7 +17946,7 @@ ThreadUpdater = (function() {
|
|||||||
Header.addShortcut('updater', sc, 100);
|
Header.addShortcut('updater', sc, 100);
|
||||||
} else {
|
} else {
|
||||||
this.dialog = sc = UI.dialog('updater', {
|
this.dialog = sc = UI.dialog('updater', {
|
||||||
innerHTML: "<div class=\"move\"></div><span id=\"update-status\"></span><span id=\"update-timer\" title=\"Update now\"></span>"
|
innerHTML: "<div class=\"move\"></div><span id=\"update-status\" class=\"empty\"></span><span id=\"update-timer\" class=\"empty\" title=\"Update now\"></span>"
|
||||||
});
|
});
|
||||||
$.addClass(doc, 'float');
|
$.addClass(doc, 'float');
|
||||||
$.ready(function() {
|
$.ready(function() {
|
||||||
|
|||||||
Binary file not shown.
@ -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://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.13.1.12' />
|
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.13.2.0' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -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://www.4chan-x.net/builds/4chan-X.crx' version='1.13.1.12' />
|
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.13.2.0' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "1.13.1.12",
|
"version": "1.13.2.0",
|
||||||
"date": "2016-11-27T03:18:15.395Z"
|
"date": "2016-11-27T04:21:28.658Z"
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user