Tag:
%gLiteral %: %%
"
});
ref = $$('.warning', section);
for (j = 0, len = ref.length; j < len; j++) {
@@ -11569,7 +11570,7 @@ Settings = (function() {
return $.id('lastarchivecheck').textContent = 'never';
});
items = {};
- ref2 = ['archiveLists', 'archiveAutoUpdate', 'captchaLanguage', 'boardnav', 'time', 'backlink', 'fileInfo', 'QR.personas', 'favicon', 'usercss', 'customCooldown', 'jsWhitelist'];
+ ref2 = ['archiveLists', 'archiveAutoUpdate', 'captchaLanguage', 'boardnav', 'time', 'timeLocale', 'backlink', 'fileInfo', 'QR.personas', 'favicon', 'usercss', 'customCooldown', 'jsWhitelist'];
for (l = 0, len2 = ref2.length; l < len2; l++) {
name = ref2[l];
items[name] = Conf[name];
@@ -11755,6 +11756,9 @@ Settings = (function() {
time: function() {
return this.nextElementSibling.textContent = Time.format(this.value, new Date());
},
+ timeLocale: function() {
+ return Settings.time.call($('[name=time]', Settings.dialog));
+ },
backlink: function() {
return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) {
return {
@@ -17945,6 +17949,30 @@ Time = (function() {
},
day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ localeFormat: function(date, options, defaultValue) {
+ if (Conf['timeLocale']) {
+ try {
+ return Intl.DateTimeFormat(Conf['timeLocale'], options).format(date);
+ } catch (_error) {}
+ }
+ return defaultValue;
+ },
+ localeFormatPart: function(date, options, part, defaultValue) {
+ var parts;
+ if (Conf['timeLocale']) {
+ try {
+ parts = Intl.DateTimeFormat(Conf['timeLocale'], options).formatToParts(date);
+ return parts.map(function(x) {
+ if (x.type === part) {
+ return x.value;
+ } else {
+ return '';
+ }
+ }).join('');
+ } catch (_error) {}
+ }
+ return defaultValue;
+ },
zeroPad: function(n) {
if (n < 10) {
return "0" + n;
@@ -17954,16 +17982,24 @@ Time = (function() {
},
formatters: {
a: function() {
- return Time.day[this.getDay()].slice(0, 3);
+ return Time.localeFormat(this, {
+ weekday: 'short'
+ }, Time.day[this.getDay()].slice(0, 3));
},
A: function() {
- return Time.day[this.getDay()];
+ return Time.localeFormat(this, {
+ weekday: 'long'
+ }, Time.day[this.getDay()]);
},
b: function() {
- return Time.month[this.getMonth()].slice(0, 3);
+ return Time.localeFormat(this, {
+ month: 'short'
+ }, Time.month[this.getMonth()].slice(0, 3));
},
B: function() {
- return Time.month[this.getMonth()];
+ return Time.localeFormat(this, {
+ month: 'long'
+ }, Time.month[this.getMonth()]);
},
d: function() {
return Time.zeroPad(this.getDate());
@@ -17990,18 +18026,13 @@ Time = (function() {
return Time.zeroPad(this.getMinutes());
},
p: function() {
- if (this.getHours() < 12) {
- return 'AM';
- } else {
- return 'PM';
- }
+ return Time.localeFormatPart(this, {
+ hour: 'numeric',
+ hour12: true
+ }, 'dayperiod', (this.getHours() < 12 ? 'AM' : 'PM'));
},
P: function() {
- if (this.getHours() < 12) {
- return 'am';
- } else {
- return 'pm';
- }
+ return Time.formatters.p.call(this).toLowerCase();
},
S: function() {
return Time.zeroPad(this.getSeconds());
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index c28ad2b6f..7cc9b60d0 100644
Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ
diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js
index a12bbaae4..6b6e3cf61 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.13.11.2
+// @version 1.13.11.3
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 7d3cf9179..5de66b804 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.13.11.2
+// @version 1.13.11.3
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -153,7 +153,7 @@ docSet = function() {
};
g = {
- VERSION: '1.13.11.2',
+ VERSION: '1.13.11.3',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -425,6 +425,7 @@ Config = (function() {
jsWhitelist: 'http://s.4cdn.org\nhttps://s.4cdn.org\nhttp://www.google.com\nhttps://www.google.com\nhttps://www.gstatic.com\nhttp://cdn.mathjax.org\nhttps://cdn.mathjax.org\nhttps://cdnjs.cloudflare.com\n\'self\'\n\'unsafe-inline\'\n\'unsafe-eval\'\n\n# Banner ads\n#http://s.zkcdn.net/ados.js\n#https://s.zkcdn.net/ados.js\n#http://engine.4chan-ads.org\n#https://engine.4chan-ads.org',
captchaLanguage: '',
time: '%m/%d/%y(%a)%H:%M:%S',
+ timeLocale: '',
backlink: '>>%id',
fileInfo: '%l %d (%p%s, %r%g)',
favicon: 'ferongr',
@@ -11550,7 +11551,7 @@ Settings = (function() {
advanced: function(section) {
var applyCSS, boardSelect, customCSS, event, input, inputs, interval, items, itemsArchive, j, k, l, len, len1, len2, len3, m, name, ref, ref1, ref2, ref3, table, updateArchives, warning;
$.extend(section, {
- innerHTML: "