diff --git a/CHANGELOG.md b/CHANGELOG.md index 639aef70c..1c160c311 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,32 @@ ## v1.13.0 +**v1.13.0.17** *(2016-10-30)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.17/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.17/builds/4chan-X-noupdate.crx)] +- Various regression and bug fixes. + +**v1.13.0.16** *(2016-10-27)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.16/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.16/builds/4chan-X-noupdate.crx)] +- Merge v1.12.3.11: Update due to 4chan's ad changes, part two. + +**v1.13.0.15** *(2016-10-27)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.15/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.15/builds/4chan-X-noupdate.crx)] +- Merge v1.12.3.10: Update due to 4chan's ad changes. + +**v1.13.0.14** *(2016-10-23)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.14/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.14/builds/4chan-X-noupdate.crx)] +- Fix bug from v1.13.0.3 causing index/catalog search to not search comment. + +**v1.13.0.13** *(2016-10-15)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.13/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.13/builds/4chan-X-noupdate.crx)] +- Add styling guide link to custom CSS section. +- Add basic support for is.4chan.org domain. + +**v1.13.0.12** *(2016-10-14)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.12/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.12/builds/4chan-X-noupdate.crx)] +- Switch back to using `border` rather than `outline` for highlighting watched threads in catalog. +- Restore hiding of extra linebreaks in catalog. Show them at reduced height on hover. + +**v1.13.0.11** *(2016-10-13)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.11/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.11/builds/4chan-X-noupdate.crx)] +- Merge v1.12.3.8: Don't run 4chan X on the donation or advertisement purchase pages (it already didn't run on the pass purchase page). + +**v1.13.0.10** *(2016-10-09)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.10/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.10/builds/4chan-X-noupdate.crx)] +- Merge v1.12.3.7: Workaround for problem on 4chan's end with images not loading. + **v1.13.0.9** *(2016-10-09)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.9/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.9/builds/4chan-X-noupdate.crx)] - Fix bug from v1.13.0.0 that broke Quote Inlining / Previewing of OPs on /f/. @@ -60,6 +86,22 @@ ### v1.12.3 +**v1.12.3.11** *(2016-10-27)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.11/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.11/builds/4chan-X-noupdate.crx)] +- Update due to 4chan's ad changes, part two. + +**v1.12.3.10** *(2016-10-27)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.10/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.10/builds/4chan-X-noupdate.crx)] +- Update due to 4chan's ad changes. + +**v1.12.3.9** *(2016-10-18)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.9/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.9/builds/4chan-X-noupdate.crx)] +- Add basic support for is.4chan.org domain. + +**v1.12.3.8** *(2016-10-13)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.8/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.8/builds/4chan-X-noupdate.crx)] +- Don't run 4chan X on the donation or advertisement purchase pages (it already didn't run on the pass purchase page). + +**v1.12.3.7** *(2016-10-09)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.7/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.7/builds/4chan-X-noupdate.crx)] +- Workaround for problem on 4chan's end with images not loading. +- The error messages displayed when the Chrome extension updates but the tab has not been reloaded have been replaced with a single warning message asking you to reload the tab. + **v1.12.3.6** *(2016-10-03)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.6/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.3.6/builds/4chan-X-noupdate.crx)] - Add `Pass Date` to filterable items. - Show Pass flair in posts constructed from JSON. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ea99dac1..da3c3f7cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,7 +29,7 @@ If you're reporting a bug, the more detail you can give, the better. If I can't - 4chan X is mostly written in [CoffeeScript](http://coffeescript.org/). If you're already familiar with Javascript, it doesn't take long to pick up. - Edit the sources in the src/ directory (not the compiled scripts in builds/). -- Compile the script with: `grunt` +- Compile the script with: `make` (this should fetch needed dependencies automatically; if not, do an `npm install` first) - Install the compiled script (found in the testbuilds/ directory), and test your changes. - Make sure you have set your name and email as you want them, as they will be published in your commit message:
`git config user.name yourname`
`git config user.email youremail` - Commit your changes: `git commit -a` diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 08a92bc91..1c7590353 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 937f7a75e..1ca3c2b35 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.0.9 +// @version 1.13.0.17 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -14,6 +14,8 @@ // @include https://www.4chan.org/* // @include http://i.4cdn.org/* // @include https://i.4cdn.org/* +// @include http://is.4chan.org/* +// @include https://is.4chan.org/* // @include https://www.google.com/recaptcha/api2/anchor?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* @@ -22,7 +24,16 @@ // @exclude https://www.4chan.org/pass // @exclude http://www.4chan.org/pass?* // @exclude https://www.4chan.org/pass?* +// @exclude http://www.4chan.org/advertise +// @exclude https://www.4chan.org/advertise +// @exclude http://www.4chan.org/advertise?* +// @exclude https://www.4chan.org/advertise?* +// @exclude http://www.4chan.org/donate +// @exclude https://www.4chan.org/donate +// @exclude http://www.4chan.org/donate?* +// @exclude https://www.4chan.org/donate?* // @connect i.4cdn.org +// @connect is.4chan.org // @connect * // @grant GM_getValue // @grant GM_setValue diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js index dee3f3aec..208cd7491 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.0.9 +// @version 1.13.0.17 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -14,6 +14,8 @@ // @include https://www.4chan.org/* // @include http://i.4cdn.org/* // @include https://i.4cdn.org/* +// @include http://is.4chan.org/* +// @include https://is.4chan.org/* // @include https://www.google.com/recaptcha/api2/anchor?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* @@ -22,7 +24,16 @@ // @exclude https://www.4chan.org/pass // @exclude http://www.4chan.org/pass?* // @exclude https://www.4chan.org/pass?* +// @exclude http://www.4chan.org/advertise +// @exclude https://www.4chan.org/advertise +// @exclude http://www.4chan.org/advertise?* +// @exclude https://www.4chan.org/advertise?* +// @exclude http://www.4chan.org/donate +// @exclude https://www.4chan.org/donate +// @exclude http://www.4chan.org/donate?* +// @exclude https://www.4chan.org/donate?* // @connect i.4cdn.org +// @connect is.4chan.org // @connect * // @grant GM_getValue // @grant GM_setValue @@ -136,7 +147,7 @@ docSet = function() { }; g = { - VERSION: '1.13.0.9', + VERSION: '1.13.0.17', NAMESPACE: '4chan X.', boards: {} }; @@ -1303,15 +1314,18 @@ body > div[style*=\" top: -10000px;\"] {\n\ max-width: calc(100vw - 50px);\n\ }\n\ /* Ads */\n\ -:root:not(.ads-loaded) .ad-cnt > * {\n\ - height: auto;\n\ +.ad-cnt > *, .adg-rects > * {\n\ + height: auto !important;\n\ }\n\ :root:not(.ads-loaded) .ad-plea,\n\ :root:not(.ads-loaded) hr.abovePostForm,\n\ :root:not(.ads-loaded) .ad-plea-bottom + hr {\n\ display: none;\n\ }\n\ -hr + div.center:not(.ad-cnt):not(.topad):not(.middlead):not(.bottomad) {\n\ +:root:not(.ads-loaded) .adg-rects {\n\ + margin: 0;\n\ +}\n\ +div.center[style] {\n\ display: none !important;\n\ }\n\ /* Anti-autoplay */\n\ @@ -1888,6 +1902,8 @@ div[data-checked=\"false\"] > .suboption-list {\n\ }\n\ .catalog-thread {\n\ display: inline-block;\n\ + -moz-box-sizing: border-box;\n\ + box-sizing: border-box;\n\ border: 1px solid transparent;\n\ word-wrap: break-word;\n\ vertical-align: top;\n\ @@ -1898,12 +1914,12 @@ div[data-checked=\"false\"] > .suboption-list {\n\ margin: 4px;\n\ }\n\ .catalog-small > .catalog-thread {\n\ - width: 165px;\n\ - height: 320px;\n\ + width: 167px;\n\ + height: 322px;\n\ }\n\ .catalog-large > .catalog-thread {\n\ - width: 270px;\n\ - height: 410px;\n\ + width: 272px;\n\ + height: 412px;\n\ }\n\ :root.catalog-hover-expand .catalog-thread:hover {\n\ z-index: 1;\n\ @@ -1996,9 +2012,11 @@ div[data-checked=\"false\"] > .suboption-list {\n\ .catalog-container:not(:hover) > * > .file,\n\ .catalog-container:not(:hover) > * > .postInfo > :not(.subject),\n\ .catalog-container:not(:hover) > * > .catalog-replies,\n\ +.catalog-container:not(:hover) .extra-linebreak,\n\ :root:not(.catalog-hover-expand) .catalog-container > * > .file,\n\ :root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject),\n\ :root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies,\n\ +:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak,\n\ .catalog-thread > .catalog-container > :not(.catalog-post),\n\ .catalog-post > .file > :not(.fileText),\n\ .catalog-post > * > .fileText > :not(:first-child),\n\ @@ -2049,11 +2067,15 @@ div[data-checked=\"false\"] > .suboption-list {\n\ :root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) {\n\ padding-top: .3em;\n\ }\n\ +.catalog-post .extra-linebreak {\n\ + content: ''; /* makes this work in Blink/WebKit */\n\ + display: block;\n\ + margin-top: .3em;\n\ +}\n\ .catalog-reply {\n\ text-align: left;\n\ white-space: nowrap;\n\ - margin: -1px;\n\ - border: 1px solid transparent;\n\ + border-top: 1px solid transparent;\n\ display: -webkit-flex;\n\ display: flex;\n\ -webkit-flex-direction: row;\n\ @@ -2497,10 +2519,10 @@ input[name=\"Default Volume\"] {\n\ box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5);\n\ }\n\ :root:not(.werkTyme) .catalog-thread.watched .catalog-thumb,\n\ -:root.werkTyme .catalog-thread.watched:not(:hover),\n\ -:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ +:root:root.werkTyme .catalog-thread.watched:not(:hover),\n\ +:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ :root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - outline: 2px solid rgba(255, 0, 0, .75);\n\ + border: 2px solid rgba(255, 0, 0, .75);\n\ }\n\ /* Spoiler text */\n\ :root.reveal-spoilers s,\n\ @@ -3833,7 +3855,7 @@ a:only-of-type > .remove {\n\ :root.tomorrow.werkTyme .catalog-thread.watched:not(:hover),\n\ :root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ :root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - outline: 2px solid rgb(64, 192, 255);\n\ + border: 2px solid rgb(64, 192, 255);\n\ }\n\ /* QR */\n\ .tomorrow #dump-list::-webkit-scrollbar-thumb {\n\ @@ -4107,6 +4129,11 @@ www: }\n\ :root:not(.js-enabled) #form {\n\ display: block;\n\ +}\n\ +#bd > div[style], #bd > div[style] > * {\n\ + height: auto !important;\n\ + margin: 0 !important;\n\ + font-size: 0;\n\ }\n" }; @@ -5975,6 +6002,9 @@ Post = (function() { return; } fileText = fileRoot.firstElementChild; + if (link.hostname === 'is.4chan.org') { + link.hostname = 'i.4cdn.org'; + } this.file = { text: fileText, link: link, @@ -5993,6 +6023,9 @@ Post = (function() { } this.file.sizeInBytes = size; if ((thumb = $('a.fileThumb > [data-md5]', fileRoot))) { + if (thumb.parentNode.hostname === 'is.4chan.org') { + thumb.parentNode.hostname = 'i.4cdn.org'; + } return $.extend(this.file, { thumb: thumb, thumbLink: thumb.parentNode, @@ -6145,17 +6178,17 @@ Post = (function() { node.id = Post.Clone.prefix + node.id; } Post.Clone.prefix++; - this.nodes = this.parseNodes(root); - ref2 = $$('.inline', this.nodes.post); + ref2 = $$('.inline', root); for (k = 0, len2 = ref2.length; k < len2; k++) { inline = ref2[k]; $.rm(inline); } - ref3 = $$('.inlined', this.nodes.post); + ref3 = $$('.inlined', root); for (l = 0, len3 = ref3.length; l < len3; l++) { inlined = ref3[l]; $.rmClass(inlined, 'inlined'); } + this.nodes = this.parseNodes(root); root.hidden = false; $.rmClass(root, 'forwarded'); $.rmClass(this.nodes.post, 'highlight'); @@ -8163,7 +8196,7 @@ Build = (function() { return root; }, catalogThread: function(thread, data, pageCount) { - var container, cssText, fileCount, gifIcon, imgClass, postCount, ratio, root, spoilerRange, src, staticPath, tn_h, tn_w; + var br, container, cssText, fileCount, gifIcon, i, imgClass, len, postCount, ratio, ref, root, spoilerRange, src, staticPath, tn_h, tn_w; staticPath = Build.staticPath, gifIcon = Build.gifIcon; tn_w = data.tn_w, tn_h = data.tn_h; if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { @@ -8191,6 +8224,13 @@ Build = (function() { innerHTML: "
" + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "" + ((thread.isSticky) ? "" : "") + ((thread.isClosed) ? "" : "") + "
" }); $.before(thread.OP.nodes.info, slice.call(container.childNodes)); + ref = $$('br', thread.OP.nodes.comment); + for (i = 0, len = ref.length; i < len; i++) { + br = ref[i]; + if (br.previousSibling && br.previousSibling.nodeName === 'BR') { + $.addClass(br, 'extra-linebreak'); + } + } root = $.el('div', { className: 'thread catalog-thread', id: "t" + thread @@ -10184,6 +10224,9 @@ Index = (function() { searchMatch: function(obj, keywords) { var file, info, k, key, keyword, l, len, len1, ref, text; info = obj.info, file = obj.file; + if (info.comment == null) { + info.comment = Build.parseComment(info.commentHTML.innerHTML); + } text = []; ref = ['comment', 'subject', 'name', 'tripcode']; for (k = 0, len = ref.length; k < len; k++) { @@ -10394,8 +10437,8 @@ Settings = (function() { } }, ads: function(cb) { - return $.onExists(doc, '.ad-cnt', function(ad) { - return $.onExists(ad, 'img', function() { + return $.onExists(doc, '.ad-cnt, .adg-rects', function(ad) { + return $.onExists(ad, 'img, iframe', function() { var url; url = Redirect.to('thread', { boardID: 'qa', @@ -10948,7 +10991,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"
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
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:
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"
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
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++) { @@ -14274,7 +14317,7 @@ Linkify = (function() { if (!Linkify.regString.test(this.info.comment)) { return; } - ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"]', this.nodes.comment); + ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"], a[href^="http://is.4chan.org/"], a[href^="https://is.4chan.org/"]', this.nodes.comment); for (j = 0, len = ref.length; j < len; j++) { link = ref[j]; $.addClass(link, 'linkify'); @@ -18922,20 +18965,23 @@ Unread = (function() { titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title; d.title = "" + titleQuotingYou + titleCount + titleDead; } - $.forceSync('Remember Last Read Post'); - if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { - ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, { - isDead: Unread.thread.isDead, - unread: count, - quotingYou: countQuotingYou - }); - } + Unread.saveThreadWatcherCount(); if (Conf['Unread Favicon']) { isDead = Unread.thread.isDead; Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default']; return $.add(d.head, Favicon.el); } - } + }, + saveThreadWatcherCount: $.debounce(2 * $.SECOND, function() { + $.forceSync('Remember Last Read Post'); + if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { + return ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, { + isDead: Unread.thread.isDead, + unread: Unread.posts.size, + quotingYou: Unread.postsQuotingYou.size + }); + } + }) }; return Unread; @@ -21676,12 +21722,13 @@ QR = (function() { }; _Class.prototype.save = function(input) { - var name, ref; + var name, prev, ref; if (input.type === 'checkbox') { this.spoiler = input.checked; return; } name = input.dataset.name; + prev = this[name]; this[name] = input.value || input.dataset["default"] || null; switch (name) { case 'thread': @@ -21700,7 +21747,9 @@ QR = (function() { this.saveFilename(); return this.updateFilename(); case 'name': - return QR.persona.set(this); + if (this.name !== prev) { + return QR.persona.set(this); + } } }; @@ -23167,6 +23216,7 @@ Main = (function() { } return; case 'i.4cdn.org': + case 'is.4chan.org': if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) { return; } @@ -23234,8 +23284,8 @@ Main = (function() { if ($.engine) { $.addClass(doc, "ua-" + $.engine); } - $.onExists(doc, '.ad-cnt', function(ad) { - return $.onExists(ad, 'img', function() { + $.onExists(doc, '.ad-cnt, .adg-rects', function(ad) { + return $.onExists(ad, 'img, iframe', function() { return $.addClass(doc, 'ads-loaded'); }); }); diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index a39e425f3..2e4e8120d 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 f9415d42f..c06ecc7c7 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.0.9 +// @version 1.13.0.17 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -14,6 +14,8 @@ // @include https://www.4chan.org/* // @include http://i.4cdn.org/* // @include https://i.4cdn.org/* +// @include http://is.4chan.org/* +// @include https://is.4chan.org/* // @include https://www.google.com/recaptcha/api2/anchor?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* @@ -22,7 +24,16 @@ // @exclude https://www.4chan.org/pass // @exclude http://www.4chan.org/pass?* // @exclude https://www.4chan.org/pass?* +// @exclude http://www.4chan.org/advertise +// @exclude https://www.4chan.org/advertise +// @exclude http://www.4chan.org/advertise?* +// @exclude https://www.4chan.org/advertise?* +// @exclude http://www.4chan.org/donate +// @exclude https://www.4chan.org/donate +// @exclude http://www.4chan.org/donate?* +// @exclude https://www.4chan.org/donate?* // @connect i.4cdn.org +// @connect is.4chan.org // @connect * // @grant GM_getValue // @grant GM_setValue @@ -136,7 +147,7 @@ docSet = function() { }; g = { - VERSION: '1.13.0.9', + VERSION: '1.13.0.17', NAMESPACE: '4chan X.', boards: {} }; @@ -1303,15 +1314,18 @@ body > div[style*=\" top: -10000px;\"] {\n\ max-width: calc(100vw - 50px);\n\ }\n\ /* Ads */\n\ -:root:not(.ads-loaded) .ad-cnt > * {\n\ - height: auto;\n\ +.ad-cnt > *, .adg-rects > * {\n\ + height: auto !important;\n\ }\n\ :root:not(.ads-loaded) .ad-plea,\n\ :root:not(.ads-loaded) hr.abovePostForm,\n\ :root:not(.ads-loaded) .ad-plea-bottom + hr {\n\ display: none;\n\ }\n\ -hr + div.center:not(.ad-cnt):not(.topad):not(.middlead):not(.bottomad) {\n\ +:root:not(.ads-loaded) .adg-rects {\n\ + margin: 0;\n\ +}\n\ +div.center[style] {\n\ display: none !important;\n\ }\n\ /* Anti-autoplay */\n\ @@ -1888,6 +1902,8 @@ div[data-checked=\"false\"] > .suboption-list {\n\ }\n\ .catalog-thread {\n\ display: inline-block;\n\ + -moz-box-sizing: border-box;\n\ + box-sizing: border-box;\n\ border: 1px solid transparent;\n\ word-wrap: break-word;\n\ vertical-align: top;\n\ @@ -1898,12 +1914,12 @@ div[data-checked=\"false\"] > .suboption-list {\n\ margin: 4px;\n\ }\n\ .catalog-small > .catalog-thread {\n\ - width: 165px;\n\ - height: 320px;\n\ + width: 167px;\n\ + height: 322px;\n\ }\n\ .catalog-large > .catalog-thread {\n\ - width: 270px;\n\ - height: 410px;\n\ + width: 272px;\n\ + height: 412px;\n\ }\n\ :root.catalog-hover-expand .catalog-thread:hover {\n\ z-index: 1;\n\ @@ -1996,9 +2012,11 @@ div[data-checked=\"false\"] > .suboption-list {\n\ .catalog-container:not(:hover) > * > .file,\n\ .catalog-container:not(:hover) > * > .postInfo > :not(.subject),\n\ .catalog-container:not(:hover) > * > .catalog-replies,\n\ +.catalog-container:not(:hover) .extra-linebreak,\n\ :root:not(.catalog-hover-expand) .catalog-container > * > .file,\n\ :root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject),\n\ :root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies,\n\ +:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak,\n\ .catalog-thread > .catalog-container > :not(.catalog-post),\n\ .catalog-post > .file > :not(.fileText),\n\ .catalog-post > * > .fileText > :not(:first-child),\n\ @@ -2049,11 +2067,15 @@ div[data-checked=\"false\"] > .suboption-list {\n\ :root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) {\n\ padding-top: .3em;\n\ }\n\ +.catalog-post .extra-linebreak {\n\ + content: ''; /* makes this work in Blink/WebKit */\n\ + display: block;\n\ + margin-top: .3em;\n\ +}\n\ .catalog-reply {\n\ text-align: left;\n\ white-space: nowrap;\n\ - margin: -1px;\n\ - border: 1px solid transparent;\n\ + border-top: 1px solid transparent;\n\ display: -webkit-flex;\n\ display: flex;\n\ -webkit-flex-direction: row;\n\ @@ -2497,10 +2519,10 @@ input[name=\"Default Volume\"] {\n\ box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5);\n\ }\n\ :root:not(.werkTyme) .catalog-thread.watched .catalog-thumb,\n\ -:root.werkTyme .catalog-thread.watched:not(:hover),\n\ -:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ +:root:root.werkTyme .catalog-thread.watched:not(:hover),\n\ +:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ :root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - outline: 2px solid rgba(255, 0, 0, .75);\n\ + border: 2px solid rgba(255, 0, 0, .75);\n\ }\n\ /* Spoiler text */\n\ :root.reveal-spoilers s,\n\ @@ -3833,7 +3855,7 @@ a:only-of-type > .remove {\n\ :root.tomorrow.werkTyme .catalog-thread.watched:not(:hover),\n\ :root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ :root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - outline: 2px solid rgb(64, 192, 255);\n\ + border: 2px solid rgb(64, 192, 255);\n\ }\n\ /* QR */\n\ .tomorrow #dump-list::-webkit-scrollbar-thumb {\n\ @@ -4107,6 +4129,11 @@ www: }\n\ :root:not(.js-enabled) #form {\n\ display: block;\n\ +}\n\ +#bd > div[style], #bd > div[style] > * {\n\ + height: auto !important;\n\ + margin: 0 !important;\n\ + font-size: 0;\n\ }\n" }; @@ -5975,6 +6002,9 @@ Post = (function() { return; } fileText = fileRoot.firstElementChild; + if (link.hostname === 'is.4chan.org') { + link.hostname = 'i.4cdn.org'; + } this.file = { text: fileText, link: link, @@ -5993,6 +6023,9 @@ Post = (function() { } this.file.sizeInBytes = size; if ((thumb = $('a.fileThumb > [data-md5]', fileRoot))) { + if (thumb.parentNode.hostname === 'is.4chan.org') { + thumb.parentNode.hostname = 'i.4cdn.org'; + } return $.extend(this.file, { thumb: thumb, thumbLink: thumb.parentNode, @@ -6145,17 +6178,17 @@ Post = (function() { node.id = Post.Clone.prefix + node.id; } Post.Clone.prefix++; - this.nodes = this.parseNodes(root); - ref2 = $$('.inline', this.nodes.post); + ref2 = $$('.inline', root); for (k = 0, len2 = ref2.length; k < len2; k++) { inline = ref2[k]; $.rm(inline); } - ref3 = $$('.inlined', this.nodes.post); + ref3 = $$('.inlined', root); for (l = 0, len3 = ref3.length; l < len3; l++) { inlined = ref3[l]; $.rmClass(inlined, 'inlined'); } + this.nodes = this.parseNodes(root); root.hidden = false; $.rmClass(root, 'forwarded'); $.rmClass(this.nodes.post, 'highlight'); @@ -8163,7 +8196,7 @@ Build = (function() { return root; }, catalogThread: function(thread, data, pageCount) { - var container, cssText, fileCount, gifIcon, imgClass, postCount, ratio, root, spoilerRange, src, staticPath, tn_h, tn_w; + var br, container, cssText, fileCount, gifIcon, i, imgClass, len, postCount, ratio, ref, root, spoilerRange, src, staticPath, tn_h, tn_w; staticPath = Build.staticPath, gifIcon = Build.gifIcon; tn_w = data.tn_w, tn_h = data.tn_h; if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { @@ -8191,6 +8224,13 @@ Build = (function() { innerHTML: "
" + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "" + ((thread.isSticky) ? "" : "") + ((thread.isClosed) ? "" : "") + "
" }); $.before(thread.OP.nodes.info, slice.call(container.childNodes)); + ref = $$('br', thread.OP.nodes.comment); + for (i = 0, len = ref.length; i < len; i++) { + br = ref[i]; + if (br.previousSibling && br.previousSibling.nodeName === 'BR') { + $.addClass(br, 'extra-linebreak'); + } + } root = $.el('div', { className: 'thread catalog-thread', id: "t" + thread @@ -10184,6 +10224,9 @@ Index = (function() { searchMatch: function(obj, keywords) { var file, info, k, key, keyword, l, len, len1, ref, text; info = obj.info, file = obj.file; + if (info.comment == null) { + info.comment = Build.parseComment(info.commentHTML.innerHTML); + } text = []; ref = ['comment', 'subject', 'name', 'tripcode']; for (k = 0, len = ref.length; k < len; k++) { @@ -10394,8 +10437,8 @@ Settings = (function() { } }, ads: function(cb) { - return $.onExists(doc, '.ad-cnt', function(ad) { - return $.onExists(ad, 'img', function() { + return $.onExists(doc, '.ad-cnt, .adg-rects', function(ad) { + return $.onExists(ad, 'img, iframe', function() { var url; url = Redirect.to('thread', { boardID: 'qa', @@ -10948,7 +10991,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"
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
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:
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"
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
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++) { @@ -14274,7 +14317,7 @@ Linkify = (function() { if (!Linkify.regString.test(this.info.comment)) { return; } - ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"]', this.nodes.comment); + ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"], a[href^="http://is.4chan.org/"], a[href^="https://is.4chan.org/"]', this.nodes.comment); for (j = 0, len = ref.length; j < len; j++) { link = ref[j]; $.addClass(link, 'linkify'); @@ -18922,20 +18965,23 @@ Unread = (function() { titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title; d.title = "" + titleQuotingYou + titleCount + titleDead; } - $.forceSync('Remember Last Read Post'); - if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { - ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, { - isDead: Unread.thread.isDead, - unread: count, - quotingYou: countQuotingYou - }); - } + Unread.saveThreadWatcherCount(); if (Conf['Unread Favicon']) { isDead = Unread.thread.isDead; Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default']; return $.add(d.head, Favicon.el); } - } + }, + saveThreadWatcherCount: $.debounce(2 * $.SECOND, function() { + $.forceSync('Remember Last Read Post'); + if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { + return ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, { + isDead: Unread.thread.isDead, + unread: Unread.posts.size, + quotingYou: Unread.postsQuotingYou.size + }); + } + }) }; return Unread; @@ -21676,12 +21722,13 @@ QR = (function() { }; _Class.prototype.save = function(input) { - var name, ref; + var name, prev, ref; if (input.type === 'checkbox') { this.spoiler = input.checked; return; } name = input.dataset.name; + prev = this[name]; this[name] = input.value || input.dataset["default"] || null; switch (name) { case 'thread': @@ -21700,7 +21747,9 @@ QR = (function() { this.saveFilename(); return this.updateFilename(); case 'name': - return QR.persona.set(this); + if (this.name !== prev) { + return QR.persona.set(this); + } } }; @@ -23167,6 +23216,7 @@ Main = (function() { } return; case 'i.4cdn.org': + case 'is.4chan.org': if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) { return; } @@ -23234,8 +23284,8 @@ Main = (function() { if ($.engine) { $.addClass(doc, "ua-" + $.engine); } - $.onExists(doc, '.ad-cnt', function(ad) { - return $.onExists(ad, 'img', function() { + $.onExists(doc, '.ad-cnt, .adg-rects', function(ad) { + return $.onExists(ad, 'img, iframe', function() { return $.addClass(doc, 'ads-loaded'); }); }); diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 1aeef2bd6..09ebb78fd 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 84ce3806a..f94c9d2a1 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.13.0.9 +// @version 1.13.0.17 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -14,6 +14,8 @@ // @include https://www.4chan.org/* // @include http://i.4cdn.org/* // @include https://i.4cdn.org/* +// @include http://is.4chan.org/* +// @include https://is.4chan.org/* // @include https://www.google.com/recaptcha/api2/anchor?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* @@ -22,7 +24,16 @@ // @exclude https://www.4chan.org/pass // @exclude http://www.4chan.org/pass?* // @exclude https://www.4chan.org/pass?* +// @exclude http://www.4chan.org/advertise +// @exclude https://www.4chan.org/advertise +// @exclude http://www.4chan.org/advertise?* +// @exclude https://www.4chan.org/advertise?* +// @exclude http://www.4chan.org/donate +// @exclude https://www.4chan.org/donate +// @exclude http://www.4chan.org/donate?* +// @exclude https://www.4chan.org/donate?* // @connect i.4cdn.org +// @connect is.4chan.org // @connect * // @grant GM_getValue // @grant GM_setValue diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 21ef907b8..0bfd0ed3d 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.13.0.9 +// @version 1.13.0.17 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -14,6 +14,8 @@ // @include https://www.4chan.org/* // @include http://i.4cdn.org/* // @include https://i.4cdn.org/* +// @include http://is.4chan.org/* +// @include https://is.4chan.org/* // @include https://www.google.com/recaptcha/api2/anchor?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* // @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc* @@ -22,7 +24,16 @@ // @exclude https://www.4chan.org/pass // @exclude http://www.4chan.org/pass?* // @exclude https://www.4chan.org/pass?* +// @exclude http://www.4chan.org/advertise +// @exclude https://www.4chan.org/advertise +// @exclude http://www.4chan.org/advertise?* +// @exclude https://www.4chan.org/advertise?* +// @exclude http://www.4chan.org/donate +// @exclude https://www.4chan.org/donate +// @exclude http://www.4chan.org/donate?* +// @exclude https://www.4chan.org/donate?* // @connect i.4cdn.org +// @connect is.4chan.org // @connect * // @grant GM_getValue // @grant GM_setValue @@ -136,7 +147,7 @@ docSet = function() { }; g = { - VERSION: '1.13.0.9', + VERSION: '1.13.0.17', NAMESPACE: '4chan X.', boards: {} }; @@ -1303,15 +1314,18 @@ body > div[style*=\" top: -10000px;\"] {\n\ max-width: calc(100vw - 50px);\n\ }\n\ /* Ads */\n\ -:root:not(.ads-loaded) .ad-cnt > * {\n\ - height: auto;\n\ +.ad-cnt > *, .adg-rects > * {\n\ + height: auto !important;\n\ }\n\ :root:not(.ads-loaded) .ad-plea,\n\ :root:not(.ads-loaded) hr.abovePostForm,\n\ :root:not(.ads-loaded) .ad-plea-bottom + hr {\n\ display: none;\n\ }\n\ -hr + div.center:not(.ad-cnt):not(.topad):not(.middlead):not(.bottomad) {\n\ +:root:not(.ads-loaded) .adg-rects {\n\ + margin: 0;\n\ +}\n\ +div.center[style] {\n\ display: none !important;\n\ }\n\ /* Anti-autoplay */\n\ @@ -1888,6 +1902,8 @@ div[data-checked=\"false\"] > .suboption-list {\n\ }\n\ .catalog-thread {\n\ display: inline-block;\n\ + -moz-box-sizing: border-box;\n\ + box-sizing: border-box;\n\ border: 1px solid transparent;\n\ word-wrap: break-word;\n\ vertical-align: top;\n\ @@ -1898,12 +1914,12 @@ div[data-checked=\"false\"] > .suboption-list {\n\ margin: 4px;\n\ }\n\ .catalog-small > .catalog-thread {\n\ - width: 165px;\n\ - height: 320px;\n\ + width: 167px;\n\ + height: 322px;\n\ }\n\ .catalog-large > .catalog-thread {\n\ - width: 270px;\n\ - height: 410px;\n\ + width: 272px;\n\ + height: 412px;\n\ }\n\ :root.catalog-hover-expand .catalog-thread:hover {\n\ z-index: 1;\n\ @@ -1996,9 +2012,11 @@ div[data-checked=\"false\"] > .suboption-list {\n\ .catalog-container:not(:hover) > * > .file,\n\ .catalog-container:not(:hover) > * > .postInfo > :not(.subject),\n\ .catalog-container:not(:hover) > * > .catalog-replies,\n\ +.catalog-container:not(:hover) .extra-linebreak,\n\ :root:not(.catalog-hover-expand) .catalog-container > * > .file,\n\ :root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject),\n\ :root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies,\n\ +:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak,\n\ .catalog-thread > .catalog-container > :not(.catalog-post),\n\ .catalog-post > .file > :not(.fileText),\n\ .catalog-post > * > .fileText > :not(:first-child),\n\ @@ -2049,11 +2067,15 @@ div[data-checked=\"false\"] > .suboption-list {\n\ :root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) {\n\ padding-top: .3em;\n\ }\n\ +.catalog-post .extra-linebreak {\n\ + content: ''; /* makes this work in Blink/WebKit */\n\ + display: block;\n\ + margin-top: .3em;\n\ +}\n\ .catalog-reply {\n\ text-align: left;\n\ white-space: nowrap;\n\ - margin: -1px;\n\ - border: 1px solid transparent;\n\ + border-top: 1px solid transparent;\n\ display: -webkit-flex;\n\ display: flex;\n\ -webkit-flex-direction: row;\n\ @@ -2497,10 +2519,10 @@ input[name=\"Default Volume\"] {\n\ box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5);\n\ }\n\ :root:not(.werkTyme) .catalog-thread.watched .catalog-thumb,\n\ -:root.werkTyme .catalog-thread.watched:not(:hover),\n\ -:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ +:root:root.werkTyme .catalog-thread.watched:not(:hover),\n\ +:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ :root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - outline: 2px solid rgba(255, 0, 0, .75);\n\ + border: 2px solid rgba(255, 0, 0, .75);\n\ }\n\ /* Spoiler text */\n\ :root.reveal-spoilers s,\n\ @@ -3833,7 +3855,7 @@ a:only-of-type > .remove {\n\ :root.tomorrow.werkTyme .catalog-thread.watched:not(:hover),\n\ :root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ :root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - outline: 2px solid rgb(64, 192, 255);\n\ + border: 2px solid rgb(64, 192, 255);\n\ }\n\ /* QR */\n\ .tomorrow #dump-list::-webkit-scrollbar-thumb {\n\ @@ -4107,6 +4129,11 @@ www: }\n\ :root:not(.js-enabled) #form {\n\ display: block;\n\ +}\n\ +#bd > div[style], #bd > div[style] > * {\n\ + height: auto !important;\n\ + margin: 0 !important;\n\ + font-size: 0;\n\ }\n" }; @@ -5975,6 +6002,9 @@ Post = (function() { return; } fileText = fileRoot.firstElementChild; + if (link.hostname === 'is.4chan.org') { + link.hostname = 'i.4cdn.org'; + } this.file = { text: fileText, link: link, @@ -5993,6 +6023,9 @@ Post = (function() { } this.file.sizeInBytes = size; if ((thumb = $('a.fileThumb > [data-md5]', fileRoot))) { + if (thumb.parentNode.hostname === 'is.4chan.org') { + thumb.parentNode.hostname = 'i.4cdn.org'; + } return $.extend(this.file, { thumb: thumb, thumbLink: thumb.parentNode, @@ -6145,17 +6178,17 @@ Post = (function() { node.id = Post.Clone.prefix + node.id; } Post.Clone.prefix++; - this.nodes = this.parseNodes(root); - ref2 = $$('.inline', this.nodes.post); + ref2 = $$('.inline', root); for (k = 0, len2 = ref2.length; k < len2; k++) { inline = ref2[k]; $.rm(inline); } - ref3 = $$('.inlined', this.nodes.post); + ref3 = $$('.inlined', root); for (l = 0, len3 = ref3.length; l < len3; l++) { inlined = ref3[l]; $.rmClass(inlined, 'inlined'); } + this.nodes = this.parseNodes(root); root.hidden = false; $.rmClass(root, 'forwarded'); $.rmClass(this.nodes.post, 'highlight'); @@ -8163,7 +8196,7 @@ Build = (function() { return root; }, catalogThread: function(thread, data, pageCount) { - var container, cssText, fileCount, gifIcon, imgClass, postCount, ratio, root, spoilerRange, src, staticPath, tn_h, tn_w; + var br, container, cssText, fileCount, gifIcon, i, imgClass, len, postCount, ratio, ref, root, spoilerRange, src, staticPath, tn_h, tn_w; staticPath = Build.staticPath, gifIcon = Build.gifIcon; tn_w = data.tn_w, tn_h = data.tn_h; if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { @@ -8191,6 +8224,13 @@ Build = (function() { innerHTML: "
" + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "" + ((thread.isSticky) ? "" : "") + ((thread.isClosed) ? "" : "") + "
" }); $.before(thread.OP.nodes.info, slice.call(container.childNodes)); + ref = $$('br', thread.OP.nodes.comment); + for (i = 0, len = ref.length; i < len; i++) { + br = ref[i]; + if (br.previousSibling && br.previousSibling.nodeName === 'BR') { + $.addClass(br, 'extra-linebreak'); + } + } root = $.el('div', { className: 'thread catalog-thread', id: "t" + thread @@ -10184,6 +10224,9 @@ Index = (function() { searchMatch: function(obj, keywords) { var file, info, k, key, keyword, l, len, len1, ref, text; info = obj.info, file = obj.file; + if (info.comment == null) { + info.comment = Build.parseComment(info.commentHTML.innerHTML); + } text = []; ref = ['comment', 'subject', 'name', 'tripcode']; for (k = 0, len = ref.length; k < len; k++) { @@ -10394,8 +10437,8 @@ Settings = (function() { } }, ads: function(cb) { - return $.onExists(doc, '.ad-cnt', function(ad) { - return $.onExists(ad, 'img', function() { + return $.onExists(doc, '.ad-cnt, .adg-rects', function(ad) { + return $.onExists(ad, 'img, iframe', function() { var url; url = Redirect.to('thread', { boardID: 'qa', @@ -10948,7 +10991,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"
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
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:
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"
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
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++) { @@ -14274,7 +14317,7 @@ Linkify = (function() { if (!Linkify.regString.test(this.info.comment)) { return; } - ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"]', this.nodes.comment); + ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"], a[href^="http://is.4chan.org/"], a[href^="https://is.4chan.org/"]', this.nodes.comment); for (j = 0, len = ref.length; j < len; j++) { link = ref[j]; $.addClass(link, 'linkify'); @@ -18922,20 +18965,23 @@ Unread = (function() { titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title; d.title = "" + titleQuotingYou + titleCount + titleDead; } - $.forceSync('Remember Last Read Post'); - if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { - ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, { - isDead: Unread.thread.isDead, - unread: count, - quotingYou: countQuotingYou - }); - } + Unread.saveThreadWatcherCount(); if (Conf['Unread Favicon']) { isDead = Unread.thread.isDead; Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default']; return $.add(d.head, Favicon.el); } - } + }, + saveThreadWatcherCount: $.debounce(2 * $.SECOND, function() { + $.forceSync('Remember Last Read Post'); + if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { + return ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, { + isDead: Unread.thread.isDead, + unread: Unread.posts.size, + quotingYou: Unread.postsQuotingYou.size + }); + } + }) }; return Unread; @@ -21676,12 +21722,13 @@ QR = (function() { }; _Class.prototype.save = function(input) { - var name, ref; + var name, prev, ref; if (input.type === 'checkbox') { this.spoiler = input.checked; return; } name = input.dataset.name; + prev = this[name]; this[name] = input.value || input.dataset["default"] || null; switch (name) { case 'thread': @@ -21700,7 +21747,9 @@ QR = (function() { this.saveFilename(); return this.updateFilename(); case 'name': - return QR.persona.set(this); + if (this.name !== prev) { + return QR.persona.set(this); + } } }; @@ -23167,6 +23216,7 @@ Main = (function() { } return; case 'i.4cdn.org': + case 'is.4chan.org': if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) { return; } @@ -23234,8 +23284,8 @@ Main = (function() { if ($.engine) { $.addClass(doc, "ua-" + $.engine); } - $.onExists(doc, '.ad-cnt', function(ad) { - return $.onExists(ad, 'img', function() { + $.onExists(doc, '.ad-cnt, .adg-rects', function(ad) { + return $.onExists(ad, 'img, iframe', function() { return $.addClass(doc, 'ads-loaded'); }); }); diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 353e5f857..a6c41352e 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 cc18cb073..47991ee2f 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 9e07d01d8..7160ceab2 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 254c07133..6a57eff11 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "downloads": "https://www.4chan-x.net/builds/", "oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/", "faq": "https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions", + "cssGuide": "https://github.com/ccd0/4chan-x/wiki/Styling-Guide", "license": "https://github.com/ccd0/4chan-x/blob/master/LICENSE", "changelog": "https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md", "issues": "https://gitreports.com/issue/ccd0/4chan-x", @@ -25,13 +26,18 @@ "*://sys.4chan.org/*", "*://www.4chan.org/*", "*://i.4cdn.org/*", + "*://is.4chan.org/*", "https://www.google.com/recaptcha/api2/anchor?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*", "https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*", "*://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*" ], "exclude_matches": [ "*://www.4chan.org/pass", - "*://www.4chan.org/pass?*" + "*://www.4chan.org/pass?*", + "*://www.4chan.org/advertise", + "*://www.4chan.org/advertise?*", + "*://www.4chan.org/donate", + "*://www.4chan.org/donate?*" ], "grants": [ "GM_getValue", diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 0a1c6e123..1436a680a 100644 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -220,6 +220,9 @@ Build = container = $.el 'div', <%= readHTML('CatalogThread.html') %> $.before thread.OP.nodes.info, [container.childNodes...] + for br in $$('br', thread.OP.nodes.comment) when br.previousSibling and br.previousSibling.nodeName is 'BR' + $.addClass br, 'extra-linebreak' + root = $.el 'div', className: 'thread catalog-thread' id: "t#{thread}" diff --git a/src/General/Index.coffee b/src/General/Index.coffee index ca87b017f..6eeda43a3 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -763,6 +763,7 @@ Index = when 'birth' then [liveThreadIDs... ].sort (a, b) -> b - a when 'replycount' then [liveThreadData...].sort((a, b) -> b.replies - a.replies).map (post) -> post.no when 'filecount' then [liveThreadData...].sort((a, b) -> b.images - a.images ).map (post) -> post.no + else liveThreadIDs if Index.search and (threadIDs = Index.querySearch Index.search) Index.sortedThreadIDs = threadIDs # Sticky threads @@ -874,6 +875,7 @@ Index = searchMatch: (obj, keywords) -> {info, file} = obj + info.comment ?= Build.parseComment info.commentHTML.innerHTML text = [] for key in ['comment', 'subject', 'name', 'tripcode'] text.push info[key] if key of info diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index a251d788d..055a431ab 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -113,7 +113,7 @@ Settings = Enable it on boards.4chan.org in your browser's privacy settings (may be listed as part of "local data" or "cookies"). """ ads: (cb) -> - $.onExists doc, '.ad-cnt', (ad) -> $.onExists ad, 'img', -> + $.onExists doc, '.ad-cnt, .adg-rects', (ad) -> $.onExists ad, 'img, iframe', -> url = Redirect.to 'thread', {boardID: 'qa', threadID: 362590} cb $.el 'li', <%= html( diff --git a/src/General/Settings/Advanced.html b/src/General/Settings/Advanced.html index def01adf4..cb09ffc15 100644 --- a/src/General/Settings/Advanced.html +++ b/src/General/Settings/Advanced.html @@ -137,6 +137,7 @@ +
For more information about customizing 4chan X's CSS, see the styling guide.
diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 12bd0c1e6..c2cdc96cd 100644 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -14,7 +14,7 @@ Linkify = node: -> return Embedding.events @ if @isClone return unless Linkify.regString.test @info.comment - for link in $$ 'a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"]', @nodes.comment + for link in $$ 'a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"], a[href^="http://is.4chan.org/"], a[href^="https://is.4chan.org/"]', @nodes.comment $.addClass link, 'linkify' Embedding.process link, @ links = Linkify.process @nodes.comment diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index f7784e592..6c14dee0f 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -231,12 +231,7 @@ Unread = Unread.title d.title = "#{titleQuotingYou}#{titleCount}#{titleDead}" - $.forceSync 'Remember Last Read Post' - if Conf['Remember Last Read Post'] and (!Unread.thread.isDead or Unread.thread.isArchived) - ThreadWatcher.update Unread.thread.board.ID, Unread.thread.ID, - isDead: Unread.thread.isDead - unread: count - quotingYou: countQuotingYou + Unread.saveThreadWatcherCount() if Conf['Unread Favicon'] {isDead} = Unread.thread @@ -249,3 +244,11 @@ Unread = Favicon[if isDead then 'dead' else 'default'] # `favicon.href = href` doesn't work on Firefox. $.add d.head, Favicon.el + + saveThreadWatcherCount: $.debounce 2 * $.SECOND, -> + $.forceSync 'Remember Last Read Post' + if Conf['Remember Last Read Post'] and (!Unread.thread.isDead or Unread.thread.isArchived) + ThreadWatcher.update Unread.thread.board.ID, Unread.thread.ID, + isDead: Unread.thread.isDead + unread: Unread.posts.size + quotingYou: Unread.postsQuotingYou.size diff --git a/src/Posting/QR.post.coffee b/src/Posting/QR.post.coffee index acce06a07..a719f92a4 100644 --- a/src/Posting/QR.post.coffee +++ b/src/Posting/QR.post.coffee @@ -117,6 +117,7 @@ QR.post = class @spoiler = input.checked return {name} = input.dataset + prev = @[name] @[name] = input.value or input.dataset.default or null switch name when 'thread' @@ -133,7 +134,8 @@ QR.post = class @saveFilename() @updateFilename() when 'name' - QR.persona.set @ + if @name isnt prev # only save manual changes, not values filled in by persona settings + QR.persona.set @ forceSave: -> return unless @ is QR.selected diff --git a/src/classes/Post.Clone.coffee b/src/classes/Post.Clone.coffee index 9eafe6422..154348b62 100644 --- a/src/classes/Post.Clone.coffee +++ b/src/classes/Post.Clone.coffee @@ -16,14 +16,14 @@ Post.Clone = class extends Post node.id = Post.Clone.prefix + node.id Post.Clone.prefix++ - @nodes = @parseNodes root - # Remove inlined posts inside of this post. - for inline in $$ '.inline', @nodes.post + for inline in $$ '.inline', root $.rm inline - for inlined in $$ '.inlined', @nodes.post + for inlined in $$ '.inlined', root $.rmClass inlined, 'inlined' + @nodes = @parseNodes root + root.hidden = false # post hiding $.rmClass root, 'forwarded' # quote inlining $.rmClass @nodes.post, 'highlight' # keybind navigation, ID highlighting diff --git a/src/classes/Post.coffee b/src/classes/Post.coffee index ebf66201e..427582c61 100644 --- a/src/classes/Post.coffee +++ b/src/classes/Post.coffee @@ -188,6 +188,8 @@ class Post return if not (link = $ '.fileText > a, .fileText-original > a', fileRoot) return if not (info = link.nextSibling?.textContent.match /\(([\d.]+ [KMG]?B).*\)/) fileText = fileRoot.firstElementChild + # XXX full images on https://is.4chan.org don't load + link.hostname = 'i.4cdn.org' if link.hostname is 'is.4chan.org' @file = text: fileText link: link @@ -203,6 +205,8 @@ class Post size *= 1024 while unit-- > 0 @file.sizeInBytes = size if (thumb = $ 'a.fileThumb > [data-md5]', fileRoot) + # XXX full images on https://is.4chan.org don't load + thumb.parentNode.hostname = 'i.4cdn.org' if thumb.parentNode.hostname is 'is.4chan.org' $.extend @file, thumb: thumb thumbLink: thumb.parentNode diff --git a/src/css/style.css b/src/css/style.css index 167e6a632..ae039dd1a 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -126,15 +126,18 @@ body > div[style*=" top: -10000px;"] { } /* Ads */ -:root:not(.ads-loaded) .ad-cnt > * { - height: auto; +.ad-cnt > *, .adg-rects > * { + height: auto !important; } :root:not(.ads-loaded) .ad-plea, :root:not(.ads-loaded) hr.abovePostForm, :root:not(.ads-loaded) .ad-plea-bottom + hr { display: none; } -hr + div.center:not(.ad-cnt):not(.topad):not(.middlead):not(.bottomad) { +:root:not(.ads-loaded) .adg-rects { + margin: 0; +} +div.center[style] { display: none !important; } @@ -717,6 +720,8 @@ div[data-checked="false"] > .suboption-list { } .catalog-thread { display: inline-block; + -moz-box-sizing: border-box; + box-sizing: border-box; border: 1px solid transparent; word-wrap: break-word; vertical-align: top; @@ -727,12 +732,12 @@ div[data-checked="false"] > .suboption-list { margin: 4px; } .catalog-small > .catalog-thread { - width: 165px; - height: 320px; + width: 167px; + height: 322px; } .catalog-large > .catalog-thread { - width: 270px; - height: 410px; + width: 272px; + height: 412px; } :root.catalog-hover-expand .catalog-thread:hover { z-index: 1; @@ -825,9 +830,11 @@ div[data-checked="false"] > .suboption-list { .catalog-container:not(:hover) > * > .file, .catalog-container:not(:hover) > * > .postInfo > :not(.subject), .catalog-container:not(:hover) > * > .catalog-replies, +.catalog-container:not(:hover) .extra-linebreak, :root:not(.catalog-hover-expand) .catalog-container > * > .file, :root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject), :root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies, +:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak, .catalog-thread > .catalog-container > :not(.catalog-post), .catalog-post > .file > :not(.fileText), .catalog-post > * > .fileText > :not(:first-child), @@ -878,11 +885,15 @@ div[data-checked="false"] > .suboption-list { :root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) { padding-top: .3em; } +.catalog-post .extra-linebreak { + content: ''; /* makes this work in Blink/WebKit */ + display: block; + margin-top: .3em; +} .catalog-reply { text-align: left; white-space: nowrap; - margin: -1px; - border: 1px solid transparent; + border-top: 1px solid transparent; display: -webkit-flex; display: flex; -webkit-flex-direction: row; @@ -1337,10 +1348,10 @@ input[name="Default Volume"] { box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5); } :root:not(.werkTyme) .catalog-thread.watched .catalog-thumb, -:root.werkTyme .catalog-thread.watched:not(:hover), -:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched, +:root:root.werkTyme .catalog-thread.watched:not(:hover), +:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched, :root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post { - outline: 2px solid rgba(255, 0, 0, .75); + border: 2px solid rgba(255, 0, 0, .75); } /* Spoiler text */ diff --git a/src/css/tomorrow.css b/src/css/tomorrow.css index f208ca4c2..fbbc95617 100644 --- a/src/css/tomorrow.css +++ b/src/css/tomorrow.css @@ -88,7 +88,7 @@ :root.tomorrow.werkTyme .catalog-thread.watched:not(:hover), :root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched, :root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post { - outline: 2px solid rgb(64, 192, 255); + border: 2px solid rgb(64, 192, 255); } diff --git a/src/css/www.css b/src/css/www.css index 7d1fd73c8..75d86eeb4 100644 --- a/src/css/www.css +++ b/src/css/www.css @@ -4,3 +4,8 @@ :root:not(.js-enabled) #form { display: block; } +#bd > div[style], #bd > div[style] > * { + height: auto !important; + margin: 0 !important; + font-size: 0; +} diff --git a/src/main/Main.coffee b/src/main/Main.coffee index d2af67dd9..78c0d0f19 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -129,7 +129,7 @@ Main = else if pathname[2] is 'post' PostSuccessful.init() return - when 'i.4cdn.org' + when 'i.4cdn.org', 'is.4chan.org' return unless pathname[2] and not /s\.jpg$/.test(pathname[2]) $.asap (-> d.readyState isnt 'loading'), -> if Conf['404 Redirect'] and d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found'] @@ -187,7 +187,7 @@ Main = $.addClass doc, 'fourchan-x', 'seaweedchan' $.addClass doc, if g.VIEW is 'thread' then 'thread-view' else g.VIEW $.addClass doc, "ua-#{$.engine}" if $.engine - $.onExists doc, '.ad-cnt', (ad) -> $.onExists ad, 'img', -> $.addClass doc, 'ads-loaded' + $.onExists doc, '.ad-cnt, .adg-rects', (ad) -> $.onExists ad, 'img, iframe', -> $.addClass doc, 'ads-loaded' $.addClass doc, 'autohiding-scrollbar' if Conf['Autohiding Scrollbar'] $.ready -> if d.body.clientHeight > doc.clientHeight and (window.innerWidth is doc.clientWidth) isnt Conf['Autohiding Scrollbar'] diff --git a/src/meta/metadata.js b/src/meta/metadata.js index dde2cff79..f3632c99f 100644 --- a/src/meta/metadata.js +++ b/src/meta/metadata.js @@ -35,6 +35,7 @@ })() %> // @connect i.4cdn.org +// @connect is.4chan.org // @connect * <%= meta.grants.map(function(grant) { diff --git a/src/platform/CrossOrigin.coffee b/src/platform/CrossOrigin.coffee index a35aab189..90543102e 100644 --- a/src/platform/CrossOrigin.coffee +++ b/src/platform/CrossOrigin.coffee @@ -14,7 +14,7 @@ CrossOrigin = # XXX https://forums.lanik.us/viewtopic.php?f=64&t=24173&p=78310 url = url.replace /^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/' <% if (type === 'crx') { %> - if url.split('/')[...3].join('/') is "#{location.protocol}//i.4cdn.org" + if url.split('/')[...3].join('/') in ["#{location.protocol}//i.4cdn.org", "#{location.protocol}//is.4chan.org"] xhr = new XMLHttpRequest() xhr.open 'GET', url, true xhr.setRequestHeader key, value for key, value of headers diff --git a/version.json b/version.json index c503c4162..987bdce14 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.13.0.9", - "date": "2016-10-09T10:48:46.406Z" + "version": "1.13.0.17", + "date": "2016-10-30T05:07:56.889Z" } \ No newline at end of file