Release 4chan X v1.11.3.0.

This commit is contained in:
ccd0 2015-07-04 13:12:38 -07:00
parent a34c4a7b73
commit 948cea6632
13 changed files with 261 additions and 195 deletions

View File

@ -2,6 +2,13 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor
The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x). The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x).
### v1.11.3
**v1.11.3.0** *(2015-07-04)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.3.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.3.0/builds/4chan-X-noupdate.crx "Chromium version")]
- Based on v1.11.2.4.
- Improved Tampermonkey and WebKit support.
- Minor bugfixes.
### v1.11.2 ### v1.11.2
**v1.11.2.4** *(2015-07-03)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.2.4/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.2.4/builds/4chan-X-noupdate.crx "Chromium version")] **v1.11.2.4** *(2015-07-03)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.2.4/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.2.4/builds/4chan-X-noupdate.crx "Chromium version")]

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.11.2.4 // @version 1.11.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -28,6 +28,7 @@
// @grant GM_setValue // @grant GM_setValue
// @grant GM_deleteValue // @grant GM_deleteValue
// @grant GM_listValues // @grant GM_listValues
// @grant GM_addValueChangeListener
// @grant GM_openInTab // @grant GM_openInTab
// @grant GM_xmlhttpRequest // @grant GM_xmlhttpRequest
// @run-at document-start // @run-at document-start

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.11.2.4 // @version 1.11.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -29,6 +29,7 @@
// @grant GM_setValue // @grant GM_setValue
// @grant GM_deleteValue // @grant GM_deleteValue
// @grant GM_listValues // @grant GM_listValues
// @grant GM_addValueChangeListener
// @grant GM_openInTab // @grant GM_openInTab
// @grant GM_xmlhttpRequest // @grant GM_xmlhttpRequest
// @run-at document-start // @run-at document-start
@ -411,7 +412,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.11.2.4', VERSION: '1.11.3.0',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -892,10 +893,32 @@
$.syncing = {}; $.syncing = {};
$.oldValue = {};
if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
$.getValue = GM_getValue; $.getValue = GM_getValue;
$.listValues = function() {
return GM_listValues();
};
} else {
$.getValue = function(key) {
return localStorage[key];
};
$.listValues = function() {
var key, results;
results = [];
for (key in localStorage) {
if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
results.push(key);
}
}
return results;
};
}
if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
$.setValue = GM_setValue;
$.deleteValue = GM_deleteValue;
} else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
$.oldValue = {};
$.setValue = function(key, val) { $.setValue = function(key, val) {
GM_setValue(key, val); GM_setValue(key, val);
if (key in $.syncing) { if (key in $.syncing) {
@ -910,13 +933,8 @@
return delete localStorage[key]; return delete localStorage[key];
} }
}; };
$.listValues = function() {
return GM_listValues();
};
} else { } else {
$.getValue = function(key) { $.oldValue = {};
return localStorage[key];
};
$.setValue = function(key, val) { $.setValue = function(key, val) {
if (key in $.syncing) { if (key in $.syncing) {
$.oldValue[key] = val; $.oldValue[key] = val;
@ -929,52 +947,55 @@
} }
return delete localStorage[key]; return delete localStorage[key];
}; };
$.listValues = function() {
var key, results;
results = [];
for (key in localStorage) {
if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
results.push(key);
}
}
return results;
};
} }
$.sync = function(key, cb) { if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
key = g.NAMESPACE + key; $.sync = function(key, cb) {
$.syncing[key] = cb; return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) {
return $.oldValue[key] = $.getValue(key); if (remote) {
}; if (newValue !== void 0) {
newValue = JSON.parse(newValue);
(function() { }
var onChange; return cb(newValue, key);
onChange = function(key) { }
var cb, newValue; });
if (!(cb = $.syncing[key])) {
return;
}
newValue = $.getValue(key);
if (newValue === $.oldValue[key]) {
return;
}
if (newValue != null) {
$.oldValue[key] = newValue;
return cb(JSON.parse(newValue), key);
} else {
delete $.oldValue[key];
return cb(void 0, key);
}
}; };
$.on(window, 'storage', function(arg) { $.forceSync = function() {};
var key; } else {
key = arg.key; $.sync = function(key, cb) {
return onChange(key); key = g.NAMESPACE + key;
}); $.syncing[key] = cb;
return $.forceSync = function(key) { return $.oldValue[key] = $.getValue(key);
return onChange(g.NAMESPACE + key);
}; };
})(); (function() {
var onChange;
onChange = function(key) {
var cb, newValue;
if (!(cb = $.syncing[key])) {
return;
}
newValue = $.getValue(key);
if (newValue === $.oldValue[key]) {
return;
}
if (newValue != null) {
$.oldValue[key] = newValue;
return cb(JSON.parse(newValue), key.slice(g.NAMESPACE.length));
} else {
delete $.oldValue[key];
return cb(void 0, key.slice(g.NAMESPACE.length));
}
};
$.on(window, 'storage', function(arg) {
var key;
key = arg.key;
return onChange(key);
});
return $.forceSync = function(key) {
return onChange(g.NAMESPACE + key);
};
})();
}
$["delete"] = function(keys) { $["delete"] = function(keys) {
var k, key, len1; var k, key, len1;
@ -1507,7 +1528,7 @@
Post.prototype.resurrect = function() { Post.prototype.resurrect = function() {
var clone, k, len1, len2, q, quotelink, ref, ref1, strong; var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
delete this.isDead; this.isDead = false;
$.rmClass(this.nodes.root, 'deleted-post'); $.rmClass(this.nodes.root, 'deleted-post');
strong = $('strong.warning', this.nodes.info); strong = $('strong.warning', this.nodes.info);
if (this.file && this.file.isDead) { if (this.file && this.file.isDead) {
@ -6975,7 +6996,7 @@
notif.onclick = function() { notif.onclick = function() {
return window.focus(); return window.focus();
}; };
if (typeof chrome !== "undefined" && chrome !== null) { if ($.engine !== 'gecko') {
notif.onclose = function() { notif.onclose = function() {
return notice.close(); return notice.close();
}; };
@ -7382,7 +7403,7 @@
window.addEventListener('focus', QR.focus, true); window.addEventListener('focus', QR.focus, true);
window.addEventListener('blur', QR.focus, true); window.addEventListener('blur', QR.focus, true);
$.on(d, 'click', QR.focus); $.on(d, 'click', QR.focus);
if (typeof chrome === "undefined" || chrome === null) { if ($.engine === 'gecko') {
nodes.pasteArea.hidden = false; nodes.pasteArea.hidden = false;
new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, { new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {
childList: true childList: true
@ -7400,7 +7421,7 @@
event = node.nodeName === 'SELECT' ? 'change' : 'input'; event = node.nodeName === 'SELECT' ? 'change' : 'input';
$.on(nodes[name], event, save); $.on(nodes[name], event, save);
} }
if ((typeof chrome === "undefined" || chrome === null) && Conf['Remember QR Size']) { if ($.engine === 'gecko' && Conf['Remember QR Size']) {
$.get('QR Size', '', function(item) { $.get('QR Size', '', function(item) {
return nodes.com.style.cssText = item['QR Size']; return nodes.com.style.cssText = item['QR Size'];
}); });
@ -10288,7 +10309,7 @@
$.off(video, 'mouseover', handler); $.off(video, 'mouseover', handler);
t = new Date().getTime(); t = new Date().getTime();
return $.asap((function() { return $.asap((function() {
return (typeof chrome !== "undefined" && chrome !== null) || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000; return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000;
}), function() { }), function() {
return video.controls = true; return video.controls = true;
}); });
@ -10931,7 +10952,7 @@
clone.file.thumb.preload = 'auto'; clone.file.thumb.preload = 'auto';
} }
thumb.preload = 'auto'; thumb.preload = 'auto';
if (typeof chrome === "undefined" || chrome === null) { if ($.engine === 'gecko') {
$.on(thumb, 'loadeddata', function() { $.on(thumb, 'loadeddata', function() {
return this.removeAttribute('poster'); return this.removeAttribute('poster');
}); });
@ -14144,9 +14165,7 @@
if (Conf['Unread Favicon']) { if (Conf['Unread Favicon']) {
isDead = Unread.thread.isDead; isDead = Unread.thread.isDead;
Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default']; Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default'];
if (typeof chrome === "undefined" || chrome === null) { return $.add(d.head, Favicon.el);
return $.add(d.head, Favicon.el);
}
} }
} }
}; };
@ -15294,7 +15313,7 @@
if (!Conf['Keybinds']) { if (!Conf['Keybinds']) {
return; return;
} }
for (hotkey in Conf.hotkeys) { for (hotkey in Config.hotkeys) {
$.sync(hotkey, Keybinds.sync); $.sync(hotkey, Keybinds.sync);
} }
init = function() { init = function() {
@ -16315,7 +16334,7 @@
div = $.el('div', { div = $.el('div', {
innerHTML: "<label><input type=\"checkbox\" name=\"" + E(key) + "\">" + E(key) + "</label><span class=\"description\">: " + E(description) + "</span>" innerHTML: "<label><input type=\"checkbox\" name=\"" + E(key) + "\">" + E(key) + "</label><span class=\"description\">: " + E(description) + "</span>"
}); });
if ((typeof chrome !== "undefined" && chrome !== null) && key === 'Remember QR Size') { if ($.engine !== 'gecko' && key === 'Remember QR Size') {
div.hidden = true; div.hidden = true;
} }
input = $('input', div); input = $('input', div);

Binary file not shown.

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.11.2.4 // @version 1.11.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -29,6 +29,7 @@
// @grant GM_setValue // @grant GM_setValue
// @grant GM_deleteValue // @grant GM_deleteValue
// @grant GM_listValues // @grant GM_listValues
// @grant GM_addValueChangeListener
// @grant GM_openInTab // @grant GM_openInTab
// @grant GM_xmlhttpRequest // @grant GM_xmlhttpRequest
// @run-at document-start // @run-at document-start
@ -410,7 +411,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.11.2.4', VERSION: '1.11.3.0',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -891,10 +892,32 @@
$.syncing = {}; $.syncing = {};
$.oldValue = {};
if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
$.getValue = GM_getValue; $.getValue = GM_getValue;
$.listValues = function() {
return GM_listValues();
};
} else {
$.getValue = function(key) {
return localStorage[key];
};
$.listValues = function() {
var key, results;
results = [];
for (key in localStorage) {
if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
results.push(key);
}
}
return results;
};
}
if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
$.setValue = GM_setValue;
$.deleteValue = GM_deleteValue;
} else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
$.oldValue = {};
$.setValue = function(key, val) { $.setValue = function(key, val) {
GM_setValue(key, val); GM_setValue(key, val);
if (key in $.syncing) { if (key in $.syncing) {
@ -909,13 +932,8 @@
return delete localStorage[key]; return delete localStorage[key];
} }
}; };
$.listValues = function() {
return GM_listValues();
};
} else { } else {
$.getValue = function(key) { $.oldValue = {};
return localStorage[key];
};
$.setValue = function(key, val) { $.setValue = function(key, val) {
if (key in $.syncing) { if (key in $.syncing) {
$.oldValue[key] = val; $.oldValue[key] = val;
@ -928,52 +946,55 @@
} }
return delete localStorage[key]; return delete localStorage[key];
}; };
$.listValues = function() {
var key, results;
results = [];
for (key in localStorage) {
if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
results.push(key);
}
}
return results;
};
} }
$.sync = function(key, cb) { if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
key = g.NAMESPACE + key; $.sync = function(key, cb) {
$.syncing[key] = cb; return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) {
return $.oldValue[key] = $.getValue(key); if (remote) {
}; if (newValue !== void 0) {
newValue = JSON.parse(newValue);
(function() { }
var onChange; return cb(newValue, key);
onChange = function(key) { }
var cb, newValue; });
if (!(cb = $.syncing[key])) {
return;
}
newValue = $.getValue(key);
if (newValue === $.oldValue[key]) {
return;
}
if (newValue != null) {
$.oldValue[key] = newValue;
return cb(JSON.parse(newValue), key);
} else {
delete $.oldValue[key];
return cb(void 0, key);
}
}; };
$.on(window, 'storage', function(arg) { $.forceSync = function() {};
var key; } else {
key = arg.key; $.sync = function(key, cb) {
return onChange(key); key = g.NAMESPACE + key;
}); $.syncing[key] = cb;
return $.forceSync = function(key) { return $.oldValue[key] = $.getValue(key);
return onChange(g.NAMESPACE + key);
}; };
})(); (function() {
var onChange;
onChange = function(key) {
var cb, newValue;
if (!(cb = $.syncing[key])) {
return;
}
newValue = $.getValue(key);
if (newValue === $.oldValue[key]) {
return;
}
if (newValue != null) {
$.oldValue[key] = newValue;
return cb(JSON.parse(newValue), key.slice(g.NAMESPACE.length));
} else {
delete $.oldValue[key];
return cb(void 0, key.slice(g.NAMESPACE.length));
}
};
$.on(window, 'storage', function(arg) {
var key;
key = arg.key;
return onChange(key);
});
return $.forceSync = function(key) {
return onChange(g.NAMESPACE + key);
};
})();
}
$["delete"] = function(keys) { $["delete"] = function(keys) {
var k, key, len1; var k, key, len1;
@ -1506,7 +1527,7 @@
Post.prototype.resurrect = function() { Post.prototype.resurrect = function() {
var clone, k, len1, len2, q, quotelink, ref, ref1, strong; var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
delete this.isDead; this.isDead = false;
$.rmClass(this.nodes.root, 'deleted-post'); $.rmClass(this.nodes.root, 'deleted-post');
strong = $('strong.warning', this.nodes.info); strong = $('strong.warning', this.nodes.info);
if (this.file && this.file.isDead) { if (this.file && this.file.isDead) {
@ -6974,7 +6995,7 @@
notif.onclick = function() { notif.onclick = function() {
return window.focus(); return window.focus();
}; };
if (typeof chrome !== "undefined" && chrome !== null) { if ($.engine !== 'gecko') {
notif.onclose = function() { notif.onclose = function() {
return notice.close(); return notice.close();
}; };
@ -7381,7 +7402,7 @@
window.addEventListener('focus', QR.focus, true); window.addEventListener('focus', QR.focus, true);
window.addEventListener('blur', QR.focus, true); window.addEventListener('blur', QR.focus, true);
$.on(d, 'click', QR.focus); $.on(d, 'click', QR.focus);
if (typeof chrome === "undefined" || chrome === null) { if ($.engine === 'gecko') {
nodes.pasteArea.hidden = false; nodes.pasteArea.hidden = false;
new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, { new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {
childList: true childList: true
@ -7399,7 +7420,7 @@
event = node.nodeName === 'SELECT' ? 'change' : 'input'; event = node.nodeName === 'SELECT' ? 'change' : 'input';
$.on(nodes[name], event, save); $.on(nodes[name], event, save);
} }
if ((typeof chrome === "undefined" || chrome === null) && Conf['Remember QR Size']) { if ($.engine === 'gecko' && Conf['Remember QR Size']) {
$.get('QR Size', '', function(item) { $.get('QR Size', '', function(item) {
return nodes.com.style.cssText = item['QR Size']; return nodes.com.style.cssText = item['QR Size'];
}); });
@ -10287,7 +10308,7 @@
$.off(video, 'mouseover', handler); $.off(video, 'mouseover', handler);
t = new Date().getTime(); t = new Date().getTime();
return $.asap((function() { return $.asap((function() {
return (typeof chrome !== "undefined" && chrome !== null) || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000; return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000;
}), function() { }), function() {
return video.controls = true; return video.controls = true;
}); });
@ -10930,7 +10951,7 @@
clone.file.thumb.preload = 'auto'; clone.file.thumb.preload = 'auto';
} }
thumb.preload = 'auto'; thumb.preload = 'auto';
if (typeof chrome === "undefined" || chrome === null) { if ($.engine === 'gecko') {
$.on(thumb, 'loadeddata', function() { $.on(thumb, 'loadeddata', function() {
return this.removeAttribute('poster'); return this.removeAttribute('poster');
}); });
@ -14143,9 +14164,7 @@
if (Conf['Unread Favicon']) { if (Conf['Unread Favicon']) {
isDead = Unread.thread.isDead; isDead = Unread.thread.isDead;
Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default']; Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default'];
if (typeof chrome === "undefined" || chrome === null) { return $.add(d.head, Favicon.el);
return $.add(d.head, Favicon.el);
}
} }
} }
}; };
@ -15293,7 +15312,7 @@
if (!Conf['Keybinds']) { if (!Conf['Keybinds']) {
return; return;
} }
for (hotkey in Conf.hotkeys) { for (hotkey in Config.hotkeys) {
$.sync(hotkey, Keybinds.sync); $.sync(hotkey, Keybinds.sync);
} }
init = function() { init = function() {
@ -16314,7 +16333,7 @@
div = $.el('div', { div = $.el('div', {
innerHTML: "<label><input type=\"checkbox\" name=\"" + E(key) + "\">" + E(key) + "</label><span class=\"description\">: " + E(description) + "</span>" innerHTML: "<label><input type=\"checkbox\" name=\"" + E(key) + "\">" + E(key) + "</label><span class=\"description\">: " + E(description) + "</span>"
}); });
if ((typeof chrome !== "undefined" && chrome !== null) && key === 'Remember QR Size') { if ($.engine !== 'gecko' && key === 'Remember QR Size') {
div.hidden = true; div.hidden = true;
} }
input = $('input', div); input = $('input', div);

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.11.2.4 // @version 1.11.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -28,6 +28,7 @@
// @grant GM_setValue // @grant GM_setValue
// @grant GM_deleteValue // @grant GM_deleteValue
// @grant GM_listValues // @grant GM_listValues
// @grant GM_addValueChangeListener
// @grant GM_openInTab // @grant GM_openInTab
// @grant GM_xmlhttpRequest // @grant GM_xmlhttpRequest
// @run-at document-start // @run-at document-start

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.11.2.4 // @version 1.11.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -29,6 +29,7 @@
// @grant GM_setValue // @grant GM_setValue
// @grant GM_deleteValue // @grant GM_deleteValue
// @grant GM_listValues // @grant GM_listValues
// @grant GM_addValueChangeListener
// @grant GM_openInTab // @grant GM_openInTab
// @grant GM_xmlhttpRequest // @grant GM_xmlhttpRequest
// @run-at document-start // @run-at document-start
@ -411,7 +412,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.11.2.4', VERSION: '1.11.3.0',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -892,10 +893,32 @@
$.syncing = {}; $.syncing = {};
$.oldValue = {};
if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
$.getValue = GM_getValue; $.getValue = GM_getValue;
$.listValues = function() {
return GM_listValues();
};
} else {
$.getValue = function(key) {
return localStorage[key];
};
$.listValues = function() {
var key, results;
results = [];
for (key in localStorage) {
if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
results.push(key);
}
}
return results;
};
}
if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
$.setValue = GM_setValue;
$.deleteValue = GM_deleteValue;
} else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
$.oldValue = {};
$.setValue = function(key, val) { $.setValue = function(key, val) {
GM_setValue(key, val); GM_setValue(key, val);
if (key in $.syncing) { if (key in $.syncing) {
@ -910,13 +933,8 @@
return delete localStorage[key]; return delete localStorage[key];
} }
}; };
$.listValues = function() {
return GM_listValues();
};
} else { } else {
$.getValue = function(key) { $.oldValue = {};
return localStorage[key];
};
$.setValue = function(key, val) { $.setValue = function(key, val) {
if (key in $.syncing) { if (key in $.syncing) {
$.oldValue[key] = val; $.oldValue[key] = val;
@ -929,52 +947,55 @@
} }
return delete localStorage[key]; return delete localStorage[key];
}; };
$.listValues = function() {
var key, results;
results = [];
for (key in localStorage) {
if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
results.push(key);
}
}
return results;
};
} }
$.sync = function(key, cb) { if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
key = g.NAMESPACE + key; $.sync = function(key, cb) {
$.syncing[key] = cb; return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) {
return $.oldValue[key] = $.getValue(key); if (remote) {
}; if (newValue !== void 0) {
newValue = JSON.parse(newValue);
(function() { }
var onChange; return cb(newValue, key);
onChange = function(key) { }
var cb, newValue; });
if (!(cb = $.syncing[key])) {
return;
}
newValue = $.getValue(key);
if (newValue === $.oldValue[key]) {
return;
}
if (newValue != null) {
$.oldValue[key] = newValue;
return cb(JSON.parse(newValue), key);
} else {
delete $.oldValue[key];
return cb(void 0, key);
}
}; };
$.on(window, 'storage', function(arg) { $.forceSync = function() {};
var key; } else {
key = arg.key; $.sync = function(key, cb) {
return onChange(key); key = g.NAMESPACE + key;
}); $.syncing[key] = cb;
return $.forceSync = function(key) { return $.oldValue[key] = $.getValue(key);
return onChange(g.NAMESPACE + key);
}; };
})(); (function() {
var onChange;
onChange = function(key) {
var cb, newValue;
if (!(cb = $.syncing[key])) {
return;
}
newValue = $.getValue(key);
if (newValue === $.oldValue[key]) {
return;
}
if (newValue != null) {
$.oldValue[key] = newValue;
return cb(JSON.parse(newValue), key.slice(g.NAMESPACE.length));
} else {
delete $.oldValue[key];
return cb(void 0, key.slice(g.NAMESPACE.length));
}
};
$.on(window, 'storage', function(arg) {
var key;
key = arg.key;
return onChange(key);
});
return $.forceSync = function(key) {
return onChange(g.NAMESPACE + key);
};
})();
}
$["delete"] = function(keys) { $["delete"] = function(keys) {
var k, key, len1; var k, key, len1;
@ -1507,7 +1528,7 @@
Post.prototype.resurrect = function() { Post.prototype.resurrect = function() {
var clone, k, len1, len2, q, quotelink, ref, ref1, strong; var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
delete this.isDead; this.isDead = false;
$.rmClass(this.nodes.root, 'deleted-post'); $.rmClass(this.nodes.root, 'deleted-post');
strong = $('strong.warning', this.nodes.info); strong = $('strong.warning', this.nodes.info);
if (this.file && this.file.isDead) { if (this.file && this.file.isDead) {
@ -6975,7 +6996,7 @@
notif.onclick = function() { notif.onclick = function() {
return window.focus(); return window.focus();
}; };
if (typeof chrome !== "undefined" && chrome !== null) { if ($.engine !== 'gecko') {
notif.onclose = function() { notif.onclose = function() {
return notice.close(); return notice.close();
}; };
@ -7382,7 +7403,7 @@
window.addEventListener('focus', QR.focus, true); window.addEventListener('focus', QR.focus, true);
window.addEventListener('blur', QR.focus, true); window.addEventListener('blur', QR.focus, true);
$.on(d, 'click', QR.focus); $.on(d, 'click', QR.focus);
if (typeof chrome === "undefined" || chrome === null) { if ($.engine === 'gecko') {
nodes.pasteArea.hidden = false; nodes.pasteArea.hidden = false;
new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, { new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {
childList: true childList: true
@ -7400,7 +7421,7 @@
event = node.nodeName === 'SELECT' ? 'change' : 'input'; event = node.nodeName === 'SELECT' ? 'change' : 'input';
$.on(nodes[name], event, save); $.on(nodes[name], event, save);
} }
if ((typeof chrome === "undefined" || chrome === null) && Conf['Remember QR Size']) { if ($.engine === 'gecko' && Conf['Remember QR Size']) {
$.get('QR Size', '', function(item) { $.get('QR Size', '', function(item) {
return nodes.com.style.cssText = item['QR Size']; return nodes.com.style.cssText = item['QR Size'];
}); });
@ -10288,7 +10309,7 @@
$.off(video, 'mouseover', handler); $.off(video, 'mouseover', handler);
t = new Date().getTime(); t = new Date().getTime();
return $.asap((function() { return $.asap((function() {
return (typeof chrome !== "undefined" && chrome !== null) || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000; return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000;
}), function() { }), function() {
return video.controls = true; return video.controls = true;
}); });
@ -10931,7 +10952,7 @@
clone.file.thumb.preload = 'auto'; clone.file.thumb.preload = 'auto';
} }
thumb.preload = 'auto'; thumb.preload = 'auto';
if (typeof chrome === "undefined" || chrome === null) { if ($.engine === 'gecko') {
$.on(thumb, 'loadeddata', function() { $.on(thumb, 'loadeddata', function() {
return this.removeAttribute('poster'); return this.removeAttribute('poster');
}); });
@ -14144,9 +14165,7 @@
if (Conf['Unread Favicon']) { if (Conf['Unread Favicon']) {
isDead = Unread.thread.isDead; isDead = Unread.thread.isDead;
Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default']; Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default'];
if (typeof chrome === "undefined" || chrome === null) { return $.add(d.head, Favicon.el);
return $.add(d.head, Favicon.el);
}
} }
} }
}; };
@ -15294,7 +15313,7 @@
if (!Conf['Keybinds']) { if (!Conf['Keybinds']) {
return; return;
} }
for (hotkey in Conf.hotkeys) { for (hotkey in Config.hotkeys) {
$.sync(hotkey, Keybinds.sync); $.sync(hotkey, Keybinds.sync);
} }
init = function() { init = function() {
@ -16315,7 +16334,7 @@
div = $.el('div', { div = $.el('div', {
innerHTML: "<label><input type=\"checkbox\" name=\"" + E(key) + "\">" + E(key) + "</label><span class=\"description\">: " + E(description) + "</span>" innerHTML: "<label><input type=\"checkbox\" name=\"" + E(key) + "\">" + E(key) + "</label><span class=\"description\">: " + E(description) + "</span>"
}); });
if ((typeof chrome !== "undefined" && chrome !== null) && key === 'Remember QR Size') { if ($.engine !== 'gecko' && key === 'Remember QR Size') {
div.hidden = true; div.hidden = true;
} }
input = $('input', div); input = $('input', div);

Binary file not shown.

View File

@ -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/4chan-X-beta.crx' version='1.11.2.4' /> <updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.11.3.0' />
</app> </app>
</gupdate> </gupdate>

View File

@ -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/4chan-X.crx' version='1.11.2.4' /> <updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.11.3.0' />
</app> </app>
</gupdate> </gupdate>

View File

@ -3,8 +3,8 @@
"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",
"version": "1.11.2.4", "version": "1.11.3.0",
"date": "2015-07-03T22:57:57.868Z", "date": "2015-07-04T20:11:44.204Z",
"repo": "https://github.com/ccd0/4chan-x/", "repo": "https://github.com/ccd0/4chan-x/",
"page": "https://github.com/ccd0/4chan-x", "page": "https://github.com/ccd0/4chan-x",
"downloads": "https://ccd0.github.io/4chan-x/builds/", "downloads": "https://ccd0.github.io/4chan-x/builds/",