diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fafc1154..cebf87c04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ ### v1.13.11 +**v1.13.11.3** *(2017-08-13)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.11.3/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.11.3/builds/4chan-X-noupdate.crx)] +- Add language setting for time formatting. + **v1.13.11.2** *(2017-08-12)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.11.2/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.11.2/builds/4chan-X-noupdate.crx)] - Last Long Reply order will now ignore hidden and filtered replies. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index c0f03e79e..f4513af0d 100644 Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js index a0cf94e3d..103412977 100644 --- a/builds/4chan-X-beta.meta.js +++ b/builds/4chan-X-beta.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.13.11.2 +// @version 1.13.11.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js index 7f188e709..25bfbd4b8 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @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: "
Archives
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection

Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
Archive properties can be overriden by another item with the same uid (or if absent, its name).
Last updated:
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date rev"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Download button: %d
Quick filter MD5: %f
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
For more information about customizing 4chan X's CSS, see the styling guide.
Javascript Whitelist
Sources from which Javascript is allowed to be loaded by Content Security Policy.
Lines starting with a # will be ignored.
" + innerHTML: "
Archives
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection

Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
Archive properties can be overriden by another item with the same uid (or if absent, its name).
Last updated:
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date rev"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Language tag:
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Download button: %d
Quick filter MD5: %f
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
For more information about customizing 4chan X's CSS, see the styling guide.
Javascript Whitelist
Sources from which Javascript is allowed to be loaded by Content Security Policy.
Lines starting with a # will be ignored.
" }); 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-noupdate.crx b/builds/4chan-X-noupdate.crx index 725ada1e0..8b310d184 100644 Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js index 522cf8d7f..9f7a458a8 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.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: "
Archives
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection

Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
Archive properties can be overriden by another item with the same uid (or if absent, its name).
Last updated:
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date rev"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Download button: %d
Quick filter MD5: %f
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
For more information about customizing 4chan X's CSS, see the styling guide.
Javascript Whitelist
Sources from which Javascript is allowed to be loaded by Content Security Policy.
Lines starting with a # will be ignored.
" + innerHTML: "
Archives
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection

Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
Archive properties can be overriden by another item with the same uid (or if absent, its name).
Last updated:
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date rev"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Language tag:
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Download button: %d
Quick filter MD5: %f
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
For more information about customizing 4chan X's CSS, see the styling guide.
Javascript Whitelist
Sources from which Javascript is allowed to be loaded by Content Security Policy.
Lines starting with a # will be ignored.
" }); 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: "
Archives
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection

Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
Archive properties can be overriden by another item with the same uid (or if absent, its name).
Last updated:
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date rev"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Download button: %d
Quick filter MD5: %f
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
For more information about customizing 4chan X's CSS, see the styling guide.
Javascript Whitelist
Sources from which Javascript is allowed to be loaded by Content Security Policy.
Lines starting with a # will be ignored.
" + innerHTML: "
Archives
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection

Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
Archive properties can be overriden by another item with the same uid (or if absent, its name).
Last updated:
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date rev"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Language tag:
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Download button: %d
Quick filter MD5: %f
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
For more information about customizing 4chan X's CSS, see the styling guide.
Javascript Whitelist
Sources from which Javascript is allowed to be loaded by Content Security Policy.
Lines starting with a # will be ignored.
" }); 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.zip b/builds/4chan-X.zip index e1b3a24f3..cd64de3ba 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index 043967530..b46301ebd 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.xml b/builds/updates.xml index 618a7c76c..f6823f79a 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index f774847ce..aa7bda9db 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.13.11.2", - "date": "2017-08-12T17:44:29.833Z" + "version": "1.13.11.3", + "date": "2017-08-13T20:34:11.894Z" } \ No newline at end of file