diff --git a/.gitignore b/.gitignore index ec9d683c2..9751307ac 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ node_modules/ tmp-crx/ tmp-userjs/ tmp-userscript/ +builds/4chan-X.zip +Gruntfile.js \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b25e5ed4c..32ccd9e03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,125 +1,106 @@ -- Added the option `Hide Unread Count at (0)`, disabled by default. +### 1.1.3 - 2013-04-28 +seaweedchan: +- Chrome doesn't get .null, so don't style it +- Fix count when auto update is disabled and set updater text to "Update" +- Remove /v/ and /vg/ redirection. See https://archive.foolz.us/foolz/thread/509388/ for news and how you can donate to bring /v/ and /vg/ archiving back. +- Toggle keybind for header auto-hiding -### 3.1.4 - *2013-04-17* +MayhemYDG: +- Fix Unread Count taking into account hidden posts. -- Fix QR remembering the file spoiler state when it shouldn't, for real this time. -- Fix inputs in the `Rice` tab being empty when `Custom Board Navigation` is disabled. +### 1.1.2 - 2013-04-26 +seaweedchan: +- Fix emoji and favicon previews not updating on change. +- Fix issue with dragging thread watcher +- Fix some settings not importing when coming from Mayhem's v3 +- Fix menu z-index -### 3.1.3 - *2013-04-16* +MayhemYDG: +- Fix bug where a thread would freeze on load. -- Fix Chrome freezing when switching from the `Filter` tab to another tab in the settings. +zixaphir: +- Fix preview with favicons and emoji +- Fix NaN error on Thread Updater Interval +- Draggable UI can no longer overlap the Header. + -- Setting the header to Autohide also increases its z-index to overlap other UI -### 3.1.2 - *2013-04-16* - -- Fix error with successful posting. - -### 3.1.1 - *2013-04-16* - -- Styling adjustments for the announcement toggler. - -## 3.1.0 - *2013-04-16* - -- **New feature**: `Announcement Hiding`, enabled by default. -- Fix support for www.4chan.org/frames on Chrome. -- Fix quote features not working on dead quotelinks in inlined posts. -- Fix resurrecting dead quotelinks on HTTP. - -### 3.0.6 - *2013-04-14* - -- Fix regression concerning thread selection when quoting on the index. - -### 3.0.5 - *2013-04-14* - -- `Scroll to Last Read Post` is now optional, enabled by default. -- The QR won't auto-hide when auto-hide is enabled and one of its input is focused. Doesn't work on Firefox. -- Added the `Remember QR Size` setting back in, disabled by default. Only on Firefox. -- Fix QR remembering the file spoiler state when it shouldn't. -- Fix QR cooldown in Opera. - -### 3.0.4 - *2013-04-11* - -- More minor fixes. - -### 3.0.3 - *2013-04-10* +### 1.1.1 - 2013-04-26 +zixaphir: +- Fix script on Opera +MayhemYDG: - Minor fixes. +- Chrome only: Due to technical limitations, Filter lists and Custom CSS will not by synchronized across devices anymore. -### 3.0.2 - *2013-04-09* +seaweedchan: +- Allow thread watcher to load on catalog -- Added a setting in the Header's menu to move it at the bottom of the screen. -- Added the `Cooldown` setting back in. -- Fixed the Header going above posts when following quotelinks for example. -- Fixed a bug where dead quotelinks would disappear. +### 1.0.10: +- Add message pertaining to rewrite -### 3.0.1 - *2013-04-08* +### 1.0.9: +ihavenoface: +- Implement Announcement Hiding +seaweedchan: +- Change #options back to inheriting colors from replies +- Fix script breaking when disabling image expansion -- Added the possibility to combine board-list toggle and custom text. -- Added Reply Navigation back in, disabled by default. -- Fixed Thread Hiding initialization error. +### 1.0.8: +seaweedchan: +- Redo settings menu styling +- Move Export/Import buttons and dialog +- Update license and use banner.js for license -# 3.0.0 - *2013-04-07* +### 1.0.7: +qqueue: +- Relative post dates +MayhemYDG: +- Exporting/importing settings -**Major rewrite of 4chan X.** +### 1.0.6 +seaweedchan: +- Update supported boards for archive redirection and custom navigation +- Point to github.io instead of github.com for pages +- Fix post archive link for InstallGentoo and Foolz +- Make InstallGentoo default for /g/ +- Fix embedding issues -Header: - - Easily access features and the boards list directly from the Header. - - The board list can be customized. - - The Header can be automatically hidden. +### 1.0.5: +seaweedchan: +- Added keybind to toggle Fappe Tyme +- Fix code tag keybind +Zixaphir: +- Add 'yourPost' class to own replies -Extension-related changes for Chrome and Opera: - - Installing and updating is now pain-free on Chrome. - - Settings will persist on different subdomains and protocols (HTTP/HTTPS). - - Settings will persist in Incognito on Chrome. - - Clearing your cookies won't erase your settings anymore. - - Fixed Chrome's install warning saying that 4chan X would run on all web sites. +### 1.0.4: +seaweedchan: +- Fix Fappe Tyme +- Re- add label for image expanding +- Move restore button to left side as per RiDeag -Egocentrism: - - `(You)` will be added to quotes linking to your posts. - - The Unread tab icon will indicate new unread posts quoting you with an exclamation mark. +### 1.0.3 +seaweedchan: +- Add ad- blocking CSS into Custom CSS examples +Zixaphir: +- Fix ctrl+s bringing up save dialog +- Fix issues with soundcloud embedding -Quick Reply changes: - - Opening text files will insert their content in the comment field. - - Pasting files/images (e.g. from another website) in Chrome will open them in the QR. - - Cooldown start time is now more accurate, which means shorter cooldown period and faster auto-posting. - - Cooldown remaining time will adjust to your upload speed and file size for faster auto-posting. - - Clicking the submit button while uploading will abort the upload and won't start re-uploading automatically anymore. - - Closing the QR while uploading will abort the upload and won't close the QR anymore. - - Creating threads outside of the index is now possible. - - Selection-to-quote also applies to selected text inside the post, not just inside the comment. - - Added support for thread creation in the catalog. - - Added thumbnailing support for Opera. +### 1.0.2: +seaweedchan: +- New Rice option: Emoji Position +- New layout for Rice tab +- No more Yotsuba / Yotsuba B in options -Image Expansion changes: - - The toggle and settings are now located in the Header's shortcuts and menu. - - Expanding spoilers along with all non-spoiler images is now optional, and disabled by default. - - Expanding OP images won't squish replies anymore. +### 1.0.1: +- New option: Emoji +- New Rice option: Sage Emoji +seaweedchan: +- Prettier error messages -Thread Updater changes: - - The Thread Updater will now notify of sticky/closed status change and update the icons. - - The Thread Updater will pause when offline, and resume when online. - - Added a setting to always auto-scroll to the bottom instead of the first new post. - -Unread posts changes: - - Added a line to distinguish read posts from unread ones. - - Read posts won't be marked as unread after reloading a thread. - - The page will scroll to the last read post after reloading a thread. - - Visible posts will not be taken into account towards the unread count. - -Thread Stats changes: - - Post and file count will now adjust with deleted posts. - - The post count will now become red past the bump limit. - - The file count will not become red anymore inside sticky threads. - -Thread/Post Hiding changes: - - Added Thread & Post Hiding in the Menu, with individual settings. - - Thread & Post Hiding Buttons can now be disabled in the settings. - - Recursive Hiding will be automatically applied when manually showing/hiding a post. - -Other: - - Added touch and multi-touch support for dragging windows. - - Added [eqn] and [math] tags keybind. - - Fix Chrome's install warning saying that 4chan X would execute on all domains. - - Fix Quote Backlinks and Quote Highlighting not affecting inlined quotes. - - Fix unreadable inlined posts with the Tomorrow theme. - - Fix user ID highlighting on fetched posts. - - More fixes and improvements. +### 1.0.0 +- Initial release +zixaphir: +- Fix unread post count for filtered posts +- Fix issues when switching from ihavenoface's fork +- Fix backlinks not receiving filtered class +- Fix QR position not saving on refresh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 5e386b1ee..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,50 +0,0 @@ -## Reporting bugs and suggestions - -Reporting bugs: - -1. Make sure both your **browser** and **4chan X** are up to date. -2. Disable your other extensions & scripts to identify conflicts. -3. If your issue persists, open a [new issue](https://github.com/MayhemYDG/4chan-x/issues) with the following information: - 1. Precise steps to reproduce the problem, with the expected and actual results. - 2. Console errors, if any. - 3. Browser version. - 4. Your exported settings. - -Open your console with: -- `Ctrl + Shift + J` on Chrome. -- `Ctrl + Shift + K` on Firefox. -- `Ctrl + Shift + O` on Opera. - -Respect these guidelines: -- Describe the issue clearly, put some effort into it. A one-liner isn't a good enough description. -- If you want to get your suggestion implemented sooner, make it convincing. -- If you want to criticize, make it convincing and constructive. -- Be mature. Act like an idiot and you will be blocked without warning. - -## Development & Contribution - -### Get started - -- Install [node.js](http://nodejs.org/). -- Install [Grunt's CLI](http://gruntjs.com/) with `npm install -g grunt-cli`. -- Clone 4chan X. -- `cd` into it. -- Install/Update 4chan X dependencies with `npm install`. - -### Build - -- Build with `grunt`. -- Continuously build with `grunt watch`. - -### Release - -- Update the version with `grunt patch`, `grunt minor` or `grunt major`. -- Release with `grunt release`. - -Note: this is only used to release new 4chan X versions, and is **not** needed or wanted in pull requests. - -### Contribute - -- Edit the CoffeeScript sources. -- If the edits affect regular users, edit the changelog. -- Open a pull request. diff --git a/Gruntfile.coffee b/Gruntfile.coffee index d4d82747d..abb4f62b7 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -17,29 +17,47 @@ module.exports = (grunt) -> coffee: options: concatOptions src: [ - 'src/config.coffee' - 'src/globals.coffee' - 'src/lib/*.coffee' - 'src/features/*/*.coffee' - 'src/settings.coffee' - 'src/main.coffee' + 'src/General/Config.coffee' + 'src/General/Globals.coffee' + 'src/General/lib/*.coffee' + 'src/General/Header.coffee' + 'src/General/Build.coffee' + 'src/General/Get.coffee' + 'src/General/UI.coffee' + 'src/Filtering/*' + 'src/Quotelinks/*' + 'src/Linkification/*' + 'src/Posting/*' + 'src/Images/*' + 'src/Menu/*' + 'src/Monitoring/*' + 'src/Archive/*' + 'src/Theming/*' + 'src/Miscellaneous/*' + 'src/General/Settings.coffee' + 'src/General/Main.coffee' ] dest: 'tmp-<%= pkg.type %>/script.coffee' + license: + options: concatOptions + files: + 'LICENSE': 'src/General/meta/banner.js' + crx: options: concatOptions files: - 'builds/crx/manifest.json': 'src/meta/manifest.json' + 'builds/crx/manifest.json': 'src/General/meta/manifest.json' 'builds/crx/script.js': [ - 'src/banner.js' + 'src/General/meta/banner.js' 'tmp-<%= pkg.type %>/script.js' ] userjs: options: concatOptions src: [ - 'src/meta/metadata.js' - 'src/meta/banner.js' + 'src/General/meta/metadata.js' + 'src/General/meta/banner.js' 'tmp-<%= pkg.type %>/script.js' ] dest: 'builds/<%= pkg.name %>.js' @@ -47,16 +65,16 @@ module.exports = (grunt) -> userscript: options: concatOptions files: - 'builds/<%= pkg.name %>.meta.js': 'src/metadata.js' + 'builds/<%= pkg.name %>.meta.js': 'src/General/meta/metadata.js' 'builds/<%= pkg.name %>.user.js': [ - 'src/meta/metadata.js' - 'src/meta/banner.js' + 'src/General/meta/metadata.js' + 'src/General/meta/banner.js' 'tmp-<%= pkg.type %>/script.js' ] copy: crx: - src: 'src/img/*.png' + src: 'src/General/img/*.png' dest: 'builds/crx/' expand: true flatten: true @@ -80,7 +98,7 @@ module.exports = (grunt) -> 'git checkout <%= pkg.meta.mainBranch %>', 'git commit -am "Release <%= pkg.meta.name %> v<%= pkg.version %>."', 'git tag -a <%= pkg.version %> -m "<%= pkg.meta.name %> v<%= pkg.version %>."', - 'git tag -af stable-v3 -m "<%= pkg.meta.name %> v<%= pkg.version %>."' + 'git tag -af stable -m "<%= pkg.meta.name %> v<%= pkg.version %>."' ].join(' && ') stdout: true @@ -135,6 +153,7 @@ module.exports = (grunt) -> grunt.registerTask 'build', [ 'concurrent:build' + 'concat:license' ] grunt.registerTask 'build-crx', [ @@ -164,38 +183,39 @@ module.exports = (grunt) -> grunt.registerTask 'release', [ 'default' + 'compress:crx' 'shell:commit' 'shell:push' ] grunt.registerTask 'patch', [ 'bump' - 'reloadPkh' + 'reloadPkg' 'updcl:3' ] grunt.registerTask 'minor', [ 'bump:minor' - 'reloadPkh' + 'reloadPkg' 'updcl:2' ] grunt.registerTask 'major', [ 'bump:major' - 'reloadPkh' + 'reloadPkg' 'updcl:1' ] grunt.registerTask 'reloadPkg', 'Reload the package', -> # Update the `pkg` object with the new version. pkg = grunt.file.readJSON('package.json') - concatOptions.process.data = pkg + grunt.config.data.pkg = concatOptions.process.data = pkg grunt.log.ok('pkg reloaded.') grunt.registerTask 'updcl', 'Update the changelog', (i) -> # i is the number of #s for markdown. version = [] version.length = +i + 1 - version = version.join('#') + ' ' + pkg.version + ' *(' + grunt.template.today('yyyy-mm-dd') + ')*' + version = version.join('#') + ' ' + pkg.version + ' - ' + grunt.template.today('yyyy-mm-dd') grunt.file.write 'CHANGELOG.md', version + '\n' + grunt.file.read('CHANGELOG.md') grunt.log.ok 'Changelog updated for v' + pkg.version + '.' \ No newline at end of file diff --git a/LICENSE b/LICENSE index 37991acde..797da2bb6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,22 +1,89 @@ -Copyright (c) 2009-2011 James Campos -Copyright (c) 2012-2013 Nicolas Stepien +/* +* appchan x - Version 2.0.0 - 2013-04-28 +* +* Licensed under the MIT license. +* https://github.com/zixaphir/appchan-x/blob/master/LICENSE +* +* Appchan X Copyright © 2013-2013 Zixaphir +* http://zixaphir.github.io/appchan-x/ +* 4chan x Copyright © 2009-2011 James Campos +* https://github.com/aeosynth/4chan-x +* 4chan x Copyright © 2012-2013 Nicolas Stepien +* https://4chan-x.just-believe.in/ +* 4chan x Copyright © 2013-2013 Jordan Bates +* http://seaweedchan.github.io/4chan-x/ +* 4chan x Copyright © 2012-2013 ihavenoface +* http://ihavenoface.github.io/4chan-x/ +* 4chan SS Copyright © 2011-2013 Ahodesuka +* https://github.com/ahodesuka/4chan-Style-Script/ +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Contributors: +* aeosynth +* mayhemydg +* noface +* !K.WeEabo0o +* blaise +* that4chanwolf +* desuwa +* seaweed +* e000 +* ahodesuka +* Shou +* ferongr +* xat +* Ongpot +* thisisanon +* Anonymous +* Seiba +* herpaderpderp +* WakiMiko +* btmcsweeney +* AppleBloom +* +* All the people who've taken the time to write bug reports. +* +* Thank you. +*/ -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +/* +* Contains data from external sources: +* +* audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/ +* cc-by-nc-3.0 +* +* 4chan/4chan-JS (https://github.com/4chan/4chan-JS) +* Copyright (c) 2012-2013, 4chan LLC +* All rights reserved. +* +* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE +* +* Linkify: (http://userscripts.org/scripts/show/1352) +* Copyright (c) 2011, Anthony Lieuallen +* All rights reserved. +* Originally written by Anthony Lieuallen of http://arantius.com/ +* Licensed for unlimited modification and redistribution as long as +* this notice is kept intact. +* +* license: http://userscripts.org/scripts/review/1352 +* +*/ \ No newline at end of file diff --git a/README.md b/README.md index c8c176c3d..56406429b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,44 @@ -# 4chan X +# Get 4chan X [HERE](http://seaweedchan.github.io/4chan-x/). -Get it [here](https://4chan-x.just-believe.in/). +## Reporting bugs and suggestions -*** +1. Make sure both your **browser** and **4chan X** are up to date. +2. Disable your other extensions & scripts to identify conflicts. +3. If your issue persists, open a [new issue](https://github.com/seaweedchan/4chan-x/issues) with the following information: + 1. Precise steps to reproduce the problem, with the expected and actual results. + 2. Console errors, if any. + 3. Browser version. + 4. Your exported settings. -### [MIT License](/LICENSE) -### [Contribute](/CONTRIBUTING.md) +Open your console with: +- `Ctrl + Shift + J` on Chrome. +- `Ctrl + Shift + K` on Firefox. +- `Ctrl + Shift + O` on Opera. + +## Development & Contribution + +### Get started + +- Install [node.js](http://nodejs.org/). +- Install [Grunt's CLI](http://gruntjs.com/) with `npm install -g grunt-cli`. +- Clone 4chan X. +- `cd` into it. +- Install/Update 4chan X dependencies with `npm install`. + +### Build + +- Build with `grunt`. +- Continuously build with `grunt watch`. + +### Release + +- Update the version with `grunt patch`, `grunt minor` or `grunt major`. +- Release with `grunt release`. + +Note: this is only used to release new 4chan X versions, and is **not** needed or wanted in pull requests. + +### Contribute + +- Edit the CoffeeScript sources. +- If the edits affect regular users, edit the changelog. +- Open a pull request. \ No newline at end of file diff --git a/builds/appchan-x.js b/builds/appchan-x.js index fdf2c013e..5940231f2 100644 --- a/builds/appchan-x.js +++ b/builds/appchan-x.js @@ -3,8 +3,7 @@ // @version 2.0.0 // @namespace zixaphir // @description The most comprehensive 4chan userscript. -// @copyright 2012-2013 Zixaphir -// @license MIT; http://en.wikipedia.org/wiki/Mit_license +// @license MIT; https://github.com/zixaphir/appchan-x/blob/Av2/LICENSE // @match *://api.4chan.org/* // @match *://boards.4chan.org/* // @match *://images.4chan.org/* @@ -14,35 +13,102 @@ // @grant GM_deleteValue // @grant GM_openInTab // @run-at document-start -// @updateURL http://zixaphir.github.com/appchan-x/builds/appchan-x.meta.js -// @downloadURL http://zixaphir.github.com/appchan-x/builds/appchan-x.user.js +// @updateURL https://github.com/zixaphir/appchan-x/raw/stable/builds/4chan_X.meta.js +// @downloadURL https://github.com/zixaphir/appchan-x/raw/stable/builds/4chan_X.user.js // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEX///8EZgR8ulSk0oT///8EAgQ1A88mAAAAAXRSTlMAQObYZgAAAIpJREFUeF6t0sENwjAMhWF84N4H6gAYMUBkdQMYwfuvwmstEeD4kl892P0OaaWcpga2/K0SGII1HNBXARgu7veoY3ANd+esgMHZIz85u0EABrbms3pl/bkC1Tn5ihGOfQwqHeZ/FdYdirEMgCG2ZAQWDTL0m9FvjAhcvoGNAK2gZhGYYX9+ZgFm9gaiNmNkMENY4QAAAABJRU5ErkJggg== // ==/UserScript== -/* appchan x - Version 2.0.0 - 2013-04-23 - * http://zixaphir.github.com/appchan-x/ - * - * Copyright (c) 2009-2011 James Campos - * Copyright (c) 2012-2013 Nicolas Stepien - * Licensed under the MIT license. - * https://github.com/zixaphir/appchan-x/blob/master/LICENSE - * - * Contributors: - * https://github.com/zixaphir/appchan-x/graphs/contributors - * Non-GitHub contributors: - * ferongr, xat-, Ongpot, thisisanon and Anonymous - favicon contributions - * e000 - cooldown sanity check - * Seiba - chrome quick reply focusing - * herpaderpderp - recaptcha fixes - * WakiMiko - recaptcha tab order http://userscripts.org/scripts/show/82657 - * - * All the people who've taken the time to write bug reports. - * - * Thank you. - */ +/* +* appchan x - Version 2.0.0 - 2013-04-28 +* +* Licensed under the MIT license. +* https://github.com/zixaphir/appchan-x/blob/master/LICENSE +* +* Appchan X Copyright © 2013-2013 Zixaphir +* http://zixaphir.github.io/appchan-x/ +* 4chan x Copyright © 2009-2011 James Campos +* https://github.com/aeosynth/4chan-x +* 4chan x Copyright © 2012-2013 Nicolas Stepien +* https://4chan-x.just-believe.in/ +* 4chan x Copyright © 2013-2013 Jordan Bates +* http://seaweedchan.github.io/4chan-x/ +* 4chan x Copyright © 2012-2013 ihavenoface +* http://ihavenoface.github.io/4chan-x/ +* 4chan SS Copyright © 2011-2013 Ahodesuka +* https://github.com/ahodesuka/4chan-Style-Script/ +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Contributors: +* aeosynth +* mayhemydg +* noface +* !K.WeEabo0o +* blaise +* that4chanwolf +* desuwa +* seaweed +* e000 +* ahodesuka +* Shou +* ferongr +* xat +* Ongpot +* thisisanon +* Anonymous +* Seiba +* herpaderpderp +* WakiMiko +* btmcsweeney +* AppleBloom +* +* All the people who've taken the time to write bug reports. +* +* Thank you. +*/ +/* +* Contains data from external sources: +* +* audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/ +* cc-by-nc-3.0 +* +* 4chan/4chan-JS (https://github.com/4chan/4chan-JS) +* Copyright (c) 2012-2013, 4chan LLC +* All rights reserved. +* +* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE +* +* Linkify: (http://userscripts.org/scripts/show/1352) +* Copyright (c) 2011, Anthony Lieuallen +* All rights reserved. +* Originally written by Anthony Lieuallen of http://arantius.com/ +* Licensed for unlimited modification and redistribution as long as +* this notice is kept intact. +* +* license: http://userscripts.org/scripts/review/1352 +* +*/ (function() { - var $, $$, Anonymize, ArchiveLink, Banner, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, GlobalMessage, Header, Icons, ImageExpand, ImageHover, ImageReplace, JSColor, Keybinds, Linkify, Main, MascotTools, Mascots, Menu, MutationObserver, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, Report, ReportLink, RevealSpoilers, Rice, Sauce, Settings, Style, ThemeTools, Themes, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, editMascot, editTheme, g, userNavigation, + var $, $$, Anonymize, ArchiveLink, Banner, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, GlobalMessage, Header, IDColor, Icons, ImageExpand, ImageHover, ImageReplace, JSColor, Keybinds, Linkify, Main, MascotTools, Mascots, Menu, MutationObserver, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Rice, Sauce, Settings, Style, ThemeTools, Themes, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, editMascot, editTheme, g, userNavigation, __slice = [].slice, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; @@ -52,7 +118,6 @@ 'Miscellaneous': { 'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], 'External Catalog': [false, 'Link to external catalog instead of the internal one.'], - 'Custom Board Navigation': [false, 'Show custom links instead of the full board list.'], 'QR Shortcut': [false, 'Adds a small [QR] link in the header.'], 'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'], '404 Redirect': [true, 'Redirect dead threads and images.'], @@ -64,7 +129,11 @@ 'Thread Expansion': [true, 'Add buttons to expand threads.'], 'Index Navigation': [false, 'Add buttons to navigate between threads.'], 'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'], - 'Check for Updates': [true, 'Check for updated versions of appchan x.'] + 'Check for Updates': [true, 'Check for updated versions of appchan x.'], + 'Emoji': [false, 'Adds icons next to names for different emails'], + 'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'], + 'Remove Spoilers': [false, 'Remove all spoilers in text.'], + 'Indicate Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled.'] }, 'Linkification': { 'Linkify': [true, 'Convert text into links where applicable.'], @@ -101,7 +170,7 @@ 'Monitoring': { 'Thread Updater': [true, 'Fetch and insert new replies. Has more options in its own dialog.'], 'Unread Count': [true, 'Show the unread posts count in the tab title.'], - 'Hide Unread Count at (0)': [false, 'Hide the unread posts count when it reaches 0.'], + 'Hide Unread Count at (0)': [false, 'Hide the unread posts count in the tab title when it reaches 0.'], 'Unread Favicon': [true, 'Show a different favicon when there are unread posts.'], 'Unread Line': [true, 'Show a line to distinguish read posts from unread ones.'], 'Scroll to Last Read Post': [true, 'Scroll back to the last read post when reopening a thread.'], @@ -120,7 +189,8 @@ 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], 'Remember QR Size': [false, 'Remember the size of the quick reply\'s comment field.'], 'Hide Original Post Form': [true, 'Hide the normal post form.'], - 'Cooldown': [true, 'Prevent "flood detected" errors.'] + 'Cooldown': [true, 'Indicate the remaining time before posting again.'], + 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'] }, 'Quote Links': { 'Quote Backlinks': [true, 'Add quote backlinks.'], @@ -131,6 +201,7 @@ 'Quote Highlighting': [true, 'Highlight the previewed post.'], 'Resurrect Quotes': [true, 'Link dead quotes to the archives.'], 'Mark Quotes of You': [true, 'Add \'(You)\' to quotes linking to your posts.'], + 'Highlight Own Posts': [false, 'Highlights own posts if Mark Quotes of You is enabled.'], 'Mark OP Quotes': [true, 'Add \'(OP)\' to OP quotes.'], 'Mark Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes.'], 'Quote Threading': [false, 'Thread conversations'] @@ -160,8 +231,7 @@ '4chan Banner Reflection': [false, 'Adds reflection effects to 4chan\'s image banner.'], 'Faded 4chan Banner': [true, 'Make 4chan\'s image banner translucent.'], 'Icon Orientation': ['horizontal', 'Change the orientation of the appchan x icons.', ['horizontal', 'vertical']], - 'Slideout Watcher': [true, 'Adds an icon you can hover over to show the watcher, as opposed to having the watcher always visible.'], - 'Updater Position': ['top', 'The position of 4chan thread updater and stats', ['top', 'bottom', 'moveable']] + 'Slideout Watcher': [true, 'Adds an icon you can hover over to show the watcher, as opposed to having the watcher always visible.'] }, Posts: { 'Alternate Post Colors': [false, 'Make post background colors alternate every other post.'], @@ -245,10 +315,18 @@ MD5: '' }, sauces: "https://www.google.com/searchbyimage?image_url=%TURL\nhttp://iqdb.org/?url=%TURL\n#//tineye.com/search?url=%TURL\n#http://saucenao.com/search.php?url=%TURL\n#http://3d.iqdb.org/?url=%TURL\n#http://regex.info/exif.cgi?imgurl=%URL\n# uploaders:\n#http://imgur.com/upload?url=%URL;text:Upload to imgur\n#http://ompldr.org/upload?url1=%URL;text:Upload to ompldr\n# \"View Same\" in archives:\n#//archive.foolz.us/_/search/image/%MD5/;text:View same on foolz\n#//archive.foolz.us/%board/search/image/%MD5/;text:View same on foolz /%board/\n#//archive.installgentoo.net/%board/image/%MD5;text:View same on installgentoo /%board/", + 'sageEmoji': 'appchan', + 'emojiPos': 'before', 'Custom CSS': false, - 'Boards Navigation': 'Sticky top', - 'Header auto-hide': false, - 'Header catalog links': false, + Header: { + 'Fixed Header': true, + 'Header auto-hide': false, + 'Bottom Header': false, + 'Hide Header': false, + 'Header catalog links': false, + 'Bottom Board List': true, + 'Custom Board Navigation': true + }, boardnav: '[ toggle-all ] [current-title]', time: '%m/%d/%y(%a)%H:%M:%S', backlink: '>>%id', @@ -257,15 +335,17 @@ usercss: "/* Tripcode Italics: */\n/*\nspan.postertrip {\nfont-style: italic;\n}\n*/\n\n/* Add a rounded border to thumbnails (but not expanded images): */\n/*\n.fileThumb > img:first-child {\nborder: solid 2px rgba(0,0,100,0.5);\nborder-radius: 10px;\n}\n*/\n\n/* Make highlighted posts look inset on the page: */\n/*\ndiv.post:target,\ndiv.post.highlight {\nbox-shadow: inset 2px 2px 2px rgba(0,0,0,0.2);\n}\n*/", hotkeys: { 'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'], - 'Open empty QR': ['l', 'Open QR without post number inserted.'], - 'Open QR': ['Shift+l', 'Open QR with post number inserted.'], + 'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'], + 'Open empty QR': ['i', 'Open QR without post number inserted.'], + 'Open QR': ['Shift+i', 'Open QR with post number inserted.'], 'Open settings': ['Alt+o', 'Open Settings.'], 'Close': ['Esc', 'Close Settings, Notifications or QR.'], 'Spoiler tags': ['Ctrl+s', 'Insert spoiler tags.'], 'Code tags': ['Alt+c', 'Insert code tags.'], 'Eqn tags': ['Alt+e', 'Insert eqn tags.'], 'Math tags': ['Alt+m', 'Insert math tags.'], - 'Submit QR': ['Alt+s', 'Submit post.'], + 'Toggle sage': ['Alt+s', 'Toggle sage in email field'], + 'Submit QR': ['Ctrl+Enter', 'Submit post.'], 'Watch': ['w', 'Watch thread.'], 'Update': ['r', 'Update the thread now.'], 'Expand image': ['Shift+e', 'Expand selected image.'], @@ -275,6 +355,7 @@ 'Open front page': ['Shift+0', 'Open page 0 in a new tab.'], 'Next page': ['Right', 'Jump to the next page.'], 'Previous page': ['Left', 'Jump to the previous page.'], + 'Open catalog': ['Shift+c', 'Open the catalog of the current board'], 'Next thread': ['Down', 'See next thread.'], 'Previous thread': ['Up', 'See previous thread.'], 'Expand thread': ['Ctrl+e', 'Expand thread.'], @@ -2440,6 +2521,59 @@ "4chan SS": 'iVBORw0KGgoAAAANSUhEUgAAAA8AAACWCAMAAAA2YSLzAAAAPFBMVEVkZGRlZWVjY2NmZmZnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dZxmG7AAAAE3RSTlMFFQ0AJD8eQFRqf5CgssDM4+73gHqZRAAAA0pJREFUSMetVlmy5CgMZDMGxK7737Ulgcu8ejMREzHtD7sShJRaKWV/Psq3iz7QGwTF2BZ01hp3N6yasctZJANiN5ZlItDLtNkQDGNeMLU7EqmCbUwhkhZbwsIuNbyWPX7dIyHOrDYOc8SOiEUJjojN0EsWlCXRrq2qvJCsIjic2OcFrwrOpdmTimqVyWG7ZkrWy97p7z/hACd2FUetBcQDpTN+nuKsGng881L5xOz/VQ88xL/eQkyZT3axp+4dUMwvH0Pnhn6wSyR+8IdR4f43/v8XX1BHjXpjwy5RdEcQ7DiuzlBUsFD+GeIFEy6W0pKXoSZOiUz5tf99nvTDD/1sP9VRPvb/un86lT57SVqwSk8KR+L6kgTOlcZslRQe5WmJRKovETW7Anb+HzxUW4Xgnv11fuuj82aKXHz1Tzztx9v4VA9+/6le26B+3VhTC9RMPIr0qx4zaWNsnFRO0s8FWgEIFIRiVUAIlJGciqMmCwpQWyI/OplXA1RrXG1YI2svTQ3ufhWjNlKFqtXFI7Yg+zAXRcBZ+HygJuVHd0ys35bVn6QojLL5cZeVvPht/mVu/r/8s7GMXsLjv2s71GZhgjnEwsEVXogiSl/pl7LWra0IQgO3poTsieoYd4dhWfJlGWqyQf6sLxWt3/MRa4Im04ixeSdAWnxvqCX6tObVmzpZOPOZvrBNJF8gmGciBChsV+YdRYwnAvNpS4AnYFBm0KA2a35Unh+efxjercaLfV7wW0rtUTNl2j715al/9VtfutF+NZ/+aZSa+py/GCpRyvr17EsVLbRhmN++BBY/ik5/+YPK6bKnf2T8fh7P+uEYn0D3E4L3i6QHmvc3+k+8PN6Mb1w52tje6LbAi+M0FT4YneqVbpVDPnL2Xqx7m3tf9ENXHba9H/a/+X3z/+XfCnOo+Zy/o4SgY5Z6iq0nb+9Mc4JxL5f1qYs+xhTP/uiX/cMe4+hDHAfGnmGe+Ev+G88vnG7Ie20wHiUt/S1Kv+6BCM/9fkEfz73/9HNufQ4ZKdzvnwtS/LXltRcJB/yJ23H/mo89nPFa85Li3XOYu435LwTXKVWwO+cnlWFTB47L/AdfR//KI2bvF8sAb0c/M+1+YE3/oS77B8N+UUVHraV6AAAAAElFTkSuQmCC' }; + String.prototype.capitalize = function() { + return this.charAt(0).toUpperCase() + this.slice(1); + }; + + String.prototype.contains = function(string) { + return this.indexOf(string) > -1; + }; + + Array.prototype.add = function(object, position) { + var keep; + + keep = this.slice(position); + this.length = position; + this.push(object); + return this.pushArrays(keep); + }; + + Array.prototype.contains = function(object) { + return this.indexOf(object) > -1; + }; + + Array.prototype.indexOf = function(object) { + var i; + + i = this.length; + while (i--) { + if (this[i] === object) { + break; + } + } + return i; + }; + + Array.prototype.pushArrays = function() { + var arg, args, _i, _len; + + args = arguments; + for (_i = 0, _len = args.length; _i < _len; _i++) { + arg = args[_i]; + this.push.apply(this, arg); + } + }; + + Array.prototype.remove = function(object) { + var index; + + if ((index = this.indexOf(object)) > -1) { + return this.splice(index, 1); + } else { + return false; + } + }; + $ = function(selector, root) { if (root == null) { root = d.body; @@ -2447,15 +2581,6 @@ return root.querySelector(selector); }; - $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))); - - $$ = function(selector, root) { - if (root == null) { - root = d.body; - } - return __slice.call(root.querySelectorAll(selector)); - }; - $.extend = function(object, properties) { var key, val; @@ -2468,400 +2593,371 @@ } }; - $.extend(Array.prototype, { - add: function(object, position) { - var keep; + $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))); - keep = this.slice(position); - this.length = position; - this.push(object); - return this.pushArrays(keep); - }, - contains: function(object) { - return this.indexOf(object) > -1; - }, - indexOf: function(object) { - var i; + $.id = function(id) { + return d.getElementById(id); + }; - i = this.length; - while (i--) { - if (this[i] === object) { - break; - } + $.ready = function(fc) { + var cb, _ref; + + if ((_ref = d.readyState) === 'interactive' || _ref === 'complete') { + $.queueTask(fc); + return; + } + cb = function() { + $.off(d, 'DOMContentLoaded', cb); + return fc(); + }; + return $.on(d, 'DOMContentLoaded', cb); + }; + + $.formData = function(form) { + var fd, key, val; + + if (form instanceof HTMLFormElement) { + return new FormData(form); + } + fd = new FormData(); + for (key in form) { + val = form[key]; + if (!val) { + continue; } - return i; - }, - pushArrays: function() { - var arg, args, _i, _len; - - args = arguments; - for (_i = 0, _len = args.length; _i < _len; _i++) { - arg = args[_i]; - this.push.apply(this, arg); - } - }, - remove: function(object) { - var index; - - if ((index = this.indexOf(object)) > -1) { - return this.splice(index, 1); + if (val.size && val.name) { + fd.append(key, val, val.name); } else { - return false; + fd.append(key, val); } } - }); + return fd; + }; - $.extend(String.prototype, { - capitalize: function() { - return this.charAt(0).toUpperCase() + this.slice(1); - }, - contains: function(string) { - return this.indexOf(string) > -1; + $.ajax = function(url, callbacks, opts) { + var cred, form, headers, key, r, sync, type, upCallbacks, val; + + if (opts == null) { + opts = {}; } - }); + type = opts.type, cred = opts.cred, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form, sync = opts.sync; + r = new XMLHttpRequest(); + r.overrideMimeType('text/html'); + type || (type = form && 'post' || 'get'); + r.open(type, url, !sync); + for (key in headers) { + val = headers[key]; + r.setRequestHeader(key, val); + } + $.extend(r, callbacks); + $.extend(r.upload, upCallbacks); + r.withCredentials = cred; + r.send(form); + return r; + }; - $.extend($, { - id: function(id) { - return d.getElementById(id); - }, - ready: function(fc) { - var cb, _ref; + $.cache = (function() { + var reqs; - if ((_ref = d.readyState) === 'interactive' || _ref === 'complete') { - $.queueTask(fc); + reqs = {}; + return function(url, cb) { + var req, rm; + + if (req = reqs[url]) { + if (req.readyState === 4) { + cb.call(req); + } else { + req.callbacks.push(cb); + } return; } - cb = function() { - $.off(d, 'DOMContentLoaded', cb); - return fc(); + rm = function() { + return delete reqs[url]; }; - return $.on(d, 'DOMContentLoaded', cb); - }, - formData: function(form) { - var fd, key, val; + req = $.ajax(url, { + onload: function(e) { + var _i, _len, _ref; - if (form instanceof HTMLFormElement) { - return new FormData(form); - } - fd = new FormData(); - for (key in form) { - val = form[key]; - if (!val) { - continue; - } - if (val.size && val.name) { - fd.append(key, val, val.name); - } else { - fd.append(key, val); - } - } - return fd; - }, - ajax: function(url, callbacks, opts) { - var cred, form, headers, key, r, sync, type, upCallbacks, val; - - if (opts == null) { - opts = {}; - } - type = opts.type, cred = opts.cred, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form, sync = opts.sync; - r = new XMLHttpRequest(); - r.overrideMimeType('text/html'); - type || (type = form && 'post' || 'get'); - r.open(type, url, !sync); - for (key in headers) { - val = headers[key]; - r.setRequestHeader(key, val); - } - $.extend(r, callbacks); - $.extend(r.upload, upCallbacks); - r.withCredentials = cred; - r.send(form); - return r; - }, - cache: (function() { - var reqs; - - reqs = {}; - return function(url, cb) { - var req, rm; - - if (req = reqs[url]) { - if (req.readyState === 4) { - cb.call(req); - } else { - req.callbacks.push(cb); + _ref = this.callbacks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + cb = _ref[_i]; + cb.call(this, e); } - return; - } - rm = function() { - return delete reqs[url]; - }; - req = $.ajax(url, { - onload: function(e) { - var _i, _len, _ref; - - _ref = this.callbacks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - cb = _ref[_i]; - cb.call(this, e); - } - return delete this.callbacks; - }, - onabort: rm, - onerror: rm - }); - req.callbacks = [cb]; - return reqs[url] = req; - }; - })(), - cb: { - checked: function() { - $.set(this.name, this.checked); - return Conf[this.name] = this.checked; - }, - value: function() { - $.set(this.name, this.value.trim()); - return Conf[this.name] = this.value; - } - }, - asap: function(test, cb) { - if (test()) { - return cb(); - } else { - return setTimeout($.asap, 25, test, cb); - } - }, - addStyle: function(css, id) { - var style; - - style = $.el('style', { - id: id, - textContent: css + return delete this.callbacks; + }, + onabort: rm, + onerror: rm }); - $.asap((function() { - return d.head; - }), function() { - return $.add(d.head, style); - }); - return style; - }, - x: function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, 8, null).singleNodeValue; - }, - X: function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); - }, - addClass: function(el, className) { - return el.classList.add(className); - }, - rmClass: function(el, className) { - return el.classList.remove(className); - }, - toggleClass: function(el, className) { - return el.classList.toggle(className); - }, - hasClass: function(el, className) { - return el.classList.contains(className); - }, - rm: (function() { - if ('remove' in Element.prototype) { - return function(el) { - return el.remove(); - }; - } else { - return function(el) { - var _ref; + req.callbacks = [cb]; + return reqs[url] = req; + }; + })(); - return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; - }; - } - })(), - rmAll: function(root) { - var node; - - while (node = root.firstChild) { - root.removeChild(node); - } + $.cb = { + checked: function() { + $.set(this.name, this.checked); + return Conf[this.name] = this.checked; }, - tn: function(s) { - return d.createTextNode(s); - }, - frag: function() { - return d.createDocumentFragment(); - }, - nodes: function(nodes) { - var frag, node, _i, _len; - - if (!(nodes instanceof Array)) { - return nodes; - } - frag = $.frag(); - for (_i = 0, _len = nodes.length; _i < _len; _i++) { - node = nodes[_i]; - frag.appendChild(node); - } - return frag; - }, - add: function(parent, el) { - return parent.appendChild($.nodes(el)); - }, - prepend: function(parent, el) { - return parent.insertBefore($.nodes(el), parent.firstChild); - }, - after: function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root.nextSibling); - }, - before: function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root); - }, - replace: function(root, el) { - return root.parentNode.replaceChild($.nodes(el), root); - }, - el: function(tag, properties) { - var el; - - el = d.createElement(tag); - if (properties) { - $.extend(el, properties); - } - return el; - }, - on: function(el, events, handler) { - var event, _i, _len, _ref; - - _ref = events.split(' '); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - event = _ref[_i]; - el.addEventListener(event, handler, false); - } - }, - off: function(el, events, handler) { - var event, _i, _len, _ref; - - _ref = events.split(' '); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - event = _ref[_i]; - el.removeEventListener(event, handler, false); - } - }, - event: function(event, detail, root) { - if (root == null) { - root = d; - } - return root.dispatchEvent(new CustomEvent(event, { - bubbles: true, - detail: detail - })); - }, - open: (function() { - if (typeof GM_openInTab !== "undefined" && GM_openInTab !== null) { - return function(URL) { - var a; - - a = $.el('a', { - href: URL - }); - return GM_openInTab(a.href); - }; - } else { - return function(URL) { - return window.open(URL, '_blank'); - }; - } - })(), - debounce: function(wait, fn) { - var args, exec, that, timeout; - - timeout = null; - that = null; - args = null; - exec = function() { - fn.apply(that, args); - return timeout = null; - }; - return function() { - args = arguments; - that = this; - if (timeout) { - clearTimeout(timeout); - } else { - exec(); - } - return timeout = setTimeout(exec, wait); - }; - }, - queueTask: (function() { - var execTask, taskChannel, taskQueue; - - taskQueue = []; - execTask = function() { - var args, func, task; - - task = taskQueue.shift(); - func = task[0]; - args = Array.prototype.slice.call(task, 1); - return func.apply(func, args); - }; - if (window.MessageChannel) { - taskChannel = new MessageChannel(); - taskChannel.port1.onmessage = execTask; - return function() { - taskQueue.push(arguments); - return taskChannel.port2.postMessage(null); - }; - } else { - return function() { - taskQueue.push(arguments); - return setTimeout(execTask, 0); - }; - } - })(), - globalEval: function(code) { - var script; - - script = $.el('script', { - textContent: code - }); - $.add(d.head || doc, script); - return $.rm(script); - }, - bytesToString: function(size) { - var unit; - - unit = 0; - while (size >= 1024) { - size /= 1024; - unit++; - } - size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); - return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit]; - }, - minmax: function(value, min, max) { - return (value < min ? min : value > max ? max : value); - }, - syncing: {}, - sync: (function() { - window.addEventListener('storage', function(e) { - var cb; - - if (cb = $.syncing[e.key]) { - return cb(JSON.parse(e.newValue)); - } - }, false); - return function(key, cb) { - return $.syncing[g.NAMESPACE + key] = cb; - }; - })(), - item: function(key, val) { - var item; - - item = {}; - item[key] = val; - return item; + value: function() { + $.set(this.name, this.value.trim()); + return Conf[this.name] = this.value; } - }); + }; + + $.asap = function(test, cb) { + if (test()) { + return cb(); + } else { + return setTimeout($.asap, 25, test, cb); + } + }; + + $.addStyle = function(css, id) { + var style; + + style = $.el('style', { + id: id, + textContent: css + }); + $.asap((function() { + return d.head; + }), function() { + return $.add(d.head, style); + }); + return style; + }; + + $.x = function(path, root) { + root || (root = d.body); + return d.evaluate(path, root, null, 8, null).singleNodeValue; + }; + + $.X = function(path, root) { + root || (root = d.body); + return d.evaluate(path, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); + }; + + $.addClass = function(el, className) { + return el.classList.add(className); + }; + + $.rmClass = function(el, className) { + return el.classList.remove(className); + }; + + $.toggleClass = function(el, className) { + return el.classList.toggle(className); + }; + + $.hasClass = function(el, className) { + return el.classList.contains(className); + }; + + $.rm = (function() { + if ('remove' in Element.prototype) { + return function(el) { + return el.remove(); + }; + } else { + return function(el) { + var _ref; + + return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; + }; + } + })(); + + $.rmAll = function(root) { + var node; + + while (node = root.firstChild) { + root.removeChild(node); + } + }; + + $.tn = function(s) { + return d.createTextNode(s); + }; + + $.frag = function() { + return d.createDocumentFragment(); + }; + + $.nodes = function(nodes) { + var frag, node, _i, _len; + + if (!(nodes instanceof Array)) { + return nodes; + } + frag = $.frag(); + for (_i = 0, _len = nodes.length; _i < _len; _i++) { + node = nodes[_i]; + frag.appendChild(node); + } + return frag; + }; + + $.add = function(parent, el) { + return parent.appendChild($.nodes(el)); + }; + + $.prepend = function(parent, el) { + return parent.insertBefore($.nodes(el), parent.firstChild); + }; + + $.after = function(root, el) { + return root.parentNode.insertBefore($.nodes(el), root.nextSibling); + }; + + $.before = function(root, el) { + return root.parentNode.insertBefore($.nodes(el), root); + }; + + $.replace = function(root, el) { + return root.parentNode.replaceChild($.nodes(el), root); + }; + + $.el = function(tag, properties) { + var el; + + el = d.createElement(tag); + if (properties) { + $.extend(el, properties); + } + return el; + }; + + $.on = function(el, events, handler) { + var event, _i, _len, _ref; + + _ref = events.split(' '); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + event = _ref[_i]; + el.addEventListener(event, handler, false); + } + }; + + $.off = function(el, events, handler) { + var event, _i, _len, _ref; + + _ref = events.split(' '); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + event = _ref[_i]; + el.removeEventListener(event, handler, false); + } + }; + + $.event = function(event, detail, root) { + if (root == null) { + root = d; + } + return root.dispatchEvent(new CustomEvent(event, { + bubbles: true, + detail: detail + })); + }; + + $.open = function(URL) { + return window.open(URL, '_blank'); + }; + + $.debounce = function(wait, fn) { + var args, exec, lastCall, that, timeout; + + lastCall = 0; + timeout = null; + that = null; + args = null; + exec = function() { + lastCall = Date.now(); + return fn.apply(that, args); + }; + return function() { + args = arguments; + that = this; + if (lastCall < Date.now() - wait) { + return exec(); + } + clearTimeout(timeout); + return timeout = setTimeout(exec, wait); + }; + }; + + $.queueTask = (function() { + var execTask, taskChannel, taskQueue; + + taskQueue = []; + execTask = function() { + var args, func, task; + + task = taskQueue.shift(); + func = task[0]; + args = Array.prototype.slice.call(task, 1); + return func.apply(func, args); + }; + if (window.MessageChannel) { + taskChannel = new MessageChannel(); + taskChannel.port1.onmessage = execTask; + return function() { + taskQueue.push(arguments); + return taskChannel.port2.postMessage(null); + }; + } else { + return function() { + taskQueue.push(arguments); + return setTimeout(execTask, 0); + }; + } + })(); + + $.globalEval = function(code) { + var script; + + script = $.el('script', { + textContent: code + }); + $.add(d.head || doc, script); + return $.rm(script); + }; + + $.bytesToString = function(size) { + var unit; + + unit = 0; + while (size >= 1024) { + size /= 1024; + unit++; + } + size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); + return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit]; + }; + + $.minmax = function(value, min, max) { + return (value < min ? min : value > max ? max : value); + }; + + $.syncing = {}; + + $.sync = (function() { + window.addEventListener('storage', function(e) { + var cb; + + if (cb = $.syncing[e.key]) { + return cb(JSON.parse(e.newValue)); + } + }, false); + return function(key, cb) { + return $.syncing[g.NAMESPACE + key] = cb; + }; + })(); + + $.item = function(key, val) { + var item; + + item = {}; + item[key] = val; + return item; + }; (function() { var scriptStorage; @@ -2898,7 +2994,7 @@ return cb(items); }); }; - return $.set = (function() { + $.set = (function() { var set; set = function(key, val) { @@ -2924,157 +3020,11 @@ })(); })(); - Build = { - spoilerRange: {}, - shortFilename: function(filename, isReply) { - var threshold; - - threshold = isReply ? 30 : 40; - if (filename.length - 4 > threshold) { - return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); - } else { - return filename; - } - }, - postFromObject: function(data, boardID) { - var o; - - o = { - postID: data.no, - threadID: data.resto || data.no, - boardID: boardID, - name: data.name, - capcode: data.capcode, - tripcode: data.trip, - uniqueID: data.id, - email: data.email ? encodeURI(data.email.replace(/"/g, '"')) : '', - subject: data.sub, - flagCode: data.country, - flagName: data.country_name, - date: data.now, - dateUTC: data.time, - comment: data.com, - isSticky: !!data.sticky, - isClosed: !!data.closed - }; - if (data.ext || data.filedeleted) { - o.file = { - name: data.filename + data.ext, - timestamp: "" + data.tim + data.ext, - url: "//images.4chan.org/" + boardID + "/src/" + data.tim + data.ext, - height: data.h, - width: data.w, - MD5: data.md5, - size: data.fsize, - turl: "//thumbs.4chan.org/" + boardID + "/thumb/" + data.tim + "s.jpg", - theight: data.tn_h, - twidth: data.tn_w, - isSpoiler: !!data.spoiler, - isDeleted: !!data.filedeleted - }; - } - return Build.post(o); - }, - post: function(o, isArchived) { - /* - This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS). - @license: https://github.com/4chan/4chan-JS/blob/master/LICENSE - */ - - var a, boardID, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; - - postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file; - isOP = postID === threadID; - staticPath = '//static.4chan.org'; - if (email) { - emailStart = ''; - emailEnd = ''; - } else { - emailStart = ''; - emailEnd = ''; - } - subject = "" + (subject || '') + ""; - userID = !capcode && uniqueID ? (" (ID: ") + ("" + uniqueID + ") ") : ''; - switch (capcode) { - case 'admin': - case 'admin_highlight': - capcodeClass = " capcodeAdmin"; - capcodeStart = " ## Admin"; - capcode = (" "; - break; - case 'mod': - capcodeClass = " capcodeMod"; - capcodeStart = " ## Mod"; - capcode = (" "; - break; - case 'developer': - capcodeClass = " capcodeDeveloper"; - capcodeStart = " ## Developer"; - capcode = (" "; - break; - default: - capcodeClass = ''; - capcodeStart = ''; - capcode = ''; - } - flag = flagCode ? ("  + flagCode + ") : ''; - if (file != null ? file.isDeleted : void 0) { - fileHTML = isOP ? ("
") + ("File deleted.") + "
" : ("
") + ("File deleted.") + "
"; - } else if (file) { - ext = file.name.slice(-3); - if (!file.twidth && !file.theight && ext === 'gif') { - file.twidth = file.width; - file.theight = file.height; - } - fileSize = $.bytesToString(file.size); - fileThumb = file.turl; - if (file.isSpoiler) { - fileSize = "Spoiler Image, " + fileSize; - if (!isArchived) { - fileThumb = '//static.4chan.org/image/spoiler'; - if (spoilerRange = Build.spoilerRange[boardID]) { - fileThumb += ("-" + boardID) + Math.floor(1 + spoilerRange * Math.random()); - } - fileThumb += '.png'; - file.twidth = file.theight = 100; - } - } - if (boardID.ID !== 'f') { - imgSrc = ("") + ("" + fileSize + ""); - } - a = $.el('a', { - innerHTML: file.name - }); - filename = a.textContent.replace(/%22/g, '"'); - a.textContent = Build.shortFilename(filename); - shortFilename = a.innerHTML; - a.textContent = filename; - filename = a.innerHTML.replace(/'/g, '''); - fileDims = ext === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height; - fileInfo = ("File: " + file.timestamp + "") + ("-(" + fileSize + ", " + fileDims + (file.isSpoiler ? '' : ", " + shortFilename + "")) + ")"; - fileHTML = "
" + fileInfo + "
" + imgSrc + "
"; - } else { - fileHTML = ''; - } - tripcode = tripcode ? " " + tripcode + "" : ''; - sticky = isSticky ? ' Sticky' : ''; - closed = isClosed ? ' Closed' : ''; - container = $.el('div', { - id: "pc" + postID, - className: "postContainer " + (isOP ? 'op' : 'reply') + "Container", - innerHTML: (isOP ? '' : "
>>
") + ("
") + ("' + (isOP ? fileHTML : '') + ("' + (isOP ? '' : fileHTML) + ("
" + (comment || '') + "
") + '
' - }); - _ref = $$('.quotelink', container); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; - href = quote.getAttribute('href'); - if (href[0] === '/') { - continue; - } - quote.href = "/" + boardID + "/res/" + href; - } - return container; + $$ = function(selector, root) { + if (root == null) { + root = d.body; } + return __slice.call(root.querySelectorAll(selector)); }; Board = (function() { @@ -3292,7 +3242,7 @@ if (!(strong = $('strong.warning', this.nodes.info))) { strong = $.el('strong', { className: 'warning', - textContent: '[Deleted]' + textContent: this.isReply ? '[Deleted]' : '[Dead]' }); $.after($('input', this.nodes.info), strong); } @@ -3561,7 +3511,7 @@ }); } now = Date.now(); - if ((this.data.lastChecked || 0) < now - 12 * $.HOUR) { + if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) { this.data.lastChecked = now; for (boardID in this.data.boards) { this.ajaxClean(boardID); @@ -3658,6 +3608,500 @@ })(); + Polyfill = { + init: function() { + return Polyfill.visibility(); + }, + visibility: function() { + var event, prefix, property; + + if ('visibilityState' in document || !(prefix = ('webkitVisibilityState' in document ? 'webkit' : 'mozVisibilityState' in document ? 'moz' : void 0))) { + return; + } + property = prefix + 'VisibilityState'; + event = prefix + 'visibilitychange'; + d.visibilityState = d[property]; + d.hidden = d.visibilityState === 'hidden'; + return $.on(d, event, function() { + d.visibilityState = d[property]; + d.hidden = d.visibilityState === 'hidden'; + return $.event('visibilitychange'); + }); + } + }; + + Header = { + init: function() { + var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, + _this = this; + + this.menu = new UI.Menu('header'); + this.menuButton = $.el('span', { + className: 'menu-button', + id: 'main-menu' + }); + barFixedToggler = $.el('label', { + innerHTML: ' Fixed Header' + }); + headerToggler = $.el('label', { + innerHTML: ' Auto-hide header' + }); + barPositionToggler = $.el('label', { + innerHTML: ' Bottom header' + }); + customNavToggler = $.el('label', { + innerHTML: ' Custom board navigation' + }); + footerToggler = $.el('label', { + innerHTML: " Hide bottom board list" + }); + editCustomNav = $.el('a', { + textContent: 'Edit custom board navigation', + href: 'javascript:;' + }); + this.barFixedToggler = barFixedToggler.firstElementChild; + this.barPositionToggler = barPositionToggler.firstElementChild; + this.headerToggler = headerToggler.firstElementChild; + this.footerToggler = footerToggler.firstElementChild; + this.customNavToggler = customNavToggler.firstElementChild; + $.on(this.menuButton, 'click', this.menuToggle); + $.on(this.barFixedToggler, 'change', this.toggleBarFixed); + $.on(this.barPositionToggler, 'change', this.toggleBarPosition); + $.on(this.headerToggler, 'change', this.toggleBarVisibility); + $.on(this.footerToggler, 'change', this.toggleFooterVisibility); + $.on(this.customNavToggler, 'change', this.toggleCustomNav); + $.on(editCustomNav, 'click', this.editCustomNav); + this.setBarFixed(Conf['Fixed Header']); + this.setBarVisibility(Conf['Header auto-hide']); + $.sync('Fixed Header', Header.setBarFixed); + $.sync('Bottom Header', Header.setBarPosition); + $.sync('Header auto-hide', Header.setBarVisibility); + $.event('AddMenuEntry', { + type: 'header', + el: $.el('span', { + textContent: 'Header' + }), + order: 107, + subEntries: [ + { + el: barFixedToggler + }, { + el: headerToggler + }, { + el: barPositionToggler + }, { + el: footerToggler + }, { + el: customNavToggler + }, { + el: editCustomNav + } + ] + }); + $.on(window, 'load hashchange', Header.hashScroll); + $.on(d, 'CreateNotification', this.createNotification); + $.asap((function() { + return d.body; + }), function() { + if (!Main.isThisPageLegit()) { + return; + } + $.asap((function() { + return $.id('boardNavMobile') || d.readyState === 'complete'; + }), Header.setBoardList); + $.prepend(d.body, _this.bar); + $.add(d.body, Header.hover); + return _this.setBarPosition(Conf['Bottom Header']); + }); + return $.ready(function() { + var cs; + + cs = $.id('settingsWindowLink'); + cs.textContent = 'Catalog Settings'; + if (g.VIEW === 'catalog') { + return _this.addShortcut(cs); + } + }); + }, + bar: $.el('div', { + id: 'header-bar' + }), + notify: $.el('div', { + id: 'notifications' + }), + shortcuts: $.el('span', { + id: 'shortcuts' + }), + hover: $.el('div', { + id: 'hoverUI' + }), + toggle: $.el('div', { + id: 'scroll-marker' + }), + setBoardList: function() { + var a, boardList, btn, fourchannav, fullBoardList, settings; + + fourchannav = $.id('boardNavDesktop'); + if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) { + a.className = 'current'; + } + boardList = $.el('span', { + id: 'board-list', + innerHTML: "" + }); + fullBoardList = $('#full-board-list', boardList); + btn = $('.hide-board-list-button', fullBoardList); + $.on(btn, 'click', Header.toggleBoardList); + $.rm($('#navtopright', fullBoardList)); + settings = $.id('navtopright'); + $.prepend(d.body, settings); + $.add(settings, Header.menuButton); + $.add(boardList, fullBoardList); + $.add(Header.bar, [boardList, Header.shortcuts, Header.notify, Header.toggle]); + Header.setCustomNav(Conf['Custom Board Navigation']); + Header.generateBoardList(Conf['boardnav']); + $.sync('Custom Board Navigation', Header.setCustomNav); + return $.sync('boardnav', Header.generateBoardList); + }, + generateBoardList: function(text) { + var as, list, nodes; + + list = $('#custom-board-list', Header.bar); + $.rmAll(list); + if (!text) { + return; + } + as = $$('#full-board-list a', Header.bar); + nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map(function(t) { + var a, board, m, _i, _len; + + if (/^[^\w@]/.test(t)) { + return $.tn(t); + } + if (/^toggle-all/.test(t)) { + a = $.el('a', { + className: 'show-board-list-button', + textContent: (t.match(/-text:"(.+)"/) || [null, '+'])[1], + href: 'javascript:;' + }); + $.on(a, 'click', Header.toggleBoardList); + return a; + } + board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0]; + for (_i = 0, _len = as.length; _i < _len; _i++) { + a = as[_i]; + if (a.textContent === board) { + a = a.cloneNode(true); + if (/-title/.test(t)) { + a.textContent = a.title; + } else if (/-replace/.test(t)) { + if ($.hasClass(a, 'current')) { + a.textContent = a.title; + } + } else if (/-full/.test(t)) { + a.textContent = "/" + board + "/ - " + a.title; + } else if (/-(index|catalog|text)/.test(t)) { + if (m = t.match(/-(index|catalog)/)) { + a.setAttribute('data-only', m[1]); + a.href = "//boards.4chan.org/" + board + "/"; + if (m[1] === 'catalog') { + a.href += 'catalog'; + } + } + if (m = t.match(/-text:"(.+)"/)) { + a.textContent = m[1]; + } + } else if (board === '@') { + $.addClass(a, 'navSmall'); + } + return a; + } + } + return $.tn(t); + }); + return $.add(list, nodes); + }, + toggleBoardList: function() { + var bar, custom, full, showBoardList; + + bar = Header.bar; + custom = $('#custom-board-list', bar); + full = $('#full-board-list', bar); + showBoardList = !full.hidden; + custom.hidden = !showBoardList; + return full.hidden = showBoardList; + }, + setBarPosition: function(bottom) { + Header.barPositionToggler.checked = bottom; + if (bottom) { + $.rmClass(doc, 'top'); + $.addClass(doc, 'bottom'); + $.after(Header.bar, Header.notify); + } else { + $.rmClass(doc, 'bottom'); + $.addClass(doc, 'top'); + $.add(Header.bar, Header.notify); + } + return Style.padding(); + }, + toggleBarPosition: function() { + $.event('CloseMenu'); + Header.setBarPosition(this.checked); + Conf['Bottom Header'] = this.checked; + return $.set('Bottom Header', this.checked); + }, + setBarFixed: function(fixed) { + Header.barFixedToggler.checked = fixed; + if (fixed) { + $.addClass(doc, 'fixed'); + return $.addClass(Header.bar, 'dialog'); + } else { + $.rmClass(doc, 'fixed'); + return $.rmClass(Header.bar, 'dialog'); + } + }, + toggleBarFixed: function() { + $.event('CloseMenu'); + Header.setBarFixed(this.checked); + Conf['Fixed Header'] = this.checked; + return $.set('Fixed Header', this.checked); + }, + setBarVisibility: function(hide) { + Header.headerToggler.checked = hide; + $.event('CloseMenu'); + (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide'); + return (hide ? $.addClass : $.rmClass)(doc, 'autohide'); + }, + toggleBarVisibility: function(e) { + var hide, message; + + if (e.type === 'mousedown' && e.button !== 0) { + return; + } + hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); + Conf['Header auto-hide'] = hide; + $.set('Header auto-hide', hide); + Header.setBarVisibility(hide); + message = hide ? 'The header bar will automatically hide itself.' : 'The header bar will remain visible.'; + return new Notification('info', message, 2); + }, + setCustomNav: function(show) { + var btn, cust, full, _ref; + + Header.customNavToggler.checked = show; + cust = $('#custom-board-list', Header.bar); + full = $('#full-board-list', Header.bar); + btn = $('.hide-board-list-button', full); + return _ref = show ? [false, true] : [true, false], cust.hidden = _ref[0], full.hidden = _ref[1], _ref; + }, + toggleCustomNav: function() { + $.cb.checked.call(this); + return Header.setCustomNav(this.checked); + }, + editCustomNav: function() { + var settings; + + Settings.open('Advanced'); + settings = $.id('fourchanx-settings'); + return $('input[name=boardnav]', settings).focus(); + }, + hashScroll: function() { + var hash, post; + + if (!((hash = this.location.hash) && (post = $.id(hash.slice(1))))) { + return; + } + if ((Get.postFromRoot(post)).isHidden) { + return; + } + return Header.scrollToPost(post); + }, + scrollToPost: function(post) { + var headRect, top; + + top = post.getBoundingClientRect().top; + if (Conf['Fixed Header'] && !Conf['Bottom Header']) { + headRect = Header.bar.getBoundingClientRect(); + top += -headRect.top - headRect.height; + } + return ($.engine === 'webkit' ? d.body : doc).scrollTop += top; + }, + addShortcut: function(el) { + var shortcut; + + shortcut = $.el('span', { + className: 'shortcut' + }); + $.add(shortcut, [$.tn(' ['), el, $.tn(']')]); + return $.prepend(Header.shortcuts, shortcut); + }, + menuToggle: function(e) { + return Header.menu.toggle(e, this, g); + }, + createNotification: function(e) { + var cb, content, lifetime, notif, type, _ref; + + _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; + notif = new Notification(type, content, lifetime); + if (cb) { + return cb(notif); + } + } + }; + + Build = { + spoilerRange: {}, + shortFilename: function(filename, isReply) { + var threshold; + + threshold = isReply ? 30 : 40; + if (filename.length - 4 > threshold) { + return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); + } else { + return filename; + } + }, + postFromObject: function(data, boardID) { + var o; + + o = { + postID: data.no, + threadID: data.resto || data.no, + boardID: boardID, + name: data.name, + capcode: data.capcode, + tripcode: data.trip, + uniqueID: data.id, + email: data.email ? encodeURI(data.email.replace(/"/g, '"')) : '', + subject: data.sub, + flagCode: data.country, + flagName: data.country_name, + date: data.now, + dateUTC: data.time, + comment: data.com, + isSticky: !!data.sticky, + isClosed: !!data.closed + }; + if (data.ext || data.filedeleted) { + o.file = { + name: data.filename + data.ext, + timestamp: "" + data.tim + data.ext, + url: "//images.4chan.org/" + boardID + "/src/" + data.tim + data.ext, + height: data.h, + width: data.w, + MD5: data.md5, + size: data.fsize, + turl: "//thumbs.4chan.org/" + boardID + "/thumb/" + data.tim + "s.jpg", + theight: data.tn_h, + twidth: data.tn_w, + isSpoiler: !!data.spoiler, + isDeleted: !!data.filedeleted + }; + } + return Build.post(o); + }, + post: function(o, isArchived) { + /* + This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS). + @license: https://github.com/4chan/4chan-JS/blob/master/LICENSE + */ + + var a, boardID, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; + + postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file; + isOP = postID === threadID; + staticPath = '//static.4chan.org'; + if (email) { + emailStart = ''; + emailEnd = ''; + } else { + emailStart = ''; + emailEnd = ''; + } + subject = "" + (subject || '') + ""; + userID = !capcode && uniqueID ? (" (ID: ") + ("" + uniqueID + ") ") : ''; + switch (capcode) { + case 'admin': + case 'admin_highlight': + capcodeClass = " capcodeAdmin"; + capcodeStart = " ## Admin"; + capcode = (" "; + break; + case 'mod': + capcodeClass = " capcodeMod"; + capcodeStart = " ## Mod"; + capcode = (" "; + break; + case 'developer': + capcodeClass = " capcodeDeveloper"; + capcodeStart = " ## Developer"; + capcode = (" "; + break; + default: + capcodeClass = ''; + capcodeStart = ''; + capcode = ''; + } + flag = flagCode ? ("  + flagCode + ") : ''; + if (file != null ? file.isDeleted : void 0) { + fileHTML = isOP ? ("
") + ("File deleted.") + "
" : ("
") + ("File deleted.") + "
"; + } else if (file) { + ext = file.name.slice(-3); + if (!file.twidth && !file.theight && ext === 'gif') { + file.twidth = file.width; + file.theight = file.height; + } + fileSize = $.bytesToString(file.size); + fileThumb = file.turl; + if (file.isSpoiler) { + fileSize = "Spoiler Image, " + fileSize; + if (!isArchived) { + fileThumb = '//static.4chan.org/image/spoiler'; + if (spoilerRange = Build.spoilerRange[boardID]) { + fileThumb += ("-" + boardID) + Math.floor(1 + spoilerRange * Math.random()); + } + fileThumb += '.png'; + file.twidth = file.theight = 100; + } + } + if (boardID.ID !== 'f') { + imgSrc = ("") + ("" + fileSize + ""); + } + a = $.el('a', { + innerHTML: file.name + }); + filename = a.textContent.replace(/%22/g, '"'); + a.textContent = Build.shortFilename(filename); + shortFilename = a.innerHTML; + a.textContent = filename; + filename = a.innerHTML.replace(/'/g, '''); + fileDims = ext === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height; + fileInfo = ("File: " + file.timestamp + "") + ("-(" + fileSize + ", " + fileDims + (file.isSpoiler ? '' : ", " + shortFilename + "")) + ")"; + fileHTML = "
" + fileInfo + "
" + imgSrc + "
"; + } else { + fileHTML = ''; + } + tripcode = tripcode ? " " + tripcode + "" : ''; + sticky = isSticky ? ' Sticky' : ''; + closed = isClosed ? ' Closed' : ''; + container = $.el('div', { + id: "pc" + postID, + className: "postContainer " + (isOP ? 'op' : 'reply') + "Container", + innerHTML: (isOP ? '' : "
>>
") + ("
") + ("' + (isOP ? fileHTML : '') + ("' + (isOP ? '' : fileHTML) + ("
" + (comment || '') + "
") + '
' + }); + _ref = $$('.quotelink', container); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quote = _ref[_i]; + href = quote.getAttribute('href'); + if (href[0] === '/') { + continue; + } + quote.href = "/" + boardID + "/res/" + href; + } + return container; + } + }; + Get = { threadExcerpt: function(thread) { var OP, excerpt, _ref; @@ -3914,28 +4358,6 @@ } }; - Polyfill = { - init: function() { - return Polyfill.visibility(); - }, - visibility: function() { - var event, prefix, property; - - if ('visibilityState' in document || !(prefix = ('webkitVisibilityState' in document ? 'webkit' : 'mozVisibilityState' in document ? 'moz' : void 0))) { - return; - } - property = prefix + 'VisibilityState'; - event = prefix + 'visibilitychange'; - d.visibilityState = d[property]; - d.hidden = d.visibilityState === 'hidden'; - return $.on(d, event, function() { - d.visibilityState = d[property]; - d.hidden = d.visibilityState === 'hidden'; - return $.event('visibilitychange'); - }); - } - }; - UI = (function() { var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove; @@ -4204,7 +4626,7 @@ })(); dragstart = function(e) { - var el, isTouching, o, rect, screenHeight, screenWidth; + var el, isTouching, o, rect, screenHeight, screenWidth, _ref; if (e.type === 'mousedown' && e.button !== 0) { return; @@ -4228,6 +4650,7 @@ screenWidth: screenWidth, isTouching: isTouching }; + _ref = Conf['Header auto-hide'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = _ref[0], o.bottomBorder = _ref[1]; if (isTouching) { o.identifier = e.identifier; o.move = touchmove.bind(o); @@ -4260,9 +4683,9 @@ left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; top = clientY - this.dy; - top = top < 10 ? 0 : this.height - top < 10 ? null : top / this.screenHeight * 100 + '%'; + top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%'; right = left === null ? 0 : null; - bottom = top === null ? 0 : null; + bottom = top === null ? this.bottomBorder + 'px' : null; style = this.style; style.left = left; style.right = right; @@ -4665,76 +5088,6 @@ } }; - Recursive = { - recursives: {}, - init: function() { - if (g.VIEW === 'catalog') { - return; - } - return Post.prototype.callbacks.push({ - name: 'Recursive', - cb: this.node - }); - }, - node: function() { - var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; - - if (this.isClone) { - return; - } - _ref = this.quotes; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; - if (obj = Recursive.recursives[quote]) { - _ref1 = obj.recursives; - for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) { - recursive = _ref1[i]; - recursive.apply(null, [this].concat(__slice.call(obj.args[i]))); - } - } - } - }, - add: function() { - var args, obj, post, recursive, _base, _name; - - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; - obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { - recursives: [], - args: [] - }); - obj.recursives.push(recursive); - return obj.args.push(args); - }, - rm: function(recursive, post) { - var i, obj, rec, _i, _len, _ref; - - if (!(obj = Recursive.recursives[post.fullID])) { - return; - } - _ref = obj.recursives; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - rec = _ref[i]; - if (rec === recursive) { - obj.recursives.splice(i, 1); - obj.args.splice(i, 1); - } - } - }, - apply: function() { - var ID, args, fullID, post, recursive, _ref; - - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; - fullID = post.fullID; - _ref = g.posts; - for (ID in _ref) { - post = _ref[ID]; - if (post.quotes.contains(fullID)) { - recursive.apply(null, [post].concat(__slice.call(args))); - } - } - } - }; - PostHiding = { init: function() { if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link']) { @@ -5013,28 +5366,71 @@ } }; - QuoteStrikeThrough = { + Recursive = { + recursives: {}, init: function() { - if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link'] && !Conf['Filter']) { + if (g.VIEW === 'catalog') { return; } return Post.prototype.callbacks.push({ - name: 'Strike-through Quotes', + name: 'Recursive', cb: this.node }); }, node: function() { - var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; + var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; if (this.isClone) { return; } - _ref = this.nodes.quotelinks; + _ref = this.quotes; for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quotelink = _ref[_i]; - _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID; - if ((_ref2 = g.posts["" + boardID + "." + postID]) != null ? _ref2.isHidden : void 0) { - $.addClass(quotelink, 'filtered'); + quote = _ref[_i]; + if (obj = Recursive.recursives[quote]) { + _ref1 = obj.recursives; + for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) { + recursive = _ref1[i]; + recursive.apply(null, [this].concat(__slice.call(obj.args[i]))); + } + } + } + }, + add: function() { + var args, obj, post, recursive, _base, _name; + + recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; + obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { + recursives: [], + args: [] + }); + obj.recursives.push(recursive); + return obj.args.push(args); + }, + rm: function(recursive, post) { + var i, obj, rec, _i, _len, _ref; + + if (!(obj = Recursive.recursives[post.fullID])) { + return; + } + _ref = obj.recursives; + for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { + rec = _ref[i]; + if (rec === recursive) { + obj.recursives.splice(i, 1); + obj.args.splice(i, 1); + } + } + }, + apply: function() { + var ID, args, fullID, post, recursive, _ref; + + recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; + fullID = post.fullID; + _ref = g.posts; + for (ID in _ref) { + post = _ref[ID]; + if (post.quotes.contains(fullID)) { + recursive.apply(null, [post].concat(__slice.call(args))); } } } @@ -5267,455 +5663,646 @@ } }; - FappeTyme = { + QuoteBacklink = { init: function() { - var el; + var format; - if (!Conf['Fappe Tyme'] && (g.VIEW === 'catalog' || g.BOARD === 'f')) { + if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { return; } - el = $.el('a', { - href: 'javascript:;', - id: 'fappeTyme', - title: 'Fappe Tyme' - }); - $.on(el, 'click', FappeTyme.toggle); - $.asap((function() { - return $.id('boardNavMobile'); - }), function() { - return $.add($.id('navtopright'), el); - }); - return Post.prototype.callbacks.push({ - name: 'Fappe Tyme', - cb: this.node - }); - }, - node: function() { - if (this.file) { - return; - } - return $.addClass(this.nodes.root, "noFile"); - }, - toggle: function() { - return $.toggleClass(doc, 'fappeTyme'); - } - }; - - ImageExpand = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { - return; - } - this.EAI = $.el('a', { - id: 'img-controls', - className: 'expand-all-shortcut', - title: 'Expand All Images', - href: 'javascript:;' - }); - $.on(this.EAI, 'click', ImageExpand.cb.toggleAll); + format = Conf['backlink'].replace(/%id/g, "' + id + '"); + this.funk = Function('id', "return '" + format + "'"); + this.containers = {}; Post.prototype.callbacks.push({ - name: 'Image Expansion', - cb: this.node + name: 'Quote Backlinking Part 1', + cb: this.firstNode }); - return $.asap((function() { - return $.id('delform'); - }), function() { - return $.prepend($.id('delform'), ImageExpand.EAI); + return Post.prototype.callbacks.push({ + name: 'Quote Backlinking Part 2', + cb: this.secondNode }); }, - node: function() { - var thumb, _ref; + firstNode: function() { + var a, clone, container, containers, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + if (this.isClone || !this.quotes.length) { return; } - thumb = this.file.thumb; - $.on(thumb.parentNode, 'click', ImageExpand.cb.toggle); - if (this.isClone && $.hasClass(thumb, 'expanding')) { - ImageExpand.contract(this); - ImageExpand.expand(this); - return; - } - if (ImageExpand.on && !this.isHidden) { - return ImageExpand.expand(this); - } - }, - cb: { - toggle: function(e) { - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { - return; - } - e.preventDefault(); - return ImageExpand.toggle(Get.postFromNode(this)); - }, - toggleAll: function() { - var ID, file, func, post, _i, _len, _ref, _ref1; - - $.event('CloseMenu'); - if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { - ImageExpand.EAI.className = 'contract-all-shortcut'; - ImageExpand.EAI.title = 'Contract All Images'; - func = ImageExpand.expand; - } else { - ImageExpand.EAI.className = 'expand-all-shortcut'; - ImageExpand.EAI.title = 'Expand All Images'; - func = ImageExpand.contract; - } - _ref = g.posts; - for (ID in _ref) { - post = _ref[ID]; - _ref1 = [post].concat(post.clones); - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - post = _ref1[_i]; - file = post.file; - if (!(file && file.isImage && doc.contains(post.nodes.root))) { - continue; - } - if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && file.thumb.getBoundingClientRect().top < 0)) { - continue; - } - $.queueTask(func, post); + a = $.el('a', { + href: "/" + this.board + "/res/" + this.thread + "#p" + this, + className: this.isHidden ? 'filtered backlink' : 'backlink', + textContent: (QuoteBacklink.funk(this.ID)) + (Conf['Mark Quotes of You'] && this.info.yours ? QuoteYou.text : '') + }); + _ref = this.quotes; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quote = _ref[_i]; + containers = [QuoteBacklink.getContainer(quote)]; + if ((post = g.posts[quote]) && post.nodes.backlinkContainer) { + _ref1 = post.clones; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + clone = _ref1[_j]; + containers.push(clone.nodes.backlinkContainer); } } - }, - setFitness: function() { - var checked; - - checked = this.checked; - (checked ? $.addClass : $.rmClass)(doc, this.name.toLowerCase().replace(/\s+/g, '-')); - if (this.name !== 'Fit height') { - return; - } - if (checked) { - $.on(window, 'resize', ImageExpand.resize); - if (!ImageExpand.style) { - ImageExpand.style = $.addStyle(null); + for (_k = 0, _len2 = containers.length; _k < _len2; _k++) { + container = containers[_k]; + link = a.cloneNode(true); + if (Conf['Quote Previewing']) { + $.on(link, 'mouseover', QuotePreview.mouseover); } - return ImageExpand.resize(); - } else { - return $.off(window, 'resize', ImageExpand.resize); - } - } - }, - toggle: function(post) { - var headRect, rect, root, thumb, top; - - thumb = post.file.thumb; - if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { - ImageExpand.expand(post); - return; - } - ImageExpand.contract(post); - rect = post.nodes.root.getBoundingClientRect(); - if (!(rect.top <= 0 || rect.left <= 0)) { - return; - } - headRect = Header.bar.getBoundingClientRect(); - top = rect.top - headRect.top - headRect.height; - root = doc; - if (rect.top < 0) { - root.scrollTop += top; - } - if (rect.left < 0) { - return root.scrollLeft = 0; - } - }, - contract: function(post) { - $.rmClass(post.nodes.root, 'expanded-image'); - $.rmClass(post.file.thumb, 'expanding'); - return post.file.isExpanded = false; - }, - expand: function(post, src) { - var img, thumb; - - thumb = post.file.thumb; - if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { - return; - } - $.addClass(thumb, 'expanding'); - if (post.file.fullImage) { - $.asap((function() { - return post.file.fullImage.naturalHeight; - }), function() { - return ImageExpand.completeExpand(post); - }); - return; - } - post.file.fullImage = img = $.el('img', { - className: 'full-image', - src: src || post.file.URL - }); - $.on(img, 'error', ImageExpand.error); - $.asap((function() { - return post.file.fullImage.naturalHeight; - }), function() { - return ImageExpand.completeExpand(post); - }); - return $.after(thumb, img); - }, - completeExpand: function(post) { - var prev, thumb; - - thumb = post.file.thumb; - if (!$.hasClass(thumb, 'expanding')) { - return; - } - post.file.isExpanded = true; - if (!post.nodes.root.parentNode) { - $.addClass(post.nodes.root, 'expanded-image'); - $.rmClass(post.file.thumb, 'expanding'); - return; - } - prev = post.nodes.root.getBoundingClientRect(); - return $.queueTask(function() { - var curr, root; - - $.addClass(post.nodes.root, 'expanded-image'); - $.rmClass(post.file.thumb, 'expanding'); - if (!(prev.top + prev.height <= 0)) { - return; - } - root = doc; - curr = post.nodes.root.getBoundingClientRect(); - return root.scrollTop += curr.height - prev.height + curr.top - prev.top; - }); - }, - error: function() { - var URL, post, src, timeoutID; - - post = Get.postFromNode(this); - $.rm(this); - delete post.file.fullImage; - if (!($.hasClass(post.file.thumb, 'expanding') || $.hasClass(post.nodes.root, 'expanded-image'))) { - return; - } - ImageExpand.contract(post); - src = this.src.split('/'); - if (src[2] === 'images.4chan.org') { - if (URL = Redirect.image(src[3], src[5])) { - setTimeout(ImageExpand.expand, 10000, post, URL); - return; - } - if (g.DEAD || post.isDead || post.file.isDead) { - return; - } - } - timeoutID = setTimeout(ImageExpand.expand, 10000, post); - return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { - onload: function() { - var postObj, _i, _len, _ref; - - if (this.status !== 200) { - return; - } - _ref = JSON.parse(this.response).posts; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - postObj = _ref[_i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - clearTimeout(timeoutID); - return post.kill(); - } else if (postObj.filedeleted) { - clearTimeout(timeoutID); - return post.kill(true); + if (Conf['Quote Inlining']) { + $.on(link, 'click', QuoteInline.toggle); } + $.add(container, [$.tn(' '), link]); } - }); - }, - menu: { - init: function() { - var conf, createSubEntry, el, key, subEntries, _ref; - - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { - return; - } - el = $.el('span', { - textContent: 'Image Expansion', - className: 'image-expansion-link' - }); - createSubEntry = ImageExpand.menu.createSubEntry; - subEntries = []; - _ref = Config.imageExpansion; - for (key in _ref) { - conf = _ref[key]; - subEntries.push(createSubEntry(key, conf)); - } - return $.event('AddMenuEntry', { - type: 'header', - el: el, - order: 105, - subEntries: subEntries - }); - }, - createSubEntry: function(type, config) { - var input, label; - - label = $.el('label', { - innerHTML: " " + type - }); - input = label.firstElementChild; - if (type === 'Fit width' || type === 'Fit height') { - $.on(input, 'change', ImageExpand.cb.setFitness); - } - if (config) { - label.title = config[1]; - input.checked = Conf[type]; - $.event('change', null, input); - $.on(input, 'change', $.cb.checked); - } - return { - el: label - }; } }, - resize: function() { - return ImageExpand.style.textContent = ":root.fit-height .full-image {max-height:" + doc.clientHeight + "px}"; + secondNode: function() { + var container; + + if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { + this.nodes.backlinkContainer = $('.container', this.nodes.info); + return; + } + if (!(this.isReply || Conf['OP Backlinks'])) { + return; + } + container = QuoteBacklink.getContainer(this.fullID); + this.nodes.backlinkContainer = container; + return $.add(this.nodes.info, container); }, - menuToggle: function(e) { - return ImageExpand.opmenu.toggle(e, this, g); + getContainer: function(id) { + var _base; + + return (_base = this.containers)[id] || (_base[id] = $.el('span', { + className: 'container' + })); } }; - ImageHover = { + QuoteCT = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Image Hover']) { + if (g.VIEW === 'catalog' || !Conf['Mark Cross-thread Quotes']) { return; } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + this.text = '\u00A0(Cross-thread)'; return Post.prototype.callbacks.push({ - name: 'Image Hover', + name: 'Mark Cross-thread Quotes', cb: this.node }); }, node: function() { - var _ref; + var board, boardID, quotelink, quotelinks, quotes, thread, threadID, _i, _len, _ref, _ref1; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + if (this.isClone && this.thread === this.context.thread) { return; } - return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover); + if (!(quotes = this.quotes).length) { + return; + } + quotelinks = this.nodes.quotelinks; + _ref = this.isClone ? this.context : this, board = _ref.board, thread = _ref.thread; + for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { + quotelink = quotelinks[_i]; + _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, threadID = _ref1.threadID; + if (!threadID) { + continue; + } + if (this.isClone) { + quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, ''); + } + if (boardID === this.board.ID && threadID !== thread.ID) { + $.add(quotelink, $.tn(QuoteCT.text)); + } + } + } + }; + + QuoteInline = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Quote Inlining']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + return Post.prototype.callbacks.push({ + name: 'Quote Inlining', + cb: this.node + }); + }, + node: function() { + var link, _i, _len, _ref; + + _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + $.on(link, 'click', QuoteInline.toggle); + } + }, + toggle: function(e) { + var boardID, context, postID, threadID, _ref; + + if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { + return; + } + e.preventDefault(); + _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; + context = Get.contextFromLink(this); + if ($.hasClass(this, 'inlined')) { + QuoteInline.rm(this, boardID, threadID, postID, context); + } else { + if ($.x("ancestor::div[@id='p" + postID + "']", this)) { + return; + } + QuoteInline.add(this, boardID, threadID, postID, context); + } + return this.classList.toggle('inlined'); + }, + findRoot: function(quotelink, isBacklink) { + if (isBacklink) { + return quotelink.parentNode.parentNode; + } else { + return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink); + } + }, + add: function(quotelink, boardID, threadID, postID, context) { + var inline, isBacklink, post; + + isBacklink = $.hasClass(quotelink, 'backlink'); + inline = $.el('div', { + id: "i" + postID, + className: 'inline' + }); + $.after(QuoteInline.findRoot(quotelink, isBacklink), inline); + Get.postClone(boardID, threadID, postID, inline, context); + if (!((post = g.posts["" + boardID + "." + postID]) && context.thread === post.thread)) { + return; + } + if (isBacklink && Conf['Forward Hiding']) { + $.addClass(post.nodes.root, 'forwarded'); + post.forwarded++ || (post.forwarded = 1); + } + if (!Unread.posts) { + return; + } + return Unread.readSinglePost(post); + }, + rm: function(quotelink, boardID, threadID, postID, context) { + var el, inlined, isBacklink, post, root, _ref; + + isBacklink = $.hasClass(quotelink, 'backlink'); + root = QuoteInline.findRoot(quotelink, isBacklink); + root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); + $.rm(root); + if (!(el = root.firstElementChild)) { + return; + } + post = g.posts["" + boardID + "." + postID]; + post.rmClone(el.dataset.clone); + if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads["" + boardID + "." + threadID] && !--post.forwarded) { + delete post.forwarded; + $.rmClass(post.nodes.root, 'forwarded'); + } + while (inlined = $('.inlined', el)) { + _ref = Get.postDataFromLink(inlined), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; + QuoteInline.rm(inlined, boardID, threadID, postID, context); + $.rmClass(inlined, 'inlined'); + } + } + }; + + QuoteOP = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Mark OP Quotes']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + this.text = '\u00A0(OP)'; + return Post.prototype.callbacks.push({ + name: 'Mark OP Quotes', + cb: this.node + }); + }, + node: function() { + var boardID, op, postID, quotelink, quotelinks, quotes, _i, _j, _len, _len1, _ref; + + if (this.isClone && this.thread === this.context.thread) { + return; + } + if (!(quotes = this.quotes).length) { + return; + } + quotelinks = this.nodes.quotelinks; + if (this.isClone && quotes.contains(this.thread.fullID)) { + for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { + quotelink = quotelinks[_i]; + quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, ''); + } + } + op = (this.isClone ? this.context : this).thread.fullID; + if (!quotes.contains(op)) { + return; + } + for (_j = 0, _len1 = quotelinks.length; _j < _len1; _j++) { + quotelink = quotelinks[_j]; + _ref = Get.postDataFromLink(quotelink), boardID = _ref.boardID, postID = _ref.postID; + if (("" + boardID + "." + postID) === op) { + $.add(quotelink, $.tn(QuoteOP.text)); + } + } + } + }; + + QuotePreview = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Quote Previewing']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + return Post.prototype.callbacks.push({ + name: 'Quote Previewing', + cb: this.node + }); + }, + node: function() { + var link, _i, _len, _ref; + + _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + $.on(link, 'mouseover', QuotePreview.mouseover); + } }, mouseover: function(e) { - var el, post; + var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; - post = Get.postFromNode(this); - el = $.el('img', { - id: 'ihover', - src: post.file.URL + if ($.hasClass(this, 'inlined')) { + return; + } + _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; + qp = $.el('div', { + id: 'qp', + className: 'dialog' }); - el.setAttribute('data-fullid', post.fullID); - $.add(Header.hover, el); + $.add(Header.hover, qp); + Get.postClone(boardID, threadID, postID, qp, Get.contextFromLink(this)); UI.hover({ root: this, - el: el, + el: qp, latestEvent: e, endEvents: 'mouseout click', + cb: QuotePreview.mouseout, asapTest: function() { - return el.naturalHeight; + return qp.firstElementChild; } }); - return $.on(el, 'error', ImageHover.error); - }, - error: function() { - var URL, post, src, timeoutID, - _this = this; - - if (!doc.contains(this)) { + if (!(origin = g.posts["" + boardID + "." + postID])) { return; } - post = g.posts[this.dataset.fullid]; - src = this.src.split('/'); - if (src[2] === 'images.4chan.org') { - if (URL = Redirect.image(src[3], src[5].replace(/\?.+$/, ''))) { - this.src = URL; - return; - } - if (g.DEAD || post.isDead || post.file.isDead) { - return; + if (Conf['Quote Highlighting']) { + posts = [origin].concat(origin.clones); + posts.pop(); + for (_i = 0, _len = posts.length; _i < _len; _i++) { + post = posts[_i]; + $.addClass(post.nodes.post, 'qphl'); } } - timeoutID = setTimeout((function() { - return _this.src = post.file.URL + '?' + Date.now(); - }), 3000); - return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { - onload: function() { - var postObj, _i, _len, _ref; - - if (this.status !== 200) { - return; - } - _ref = JSON.parse(this.response).posts; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - postObj = _ref[_i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - clearTimeout(timeoutID); - return post.kill(); - } else if (postObj.filedeleted) { - clearTimeout(timeoutID); - return post.kill(true); - } + quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0]; + clone = Get.postFromRoot(qp.firstChild); + _ref1 = clone.nodes.quotelinks.concat(__slice.call(clone.nodes.backlinks)); + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + quote = _ref1[_j]; + if (quote.hash.slice(2) === quoterID) { + $.addClass(quote, 'forwardlink'); } - }); + } + }, + mouseout: function() { + var clone, post, root, _i, _len, _ref; + + if (!(root = this.el.firstElementChild)) { + return; + } + clone = Get.postFromRoot(root); + post = clone.origin; + post.rmClone(root.dataset.clone); + if (!Conf['Quote Highlighting']) { + return; + } + _ref = [post].concat(post.clones); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + post = _ref[_i]; + $.rmClass(post.nodes.post, 'qphl'); + } } }; - ImageReplace = { + QuoteStrikeThrough = { init: function() { - if (g.VIEW === 'catalog') { + if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link'] && !Conf['Filter']) { return; } return Post.prototype.callbacks.push({ - name: 'Image Replace', + name: 'Strike-through Quotes', cb: this.node }); }, node: function() { - var URL, img, style, thumb, type, _ref, _ref1; + var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; - if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { + if (this.isClone) { return; } - _ref1 = this.file, thumb = _ref1.thumb, URL = _ref1.URL; - if (!(Conf["Replace " + ((type = (URL.match(/\w{3}$/))[0].toUpperCase()) === 'PEG' ? 'JPG' : type)] && !/spoiler/.test(thumb.src))) { - return; + _ref = this.nodes.quotelinks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quotelink = _ref[_i]; + _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID; + if ((_ref2 = g.posts["" + boardID + "." + postID]) != null ? _ref2.isHidden : void 0) { + $.addClass(quotelink, 'filtered'); + } } - if (this.file.isSpoiler) { - style = thumb.style; - style.maxHeight = style.maxWidth = this.isReply ? '125px' : '250px'; - } - img = $.el('img'); - $.on(img, 'load', function() { - return thumb.src = URL; - }); - return img.src = URL; } }; - RevealSpoilers = { + /* + <3 aeosynth + */ + + + QuoteThreading = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reveal Spoilers']) { + var input; + + if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { return; } + this.enabled = true; + this.controls = $.el('span', { + innerHTML: '' + }); + input = $('input', this.controls); + $.on(input, 'change', QuoteThreading.toggle); + $.event('AddMenuEntry', { + type: 'header', + el: this.controls, + order: 98 + }); + $.on(d, '4chanXInitFinished', this.setup); return Post.prototype.callbacks.push({ - name: 'Reveal Spoilers', + name: 'Quote Threading', + cb: this.node + }); + }, + setup: function() { + var ID, post, posts; + + $.off(d, '4chanXInitFinished', QuoteThreading.setup); + posts = g.posts; + for (ID in posts) { + post = posts[ID]; + if (post.cb) { + post.cb.call(post); + } + } + return QuoteThreading.hasRun = true; + }, + node: function() { + var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; + + if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { + return; + } + quotes = this.quotes, ID = this.ID, fullID = this.fullID; + posts = g.posts; + if (!(post = posts[fullID]) || post.isHidden) { + return; + } + uniq = {}; + len = ("" + g.BOARD).length + 1; + for (_i = 0, _len = quotes.length; _i < _len; _i++) { + quote = quotes[_i]; + qid = quote; + if (!(qid.slice(len) < ID)) { + continue; + } + if (qid in posts) { + uniq[qid.slice(len)] = true; + } + } + keys = Object.keys(uniq); + if (keys.length !== 1) { + return; + } + this.threaded = "" + g.BOARD + "." + keys[0]; + return this.cb = QuoteThreading.nodeinsert; + }, + nodeinsert: function() { + var bottom, height, posts, qpost, qroot, threadContainer, top, _ref; + + posts = g.posts; + qpost = posts[this.threaded]; + delete this.threaded; + delete this.cb; + if (this.thread.OP === qpost) { + return false; + } + if (QuoteThreading.hasRun) { + height = doc.clientHeight; + _ref = qpost.nodes.root.getBoundingClientRect(), bottom = _ref.bottom, top = _ref.top; + if (!(Unread.posts.contains(qpost) || ((bottom < height) && (top > 0)))) { + return false; + } + } + qroot = qpost.nodes.root; + if (!$.hasClass(qroot, 'threadOP')) { + $.addClass(qroot, 'threadOP'); + threadContainer = $.el('div', { + className: 'threadContainer' + }); + $.after(qroot, threadContainer); + } else { + threadContainer = qroot.nextSibling; + } + $.add(threadContainer, this.nodes.root); + return true; + }, + toggle: function() { + var container, containers, node, nodes, replies, reply, thread, _i, _j, _len, _len1; + + thread = $('.thread'); + replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); + QuoteThreading.enabled = this.checked; + if (this.checked) { + nodes = (function() { + var _i, _len, _results; + + _results = []; + for (_i = 0, _len = replies.length; _i < _len; _i++) { + reply = replies[_i]; + _results.push(Get.postFromNode(reply)); + } + return _results; + })(); + for (_i = 0, _len = nodes.length; _i < _len; _i++) { + node = nodes[_i]; + QuoteThreading.node(node); + } + } else { + replies.sort(function(a, b) { + var aID, bID; + + aID = Number(a.id.slice(2)); + bID = Number(b.id.slice(2)); + return aID - bID; + }); + $.add(thread, replies); + containers = $$('.threadContainer', thread); + for (_j = 0, _len1 = containers.length; _j < _len1; _j++) { + container = containers[_j]; + $.rm(container); + } + Unread.update(true); + } + }, + kb: function() { + var control; + + control = $.id('threadingControl'); + return control.click(); + } + }; + + QuoteYou = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Mark Quotes of You'] || !Conf['Quick Reply']) { + return; + } + this.text = '\u00A0(You)'; + return Post.prototype.callbacks.push({ + name: 'Mark Quotes of You', cb: this.node }); }, node: function() { - var thumb, _ref; + var quotelink, quotelinks, quotes, _i, _len; - if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { + if (this.isClone) { return; } - thumb = this.file.thumb; - thumb.removeAttribute('style'); - return thumb.src = this.file.thumbURL; + if (this.info.yours) { + $.addClass(this.nodes.root, 'yourPost'); + } + if (Conf['Highlight Own Posts']) { + $.addClass(doc, 'highlight-own'); + } + if (!(quotes = this.quotes).length) { + return; + } + quotelinks = this.nodes.quotelinks; + for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { + quotelink = quotelinks[_i]; + if (QR.db.get(Get.postDataFromLink(quotelink))) { + $.add(quotelink, $.tn(QuoteYou.text)); + } + } + } + }; + + Quotify = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Resurrect Quotes']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + return Post.prototype.callbacks.push({ + name: 'Resurrect Quotes', + cb: this.node + }); + }, + node: function() { + var deadlink, _i, _len, _ref; + + _ref = $$('.deadlink', this.nodes.comment); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + deadlink = _ref[_i]; + if (this.isClone) { + if ($.hasClass(deadlink, 'quotelink')) { + this.nodes.quotelinks.push(deadlink); + } + } else { + Quotify.parseDeadlink.call(this, deadlink); + } + } + }, + parseDeadlink: function(deadlink) { + var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; + + if (deadlink.parentNode.className === 'prettyprint') { + $.replace(deadlink, __slice.call(deadlink.childNodes)); + return; + } + quote = deadlink.textContent; + if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) { + return; + } + boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; + quoteID = "" + boardID + "." + postID; + if (post = g.posts[quoteID]) { + if (!post.isDead) { + a = $.el('a', { + href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, + className: 'quotelink', + textContent: quote + }); + } else { + a = $.el('a', { + href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, + className: 'quotelink deadlink', + target: '_blank', + textContent: "" + quote + "\u00A0(Dead)" + }); + a.setAttribute('data-boardid', boardID); + a.setAttribute('data-threadid', post.thread.ID); + a.setAttribute('data-postid', postID); + } + } else if (redirect = Redirect.to({ + boardID: boardID, + threadID: 0, + postID: postID + })) { + a = $.el('a', { + href: redirect, + className: 'deadlink', + target: '_blank', + textContent: "" + quote + "\u00A0(Dead)" + }); + if (Redirect.post(boardID, postID)) { + $.addClass(a, 'quotelink'); + a.setAttribute('data-boardid', boardID); + a.setAttribute('data-postid', postID); + } + } + if (!this.quotes.contains(quoteID)) { + this.quotes.push(quoteID); + } + if (!a) { + deadlink.textContent = "" + quote + "\u00A0(Dead)"; + return; + } + $.replace(deadlink, a); + if ($.hasClass(a, 'quotelink')) { + return this.nodes.quotelinks.push(a); + } } }; @@ -6005,2848 +6592,6 @@ } }; - ArchiveLink = { - init: function() { - var div, entry, type, _i, _len, _ref; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { - return; - } - div = $.el('div', { - textContent: 'Archive' - }); - entry = { - type: 'post', - el: div, - order: 90, - open: function(_arg) { - var ID, board, redirect, thread; - - ID = _arg.ID, thread = _arg.thread, board = _arg.board; - redirect = Redirect.to({ - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - return redirect !== ("//boards.4chan.org/" + board + "/"); - }, - subEntries: [] - }; - _ref = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['E-mail', 'email'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; - entry.subEntries.push(this.createSubEntry(type[0], type[1])); - } - return $.event('AddMenuEntry', entry); - }, - createSubEntry: function(text, type) { - var el, open; - - el = $.el('a', { - textContent: text, - target: '_blank' - }); - open = type === 'post' ? function(_arg) { - var ID, board, thread; - - ID = _arg.ID, thread = _arg.thread, board = _arg.board; - el.href = Redirect.to({ - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - return true; - } : function(post) { - var value; - - value = Filter[type](post); - if (!value) { - return false; - } - el.href = Redirect.to({ - boardID: post.board.ID, - type: type, - value: value, - isSearch: true - }); - return true; - }; - return { - el: el, - open: open - }; - } - }; - - DeleteLink = { - init: function() { - var div, fileEl, fileEntry, postEl, postEntry; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { - return; - } - div = $.el('div', { - className: 'delete-link', - textContent: 'Delete' - }); - postEl = $.el('a', { - className: 'delete-post', - href: 'javascript:;' - }); - fileEl = $.el('a', { - className: 'delete-file', - href: 'javascript:;' - }); - postEntry = { - el: postEl, - open: function() { - postEl.textContent = 'Post'; - $.on(postEl, 'click', DeleteLink["delete"]); - return true; - } - }; - fileEntry = { - el: fileEl, - open: function(_arg) { - var file; - - file = _arg.file; - if (!file || file.isDead) { - return false; - } - fileEl.textContent = 'File'; - $.on(fileEl, 'click', DeleteLink["delete"]); - return true; - } - }; - return $.event('AddMenuEntry', { - type: 'post', - el: div, - order: 40, - open: function(post) { - var node; - - if (post.isDead) { - return false; - } - DeleteLink.post = post; - node = div.firstChild; - node.textContent = 'Delete'; - DeleteLink.cooldown.start(post, node); - return true; - }, - subEntries: [postEntry, fileEntry] - }); - }, - "delete": function() { - var fileOnly, form, link, m, post, pwd; - - post = DeleteLink.post; - if (DeleteLink.cooldown.counting === post) { - return; - } - $.off(this, 'click', DeleteLink["delete"]); - this.textContent = "Deleting " + this.textContent + "..."; - pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $.id('delPassword').value; - fileOnly = $.hasClass(this, 'delete-file'); - form = { - mode: 'usrdel', - onlyimgdel: fileOnly, - pwd: pwd - }; - form[post.ID] = 'delete'; - link = this; - return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), { - onload: function() { - return DeleteLink.load(link, post, fileOnly, this.response); - }, - onerror: function() { - return DeleteLink.error(link); - } - }, { - cred: true, - form: $.formData(form) - }); - }, - load: function(link, post, fileOnly, html) { - var msg, s, tmpDoc; - - tmpDoc = d.implementation.createHTMLDocument(''); - tmpDoc.documentElement.innerHTML = html; - if (tmpDoc.title === '4chan - Banned') { - s = 'Banned!'; - } else if (msg = tmpDoc.getElementById('errmsg')) { - s = msg.textContent; - $.on(link, 'click', DeleteLink["delete"]); - } else { - if (tmpDoc.title === 'Updating index...') { - (post.origin || post).kill(fileOnly); - } - s = 'Deleted'; - } - return link.textContent = s; - }, - error: function(link) { - link.textContent = 'Connection error, please retry.'; - return $.on(link, 'click', DeleteLink["delete"]); - }, - cooldown: { - start: function(post, node) { - var length, seconds, _ref; - - if (!((_ref = QR.db) != null ? _ref.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }) : void 0)) { - delete DeleteLink.cooldown.counting; - return; - } - DeleteLink.cooldown.counting = post; - length = post.board.ID === 'q' ? 600 : 30; - seconds = Math.ceil((length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND); - return DeleteLink.cooldown.count(post, seconds, length, node); - }, - count: function(post, seconds, length, node) { - if (DeleteLink.cooldown.counting !== post) { - return; - } - if (!((0 <= seconds && seconds <= length))) { - if (DeleteLink.cooldown.counting === post) { - node.textContent = 'Delete'; - delete DeleteLink.cooldown.counting; - } - return; - } - setTimeout(DeleteLink.cooldown.count, 1000, post, seconds - 1, length, node); - return node.textContent = "Delete (" + seconds + ")"; - } - } - }; - - DownloadLink = { - init: function() { - var a; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { - return; - } - a = $.el('a', { - className: 'download-link', - textContent: 'Download file' - }); - return $.event('AddMenuEntry', { - type: 'post', - el: a, - order: 70, - open: function(_arg) { - var file; - - file = _arg.file; - if (!file) { - return false; - } - a.href = file.URL; - a.download = file.name; - return true; - } - }); - } - }; - - Menu = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Menu']) { - return; - } - this.menu = new UI.Menu('post'); - return Post.prototype.callbacks.push({ - name: 'Menu', - cb: this.node - }); - }, - node: function() { - var button; - - button = Menu.makeButton(this); - if (this.isClone) { - $.replace($('.menu-button', this.nodes.info), button); - return; - } - return $.add(this.nodes.info, [$.tn('\u00A0'), button]); - }, - makeButton: (function() { - var a; - - a = null; - return function(post) { - var clone; - - a || (a = $.el('a', { - className: 'menu-button', - innerHTML: '[]', - href: 'javascript:;' - })); - clone = a.cloneNode(true); - clone.setAttribute('data-postid', post.fullID); - if (post.isClone) { - clone.setAttribute('data-clone', true); - } - $.on(clone, 'click', Menu.toggle); - return clone; - }; - })(), - toggle: function(e) { - var post; - - post = this.dataset.clone ? Get.postFromNode(this) : g.posts[this.dataset.postid]; - return Menu.menu.toggle(e, this, post); - } - }; - - ReportLink = { - init: function() { - var a; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { - return; - } - a = $.el('a', { - className: 'report-link', - href: 'javascript:;', - textContent: 'Report this post' - }); - $.on(a, 'click', ReportLink.report); - return $.event('AddMenuEntry', { - type: 'post', - el: a, - order: 10, - open: function(post) { - ReportLink.post = post; - return !post.isDead; - } - }); - }, - report: function() { - var id, post, set, url; - - post = ReportLink.post; - url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; - id = Date.now(); - set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"; - return window.open(url, id, set); - } - }; - - PSAHiding = { - init: function() { - if (!Conf['Announcement Hiding']) { - return; - } - return $.on(d, '4chanXInitFinished', this.setup); - }, - setup: function() { - var btn, psa, text; - - $.off(d, '4chanXInitFinished', PSAHiding.setup); - if (!(psa = $.id('globalMessage'))) { - return; - } - PSAHiding.btn = btn = $.el('a', { - title: 'Toggle announcement.', - innerHTML: '', - href: 'javascript:;', - textContent: '[ - ]' - }); - $.on(btn, 'click', PSAHiding.toggle); - $.prepend(psa, btn); - text = PSAHiding.trim(psa); - return $.get('hiddenPSAs', [], function(item) { - return PSAHiding.sync(item['hiddenPSAs']); - }); - }, - toggle: function(e) { - var text; - - text = PSAHiding.trim($.id('globalMessage')); - return $.get('hiddenPSAs', [], function(item) { - var hiddenPSAs; - - hiddenPSAs = item.hiddenPSAs; - hiddenPSAs.push(text); - hiddenPSAs = hiddenPSAs.slice(-5); - PSAHiding.sync(hiddenPSAs); - return $.set('hiddenPSAs', hiddenPSAs); - }); - }, - sync: function(hiddenPSAs) { - var btn, psa; - - btn = PSAHiding.btn; - psa = $.id('globalMessage'); - if (hiddenPSAs.contains(PSAHiding.trim(psa))) { - $.rm(psa); - return Style.iconPositions(); - } - }, - trim: function(psa) { - return psa.textContent.replace(/\W+/g, '').toLowerCase(); - } - }; - - CatalogLinks = { - init: function() { - var el, input; - - $.ready(this.ready); - if (!Conf['Catalog Links']) { - return; - } - el = $.el('label', { - id: 'toggleCatalog', - href: 'javascript:;', - innerHTML: "Catalog Links", - title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "." - }); - input = $('input', el); - $.on(input, 'change', this.toggle); - $.sync('Header catalog links', CatalogLinks.set); - $.event('AddMenuEntry', { - type: 'header', - el: el, - order: 95 - }); - return $.on(d, '4chanXInitFinished', function() { - return CatalogLinks.set(Conf['Header catalog links']); - }); - }, - toggle: function() { - var useCatalog; - - $.event('CloseMenu'); - $.set('Header catalog links', useCatalog = this.checked); - return CatalogLinks.set(useCatalog); - }, - set: function(useCatalog) { - var a, board, path, _i, _len, _ref; - - path = useCatalog ? 'catalog' : ''; - _ref = $$('a', $.id('board-list')); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - a = _ref[_i]; - board = a.pathname.split('/')[1]; - if (['f', 'status', '4chan'].contains(board) || !board) { - continue; - } - if (Conf['External Catalog']) { - a.href = useCatalog ? CatalogLinks.external(board) : "//boards.4chan.org/" + board + "/"; - } else { - a.pathname = "/" + board + "/" + path; - } - a.title = useCatalog ? "" + a.title + " - Catalog" : a.title.replace(/\ -\ Catalog$/, ''); - } - return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; - }, - external: function(board) { - return (['a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'].contains(board) ? "http://catalog.neet.tv/" + board : ['d', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'].contains(board) ? "http://4index.gropes.us/" + board : "//boards.4chan.org/" + board + "/catalog"); - }, - ready: function() { - var catalogLink; - - if (catalogLink = $('.pages.cataloglink a', d.body) || $('[href=".././catalog"]', d.body)) { - if (g.VIEW !== 'thread') { - $.add(d.body, catalogLink); - } - return catalogLink.id = 'catalog'; - } - } - }; - - ExpandComment = { - init: function() { - if (g.VIEW !== 'index' || !Conf['Comment Expansion']) { - return; - } - if (g.BOARD.ID === 'g') { - this.callbacks.push(Fourchan.code); - } - if (g.BOARD.ID === 'sci') { - this.callbacks.push(Fourchan.math); - } - return Post.prototype.callbacks.push({ - name: 'Comment Expansion', - cb: this.node - }); - }, - node: function() { - var a; - - if (a = $('.abbr > a', this.nodes.comment)) { - return $.on(a, 'click', ExpandComment.cb); - } - }, - callbacks: [], - cb: function(e) { - var post; - - e.preventDefault(); - post = Get.postFromNode(this); - return ExpandComment.expand(post); - }, - expand: function(post) { - var a; - - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { - $.replace(post.nodes.shortComment, post.nodes.longComment); - post.nodes.comment = post.nodes.longComment; - return; - } - if (!(a = $('.abbr > a', post.nodes.comment))) { - return; - } - a.textContent = "Post No." + post + " Loading..."; - return $.cache("//api.4chan.org" + a.pathname + ".json", function() { - return ExpandComment.parse(this, a, post); - }); - }, - contract: function(post) { - var a; - - if (!post.nodes.shortComment) { - return; - } - a = $('.abbr > a', post.nodes.shortComment); - a.textContent = 'here'; - $.replace(post.nodes.longComment, post.nodes.shortComment); - return post.nodes.comment = post.nodes.shortComment; - }, - parse: function(req, a, post) { - var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - - status = req.status; - if (![200, 304].contains(status)) { - a.textContent = "Error " + req.statusText + " (" + status + ")"; - return; - } - posts = JSON.parse(req.response).posts; - if (spoilerRange = posts[0].custom_spoiler) { - Build.spoilerRange[g.BOARD] = spoilerRange; - } - for (_i = 0, _len = posts.length; _i < _len; _i++) { - postObj = posts[_i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - a.textContent = "Post No." + post + " not found."; - return; - } - comment = post.nodes.comment; - clone = comment.cloneNode(false); - clone.innerHTML = postObj.com; - _ref = $$('.quotelink', clone); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - quote = _ref[_j]; - href = quote.getAttribute('href'); - if (href[0] === '/') { - continue; - } - quote.href = "/" + post.board + "/res/" + href; - } - post.nodes.shortComment = comment; - $.replace(comment, clone); - post.nodes.comment = post.nodes.longComment = clone; - post.parseComment(); - post.parseQuotes(); - _ref1 = ExpandComment.callbacks; - for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { - callback = _ref1[_k]; - callback.call(post); - } - } - }; - - ExpandThread = { - init: function() { - if (g.VIEW !== 'index' || !Conf['Thread Expansion']) { - return; - } - return Thread.prototype.callbacks.push({ - name: 'Thread Expansion', - cb: this.node - }); - }, - node: function() { - var a, span; - - if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { - return; - } - a = $.el('a', { - textContent: "+ " + span.textContent, - className: 'summary', - href: 'javascript:;' - }); - $.on(a, 'click', ExpandThread.cbToggle); - return $.replace(span, a); - }, - cbToggle: function() { - var op; - - op = Get.postFromRoot(this.previousElementSibling); - return ExpandThread.toggle(op.thread); - }, - toggle: function(thread) { - var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - - threadRoot = thread.OP.nodes.root.parentNode; - a = $('.summary', threadRoot); - switch (thread.isExpanded) { - case false: - case void 0: - thread.isExpanded = 'loading'; - _ref = $$('.thread > .postContainer', threadRoot); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - post = _ref[_i]; - ExpandComment.expand(Get.postFromRoot(post)); - } - if (!a) { - thread.isExpanded = true; - return; - } - thread.isExpanded = 'loading'; - a.textContent = a.textContent.replace('+', '× Loading...'); - $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { - return ExpandThread.parse(this, thread, a); - }); - break; - case 'loading': - thread.isExpanded = false; - if (!a) { - return; - } - a.textContent = a.textContent.replace('× Loading...', '+'); - break; - case true: - thread.isExpanded = false; - if (a) { - a.textContent = a.textContent.replace('-', '+'); - num = (function() { - if (thread.isSticky) { - return 1; - } else { - switch (g.BOARD.ID) { - case 'b': - case 'vg': - case 'q': - return 3; - case 't': - return 1; - default: - return 5; - } - } - })(); - replies = $$('.thread > .replyContainer', threadRoot).slice(0, -num); - for (_j = 0, _len1 = replies.length; _j < _len1; _j++) { - reply = replies[_j]; - if (Conf['Quote Inlining']) { - while (inlined = $('.inlined', reply)) { - inlined.click(); - } - } - $.rm(reply); - } - } - _ref1 = $$('.thread > .postContainer', threadRoot); - for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { - post = _ref1[_k]; - ExpandComment.contract(Get.postFromRoot(post)); - } - } - }, - parse: function(req, thread, a) { - var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; - - if (a.textContent[0] === '+') { - return; - } - status = req.status; - if (![200, 304].contains(status)) { - a.textContent = "Error " + req.statusText + " (" + status + ")"; - $.off(a, 'click', ExpandThread.cb.toggle); - return; - } - thread.isExpanded = true; - a.textContent = a.textContent.replace('× Loading...', '-'); - posts = JSON.parse(req.response).posts; - if (spoilerRange = posts[0].custom_spoiler) { - Build.spoilerRange[g.BOARD] = spoilerRange; - } - replies = posts.slice(1); - posts = []; - nodes = []; - for (_i = 0, _len = replies.length; _i < _len; _i++) { - reply = replies[_i]; - if (post = thread.posts[reply.no]) { - nodes.push(post.nodes.root); - continue; - } - node = Build.postFromObject(reply, thread.board); - post = new Post(node, thread, thread.board); - link = $('a[title="Highlight this post"]', node); - link.href = "res/" + thread + "#p" + post; - link.nextSibling.href = "res/" + thread + "#q" + post; - posts.push(post); - nodes.push(node); - } - Main.callbackNodes(Post, posts); - $.after(a, nodes); - return Fourchan.parseThread(thread.ID, 1, nodes.length); - } - }; - - FileInfo = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) { - return; - } - this.funk = this.createFunc(Conf['fileInfo']); - return Post.prototype.callbacks.push({ - name: 'File Info Formatting', - cb: this.node - }); - }, - node: function() { - if (!this.file || this.isClone) { - return; - } - return this.file.text.innerHTML = FileInfo.funk(FileInfo, this); - }, - createFunc: function(format) { - var code; - - code = format.replace(/%(.)/g, function(s, c) { - if (c in FileInfo.formatters) { - return "' + FileInfo.formatters." + c + ".call(post) + '"; - } else { - return s; - } - }); - return Function('FileInfo', 'post', "return '" + code + "'"); - }, - convertUnit: function(size, unit) { - var i; - - if (unit === 'B') { - return "" + (size.toFixed()) + " Bytes"; - } - i = 1 + ['KB', 'MB'].indexOf(unit); - while (i--) { - size /= 1024; - } - size = unit === 'MB' ? Math.round(size * 100) / 100 : size.toFixed(); - return "" + size + " " + unit; - }, - escape: function(name) { - return name.replace(/<|>/g, function(c) { - return c === '<' && '<' || '>'; - }); - }, - formatters: { - t: function() { - return this.file.URL.match(/\d+\..+$/)[0]; - }, - T: function() { - return "" + (FileInfo.formatters.t.call(this)) + ""; - }, - l: function() { - return "" + (FileInfo.formatters.n.call(this)) + ""; - }, - L: function() { - return "" + (FileInfo.formatters.N.call(this)) + ""; - }, - n: function() { - var fullname, shortname; - - fullname = this.file.name; - shortname = Build.shortFilename(this.file.name, this.isReply); - if (fullname === shortname) { - return FileInfo.escape(fullname); - } else { - return "" + (FileInfo.escape(shortname)) + "" + (FileInfo.escape(fullname)) + ""; - } - }, - N: function() { - return FileInfo.escape(this.file.name); - }, - p: function() { - if (this.file.isSpoiler) { - return 'Spoiler, '; - } else { - return ''; - } - }, - s: function() { - return this.file.size; - }, - B: function() { - return FileInfo.convertUnit(this.file.sizeInBytes, 'B'); - }, - K: function() { - return FileInfo.convertUnit(this.file.sizeInBytes, 'KB'); - }, - M: function() { - return FileInfo.convertUnit(this.file.sizeInBytes, 'MB'); - }, - r: function() { - if (this.file.isImage) { - return this.file.dimensions; - } else { - return 'PDF'; - } - } - } - }; - - Fourchan = { - init: function() { - var board; - - if (g.VIEW === 'catalog') { - return; - } - board = g.BOARD.ID; - if (board === 'g') { - $.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML);\n}, false);"); - Post.prototype.callbacks.push({ - name: 'Parse /g/ code', - cb: this.code - }); - } - if (board === 'sci') { - $.globalEval("window.addEventListener('jsmath', function(e) {\n if (jsMath.loaded) {\n // process one post\n jsMath.ProcessBeforeShowing(e.detail);\n } else {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);"); - return Post.prototype.callbacks.push({ - name: 'Parse /sci/ math', - cb: this.math - }); - } - }, - code: function() { - var pre, _i, _len, _ref; - - if (this.isClone) { - return; - } - _ref = $$('.prettyprint', this.nodes.comment); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - pre = _ref[_i]; - $.event('prettyprint', pre, window); - } - }, - math: function() { - if (this.isClone || !$('.math', this.nodes.comment)) { - return; - } - return $.event('jsmath', this.nodes.post, window); - }, - parseThread: function(threadID, offset, limit) { - return $.event('4chanParsingDone', { - threadId: threadID, - offset: offset, - limit: limit - }); - } - }; - - Header = { - init: function() { - var createSubEntry, headerToggler, setting, subEntries, _i, _len, _ref; - - this.menuButton = $.el('span', { - className: 'menu-button', - id: 'main-menu' - }); - this.menu = new UI.Menu('header'); - headerToggler = $.el('label', { - innerHTML: ' Auto-hide header' - }); - this.headerToggler = headerToggler.firstElementChild; - $.on(this.menuButton, 'click', this.menuToggle); - $.on(window, 'load hashchange', Header.hashScroll); - $.on(this.headerToggler, 'change', this.toggleBarVisibility); - createSubEntry = Header.createSubEntry; - subEntries = []; - _ref = ['Sticky top', 'Sticky bottom', 'Top', 'Hide']; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - setting = _ref[_i]; - subEntries.push(createSubEntry(setting)); - } - subEntries.push({ - el: headerToggler - }); - $.event('AddMenuEntry', { - type: 'header', - el: $.el('span', { - textContent: 'Header' - }), - order: 105, - subEntries: subEntries - }); - $.on(d, 'CreateNotification', this.createNotification); - $.asap((function() { - return d.body; - }), function() { - if (!Main.isThisPageLegit()) { - return; - } - return $.asap((function() { - return $.id('boardNavMobile'); - }), Header.setBoardList); - }); - return $.ready(function() { - return $.add(d.body, Header.hover); - }); - }, - bar: $.el('div', { - id: 'notifications' - }), - shortcuts: $.el('span', { - id: 'shortcuts' - }), - hover: $.el('div', { - id: 'hoverUI' - }), - toggle: $.el('div', { - id: 'scroll-marker' - }), - createSubEntry: function(setting) { - var label; - - label = $.el('label', { - textContent: "" + setting - }); - $.on(label, 'click', Header.setBarPosition); - return { - el: label - }; - }, - setBoardList: function() { - var a, boardList, btn, customBoardList, fullBoardList, nav, settings; - - Header.nav = nav = $.id('boardNavDesktop'); - nav.id = 'header-bar'; - if (a = $("a[href*='/" + g.BOARD + "/']", nav)) { - a.className = 'current'; - } - boardList = $.el('span', { - id: 'board-list' - }); - $.add(boardList, fullBoardList = $.el('span', { - id: 'full-board-list' - })); - Header.setBarPosition.call({ - textContent: "" + Conf['Boards Navigation'] - }); - $.sync('Boards Navigation', Header.changeBarPosition); - Header.setBarVisibility(Conf['Header auto-hide']); - $.sync('Header auto-hide', Header.setBarVisibility); - $.prepend(d.body, settings = $.id('navtopright')); - $.add(settings, Header.menuButton); - $.add(fullBoardList, __slice.call(nav.childNodes)); - $.add(nav, [boardList, Header.shortcuts, Header.bar, Header.toggle]); - if (Conf['Custom Board Navigation']) { - fullBoardList.hidden = true; - customBoardList = $.el('span', { - id: 'custom-board-list' - }); - $.add(boardList, customBoardList); - Header.generateBoardList(Conf['boardnav']); - $.sync('boardnav', Header.generateBoardList); - btn = $.el('span', { - className: 'hide-board-list-button', - innerHTML: '[ - ]\u00A0' - }); - $.on(btn, 'click', Header.toggleBoardList); - return $.prepend(fullBoardList, btn); - } else { - return fullBoardList.hidden = false; - } - }, - generateBoardList: function(text) { - var as, list, nodes; - - list = $('#custom-board-list', Header.nav); - $.rmAll(list); - if (!text) { - return; - } - as = $$('#full-board-list a', Header.nav).slice(0, -2); - nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map(function(t) { - var a, board, m, _i, _len; - - if (/^[^\w@]/.test(t)) { - return $.tn(t); - } - if (/^toggle-all/.test(t)) { - a = $.el('a', { - className: 'show-board-list-button', - textContent: (t.match(/-text:"(.+)"/) || [null, '+'])[1], - href: 'javascript:;' - }); - $.on(a, 'click', Header.toggleBoardList); - return a; - } - board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0]; - for (_i = 0, _len = as.length; _i < _len; _i++) { - a = as[_i]; - if (a.textContent === board) { - a = a.cloneNode(true); - if (/-title/.test(t)) { - a.textContent = a.title; - } else if (/-replace/.test(t)) { - if ($.hasClass(a, 'current')) { - a.textContent = a.title; - } - } else if (/-full/.test(t)) { - a.textContent = "/" + board + "/ - " + a.title; - } else if (/-(index|catalog|text)/.test(t)) { - if (m = t.match(/-(index|catalog)/)) { - a.setAttribute('data-only', m[1]); - a.href = "//boards.4chan.org/" + board + "/"; - if (m[1] === 'catalog') { - a.href += 'catalog'; - } - } - if (m = t.match(/-text:"(.+)"/)) { - a.textContent = m[1]; - } - } else if (board === '@') { - $.addClass(a, 'navSmall'); - } - return a; - } - } - return $.tn(t); - }); - return $.add(list, nodes); - }, - toggleBoardList: function() { - var custom, full, nav, showBoardList; - - nav = Header.nav; - custom = $('#custom-board-list', nav); - full = $('#full-board-list', nav); - showBoardList = !full.hidden; - custom.hidden = !showBoardList; - return full.hidden = showBoardList; - }, - setBarPosition: function() { - $.event('CloseMenu'); - Header.changeBarPosition(this.textContent); - Conf['Boards Navigation'] = this.textContent; - return $.set('Boards Navigation', this.textContent); - }, - changeBarPosition: function(setting) { - $.rmClass(doc, 'top'); - $.rmClass(doc, 'fixed'); - $.rmClass(doc, 'bottom'); - $.rmClass(doc, 'hide'); - switch (setting) { - case 'Sticky top': - $.addClass(doc, 'top'); - return $.addClass(doc, 'fixed'); - case 'Sticky bottom': - $.addClass(doc, 'fixed'); - return $.addClass(doc, 'bottom'); - case 'Top': - return $.addClass(doc, 'top'); - case 'Hide': - return $.addClass(doc, 'hide'); - } - }, - setBarVisibility: function(hide) { - Header.headerToggler.checked = hide; - $.event('CloseMenu'); - return (hide ? $.addClass : $.rmClass)(Header.nav, 'autohide'); - }, - hashScroll: function() { - var post; - - if (!(post = this.location.hash.slice(1))) { - return; - } - if ((Get.postFromRoot(post)).isHidden) { - return; - } - return Header.scrollToPost(post); - }, - scrollToPost: function(post) { - var headRect, top; - - top = post.getBoundingClientRect().top; - if (Conf['Boards Navigation'] === 'sticky top') { - headRect = Header.bar.getBoundingClientRect(); - top += -headRect.top - headRect.height; - } - return doc.scrollTop += top; - }, - toggleBarVisibility: function(e) { - var hide, message; - - if (e.type === 'mousedown' && e.button !== 0) { - return; - } - hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); - Conf['Header auto-hide'] = hide; - $.set('Header auto-hide', hide); - Header.setBarVisibility(hide); - message = hide ? 'The header bar will automatically hide itself.' : 'The header bar will remain visible.'; - return new Notification('info', message, 2); - }, - hashScroll: function() { - var hash, post; - - if (!((hash = this.location.hash) && (post = $.id(hash.slice(1))))) { - return; - } - if ((Get.postFromRoot(post)).isHidden) { - return; - } - return Header.scrollToPost(post); - }, - scrollToPost: function(post) { - var headRect, top; - - top = post.getBoundingClientRect().top; - if (Conf['Boards Navigation'] === 'Sticky top') { - headRect = Header.bar.getBoundingClientRect(); - top += -headRect.top - headRect.height; - } - return doc.scrollTop += top; - }, - addShortcut: function(el) { - var shortcut; - - shortcut = $.el('span', { - className: 'shortcut' - }); - $.add(shortcut, [$.tn(' ['), el, $.tn(']')]); - return $.prepend(Header.shortcuts, shortcut); - }, - menuToggle: function(e) { - return Header.menu.toggle(e, this, g); - }, - createNotification: function(e) { - var cb, content, lifetime, notif, type, _ref; - - _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; - notif = new Notification(type, content, lifetime); - if (cb) { - return cb(notif); - } - } - }; - - Keybinds = { - init: function() { - var init; - - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { - return; - } - init = function() { - var node, _i, _len, _ref; - - $.off(d, '4chanXInitFinished', init); - $.on(d, 'keydown', Keybinds.keydown); - _ref = $$('[accesskey]'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - node.removeAttribute('accesskey'); - } - }; - return $.on(d, '4chanXInitFinished', init); - }, - keydown: function(e) { - var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; - - if (!(key = Keybinds.keyCode(e))) { - return; - } - target = e.target; - if (['INPUT', 'TEXTAREA'].contains(target.nodeName)) { - if (!/(Esc|Alt|Ctrl|Meta)/.test(key)) { - return; - } - } - threadRoot = Nav.getThread(); - if (op = $('.op', threadRoot)) { - thread = Get.postFromNode(op).thread; - } - switch (key) { - case Conf['Toggle board list']: - if (Conf['Custom Board Navigation']) { - Header.toggleBoardList(); - } - break; - case Conf['Open empty QR']: - Keybinds.qr(threadRoot); - break; - case Conf['Open QR']: - Keybinds.qr(threadRoot, true); - break; - case Conf['Open settings']: - Settings.open(); - break; - case Conf['Close']: - if ($.id('fourchanx-settings')) { - Settings.close(); - } else if ((notifications = $$('.notification')).length) { - for (_i = 0, _len = notifications.length; _i < _len; _i++) { - notification = notifications[_i]; - $('.close', notification).click(); - } - } else if (QR.nodes) { - QR.close(); - } - break; - case Conf['Spoiler tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('spoiler', target); - break; - case Conf['Code tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('code', target); - break; - case Conf['Eqn tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('eqn', target); - break; - case Conf['Math tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('math', target); - break; - case Conf['Submit QR']: - if (QR.nodes && !QR.status()) { - QR.submit(); - } - break; - case Conf['Watch']: - ThreadWatcher.toggle(thread); - break; - case Conf['Update']: - ThreadUpdater.update(); - break; - case Conf['Expand image']: - Keybinds.img(threadRoot); - break; - case Conf['Expand images']: - Keybinds.img(threadRoot, true); - break; - case Conf['fappeTyme']: - FappeTyme.toggle(); - break; - case Conf['Front page']: - window.location = "/" + g.BOARD + "/0#delform"; - break; - case Conf['Open front page']: - $.open("/" + g.BOARD + "/#delform"); - break; - case Conf['Next page']: - if (form = $('.next form')) { - window.location = form.action; - } - break; - case Conf['Previous page']: - if (form = $('.prev form')) { - window.location = form.action; - } - break; - case Conf['Next thread']: - if (g.VIEW === 'thread') { - return; - } - Nav.scroll(+1); - break; - case Conf['Previous thread']: - if (g.VIEW === 'thread') { - return; - } - Nav.scroll(-1); - break; - case Conf['Expand thread']: - ExpandThread.toggle(thread); - break; - case Conf['Open thread']: - Keybinds.open(thread); - break; - case Conf['Open thread tab']: - Keybinds.open(thread, true); - break; - case Conf['Next reply']: - Keybinds.hl(+1, threadRoot); - break; - case Conf['Previous reply']: - Keybinds.hl(-1, threadRoot); - break; - case Conf['Hide']: - if (g.VIEW === 'index') { - ThreadHiding.toggle(thread); - } - break; - default: - return; - } - e.preventDefault(); - return e.stopPropagation(); - }, - keyCode: function(e) { - var kc, key; - - key = (function() { - switch (kc = e.keyCode) { - case 8: - return ''; - case 13: - return 'Enter'; - case 27: - return 'Esc'; - case 37: - return 'Left'; - case 38: - return 'Up'; - case 39: - return 'Right'; - case 40: - return 'Down'; - default: - if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { - return String.fromCharCode(kc).toLowerCase(); - } else { - return null; - } - } - })(); - if (key) { - if (e.altKey) { - key = 'Alt+' + key; - } - if (e.ctrlKey) { - key = 'Ctrl+' + key; - } - if (e.metaKey) { - key = 'Meta+' + key; - } - if (e.shiftKey) { - key = 'Shift+' + key; - } - } - return key; - }, - qr: function(thread, quote) { - if (!(Conf['Quick Reply'] && QR.postingIsEnabled)) { - return; - } - QR.open(); - if (quote) { - QR.quote.call($('input', $('.post.highlight', thread) || thread)); - } - QR.nodes.com.focus(); - if (Conf['QR Shortcut']) { - return $.rmClass($('.qr-shortcut'), 'disabled'); - } - }, - tags: function(tag, ta) { - var range, selEnd, selStart, value; - - value = ta.value; - selStart = ta.selectionStart; - selEnd = ta.selectionEnd; - ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd); - range = ("[" + tag + "]").length + selEnd; - ta.setSelectionRange(range, range); - return $.event('input', null, ta); - }, - img: function(thread, all) { - var post; - - if (all) { - return ImageExpand.cb.toggleAll(); - } else { - post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread)); - return ImageExpand.toggle(post); - } - }, - open: function(thread, tab) { - var url; - - if (g.VIEW !== 'index') { - return; - } - url = "/" + thread.board + "/res/" + thread; - if (tab) { - return $.open(url); - } else { - return location.href = url; - } - }, - hl: function(delta, thread) { - var headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; - - if (Conf['Fixed Header'] && Conf['Bottom header']) { - topMargin = 0; - } else { - headRect = Header.bar.getBoundingClientRect(); - topMargin = headRect.top + headRect.height; - } - if (postEl = $('.reply.highlight', thread)) { - $.rmClass(postEl, 'highlight'); - rect = postEl.getBoundingClientRect(); - if (rect.bottom >= topMargin && rect.top <= doc.clientHeight) { - root = postEl.parentNode; - next = $.x('child::div[contains(@class,"post reply")]', delta === +1 ? root.nextElementSibling : root.previousElementSibling); - if (!next) { - this.focus(postEl); - return; - } - if (!(g.VIEW === 'thread' || $.x('ancestor::div[parent::div[@class="board"]]', next) === thread)) { - return; - } - rect = next.getBoundingClientRect(); - if (rect.top < 0 || rect.bottom > doc.clientHeight) { - if (delta === -1) { - window.scrollBy(0, rect.top - topMargin); - } else { - next.scrollIntoView(false); - } - } - this.focus(next); - return; - } - } - replies = $$('.reply', thread); - if (delta === -1) { - replies.reverse(); - } - for (_i = 0, _len = replies.length; _i < _len; _i++) { - reply = replies[_i]; - rect = reply.getBoundingClientRect(); - if (delta === +1 && rect.top >= topMargin || delta === -1 && rect.bottom <= doc.clientHeight) { - this.focus(reply); - return; - } - } - }, - focus: function(post) { - return $.addClass(post, 'highlight'); - } - }; - - Redirect = { - init: function() { - return $.sync('archs', this.updateArchives); - }, - updateArchives: function() { - return $.get('archivers', {}, function(_arg) { - var archivers; - - archivers = _arg.archivers; - return Conf['archivers'] = archivers; - }); - }, - image: function(boardID, filename) { - switch (boardID) { - case 'a': - case 'gd': - case 'jp': - case 'm': - case 'q': - case 'tg': - case 'vg': - case 'vp': - case 'vr': - case 'wsg': - return "//archive.foolz.us/" + boardID + "/full_image/" + filename; - case 'u': - return "//nsfw.foolz.us/" + boardID + "/full_image/" + filename; - case 'po': - return "//archive.thedarkcave.org/" + boardID + "/full_image/" + filename; - case 'hr': - case 'tv': - return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename; - case 'ck': - case 'fa': - case 'lit': - case 's4s': - return "//fuuka.warosu.org/" + boardID + "/full_image/" + filename; - case 'cgl': - case 'g': - case 'mu': - case 'w': - return "//rbt.asia/" + boardID + "/full_image/" + filename; - case 'an': - case 'k': - case 'toy': - case 'x': - return "http://archive.heinessen.com/" + boardID + "/full_image/" + filename; - case 'c': - return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename; - } - }, - post: function(boardID, postID) { - var archive, name, _base, _ref; - - if (Redirect.post[boardID] == null) { - _ref = this.archiver; - for (name in _ref) { - archive = _ref[name]; - if (archive.type === 'foolfuuka' && archive.boards.contains(boardID)) { - Redirect.post[boardID] = archive.base; - break; - } - } - (_base = Redirect.post)[boardID] || (_base[boardID] = false); - } - if (Redirect.post[boardID]) { - return "" + Redirect.post[boardID] + "/_/api/chan/post/?board=" + boardID + "&num=" + postID; - } else { - return null; - } - }, - select: function(board) { - var archive, name, _ref, _results; - - _ref = this.archiver; - _results = []; - for (name in _ref) { - archive = _ref[name]; - if (!archive.boards.contains(board)) { - continue; - } - _results.push(name); - } - return _results; - }, - to: function(data) { - var arch, archive, boardID; - - boardID = data.boardID; - if ((arch = Conf.archivers[boardID]) == null) { - Conf.archivers[boardID] = arch = this.select(boardID)[0]; - $.set('archivers', Conf.archivers); - } - return (arch && (archive = this.archiver[arch]) ? Redirect.path(archive.base, archive.type, data) : data.threadID ? "//boards.4chan.org/" + boardID + "/" : null); - }, - archiver: { - 'Foolz': { - base: 'https://archive.foolz.us', - boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'], - type: 'foolfuuka' - }, - 'NSFWFoolz': { - base: 'https://nsfw.foolz.us', - boards: ['u'], - type: 'foolfuuka' - }, - 'TheDarkCave': { - base: 'http://archive.thedarkcave.org', - boards: ['c', 'int', 'out', 'po'], - type: 'foolfuuka' - }, - '4plebs': { - base: 'http://archive.4plebs.org', - boards: ['hr', 'tg', 'tv', 'x'], - base: 'foolfuuka' - }, - 'Warosu': { - base: '//fuuka.warosu.org', - boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'], - type: 'fuuka' - }, - 'InstallGentoo': { - base: '//archive.installgentoo.net', - boards: ['diy', 'g', 'sci'], - type: 'fuuka' - }, - 'RebeccaBlackTech': { - base: '//rbt.asia', - boards: ['an', 'cgl', 'g', 'mu', 'w'], - type: 'fuuka_mail' - }, - 'Heinessen': { - base: 'http://archive.heinessen.com', - boards: ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'], - type: 'fuuka' - }, - 'Cliche': { - base: '//www.cliché.net/4chan/cgi-board.pl', - boards: ['e'], - type: 'fuuka' - }, - 'NyaFuu': { - base: '//archive.nyafuu.org', - boards: ['c', 'w'], - type: 'fuuka' - } - }, - path: function(base, archiver, data) { - var boardID, path, postID, threadID, type, value; - - if (data.isSearch) { - boardID = data.boardID, type = data.type, value = data.value; - type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; - value = encodeURIComponent(value); - if (archiver === 'foolfuuka') { - return "" + base + "/" + boardID + "/search/" + type + "/" + value; - } else if (type === 'image') { - return "" + base + "/" + boardID + "/?task=search2&search_media_hash=" + value; - } else { - return "" + base + "/" + boardID + "/?task=search2&search_" + type + "=" + value; - } - } - boardID = data.boardID, threadID = data.threadID, postID = data.postID; - path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; - if (archiver === 'foolfuuka') { - path += '/'; - } - if (threadID && postID) { - path += archiver === 'foolfuuka' ? "#" + postID : "#p" + postID; - } - return "" + base + "/" + path; - } - }; - - RelativeDates = { - INTERVAL: $.MINUTE / 2, - init: function() { - if (g.VIEW === 'catalog' || !Conf['Relative Post Dates']) { - return; - } - $.on(d, 'visibilitychange ThreadUpdate', this.flush); - this.flush(); - return Post.prototype.callbacks.push({ - name: 'Relative Post Dates', - cb: this.node - }); - }, - node: function() { - var dateEl; - - if (this.isClone) { - return; - } - dateEl = this.nodes.date; - dateEl.title = dateEl.textContent; - return RelativeDates.setUpdate(this); - }, - relative: function(diff, now, date) { - var days, months, number, rounded, unit, years; - - unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); - rounded = Math.round(number); - if (rounded !== 1) { - unit += 's'; - } - return "" + rounded + " " + unit + " ago"; - }, - stale: [], - flush: function() { - var now, update, _i, _len, _ref; - - if (d.hidden) { - return; - } - now = new Date(); - _ref = RelativeDates.stale; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - update = _ref[_i]; - update(now); - } - RelativeDates.stale = []; - clearTimeout(RelativeDates.timeout); - return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); - }, - setUpdate: function(post) { - var markStale, setOwnTimeout, update; - - setOwnTimeout = function(diff) { - var delay; - - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; - return setTimeout(markStale, delay); - }; - update = function(now) { - var date, diff, relative, singlePost, _i, _len, _ref; - - date = post.info.date; - diff = now - date; - relative = RelativeDates.relative(diff, now, date); - _ref = [post].concat(post.clones); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - singlePost = _ref[_i]; - singlePost.nodes.date.firstChild.textContent = relative; - } - return setOwnTimeout(diff); - }; - markStale = function() { - return RelativeDates.stale.push(update); - }; - return update(new Date()); - } - }; - - Report = { - init: function() { - if (!/report/.test(location.search)) { - return; - } - return $.ready(this.ready); - }, - ready: function() { - var field, form; - - form = $('form'); - field = $.id('recaptcha_response_field'); - $.on(field, 'keydown', function(e) { - if (e.keyCode === 8 && !field.value) { - return $.globalEval('Recaptcha.reload("t")'); - } - }); - return $.on(form, 'submit', function(e) { - var response; - - e.preventDefault(); - response = field.value.trim(); - if (!/\s/.test(response)) { - field.value = "" + response + " " + response; - } - return form.submit(); - }); - } - }; - - Nav = { - init: function() { - var append, next, prev, span; - - switch (g.VIEW) { - case 'index': - if (!Conf['Index Navigation']) { - return; - } - break; - case 'thread': - if (!Conf['Reply Navigation']) { - return; - } - break; - default: - return; - } - span = $.el('span', { - id: 'navlinks' - }); - prev = $.el('a', { - href: 'javascript:;' - }); - next = $.el('a', { - href: 'javascript:;' - }); - $.on(prev, 'click', this.prev); - $.on(next, 'click', this.next); - $.add(span, [prev, $.tn(' '), next]); - append = function() { - $.off(d, '4chanXInitFinished', append); - return $.add(d.body, span); - }; - return $.on(d, '4chanXInitFinished', append); - }, - prev: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, 0); - } else { - return Nav.scroll(-1); - } - }, - next: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, d.body.scrollHeight); - } else { - return Nav.scroll(+1); - } - }, - getThread: function(full) { - var headRect, i, rect, thread, threads, topMargin, _i, _len; - - if (Conf['Bottom header']) { - topMargin = 0; - } else { - headRect = Header.bar.getBoundingClientRect(); - topMargin = headRect.top + headRect.height; - } - threads = $$('.thread:not([hidden])'); - for (i = _i = 0, _len = threads.length; _i < _len; i = ++_i) { - thread = threads[i]; - rect = thread.getBoundingClientRect(); - if (rect.bottom > topMargin) { - if (full) { - return [threads, thread, i, rect, topMargin]; - } else { - return thread; - } - } - } - return $('.board'); - }, - scroll: function(delta) { - var i, rect, thread, threads, top, topMargin, _ref, _ref1; - - _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; - top = rect.top - topMargin; - if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) { - i += delta; - } - top = ((_ref1 = threads[i]) != null ? _ref1.getBoundingClientRect().top : void 0) - topMargin; - return window.scrollBy(0, top); - } - }; - - Sauce = { - init: function() { - var link, links, _i, _len, _ref; - - if (g.VIEW === 'catalog' || !Conf['Sauce']) { - return; - } - links = []; - _ref = Conf['sauces'].split('\n'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - if (link[0] === '#') { - continue; - } - links.push(this.createSauceLink(link.trim())); - } - if (!links.length) { - return; - } - this.links = links; - this.link = $.el('a', { - target: '_blank' - }); - return Post.prototype.callbacks.push({ - name: 'Sauce', - cb: this.node - }); - }, - createSauceLink: function(link) { - var m, text; - - link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { - switch (parameter) { - case '%TURL': - return "' + encodeURIComponent(post.file.thumbURL) + '"; - case '%URL': - return "' + encodeURIComponent(post.file.URL) + '"; - case '%MD5': - return "' + encodeURIComponent(post.file.MD5) + '"; - case '%board': - return "' + encodeURIComponent(post.board) + '"; - default: - return parameter; - } - }); - text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1]; - link = link.replace(/;text:.+$/, ''); - return Function('post', 'a', "a.href = '" + link + "';\na.textContent = '" + text + "';\nreturn a;"); - }, - node: function() { - var link, nodes, _i, _len, _ref; - - if (this.isClone || !this.file) { - return; - } - nodes = []; - _ref = Sauce.links; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - nodes.push($.tn('\u00A0'), link(this, Sauce.link.cloneNode(true))); - } - return $.add(this.file.info, nodes); - } - }; - - Time = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Time Formatting']) { - return; - } - this.funk = this.createFunc(Conf['time']); - return Post.prototype.callbacks.push({ - name: 'Time Formatting', - cb: this.node - }); - }, - node: function() { - if (this.isClone) { - return; - } - return this.nodes.date.textContent = Time.funk(Time, this.info.date); - }, - createFunc: function(format) { - var code; - - code = format.replace(/%([A-Za-z])/g, function(s, c) { - if (c in Time.formatters) { - return "' + Time.formatters." + c + ".call(date) + '"; - } else { - return s; - } - }); - return Function('Time', 'date', "return '" + code + "'"); - }, - day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - zeroPad: function(n) { - if (n < 10) { - return "0" + n; - } else { - return n; - } - }, - formatters: { - a: function() { - return Time.day[this.getDay()].slice(0, 3); - }, - A: function() { - return Time.day[this.getDay()]; - }, - b: function() { - return Time.month[this.getMonth()].slice(0, 3); - }, - B: function() { - return Time.month[this.getMonth()]; - }, - d: function() { - return Time.zeroPad(this.getDate()); - }, - e: function() { - return this.getDate(); - }, - H: function() { - return Time.zeroPad(this.getHours()); - }, - I: function() { - return Time.zeroPad(this.getHours() % 12 || 12); - }, - k: function() { - return this.getHours(); - }, - l: function() { - return this.getHours() % 12 || 12; - }, - m: function() { - return Time.zeroPad(this.getMonth() + 1); - }, - M: function() { - return Time.zeroPad(this.getMinutes()); - }, - p: function() { - if (this.getHours() < 12) { - return 'AM'; - } else { - return 'PM'; - } - }, - P: function() { - if (this.getHours() < 12) { - return 'am'; - } else { - return 'pm'; - } - }, - S: function() { - return Time.zeroPad(this.getSeconds()); - }, - y: function() { - return this.getFullYear() - 2000; - } - } - }; - - Favicon = { - init: function() { - return $.ready(function() { - var href; - - Favicon.el = $('link[rel="shortcut icon"]', d.head); - Favicon.el.type = 'image/x-icon'; - href = Favicon.el.href; - Favicon.SFW = /ws\.ico$/.test(href); - Favicon["default"] = href; - return Favicon["switch"](); - }); - }, - "switch": function() { - var unreadDead; - - unreadDead = Favicon.unreadDeadY = Favicon.unreadSFW = Favicon.unreadSFWY = Favicon.unreadNSFW = Favicon.unreadNSFWY = 'data:image/png;base64,'; - switch (Conf['favicon']) { - case 'ferongr': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAS1BMVEUAAAAAAAAAAAAJAAASAAAZAQAaAQAiAQAkAQAoFBQyAgAzAgA1AgA4AABBAgBXAwBzBQCEBgGvCAG/AADoCwLpDAP/gID/q6v///9zILr8AAAAA3RSTlMAx9dmesIgAAAAc0lEQVQY02WPgQ6DIBBDmTqnbE70Cvb/v3TAnW5OSKB9ybXg3HUBOAmEEH4FQtrSn4gxi+xjVC9SVOEiSvbZI8zSV+/Xo7icnryZ15GObMxvtWUkB/VJW57kHU7fUcHStm8FkncGE/mwP6CGzq/eauHwvT7sWQt3gZLW+AAAAABJRU5ErkJggg=='; - Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///8AcH4AtswA2PJ55fKi6fIA1/FtpPADAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; - Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAASFBMVEUAAAAAAAAAAAAACAkAERMAGBsAGR0AISUALzQALzUAMTcANjwAP0cAVF8AcH4AeokAorYAtswA1/EA2PISIyV55fKi6fL////l+pZqAAAAA3RSTlMAx9dmesIgAAAAcklEQVQY02VPARLCIAxjsjnUWdcg6/9/ukIr00nvIMldEhrC/wHwA0BE3wBUtnICOStQnrNx5oqqzmzKx9vDPH1Nae3F9U4ig3OzjCIX51treYvMxou13EQmBPtHE14xLiawjgoPtfgOaKHP+9VrEXA8O1v7CmSPE3u0AAAAAElFTkSuQmCC'; - Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///8oeQBJ3ABV/wHM/7Lu/+ZU/gAqUP3dAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; - Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAS1BMVEUAAAAAAAAAAAADCgAGEgAIGgAJGwALJAANJwASNwASOAATOgAVQQAWRAAeWwAgKBsoeQAwkQA/wABJ3ABU/gBV/wHM/7Lu/+b////r+K2AAAAAA3RSTlMAx9dmesIgAAAAc0lEQVQY02WPgQ6DIBBDmTonbk70Cvb/v3TAnW5OSKB9ybXg3HUBOAmEEH4FQtrSn4gxi+xjVC9SVOEiSvbZI8zSV+/Xo7icnryZ15GObMxvtWUmB/VJW0byDqfvqGBp20mB5J3Bi3zYH1BD38/eauHwvT7sEAt1Fb320QAAAABJRU5ErkJggg=='; - break; - case 'xat-': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEX9AAD8AAD/AAD+AADAExKKXl2CfHqLkZFub2yfaF3bZ2PzZGL/zs//iYr/AAASAAAGAAAAAAAAAAAAAADpOCseAAAADHRSTlP9MAcAATVYeprJ5O/MbzqoAAAAXklEQVQY03VPQQ7AIAgz8QAG4dL//3VVcVk2Vw4tDVQp9YVyMACIEkIxDEQEGjHFnBjCbPU5EXBfnBns6WRG1Wbuvbtb0z9jr6Qh2KGQenp2/+xpsFQnrePAuulz7QUTuwm5NnwmIAAAAABJRU5ErkJggg=='; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUBAAACAQELCQkPDQwgFBMzKilOSEdva2iEgoCReHOadXClamDIaWbxcG7+hIX+mpv+m5z+oqP+tLX+zc7//f3+9PT97Oz23t750NDbra3zwL87LCwAAAAGAABHAADPAAD/AABkWeLDAAAAHHRSTlO5/fTv8Na2n42lsMvi8v3+/v749OaITDsDAQABSG2w8gAAAGdJREFUCNdNjtEKgDAIRYVGCmsyqCe7q/3/V2azQfpwPehVyQCIMIt4YYTeO7LHKMiGlDIkuh2qofR6obUqhtc4F637XreU1h+m41gcJX/DHyJWXYHzkCMm+hd3a4GezLNr8PQA4bQHEXEQFRJP5NAAAAA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K13U2n8Z+wnaRB2KKievt2bPY0o5knrOETd9Ln2AuDLCz1j8HTeAAAAAElFTkSuQmCC'; - Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUPGgsCBAIBAQEBAQAAAQAAAAABAQEFBQQQEw85SDdVa1GhzJm967TZ+NLP+sbM+8S6/a3k/9+s/pyr/puX/oSd15KIuoGBj39tfm1qj2RepFlu2VRkwzZlyTNatC5myzMAAAAOPREWAAAAHnRSTlP4/fz331IPBQIBAAECOly37/7+/v7XwpWktNDy+f7X56yoAAAAZElEQVQI102NwQ7AIAhDMdku3JwkIiaz//+VQ9FkcCgvpUAMoKpX9YEJYww0s7YG4iW9Lwl3QCSUZhZSHsHKslqXknPpRPpDypkmtr0cWBGntnseOeKgGd6UAr1Vj8vw9sKFmz+fERAp5vutHwAAAABJRU5ErkJggg=='; - break; - case 'Mayhem': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABIUlEQVQ4jZ2ScWuDMBDFgw4pIkU0WsoQkWAYIkXZH4N9/+/V3dmfXSrKYIFHwt17j8vdGWNMIkgFuaDgzgQnwRs4EQs5KdolUQtagRN0givEDBTEOjgtGs0Zq8F7cKqqusVxrMQLaDUWcjBSrXkn8gs51tpJSWLk9b3HUa0aNIL5gPBR1/V4kJvR7lTwl8GmAm1Gf9+c3S+89qBHa8502AsmSrtBaEBPbIbj0ah2madlNAPEccdgJDfAtWifBjqWKShRBT6KoiH8QlEUn/qt0CCjnNdmPUwmFWzj9Oe6LpKuZXcwqq88z78Pch3aZU3dPwwc2sWlfZKCW5tWluV8kGvXClLm6dYN4/aUqfCbnEOzNDGhGZbNargvxCzvMGfRJD8UaDVvgkzo6QAAAABJRU5ErkJggg=='; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABj0lEQVQ4y42TQUorQRCGv+oekpj43p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ZzUanCWzZQAAAABJRU5ErkJggg=='; - Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///8ul8P///8AAACaqgkzAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; - Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAABBQcHFx4KISoNLToaVW4oKCgul8M4ODg7OzvBwcH///8uS/CdAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWoftRGvdwBEewchM7d9BFbE6pbP4Mgj+R5MjjwgP+qQSkRtQAV8K3lVI2Q648oknIRpWZsMI4988HjgvpU+wO8HgeHzR9cjZYhoRiPkcDd0rXpyUAiRd5YjKC7MvNRgAAAABJRU5ErkJggg=='; - Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///9mzDP///8AAACT0n1lAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; - Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAECAIQIAgWLAsePA8oKCg4ODg6dB07OztmzDPBwcH///+rsf3XAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWofRL4x6O4AhuopWb2P4F7E5prP4MgiaSHHlceMA/jYC0iBrgSnjdKaUacuURTUI2qsyEFcaxvD6wnkifYleAx/N449Mn5wfbkFDM52jgTun6tAQg8QAEvjQg42KY2AAAAABJRU5ErkJggg=='; - } - if (Favicon.SFW) { - Favicon.unread = Favicon.unreadSFW; - return Favicon.unreadY = Favicon.unreadSFWY; - } else { - Favicon.unread = Favicon.unreadNSFW; - return Favicon.unreadY = Favicon.unreadNSFWY; - } - }, - empty: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX////b29sAAAAJ2DVhAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=', - dead: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX/////AAAAAACalQKRAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=' - }; - - ThreadExcerpt = { - init: function() { - if (g.VIEW !== 'thread' || !Conf['Thread Excerpt']) { - return; - } - return Thread.prototype.callbacks.push({ - name: 'Thread Excerpt', - cb: this.node - }); - }, - node: function() { - return d.title = Get.threadExcerpt(this); - } - }; - - ThreadStats = { - init: function() { - var html; - - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { - return; - } - html = '0 / 0'; - if (Conf['Thread Updater']) { - this.dialog = $.el('span', { - innerHTML: "[ " + html + " ]" - }); - } else { - this.dialog = UI.dialog('thread-stats', 'bottom: 0; left: 0;', "
" + html + "
"); - } - this.postCountEl = $('#post-count', this.dialog); - this.fileCountEl = $('#file-count', this.dialog); - return Thread.prototype.callbacks.push({ - name: 'Thread Stats', - cb: this.node - }); - }, - node: function() { - var ID, fileCount, post, postCount, _ref; - - postCount = 0; - fileCount = 0; - _ref = this.posts; - for (ID in _ref) { - post = _ref[ID]; - postCount++; - if (post.file) { - fileCount++; - } - } - ThreadStats.thread = this; - ThreadStats.update(postCount, fileCount); - $.on(d, 'ThreadUpdate', ThreadStats.onUpdate); - if (Conf['Thread Updater']) { - return $.asap((function() { - return $('.move', ThreadUpdater.dialog); - }), function() { - return $.prepend($('.move', ThreadUpdater.dialog), ThreadStats.dialog); - }); - } else { - return $.add(d.body, ThreadStats.dialog); - } - }, - onUpdate: function(e) { - var fileCount, postCount, _ref; - - if (e.detail[404]) { - return; - } - _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount; - return ThreadStats.update(postCount, fileCount); - }, - update: function(postCount, fileCount) { - var fileCountEl, postCountEl, thread; - - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; - postCountEl.textContent = postCount; - fileCountEl.textContent = fileCount; - (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning'); - return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning'); - } - }; - - ThreadUpdater = { - init: function() { - var checked, conf, html, name, _ref; - - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { - return; - } - html = ''; - _ref = Config.updater.checkbox; - for (name in _ref) { - conf = _ref[name]; - checked = Conf[name] ? 'checked' : ''; - html += "
"; - } - checked = Conf['Auto Update'] ? 'checked' : ''; - html = "
\n" + html + "\n
\n
\n
"; - this.dialog = UI.dialog('updater', 'bottom: 0; right: 0;', html); - this.timer = $('#update-timer', this.dialog); - this.status = $('#update-status', this.dialog); - this.checkPostCount = 0; - return Thread.prototype.callbacks.push({ - name: 'Thread Updater', - cb: this.node - }); - }, - node: function() { - var input, _i, _len, _ref; - - ThreadUpdater.thread = this; - ThreadUpdater.root = this.OP.nodes.root.parentNode; - ThreadUpdater.lastPost = +ThreadUpdater.root.lastElementChild.id.match(/\d+/)[0]; - ThreadUpdater.outdateCount = 0; - ThreadUpdater.lastModified = '0'; - _ref = $$('input', ThreadUpdater.dialog); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - input = _ref[_i]; - if (input.type === 'checkbox') { - $.on(input, 'change', $.cb.checked); - } - switch (input.name) { - case 'Scroll BG': - $.on(input, 'change', ThreadUpdater.cb.scrollBG); - ThreadUpdater.cb.scrollBG(); - break; - case 'Auto Update This': - $.on(input, 'change', ThreadUpdater.cb.autoUpdate); - $.event('change', null, input); - break; - case 'Interval': - $.on(input, 'change', ThreadUpdater.cb.interval); - ThreadUpdater.cb.interval.call(input); - break; - case 'Update': - $.on(input, 'click', ThreadUpdater.update); - } - } - $.on(window, 'online offline', ThreadUpdater.cb.online); - $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.post); - $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); - ThreadUpdater.cb.online(); - Rice.nodes(ThreadUpdater.dialog); - return $.add(d.body, ThreadUpdater.dialog); - }, - /* - http://freesound.org/people/pierrecartoons1979/sounds/90112/ - cc-by-nc-3.0 - */ - - beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', - cb: { - online: function() { - if (ThreadUpdater.online = navigator.onLine) { - ThreadUpdater.outdateCount = 0; - ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - if (Conf['Auto Update This']) { - ThreadUpdater.update(); - } - ThreadUpdater.set('status', null, null); - } else { - ThreadUpdater.set('timer', null); - ThreadUpdater.set('status', 'Offline', 'warning'); - } - return ThreadUpdater.cb.autoUpdate(); - }, - post: function(e) { - if (!(Conf['Auto Update This'] && e.detail.threadID === ThreadUpdater.thread.ID)) { - return; - } - ThreadUpdater.outdateCount = 0; - if (ThreadUpdater.seconds > 2) { - return setTimeout(ThreadUpdater.update, 1000); - } - }, - checkpost: function() { - if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 10)) { - return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500); - } - ThreadUpdater.checkPostCount = 0; - delete ThreadUpdater.foundPost; - return delete ThreadUpdater.postID; - }, - visibility: function() { - if (d.hidden) { - return; - } - ThreadUpdater.outdateCount = 0; - if (ThreadUpdater.seconds > ThreadUpdater.interval) { - return ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - } - }, - scrollBG: function() { - return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() { - return true; - } : function() { - return !d.hidden; - }; - }, - autoUpdate: function() { - if (Conf['Auto Update This'] && ThreadUpdater.online) { - return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); - } else { - return clearTimeout(ThreadUpdater.timeoutID); - } - }, - interval: function() { - var val; - - val = parseInt(this.value, 10); - ThreadUpdater.interval = this.value = val; - return $.cb.value.call(this); - }, - load: function() { - var klass, req, text, _ref; - - req = ThreadUpdater.req; - switch (req.status) { - case 200: - g.DEAD = false; - ThreadUpdater.parse(JSON.parse(req.response).posts); - ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified'); - ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - break; - case 404: - g.DEAD = true; - ThreadUpdater.set('timer', null); - ThreadUpdater.set('status', '404', 'warning'); - clearTimeout(ThreadUpdater.timeoutID); - ThreadUpdater.thread.kill(); - $.event('ThreadUpdate', { - 404: true, - thread: ThreadUpdater.thread - }); - break; - default: - ThreadUpdater.outdateCount++; - ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - /* - Status Code 304: Not modified - By sending the `If-Modified-Since` header we get a proper status code, and no response. - This saves bandwidth for both the user and the servers and avoid unnecessary computation. - */ - - _ref = [0, 304].contains(req.status) ? [null, null] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1]; - ThreadUpdater.set('status', text, klass); - } - if (ThreadUpdater.postID) { - ThreadUpdater.cb.checkpost(this.status); - } - return delete ThreadUpdater.req; - } - }, - getInterval: function() { - var i, j; - - i = ThreadUpdater.interval; - j = Math.min(ThreadUpdater.outdateCount, 10); - if (!d.hidden) { - j = Math.min(j, 7); - } - return ThreadUpdater.seconds = Conf['Optional Increase'] ? Math.max(i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j]) : i; - }, - set: function(name, text, klass) { - var el, node; - - el = ThreadUpdater[name]; - if (node = el.firstChild) { - node.data = text; - } else { - el.textContent = text; - } - if (klass !== void 0) { - return el.className = klass; - } - }, - timeout: function() { - var n; - - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); - if (!(n = --ThreadUpdater.seconds)) { - return ThreadUpdater.update(); - } else if (n <= -60) { - ThreadUpdater.set('status', 'Retrying', null); - return ThreadUpdater.update(); - } else if (n > 0) { - return ThreadUpdater.set('timer', n); - } - }, - update: function() { - var url; - - if (!ThreadUpdater.online) { - return; - } - ThreadUpdater.seconds = 0; - ThreadUpdater.set('timer', '...'); - if (ThreadUpdater.req) { - ThreadUpdater.req.onloadend = null; - ThreadUpdater.req.abort(); - } - url = "//api.4chan.org/" + ThreadUpdater.thread.board + "/res/" + ThreadUpdater.thread + ".json"; - return ThreadUpdater.req = $.ajax(url, { - onloadend: ThreadUpdater.cb.load - }, { - headers: { - 'If-Modified-Since': ThreadUpdater.lastModified - } - }); - }, - updateThreadStatus: function(title, OP) { - var icon, message, root, titleLC; - - titleLC = title.toLowerCase(); - if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { - return; - } - if (!(ThreadUpdater.thread["is" + title] = !!OP[titleLC])) { - message = title === 'Sticky' ? 'The thread is not a sticky anymore.' : 'The thread is not closed anymore.'; - new Notification('info', message, 30); - $.rm($("." + titleLC + "Icon", ThreadUpdater.thread.OP.nodes.info)); - return; - } - message = title === 'Sticky' ? 'The thread is now a sticky.' : 'The thread is now closed.'; - new Notification('info', message, 30); - icon = $.el('img', { - src: "//static.4chan.org/image/" + titleLC + ".gif", - alt: title, - title: title, - className: "" + titleLC + "Icon" - }); - root = $('[title="Quote this post"]', ThreadUpdater.thread.OP.nodes.info); - if (title === 'Closed') { - root = $('.stickyIcon', ThreadUpdater.thread.OP.nodes.info) || root; - } - return $.after(root, [$.tn(' '), icon]); - }, - parse: function(postObjects) { - var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, scroll, _i, _len, _ref; - - OP = postObjects[0]; - Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; - ThreadUpdater.updateThreadStatus('Sticky', OP); - ThreadUpdater.updateThreadStatus('Closed', OP); - ThreadUpdater.thread.postLimit = !!OP.bumplimit; - ThreadUpdater.thread.fileLimit = !!OP.imagelimit; - posts = []; - index = []; - files = []; - count = 0; - for (_i = 0, _len = postObjects.length; _i < _len; _i++) { - postObject = postObjects[_i]; - num = postObject.no; - index.push(num); - if (postObject.fsize) { - files.push(num); - } - if (num <= ThreadUpdater.lastPost) { - continue; - } - count++; - node = Build.postFromObject(postObject, ThreadUpdater.thread.board); - posts.push(new Post(node, ThreadUpdater.thread, ThreadUpdater.thread.board)); - } - deletedPosts = []; - deletedFiles = []; - _ref = ThreadUpdater.thread.posts; - for (ID in _ref) { - post = _ref[ID]; - ID = +ID; - if (post.isDead && index.contains(ID)) { - post.resurrect(); - } else if (!index.contains(ID)) { - post.kill(); - deletedPosts.push(post); - } else if (post.file && !post.file.isDead && !files.contains(ID)) { - post.kill(true); - deletedFiles.push(post); - } - if (ThreadUpdater.postID) { - if (ID === ThreadUpdater.postID) { - ThreadUpdater.foundPost = true; - } - } - } - if (!count) { - ThreadUpdater.set('status', null, null); - ThreadUpdater.outdateCount++; - } else { - ThreadUpdater.set('status', "+" + count, 'new'); - ThreadUpdater.outdateCount = 0; - if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) { - if (!ThreadUpdater.audio) { - ThreadUpdater.audio = $.el('audio', { - src: ThreadUpdater.beep - }); - } - ThreadUpdater.audio.play(); - } - ThreadUpdater.lastPost = posts[count - 1].ID; - Main.callbackNodes(Post, posts); - scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; - for (key in posts) { - post = posts[key]; - if (!posts.hasOwnProperty(key)) { - continue; - } - if (post.cb) { - if (!post.cb.call(post)) { - $.add(ThreadUpdater.root, post.nodes.root); - } - } else { - $.add(ThreadUpdater.root, post.nodes.root); - } - } - if (scroll) { - if (Conf['Bottom Scroll']) { - doc.scrollTop = d.body.clientHeight; - } else { - Header.scrollToPost(nodes[0]); - } - } - $.queueTask(function() { - var length, threadID; - - threadID = ThreadUpdater.thread.ID; - length = $$('.thread > .postContainer', ThreadUpdater.root).length; - return Fourchan.parseThread(threadID, length - count, length); - }); - } - return $.event('ThreadUpdate', { - 404: false, - thread: ThreadUpdater.thread, - newPosts: posts, - deletedPosts: deletedPosts, - deletedFiles: deletedFiles, - postCount: OP.replies + 1, - fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead) - }); - } - }; - - ThreadWatcher = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Thread Watcher']) { - return; - } - this.dialog = UI.dialog('watcher', 'top: 50px; left: 0px;', '
Thread Watcher
'); - $.on(d, 'QRPostSuccessful', this.cb.post); - $.on(d, '4chanXInitFinished', this.ready); - $.sync('WatchedThreads', this.refresh); - return Thread.prototype.callbacks.push({ - name: 'Thread Watcher', - cb: this.node - }); - }, - node: function() { - var favicon, - _this = this; - - favicon = $.el('img', { - className: 'favicon' - }); - $.on(favicon, 'click', ThreadWatcher.cb.toggle); - $.before($('input', this.OP.nodes.post), favicon); - if (g.VIEW !== 'thread') { - return; - } - return $.get('AutoWatch', 0, function(item) { - if (item['AutoWatch'] !== _this.ID) { - return; - } - ThreadWatcher.watch(_this); - return $["delete"]('AutoWatch'); - }); - }, - ready: function() { - $.off(d, '4chanXInitFinished', ThreadWatcher.ready); - if (!Main.isThisPageLegit()) { - return; - } - ThreadWatcher.refresh(); - return $.add(d.body, ThreadWatcher.dialog); - }, - refresh: function(watched) { - var ID, board, div, favicon, id, link, nodes, props, thread, x, _ref, _ref1; - - if (!watched) { - $.get('WatchedThreads', {}, function(item) { - return ThreadWatcher.refresh(item['WatchedThreads']); - }); - return; - } - nodes = [$('.move', ThreadWatcher.dialog)]; - for (board in watched) { - _ref = watched[board]; - for (id in _ref) { - props = _ref[id]; - x = $.el('a', { - textContent: '×', - href: 'javascript:;' - }); - $.on(x, 'click', ThreadWatcher.cb.x); - link = $.el('a', props); - link.title = link.textContent; - div = $.el('div'); - $.add(div, [x, $.tn(' '), link]); - nodes.push(div); - } - } - $.rmAll(ThreadWatcher.dialog); - $.add(ThreadWatcher.dialog, nodes); - watched = watched[g.BOARD] || {}; - _ref1 = g.BOARD.threads; - for (ID in _ref1) { - thread = _ref1[ID]; - favicon = $('.favicon', thread.OP.nodes.post); - favicon.src = ID in watched ? Favicon["default"] : Favicon.empty; - } - }, - cb: { - toggle: function() { - return ThreadWatcher.toggle(Get.postFromNode(this).thread); - }, - x: function() { - var thread; - - thread = this.nextElementSibling.pathname.split('/'); - return ThreadWatcher.unwatch(thread[1], thread[3]); - }, - post: function(e) { - var board, postID, threadID, _ref; - - _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; - if (postID === threadID) { - if (Conf['Auto Watch']) { - return $.set('AutoWatch', threadID); - } - } else if (Conf['Auto Watch Reply']) { - return ThreadWatcher.watch(board.threads[threadID]); - } - } - }, - toggle: function(thread) { - if ($('.favicon', thread.OP.nodes.post).src === Favicon.empty) { - return ThreadWatcher.watch(thread); - } else { - return ThreadWatcher.unwatch(thread.board, thread.ID); - } - }, - unwatch: function(board, threadID) { - return $.get('WatchedThreads', {}, function(item) { - var watched; - - watched = item['WatchedThreads']; - delete watched[board][threadID]; - if (!Object.keys(watched[board]).length) { - delete watched[board]; - } - ThreadWatcher.refresh(watched); - return $.set('WatchedThreads', watched); - }); - }, - watch: function(thread) { - return $.get('WatchedThreads', {}, function(item) { - var watched, _name; - - watched = item['WatchedThreads']; - watched[_name = thread.board] || (watched[_name] = {}); - watched[thread.board][thread] = { - href: "/" + thread.board + "/res/" + thread, - textContent: Get.threadExcerpt(thread) - }; - ThreadWatcher.refresh(watched); - return $.set('WatchedThreads', watched); - }); - } - }; - - Unread = { - init: function() { - if (g.VIEW !== 'thread' || !Conf['Unread Count'] && !Conf['Unread Favicon']) { - return; - } - this.db = new DataBoard('lastReadPosts', this.sync); - this.hr = $.el('hr', { - id: 'unread-line' - }); - this.posts = []; - this.postsQuotingYou = []; - return Thread.prototype.callbacks.push({ - name: 'Unread', - cb: this.node - }); - }, - node: function() { - var ID, post, posts, _ref; - - Unread.thread = this; - Unread.title = d.title; - posts = []; - _ref = this.posts; - for (ID in _ref) { - post = _ref[ID]; - if (post.isReply) { - posts.push(post); - } - } - Unread.lastReadPost = Unread.db.get({ - boardID: this.board.ID, - threadID: this.ID, - defaultValue: 0 - }); - Unread.addPosts(posts); - $.on(d, 'ThreadUpdate', Unread.onUpdate); - $.on(d, 'scroll visibilitychange', Unread.read); - if (Conf['Unread Line']) { - $.on(d, 'visibilitychange', Unread.setLine); - } - if (!Conf['Scroll to Last Read Post']) { - return; - } - return $.on(window, 'load', function() { - var hash, root; - - if ((hash = location.hash.match(/\d+/)) && hash[0] in this.posts) { - return; - } - if (Unread.posts.length) { - while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) { - if (!(Get.postFromRoot(root)).isHidden) { - break; - } - } - if (!root) { - return; - } - return root.scrollIntoView(false); - } else if (posts.length) { - return Header.scrollToPost(posts[posts.length - 1].nodes.root); - } - }); - }, - sync: function() { - var lastReadPost; - - lastReadPost = Unread.db.get({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - defaultValue: 0 - }); - if (!(Unread.lastReadPost < lastReadPost)) { - return; - } - Unread.lastReadPost = lastReadPost; - Unread.readArray(Unread.posts); - Unread.readArray(Unread.postsQuotingYou); - Unread.setLine(); - return Unread.update(); - }, - addPosts: function(newPosts) { - var ID, data, post, _i, _len; - - for (_i = 0, _len = newPosts.length; _i < _len; _i++) { - post = newPosts[_i]; - ID = post.ID; - if (ID <= Unread.lastReadPost || post.isHidden) { - continue; - } - if (QR.db) { - data = { - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }; - if (QR.db.get(data)) { - continue; - } - } - Unread.posts.push(post); - Unread.addPostQuotingYou(post); - } - if (Conf['Unread Line']) { - Unread.setLine(newPosts.contains(Unread.posts[0])); - } - Unread.read(); - return Unread.update(); - }, - addPostQuotingYou: function(post) { - var quotelink, _i, _len, _ref; - - if (!QR.db) { - return; - } - _ref = post.nodes.quotelinks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quotelink = _ref[_i]; - if (QR.db.get(Get.postDataFromLink(quotelink))) { - Unread.postsQuotingYou.push(post); - } - } - }, - onUpdate: function(e) { - if (e.detail[404]) { - return Unread.update(); - } else { - return Unread.addPosts(e.detail.newPosts); - } - }, - readSinglePost: function(post) { - var i; - - if ((i = Unread.posts.indexOf(post)) === -1) { - return; - } - Unread.posts.splice(i, 1); - if (i === 0) { - Unread.lastReadPost = post.ID; - Unread.saveLastReadPost(); - } - if ((i = Unread.postsQuotingYou.indexOf(post)) !== -1) { - Unread.postsQuotingYou.splice(i, 1); - } - return Unread.update(); - }, - readArray: function(arr) { - var i, post, _i, _len; - - for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { - post = arr[i]; - if (post.ID > Unread.lastReadPost) { - break; - } - } - return arr.splice(0, i); - }, - read: $.debounce(50, function(e) { - var ID, bottom, height, i, post, posts, read; - - if (d.hidden || !Unread.posts.length) { - return; - } - height = doc.clientHeight; - posts = Unread.posts; - read = []; - i = posts.length; - while (post = posts[--i]) { - bottom = post.nodes.root.getBoundingClientRect().bottom; - if (bottom < height) { - ID = post.ID; - posts.remove(post); - } - } - if (!ID) { - return; - } - Unread.lastReadPost = ID; - Unread.saveLastReadPost(); - Unread.readArray(Unread.postsQuotingYou); - if (e) { - return Unread.update(); - } - }), - saveLastReadPost: $.debounce(2 * $.SECOND, function() { - return Unread.db.set({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - val: Unread.lastReadPost - }); - }), - setLine: function(force) { - var post, root; - - if (!(d.hidden || force === true)) { - return; - } - if (post = Unread.posts[0]) { - root = post.nodes.root; - if (root !== $('.thread > .replyContainer', root.parentNode)) { - return $.before(root, Unread.hr); - } - } else { - return $.rm(Unread.hr); - } - }, - update: function() { - var count; - - count = Unread.posts.length; - if (Conf['Unread Count']) { - d.title = "" + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); - } - if (!Conf['Unread Favicon']) { - return; - } - Favicon.el.href = g.DEAD ? Unread.postsQuotingYou.length ? Favicon.unreadDeadY : count ? Favicon.unreadDead : Favicon.dead : count ? Unread.postsQuotingYou.length ? Favicon.unreadY : Favicon.unread : Favicon["default"]; - return $.add(d.head, Favicon.el); - } - }; - QR = { init: function() { var sc; @@ -8879,14 +6624,16 @@ return $.addClass(doc, 'hide-original-post-form'); }); } - $.on(d, '4chanXInitFinished', this.initReady); + $.ready(this.initReady); + if (Conf['Persistent QR']) { + $.on(d, '4chanXInitFinished', this.persist); + } return Post.prototype.callbacks.push({ name: 'Quick Reply', cb: this.node }); }, initReady: function() { - $.off(d, '4chanXInitFinished', QR.initReady); QR.postingIsEnabled = !!$.id('postForm'); if (!QR.postingIsEnabled) { return; @@ -8906,23 +6653,20 @@ $.on(d, 'dragover', QR.dragOver); $.on(d, 'drop', QR.dropFile); $.on(d, 'dragstart dragend', QR.drag); - $.on(d, 'ThreadUpdate', function() { + return $.on(d, 'ThreadUpdate', function() { if (g.DEAD) { return QR.abort(); } else { return QR.status(); } }); - if (Conf['Persistent QR']) { - return QR.persist(); - } }, node: function() { return $.on($('a[title="Quote this post"]', this.nodes.info), 'click', QR.quote); }, persist: function() { QR.open(); - if (Conf['Auto-Hide QR']) { + if (Conf['Auto Hide QR']) { return QR.hide(); } }, @@ -9159,7 +6903,7 @@ elapsed = Math.floor((now - start) / $.SECOND); if (elapsed >= 0) { seconds = Math.max(seconds, types[type] - elapsed); - if (hasFile && upSpd) { + if (Conf['Cooldown Prediction'] && hasFile && upSpd) { seconds -= Math.floor(post.file.size / upSpd * upSpdAccuracy); seconds = Math.max(seconds, 0); } @@ -9841,7 +7585,7 @@ dialog: function() { var dialog, mimeTypes, name, nodes, thread, _i, _len, _ref; - dialog = UI.dialog('qr', 'top:0;right:0;', "
\n Post Form\n ×\n
\n
\n
\n \n \n \n \n
\n
\n \n \n
\n
\n
\n +\n
\n
\n \n No selected file\n \n ×\n \n \n
\n \n
\n \n
\n \n
".replace(/>\s+<')); + dialog = UI.dialog('qr', 'top:0;right:0;', "
Post Form\n×
No selected file×
"); QR.nodes = nodes = { el: dialog, move: $('.move', dialog), @@ -10006,7 +7750,7 @@ } QR.cleanNotifications(); QR.cooldown.auto = QR.posts.length > 1; - if (Conf['Auto-Hide QR'] && !QR.cooldown.auto) { + if (Conf['Auto Hide QR'] && !QR.cooldown.auto) { QR.hide(); } if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) { @@ -10036,7 +7780,7 @@ QR.cooldown.auto = false; QR.status(); return QR.error($.el('span', { - innerHTML: 'Connection error. You may have been banned.' + innerHTML: "Connection error. You may have been banned.\n[FAQ]" })); } }; @@ -10172,613 +7916,1858 @@ } }; - QuoteBacklink = { + FappeTyme = { init: function() { - var format; + var el; - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { + if (!Conf['Fappe Tyme'] && (g.VIEW === 'catalog' || g.BOARD === 'f')) { return; } - format = Conf['backlink'].replace(/%id/g, "' + id + '"); - this.funk = Function('id', "return '" + format + "'"); - this.containers = {}; - Post.prototype.callbacks.push({ - name: 'Quote Backlinking Part 1', - cb: this.firstNode + el = $.el('a', { + href: 'javascript:;', + id: 'fappeTyme', + title: 'Fappe Tyme' + }); + $.on(el, 'click', FappeTyme.toggle); + $.asap((function() { + return $.id('boardNavMobile'); + }), function() { + return $.add($.id('navtopright'), el); }); return Post.prototype.callbacks.push({ - name: 'Quote Backlinking Part 2', - cb: this.secondNode + name: 'Fappe Tyme', + cb: this.node }); }, - firstNode: function() { - var a, clone, container, containers, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; + node: function() { + if (this.file) { + return; + } + return $.addClass(this.nodes.root, "noFile"); + }, + toggle: function() { + return $.toggleClass(doc, 'fappeTyme'); + } + }; - if (this.isClone || !this.quotes.length) { + ImageExpand = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + return; + } + this.EAI = $.el('a', { + id: 'img-controls', + className: 'expand-all-shortcut', + title: 'Expand All Images', + href: 'javascript:;' + }); + $.on(this.EAI, 'click', ImageExpand.cb.toggleAll); + Post.prototype.callbacks.push({ + name: 'Image Expansion', + cb: this.node + }); + return $.asap((function() { + return $.id('delform'); + }), function() { + return $.prepend($.id('delform'), ImageExpand.EAI); + }); + }, + node: function() { + var thumb, _ref; + + if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + return; + } + thumb = this.file.thumb; + $.on(thumb.parentNode, 'click', ImageExpand.cb.toggle); + if (this.isClone && $.hasClass(thumb, 'expanding')) { + ImageExpand.contract(this); + ImageExpand.expand(this); + return; + } + if (ImageExpand.on && !this.isHidden) { + return ImageExpand.expand(this); + } + }, + cb: { + toggle: function(e) { + if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { + return; + } + e.preventDefault(); + return ImageExpand.toggle(Get.postFromNode(this)); + }, + toggleAll: function() { + var ID, file, func, post, _i, _len, _ref, _ref1; + + $.event('CloseMenu'); + if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { + ImageExpand.EAI.className = 'contract-all-shortcut'; + ImageExpand.EAI.title = 'Contract All Images'; + func = ImageExpand.expand; + } else { + ImageExpand.EAI.className = 'expand-all-shortcut'; + ImageExpand.EAI.title = 'Expand All Images'; + func = ImageExpand.contract; + } + _ref = g.posts; + for (ID in _ref) { + post = _ref[ID]; + _ref1 = [post].concat(post.clones); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + post = _ref1[_i]; + file = post.file; + if (!(file && file.isImage && doc.contains(post.nodes.root))) { + continue; + } + if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && file.thumb.getBoundingClientRect().top < 0)) { + continue; + } + $.queueTask(func, post); + } + } + }, + setFitness: function() { + var checked; + + checked = this.checked; + (checked ? $.addClass : $.rmClass)(doc, this.name.toLowerCase().replace(/\s+/g, '-')); + if (this.name !== 'Fit height') { + return; + } + if (checked) { + $.on(window, 'resize', ImageExpand.resize); + if (!ImageExpand.style) { + ImageExpand.style = $.addStyle(null); + } + return ImageExpand.resize(); + } else { + return $.off(window, 'resize', ImageExpand.resize); + } + } + }, + toggle: function(post) { + var headRect, rect, root, thumb, top; + + thumb = post.file.thumb; + if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { + ImageExpand.expand(post); + return; + } + ImageExpand.contract(post); + rect = post.nodes.root.getBoundingClientRect(); + if (!(rect.top <= 0 || rect.left <= 0)) { + return; + } + top = rect.top; + if (Conf['Fixed Header'] && !Conf['Bottom Header']) { + headRect = Header.bar.getBoundingClientRect(); + top += -headRect.top - headRect.height; + } + root = doc; + if (rect.top < 0) { + root.scrollTop += top; + } + if (rect.left < 0) { + return root.scrollLeft = 0; + } + }, + contract: function(post) { + $.rmClass(post.nodes.root, 'expanded-image'); + $.rmClass(post.file.thumb, 'expanding'); + return post.file.isExpanded = false; + }, + expand: function(post, src) { + var img, thumb; + + thumb = post.file.thumb; + if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { + return; + } + $.addClass(thumb, 'expanding'); + if (post.file.fullImage) { + $.asap((function() { + return post.file.fullImage.naturalHeight; + }), function() { + return ImageExpand.completeExpand(post); + }); + return; + } + post.file.fullImage = img = $.el('img', { + className: 'full-image', + src: src || post.file.URL + }); + $.on(img, 'error', ImageExpand.error); + $.asap((function() { + return post.file.fullImage.naturalHeight; + }), function() { + return ImageExpand.completeExpand(post); + }); + return $.after(thumb, img); + }, + completeExpand: function(post) { + var prev, thumb; + + thumb = post.file.thumb; + if (!$.hasClass(thumb, 'expanding')) { + return; + } + post.file.isExpanded = true; + if (!post.nodes.root.parentNode) { + $.addClass(post.nodes.root, 'expanded-image'); + $.rmClass(post.file.thumb, 'expanding'); + return; + } + prev = post.nodes.root.getBoundingClientRect(); + return $.queueTask(function() { + var curr, root; + + $.addClass(post.nodes.root, 'expanded-image'); + $.rmClass(post.file.thumb, 'expanding'); + if (!(prev.top + prev.height <= 0)) { + return; + } + root = doc; + curr = post.nodes.root.getBoundingClientRect(); + return root.scrollTop += curr.height - prev.height + curr.top - prev.top; + }); + }, + error: function() { + var URL, post, src, timeoutID; + + post = Get.postFromNode(this); + $.rm(this); + delete post.file.fullImage; + if (!($.hasClass(post.file.thumb, 'expanding') || $.hasClass(post.nodes.root, 'expanded-image'))) { + return; + } + ImageExpand.contract(post); + src = this.src.split('/'); + if (src[2] === 'images.4chan.org') { + if (URL = Redirect.image(src[3], src[5])) { + setTimeout(ImageExpand.expand, 10000, post, URL); + return; + } + if (g.DEAD || post.isDead || post.file.isDead) { + return; + } + } + timeoutID = setTimeout(ImageExpand.expand, 10000, post); + return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { + onload: function() { + var postObj, _i, _len, _ref; + + if (this.status !== 200) { + return; + } + _ref = JSON.parse(this.response).posts; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + postObj = _ref[_i]; + if (postObj.no === post.ID) { + break; + } + } + if (postObj.no !== post.ID) { + clearTimeout(timeoutID); + return post.kill(); + } else if (postObj.filedeleted) { + clearTimeout(timeoutID); + return post.kill(true); + } + } + }); + }, + menu: { + init: function() { + var conf, createSubEntry, el, key, subEntries, _ref; + + if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + return; + } + el = $.el('span', { + textContent: 'Image Expansion', + className: 'image-expansion-link' + }); + createSubEntry = ImageExpand.menu.createSubEntry; + subEntries = []; + _ref = Config.imageExpansion; + for (key in _ref) { + conf = _ref[key]; + subEntries.push(createSubEntry(key, conf)); + } + return $.event('AddMenuEntry', { + type: 'header', + el: el, + order: 105, + subEntries: subEntries + }); + }, + createSubEntry: function(type, config) { + var input, label; + + label = $.el('label', { + innerHTML: " " + type + }); + input = label.firstElementChild; + if (type === 'Fit width' || type === 'Fit height') { + $.on(input, 'change', ImageExpand.cb.setFitness); + } + if (config) { + label.title = config[1]; + input.checked = Conf[type]; + $.event('change', null, input); + $.on(input, 'change', $.cb.checked); + } + return { + el: label + }; + } + }, + resize: function() { + return ImageExpand.style.textContent = ":root.fit-height .full-image {max-height:" + doc.clientHeight + "px}"; + }, + menuToggle: function(e) { + return ImageExpand.opmenu.toggle(e, this, g); + } + }; + + ImageHover = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Image Hover']) { + return; + } + return Post.prototype.callbacks.push({ + name: 'Image Hover', + cb: this.node + }); + }, + node: function() { + var _ref; + + if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + return; + } + return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover); + }, + mouseover: function(e) { + var el, post; + + post = Get.postFromNode(this); + el = $.el('img', { + id: 'ihover', + src: post.file.URL + }); + el.setAttribute('data-fullid', post.fullID); + $.add(Header.hover, el); + UI.hover({ + root: this, + el: el, + latestEvent: e, + endEvents: 'mouseout click', + asapTest: function() { + return el.naturalHeight; + } + }); + return $.on(el, 'error', ImageHover.error); + }, + error: function() { + var URL, post, src, timeoutID, + _this = this; + + if (!doc.contains(this)) { + return; + } + post = g.posts[this.dataset.fullid]; + src = this.src.split('/'); + if (src[2] === 'images.4chan.org') { + if (URL = Redirect.image(src[3], src[5].replace(/\?.+$/, ''))) { + this.src = URL; + return; + } + if (g.DEAD || post.isDead || post.file.isDead) { + return; + } + } + timeoutID = setTimeout((function() { + return _this.src = post.file.URL + '?' + Date.now(); + }), 3000); + return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { + onload: function() { + var postObj, _i, _len, _ref; + + if (this.status !== 200) { + return; + } + _ref = JSON.parse(this.response).posts; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + postObj = _ref[_i]; + if (postObj.no === post.ID) { + break; + } + } + if (postObj.no !== post.ID) { + clearTimeout(timeoutID); + return post.kill(); + } else if (postObj.filedeleted) { + clearTimeout(timeoutID); + return post.kill(true); + } + } + }); + } + }; + + ImageReplace = { + init: function() { + if (g.VIEW === 'catalog') { + return; + } + return Post.prototype.callbacks.push({ + name: 'Image Replace', + cb: this.node + }); + }, + node: function() { + var URL, img, style, thumb, type, _ref, _ref1; + + if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { + return; + } + _ref1 = this.file, thumb = _ref1.thumb, URL = _ref1.URL; + if (!(Conf["Replace " + ((type = (URL.match(/\w{3}$/))[0].toUpperCase()) === 'PEG' ? 'JPG' : type)] && !/spoiler/.test(thumb.src))) { + return; + } + if (this.file.isSpoiler) { + style = thumb.style; + style.maxHeight = style.maxWidth = this.isReply ? '125px' : '250px'; + } + img = $.el('img'); + $.on(img, 'load', function() { + return thumb.src = URL; + }); + return img.src = URL; + } + }; + + RevealSpoilers = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Reveal Spoilers']) { + return; + } + return Post.prototype.callbacks.push({ + name: 'Reveal Spoilers', + cb: this.node + }); + }, + node: function() { + var thumb, _ref; + + if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { + return; + } + thumb = this.file.thumb; + thumb.removeAttribute('style'); + return thumb.src = this.file.thumbURL; + } + }; + + ArchiveLink = { + init: function() { + var div, entry, type, _i, _len, _ref; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { + return; + } + div = $.el('div', { + textContent: 'Archive' + }); + entry = { + type: 'post', + el: div, + order: 90, + open: function(_arg) { + var ID, board, redirect, thread; + + ID = _arg.ID, thread = _arg.thread, board = _arg.board; + redirect = Redirect.to({ + postID: ID, + threadID: thread.ID, + boardID: board.ID + }); + return redirect !== ("//boards.4chan.org/" + board + "/"); + }, + subEntries: [] + }; + _ref = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['E-mail', 'email'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + type = _ref[_i]; + entry.subEntries.push(this.createSubEntry(type[0], type[1])); + } + return $.event('AddMenuEntry', entry); + }, + createSubEntry: function(text, type) { + var el, open; + + el = $.el('a', { + textContent: text, + target: '_blank' + }); + open = type === 'post' ? function(_arg) { + var ID, board, thread; + + ID = _arg.ID, thread = _arg.thread, board = _arg.board; + el.href = Redirect.to({ + postID: ID, + threadID: thread.ID, + boardID: board.ID + }); + return true; + } : function(post) { + var value; + + value = Filter[type](post); + if (!value) { + return false; + } + el.href = Redirect.to({ + boardID: post.board.ID, + type: type, + value: value, + isSearch: true + }); + return true; + }; + return { + el: el, + open: open + }; + } + }; + + DeleteLink = { + init: function() { + var div, fileEl, fileEntry, postEl, postEntry; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { + return; + } + div = $.el('div', { + className: 'delete-link', + textContent: 'Delete' + }); + postEl = $.el('a', { + className: 'delete-post', + href: 'javascript:;' + }); + fileEl = $.el('a', { + className: 'delete-file', + href: 'javascript:;' + }); + postEntry = { + el: postEl, + open: function() { + postEl.textContent = 'Post'; + $.on(postEl, 'click', DeleteLink["delete"]); + return true; + } + }; + fileEntry = { + el: fileEl, + open: function(_arg) { + var file; + + file = _arg.file; + if (!file || file.isDead) { + return false; + } + fileEl.textContent = 'File'; + $.on(fileEl, 'click', DeleteLink["delete"]); + return true; + } + }; + return $.event('AddMenuEntry', { + type: 'post', + el: div, + order: 40, + open: function(post) { + var node; + + if (post.isDead) { + return false; + } + DeleteLink.post = post; + node = div.firstChild; + node.textContent = 'Delete'; + DeleteLink.cooldown.start(post, node); + return true; + }, + subEntries: [postEntry, fileEntry] + }); + }, + "delete": function() { + var fileOnly, form, link, m, post, pwd; + + post = DeleteLink.post; + if (DeleteLink.cooldown.counting === post) { + return; + } + $.off(this, 'click', DeleteLink["delete"]); + this.textContent = "Deleting " + this.textContent + "..."; + pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $.id('delPassword').value; + fileOnly = $.hasClass(this, 'delete-file'); + form = { + mode: 'usrdel', + onlyimgdel: fileOnly, + pwd: pwd + }; + form[post.ID] = 'delete'; + link = this; + return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), { + onload: function() { + return DeleteLink.load(link, post, fileOnly, this.response); + }, + onerror: function() { + return DeleteLink.error(link); + } + }, { + cred: true, + form: $.formData(form) + }); + }, + load: function(link, post, fileOnly, html) { + var msg, s, tmpDoc; + + tmpDoc = d.implementation.createHTMLDocument(''); + tmpDoc.documentElement.innerHTML = html; + if (tmpDoc.title === '4chan - Banned') { + s = 'Banned!'; + } else if (msg = tmpDoc.getElementById('errmsg')) { + s = msg.textContent; + $.on(link, 'click', DeleteLink["delete"]); + } else { + if (tmpDoc.title === 'Updating index...') { + (post.origin || post).kill(fileOnly); + } + s = 'Deleted'; + } + return link.textContent = s; + }, + error: function(link) { + link.textContent = 'Connection error, please retry.'; + return $.on(link, 'click', DeleteLink["delete"]); + }, + cooldown: { + start: function(post, node) { + var length, seconds, _ref; + + if (!((_ref = QR.db) != null ? _ref.get({ + boardID: post.board.ID, + threadID: post.thread.ID, + postID: post.ID + }) : void 0)) { + delete DeleteLink.cooldown.counting; + return; + } + DeleteLink.cooldown.counting = post; + length = post.board.ID === 'q' ? 600 : 30; + seconds = Math.ceil((length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND); + return DeleteLink.cooldown.count(post, seconds, length, node); + }, + count: function(post, seconds, length, node) { + if (DeleteLink.cooldown.counting !== post) { + return; + } + if (!((0 <= seconds && seconds <= length))) { + if (DeleteLink.cooldown.counting === post) { + node.textContent = 'Delete'; + delete DeleteLink.cooldown.counting; + } + return; + } + setTimeout(DeleteLink.cooldown.count, 1000, post, seconds - 1, length, node); + return node.textContent = "Delete (" + seconds + ")"; + } + } + }; + + DownloadLink = { + init: function() { + var a; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { return; } a = $.el('a', { - href: "/" + this.board + "/res/" + this.thread + "#p" + this, - className: this.isHidden ? 'filtered backlink' : 'backlink', - textContent: (QuoteBacklink.funk(this.ID)) + (Conf['Mark Quotes of You'] && this.info.yours ? QuoteYou.text : '') + className: 'download-link', + textContent: 'Download file' }); - _ref = this.quotes; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; - containers = [QuoteBacklink.getContainer(quote)]; - if ((post = g.posts[quote]) && post.nodes.backlinkContainer) { - _ref1 = post.clones; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - clone = _ref1[_j]; - containers.push(clone.nodes.backlinkContainer); - } - } - for (_k = 0, _len2 = containers.length; _k < _len2; _k++) { - container = containers[_k]; - link = a.cloneNode(true); - if (Conf['Quote Previewing']) { - $.on(link, 'mouseover', QuotePreview.mouseover); - } - if (Conf['Quote Inlining']) { - $.on(link, 'click', QuoteInline.toggle); - } - $.add(container, [$.tn(' '), link]); - } - } - }, - secondNode: function() { - var container; + return $.event('AddMenuEntry', { + type: 'post', + el: a, + order: 70, + open: function(_arg) { + var file; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { - this.nodes.backlinkContainer = $('.container', this.nodes.info); - return; - } - if (!(this.isReply || Conf['OP Backlinks'])) { - return; - } - container = QuoteBacklink.getContainer(this.fullID); - this.nodes.backlinkContainer = container; - return $.add(this.nodes.info, container); - }, - getContainer: function(id) { - var _base; - - return (_base = this.containers)[id] || (_base[id] = $.el('span', { - className: 'container' - })); + file = _arg.file; + if (!file) { + return false; + } + a.href = file.URL; + a.download = file.name; + return true; + } + }); } }; - QuoteCT = { + Menu = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark Cross-thread Quotes']) { + if (g.VIEW === 'catalog' || !Conf['Menu']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.text = '\u00A0(Cross-thread)'; + this.menu = new UI.Menu('post'); return Post.prototype.callbacks.push({ - name: 'Mark Cross-thread Quotes', + name: 'Menu', cb: this.node }); }, node: function() { - var board, boardID, quotelink, quotelinks, quotes, thread, threadID, _i, _len, _ref, _ref1; + var button; - if (this.isClone && this.thread === this.context.thread) { + button = Menu.makeButton(this); + if (this.isClone) { + $.replace($('.menu-button', this.nodes.info), button); return; } - if (!(quotes = this.quotes).length) { - return; - } - quotelinks = this.nodes.quotelinks; - _ref = this.isClone ? this.context : this, board = _ref.board, thread = _ref.thread; - for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { - quotelink = quotelinks[_i]; - _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, threadID = _ref1.threadID; - if (!threadID) { - continue; - } - if (this.isClone) { - quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, ''); - } - if (boardID === this.board.ID && threadID !== thread.ID) { - $.add(quotelink, $.tn(QuoteCT.text)); - } - } - } - }; - - QuoteInline = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Inlining']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Post.prototype.callbacks.push({ - name: 'Quote Inlining', - cb: this.node - }); + return $.add(this.nodes.info, [$.tn('\u00A0'), button]); }, - node: function() { - var link, _i, _len, _ref; + makeButton: (function() { + var a; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - $.on(link, 'click', QuoteInline.toggle); - } - }, + a = null; + return function(post) { + var clone; + + a || (a = $.el('a', { + className: 'menu-button', + innerHTML: '[]', + href: 'javascript:;' + })); + clone = a.cloneNode(true); + clone.setAttribute('data-postid', post.fullID); + if (post.isClone) { + clone.setAttribute('data-clone', true); + } + $.on(clone, 'click', Menu.toggle); + return clone; + }; + })(), toggle: function(e) { - var boardID, context, postID, threadID, _ref; + var post; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { - return; - } - e.preventDefault(); - _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; - context = Get.contextFromLink(this); - if ($.hasClass(this, 'inlined')) { - QuoteInline.rm(this, boardID, threadID, postID, context); - } else { - if ($.x("ancestor::div[@id='p" + postID + "']", this)) { - return; - } - QuoteInline.add(this, boardID, threadID, postID, context); - } - return this.classList.toggle('inlined'); - }, - findRoot: function(quotelink, isBacklink) { - if (isBacklink) { - return quotelink.parentNode.parentNode; - } else { - return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink); - } - }, - add: function(quotelink, boardID, threadID, postID, context) { - var inline, isBacklink, post; - - isBacklink = $.hasClass(quotelink, 'backlink'); - inline = $.el('div', { - id: "i" + postID, - className: 'inline' - }); - $.after(QuoteInline.findRoot(quotelink, isBacklink), inline); - Get.postClone(boardID, threadID, postID, inline, context); - if (!((post = g.posts["" + boardID + "." + postID]) && context.thread === post.thread)) { - return; - } - if (isBacklink && Conf['Forward Hiding']) { - $.addClass(post.nodes.root, 'forwarded'); - post.forwarded++ || (post.forwarded = 1); - } - if (!Unread.posts) { - return; - } - return Unread.readSinglePost(post); - }, - rm: function(quotelink, boardID, threadID, postID, context) { - var el, inlined, isBacklink, post, root, _ref; - - isBacklink = $.hasClass(quotelink, 'backlink'); - root = QuoteInline.findRoot(quotelink, isBacklink); - root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); - $.rm(root); - if (!(el = root.firstElementChild)) { - return; - } - post = g.posts["" + boardID + "." + postID]; - post.rmClone(el.dataset.clone); - if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads["" + boardID + "." + threadID] && !--post.forwarded) { - delete post.forwarded; - $.rmClass(post.nodes.root, 'forwarded'); - } - while (inlined = $('.inlined', el)) { - _ref = Get.postDataFromLink(inlined), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; - QuoteInline.rm(inlined, boardID, threadID, postID, context); - $.rmClass(inlined, 'inlined'); - } + post = this.dataset.clone ? Get.postFromNode(this) : g.posts[this.dataset.postid]; + return Menu.menu.toggle(e, this, post); } }; - QuoteOP = { + ReportLink = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark OP Quotes']) { + var a; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); + a = $.el('a', { + className: 'report-link', + href: 'javascript:;', + textContent: 'Report this post' + }); + $.on(a, 'click', ReportLink.report); + return $.event('AddMenuEntry', { + type: 'post', + el: a, + order: 10, + open: function(post) { + ReportLink.post = post; + return !post.isDead; + } + }); + }, + report: function() { + var id, post, set, url; + + post = ReportLink.post; + url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; + id = Date.now(); + set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"; + return window.open(url, id, set); + } + }; + + Favicon = { + init: function() { + return $.ready(function() { + var href; + + Favicon.el = $('link[rel="shortcut icon"]', d.head); + Favicon.el.type = 'image/x-icon'; + href = Favicon.el.href; + Favicon.SFW = /ws\.ico$/.test(href); + Favicon["default"] = href; + return Favicon["switch"](); + }); + }, + "switch": function() { + var unreadDead; + + unreadDead = Favicon.unreadDeadY = Favicon.unreadSFW = Favicon.unreadSFWY = Favicon.unreadNSFW = Favicon.unreadNSFWY = 'data:image/png;base64,'; + switch (Conf['favicon']) { + case 'ferongr': + Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQB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9jr6Qh2KGQenp2/+xpsFQnrePAuulz7QUTuwm5NnwmIAAAAABJRU5ErkJggg=='; + Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUBAAACAQELCQkPDQwgFBMzKilOSEdva2iEgoCReHOadXClamDIaWbxcG7+hIX+mpv+m5z+oqP+tLX+zc7//f3+9PT97Oz23t750NDbra3zwL87LCwAAAAGAABHAADPAAD/AABkWeLDAAAAHHRSTlO5/fTv8Na2n42lsMvi8v3+/v749OaITDsDAQABSG2w8gAAAGdJREFUCNdNjtEKgDAIRYVGCmsyqCe7q/3/V2azQfpwPehVyQCIMIt4YYTeO7LHKMiGlDIkuh2qofR6obUqhtc4F637XreU1h+m41gcJX/DHyJWXYHzkCMm+hd3a4GezLNr8PQA4bQHEXEQFRJP5NAAAAAASUVORK5CYII='; + Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEUAAAAAAAAAAAAAAABFRUdsa2yRjop4dXVpZ2tdcI9dfKdBirUzlMBHpdxSquRisfOs2/99xv8umMMAAABljCUFAAAAEHRSTlN7FwUAQVt6kZ2/zej59vTv0aAplgAAAGNJREFUGNNtj1EOwCAIQ5eYIPCD0vvfdYi6LJvy0fICNVzl864DAECVuVKYAeDuEFVJkxPDmM1+TTh6n7oy0FvrWBmF1aIPYspnUGWvSE1A2KGgcvp2AtU3iGJOmcch6pHftTekXQrRd6slMAAAAABJRU5ErkJggg=='; + Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUAAAAAAAAAAAAAAAAREBAWFRY1NDROTE1iYGFzdXp4eoCAgYVlc4mHjZiYoa6zvcqy1/Pg8v+e1f+b1P6X0f2DyP5jsu49msgymcctkLomc5QbPU0SIiwNFxwumMMAAAAAAADALpU1AAAAHnRSTlPNLgcBAAABBxhdc4WznarD8P7+/v3+8/z9/vz2+PUOYDHSAAAAZElEQVQI102OsQ6AMAhEMWGDpTbUQUvu/79ShDYRhuMFDiAGIKIqEgUT3B0akQVxyhgp1XWYldLnhfXTkF5WHdZb69cz9YdPazNQdA0vRK2ahftQDGNjfHHXZjgSV5cRGQHCwS8j7A9loVSnzwAAAABJRU5ErkJggg=='; + Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEUAAAAAAAAAAAAAAAAfJSBLUU1ydHR8fn6Ri5Frbm9dn19jvEFt30tv5VB082KR/33Z/9Gq/5tmzDMAAADw+5ntAAAAEHRSTlP++ywHAAE2Wnuayez19O/+EzXeOQAAAF9JREFUGNN1TzESwCAIc3AABxDy/78WFXu91oYhIYcRSn2hHAwAxAEKMQy4O1pgijkxhMjqc8KhujgzoGaKzKjcRK13U2n8Z+wnaRB2KKievt2bPY0o5knrOETd9Ln2AuDLCz1j8HTeAAAAAElFTkSuQmCC'; + Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUPGgsCBAIBAQEBAQAAAQAAAAABAQEFBQQQEw85SDdVa1GhzJm967TZ+NLP+sbM+8S6/a3k/9+s/pyr/puX/oSd15KIuoGBj39tfm1qj2RepFlu2VRkwzZlyTNatC5myzMAAAAOPREWAAAAHnRSTlP4/fz331IPBQIBAAECOly37/7+/v7XwpWktNDy+f7X56yoAAAAZElEQVQI102NwQ7AIAhDMdku3JwkIiaz//+VQ9FkcCgvpUAMoKpX9YEJYww0s7YG4iW9Lwl3QCSUZhZSHsHKslqXknPpRPpDypkmtr0cWBGntnseOeKgGd6UAr1Vj8vw9sKFmz+fERAp5vutHwAAAABJRU5ErkJggg=='; + break; + case 'Mayhem': + Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABIUlEQVQ4jZ2ScWuDMBDFgw4pIkU0WsoQkWAYIkXZH4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EUBAAAAAAD/AABnZ2f///8nFk05AAAAAXRSTlMAQObYZgAAAEFJREFUeNqNjgEKACAMAjvX/98cAkkxgmSgO8Bt/Ai4ApJ6KKhzF3OiEMDASrGB/QWgPEHsUpN+Ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC'; + Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAD/AAD///9nZ2f77Y6hAAAAAXRSTlMAQObYZgAAAEBJREFUeF6NjQEKACAMAnfW/98cAxFiBIngOsTqR8B1IGkeG9p5i7XabgAGZNigXgA8aoCUxvzWAIcBItGiSEwdccYA3BuRAWkAAAAASUVORK5CYII='; + Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAAul8NnZ2f////82iC9AAAAAXRSTlMAQObYZgAAAEFJREFUeNqNjgEKACAMAjvX/98cAkkxgmSgO8Bt/Ai4ApJ6KKhzF3OiEMDASrGB/QWgPEHsUpN+Ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC'; + Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAAul8P///9nZ2cgIeMlAAAAAXRSTlMAQObYZgAAAEBJREFUeF6NjQEKACAMAnfW/98cAxFiBIngOsTqR8B1IGkeG9p5i7XabgAGZNigXgA8aoCUxvzWAIcBItGiSEwdccYA3BuRAWkAAAAASUVORK5CYII='; + Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAElBMVEUBAAAAAABmzDNlyjJnZ2f///+6o7dfAAAAAXRSTlMAQObYZgAAAERJREFUeF6NjkEKADEIA51o///lJZfQxUsHITogWi8AvwZJuxmYa25xDooBLEwOWFTYAsYVhdorLZt9Ng9xCUTCUCQ2H3F4ANrZ2WNiAAAAAElFTkSuQmCC'; + Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAElBMVEUBAAAAAABmzDP///9lyjJnZ2cIHys9AAAAAXRSTlMAQObYZgAAAENJREFUeF6NjUEKwEAMAjNm9/9fLkEslFwqgjoEUn8EfAqSdrkwzj6ieyyTkQEVGWRvANfO1iEX620AjgBEwqR4Y+sBeGAA6d+vQ4IAAAAASUVORK5CYII='; + break; + case 'Original': + Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX/////AAD///8AAABBZmS3AAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAKAAAoAAAoKCg4AAA4ODg7OztMAACRAADBwcH/AAD///+WCcPSAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQmAUAxEb4Isk0rwp3EPR3ECcRQrh7C3/nAasPwzmCgYuPBy5AH/NALSImqAK+H1oJRqyJVHNAnZqDITVhj7/PrAciJ9il0BHs/jjU+fnB9sQ0IxX6OBO6Xr0xKAxANLZzUanCWzZQAAAABJRU5ErkJggg=='; + Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///8ul8P///8AAACaqgkzAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAABBQcHFx4KISoNLToaVW4oKCgul8M4ODg7OzvBwcH///8uS/CdAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWoftRGvdwBEewchM7d9BFbE6pbP4Mgj+R5MjjwgP+qQSkRtQAV8K3lVI2Q648oknIRpWZsMI4988HjgvpU+wO8HgeHzR9cjZYhoRiPkcDd0rXpyUAiRd5YjKC7MvNRgAAAABJRU5ErkJggg=='; + Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///9mzDP///8AAACT0n1lAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAECAIQIAgWLAsePA8oKCg4ODg6dB07OztmzDPBwcH///+rsf3XAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWofRL4x6O4AhuopWb2P4F7E5prP4MgiaSHHlceMA/jYC0iBrgSnjdKaUacuURTUI2qsyEFcaxvD6wnkifYleAx/N449Mn5wfbkFDM52jgTun6tAQg8QAEvjQg42KY2AAAAABJRU5ErkJggg=='; } - this.text = '\u00A0(OP)'; - return Post.prototype.callbacks.push({ - name: 'Mark OP Quotes', + if (Favicon.SFW) { + Favicon.unread = Favicon.unreadSFW; + return Favicon.unreadY = Favicon.unreadSFWY; + } else { + Favicon.unread = Favicon.unreadNSFW; + return Favicon.unreadY = Favicon.unreadNSFWY; + } + }, + empty: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX////b29sAAAAJ2DVhAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=', + dead: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX/////AAAAAACalQKRAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=' + }; + + ThreadExcerpt = { + init: function() { + if (g.VIEW !== 'thread' || !Conf['Thread Excerpt']) { + return; + } + return Thread.prototype.callbacks.push({ + name: 'Thread Excerpt', cb: this.node }); }, node: function() { - var boardID, op, postID, quotelink, quotelinks, quotes, _i, _j, _len, _len1, _ref; - - if (this.isClone && this.thread === this.context.thread) { - return; - } - if (!(quotes = this.quotes).length) { - return; - } - quotelinks = this.nodes.quotelinks; - if (this.isClone && quotes.contains(this.thread.fullID)) { - for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { - quotelink = quotelinks[_i]; - quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, ''); - } - } - op = (this.isClone ? this.context : this).thread.fullID; - if (!quotes.contains(op)) { - return; - } - for (_j = 0, _len1 = quotelinks.length; _j < _len1; _j++) { - quotelink = quotelinks[_j]; - _ref = Get.postDataFromLink(quotelink), boardID = _ref.boardID, postID = _ref.postID; - if (("" + boardID + "." + postID) === op) { - $.add(quotelink, $.tn(QuoteOP.text)); - } - } + return d.title = Get.threadExcerpt(this); } }; - QuotePreview = { + ThreadStats = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Previewing']) { + var sc; + + if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Post.prototype.callbacks.push({ - name: 'Quote Previewing', + this.dialog = sc = $.el('span', { + innerHTML: "0 / 0", + id: 'thread-stats' + }); + this.postCountEl = $('#post-count', sc); + this.fileCountEl = $('#file-count', sc); + Header.addShortcut(sc); + return Thread.prototype.callbacks.push({ + name: 'Thread Stats', cb: this.node }); }, node: function() { - var link, _i, _len, _ref; + var ID, fileCount, post, postCount, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - $.on(link, 'mouseover', QuotePreview.mouseover); + postCount = 0; + fileCount = 0; + _ref = this.posts; + for (ID in _ref) { + post = _ref[ID]; + postCount++; + if (post.file) { + fileCount++; + } } + ThreadStats.thread = this; + ThreadStats.update(postCount, fileCount); + return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate); }, - mouseover: function(e) { - var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; + onUpdate: function(e) { + var fileCount, postCount, _ref; - if ($.hasClass(this, 'inlined')) { + if (e.detail[404]) { return; } - _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; - qp = $.el('div', { - id: 'qp', - className: 'dialog' - }); - $.add(Header.hover, qp); - Get.postClone(boardID, threadID, postID, qp, Get.contextFromLink(this)); - UI.hover({ - root: this, - el: qp, - latestEvent: e, - endEvents: 'mouseout click', - cb: QuotePreview.mouseout, - asapTest: function() { - return qp.firstElementChild; - } - }); - if (!(origin = g.posts["" + boardID + "." + postID])) { - return; - } - if (Conf['Quote Highlighting']) { - posts = [origin].concat(origin.clones); - posts.pop(); - for (_i = 0, _len = posts.length; _i < _len; _i++) { - post = posts[_i]; - $.addClass(post.nodes.post, 'qphl'); - } - } - quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0]; - clone = Get.postFromRoot(qp.firstChild); - _ref1 = clone.nodes.quotelinks.concat(__slice.call(clone.nodes.backlinks)); - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - quote = _ref1[_j]; - if (quote.hash.slice(2) === quoterID) { - $.addClass(quote, 'forwardlink'); - } - } + _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount; + return ThreadStats.update(postCount, fileCount); }, - mouseout: function() { - var clone, post, root, _i, _len, _ref; + update: function(postCount, fileCount) { + var fileCountEl, postCountEl, thread; - if (!(root = this.el.firstElementChild)) { - return; - } - clone = Get.postFromRoot(root); - post = clone.origin; - post.rmClone(root.dataset.clone); - if (!Conf['Quote Highlighting']) { - return; - } - _ref = [post].concat(post.clones); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - post = _ref[_i]; - $.rmClass(post.nodes.post, 'qphl'); - } + thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; + postCountEl.textContent = postCount; + fileCountEl.textContent = fileCount; + (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning'); + return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning'); } }; - /* - <3 aeosynth - */ - - - QuoteThreading = { + ThreadUpdater = { init: function() { - var input; + var checked, conf, el, input, name, sc, settings, subEntries, _ref; - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { + if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { return; } - this.enabled = true; - this.controls = $.el('span', { - innerHTML: '' + checked = Conf['Auto Update'] ? 'checked' : ''; + this.dialog = sc = $.el('span', { + innerHTML: "", + id: 'updater' + }); + this.timer = $('#update-timer', sc); + this.status = $('#update-status', sc); + $.on(this.timer, 'click', ThreadUpdater.update); + $.on(this.status, 'click', ThreadUpdater.update); + this.checkPostCount = 0; + Header.addShortcut(sc); + subEntries = []; + _ref = Config.updater.checkbox; + for (name in _ref) { + conf = _ref[name]; + checked = Conf[name] ? 'checked' : ''; + el = $.el('label', { + title: "" + conf[1], + innerHTML: " " + name + }); + input = el.firstElementChild; + $.on(input, 'change', $.cb.checked); + if (input.name === 'Scroll BG') { + $.on(input, 'change', ThreadUpdater.cb.scrollBG); + ThreadUpdater.cb.scrollBG(); + } else if (input.name === 'Auto Update') { + $.on(input, 'change', ThreadUpdater.update); + } + subEntries.push({ + el: el + }); + } + settings = $.el('span', { + innerHTML: 'Interval' + }); + $.on(settings, 'click', this.intervalShortcut); + subEntries.push({ + el: settings }); - input = $('input', this.controls); - $.on(input, 'change', QuoteThreading.toggle); $.event('AddMenuEntry', { type: 'header', - el: this.controls, - order: 98 + el: $.el('span', { + textContent: 'Updater' + }), + order: 110, + subEntries: subEntries }); - $.on(d, '4chanXInitFinished', this.setup); - return Post.prototype.callbacks.push({ - name: 'Quote Threading', + return Thread.prototype.callbacks.push({ + name: 'Thread Updater', cb: this.node }); }, - setup: function() { - var ID, post, posts; - - $.off(d, '4chanXInitFinished', QuoteThreading.setup); - posts = g.posts; - for (ID in posts) { - post = posts[ID]; - if (post.cb) { - post.cb.call(post); - } - } - return QuoteThreading.hasRun = true; - }, node: function() { - var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; + ThreadUpdater.thread = this; + ThreadUpdater.root = this.OP.nodes.root.parentNode; + ThreadUpdater.lastPost = +ThreadUpdater.root.lastElementChild.id.match(/\d+/)[0]; + ThreadUpdater.outdateCount = 0; + ThreadUpdater.lastModified = '0'; + ThreadUpdater.cb.interval.call($.el('input', { + value: Conf['Interval'] + })); + $.on(window, 'online offline', ThreadUpdater.cb.online); + $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.post); + $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); + ThreadUpdater.cb.online(); + return Rice.nodes(ThreadUpdater.dialog); + }, + /* + http://freesound.org/people/pierrecartoons1979/sounds/90112/ + cc-by-nc-3.0 + */ - if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { + beep: 'data:audio/wav;base64,UklGRjQDAABX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{ + if (ThreadUpdater.online = navigator.onLine) { + ThreadUpdater.outdateCount = 0; + ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + ThreadUpdater.update(); + ThreadUpdater.set('status', null, null); + } else { + ThreadUpdater.set('timer', null); + ThreadUpdater.set('status', 'Offline', 'warning'); + } + return ThreadUpdater.cb.autoUpdate(); + }, + post: function(e) { + if (e.detail.threadID !== ThreadUpdater.thread.ID) { + return; + } + ThreadUpdater.outdateCount = 0; + if (ThreadUpdater.seconds > 2) { + return setTimeout(ThreadUpdater.update, 1000); + } + }, + checkpost: function() { + if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 10)) { + return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500); + } + ThreadUpdater.checkPostCount = 0; + delete ThreadUpdater.foundPost; + return delete ThreadUpdater.postID; + }, + visibility: function() { + if (d.hidden) { + return; + } + ThreadUpdater.outdateCount = 0; + if (ThreadUpdater.seconds > ThreadUpdater.interval) { + return ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + } + }, + scrollBG: function() { + return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() { + return true; + } : function() { + return !d.hidden; + }; + }, + autoUpdate: function() { + if (ThreadUpdater.online) { + return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); + } else { + return clearTimeout(ThreadUpdater.timeoutID); + } + }, + interval: function() { + var val; + + val = +this.value; + if (val < 1) { + val = 1; + } + ThreadUpdater.interval = this.value = val; + return $.cb.value.call(this); + }, + load: function() { + var klass, req, text, _ref; + + req = ThreadUpdater.req; + switch (req.status) { + case 200: + g.DEAD = false; + ThreadUpdater.parse(JSON.parse(req.response).posts); + ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified'); + if (Conf['Auto Update']) { + ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + } + break; + case 404: + g.DEAD = true; + ThreadUpdater.set('timer', null); + ThreadUpdater.set('status', '404', 'warning'); + clearTimeout(ThreadUpdater.timeoutID); + ThreadUpdater.thread.kill(); + $.event('ThreadUpdate', { + 404: true, + thread: ThreadUpdater.thread + }); + break; + default: + if (Conf['Auto Update']) { + ThreadUpdater.outdateCount++; + ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + } + /* + Status Code 304: Not modified + By sending the `If-Modified-Since` header we get a proper status code, and no response. + This saves bandwidth for both the user and the servers and avoid unnecessary computation. + */ + + _ref = [0, 304].contains(req.status) ? [null, null] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1]; + ThreadUpdater.set('status', text, klass); + } + if (ThreadUpdater.postID) { + ThreadUpdater.cb.checkpost(this.status); + } + return delete ThreadUpdater.req; + } + }, + getInterval: function() { + var i, j; + + i = ThreadUpdater.interval; + j = Math.min(ThreadUpdater.outdateCount, 10); + if (!d.hidden) { + j = Math.min(j, 7); + } + return ThreadUpdater.seconds = Conf['Optional Increase'] ? Math.max(i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j]) : i; + }, + intervalShortcut: function() { + var settings; + + Settings.open('Advanced'); + settings = $.id('fourchanx-settings'); + return $('input[name=Interval]', settings).focus(); + }, + set: function(name, text, klass) { + var el, node; + + el = ThreadUpdater[name]; + if (node = el.firstChild) { + node.data = text; + } else { + el.textContent = text; + } + if (klass !== void 0) { + return el.className = klass; + } + }, + timeout: function() { + var n; + + ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); + if (!(n = --ThreadUpdater.seconds)) { + return ThreadUpdater.update(); + } else if (n <= -60) { + ThreadUpdater.set('status', 'Retrying', null); + return ThreadUpdater.update(); + } else if (n > 0) { + return ThreadUpdater.set('timer', n); + } + }, + update: function() { + var url; + + if (!ThreadUpdater.online) { return; } - quotes = this.quotes, ID = this.ID, fullID = this.fullID; - posts = g.posts; - if (!(post = posts[fullID]) || post.isHidden) { + ThreadUpdater.seconds = 0; + if (Conf['Auto Update']) { + ThreadUpdater.set('timer', '...'); + } else { + ThreadUpdater.set('timer', 'Update'); + } + if (ThreadUpdater.req) { + ThreadUpdater.req.onloadend = null; + ThreadUpdater.req.abort(); + } + url = "//api.4chan.org/" + ThreadUpdater.thread.board + "/res/" + ThreadUpdater.thread + ".json"; + return ThreadUpdater.req = $.ajax(url, { + onloadend: ThreadUpdater.cb.load + }, { + headers: { + 'If-Modified-Since': ThreadUpdater.lastModified + } + }); + }, + updateThreadStatus: function(title, OP) { + var icon, message, root, titleLC; + + titleLC = title.toLowerCase(); + if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { return; } - uniq = {}; - len = ("" + g.BOARD).length + 1; - for (_i = 0, _len = quotes.length; _i < _len; _i++) { - quote = quotes[_i]; - qid = quote; - if (!(qid.slice(len) < ID)) { + if (!(ThreadUpdater.thread["is" + title] = !!OP[titleLC])) { + message = title === 'Sticky' ? 'The thread is not a sticky anymore.' : 'The thread is not closed anymore.'; + new Notification('info', message, 30); + $.rm($("." + titleLC + "Icon", ThreadUpdater.thread.OP.nodes.info)); + return; + } + message = title === 'Sticky' ? 'The thread is now a sticky.' : 'The thread is now closed.'; + new Notification('info', message, 30); + icon = $.el('img', { + src: "//static.4chan.org/image/" + titleLC + ".gif", + alt: title, + title: title, + className: "" + titleLC + "Icon" + }); + root = $('[title="Quote this post"]', ThreadUpdater.thread.OP.nodes.info); + if (title === 'Closed') { + root = $('.stickyIcon', ThreadUpdater.thread.OP.nodes.info) || root; + } + return $.after(root, [$.tn(' '), icon]); + }, + parse: function(postObjects) { + var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, scroll, _i, _len, _ref; + + OP = postObjects[0]; + Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; + ThreadUpdater.updateThreadStatus('Sticky', OP); + ThreadUpdater.updateThreadStatus('Closed', OP); + ThreadUpdater.thread.postLimit = !!OP.bumplimit; + ThreadUpdater.thread.fileLimit = !!OP.imagelimit; + posts = []; + index = []; + files = []; + count = 0; + for (_i = 0, _len = postObjects.length; _i < _len; _i++) { + postObject = postObjects[_i]; + num = postObject.no; + index.push(num); + if (postObject.fsize) { + files.push(num); + } + if (num <= ThreadUpdater.lastPost) { continue; } - if (qid in posts) { - uniq[qid.slice(len)] = true; + count++; + node = Build.postFromObject(postObject, ThreadUpdater.thread.board); + posts.push(new Post(node, ThreadUpdater.thread, ThreadUpdater.thread.board)); + } + deletedPosts = []; + deletedFiles = []; + _ref = ThreadUpdater.thread.posts; + for (ID in _ref) { + post = _ref[ID]; + ID = +ID; + if (post.isDead && index.contains(ID)) { + post.resurrect(); + } else if (!index.contains(ID)) { + post.kill(); + deletedPosts.push(post); + } else if (post.file && !post.file.isDead && !files.contains(ID)) { + post.kill(true); + deletedFiles.push(post); } - } - keys = Object.keys(uniq); - if (keys.length !== 1) { - return; - } - this.threaded = "" + g.BOARD + "." + keys[0]; - return this.cb = QuoteThreading.nodeinsert; - }, - nodeinsert: function() { - var bottom, height, posts, qpost, qroot, threadContainer, top, _ref; - - posts = g.posts; - qpost = posts[this.threaded]; - delete this.threaded; - delete this.cb; - if (this.thread.OP === qpost) { - return false; - } - if (QuoteThreading.hasRun) { - height = doc.clientHeight; - _ref = qpost.nodes.root.getBoundingClientRect(), bottom = _ref.bottom, top = _ref.top; - if (!(Unread.posts.contains(qpost) || ((bottom < height) && (top > 0)))) { - return false; - } - } - qroot = qpost.nodes.root; - if (!$.hasClass(qroot, 'threadOP')) { - $.addClass(qroot, 'threadOP'); - threadContainer = $.el('div', { - className: 'threadContainer' - }); - $.after(qroot, threadContainer); - } else { - threadContainer = qroot.nextSibling; - } - $.add(threadContainer, this.nodes.root); - return true; - }, - toggle: function() { - var container, containers, node, nodes, replies, reply, thread, _i, _j, _len, _len1; - - thread = $('.thread'); - replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); - QuoteThreading.enabled = this.checked; - if (this.checked) { - nodes = (function() { - var _i, _len, _results; - - _results = []; - for (_i = 0, _len = replies.length; _i < _len; _i++) { - reply = replies[_i]; - _results.push(Get.postFromNode(reply)); + if (ThreadUpdater.postID) { + if (ID === ThreadUpdater.postID) { + ThreadUpdater.foundPost = true; } - return _results; - })(); - for (_i = 0, _len = nodes.length; _i < _len; _i++) { - node = nodes[_i]; - QuoteThreading.node(node); } + } + if (!count) { + ThreadUpdater.set('status', null, null); + ThreadUpdater.outdateCount++; } else { - replies.sort(function(a, b) { - var aID, bID; + ThreadUpdater.set('status', "+" + count, 'new'); + ThreadUpdater.outdateCount = 0; + if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) { + if (!ThreadUpdater.audio) { + ThreadUpdater.audio = $.el('audio', { + src: ThreadUpdater.beep + }); + } + ThreadUpdater.audio.play(); + } + ThreadUpdater.lastPost = posts[count - 1].ID; + Main.callbackNodes(Post, posts); + scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; + for (key in posts) { + post = posts[key]; + if (!posts.hasOwnProperty(key)) { + continue; + } + if (post.cb) { + if (!post.cb.call(post)) { + $.add(ThreadUpdater.root, post.nodes.root); + } + } else { + $.add(ThreadUpdater.root, post.nodes.root); + } + } + if (scroll) { + if (Conf['Bottom Scroll']) { + doc.scrollTop = d.body.clientHeight; + } else { + Header.scrollToPost(nodes[0]); + } + } + $.queueTask(function() { + var length, threadID; - aID = Number(a.id.slice(2)); - bID = Number(b.id.slice(2)); - return aID - bID; + threadID = ThreadUpdater.thread.ID; + length = $$('.thread > .postContainer', ThreadUpdater.root).length; + return Fourchan.parseThread(threadID, length - count, length); }); - $.add(thread, replies); - containers = $$('.threadContainer', thread); - for (_j = 0, _len1 = containers.length; _j < _len1; _j++) { - container = containers[_j]; - $.rm(container); - } - Unread.update(true); } - }, - kb: function() { - var control; - - control = $.id('threadingControl'); - return control.click(); + return $.event('ThreadUpdate', { + 404: false, + thread: ThreadUpdater.thread, + newPosts: posts, + deletedPosts: deletedPosts, + deletedFiles: deletedFiles, + postCount: OP.replies + 1, + fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead) + }); } }; - QuoteYou = { + ThreadWatcher = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark Quotes of You'] || !Conf['Quick Reply']) { + if (!Conf['Thread Watcher']) { return; } - this.text = '\u00A0(You)'; - return Post.prototype.callbacks.push({ - name: 'Mark Quotes of You', + this.dialog = UI.dialog('watcher', 'top: 50px; left: 0px;', '
Thread Watcher
'); + $.on(d, 'QRPostSuccessful', this.cb.post); + $.on(d, '4chanXInitFinished', this.ready); + $.sync('WatchedThreads', this.refresh); + return Thread.prototype.callbacks.push({ + name: 'Thread Watcher', cb: this.node }); }, node: function() { - var quotelink, quotelinks, quotes, _i, _len; + var favicon, + _this = this; - if (this.isClone) { + favicon = $.el('img', { + className: 'favicon' + }); + $.on(favicon, 'click', ThreadWatcher.cb.toggle); + $.before($('input', this.OP.nodes.post), favicon); + if (g.VIEW !== 'thread') { return; } - if (!(quotes = this.quotes).length) { + return $.get('AutoWatch', 0, function(item) { + if (item['AutoWatch'] !== _this.ID) { + return; + } + ThreadWatcher.watch(_this); + return $["delete"]('AutoWatch'); + }); + }, + ready: function() { + $.off(d, '4chanXInitFinished', ThreadWatcher.ready); + if (!Main.isThisPageLegit()) { return; } - quotelinks = this.nodes.quotelinks; - for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { - quotelink = quotelinks[_i]; - if (QR.db.get(Get.postDataFromLink(quotelink))) { - $.add(quotelink, $.tn(QuoteYou.text)); + ThreadWatcher.refresh(); + return $.add(d.body, ThreadWatcher.dialog); + }, + refresh: function(watched) { + var ID, board, div, favicon, id, link, nodes, props, thread, x, _ref, _ref1; + + if (!watched) { + $.get('WatchedThreads', {}, function(item) { + return ThreadWatcher.refresh(item['WatchedThreads']); + }); + return; + } + nodes = [$('.move', ThreadWatcher.dialog)]; + for (board in watched) { + _ref = watched[board]; + for (id in _ref) { + props = _ref[id]; + x = $.el('a', { + textContent: '×', + href: 'javascript:;' + }); + $.on(x, 'click', ThreadWatcher.cb.x); + link = $.el('a', props); + link.title = link.textContent; + div = $.el('div'); + $.add(div, [x, $.tn(' '), link]); + nodes.push(div); } } + $.rmAll(ThreadWatcher.dialog); + $.add(ThreadWatcher.dialog, nodes); + watched = watched[g.BOARD] || {}; + _ref1 = g.BOARD.threads; + for (ID in _ref1) { + thread = _ref1[ID]; + favicon = $('.favicon', thread.OP.nodes.post); + favicon.src = ID in watched ? Favicon["default"] : Favicon.empty; + } + }, + cb: { + toggle: function() { + return ThreadWatcher.toggle(Get.postFromNode(this).thread); + }, + x: function() { + var thread; + + thread = this.nextElementSibling.pathname.split('/'); + return ThreadWatcher.unwatch(thread[1], thread[3]); + }, + post: function(e) { + var board, postID, threadID, _ref; + + _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; + if (postID === threadID) { + if (Conf['Auto Watch']) { + return $.set('AutoWatch', threadID); + } + } else if (Conf['Auto Watch Reply']) { + return ThreadWatcher.watch(board.threads[threadID]); + } + } + }, + toggle: function(thread) { + if ($('.favicon', thread.OP.nodes.post).src === Favicon.empty) { + return ThreadWatcher.watch(thread); + } else { + return ThreadWatcher.unwatch(thread.board, thread.ID); + } + }, + unwatch: function(board, threadID) { + return $.get('WatchedThreads', {}, function(item) { + var watched; + + watched = item['WatchedThreads']; + delete watched[board][threadID]; + if (!Object.keys(watched[board]).length) { + delete watched[board]; + } + ThreadWatcher.refresh(watched); + return $.set('WatchedThreads', watched); + }); + }, + watch: function(thread) { + return $.get('WatchedThreads', {}, function(item) { + var watched, _name; + + watched = item['WatchedThreads']; + watched[_name = thread.board] || (watched[_name] = {}); + watched[thread.board][thread] = { + href: "/" + thread.board + "/res/" + thread, + textContent: Get.threadExcerpt(thread) + }; + ThreadWatcher.refresh(watched); + return $.set('WatchedThreads', watched); + }); } }; - Quotify = { + Unread = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Resurrect Quotes']) { + if (g.VIEW !== 'thread' || !Conf['Unread Count'] && !Conf['Unread Favicon']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Post.prototype.callbacks.push({ - name: 'Resurrect Quotes', + this.db = new DataBoard('lastReadPosts', this.sync); + this.hr = $.el('hr', { + id: 'unread-line' + }); + this.posts = []; + this.postsQuotingYou = []; + return Thread.prototype.callbacks.push({ + name: 'Unread', cb: this.node }); }, node: function() { - var deadlink, _i, _len, _ref; + Unread.thread = this; + Unread.title = d.title; + Unread.lastReadPost = Unread.db.get({ + boardID: this.board.ID, + threadID: this.ID, + defaultValue: 0 + }); + $.on(d, '4chanXInitFinished', Unread.ready); + $.on(d, 'ThreadUpdate', Unread.onUpdate); + return $.on(d, 'scroll visibilitychange', Unread.read); + }, + ready: function() { + var ID, post, posts, _ref; - _ref = $$('.deadlink', this.nodes.comment); + $.off(d, '4chanXInitFinished', Unread.ready); + posts = []; + _ref = Unread.thread.posts; + for (ID in _ref) { + post = _ref[ID]; + if (post.isReply) { + posts.push(post); + } + } + Unread.addPosts(posts); + if (Conf['Unread Line']) { + Unread.setLine(); + } + if (Conf['Scroll to Last Read Post']) { + return Unread.scroll(); + } + }, + scroll: function() { + var hash, post, posts, prevID, root; + + if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { + return; + } + if (Unread.posts.length) { + prevID = 0; + while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) { + post = Get.postFromRoot(root); + if (prevID === post.ID) { + break; + } + prevID = post.ID; + if (!post.isHidden) { + break; + } + } + root.scrollIntoView(false); + return; + } + posts = Object.keys(Unread.thread.posts); + return Header.scrollToPost(Unread.thread.posts[posts[posts.length - 1]].nodes.root); + }, + sync: function() { + var lastReadPost; + + lastReadPost = Unread.db.get({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + defaultValue: 0 + }); + if (!(Unread.lastReadPost < lastReadPost)) { + return; + } + Unread.lastReadPost = lastReadPost; + Unread.readArray(Unread.posts); + Unread.readArray(Unread.postsQuotingYou); + Unread.setLine(); + return Unread.update(); + }, + addPosts: function(newPosts) { + var ID, data, post, _i, _len; + + for (_i = 0, _len = newPosts.length; _i < _len; _i++) { + post = newPosts[_i]; + ID = post.ID; + if (ID <= Unread.lastReadPost || post.isHidden) { + continue; + } + if (QR.db) { + data = { + boardID: post.board.ID, + threadID: post.thread.ID, + postID: post.ID + }; + if (QR.db.get(data)) { + continue; + } + } + Unread.posts.push(post); + Unread.addPostQuotingYou(post); + } + if (Conf['Unread Line']) { + Unread.setLine(newPosts.contains(Unread.posts[0])); + } + Unread.read(); + return Unread.update(); + }, + addPostQuotingYou: function(post) { + var quotelink, _i, _len, _ref; + + if (!QR.db) { + return; + } + _ref = post.nodes.quotelinks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { - deadlink = _ref[_i]; - if (this.isClone) { - if ($.hasClass(deadlink, 'quotelink')) { - this.nodes.quotelinks.push(deadlink); - } - } else { - Quotify.parseDeadlink.call(this, deadlink); + quotelink = _ref[_i]; + if (QR.db.get(Get.postDataFromLink(quotelink))) { + Unread.postsQuotingYou.push(post); } } }, - parseDeadlink: function(deadlink) { - var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; + onUpdate: function(e) { + if (e.detail[404]) { + return Unread.update(); + } else { + return Unread.addPosts(e.detail.newPosts); + } + }, + readSinglePost: function(post) { + var i; - if (deadlink.parentNode.className === 'prettyprint') { - $.replace(deadlink, __slice.call(deadlink.childNodes)); + if ((i = Unread.posts.indexOf(post)) === -1) { return; } - quote = deadlink.textContent; - if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) { + Unread.posts.splice(i, 1); + if (i === 0) { + Unread.lastReadPost = post.ID; + Unread.saveLastReadPost(); + } + if ((i = Unread.postsQuotingYou.indexOf(post)) !== -1) { + Unread.postsQuotingYou.splice(i, 1); + } + return Unread.update(); + }, + readArray: function(arr) { + var i, post, _i, _len; + + for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { + post = arr[i]; + if (post.ID > Unread.lastReadPost) { + break; + } + } + return arr.splice(0, i); + }, + read: $.debounce(50, function(e) { + var ID, bottom, height, i, post, posts, read; + + if (d.hidden || !Unread.posts.length) { return; } - boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; - quoteID = "" + boardID + "." + postID; - if (post = g.posts[quoteID]) { - if (!post.isDead) { - a = $.el('a', { - href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, - className: 'quotelink', - textContent: quote - }); + height = doc.clientHeight; + posts = Unread.posts; + read = []; + i = posts.length; + while (post = posts[--i]) { + bottom = post.nodes.root.getBoundingClientRect().bottom; + if (bottom < height) { + ID = post.ID; + posts.remove(post); + } + } + if (!ID) { + return; + } + Unread.lastReadPost = ID; + Unread.saveLastReadPost(); + Unread.readArray(Unread.postsQuotingYou); + if (e) { + return Unread.update(); + } + }), + saveLastReadPost: $.debounce(2 * $.SECOND, function() { + return Unread.db.set({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + val: Unread.lastReadPost + }); + }), + setLine: function(force) { + var post, root; + + if (!(d.hidden || force === true)) { + return; + } + if (post = Unread.posts[0]) { + root = post.nodes.root; + if (root !== $('.thread > .replyContainer', root.parentNode)) { + return $.before(root, Unread.hr); + } + } else { + return $.rm(Unread.hr); + } + }, + update: function() { + var count; + + count = Unread.posts.length; + if (Conf['Unread Count']) { + d.title = "" + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); + } + if (!Conf['Unread Favicon']) { + return; + } + Favicon.el.href = g.DEAD ? Unread.postsQuotingYou.length ? Favicon.unreadDeadY : count ? Favicon.unreadDead : Favicon.dead : count ? Unread.postsQuotingYou.length ? Favicon.unreadY : Favicon.unread : Favicon["default"]; + return $.add(d.head, Favicon.el); + } + }; + + Redirect = { + init: function() { + return $.sync('archs', this.updateArchives); + }, + updateArchives: function() { + return $.get('archivers', {}, function(_arg) { + var archivers; + + archivers = _arg.archivers; + return Conf['archivers'] = archivers; + }); + }, + image: function(boardID, filename) { + switch (boardID) { + case 'a': + case 'gd': + case 'jp': + case 'm': + case 'q': + case 'tg': + case 'vp': + case 'vr': + case 'wsg': + return "//archive.foolz.us/" + boardID + "/full_image/" + filename; + case 'u': + return "//nsfw.foolz.us/" + boardID + "/full_image/" + filename; + case 'po': + return "//archive.thedarkcave.org/" + boardID + "/full_image/" + filename; + case 'hr': + case 'tv': + return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename; + case 'ck': + case 'fa': + case 'lit': + case 's4s': + return "//fuuka.warosu.org/" + boardID + "/full_image/" + filename; + case 'cgl': + case 'g': + case 'mu': + case 'w': + return "//rbt.asia/" + boardID + "/full_image/" + filename; + case 'an': + case 'k': + case 'toy': + case 'x': + return "http://archive.heinessen.com/" + boardID + "/full_image/" + filename; + case 'c': + return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename; + } + }, + post: function(boardID, postID) { + var archive, name, _base, _ref; + + if (Redirect.post[boardID] == null) { + _ref = this.archiver; + for (name in _ref) { + archive = _ref[name]; + if (archive.type === 'foolfuuka' && archive.boards.contains(boardID)) { + Redirect.post[boardID] = archive.base; + break; + } + } + (_base = Redirect.post)[boardID] || (_base[boardID] = false); + } + if (Redirect.post[boardID]) { + return "" + Redirect.post[boardID] + "/_/api/chan/post/?board=" + boardID + "&num=" + postID; + } else { + return null; + } + }, + select: function(board) { + var archive, name, _ref, _results; + + _ref = this.archiver; + _results = []; + for (name in _ref) { + archive = _ref[name]; + if (!archive.boards.contains(board)) { + continue; + } + _results.push(name); + } + return _results; + }, + to: function(data) { + var arch, archive, boardID; + + boardID = data.boardID; + if ((arch = Conf.archivers[boardID]) == null) { + Conf.archivers[boardID] = arch = this.select(boardID)[0]; + $.set('archivers', Conf.archivers); + } + return (arch && (archive = this.archiver[arch]) ? Redirect.path(archive.base, archive.type, data) : data.threadID ? "//boards.4chan.org/" + boardID + "/" : null); + }, + archiver: { + 'Foolz': { + base: 'https://archive.foolz.us', + boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg'], + type: 'foolfuuka' + }, + 'NSFWFoolz': { + base: 'https://nsfw.foolz.us', + boards: ['u'], + type: 'foolfuuka' + }, + 'TheDarkCave': { + base: 'http://archive.thedarkcave.org', + boards: ['c', 'int', 'out', 'po'], + type: 'foolfuuka' + }, + '4plebs': { + base: 'http://archive.4plebs.org', + boards: ['hr', 'tg', 'tv', 'x'], + base: 'foolfuuka' + }, + 'Warosu': { + base: '//fuuka.warosu.org', + boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'], + type: 'fuuka' + }, + 'InstallGentoo': { + base: '//archive.installgentoo.net', + boards: ['diy', 'g', 'sci'], + type: 'fuuka' + }, + 'RebeccaBlackTech': { + base: '//rbt.asia', + boards: ['an', 'cgl', 'g', 'mu', 'w'], + type: 'fuuka_mail' + }, + 'Heinessen': { + base: 'http://archive.heinessen.com', + boards: ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'], + type: 'fuuka' + }, + 'Cliche': { + base: '//www.cliché.net/4chan/cgi-board.pl', + boards: ['e'], + type: 'fuuka' + }, + 'NyaFuu': { + base: '//archive.nyafuu.org', + boards: ['c', 'w'], + type: 'fuuka' + } + }, + path: function(base, archiver, data) { + var boardID, path, postID, threadID, type, value; + + if (data.isSearch) { + boardID = data.boardID, type = data.type, value = data.value; + type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; + value = encodeURIComponent(value); + if (archiver === 'foolfuuka') { + return "" + base + "/" + boardID + "/search/" + type + "/" + value; + } else if (type === 'image') { + return "" + base + "/" + boardID + "/?task=search2&search_media_hash=" + value; } else { - a = $.el('a', { - href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, - className: 'quotelink deadlink', - target: '_blank', - textContent: "" + quote + "\u00A0(Dead)" - }); - a.setAttribute('data-boardid', boardID); - a.setAttribute('data-threadid', post.thread.ID); - a.setAttribute('data-postid', postID); - } - } else if (redirect = Redirect.to({ - boardID: boardID, - threadID: 0, - postID: postID - })) { - a = $.el('a', { - href: redirect, - className: 'deadlink', - target: '_blank', - textContent: "" + quote + "\u00A0(Dead)" - }); - if (Redirect.post(boardID, postID)) { - $.addClass(a, 'quotelink'); - a.setAttribute('data-boardid', boardID); - a.setAttribute('data-postid', postID); + return "" + base + "/" + boardID + "/?task=search2&search_" + type + "=" + value; } } - if (!this.quotes.contains(quoteID)) { - this.quotes.push(quoteID); + boardID = data.boardID, threadID = data.threadID, postID = data.postID; + path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; + if (archiver === 'foolfuuka') { + path += '/'; } - if (!a) { - deadlink.textContent = "" + quote + "\u00A0(Dead)"; - return; - } - $.replace(deadlink, a); - if ($.hasClass(a, 'quotelink')) { - return this.nodes.quotelinks.push(a); + if (threadID && postID) { + path += archiver === 'foolfuuka' ? "#" + postID : "#p" + postID; } + return "" + base + "/" + path; } }; @@ -10877,56 +9866,77 @@ } }; - CustomCSS = { - init: function() { - if (!Conf['Custom CSS']) { - return; - } - return this.addStyle(); - }, - addStyle: function() { - return this.style = $.addStyle(Conf['usercss']); - }, - rmStyle: function() { - if (this.style) { - $.rm(this.style); - return delete this.style; - } - }, - update: function() { - if (!this.style) { - this.addStyle(); - } - return this.style.textContent = Conf['usercss']; - } - }; - Emoji = { init: function() { - return Emoji.icons.not.push(['PlanNine', Emoji.icons.not[0][1]]); + Emoji.icons['PlanNine'] = Emoji.icons['Plan9']; + return Emoji.icons['Sage'] = Emoji.sage[Conf['sageEmoji']]; }, css: function(position) { - var category, css, icon, key, margin, name, _conf, _i, _len, _ref; + var category, css, icon, key, name, _conf, _ref; _conf = Conf; - css = []; - margin = "margin-" + (position === "before" ? "right" : "left") + ": " + (parseInt(_conf['Emoji Spacing'])) + "px;"; + css = ["a.useremail[href]:last-of-type::" + position + " {\n vertical-align: top;\n margin-" + (position === "before" ? "right" : "left") + ": 5px;\n}\n"]; _ref = Emoji.icons; for (key in _ref) { category = _ref[key]; + if (!Emoji.icons.hasOwnProperty(key)) { + continue; + } if ((_conf['Emoji'] !== "disable ponies" && key === "pony") || (_conf['Emoji'] !== "only ponies" && key === "not")) { - for (_i = 0, _len = category.length; _i < _len; _i++) { - icon = category[_i]; + for (name in category) { + icon = category[name]; + if (!category.hasOwnProperty(name)) { + continue; + } name = icon[0]; - css[css.length] = "a.useremail[href*='" + name + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toLowerCase()) + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toUpperCase()) + "']:last-of-type::" + position + " {\n content: url('data:image/png;base64," + icon[1] + "');\n vertical-align: top;\n " + margin + "\n}\n"; + css.push("a.useremail[href*='" + name + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toLowerCase()) + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toUpperCase()) + "']:last-of-type::" + position + " {\n content: url('data:image/png;base64," + icon + "');\n}\n"); } } } return css.join(""); }, + sage: { + '4chan SS': 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAYAAACZ3F9/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAa9JREFUKFOdkt0rg2EUwM95b2zlL0CRRLngksznXrJsNtYW1tjYhM3mY6+IXZAbikhTKJp8XZAp81UmWYhIRHHhUi60e7s6ntdCa2449es8PfU7z+k5B6AbyuE/wQlc4BcO2d06unAUBCgFE0hianOd3NHIcy8NPwrUf9NBPZcOEi7ayXZiea/1V7+ljaXeYAfOgg2So2TOwQWGnwQafOgi962TnMFmatozUeNu4yetASspVvgXiUvii5K5Nm6z56ol3Hdtpy+cwSYy+HRUt1nLsoEato0kXyh6wTac+24brThWv6MNOYNW9prlG/uxmbRrFaT0VrCspZoNPSUNJNyCB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t7AtPKWmEU9d645eHYJo5tcKi/FX/zG+zmQxQH+rANk862DOW5N/hhaY64cJSa5xNFCgDDILZACMKYWAmh73HmzFsMlBQJ06LeiMinE1S3KzRCm5rXIIoUIoKIYCVM36urZFbEoiBLNMIhAE6/NsSB7h6SKZdL8xsUOnpx9j1KbTdARACIowArYe1ergfNT2i0mIbJys0GI6PT3N1/hJvrPxOFdRJNBQIy/FapI4Bpgohgcjuw+jq8jy8tV55MNBWI4ohS802CpizKv8q+FgALZAfYgSyAZtNro1oLaU1VvxCA029Oraxs7u/tKnXiNjn8HyKwur6lI++6vPK4V7IA7u+1Dyu1tr183ddNbkHuXP8/zEIYeFqiLRl6YO/p0bHJdflT/PD9qZa1W+ry99fcvlAlcZwUpuUAglIRYVgnDEIOlna4q0M/NPnuO1/PzMwg/045O/XeibUt5/Xangx6viSVFpK2jtMpvdyWCz+5ryf10clX3/amp6eZmJjgd441URWWJY8BAAAAAElFTkSuQmCC'], ['Trisquel', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABjFBMVEX///8AAAAAAAAAAAAAADMAAGYAAAAAHFUAGWYAF10AImYAIGAAHloAHGMAKGsAGmYAJmYAJGEAKnUAJ1gAMXYAJnEAJGQAI2EAK28AK3cAGTEAMHgALXEALXgALG0AFUAAI2oAK3EAMngANoYALXMANIAAM4IANIIAL3gANIcANokANoQANYQAOY0ANIYANooAN4kAN40AOY0APZMANIUAOY0AO5AAPZUAPJAAP5MAPpQAQJUAOYsAPpYANoUAPpoAPpUAM4AAQJkAPZIAPJEAQpgAN4cAPpQAPZUAPJEAO4oAOosAOo8AQJoAOYsAO44AQpsAO48AQp0AP5UAQpoARJwAQ58ARaAAQZgAQ54AQ50AQpgARaIARqMARaMARaIAR6QARaIARaEASakARKEAR6MASqsARKEASKcAR6MARqYAR6UATbEATa8ARqUARKAAR6oARqMASKgATK8AR6QATbIATbAASq0AR6cASKgASqwAR6UASKcATa8ASqoASqwAS6wASKoAS60AT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i/FX/zG+zmQxQH+rANk862DOW5N/hhaY64cJSa5xNFCgDDILZACMKYWAmh73HmzFsMlBQJ06LeiMinE1S3KzRCm5rXIIoUIoKIYCVM36urZFbEoiBLNMIhAE6/NsSB7h6SKZdL8xsUOnpx9j1KbTdARACIowArYe1ergfNT2i0mIbJys0GI6PT3N1/hJvrPxOFdRJNBQIy/FapI4Bpgohgcjuw+jq8jy8tV55MNBWI4ohS802CpizKv8q+FgALZAfYgSyAZtNro1oLaU1VvxCA029Oraxs7u/tKnXiNjn8HyKwur6lI++6vPK4V7IA7u+1Dyu1tr183ddNbkHuXP8/zEIYeFqiLRl6YO/p0bHJdflT/PD9qZa1W+ry99fcvlAlcZwUpuUAglIRYVgnDEIOlna4q0M/NPnuO1/PzMwg/045O/XeibUt5/Xangx6viSVFpK2jtMpvdyWCz+5ryf10clX3/amp6eZmJjgd441URWWJY8BAAAAAElFTkSuQmCC', + 'Trisquel': 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABjFBMVEX///8AAAAAAAAAAAAAADMAAGYAAAAAHFUAGWYAF10AImYAIGAAHloAHGMAKGsAGmYAJmYAJGEAKnUAJ1gAMXYAJnEAJGQAI2EAK28AK3cAGTEAMHgALXEALXgALG0AFUAAI2oAK3EAMngANoYALXMANIAAM4IANIIAL3gANIcANokANoQANYQAOY0ANIYANooAN4kAN40AOY0APZMANIUAOY0AO5AAPZUAPJAAP5MAPpQAQJUAOYsAPpYANoUAPpoAPpUAM4AAQJkAPZIAPJEAQpgAN4cAPpQAPZUAPJEAO4oAOosAOo8AQJoAOYsAO44AQpsAO48AQp0AP5UAQpoARJwAQ58ARaAAQZgAQ54AQ50AQpgARaIARqMARaMARaIAR6QARaIARaEASakARKEAR6MASqsARKEASKcAR6MARqYAR6UATbEATa8ARqUARKAAR6oARqMASKgATK8AR6QATbIATbAASq0AR6cASKgASqwAR6UASKcATa8ASqoASqwAS6wASKoAS60ATbHn4CTpAAAAhHRSTlMAAQI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I8P9Xs1Jsj36MfvvO5J/+rTw58dP7afJPfBgeef3XGz/gskFVpJc4HwGwAAAABJRU5ErkJggg==' + } } }; @@ -11299,7 +10309,7 @@ return null; } } - position = "" + (Conf['Mascot Position'] === 'bottom' || (Conf['Mascot Position'] === "default" && Conf['Post Form Style'] !== "fixed") ? 0 + ((g.VIEW !== 'thread' || Conf['Boards Navigation'] === 'Sticky bottom') && Conf['4chan SS Navigation'] ? 1.6 : 0) : 20.3 + (g.VIEW !== 'thread' || !!$('#postForm input[name=spoiler]') ? 1.4 : 0) + (Conf['Show Post Form Header'] ? 1.5 : 0) + (Conf['Post Form Decorations'] ? 0.2 : 0)) + "em"; + position = "" + (Conf['Mascot Position'] === 'bottom' || (Conf['Mascot Position'] === "default" && Conf['Post Form Style'] !== "fixed") ? 0 + ((g.VIEW !== 'thread' || Conf['Bottom Header']) && Conf['4chan SS Navigation'] ? 1.6 : 0) : 20.3 + (g.VIEW !== 'thread' || !!$('#postForm input[name=spoiler]') ? 1.4 : 0) + (Conf['Show Post Form Header'] ? 1.5 : 0) + (Conf['Post Form Decorations'] ? 0.2 : 0)) + "em"; if (Conf['editMode']) { if (!(mascot = editMascot || (mascot = Mascots[Conf["mascot"]]))) { return; @@ -11737,7 +10747,7 @@ return setTimeout((function() { var exLink; - Style.padding.nav = Header.nav; + Style.padding.nav = Header.bar; Style.padding.pages = $(".pagelist", d.body); Style.padding(); $.on(window, "resize", Style.padding); @@ -11898,7 +10908,7 @@ hide: 2 }[_conf['Sidebar']] || (252 + Style.sidebarOffset.W); Style.replyMargin = _conf["Post Spacing"]; - return css = "/* Cleanup */\n#absbot,\n#delPassword,\n#delform > hr:last-of-type,\n#navbotright,\n#postForm,\n#styleSwitcher,\n.boardBanner > div,\n.mobile,\n.postingMode,\n.riced,\n.sideArrows,\n.stylechanger,\nbody > br,\nbody > div[style^=\"text-align\"],\nbody > hr {\n display: none;\n}\n/* Empties */\n#qr .warning:empty,\n#qr-thread-select:empty {\n display: none;\n}\n/* File Name Trunctuate */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\n display: none;\n}\n/* Unnecessary */\n#qp input,\n#qp .rice,\n.inline .rice {\n display: none !important;\n}\n/* Hidden Content */\n.forwarded,\n.hidden_thread ~ div,\n.hidden_thread ~ a,\n.replyContainer .stub ~ div,\n.replyContainer .stub ~ a,\n.stub + div,\n[hidden] {\n display: none !important;\n}\n/* Hidden UI */\n#catalog,\n#navlinks,\n#navtopright,\n.cataloglink,\n.navLinks,\na[style=\"cursor: pointer; float: right;\"] {\n position: fixed;\n top: 100%;\n left: 100%;\n}\n/* Hide last horizontal rule, keep clear functionality. */\n.board > hr:last-of-type {\n visibility: hidden;\n}\n/* Fappe Tyme */\n.fappeTyme .thread > .noFile {\n display: none;\n}\n/* Defaults */\na {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n outline: none;\n}\nbody,\nhtml {\n min-height: 100%;\n " + Style.sizing + ": border-box;\n}\nbody {\n outline: none;\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n min-height: 100%;\n margin-top: 0;\n margin-bottom: 0;\n margin-" + Style.sidebarLocation[0] + ": " + (/^boards\.4chan\.org$/.test(location.hostname) ? Style.sidebar : '2') + "px;\n margin-" + Style.sidebarLocation[1] + ": 2px;\n padding: 0 " + (parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px 0 " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"]) + "px;\n}\nbody.unscroll {\n overflow: hidden;\n}\n" + (_conf["4chan SS Sidebar"] && /^boards\.4chan\.org$/.test(location.hostname) ? "body::before { content: ''; position: fixed; top: 0; bottom: 0; " + Style.sidebarLocation[0] + ": 0; width: " + (_conf['Sidebar'] === 'large' ? 305 : _conf['Sidebar'] === 'normal' ? 254 : _conf['Sidebar'] === 'minimal' ? 27 : 0) + "px; z-index: 1; " + Style.sizing + ": border-box; display: block;}body { padding-" + Style.sidebarLocation[0] + ": 2px;}" : "") + "\nbutton,\ninput,\ntextarea {\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n}\nhr {\n clear: both;\n border: 0;\n padding: 0;\n margin: 0 0 1px;\n " + (_conf['Hide Horizontal Rules'] ? 'visibility: hidden;' : '') + "\n}\n.center {\n text-align: center;\n}\n.disabled {\n opacity: 0.5;\n}\n/* Symbols */\n.drop-marker {\n vertical-align: middle;\n display: inline-block;\n margin: 2px 2px 3px;\n border-top: .5em solid;\n border-right: .3em solid transparent;\n border-left: .3em solid transparent;\n}\n.brackets-wrap::before {\n content: \"\\00a0[\";\n}\n.brackets-wrap::after {\n content: \"]\\00a0\";\n}\n/* Thread / Reply Nav */\n#navlinks a {\n position: fixed;\n z-index: 12;\n opacity: 0.5;\n display: inline-block;\n border-right: 6px solid transparent;\n border-left: 6px solid transparent;\n margin: 1.5px;\n}\n/* Header */\n#header-bar {\n z-index: 6;\n border-width: 1px;\n position: absolute;\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + (_conf["Hide Navigation Decorations"] ? " font-size: 0; color: transparent; word-spacing: 2px;" : "") + "\n text-align: " + _conf["Navigation Alignment"] + ";\n}\n.fixed #header-bar {\n position: fixed;\n}\n.top #header-bar {\n top: 0;\n border-top-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : "") + "\"\n}\n.fixed.bottom #header-bar {\n bottom: 0;\n border-bottom-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\"\n}\n.hide #header-bar {\n position: fixed;\n top: 110%;\n bottom: auto;\n}\n/* Header Autohide */\n.fixed #header-bar.autohide:not(:hover) {\n box-shadow: none;\n transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);\n}\n.fixed.top #header-bar.autohide:not(:hover) {\n margin-bottom: -1em;\n " + agent + "transform: translateY(-100%);\n}\n.fixed.bottom #header-bar.autohide:not(:hover) {\n " + agent + "transform: translateY(100%);\n}\n#scroll-marker {\n left: 0;\n right: 0;\n height: 10px;\n position: absolute;\n}\n#header-bar #scroll-marker {\n display: none;\n}\n.fixed #header-bar #scroll-marker {\n display: block;\n}\n.fixed.top header-bar #scroll-marker {\n top: 100%;\n}\n.fixed.bottom #header-bar #scroll-marker {\n bottom: 100%;\n}\n/* Notifications */\n#notifications {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n}\n.fixed.top #notifications {\n position: absolute;\n top: 100%;\n}\n.notification {\n display: block;\n overflow: hidden;\n width: 300px;\n border: 1px solid;\n " + (_conf['Sidebar Location'] === 'left' ? 'margin-left: auto;' : '') + "\n}\n.notification:not(:first-of-type) {\n border-top: none;\n}\n.close {\n float: right;\n}\n/* Main Menu */\n#main-menu {\n margin: 0;\n border: 2px solid;\n border-radius: 10px;\n height: 14px;\n width: 14px;\n " + Style.sizing + ": border-box;\n border-color: rgb(130,130,130);\n color: rgb(130,130,130);\n}\n#main-menu::after {\n content: '';\n font-size: 10px;\n position: absolute;\n top: 50%;\n left: 50%;\n " + agent + "transform: translate(-60%, -50%);\n display: block;\n border-top: 5px solid rgb(130, 130, 130);\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n width: 7px;\n " + Style.sizing + ": border-box;\n} \n/* Pagination */\n.pagelist {\n border-width: 1px;\n text-align: " + _conf["Pagination Alignment"] + ";\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + { + return css = "/* Cleanup */\n#absbot,\n#boardNavDesktop,\n#delPassword,\n#delform > hr:last-of-type,\n#navbotright,\n#postForm,\n#styleSwitcher,\n.boardBanner > div,\n.mobile,\n.postingMode,\n.riced,\n.sideArrows,\n.stylechanger,\nbody > br,\nbody > div[style^=\"text-align\"],\nbody > hr {\n display: none;\n}\n/* Empties */\n#qr .warning:empty,\n#qr-thread-select:empty {\n display: none;\n}\n/* File Name Trunctuate */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\n display: none;\n}\n/* Unnecessary */\n#qp input,\n#qp .rice,\n.inline .rice {\n display: none !important;\n}\n/* Hidden Content */\n.forwarded,\n.hidden_thread ~ div,\n.hidden_thread ~ a,\n.replyContainer .stub ~ div,\n.replyContainer .stub ~ a,\n.stub + div,\n[hidden] {\n display: none !important;\n}\n/* Hidden UI */\n#catalog,\n#navlinks,\n#navtopright,\n.cataloglink,\n.navLinks,\na[style=\"cursor: pointer; float: right;\"] {\n position: fixed;\n top: 100%;\n left: 100%;\n}\n/* Hide last horizontal rule, keep clear functionality. */\n.board > hr:last-of-type {\n visibility: hidden;\n}\n/* Fappe Tyme */\n.fappeTyme .thread > .noFile {\n display: none;\n}\n/* Defaults */\na {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n outline: none;\n}\nbody,\nhtml {\n min-height: 100%;\n " + Style.sizing + ": border-box;\n}\nbody {\n outline: none;\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n min-height: 100%;\n margin-top: 0;\n margin-bottom: 0;\n margin-" + Style.sidebarLocation[0] + ": " + (/^boards\.4chan\.org$/.test(location.hostname) ? Style.sidebar : '2') + "px;\n margin-" + Style.sidebarLocation[1] + ": 2px;\n padding: 0 " + (parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px 0 " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"]) + "px;\n}\nbody.unscroll {\n overflow: hidden;\n}\n" + (_conf["4chan SS Sidebar"] && /^boards\.4chan\.org$/.test(location.hostname) ? "body::before { content: ''; position: fixed; top: 0; bottom: 0; " + Style.sidebarLocation[0] + ": 0; width: " + (_conf['Sidebar'] === 'large' ? 305 : _conf['Sidebar'] === 'normal' ? 254 : _conf['Sidebar'] === 'minimal' ? 27 : 0) + "px; z-index: 1; " + Style.sizing + ": border-box; display: block;}body { padding-" + Style.sidebarLocation[0] + ": 2px;}" : "") + "\nbutton,\ninput,\ntextarea {\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n}\nhr {\n clear: both;\n border: 0;\n padding: 0;\n margin: 0 0 1px;\n " + (_conf['Hide Horizontal Rules'] ? 'visibility: hidden;' : '') + "\n}\n.center {\n text-align: center;\n}\n.disabled {\n opacity: 0.5;\n}\n/* Symbols */\n.drop-marker {\n vertical-align: middle;\n display: inline-block;\n margin: 2px 2px 3px;\n border-top: .5em solid;\n border-right: .3em solid transparent;\n border-left: .3em solid transparent;\n}\n.brackets-wrap::before {\n content: \"\\00a0[\";\n}\n.brackets-wrap::after {\n content: \"]\\00a0\";\n}\n/* Thread / Reply Nav */\n#navlinks a {\n position: fixed;\n z-index: 12;\n opacity: 0.5;\n display: inline-block;\n border-right: 6px solid transparent;\n border-left: 6px solid transparent;\n margin: 1.5px;\n}\n/* Header */\n#header-bar {\n z-index: 6;\n border-width: 1px;\n position: absolute;\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + (_conf["Hide Navigation Decorations"] ? " font-size: 0; color: transparent; word-spacing: 2px;" : "") + "\n text-align: " + _conf["Navigation Alignment"] + ";\n}\n.fixed #header-bar.autohide {\n z-index: 24;\n}\n.fixed #header-bar {\n position: fixed;\n}\n.top #header-bar {\n top: 0;\n border-top-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : "") + "\"\n}\n.fixed.bottom #header-bar {\n bottom: 0;\n border-bottom-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\"\n}\n.hide #header-bar {\n position: fixed;\n top: 110%;\n bottom: auto;\n}\n/* Header Autohide */\n.fixed #header-bar.autohide:not(:hover) {\n box-shadow: none;\n transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);\n}\n.fixed.top #header-bar.autohide:not(:hover) {\n margin-bottom: -1em;\n " + agent + "transform: translateY(-100%);\n}\n.fixed.bottom #header-bar.autohide:not(:hover) {\n " + agent + "transform: translateY(100%);\n}\n#scroll-marker {\n left: 0;\n right: 0;\n height: 10px;\n position: absolute;\n}\n#header-bar #scroll-marker {\n display: none;\n}\n.fixed #header-bar #scroll-marker {\n display: block;\n}\n.fixed.top header-bar #scroll-marker {\n top: 100%;\n}\n.fixed.bottom #header-bar #scroll-marker {\n bottom: 100%;\n}\n/* Notifications */\n#notifications {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n}\n.fixed.top #notifications {\n position: absolute;\n top: 100%;\n}\n.notification {\n display: block;\n overflow: hidden;\n width: 300px;\n border: 1px solid;\n " + (_conf['Sidebar Location'] === 'left' ? 'margin-left: auto;' : '') + "\n}\n.notification:not(:first-of-type) {\n border-top: none;\n}\n.close {\n float: right;\n}\n/* Main Menu */\n#main-menu {\n margin: 0;\n border: 2px solid;\n border-radius: 10px;\n height: 14px;\n width: 14px;\n " + Style.sizing + ": border-box;\n border-color: rgb(130,130,130);\n color: rgb(130,130,130);\n}\n#main-menu::after {\n content: '';\n font-size: 10px;\n position: absolute;\n top: 50%;\n left: 50%;\n " + agent + "transform: translate(-60%, -50%);\n display: block;\n border-top: 5px solid rgb(130, 130, 130);\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n width: 7px;\n " + Style.sizing + ": border-box;\n} \n/* Pagination */\n.pagelist {\n border-width: 1px;\n text-align: " + _conf["Pagination Alignment"] + ";\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + { "sticky top": " position: fixed; top: 0; border-top-width: 0; " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : ""), "sticky bottom": " position: fixed; bottom: 0; border-bottom-width: 0; " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : ""), "top": " position: absolute; top: 0; border-top-width: 0; " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : ""), @@ -11917,7 +10927,7 @@ "under post form": " position: fixed; " + Style.sidebarLocation[0] + ": 2px; bottom: 140px; width: " + width + "px;", "at top": " margin: 12px 0;", "hide": " display: none;" - }[_conf["Board Title"]] + "\n}\n.boardTitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) + 10) + "px;\n}\n.boardSubtitle,\n.boardSubtitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) - 1) + "px;\n}\n/* Dialogs */\n.move {\n cursor: pointer;\n}\n#ihover {\n position: fixed;\n max-height: 97%;\n max-width: 75%;\n padding: 10px;\n z-index: 22;\n}\n#qp {\n position: fixed;\n z-index: 22;\n}\n#qp .postMessage::after {\n clear: both;\n display: block;\n content: \"\";\n}\n#qp .full-image {\n max-height: 300px;\n max-width: 500px;\n}\n#menu {\n position: fixed;\n outline: none;\n z-index: 22;\n}\n/* Updater */\n#updater {\n position: fixed;\n z-index: 10;\n padding: 0 1px 1px;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n#updater:hover {\n z-index: 30;\n} \n#updater:not(:hover) > div:not(.move) {\n display: none;\n}\n#updater input {\n text-align: right;\n}\n#updater .field {\n width: 50px;\n}\n/* Stats */\n#thread-stats {\n position: fixed;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n z-index: 10;\n}\n/* Image Expansion */\n.fit-width .full-image {\n max-width: 100%;\n width: 100%;\n}\n" + (_conf['Images Overlap Post Form'] ? ".full-image { position: relative; z-index: 22;}" : "") + "\n/* Prefetcher */\n#prefetch {\n z-index: 9;\n position: fixed;\n}\n/* Delete Buttons */\n" + (_conf['Hide Delete UI'] ? ".deleteform,.post:not(#exlinks-options) .rice { display: none;}.postInfo { padding: 0 0 0 3px;}" : ".deleteform { position: fixed; z-index: 18; width: 0; bottom: 0; right: 0; border-width: 1px 0 0 1px; border-style: solid; font-size: 0; color: transparent;}.deleteform:hover { width: auto;}.deleteform::before { z-index: 18; border-width: 1px 0 0 1px; border-style: solid; content: 'X'; display: block; position: fixed; bottom: 0; right: 0; font-size: " + _conf['Font Size'] + "px; " + Style.sizing + ": border-box; height: 1.6em; width: 1.4em; text-align: center;}.deleteform:hover::before { display: none;}.deleteform input { margin: 0 1px 0 0;}") + "\n/* Slideout Navigation */\n#boardNavDesktopFoot {\n position: fixed;\n width: " + width + "px;\n " + Style.sidebarLocation[0] + ": 2px;\n text-align: center;\n font-size: 0;\n color: transparent;\n overflow: hidden;\n " + Style.sizing + ": border-box;\n}\n#boardNavDesktopFoot a,\n#boardNavDesktopFoot a::after,\n#boardNavDesktopFoot a::before {\n font-size: " + _conf['Font Size'] + "px;\n}\n#boardNavDesktopFoot:hover {\n overflow-y: auto;\n padding: 2px;\n}\n#boardNavDesktopFoot:not(:hover) {\n border-color: transparent;\n background-color: transparent;\n height: 0;\n overflow: hidden;\n padding: 0;\n border: 0 none;\n}\n" + { + }[_conf["Board Title"]] + "\n}\n.boardTitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) + 10) + "px;\n}\n.boardSubtitle,\n.boardSubtitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) - 1) + "px;\n}\n/* Dialogs */\n.move {\n cursor: pointer;\n}\n#ihover {\n position: fixed;\n max-height: 97%;\n max-width: 75%;\n padding: 10px;\n z-index: 22;\n}\n#qp {\n position: fixed;\n z-index: 22;\n}\n#qp .postMessage::after {\n clear: both;\n display: block;\n content: \"\";\n}\n#qp .full-image {\n max-height: 300px;\n max-width: 500px;\n}\n#menu {\n position: fixed;\n outline: none;\n z-index: 22;\n}\n/* Image Expansion */\n.fit-width .full-image {\n max-width: 100%;\n width: 100%;\n}\n" + (_conf['Images Overlap Post Form'] ? ".full-image { position: relative; z-index: 22;}" : "") + "\n/* Prefetcher */\n#prefetch {\n z-index: 9;\n position: fixed;\n}\n/* Delete Buttons */\n" + (_conf['Hide Delete UI'] ? ".deleteform,.post:not(#exlinks-options) .rice { display: none;}.postInfo { padding: 0 0 0 3px;}" : ".deleteform { position: fixed; z-index: 18; width: 0; bottom: 0; right: 0; border-width: 1px 0 0 1px; border-style: solid; font-size: 0; color: transparent;}.deleteform:hover { width: auto;}.deleteform::before { z-index: 18; border-width: 1px 0 0 1px; border-style: solid; content: 'X'; display: block; position: fixed; bottom: 0; right: 0; font-size: " + _conf['Font Size'] + "px; " + Style.sizing + ": border-box; height: 1.6em; width: 1.4em; text-align: center;}.deleteform:hover::before { display: none;}.deleteform input { margin: 0 1px 0 0;}") + "\n/* Slideout Navigation */\n#boardNavDesktopFoot {\n position: fixed;\n width: " + width + "px;\n " + Style.sidebarLocation[0] + ": 2px;\n text-align: center;\n font-size: 0;\n color: transparent;\n overflow: hidden;\n " + Style.sizing + ": border-box;\n}\n#boardNavDesktopFoot a,\n#boardNavDesktopFoot a::after,\n#boardNavDesktopFoot a::before {\n font-size: " + _conf['Font Size'] + "px;\n}\n#boardNavDesktopFoot:hover {\n overflow-y: auto;\n padding: 2px;\n}\n#boardNavDesktopFoot:not(:hover) {\n border-color: transparent;\n background-color: transparent;\n height: 0;\n overflow: hidden;\n padding: 0;\n border: 0 none;\n}\n" + { compact: "#boardNavDesktopFoot { word-spacing: 1px;}", list: "#boardNavDesktopFoot a { display: block;}#boardNavDesktopFoot:hover { max-height: 400px;}#boardNavDesktopFoot a::after { content: ' - ' attr(title);}#boardNavDesktopFoot a[href*='//boards.4chan.org/']::after,#boardNavDesktopFoot a[href*='//rs.4chan.org/']::after { content: '/ - ' attr(title);}#boardNavDesktopFoot a[href*='//boards.4chan.org/']::before,#boardNavDesktopFoot a[href*='//rs.4chan.org/']::before { content: '/';}", hide: "#boardNavDesktopFoot { display: none;}" @@ -11933,7 +10943,7 @@ "slideout": "#qrtab input,#qrtab .rice { display: none;}#qr { top: auto !important; bottom: 1.7em !important; " + Style.sidebarLocation[0] + ": 0 !important; " + Style.sidebarLocation[1] + ": auto !important; " + agent + "transform: translateX(" + xOffset + "93%);}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transform: translate(0);}", "tabbed slideout": "#qr { top: auto !important; bottom: 1.7em !important; " + Style.sidebarLocation[0] + ": 0 !important; " + Style.sidebarLocation[1] + ": auto !important; " + agent + "transform: translateX(" + xOffset + "100%);}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transform: translateX(0);}#qrtab { " + agent + "transform: rotate(" + (Style.sidebarLocation[0] === "left" ? "" : "-") + "90deg); " + agent + "transform-origin: bottom " + Style.sidebarLocation[0] + "; position: absolute; top: 0; " + Style.sidebarLocation[0] + ": 100%; width: 110px; text-align: center; border-width: 1px 1px 0 1px; cursor: default;}#qr:hover #qrtab,#qr.has-focus #qrtab,#qr.dump #qrtab { opacity: 0; " + Style.sidebarLocation[0] + ": " + (252 + Style.sidebarOffset.W) + "px;}#qrtab input,#qrtab .close,#qrtab .rice,#qrtab span { display: none;}", "transparent fade": "#qr { overflow: visible; top: auto !important; bottom: 1.7em !important; " + Style.sidebarLocation[0] + ": 2px !important; " + Style.sidebarLocation[1] + ": auto !important; opacity: 0.2; " + agent + "transition: opacity .3s ease-in-out 1s;}#qr:hover,#qr.has-focus,#qr.dump { opacity: 1; " + agent + "transition: opacity .3s linear;}" - }[_conf['Post Form Style']] || "") + "\n\n" + (_conf['Post Form Style'] !== 'tabbed slideout' ? (!(_conf['Post Form Style'] === 'float' || _conf['Show Post Form Header']) ? "#qrtab { display: none; }" : _conf['Post Form Style'] !== 'slideout' ? ".autohide:not(:hover):not(.has-focus) > form { display: none !important; }" : "") + "#qrtab { margin-bottom: 1px; }" : "") + "\n\n" + (_conf['Post Form Style'] !== 'float' && _conf["Post Form Slideout Transitions"] ? "#qr { " + agent + "transition: " + agent + "transform .3s ease-in-out 1s;}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transition: " + agent + "transform .3s linear;}#qrtab { " + agent + "transition: opacity .3s ease-in-out 1s;}#qr:hover #qrtab { " + agent + "transition: opacity .3s linear;}" : "") + "\n\n#qr .close {\n float: right;\n padding: 0 3px;\n}\n#qr .warning {\n min-height: 1.6em;\n vertical-align: middle;\n padding: 0 1px;\n border-width: 1px;\n border-style: solid;\n}\n.persona {\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-button {\n width: 10%;\n margin: 0;\n}\n\n" + (_conf['Compact Post Form Inputs'] ? ".persona input.field { width: 29.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 14.8em; min-height: 9em;}#qr.has-captcha textarea.field { height: 9em;}" : ".persona input.field { width: 100%;}.persona input.field[name='name'] { width: 89.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 11.6em; min-height: 6em;}#qr.has-captcha textarea.field { height: 6em;}") + "\n\n" + (_conf["Tripcode Hider"] ? ".tripped:not(:hover):not(:focus) { opacity: 0;}" : "") + "\n\n#qr textarea {\n resize: " + _conf['Textarea Resize'] + ";\n}\n.captcha-img {\n margin: 1px 0 0;\n text-align: center;\n line-height: 0;\n}\n.captcha-img img {\n width: 100%;\n height: 4em;\n width: 246px;\n}\n.captcha-input {\n width: 100%;\n margin: 1px 0 0;\n}\n.field,\n.selectrice,\nbutton,\ninput:not([type=radio]) {\n " + Style.sizing + ": border-box;\n font-size: " + (parseInt(_conf['Font Size'], 10)) + "px;\n height: 1.6em;\n margin: 1px 0 0;\n vertical-align: bottom;\n padding: 0 1px;\n}\n#qr textarea {\n min-width: 100%;\n}\n#qr [type='submit'] {\n width: 25%;\n}\n[type='file'] {\n position: absolute;\n opacity: 0;\n z-index: -1;\n}\n#showQR {\n display: " + (_conf["Hide Show Post Form"] ? "none" : "block") + ";\n z-index: 4;\n " + Style.sidebarLocation[0] + ": 2px;\n width: " + width + "px;\n background-color: transparent;\n text-align: center;\n position: fixed;\n top: auto;\n}\n/* Fake File Input */\n#qr-filename,\n.has-file #qr-no-file {\n display: none;\n}\n#qr-no-file,\n.has-file #qr-filename {\n display: block;\n}\n#qr-filename-container {\n " + Style.sizing + ": border-box;\n display: inline-block;\n position: relative;\n width: 100px;\n min-width: 74.6%;\n max-width: 74.6%;\n margin-right: 0.4%;\n overflow: hidden;\n padding: 2px 1px 0;\n}\n#qr-filerm {\n position: absolute;\n right: 3px;\n top: 2px;\n z-index: 2;\n}\n/* Thread Select / Spoiler Label */\n#qr-thread-select {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n}\n#qr-spoiler-label {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n text-align: right;\n}\n/* Dumping UI */\n.dump #dump-list-container {\n display: block;\n}\n#dump-list-container {\n display: none;\n position: relative;\n overflow-y: hidden;\n margin-top: 1px;\n}\n#dump-list {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: pre;\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-list:hover {\n overflow-x: auto;\n}\n.qr-preview {\n " + Style.sizing + ": border-box;\n counter-increment: thumbnails;\n cursor: move;\n display: inline-block;\n height: 90px;\n width: 90px;\n padding: 2px;\n opacity: .5;\n overflow: hidden;\n position: relative;\n text-shadow: 0 1px 1px #000;\n " + agent + "transition: opacity .25s ease-in-out;\n vertical-align: top;\n}\n.qr-preview:hover,\n.qr-preview:focus {\n opacity: .9;\n}\n.qr-preview::before {\n content: counter(thumbnails);\n color: #fff;\n position: absolute;\n top: 3px;\n right: 3px;\n text-shadow: 0 0 3px #000, 0 0 8px #000;\n}\n.qr-preview#selected {\n opacity: 1;\n}\n.qr-preview.drag {\n box-shadow: 0 0 10px rgba(0,0,0,.5);\n}\n.qr-preview.over {\n border-color: #fff;\n}\n.qr-preview > span {\n color: #fff;\n}\n.remove {\n background: none;\n color: #e00;\n font-weight: 700;\n padding: 3px;\n}\na:only-of-type > .remove {\n display: none;\n}\n.remove:hover::after {\n content: \" Remove\";\n}\n.qr-preview > label {\n background: rgba(0,0,0,.5);\n color: #fff;\n right: 0; bottom: 0; left: 0;\n position: absolute;\n text-align: center;\n}\n.qr-preview > label > input {\n margin: 0;\n}\n#add-post {\n cursor: pointer;\n font-size: 2em;\n position: absolute;\n top: 50%;\n right: 10px;\n " + agent + "transform: translateY(-50%);\n}\n/* Ads */\n.topad img,\n.middlead img,\n.bottomad img {\n opacity: 0.3;\n " + agent + "transition: opacity .3s linear;\n}\n.topad img:hover,\n.middlead img:hover,\n.bottomad img:hover {\n opacity: 1;\n}\n" + (_conf["Block Ads"] ? "/* AdBlock Minus */.bottomad + hr,.topad img,.middlead img,.bottomad img { display: none;}" : "") + "\n" + (_conf["Shrink Ads"] ? ".topad a img,.middlead a img,.bottomad a img { width: 500px; height: auto;}" : "") + "\n/* Options */\n#overlay {\n position: fixed;\n z-index: 30;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: rgba(0,0,0,.5);\n}\n#appchanx-settings {\n width: auto;\n left: 15%;\n right: 15%;\n top: 15%;\n bottom: 15%;\n position: fixed;\n z-index: 31;\n padding: .3em;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.description {\n display: none;\n}\n#appchanx-settings h3,\n.section-keybinds,\n.section-mascots,\n.section-script,\n.style {\n text-align: center;\n}\n.section-keybinds table,\n.section-script fieldset,\n.section-style fieldset {\n text-align: left;\n}\n.section-keybinds table {\n margin: auto;\n}\n#appchanx-settings fieldset {\n padding: 5px 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n vertical-align: top;\n " + (_conf["Single Column Mode"] ? "margin: 0 auto 6px;" : "margin: 0 3px 6px;\n display: inline-block;") + "\n border: 0;\n}\n.section-container {\n overflow: auto;\n position: absolute;\n top: 1.7em;\n right: 5px;\n bottom: 5px;\n left: 5px;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.sections-list {\n padding: 0 3px;\n float: left;\n}\n.sections-list > a {\n cursor: pointer;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\n position: relative;\n padding: 0 4px;\n z-index: 1;\n height: 1.4em;\n display: inline-block;\n border-width: 1px 1px 0 1px;\n border-color: transparent;\n border-style: solid;\n}\n.credits {\n float: right;\n}\n#appchanx-settings h3 {\n margin: 0;\n}\n.section-script fieldset > div,\n.section-style fieldset > div,\n.section-rice fieldset > div {\n overflow: visible;\n padding: 0 5px 0 7px;\n}\n#appchanx-settings tr:nth-of-type(2n+1),\n.section-script fieldset > div:nth-of-type(2n+1),\n.section-rice fieldset > div:nth-of-type(2n+1),\n.section-style fieldset > div:nth-of-type(2n+1),\n.section-keybinds tr:nth-of-type(2n+1),\n#selectrice li:nth-of-type(2n+1) {\n background-color: rgba(0, 0, 0, 0.05);\n}\narticle li {\n margin: 10px 0 10px 2em;\n}\n#appchanx-settings .option {\n width: 50%;\n display: inline-block;\n vertical-align: bottom;\n}\n.option input {\n width: 100%;\n}\n.optionlabel {\n padding-left: 18px;\n}\n.rice + .optionlabel {\n padding-left: 0;\n}\n.section-script fieldset,\n.styleoption {\n text-align: left;\n}\n.section-style fieldset {\n width: 370px;\n}\n.section-script fieldset {\n width: 200px;\n}\n.suboptions,\n#mascotcontent,\n#themecontent {\n overflow: auto;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 1.7em;\n left: 0;\n}\n.mAlign {\n height: 250px;\n vertical-align: middle;\n display: table-cell;\n}\n#themecontent {\n top: 1.7em;\n}\n#save,\n.stylesettings {\n position: absolute;\n right: 10px;\n bottom: 0;\n}\n.section-style .suboptions {\n bottom: 0;\n}\n.section-container textarea {\n font-family: monospace;\n min-height: 350px;\n resize: vertical;\n width: 100%;\n}\n/* Hover Functionality */\n#mouseover {\n z-index: 33;\n position: fixed;\n max-width: 70%;\n}\n#mouseover:empty {\n display: none;\n}\n/* Mascot Tab */\n#mascot_hide {\n padding: 3px;\n position: absolute;\n top: 2px;\n right: 18px;\n}\n#mascot_hide .rice {\n float: left;\n}\n#mascot_hide > div {\n height: 0;\n text-align: right;\n overflow: hidden;\n}\n#mascot_hide:hover > div {\n height: auto;\n}\n#mascot_hide label {\n width: 100%;\n display: block;\n clear: both;\n text-decoration: none;\n}\n.mascots {\n padding: 0;\n text-align: center;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.mascot,\n.mascotcontainer {\n overflow: hidden;\n}\n.mascot {\n position: relative;\n border: none;\n margin: 5px;\n padding: 0;\n width: 200px;\n display: inline-block;\n background-color: transparent;\n}\n.mascotcontainer {\n height: 250px;\n border: 0;\n margin: 0;\n max-height: 250px;\n cursor: pointer;\n bottom: 0;\n border-width: 0 1px 1px;\n border-style: solid;\n border-color: transparent;\n overflow: hidden;\n}\n.mascot img {\n max-width: 200px;\n}\n.mascotname,\n.mascotoptions {\n padding: 0;\n width: 100%;\n}\n.mascot .mascotoptions {\nopacity: 0;\n " + agent + "transition: opacity .3s linear;\n}\n.mascot:hover .mascotoptions {\n opacity: 1;\n}\n.mascotoptions {\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.mascotoptions a {\n display: inline-block;\n width: 33%;\n}\n#upload {\n position: absolute;\n width: 100px;\n left: 50%;\n margin-left: -50px;\n text-align: center;\n bottom: 0;\n}\n#mascots_batch {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Themes Tab */\n#themes h1 {\n position: absolute;\n right: 300px;\n bottom: 10px;\n margin: 0;\n " + agent + "transition: all .2s ease-in-out;\n opacity: 0;\n}\n#themes .selectedtheme h1 {\n right: 11px;\n opacity: 1;\n}\n#themeContainer {\n margin-bottom: 3px;\n}\n#addthemes {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n.theme {\n margin: 1em;\n}\n/* Theme Editor */\n#themeConf {\n position: fixed;\n " + Style.sidebarLocation[1] + ": 2px;\n " + Style.sidebarLocation[0] + ": auto;\n top: 0;\n bottom: 0;\n width: 296px;\n z-index: 10;\n}\n#themebar input {\n width: 30%;\n}\n.option .color {\n width: 10%;\n border-left: none !important;\n color: transparent !important;\n}\n.option .colorfield {\n width: 90%;\n}\n.themevar textarea {\n min-width: 100%;\n max-width: 100%;\n height: 20em;\n resize: vertical;\n}\n/* Mascot Editor */\n#mascotConf {\n position: fixed;\n height: 17em;\n bottom: 0;\n left: 50%;\n width: 500px;\n margin-left: -250px;\n overflow: auto;\n z-index: 10;\n}\n#mascotConf .option,\n#mascotConf .optionlabel {\n " + Style.sizing + ": border-box;\n width: 50%;\n display: inline-block;\n vertical-align: middle;\n}\n#mascotConf .option input {\n width: 100%;\n}\n#close {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Catalog */\n#content .navLinks,\n#info .navLinks,\n.btn-wrap {\n display: block;\n}\n.navLinks > .btn-wrap:not(:first-of-type)::before {\n content: ' - ';\n}\n.button {\n cursor: pointer;\n}\n#content .btn-wrap,\n#info .btn-wrap {\n display: inline-block;\n}\n#settings .selectrice {\n width: 100px;\n display: inline-block;\n}\n#post-preview {\n position: absolute;\n z-index: 22;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n#settings,\n#threads,\n#info .navLinks,\n#content .navLinks {\n text-align: center;\n}\n#threads .thread {\n vertical-align: top;\n display: inline-block;\n word-wrap: break-word;\n overflow: hidden;\n margin-top: 5px;\n padding: 5px 0 3px;\n text-align: center;\n}\n.extended-small .thread,\n.small .thread {\n width: 165px;\n max-height: 320px;\n}\n.small .teaser,\n.large .teaser {\n display: none;\n}\n.extended-large .thread,\n.large .thread {\n width: 270px;\n max-height: 410px;\n}\n.extended-small .thumb,\n.small .thumb {\n max-width: 150px;\n max-height: 150px;\n}\n/* Front Page */\n#logo {\n text-align: center;\n}\n#doc {\n margin: 0 auto;\n width: 1000px;\n position: relative;\n}\n#boards .boxcontent {\n vertical-align: top;\n text-align: center;\n}\n#filter-container,\n#options-container {\n float: right;\n position: relative;\n}\n#optionssmenu {\n top: 100% !important;\n left: 0 !important;\n}\n#boards .column {\n " + Style.sizing + ": border-box;\n display: inline-block;\n width: 16em;\n text-align: left;\n vertical-align: top;\n}\n.bd ul,\n.boxcontent ul {\n vertical-align: top;\n padding: 0;\n}\n.right-box .boxcontent ul {\n padding: 0 10px;\n}\n.yuimenuitem,\n.boxcontent li {\n list-style-type: none;\n}\n.bd ul {\n margin: 0;\n}\n.yuimenuitem::before {\n content: \" [ ] \";\n font-family: monospace;\n}\n.yuimenuitem-checked::before {\n content: \" [x] \"\n}\n.yui-u {\n display: inline-block;\n vertical-align: top;\n width: 475px;\n margin: 10px;\n}\n#recent-images .boxcontent {\n text-align: center;\n}\n#ft {\n text-align: center;\n}\n#ft ul {\n padding: 0;\n}\n#ft li {\n list-style-type: none;\n display: inline-block;\n width: 100px;\n}\n#preview-tooltip-nws,\n#preview-tooltip-ws,\n#ft .fill,\n.clear-bug {\n display: none;\n}"; + }[_conf['Post Form Style']] || "") + "\n\n" + (_conf['Post Form Style'] !== 'tabbed slideout' ? (!(_conf['Post Form Style'] === 'float' || _conf['Show Post Form Header']) ? "#qrtab { display: none; }" : _conf['Post Form Style'] !== 'slideout' ? ".autohide:not(:hover):not(.has-focus) > form { display: none !important; }" : "") + "#qrtab { margin-bottom: 1px; }" : "") + "\n\n" + (_conf['Post Form Style'] !== 'float' && _conf["Post Form Slideout Transitions"] ? "#qr { " + agent + "transition: " + agent + "transform .3s ease-in-out 1s;}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transition: " + agent + "transform .3s linear;}#qrtab { " + agent + "transition: opacity .3s ease-in-out 1s;}#qr:hover #qrtab { " + agent + "transition: opacity .3s linear;}" : "") + "\n\n#qr .close {\n float: right;\n padding: 0 3px;\n}\n#qr .warning {\n min-height: 1.6em;\n vertical-align: middle;\n padding: 0 1px;\n border-width: 1px;\n border-style: solid;\n}\n.persona {\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-button {\n width: 10%;\n margin: 0;\n}\n\n" + (_conf['Compact Post Form Inputs'] ? ".persona input.field { width: 29.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 14.8em; min-height: 9em;}#qr.has-captcha textarea.field { height: 9em;}" : ".persona input.field { width: 100%;}.persona input.field[name='name'] { width: 89.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 11.6em; min-height: 6em;}#qr.has-captcha textarea.field { height: 6em;}") + "\n\n" + (_conf["Tripcode Hider"] ? ".tripped:not(:hover):not(:focus) { opacity: 0;}" : "") + "\n\n#qr textarea {\n resize: " + _conf['Textarea Resize'] + ";\n}\n.captcha-img {\n margin: 1px 0 0;\n text-align: center;\n line-height: 0;\n}\n.captcha-img img {\n width: 100%;\n height: 4em;\n width: 246px;\n}\n.captcha-input {\n width: 100%;\n margin: 1px 0 0;\n}\n.field,\n.selectrice,\nbutton,\ninput:not([type=radio]) {\n " + Style.sizing + ": border-box;\n font-size: " + (parseInt(_conf['Font Size'], 10)) + "px;\n height: 1.6em;\n margin: 1px 0 0;\n vertical-align: bottom;\n padding: 0 1px;\n}\n.selectrice {\n padding-right: 1.6em;\n}\n#qr textarea {\n min-width: 100%;\n}\n#qr [type='submit'] {\n width: 25%;\n}\n[type='file'] {\n position: absolute;\n opacity: 0;\n z-index: -1;\n}\n#showQR {\n display: " + (_conf["Hide Show Post Form"] ? "none" : "block") + ";\n z-index: 4;\n " + Style.sidebarLocation[0] + ": 2px;\n width: " + width + "px;\n background-color: transparent;\n text-align: center;\n position: fixed;\n top: auto;\n}\n/* Fake File Input */\n#qr-filename,\n.has-file #qr-no-file {\n display: none;\n}\n#qr-no-file,\n.has-file #qr-filename {\n display: block;\n}\n#qr-filename-container {\n " + Style.sizing + ": border-box;\n display: inline-block;\n position: relative;\n width: 100px;\n min-width: 74.6%;\n max-width: 74.6%;\n margin-right: 0.4%;\n overflow: hidden;\n padding: 2px 1px 0;\n}\n#qr-filerm {\n position: absolute;\n right: 3px;\n top: 2px;\n z-index: 2;\n}\n/* Thread Select / Spoiler Label */\n#qr-thread-select {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n}\n#qr-spoiler-label {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n text-align: right;\n}\n/* Dumping UI */\n.dump #dump-list-container {\n display: block;\n}\n#dump-list-container {\n display: none;\n position: relative;\n overflow-y: hidden;\n margin-top: 1px;\n}\n#dump-list {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: pre;\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-list:hover {\n overflow-x: auto;\n}\n.qr-preview {\n " + Style.sizing + ": border-box;\n counter-increment: thumbnails;\n cursor: move;\n display: inline-block;\n height: 90px;\n width: 90px;\n padding: 2px;\n opacity: .5;\n overflow: hidden;\n position: relative;\n text-shadow: 0 1px 1px #000;\n " + agent + "transition: opacity .25s ease-in-out;\n vertical-align: top;\n}\n.qr-preview:hover,\n.qr-preview:focus {\n opacity: .9;\n}\n.qr-preview::before {\n content: counter(thumbnails);\n color: #fff;\n position: absolute;\n top: 3px;\n right: 3px;\n text-shadow: 0 0 3px #000, 0 0 8px #000;\n}\n.qr-preview#selected {\n opacity: 1;\n}\n.qr-preview.drag {\n box-shadow: 0 0 10px rgba(0,0,0,.5);\n}\n.qr-preview.over {\n border-color: #fff;\n}\n.qr-preview > span {\n color: #fff;\n}\n.remove {\n background: none;\n color: #e00;\n font-weight: 700;\n padding: 3px;\n}\na:only-of-type > .remove {\n display: none;\n}\n.remove:hover::after {\n content: \" Remove\";\n}\n.qr-preview > label {\n background: rgba(0,0,0,.5);\n color: #fff;\n right: 0; bottom: 0; left: 0;\n position: absolute;\n text-align: center;\n}\n.qr-preview > label > input {\n margin: 0;\n}\n#add-post {\n cursor: pointer;\n font-size: 2em;\n position: absolute;\n top: 50%;\n right: 10px;\n " + agent + "transform: translateY(-50%);\n}\n/* Ads */\n.topad img,\n.middlead img,\n.bottomad img {\n opacity: 0.3;\n " + agent + "transition: opacity .3s linear;\n}\n.topad img:hover,\n.middlead img:hover,\n.bottomad img:hover {\n opacity: 1;\n}\n" + (_conf["Block Ads"] ? "/* AdBlock Minus */.bottomad + hr,.topad img,.middlead img,.bottomad img { display: none;}" : "") + "\n" + (_conf["Shrink Ads"] ? ".topad a img,.middlead a img,.bottomad a img { width: 500px; height: auto;}" : "") + "\n/* Options */\n#overlay {\n position: fixed;\n z-index: 30;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: rgba(0,0,0,.5);\n}\n#appchanx-settings {\n width: auto;\n left: 15%;\n right: 15%;\n top: 15%;\n bottom: 15%;\n position: fixed;\n z-index: 31;\n padding: .3em;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.description {\n display: none;\n}\n#appchanx-settings h3,\n.section-keybinds,\n.section-mascots,\n.section-script,\n.style {\n text-align: center;\n}\n.section-keybinds table,\n.section-script fieldset,\n.section-style fieldset {\n text-align: left;\n}\n.section-keybinds table {\n margin: auto;\n}\n#appchanx-settings fieldset {\n padding: 5px 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n vertical-align: top;\n " + (_conf["Single Column Mode"] ? "margin: 0 auto 6px;" : "margin: 0 3px 6px;\n display: inline-block;") + "\n border: 0;\n}\n#appchanx-settings .section-advanced fieldset {\n display: block;\n margin: 0 auto 6px;\n}\n.section-advanced .selectrice {\n display: inline-block;\n clear: both;\n}\n.section-container {\n overflow: auto;\n position: absolute;\n top: 1.7em;\n right: 5px;\n bottom: 5px;\n left: 5px;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.sections-list {\n padding: 0 3px;\n float: left;\n}\n.sections-list > a {\n cursor: pointer;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\n position: relative;\n padding: 0 4px;\n z-index: 1;\n height: 1.4em;\n display: inline-block;\n border-width: 1px 1px 0 1px;\n border-color: transparent;\n border-style: solid;\n}\n.credits {\n float: right;\n}\n#appchanx-settings h3 {\n margin: 0;\n}\n.section-script fieldset > div,\n.section-style fieldset > div,\n.section-advanced fieldset > div {\n overflow: visible;\n padding: 0 5px 0 7px;\n}\n#appchanx-settings tr:nth-of-type(2n+1),\n.section-script fieldset > div:nth-of-type(2n+1),\n.section-advanced fieldset > div:nth-of-type(2n+1),\n.section-style fieldset > div:nth-of-type(2n+1),\n.section-keybinds tr:nth-of-type(2n+1),\n#selectrice li:nth-of-type(2n+1) {\n background-color: rgba(0, 0, 0, 0.05);\n}\narticle li {\n margin: 10px 0 10px 2em;\n}\n#appchanx-settings .option {\n width: 50%;\n display: inline-block;\n vertical-align: bottom;\n}\n.option input {\n width: 100%;\n}\n.optionlabel {\n padding-left: 18px;\n}\n.rice + .optionlabel {\n padding-left: 0;\n}\n.section-script fieldset,\n.styleoption {\n text-align: left;\n}\n.section-style fieldset {\n width: 370px;\n}\n.section-script fieldset {\n width: 200px;\n}\n.suboptions,\n#mascotcontent,\n#themecontent {\n overflow: auto;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 1.7em;\n left: 0;\n}\n.mAlign {\n height: 250px;\n vertical-align: middle;\n display: table-cell;\n}\n#themecontent {\n top: 1.7em;\n}\n#save,\n.stylesettings {\n position: absolute;\n right: 10px;\n bottom: 0;\n}\n.section-style .suboptions {\n bottom: 0;\n}\n.section-container textarea {\n font-family: monospace;\n min-height: 350px;\n resize: vertical;\n width: 100%;\n}\n/* Hover Functionality */\n#mouseover {\n z-index: 33;\n position: fixed;\n max-width: 70%;\n}\n#mouseover:empty {\n display: none;\n}\n/* Mascot Tab */\n#mascot_hide {\n padding: 3px;\n position: absolute;\n top: 2px;\n right: 18px;\n}\n#mascot_hide .rice {\n float: left;\n}\n#mascot_hide > div {\n height: 0;\n text-align: right;\n overflow: hidden;\n}\n#mascot_hide:hover > div {\n height: auto;\n}\n#mascot_hide label {\n width: 100%;\n display: block;\n clear: both;\n text-decoration: none;\n}\n.mascots {\n padding: 0;\n text-align: center;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.mascot,\n.mascotcontainer {\n overflow: hidden;\n}\n.mascot {\n position: relative;\n border: none;\n margin: 5px;\n padding: 0;\n width: 200px;\n display: inline-block;\n background-color: transparent;\n}\n.mascotcontainer {\n height: 250px;\n border: 0;\n margin: 0;\n max-height: 250px;\n cursor: pointer;\n bottom: 0;\n border-width: 0 1px 1px;\n border-style: solid;\n border-color: transparent;\n overflow: hidden;\n}\n.mascot img {\n max-width: 200px;\n}\n.mascotname,\n.mascotoptions {\n padding: 0;\n width: 100%;\n}\n.mascot .mascotoptions {\nopacity: 0;\n " + agent + "transition: opacity .3s linear;\n}\n.mascot:hover .mascotoptions {\n opacity: 1;\n}\n.mascotoptions {\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.mascotoptions a {\n display: inline-block;\n width: 33%;\n}\n#upload {\n position: absolute;\n width: 100px;\n left: 50%;\n margin-left: -50px;\n text-align: center;\n bottom: 0;\n}\n#mascots_batch {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Themes Tab */\n#themes h1 {\n position: absolute;\n right: 300px;\n bottom: 10px;\n margin: 0;\n " + agent + "transition: all .2s ease-in-out;\n opacity: 0;\n}\n#themes .selectedtheme h1 {\n right: 11px;\n opacity: 1;\n}\n#themeContainer {\n margin-bottom: 3px;\n}\n#addthemes {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n.theme {\n margin: 1em;\n}\n/* Theme Editor */\n#themeConf {\n position: fixed;\n " + Style.sidebarLocation[1] + ": 2px;\n " + Style.sidebarLocation[0] + ": auto;\n top: 0;\n bottom: 0;\n width: 296px;\n z-index: 10;\n}\n#themebar input {\n width: 30%;\n}\n.option .color {\n width: 10%;\n border-left: none !important;\n color: transparent !important;\n}\n.option .colorfield {\n width: 90%;\n}\n.themevar textarea {\n min-width: 100%;\n max-width: 100%;\n height: 20em;\n resize: vertical;\n}\n/* Mascot Editor */\n#mascotConf {\n position: fixed;\n height: 17em;\n bottom: 0;\n left: 50%;\n width: 500px;\n margin-left: -250px;\n overflow: auto;\n z-index: 10;\n}\n#mascotConf .option,\n#mascotConf .optionlabel {\n " + Style.sizing + ": border-box;\n width: 50%;\n display: inline-block;\n vertical-align: middle;\n}\n#mascotConf .option input {\n width: 100%;\n}\n#close {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Catalog */\n#content .navLinks,\n#info .navLinks,\n.btn-wrap {\n display: block;\n}\n.navLinks > .btn-wrap:not(:first-of-type)::before {\n content: ' - ';\n}\n.button {\n cursor: pointer;\n}\n#content .btn-wrap,\n#info .btn-wrap {\n display: inline-block;\n}\n#post-preview {\n position: absolute;\n z-index: 22;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n#settings,\n#threads,\n#info .navLinks,\n#content .navLinks {\n text-align: center;\n}\n#threads .thread {\n vertical-align: top;\n display: inline-block;\n word-wrap: break-word;\n overflow: hidden;\n margin-top: 5px;\n padding: 5px 0 3px;\n text-align: center;\n}\n.extended-small .thread,\n.small .thread {\n width: 165px;\n max-height: 320px;\n}\n.small .teaser,\n.large .teaser {\n display: none;\n}\n.extended-large .thread,\n.large .thread {\n width: 270px;\n max-height: 410px;\n}\n.extended-small .thumb,\n.small .thumb {\n max-width: 150px;\n max-height: 150px;\n}\n/* Front Page */\n#logo {\n text-align: center;\n}\n#doc {\n margin: 0 auto;\n width: 1000px;\n position: relative;\n}\n#boards .boxcontent {\n vertical-align: top;\n text-align: center;\n}\n#filter-container,\n#options-container {\n float: right;\n position: relative;\n}\n#optionssmenu {\n top: 100% !important;\n left: 0 !important;\n}\n#boards .column {\n " + Style.sizing + ": border-box;\n display: inline-block;\n width: 16em;\n text-align: left;\n vertical-align: top;\n}\n.bd ul,\n.boxcontent ul {\n vertical-align: top;\n padding: 0;\n}\n.right-box .boxcontent ul {\n padding: 0 10px;\n}\n.yuimenuitem,\n.boxcontent li {\n list-style-type: none;\n}\n.bd ul {\n margin: 0;\n}\n.yuimenuitem::before {\n content: \" [ ] \";\n font-family: monospace;\n}\n.yuimenuitem-checked::before {\n content: \" [x] \"\n}\n.yui-u {\n display: inline-block;\n vertical-align: top;\n width: 475px;\n margin: 10px;\n}\n#recent-images .boxcontent {\n text-align: center;\n}\n#ft {\n text-align: center;\n}\n#ft ul {\n padding: 0;\n}\n#ft li {\n list-style-type: none;\n display: inline-block;\n width: 100px;\n}\n#preview-tooltip-nws,\n#preview-tooltip-ws,\n#ft .fill,\n.clear-bug {\n display: none;\n}"; }, theme: function(theme) { var agent, background, backgroundC, bgColor, css, fileHeading, icons, replyHeading, _conf; @@ -11943,7 +10953,7 @@ bgColor = new Style.color(Style.colorToHex(backgroundC = theme["Background Color"]) || 'aaaaaa'); Style.lightTheme = bgColor.isLight(); icons = "data:image/png;base64," + Icons[_conf["Icons"]]; - css = ".hide_thread_button span > span,\n.hide_reply_button span > span {\n background-color: " + theme["Links"] + ";\n}\n#mascot_hide label {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\n#content .thumb {\n box-shadow: 0 0 5px " + theme["Reply Border"] + ";\n}\n.mascotname,\n.mascotoptions {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.opContainer.filter_highlight {\n box-shadow: inset 5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\n.filter_highlight > .reply {\n box-shadow: -5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\nhr {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\na[style=\"cursor: pointer; float: right;\"] + div[style^=\"width: 100%;\"] > table > tbody > tr > td {\n background: " + backgroundC + " !important;\n border: 1px solid " + theme["Reply Border"] + " !important;\n}\n#fs_status {\n background: " + theme["Dialog Background"] + " !important;\n}\n#fs_data tr[style=\"background-color: #EA8;\"] {\n background: " + theme["Reply Background"] + " !important;\n}\n#fs_data,\n#fs_data *,\n.threadContainer {\n border-color: " + theme["Reply Border"] + " !important;\n}\nhtml {\n background: " + (backgroundC || '') + ";\n background-image: " + (theme["Background Image"] || '') + ";\n background-repeat: " + (theme["Background Repeat"] || '') + ";\n background-attachment: " + (theme["Background Attachment"] || '') + ";\n background-position: " + (theme["Background Position"] || '') + ";\n}\n.section-container,\n#exlinks-options-content,\n#mascotcontent,\n#themecontent {\n background: " + backgroundC + ";\n border: 1px solid " + theme["Reply Border"] + ";\n padding: 5px;\n}\n.sections-list > a.tab-selected {\n background: " + backgroundC + ";\n border-color: " + theme["Reply Border"] + ";\n border-style: solid;\n}\n.captcha-img img {\n " + (Style.filter(theme["Text"], theme["Input Background"])) + "\n}\n#boardTitle,\n#prefetch,\n#showQR,\n" + (!_conf["Post Form Decorations"] ? '#spoilerLabel,' : '') + "\n#thread-stats {\n text-shadow:\n 1px 1px 0 " + backgroundC + ",\n -1px -1px 0 " + backgroundC + ",\n 1px -1px 0 " + backgroundC + ",\n -1px 1px 0 " + backgroundC + ",\n 0 1px 0 " + backgroundC + ",\n 0 -1px 0 " + backgroundC + ",\n 1px 0 0 " + backgroundC + ",\n -1px 0 0 " + backgroundC + "\n " + (_conf["Sidebar Glow"] ? ", 0 2px 5px " + theme['Text'] + ";" : ";") + "\n}\n/* Fixes text spoilers */\n" + (_conf['Remove Spoilers'] && _conf['Indicate Spoilers'] ? ".spoiler::before,s::before { content: '[spoiler]';}.spoiler::after,s::after { content: '[/spoiler]';}" : !_conf['Remove Spoilers'] ? ".spoiler:not(:hover) *,s:not(:hover) * { color: rgb(0,0,0) !important; text-shadow: none !important;}.spoiler:not(:hover),s:not(:hover) { background-color: rgb(0,0,0); color: rgb(0,0,0) !important; text-shadow: none !important;}" : "") + "\n#exlinks-options,\n#appchanx-settings,\n#qrtab,\n" + (_conf["Post Form Decorations"] ? "#qr," : "") + "\n#updater,\ninput[type=\"submit\"],\ninput[value=\"Report\"],\nspan[style=\"left: 5px; position: absolute;\"] a {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.enabled .mascotcontainer {\n background: " + theme["Buttons Background"] + ";\n border-color: " + theme["Buttons Border"] + ";\n}\n#dump,\n#qr-filename-container,\n#appchanx-settings input,\n.captcha-img,\n.dump #dump:not(:hover):not(:focus),\n.qr-preview,\n.selectrice,\nbutton,\ninput,\ntextarea {\n background: " + theme["Input Background"] + ";\n border: 1px solid " + theme["Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:hover,\n#qr-filename-container:hover,\n#qr-filename-container:hover,\n.selectrice:hover,\n#selectrice li:hover,\n#selectrice li:nth-of-type(2n+1):hover,\ninput:hover,\ntextarea:hover {\n background: " + theme["Hovered Input Background"] + ";\n border-color: " + theme["Hovered Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:active,\n#dump:focus,\n#selectrice li:focus,\n.selectrice:focus,\n#qr-filename-container:active,\n#qr-filename-container:focus,\ninput:focus,\ntextarea:focus,\ntextarea.field:focus {\n background: " + theme["Focused Input Background"] + ";\n border-color: " + theme["Focused Input Border"] + ";\n color: " + theme["Inputs"] + ";\n outline: none;\n}\n#mouseover,\n#post-preview,\n#qp .post,\n#xupdater,\n.reply.post {\n border-width: 1px;\n border-style: solid;\n border-color: " + theme["Reply Border"] + ";\n background: " + theme["Reply Background"] + ";\n}\n.thread > .replyContainer > .reply.post {\n border-width: " + (_conf['Post Spacing'] === "0" ? "1px 1px 0 1px" : '1px') + ";\n}\n.exblock.reply,\n.reply.post.highlight,\n.reply.post:target {\n background: " + theme["Highlighted Reply Background"] + ";\n border: 1px solid " + theme["Highlighted Reply Border"] + ";\n}\n#header-bar,\n.pagelist {\n background: " + theme["Navigation Background"] + ";\n border-style: solid;\n border-color: " + theme["Navigation Border"] + ";\n}\n.thread {\n background: " + theme["Thread Wrapper Background"] + ";\n border: 1px solid " + theme["Thread Wrapper Border"] + ";\n}\n#boardNavDesktopFoot,\n#mascotConf,\n#mascot_hide,\n#menu,\n#selectrice,\n#themeConf,\n#watcher,\n#watcher:hover,\n.notification,\n.submenu,\na[style=\"cursor: pointer; float: right;\"] ~ div[style^=\"width: 100%;\"] > table {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Dialog Border"] + ";\n}\n.deleteform::before,\n.deleteform,\n#qr .warning {\n background: " + theme["Input Background"] + ";\n border-color: " + theme["Input Border"] + ";\n}\n.disabledwarning,\n.warning {\n color: " + theme["Warnings"] + ";\n}\n#navlinks a:first-of-type {\n border-bottom: 11px solid rgb(130,130,130);\n}\n#navlinks a:last-of-type {\n border-top: 11px solid rgb(130,130,130);\n}\n#charCount {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.7)" : "rgba(255,255,255,0.7)") + ";\n}\n.postNum a {\n color: " + theme["Post Numbers"] + ";\n}\n.subject {\n color: " + theme["Subjects"] + " !important;\n}\n.dateTime,\n.post-ago {\n color: " + theme["Timestamps"] + " !important;\n}\n#fs_status a,\n#updater #count:not(.new)::after,\n#showQR,\n#updater,\n.abbr,\n.boxbar,\n.boxcontent,\n.deleteform::before,\n.pages strong,\n.pln,\n.reply,\n.reply.highlight,\n.summary,\nbody,\nbutton,\nspan[style=\"left: 5px; position: absolute;\"] a,\ninput,\ntextarea {\n color: " + theme["Text"] + ";\n}\n#exlinks-options-content > table,\n#appchanx-settings fieldset,\n#selectrice {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n box-shadow: inset " + theme["Shadow Color"] + " 0 0 5px;\n}\n.quote + .spoiler:hover,\n.quote {\n color: " + theme["Greentext"] + ";\n}\n.forwardlink {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n border-bottom: 1px dashed " + theme["Backlinks"] + ";\n}\n.container::before {\n color: " + theme["Timestamps"] + ";\n}\n#menu,\n#post-preview,\n#qp .opContainer,\n#qp .replyContainer,\n.submenu {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.rice {\n background: " + theme["Checkbox Background"] + ";\n border: 1px solid " + theme["Checkbox Border"] + ";\n}\n.selectrice::before {\n border-left: 1px solid " + theme["Input Border"] + ";\n}\n.selectrice::after {\n border-top: .45em solid " + theme["Inputs"] + ";\n}\n#updater input,\n.bd {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.pages a,\n#header-bar a {\n color: " + theme["Navigation Links"] + ";\n}\ninput[type=checkbox]:checked + .rice {\n position: relative;\n}\ninput[type=checkbox]:checked + .rice::after {\n content: \"\";\n display: block;\n width: 4px;\n height: 10px;\n border: solid " + theme["Inputs"] + ";\n border-width: 0 3px 3px 0;\n " + agent + "transform: rotate(45deg);\n position: absolute;\n left: 2px;\n bottom: -1px;\n}\n#addReply,\n#dump,\n.button,\n.entry,\n.replylink,\na {\n color: " + theme["Links"] + ";\n}\n.backlink {\n color: " + theme["Backlinks"] + ";\n}\n.qiQuote,\n.quotelink {\n color: " + theme["Quotelinks"] + ";\n}\n#addReply:hover,\n#dump:hover,\n.entry:hover,\n.sideArrows a:hover,\n.replylink:hover,\n.qiQuote:hover,\n.quotelink:hover,\na .name:hover,\na .postertrip:hover,\na:hover {\n color: " + theme["Hovered Links"] + ";\n}\n#header-bar a:hover,\n#boardTitle a:hover {\n color: " + theme["Hovered Navigation Links"] + ";\n}\n#boardTitle {\n color: " + theme["Board Title"] + ";\n}\n.name,\n.post-author {\n color: " + theme["Names"] + " !important;\n}\n.post-tripcode,\n.postertrip,\n.trip {\n color: " + theme["Tripcodes"] + " !important;\n}\na .postertrip,\na .name {\n color: " + theme["Emails"] + ";\n}\n.post.reply.qphl,\n.post.op.qphl {\n border-color: " + theme["Backlinked Reply Outline"] + ";\n background: " + theme["Highlighted Reply Background"] + ";\n}\n.inline .post {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.placeholder,\n#qr input::" + agent + "placeholder,\n#qr textarea::" + agent + "placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#qr input:" + agent + "placeholder,\n#qr textarea:" + agent + "placeholder,\n.placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#appchanx-settings fieldset,\n.boxcontent dd,\n.selectrice ul {\n border-color: " + (Style.lightTheme ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)") + ";\n}\n#appchanx-settings li,\n#selectrice li:not(:first-of-type) {\n border-top: 1px solid " + (Style.lightTheme ? "rgba(0,0,0,0.05)" : "rgba(255,255,255,0.025)") + ";\n}\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n.navLinks > a:first-of-type::after,\n#watcher::after,\n#globalMessage::after,\n#boardNavDesktopFoot::after,\na[style=\"cursor: pointer; float: right;\"]::after,\n#img-controls,\n#catalog::after,\n#fappeTyme {\n background-image: url('" + icons + "');\n" + (!Style.lightTheme ? "filter: url(\"data:image/svg+xml,#filters\");" : "") + "\n}\n" + theme["Custom CSS"]; + css = ".hide_thread_button span > span,\n.hide_reply_button span > span {\n background-color: " + theme["Links"] + ";\n}\n#mascot_hide label {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\n#content .thumb {\n box-shadow: 0 0 5px " + theme["Reply Border"] + ";\n}\n.mascotname,\n.mascotoptions {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.opContainer.filter_highlight {\n box-shadow: inset 5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\n.filter_highlight > .reply {\n box-shadow: -5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\nhr {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\na[style=\"cursor: pointer; float: right;\"] + div[style^=\"width: 100%;\"] > table > tbody > tr > td {\n background: " + backgroundC + " !important;\n border: 1px solid " + theme["Reply Border"] + " !important;\n}\n#fs_status {\n background: " + theme["Dialog Background"] + " !important;\n}\n#fs_data tr[style=\"background-color: #EA8;\"] {\n background: " + theme["Reply Background"] + " !important;\n}\n#fs_data,\n#fs_data *,\n.threadContainer {\n border-color: " + theme["Reply Border"] + " !important;\n}\nhtml {\n background: " + (backgroundC || '') + ";\n background-image: " + (theme["Background Image"] || '') + ";\n background-repeat: " + (theme["Background Repeat"] || '') + ";\n background-attachment: " + (theme["Background Attachment"] || '') + ";\n background-position: " + (theme["Background Position"] || '') + ";\n}\n.section-container,\n#exlinks-options-content,\n#mascotcontent,\n#themecontent {\n background: " + backgroundC + ";\n border: 1px solid " + theme["Reply Border"] + ";\n padding: 5px;\n}\n.sections-list > a.tab-selected {\n background: " + backgroundC + ";\n border-color: " + theme["Reply Border"] + ";\n border-style: solid;\n}\n.captcha-img img {\n " + (Style.filter(theme["Text"], theme["Input Background"])) + "\n}\n#boardTitle,\n#prefetch,\n#showQR,\n" + (!_conf["Post Form Decorations"] ? '#spoilerLabel,' : '') + "\n#thread-stats {\n text-shadow:\n 1px 1px 0 " + backgroundC + ",\n -1px -1px 0 " + backgroundC + ",\n 1px -1px 0 " + backgroundC + ",\n -1px 1px 0 " + backgroundC + ",\n 0 1px 0 " + backgroundC + ",\n 0 -1px 0 " + backgroundC + ",\n 1px 0 0 " + backgroundC + ",\n -1px 0 0 " + backgroundC + "\n " + (_conf["Sidebar Glow"] ? ", 0 2px 5px " + theme['Text'] + ";" : ";") + "\n}\n/* Fixes text spoilers */\n" + (_conf['Remove Spoilers'] && _conf['Indicate Spoilers'] ? ".spoiler::before,s::before { content: '[spoiler]';}.spoiler::after,s::after { content: '[/spoiler]';}" : !_conf['Remove Spoilers'] ? ".spoiler:not(:hover) *,s:not(:hover) * { color: rgb(0,0,0) !important; text-shadow: none !important;}.spoiler:not(:hover),s:not(:hover) { background-color: rgb(0,0,0); color: rgb(0,0,0) !important; text-shadow: none !important;}" : "") + "\n#exlinks-options,\n#appchanx-settings,\n#qrtab,\n" + (_conf["Post Form Decorations"] ? "#qr," : "") + "\ninput[type=\"submit\"],\ninput[value=\"Report\"],\nspan[style=\"left: 5px; position: absolute;\"] a {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.enabled .mascotcontainer {\n background: " + theme["Buttons Background"] + ";\n border-color: " + theme["Buttons Border"] + ";\n}\n#dump,\n#qr-filename-container,\n#appchanx-settings input,\n.captcha-img,\n.dump #dump:not(:hover):not(:focus),\n.qr-preview,\n.selectrice,\nbutton,\ninput,\ntextarea {\n background: " + theme["Input Background"] + ";\n border: 1px solid " + theme["Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:hover,\n#qr-filename-container:hover,\n#qr-filename-container:hover,\n.selectrice:hover,\n#selectrice li:hover,\n#selectrice li:nth-of-type(2n+1):hover,\ninput:hover,\ntextarea:hover {\n background: " + theme["Hovered Input Background"] + ";\n border-color: " + theme["Hovered Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:active,\n#dump:focus,\n#selectrice li:focus,\n.selectrice:focus,\n#qr-filename-container:active,\n#qr-filename-container:focus,\ninput:focus,\ntextarea:focus,\ntextarea.field:focus {\n background: " + theme["Focused Input Background"] + ";\n border-color: " + theme["Focused Input Border"] + ";\n color: " + theme["Inputs"] + ";\n outline: none;\n}\n#mouseover,\n#post-preview,\n#qp .post,\n#xupdater,\n.reply.post {\n border-width: 1px;\n border-style: solid;\n border-color: " + theme["Reply Border"] + ";\n background: " + theme["Reply Background"] + ";\n}\n.thread > .replyContainer > .reply.post {\n border-width: " + (_conf['Post Spacing'] === "0" ? "1px 1px 0 1px" : '1px') + ";\n}\n.exblock.reply,\n.reply.post.highlight,\n.reply.post:target {\n background: " + theme["Highlighted Reply Background"] + ";\n border: 1px solid " + theme["Highlighted Reply Border"] + ";\n}\n#header-bar,\n.pagelist {\n background: " + theme["Navigation Background"] + ";\n border-style: solid;\n border-color: " + theme["Navigation Border"] + ";\n}\n.thread {\n background: " + theme["Thread Wrapper Background"] + ";\n border: 1px solid " + theme["Thread Wrapper Border"] + ";\n}\n#boardNavDesktopFoot,\n#mascotConf,\n#mascot_hide,\n#menu,\n#selectrice,\n#themeConf,\n#watcher,\n#watcher:hover,\n.notification,\n.submenu,\na[style=\"cursor: pointer; float: right;\"] ~ div[style^=\"width: 100%;\"] > table {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Dialog Border"] + ";\n}\n.deleteform::before,\n.deleteform,\n#qr .warning {\n background: " + theme["Input Background"] + ";\n border-color: " + theme["Input Border"] + ";\n}\n.disabledwarning,\n.warning {\n color: " + theme["Warnings"] + ";\n}\n#navlinks a:first-of-type {\n border-bottom: 11px solid rgb(130,130,130);\n}\n#navlinks a:last-of-type {\n border-top: 11px solid rgb(130,130,130);\n}\n#charCount {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.7)" : "rgba(255,255,255,0.7)") + ";\n}\n.postNum a {\n color: " + theme["Post Numbers"] + ";\n}\n.subject {\n color: " + theme["Subjects"] + " !important;\n}\n.dateTime,\n.post-ago {\n color: " + theme["Timestamps"] + " !important;\n}\n#fs_status a,\n#updater #update-status:not(.new)::after,\n#showQR,\n.abbr,\n.boxbar,\n.boxcontent,\n.deleteform::before,\n.pages strong,\n.pln,\n.reply,\n.reply.highlight,\n.summary,\nbody,\nbutton,\nspan[style=\"left: 5px; position: absolute;\"] a,\ninput,\ntextarea {\n color: " + theme["Text"] + ";\n}\n#exlinks-options-content > table,\n#appchanx-settings fieldset,\n#selectrice {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n box-shadow: inset " + theme["Shadow Color"] + " 0 0 5px;\n}\n.quote + .spoiler:hover,\n.quote {\n color: " + theme["Greentext"] + ";\n}\n.forwardlink {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n border-bottom: 1px dashed " + theme["Backlinks"] + ";\n}\n.container::before {\n color: " + theme["Timestamps"] + ";\n}\n#menu,\n#post-preview,\n#qp .opContainer,\n#qp .replyContainer,\n.submenu {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.rice {\n background: " + theme["Checkbox Background"] + ";\n border: 1px solid " + theme["Checkbox Border"] + ";\n}\n.selectrice::before {\n border-left: 1px solid " + theme["Input Border"] + ";\n}\n.selectrice::after {\n border-top: .45em solid " + theme["Inputs"] + ";\n}\n.bd {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.pages a,\n#header-bar a {\n color: " + theme["Navigation Links"] + ";\n}\ninput[type=checkbox]:checked + .rice {\n position: relative;\n}\ninput[type=checkbox]:checked + .rice::after {\n content: \"\";\n display: block;\n width: 4px;\n height: 10px;\n border: solid " + theme["Inputs"] + ";\n border-width: 0 3px 3px 0;\n " + agent + "transform: rotate(45deg);\n position: absolute;\n left: 2px;\n bottom: -1px;\n}\n#addReply,\n#dump,\n.button,\n.entry,\n.replylink,\na {\n color: " + theme["Links"] + ";\n}\n.backlink {\n color: " + theme["Backlinks"] + ";\n}\n.qiQuote,\n.quotelink {\n color: " + theme["Quotelinks"] + ";\n}\n#addReply:hover,\n#dump:hover,\n.entry:hover,\n.sideArrows a:hover,\n.replylink:hover,\n.qiQuote:hover,\n.quotelink:hover,\na .name:hover,\na .postertrip:hover,\na:hover {\n color: " + theme["Hovered Links"] + ";\n}\n#header-bar a:hover,\n#boardTitle a:hover {\n color: " + theme["Hovered Navigation Links"] + ";\n}\n#boardTitle {\n color: " + theme["Board Title"] + ";\n}\n.name,\n.post-author {\n color: " + theme["Names"] + " !important;\n}\n.post-tripcode,\n.postertrip,\n.trip {\n color: " + theme["Tripcodes"] + " !important;\n}\na .postertrip,\na .name {\n color: " + theme["Emails"] + ";\n}\n.post.reply.qphl,\n.post.op.qphl {\n border-color: " + theme["Backlinked Reply Outline"] + ";\n background: " + theme["Highlighted Reply Background"] + ";\n}\n.inline .post {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.placeholder,\n#qr input::" + agent + "placeholder,\n#qr textarea::" + agent + "placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#qr input:" + agent + "placeholder,\n#qr textarea:" + agent + "placeholder,\n.placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#appchanx-settings fieldset,\n.boxcontent dd,\n.selectrice ul {\n border-color: " + (Style.lightTheme ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)") + ";\n}\n#appchanx-settings li,\n#selectrice li:not(:first-of-type) {\n border-top: 1px solid " + (Style.lightTheme ? "rgba(0,0,0,0.05)" : "rgba(255,255,255,0.025)") + ";\n}\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n.navLinks > a:first-of-type::after,\n#watcher::after,\n#globalMessage::after,\n#boardNavDesktopFoot::after,\na[style=\"cursor: pointer; float: right;\"]::after,\n#img-controls,\n#catalog::after,\n#fappeTyme {\n background-image: url('" + icons + "');\n" + (!Style.lightTheme ? "filter: url(\"data:image/svg+xml,#filters\");" : "") + "\n}\n" + theme["Custom CSS"]; css += (Style.lightTheme ? ".prettyprint {\n background-color: #e7e7e7;\n border: 1px solid #dcdcdc;\n}\n.com {\n color: #dd0000;\n}\n.str,\n.atv {\n color: #7fa61b;\n}\n.pun {\n color: #61663a;\n}\n.tag {\n color: #117743;\n}\n.kwd {\n color: #5a6F9e;\n}\n.typ,\n.atn {\n color: #9474bd;\n}\n.lit {\n color: #368c72;\n}\n" : ".prettyprint {\n background-color: rgba(0,0,0,.1);\n border: 1px solid rgba(0,0,0,0.5);\n}\n.tag {\n color: #96562c;\n}\n.pun {\n color: #5b6f2a;\n}\n.com {\n color: #a34443;\n}\n.str,\n.atv {\n color: #8ba446;\n}\n.kwd {\n color: #987d3e;\n}\n.typ,\n.atn {\n color: #897399;\n}\n.lit {\n color: #558773;\n}\n"); if (_conf["Alternate Post Colors"]) { css += ".replyContainer:not(.hidden):nth-of-type(2n+1) .post {\n background-image: " + agent + "linear-gradient(" + (Style.lightTheme ? "rgba(0,0,0,0.05), rgba(0,0,0,0.05)" : "rgba(255,255,255,0.02), rgba(255,255,255,0.02)") + ");\n}\n"; @@ -11999,45 +11009,38 @@ if (iconOffset < 0) { iconOffset = 0; } - css += "/* 4chan X Options */\n#appchanOptions {\n " + align + ": " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Watcher */\n#watcher::after {\n " + align + ": " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n " + align + ": " + position[i++] + "px;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Expand Images */\n#img-controls {\n " + align + ": " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n " + align + ": " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n " + align + ": " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a {\n margin: 2px;\n top: 1px;\n}\n#navlinks a:last-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#navlinks a:first-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 1.6em;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#boardNavDesktopFoot::after,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#watcher::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\ndiv.navLinks > a:first-of-type::after,\n#catalog::after,\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: 1px !important;\n}\n" + (_conf["Announcements"] === "slideout" ? "#globalMessage," : "") + "\n" + (_conf["Slideout Watcher"] ? "#watcher," : "") + "\n#boardNavDesktopFoot {\n top: 16px !important;\n}\n" + (_conf['Boards Navigation'] === 'Top' || _conf['Boards Navigation'] === 'Sticky top' ? '#header-bar' : _conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? '.pagelist' : void 0) + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}\n"; - if (_conf["Updater Position"] !== 'moveable') { - css += "/* Updater + Stats */\n#updater,\n#thread-stats {\n " + align + ": " + (_conf["Updater Position"] === "bottom" && !_conf["Hide Delete UI"] ? 23 : 2) + "px !important;\n " + Style.sidebarLocation[1] + ": auto !important;\n top: auto !important;\n bottom: auto !important;\n " + (_conf["Updater Position"] === 'top' ? "top: 16px !important" : "bottom: 0 !important") + ";\n}"; - } + css += "/* 4chan X Options */\n#appchanOptions {\n " + align + ": " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Watcher */\n#watcher::after {\n " + align + ": " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n " + align + ": " + position[i++] + "px;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Expand Images */\n#img-controls {\n " + align + ": " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n " + align + ": " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n " + align + ": " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a {\n margin: 2px;\n top: 1px;\n}\n#navlinks a:last-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#navlinks a:first-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 1.6em;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#boardNavDesktopFoot::after,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#watcher::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\ndiv.navLinks > a:first-of-type::after,\n#catalog::after,\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: 1px !important;\n}\n" + (_conf["Announcements"] === "slideout" ? "#globalMessage," : "") + "\n" + (_conf["Slideout Watcher"] ? "#watcher," : "") + "\n#boardNavDesktopFoot {\n top: 16px !important;\n}\n.fixed.top #header-bar" + (_conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? ',\n.pagelist' : '') + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}\n"; } else { position = aligner(2 + (_conf["4chan Banner"] === "at sidebar top" ? Style.logoOffset + 19 : 0), [notEither && _conf['Image Expansion'], true, true, _conf['Slideout Navigation'] !== 'hide', _conf['Announcements'] === 'slideout' && $('#globalMessage', d.body), notCatalog && _conf['Slideout Watcher'] && _conf['Thread Watcher'], notCatalog && $('body > a[style="cursor: pointer; float: right;"]', d.body), $('#navtopright .exlinksOptionsLink', d.body), notEither, g.VIEW === 'thread', notEither && _conf['Fappe Tyme'], navlinks = ((g.VIEW !== 'thread' && _conf['Index Navigation']) || (g.VIEW === 'thread' && _conf['Reply Navigation'])) && notCatalog, navlinks]); iconOffset = (g.VIEW === 'thread' && _conf['Prefetch'] ? 250 + Style.sidebarOffset.W : 20 + (g.VIEW === 'thread' && _conf['Updater Position'] === 'top' ? 100 : 0)) - (_conf['4chan SS Navigation'] ? 0 : Style.sidebar + parseInt(_conf[align.capitalize() + " Thread Padding"], 10)); - css += "/* Expand Images */\n#img-controls {\n top: " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n top: " + position[i++] + "px;\n}\n/* 4chan X Options */\n#appchanOptions {\n top: " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot,\n#boardNavDesktopFoot::after {\n top: " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage,\n#globalMessage::after {\n top: " + position[i++] + "px;\n}\n/* Watcher */\n" + (_conf["Slideout Watcher"] ? "#watcher, #watcher::after" : "") + " {\n top: " + position[i++] + "px !important;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n top: " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n top: " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n top: " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n top: " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a:first-of-type {\n top: " + position[i++] + "px !important;\n}\n#navlinks a:last-of-type {\n top: " + position[i++] + "px !important;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 0;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#navlinks a,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#boardNavDesktopFoot::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\n" + (_conf["Slideout Watcher"] ? "#watcher::after," : "") + "\nbody > a[style=\"cursor: pointer; float: right;\"]::after,\n#catalog::after,\ndiv.navLinks > a:first-of-type::after {\n " + align + ": 3px !important;\n}\n#boardNavDesktopFoot,\n#globalMessage,\n#watcher {\n width: " + (233 + Style.sidebarOffset.W) + "px !important;\n " + align + ": 18px !important;\n}\n" + (_conf['Boards Navigation'] === 'Top' || _conf['Boards Navigation'] === 'Sticky top' ? '#header-bar' : _conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? '.pagelist' : void 0) + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}"; - if (_conf["Updater Position"] !== 'moveable') { - css += "/* Updater + Stats */\n#updater,\n#thread-stats {\n " + align + ": " + (_conf["Updater Position"] === "top" || !_conf["Hide Delete UI"] ? 23 : 2) + "px !important; \n " + Style.sidebarLocation[1] + ": auto !important;\n top: " + (_conf["Updater Position"] === "top" ? "-1px" : "auto") + " !important;\n bottom: " + (_conf["Updater Position"] === "bottom" ? "-2px" : "auto") + " !important;\n}"; - } + css += "/* Expand Images */\n#img-controls {\n top: " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n top: " + position[i++] + "px;\n}\n/* 4chan X Options */\n#appchanOptions {\n top: " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot,\n#boardNavDesktopFoot::after {\n top: " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage,\n#globalMessage::after {\n top: " + position[i++] + "px;\n}\n/* Watcher */\n" + (_conf["Slideout Watcher"] ? "#watcher, #watcher::after" : "") + " {\n top: " + position[i++] + "px !important;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n top: " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n top: " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n top: " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n top: " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a:first-of-type {\n top: " + position[i++] + "px !important;\n}\n#navlinks a:last-of-type {\n top: " + position[i++] + "px !important;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 0;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#navlinks a,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#boardNavDesktopFoot::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\n" + (_conf["Slideout Watcher"] ? "#watcher::after," : "") + "\nbody > a[style=\"cursor: pointer; float: right;\"]::after,\n#catalog::after,\ndiv.navLinks > a:first-of-type::after {\n " + align + ": 3px !important;\n}\n#boardNavDesktopFoot,\n#globalMessage,\n#watcher {\n width: " + (233 + Style.sidebarOffset.W) + "px !important;\n " + align + ": 18px !important;\n}\n.fixed.top #header-bar" + (_conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? ',\n.pagelist' : '') + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}"; } return Style.icons.textContent = css; }, padding: function() { var css, sheet, _conf; - if (!(sheet = Style.paddingSheet)) { + if (!((sheet = Style.paddingSheet) && Style.padding.nav)) { return; } _conf = Conf; - Style.padding.nav.property = _conf["Boards Navigation"].split(" "); - Style.padding.nav.property = Style.padding.nav.property[Style.padding.nav.property.length - 1]; + Style.padding.nav.property = _conf['Bottom Header'] ? 'bottom' : 'top'; if (Style.padding.pages) { Style.padding.pages.property = _conf["Pagination"].split(" "); Style.padding.pages.property = Style.padding.pages.property[Style.padding.pages.property.length - 1]; } css = "body::before {\n"; - if (Style.padding.pages && (_conf["Pagination"] === "sticky top" || _conf["Pagination"] === "sticky bottom")) { + if (Style.padding.pages && ["sticky top", "top", "sticky bottom"].contains(_conf["Pagination"])) { css += " " + Style.padding.pages.property + ": " + Style.padding.pages.offsetHeight + "px !important;\n"; } - if (_conf["Boards Navigation"] === "Sticky top" || _conf["Boards Navigation"] === "Sticky bottom") { + if (_conf['Fixed Header']) { css += " " + Style.padding.nav.property + ": " + Style.padding.nav.offsetHeight + "px !important;\n"; } css += "}\nbody {\n padding-bottom: 0;\n"; - if ((Style.padding.pages != null) && (_conf["Pagination"] === "sticky top" || _conf["Pagination"] === "sticky bottom" || _conf["Pagination"] === "top")) { + if ((Style.padding.pages != null) && ["sticky top", "top", "sticky bottom"].contains(_conf["Pagination"])) { css += " padding-" + Style.padding.pages.property + ": " + Style.padding.pages.offsetHeight + "px;\n"; } - if (_conf["Boards Navigation"] !== "Hide") { + if (!(_conf['Header auto-hide'] || _conf['Hide Header'])) { css += " padding-" + Style.padding.nav.property + ": " + Style.padding.nav.offsetHeight + "px;\n"; } css += "}"; @@ -12440,6 +11443,1343 @@ } }; + PSAHiding = { + init: function() { + var entry; + + if (!Conf['Announcement Hiding']) { + return; + } + entry = { + type: 'header', + el: $.el('a', { + textContent: 'Show announcement', + className: 'show-announcement', + href: 'javascript:;' + }), + order: 50, + open: function() { + var _ref; + + if ((_ref = $.id('globalMessage')) != null ? _ref.hidden : void 0) { + return true; + } + return false; + } + }; + $.event('AddMenuEntry', entry); + $.on(entry.el, 'click', PSAHiding.toggle); + $.addClass(doc, 'hide-announcement'); + return $.on(d, '4chanXInitFinished', this.setup); + }, + setup: function() { + var btn, psa; + + $.off(d, '4chanXInitFinished', PSAHiding.setup); + if (!(psa = $.id('globalMessage'))) { + return; + } + PSAHiding.btn = btn = $.el('a', { + innerHTML: '[ - ]', + title: 'Hide announcement.', + className: 'hide-announcement', + href: 'javascript:;', + textContent: '[ - ]' + }); + $.on(btn, 'click', PSAHiding.toggle); + return $.get('hiddenPSAs', [], function(item) { + return PSAHiding.sync(item['hiddenPSAs']); + }); + }, + toggle: function(e) { + var text; + + text = PSAHiding.trim($.id('globalMessage')); + return $.get('hiddenPSAs', [], function(_arg) { + var hiddenPSAs, i; + + hiddenPSAs = _arg.hiddenPSAs; + if (hide) { + hiddenPSAs.push(text); + hiddenPSAs = hiddenPSAs.slice(-5); + } else { + $.event('CloseMenu'); + i = hiddenPSAs.indexOf(text); + hiddenPSAs.splice(i, 1); + } + PSAHiding.sync(hiddenPSAs); + return $.set('hiddenPSAs', hiddenPSAs); + }); + }, + sync: function(hiddenPSAs) { + var hr, psa; + + psa = $.id('globalMessage'); + psa.hidden = PSAHiding.btn.hidden = hiddenPSAs.contains(PSAHiding.trim(psa)) ? true : false; + if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') { + return hr.hidden = psa.hidden; + } + }, + trim: function(psa) { + return psa.textContent.replace(/\W+/g, '').toLowerCase(); + } + }; + + CatalogLinks = { + init: function() { + var el, input; + + $.ready(this.ready); + if (!Conf['Catalog Links']) { + return; + } + el = $.el('label', { + id: 'toggleCatalog', + href: 'javascript:;', + innerHTML: "Catalog Links", + title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "." + }); + input = $('input', el); + $.on(input, 'change', this.toggle); + $.sync('Header catalog links', CatalogLinks.set); + $.event('AddMenuEntry', { + type: 'header', + el: el, + order: 95 + }); + return $.on(d, '4chanXInitFinished', function() { + return CatalogLinks.set(Conf['Header catalog links']); + }); + }, + toggle: function() { + var useCatalog; + + $.event('CloseMenu'); + $.set('Header catalog links', useCatalog = this.checked); + return CatalogLinks.set(useCatalog); + }, + set: function(useCatalog) { + var a, board, path, _i, _len, _ref; + + path = useCatalog ? 'catalog' : ''; + _ref = $$("#board-list a[href*=\"boards.4chan.org\"],\n#boardNavDesktop a[href*=\"boards.4chan.org\"],\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + a = _ref[_i]; + board = a.pathname.split('/')[1]; + if (['f', 'status', '4chan'].contains(board) || !board) { + continue; + } + if (Conf['External Catalog']) { + a.href = useCatalog ? CatalogLinks.external(board) : "//boards.4chan.org/" + board + "/"; + } else { + a.pathname = "/" + board + "/" + path; + } + a.title = useCatalog ? "" + a.title + " - Catalog" : a.title.replace(/\ -\ Catalog$/, ''); + } + return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; + }, + external: function(board) { + return (['a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'].contains(board) ? "http://catalog.neet.tv/" + board : ['d', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'].contains(board) ? "http://4index.gropes.us/" + board : "//boards.4chan.org/" + board + "/catalog"); + }, + ready: function() { + var catalogLink; + + if (catalogLink = $('.pages.cataloglink a', d.body) || $('[href=".././catalog"]', d.body)) { + if (g.VIEW !== 'thread') { + $.add(d.body, catalogLink); + } + return catalogLink.id = 'catalog'; + } + } + }; + + IDColor = { + init: function() { + if (!Conf['Color User IDs']) { + return; + } + return Post.prototype.callbacks.push({ + name: 'Reveal Spoilers', + cb: this.node + }); + }, + node: function(post) { + var str, uid; + + if (!(uid = $('.hand', this.nodes.uniqueID))) { + return; + } + str = this.info.uniqueID; + if (uid.nodeName === 'SPAN') { + return uid.style.cssText = IDColor.apply.call(str); + } + }, + ids: {}, + compute: function(str) { + var hash, rgb; + + hash = this.hash(str); + rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; + rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; + this.ids[str] = rgb; + return rgb; + }, + apply: function() { + var rgb; + + rgb = IDColor.ids[this] || IDColor.compute(this); + return ("background-color: rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "); color: ") + (rgb[3] ? "black;" : "white; border-radius: 3px; padding: 0px 2px;"); + }, + hash: function(str) { + var i, j, msg; + + msg = 0; + i = 0; + j = str.length; + while (i < j) { + msg = ((msg << 5) - msg) + str.charCodeAt(i); + ++i; + } + return msg; + } + }; + + CustomCSS = { + init: function() { + if (!Conf['Custom CSS']) { + return; + } + return this.addStyle(); + }, + addStyle: function() { + return this.style = $.addStyle(Conf['usercss']); + }, + rmStyle: function() { + if (this.style) { + $.rm(this.style); + return delete this.style; + } + }, + update: function() { + if (!this.style) { + this.addStyle(); + } + return this.style.textContent = Conf['usercss']; + } + }; + + ExpandComment = { + init: function() { + if (g.VIEW !== 'index' || !Conf['Comment Expansion']) { + return; + } + if (g.BOARD.ID === 'g') { + this.callbacks.push(Fourchan.code); + } + if (g.BOARD.ID === 'sci') { + this.callbacks.push(Fourchan.math); + } + return Post.prototype.callbacks.push({ + name: 'Comment Expansion', + cb: this.node + }); + }, + node: function() { + var a; + + if (a = $('.abbr > a', this.nodes.comment)) { + return $.on(a, 'click', ExpandComment.cb); + } + }, + callbacks: [], + cb: function(e) { + var post; + + e.preventDefault(); + post = Get.postFromNode(this); + return ExpandComment.expand(post); + }, + expand: function(post) { + var a; + + if (post.nodes.longComment && !post.nodes.longComment.parentNode) { + $.replace(post.nodes.shortComment, post.nodes.longComment); + post.nodes.comment = post.nodes.longComment; + return; + } + if (!(a = $('.abbr > a', post.nodes.comment))) { + return; + } + a.textContent = "Post No." + post + " Loading..."; + return $.cache("//api.4chan.org" + a.pathname + ".json", function() { + return ExpandComment.parse(this, a, post); + }); + }, + contract: function(post) { + var a; + + if (!post.nodes.shortComment) { + return; + } + a = $('.abbr > a', post.nodes.shortComment); + a.textContent = 'here'; + $.replace(post.nodes.longComment, post.nodes.shortComment); + return post.nodes.comment = post.nodes.shortComment; + }, + parse: function(req, a, post) { + var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; + + status = req.status; + if (![200, 304].contains(status)) { + a.textContent = "Error " + req.statusText + " (" + status + ")"; + return; + } + posts = JSON.parse(req.response).posts; + if (spoilerRange = posts[0].custom_spoiler) { + Build.spoilerRange[g.BOARD] = spoilerRange; + } + for (_i = 0, _len = posts.length; _i < _len; _i++) { + postObj = posts[_i]; + if (postObj.no === post.ID) { + break; + } + } + if (postObj.no !== post.ID) { + a.textContent = "Post No." + post + " not found."; + return; + } + comment = post.nodes.comment; + clone = comment.cloneNode(false); + clone.innerHTML = postObj.com; + _ref = $$('.quotelink', clone); + for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { + quote = _ref[_j]; + href = quote.getAttribute('href'); + if (href[0] === '/') { + continue; + } + quote.href = "/" + post.board + "/res/" + href; + } + post.nodes.shortComment = comment; + $.replace(comment, clone); + post.nodes.comment = post.nodes.longComment = clone; + post.parseComment(); + post.parseQuotes(); + _ref1 = ExpandComment.callbacks; + for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { + callback = _ref1[_k]; + callback.call(post); + } + } + }; + + ExpandThread = { + init: function() { + if (g.VIEW !== 'index' || !Conf['Thread Expansion']) { + return; + } + return Thread.prototype.callbacks.push({ + name: 'Thread Expansion', + cb: this.node + }); + }, + node: function() { + var a, span; + + if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { + return; + } + a = $.el('a', { + textContent: "+ " + span.textContent, + className: 'summary', + href: 'javascript:;' + }); + $.on(a, 'click', ExpandThread.cbToggle); + return $.replace(span, a); + }, + cbToggle: function() { + var op; + + op = Get.postFromRoot(this.previousElementSibling); + return ExpandThread.toggle(op.thread); + }, + toggle: function(thread) { + var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; + + threadRoot = thread.OP.nodes.root.parentNode; + a = $('.summary', threadRoot); + switch (thread.isExpanded) { + case false: + case void 0: + thread.isExpanded = 'loading'; + _ref = $$('.thread > .postContainer', threadRoot); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + post = _ref[_i]; + ExpandComment.expand(Get.postFromRoot(post)); + } + if (!a) { + thread.isExpanded = true; + return; + } + thread.isExpanded = 'loading'; + a.textContent = a.textContent.replace('+', '× Loading...'); + $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { + return ExpandThread.parse(this, thread, a); + }); + break; + case 'loading': + thread.isExpanded = false; + if (!a) { + return; + } + a.textContent = a.textContent.replace('× Loading...', '+'); + break; + case true: + thread.isExpanded = false; + if (a) { + a.textContent = a.textContent.replace('-', '+'); + num = (function() { + if (thread.isSticky) { + return 1; + } else { + switch (g.BOARD.ID) { + case 'b': + case 'vg': + case 'q': + return 3; + case 't': + return 1; + default: + return 5; + } + } + })(); + replies = $$('.thread > .replyContainer', threadRoot).slice(0, -num); + for (_j = 0, _len1 = replies.length; _j < _len1; _j++) { + reply = replies[_j]; + if (Conf['Quote Inlining']) { + while (inlined = $('.inlined', reply)) { + inlined.click(); + } + } + $.rm(reply); + } + } + _ref1 = $$('.thread > .postContainer', threadRoot); + for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { + post = _ref1[_k]; + ExpandComment.contract(Get.postFromRoot(post)); + } + } + }, + parse: function(req, thread, a) { + var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; + + if (a.textContent[0] === '+') { + return; + } + status = req.status; + if (![200, 304].contains(status)) { + a.textContent = "Error " + req.statusText + " (" + status + ")"; + $.off(a, 'click', ExpandThread.cb.toggle); + return; + } + thread.isExpanded = true; + a.textContent = a.textContent.replace('× Loading...', '-'); + posts = JSON.parse(req.response).posts; + if (spoilerRange = posts[0].custom_spoiler) { + Build.spoilerRange[g.BOARD] = spoilerRange; + } + replies = posts.slice(1); + posts = []; + nodes = []; + for (_i = 0, _len = replies.length; _i < _len; _i++) { + reply = replies[_i]; + if (post = thread.posts[reply.no]) { + nodes.push(post.nodes.root); + continue; + } + node = Build.postFromObject(reply, thread.board); + post = new Post(node, thread, thread.board); + link = $('a[title="Highlight this post"]', node); + link.href = "res/" + thread + "#p" + post; + link.nextSibling.href = "res/" + thread + "#q" + post; + posts.push(post); + nodes.push(node); + } + Main.callbackNodes(Post, posts); + $.after(a, nodes); + return Fourchan.parseThread(thread.ID, 1, nodes.length); + } + }; + + FileInfo = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) { + return; + } + this.funk = this.createFunc(Conf['fileInfo']); + return Post.prototype.callbacks.push({ + name: 'File Info Formatting', + cb: this.node + }); + }, + node: function() { + if (!this.file || this.isClone) { + return; + } + return this.file.text.innerHTML = FileInfo.funk(FileInfo, this); + }, + createFunc: function(format) { + var code; + + code = format.replace(/%(.)/g, function(s, c) { + if (c in FileInfo.formatters) { + return "' + FileInfo.formatters." + c + ".call(post) + '"; + } else { + return s; + } + }); + return Function('FileInfo', 'post', "return '" + code + "'"); + }, + convertUnit: function(size, unit) { + var i; + + if (unit === 'B') { + return "" + (size.toFixed()) + " Bytes"; + } + i = 1 + ['KB', 'MB'].indexOf(unit); + while (i--) { + size /= 1024; + } + size = unit === 'MB' ? Math.round(size * 100) / 100 : size.toFixed(); + return "" + size + " " + unit; + }, + escape: function(name) { + return name.replace(/<|>/g, function(c) { + return c === '<' && '<' || '>'; + }); + }, + formatters: { + t: function() { + return this.file.URL.match(/\d+\..+$/)[0]; + }, + T: function() { + return "" + (FileInfo.formatters.t.call(this)) + ""; + }, + l: function() { + return "" + (FileInfo.formatters.n.call(this)) + ""; + }, + L: function() { + return "" + (FileInfo.formatters.N.call(this)) + ""; + }, + n: function() { + var fullname, shortname; + + fullname = this.file.name; + shortname = Build.shortFilename(this.file.name, this.isReply); + if (fullname === shortname) { + return FileInfo.escape(fullname); + } else { + return "" + (FileInfo.escape(shortname)) + "" + (FileInfo.escape(fullname)) + ""; + } + }, + N: function() { + return FileInfo.escape(this.file.name); + }, + p: function() { + if (this.file.isSpoiler) { + return 'Spoiler, '; + } else { + return ''; + } + }, + s: function() { + return this.file.size; + }, + B: function() { + return FileInfo.convertUnit(this.file.sizeInBytes, 'B'); + }, + K: function() { + return FileInfo.convertUnit(this.file.sizeInBytes, 'KB'); + }, + M: function() { + return FileInfo.convertUnit(this.file.sizeInBytes, 'MB'); + }, + r: function() { + if (this.file.isImage) { + return this.file.dimensions; + } else { + return 'PDF'; + } + } + } + }; + + Fourchan = { + init: function() { + var board; + + if (g.VIEW === 'catalog') { + return; + } + board = g.BOARD.ID; + if (board === 'g') { + $.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML);\n}, false);"); + Post.prototype.callbacks.push({ + name: 'Parse /g/ code', + cb: this.code + }); + } + if (board === 'sci') { + $.globalEval("window.addEventListener('jsmath', function(e) {\n if (jsMath.loaded) {\n // process one post\n jsMath.ProcessBeforeShowing(e.detail);\n } else {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);"); + return Post.prototype.callbacks.push({ + name: 'Parse /sci/ math', + cb: this.math + }); + } + }, + code: function() { + var pre, _i, _len, _ref; + + if (this.isClone) { + return; + } + _ref = $$('.prettyprint', this.nodes.comment); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + pre = _ref[_i]; + $.event('prettyprint', pre, window); + } + }, + math: function() { + if (this.isClone || !$('.math', this.nodes.comment)) { + return; + } + return $.event('jsmath', this.nodes.post, window); + }, + parseThread: function(threadID, offset, limit) { + return $.event('4chanParsingDone', { + threadId: threadID, + offset: offset, + limit: limit + }); + } + }; + + Keybinds = { + init: function() { + var init; + + if (g.VIEW === 'catalog' || !Conf['Keybinds']) { + return; + } + init = function() { + var node, _i, _len, _ref; + + $.off(d, '4chanXInitFinished', init); + $.on(d, 'keydown', Keybinds.keydown); + _ref = $$('[accesskey]'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + node = _ref[_i]; + node.removeAttribute('accesskey'); + } + }; + return $.on(d, '4chanXInitFinished', init); + }, + keydown: function(e) { + var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; + + if (!(key = Keybinds.keyCode(e))) { + return; + } + target = e.target; + if (['INPUT', 'TEXTAREA'].contains(target.nodeName)) { + if (!/(Esc|Alt|Ctrl|Meta)/.test(key)) { + return; + } + } + threadRoot = Nav.getThread(); + if (op = $('.op', threadRoot)) { + thread = Get.postFromNode(op).thread; + } + switch (key) { + case Conf['Toggle board list']: + if (Conf['Custom Board Navigation']) { + Header.toggleBoardList(); + } + break; + case Conf['Toggle header']: + if (!$('#menu.left')) { + Header.menuButton.click(); + } + Header.headerToggler.click(); + break; + case Conf['Open empty QR']: + Keybinds.qr(threadRoot); + break; + case Conf['Open QR']: + Keybinds.qr(threadRoot, true); + break; + case Conf['Open settings']: + Settings.open(); + break; + case Conf['Close']: + if ($.id('fourchanx-settings')) { + Settings.close(); + } else if ((notifications = $$('.notification')).length) { + for (_i = 0, _len = notifications.length; _i < _len; _i++) { + notification = notifications[_i]; + $('.close', notification).click(); + } + } else if (QR.nodes) { + QR.close(); + } + break; + case Conf['Spoiler tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('spoiler', target); + break; + case Conf['Code tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('code', target); + break; + case Conf['Eqn tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('eqn', target); + break; + case Conf['Math tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('math', target); + break; + case Conf['Toggle sage']: + if (QR.nodes) { + Keybinds.sage(); + } + break; + case Conf['Submit QR']: + if (QR.nodes && !QR.status()) { + QR.submit(); + } + break; + case Conf['Watch']: + ThreadWatcher.toggle(thread); + break; + case Conf['Update']: + ThreadUpdater.update(); + break; + case Conf['Expand image']: + Keybinds.img(threadRoot); + break; + case Conf['Expand images']: + Keybinds.img(threadRoot, true); + break; + case Conf['fappeTyme']: + FappeTyme.toggle(); + break; + case Conf['Front page']: + window.location = "/" + g.BOARD + "/0#delform"; + break; + case Conf['Open front page']: + $.open("/" + g.BOARD + "/#delform"); + break; + case Conf['Next page']: + if (form = $('.next form')) { + window.location = form.action; + } + break; + case Conf['Previous page']: + if (form = $('.prev form')) { + window.location = form.action; + } + break; + case Conf['Open catalog']: + if (Conf['External Catalog']) { + window.location = CatalogLinks.external(g.BOARD.ID); + } else { + window.location = "/" + g.BOARD + "/catalog"; + } + break; + case Conf['Next thread']: + if (g.VIEW === 'thread') { + return; + } + Nav.scroll(+1); + break; + case Conf['Previous thread']: + if (g.VIEW === 'thread') { + return; + } + Nav.scroll(-1); + break; + case Conf['Expand thread']: + ExpandThread.toggle(thread); + break; + case Conf['Open thread']: + Keybinds.open(thread); + break; + case Conf['Open thread tab']: + Keybinds.open(thread, true); + break; + case Conf['Next reply']: + Keybinds.hl(+1, threadRoot); + break; + case Conf['Previous reply']: + Keybinds.hl(-1, threadRoot); + break; + case Conf['Hide']: + if (g.VIEW === 'index') { + ThreadHiding.toggle(thread); + } + break; + default: + return; + } + e.preventDefault(); + return e.stopPropagation(); + }, + keyCode: function(e) { + var kc, key; + + key = (function() { + switch (kc = e.keyCode) { + case 8: + return ''; + case 13: + return 'Enter'; + case 27: + return 'Esc'; + case 37: + return 'Left'; + case 38: + return 'Up'; + case 39: + return 'Right'; + case 40: + return 'Down'; + default: + if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { + return String.fromCharCode(kc).toLowerCase(); + } else { + return null; + } + } + })(); + if (key) { + if (e.altKey) { + key = 'Alt+' + key; + } + if (e.ctrlKey) { + key = 'Ctrl+' + key; + } + if (e.metaKey) { + key = 'Meta+' + key; + } + if (e.shiftKey) { + key = 'Shift+' + key; + } + } + return key; + }, + qr: function(thread, quote) { + if (!(Conf['Quick Reply'] && QR.postingIsEnabled)) { + return; + } + QR.open(); + if (quote) { + QR.quote.call($('input', $('.post.highlight', thread) || thread)); + } + QR.nodes.com.focus(); + if (Conf['QR Shortcut']) { + return $.rmClass($('.qr-shortcut'), 'disabled'); + } + }, + tags: function(tag, ta) { + var range, selEnd, selStart, value; + + value = ta.value; + selStart = ta.selectionStart; + selEnd = ta.selectionEnd; + ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd); + range = ("[" + tag + "]").length + selEnd; + ta.setSelectionRange(range, range); + return $.event('input', null, ta); + }, + sage: function() { + var isSage; + + isSage = /sage/i.test(QR.nodes.email.value); + return QR.nodes.email.value = isSage ? "" : "sage"; + }, + img: function(thread, all) { + var post; + + if (all) { + return ImageExpand.cb.toggleAll(); + } else { + post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread)); + return ImageExpand.toggle(post); + } + }, + open: function(thread, tab) { + var url; + + if (g.VIEW !== 'index') { + return; + } + url = "/" + thread.board + "/res/" + thread; + if (tab) { + return $.open(url); + } else { + return location.href = url; + } + }, + hl: function(delta, thread) { + var headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; + + if (Conf['Fixed Header'] && Conf['Bottom header']) { + topMargin = 0; + } else { + headRect = Header.bar.getBoundingClientRect(); + topMargin = headRect.top + headRect.height; + } + if (postEl = $('.reply.highlight', thread)) { + $.rmClass(postEl, 'highlight'); + rect = postEl.getBoundingClientRect(); + if (rect.bottom >= topMargin && rect.top <= doc.clientHeight) { + root = postEl.parentNode; + next = $.x('child::div[contains(@class,"post reply")]', delta === +1 ? root.nextElementSibling : root.previousElementSibling); + if (!next) { + this.focus(postEl); + return; + } + if (!(g.VIEW === 'thread' || $.x('ancestor::div[parent::div[@class="board"]]', next) === thread)) { + return; + } + rect = next.getBoundingClientRect(); + if (rect.top < 0 || rect.bottom > doc.clientHeight) { + if (delta === -1) { + window.scrollBy(0, rect.top - topMargin); + } else { + next.scrollIntoView(false); + } + } + this.focus(next); + return; + } + } + replies = $$('.reply', thread); + if (delta === -1) { + replies.reverse(); + } + for (_i = 0, _len = replies.length; _i < _len; _i++) { + reply = replies[_i]; + rect = reply.getBoundingClientRect(); + if (delta === +1 && rect.top >= topMargin || delta === -1 && rect.bottom <= doc.clientHeight) { + this.focus(reply); + return; + } + } + }, + focus: function(post) { + return $.addClass(post, 'highlight'); + } + }; + + Nav = { + init: function() { + var append, next, prev, span; + + switch (g.VIEW) { + case 'index': + if (!Conf['Index Navigation']) { + return; + } + break; + case 'thread': + if (!Conf['Reply Navigation']) { + return; + } + break; + default: + return; + } + span = $.el('span', { + id: 'navlinks' + }); + prev = $.el('a', { + href: 'javascript:;' + }); + next = $.el('a', { + href: 'javascript:;' + }); + $.on(prev, 'click', this.prev); + $.on(next, 'click', this.next); + $.add(span, [prev, $.tn(' '), next]); + append = function() { + $.off(d, '4chanXInitFinished', append); + return $.add(d.body, span); + }; + return $.on(d, '4chanXInitFinished', append); + }, + prev: function() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, 0); + } else { + return Nav.scroll(-1); + } + }, + next: function() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, d.body.scrollHeight); + } else { + return Nav.scroll(+1); + } + }, + getThread: function(full) { + var headRect, i, rect, thread, threads, topMargin, _i, _len; + + if (Conf['Bottom header']) { + topMargin = 0; + } else { + headRect = Header.bar.getBoundingClientRect(); + topMargin = headRect.top + headRect.height; + } + threads = $$('.thread:not([hidden])'); + for (i = _i = 0, _len = threads.length; _i < _len; i = ++_i) { + thread = threads[i]; + rect = thread.getBoundingClientRect(); + if (rect.bottom > topMargin) { + if (full) { + return [threads, thread, i, rect, topMargin]; + } else { + return thread; + } + } + } + return $('.board'); + }, + scroll: function(delta) { + var i, rect, thread, threads, top, topMargin, _ref, _ref1; + + _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; + top = rect.top - topMargin; + if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) { + i += delta; + } + top = ((_ref1 = threads[i]) != null ? _ref1.getBoundingClientRect().top : void 0) - topMargin; + return window.scrollBy(0, top); + } + }; + + RelativeDates = { + INTERVAL: $.MINUTE / 2, + init: function() { + if (g.VIEW === 'catalog' || !Conf['Relative Post Dates']) { + return; + } + $.on(d, 'visibilitychange ThreadUpdate', this.flush); + this.flush(); + return Post.prototype.callbacks.push({ + name: 'Relative Post Dates', + cb: this.node + }); + }, + node: function() { + var dateEl; + + if (this.isClone) { + return; + } + dateEl = this.nodes.date; + dateEl.title = dateEl.textContent; + return RelativeDates.setUpdate(this); + }, + relative: function(diff, now, date) { + var days, months, number, rounded, unit, years; + + unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); + rounded = Math.round(number); + if (rounded !== 1) { + unit += 's'; + } + return "" + rounded + " " + unit + " ago"; + }, + stale: [], + flush: function() { + var now, update, _i, _len, _ref; + + if (d.hidden) { + return; + } + now = new Date(); + _ref = RelativeDates.stale; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + update = _ref[_i]; + update(now); + } + RelativeDates.stale = []; + clearTimeout(RelativeDates.timeout); + return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); + }, + setUpdate: function(post) { + var markStale, setOwnTimeout, update; + + setOwnTimeout = function(diff) { + var delay; + + delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; + return setTimeout(markStale, delay); + }; + update = function(now) { + var date, diff, relative, singlePost, _i, _len, _ref; + + date = post.info.date; + diff = now - date; + relative = RelativeDates.relative(diff, now, date); + _ref = [post].concat(post.clones); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + singlePost = _ref[_i]; + singlePost.nodes.date.firstChild.textContent = relative; + } + return setOwnTimeout(diff); + }; + markStale = function() { + return RelativeDates.stale.push(update); + }; + return update(new Date()); + } + }; + + RemoveSpoilers = { + init: function() { + if (!Conf['Remove Spoilers']) { + return; + } + if (Conf['Indicate Spoilers']) { + this.wrapper = function(text) { + return "[spoiler]" + text + "[/spoiler]"; + }; + } + return Post.prototype.callbacks.push({ + name: 'Reveal Spoilers', + cb: this.node + }); + }, + wrapper: function(text) { + return text; + }, + node: function(post) { + var spoiler, spoilers, _i, _len; + + spoilers = $$('s', this.nodes.comment); + for (_i = 0, _len = spoilers.length; _i < _len; _i++) { + spoiler = spoilers[_i]; + $.replace(spoiler, $.tn(RemoveSpoilers.wrapper(spoiler.textContent))); + } + } + }; + + Report = { + init: function() { + if (!/report/.test(location.search)) { + return; + } + return $.ready(this.ready); + }, + ready: function() { + var field, form; + + form = $('form'); + field = $.id('recaptcha_response_field'); + $.on(field, 'keydown', function(e) { + if (e.keyCode === 8 && !field.value) { + return $.globalEval('Recaptcha.reload("t")'); + } + }); + return $.on(form, 'submit', function(e) { + var response; + + e.preventDefault(); + response = field.value.trim(); + if (!/\s/.test(response)) { + field.value = "" + response + " " + response; + } + return form.submit(); + }); + } + }; + + Sauce = { + init: function() { + var link, links, _i, _len, _ref; + + if (g.VIEW === 'catalog' || !Conf['Sauce']) { + return; + } + links = []; + _ref = Conf['sauces'].split('\n'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + if (link[0] === '#') { + continue; + } + links.push(this.createSauceLink(link.trim())); + } + if (!links.length) { + return; + } + this.links = links; + this.link = $.el('a', { + target: '_blank' + }); + return Post.prototype.callbacks.push({ + name: 'Sauce', + cb: this.node + }); + }, + createSauceLink: function(link) { + var m, text; + + link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { + switch (parameter) { + case '%TURL': + return "' + encodeURIComponent(post.file.thumbURL) + '"; + case '%URL': + return "' + encodeURIComponent(post.file.URL) + '"; + case '%MD5': + return "' + encodeURIComponent(post.file.MD5) + '"; + case '%board': + return "' + encodeURIComponent(post.board) + '"; + default: + return parameter; + } + }); + text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1]; + link = link.replace(/;text:.+$/, ''); + return Function('post', 'a', "a.href = '" + link + "';\na.textContent = '" + text + "';\nreturn a;"); + }, + node: function() { + var link, nodes, _i, _len, _ref; + + if (this.isClone || !this.file) { + return; + } + nodes = []; + _ref = Sauce.links; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + nodes.push($.tn('\u00A0'), link(this, Sauce.link.cloneNode(true))); + } + return $.add(this.file.info, nodes); + } + }; + + Time = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Time Formatting']) { + return; + } + this.funk = this.createFunc(Conf['time']); + return Post.prototype.callbacks.push({ + name: 'Time Formatting', + cb: this.node + }); + }, + node: function() { + if (this.isClone) { + return; + } + return this.nodes.date.textContent = Time.funk(Time, this.info.date); + }, + createFunc: function(format) { + var code; + + code = format.replace(/%([A-Za-z])/g, function(s, c) { + if (c in Time.formatters) { + return "' + Time.formatters." + c + ".call(date) + '"; + } else { + return s; + } + }); + return Function('Time', 'date', "return '" + code + "'"); + }, + day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + zeroPad: function(n) { + if (n < 10) { + return "0" + n; + } else { + return n; + } + }, + formatters: { + a: function() { + return Time.day[this.getDay()].slice(0, 3); + }, + A: function() { + return Time.day[this.getDay()]; + }, + b: function() { + return Time.month[this.getMonth()].slice(0, 3); + }, + B: function() { + return Time.month[this.getMonth()]; + }, + d: function() { + return Time.zeroPad(this.getDate()); + }, + e: function() { + return this.getDate(); + }, + H: function() { + return Time.zeroPad(this.getHours()); + }, + I: function() { + return Time.zeroPad(this.getHours() % 12 || 12); + }, + k: function() { + return this.getHours(); + }, + l: function() { + return this.getHours() % 12 || 12; + }, + m: function() { + return Time.zeroPad(this.getMonth() + 1); + }, + M: function() { + return Time.zeroPad(this.getMinutes()); + }, + p: function() { + if (this.getHours() < 12) { + return 'AM'; + } else { + return 'PM'; + } + }, + P: function() { + if (this.getHours() < 12) { + return 'am'; + } else { + return 'pm'; + } + }, + S: function() { + return Time.zeroPad(this.getSeconds()); + }, + y: function() { + return this.getFullYear() - 2000; + } + } + }; + Settings = { init: function() { var link, settings; @@ -12493,7 +12833,7 @@ Settings.addSection('Script', Settings.main); Settings.addSection('Filter', Settings.filter); Settings.addSection('Sauce', Settings.sauce); - Settings.addSection('Rice', Settings.rice); + Settings.addSection('Advanced', Settings.advanced); Settings.addSection('Keybinds', Settings.keybinds); $.on(d, 'AddSettingsSection', Settings.addSection); $.on(d, 'OpenSettings', function(e) { @@ -12528,7 +12868,7 @@ Settings.dialog = dialog = $.el('div', { id: 'appchanx-settings', "class": 'dialog', - innerHTML: "\n
\n
" + innerHTML: "
" }); Settings.overlay = overlay = $.el('div', { id: 'overlay' @@ -12832,6 +13172,13 @@ }); } data.Conf.WatchedThreads = data.WatchedThreads; + } else if (version[0] === '3') { + data = Settings.convertSettings(data, { + 'Reply Hiding': 'Reply Hiding Buttons', + 'Thread Hiding': 'Thread Hiding Buttons', + 'Bottom header': 'Bottom Header', + 'Unread Tab Icon': 'Unread Favicon' + }); } return $.set(data.Conf); }, @@ -12850,7 +13197,7 @@ filter: function(section) { var select; - section.innerHTML = "\n
"; + section.innerHTML = "
"; select = $('select', section); $.on(select, 'change', Settings.selectFilter); return Settings.selectFilter.call(select); @@ -12873,31 +13220,31 @@ $.add(div, ta); return; } - return div.innerHTML = "
Filter is disabled.
\n

\n Use regular expressions, one per line.
\n Lines starting with a # will be ignored.
\n For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
\n MD5 filtering uses exact string matching, not regular expressions.\n

\n
    You can use these settings with each regular expression, separate them with semicolons:\n
  • \n Per boards, separate them with commas. It is global if not specified.
    \n For example: boards:a,jp;.\n
  • \n
  • \n Filter OPs only along with their threads (`only`), replies only (`no`), or both (`yes`, this is default).
    \n For example: op:only;, op:no; or op:yes;.\n
  • \n
  • \n Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
    \n For example: stub:yes; or stub:no;.\n
  • \n
  • \n Highlight instead of hiding. You can specify a class name to use with a userstyle.
    \n For example: highlight; or highlight:wallpaper;.\n
  • \n
  • \n Highlighted OPs will have their threads put on top of board pages by default.
    \n For example: top:yes; or top:no;.\n
  • \n
"; + return div.innerHTML = "
Filter is disabled.

\nUse regular expressions, one per line.
\nLines starting with a # will be ignored.
\nFor example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
\nMD5 filtering uses exact string matching, not regular expressions.\n

    You can use these settings with each regular expression, separate them with semicolons:\n
  • \n Per boards, separate them with commas. It is global if not specified.
    \n For example: boards:a,jp;.\n
  • \n Filter OPs only along with their threads (`only`), replies only (`no`), or both (`yes`, this is default).
    \n For example: op:only;, op:no; or op:yes;.\n
  • \n Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
    \n For example: stub:yes; or stub:no;.\n
  • \n Highlight instead of hiding. You can specify a class name to use with a userstyle.
    \n For example: highlight; or highlight:wallpaper;.\n
  • \n Highlighted OPs will have their threads put on top of board pages by default.
    \n For example: top:yes; or top:no;.\n
"; }, sauce: function(section) { var sauce; - section.innerHTML = "
Sauce is disabled.
\n
Lines starting with a # will be ignored.
\n
You can specify a display text by appending ;text:[text] to the URL.
\n
    These parameters will be replaced by their corresponding values:\n
  • %TURL: Thumbnail URL.
  • \n
  • %URL: Full image URL.
  • \n
  • %MD5: MD5 hash.
  • \n
  • %board: Current board.
  • \n
\n"; + section.innerHTML = "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
    These parameters will be replaced by their corresponding values:\n
  • %TURL: Thumbnail URL.
  • %URL: Full image URL.
  • %MD5: MD5 hash.
  • %board: Current board.
"; sauce = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { return sauce.value = item['sauces']; }); return $.on(sauce, 'change', $.cb.value); }, - rice: function(section) { + advanced: function(section) { var archiver, event, input, inputs, items, name, toSelect, _i, _j, _len, _len1, _ref; - section.innerHTML = "
\n Archiver\n Select an Archiver for this board:\n \n
\n
\n Custom Board Navigation is disabled.\n
\n
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
\n
\n For example:
\n [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
\n [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
\n
Board link: board
\n
Title link: board-title
\n
Board link (Replace with title when on that board): board-replace
\n
Full text link: board-full
\n
Custom text link: board-text:\"VIP Board\"
\n
Index-only link: board-index
\n
Catalog-only link: board-catalog
\n
Combinations are possible: board-index-text:\"VIP Index\"
\n
Full board list toggle: toggle-all
\n
\n\n
\n Time Formatting is disabled.\n
:
\n \n
Day: %a, %A, %d, %e
\n
Month: %m, %b, %B
\n
Year: %y
\n
Hour: %k, %H, %l, %I, %p, %P
\n
Minute: %M
\n
Second: %S
\n
\n\n
\n Quote Backlinks formatting is disabled.\n
:
\n
\n\n
\n File Info Formatting is disabled.\n
:
\n
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
\n
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
\n
Spoiler indicator: %p
\n
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
\n
Resolution: %r (Displays 'PDF' for PDF files)
\n
\n\n
\n Unread Favicon is disabled.\n \n \n
\n\n
\n Custom CSS\n \n \n
"; + section.innerHTML = "
Archiver
\n Select an Archiver for this board:\n
Custom Board Navigation is disabled.
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
\n For example:
[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
Board link: board
Title link: board-title
Board link (Replace with title when on that board): board-replace
Full text link: board-full
Custom text link: board-text:\"VIP Board\"
Index-only link: board-index
Catalog-only link: board-catalog
Combinations are possible: board-index-text:\"VIP Index\"
Full board list toggle: toggle-all
Time Formatting is disabled.
:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Unread Favicon is disabled.
Emoji is disabled.
\n Sage Icon:
\n Position:
Thread Updater is disabled.
\n Interval:
Custom CSS
"; items = {}; inputs = {}; - _ref = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss']; + _ref = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'emojiPos', 'sageEmoji', 'usercss']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { name = _ref[_i]; input = $("[name='" + name + "']", section); items[name] = Conf[name]; inputs[name] = input; - event = ['favicon', 'usercss'].contains(name) ? 'change' : 'input'; + event = ['favicon', 'usercss', 'sageEmoji', 'emojiPos'].contains(name) ? 'change' : 'input'; $.on(input, event, $.cb.value); } archiver = $('select[name=archiver]', section); @@ -12924,15 +13271,17 @@ for (key in items) { val = items[key]; + if (['usercss', 'emojiPos', 'archiver'].contains(key)) { + continue; + } input = inputs[key]; input.value = val; - if ('usercss' !== name) { - $.on(input, event, Settings[key]); - Settings[key].call(input); - } + $.on(input, event, Settings[key]); + Settings[key].call(input); } + return Rice.nodes(sectionreturn); }); - Rice.nodes(section); + $.on($('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval); $.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss); return $.on($.id('apply-css'), 'click', Settings.usercss); }, @@ -12946,7 +13295,7 @@ return this.nextElementSibling.textContent = funk(Time, new Date()); }, backlink: function() { - return this.nextElementSibling.textContent = Conf['backlink'].replace(/%id/, '123456789'); + return this.nextElementSibling.textContent = this.value.replace(/%id/, '123456789'); }, fileInfo: function() { var data, funk; @@ -12971,7 +13320,10 @@ if (g.VIEW === 'thread' && Conf['Unread Favicon']) { Unread.update(); } - return this.nextElementSibling.innerHTML = "\n\n\n"; + return $.id('favicon-preview').innerHTML = "\n\n\n"; + }, + sageEmoji: function() { + return $.id('sageicon-preview').innerHTML = ""; }, togglecss: function() { if ($('textarea', this.parentNode.parentNode).disabled = !this.checked) { @@ -12987,7 +13339,7 @@ keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; - section.innerHTML = "
Keybinds are disabled.
\n
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
\n
Press Backspace to disable a keybind.
\n\n \n
ActionsKeybinds
"; + section.innerHTML = "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
"; tbody = $('tbody', section); items = {}; inputs = {}; @@ -13640,6 +13992,9 @@ 'Settings': Settings, 'Announcement Hiding': PSAHiding, 'Fourchan thingies': Fourchan, + 'Emoji': Emoji, + 'Color User IDs': IDColor, + 'Remove Spoilers': RemoveSpoilers, 'Custom CSS': CustomCSS, 'Linkify': Linkify, 'Resurrect Quotes': Quotify, @@ -13739,7 +14094,11 @@ Main.handleErrors(errors); } Main.callbackNodes(Thread, threads); - Main.callbackNodes(Post, posts); + Main.callbackNodesDB(Post, posts, function() { + $.event('4chanXInitFinished'); + return Main.checkUpdate(); + }); + return; } $.event('4chanXInitFinished'); return Main.checkUpdate(); @@ -13771,6 +14130,63 @@ return Main.handleErrors(errors); } }, + callbackNodesDB: function(klass, nodes, cb) { + var errors, func, i, len, node, queue, softTask; + + queue = []; + softTask = function() { + var args, func, task; + + task = queue.shift(); + func = task[0]; + args = Array.prototype.slice.call(task, 1); + func.apply(func, args); + if (!queue.length) { + return; + } + if ((queue.length % 7) === 0) { + return setTimeout(softTask, 0); + } else { + return softTask(); + } + }; + len = nodes.length; + i = 0; + errors = null; + func = function(node, i) { + var callback, err, _i, _len, _ref; + + _ref = klass.prototype.callbacks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + callback = _ref[_i]; + try { + callback.cb.call(node); + } catch (_error) { + err = _error; + if (!errors) { + errors = []; + } + errors.push({ + message: "\"" + callback.name + "\" crashed on " + klass.name + " No." + node + " (/" + node.board + "/).", + error: err + }); + } + } + if (i === len) { + if (errors) { + Main.handleErrors(errors); + } + if (cb) { + return cb(); + } + } + }; + while (i < len) { + node = nodes[i]; + queue.push([func, node, ++i]); + } + return softTask(); + }, addCallback: function(e) { var Klass, obj; diff --git a/builds/appchan-x.meta.js b/builds/appchan-x.meta.js index e69de29bb..1a1a3cff5 100644 --- a/builds/appchan-x.meta.js +++ b/builds/appchan-x.meta.js @@ -0,0 +1,19 @@ +// ==UserScript== +// @name appchan x +// @version 2.0.0 +// @namespace zixaphir +// @description The most comprehensive 4chan userscript. +// @license MIT; https://github.com/zixaphir/appchan-x/blob/Av2/LICENSE +// @match *://api.4chan.org/* +// @match *://boards.4chan.org/* +// @match *://images.4chan.org/* +// @match *://sys.4chan.org/* +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_deleteValue +// @grant GM_openInTab +// @run-at document-start +// @updateURL https://github.com/zixaphir/appchan-x/raw/stable/builds/4chan_X.meta.js +// @downloadURL https://github.com/zixaphir/appchan-x/raw/stable/builds/4chan_X.user.js +// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEX///8EZgR8ulSk0oT///8EAgQ1A88mAAAAAXRSTlMAQObYZgAAAIpJREFUeF6t0sENwjAMhWF84N4H6gAYMUBkdQMYwfuvwmstEeD4kl892P0OaaWcpga2/K0SGII1HNBXARgu7veoY3ANd+esgMHZIz85u0EABrbms3pl/bkC1Tn5ihGOfQwqHeZ/FdYdirEMgCG2ZAQWDTL0m9FvjAhcvoGNAK2gZhGYYX9+ZgFm9gaiNmNkMENY4QAAAABJRU5ErkJggg== +// ==/UserScript== diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index db51bfaaf..6daaae5b3 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -3,8 +3,7 @@ // @version 2.0.0 // @namespace zixaphir // @description The most comprehensive 4chan userscript. -// @copyright 2012-2013 Zixaphir -// @license MIT; http://en.wikipedia.org/wiki/Mit_license +// @license MIT; https://github.com/zixaphir/appchan-x/blob/Av2/LICENSE // @match *://api.4chan.org/* // @match *://boards.4chan.org/* // @match *://images.4chan.org/* @@ -14,35 +13,102 @@ // @grant GM_deleteValue // @grant GM_openInTab // @run-at document-start -// @updateURL http://zixaphir.github.com/appchan-x/builds/appchan-x.meta.js -// @downloadURL http://zixaphir.github.com/appchan-x/builds/appchan-x.user.js +// @updateURL https://github.com/zixaphir/appchan-x/raw/stable/builds/4chan_X.meta.js +// @downloadURL https://github.com/zixaphir/appchan-x/raw/stable/builds/4chan_X.user.js // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEX///8EZgR8ulSk0oT///8EAgQ1A88mAAAAAXRSTlMAQObYZgAAAIpJREFUeF6t0sENwjAMhWF84N4H6gAYMUBkdQMYwfuvwmstEeD4kl892P0OaaWcpga2/K0SGII1HNBXARgu7veoY3ANd+esgMHZIz85u0EABrbms3pl/bkC1Tn5ihGOfQwqHeZ/FdYdirEMgCG2ZAQWDTL0m9FvjAhcvoGNAK2gZhGYYX9+ZgFm9gaiNmNkMENY4QAAAABJRU5ErkJggg== // ==/UserScript== -/* appchan x - Version 2.0.0 - 2013-04-23 - * http://zixaphir.github.com/appchan-x/ - * - * Copyright (c) 2009-2011 James Campos - * Copyright (c) 2012-2013 Nicolas Stepien - * Licensed under the MIT license. - * https://github.com/zixaphir/appchan-x/blob/master/LICENSE - * - * Contributors: - * https://github.com/zixaphir/appchan-x/graphs/contributors - * Non-GitHub contributors: - * ferongr, xat-, Ongpot, thisisanon and Anonymous - favicon contributions - * e000 - cooldown sanity check - * Seiba - chrome quick reply focusing - * herpaderpderp - recaptcha fixes - * WakiMiko - recaptcha tab order http://userscripts.org/scripts/show/82657 - * - * All the people who've taken the time to write bug reports. - * - * Thank you. - */ +/* +* appchan x - Version 2.0.0 - 2013-04-28 +* +* Licensed under the MIT license. +* https://github.com/zixaphir/appchan-x/blob/master/LICENSE +* +* Appchan X Copyright © 2013-2013 Zixaphir +* http://zixaphir.github.io/appchan-x/ +* 4chan x Copyright © 2009-2011 James Campos +* https://github.com/aeosynth/4chan-x +* 4chan x Copyright © 2012-2013 Nicolas Stepien +* https://4chan-x.just-believe.in/ +* 4chan x Copyright © 2013-2013 Jordan Bates +* http://seaweedchan.github.io/4chan-x/ +* 4chan x Copyright © 2012-2013 ihavenoface +* http://ihavenoface.github.io/4chan-x/ +* 4chan SS Copyright © 2011-2013 Ahodesuka +* https://github.com/ahodesuka/4chan-Style-Script/ +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Contributors: +* aeosynth +* mayhemydg +* noface +* !K.WeEabo0o +* blaise +* that4chanwolf +* desuwa +* seaweed +* e000 +* ahodesuka +* Shou +* ferongr +* xat +* Ongpot +* thisisanon +* Anonymous +* Seiba +* herpaderpderp +* WakiMiko +* btmcsweeney +* AppleBloom +* +* All the people who've taken the time to write bug reports. +* +* Thank you. +*/ +/* +* Contains data from external sources: +* +* audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/ +* cc-by-nc-3.0 +* +* 4chan/4chan-JS (https://github.com/4chan/4chan-JS) +* Copyright (c) 2012-2013, 4chan LLC +* All rights reserved. +* +* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE +* +* Linkify: (http://userscripts.org/scripts/show/1352) +* Copyright (c) 2011, Anthony Lieuallen +* All rights reserved. +* Originally written by Anthony Lieuallen of http://arantius.com/ +* Licensed for unlimited modification and redistribution as long as +* this notice is kept intact. +* +* license: http://userscripts.org/scripts/review/1352 +* +*/ (function() { - var $, $$, Anonymize, ArchiveLink, Banner, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, GlobalMessage, Header, Icons, ImageExpand, ImageHover, ImageReplace, JSColor, Keybinds, Linkify, Main, MascotTools, Mascots, Menu, MutationObserver, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, Report, ReportLink, RevealSpoilers, Rice, Sauce, Settings, Style, ThemeTools, Themes, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, editMascot, editTheme, g, userNavigation, + var $, $$, Anonymize, ArchiveLink, Banner, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, GlobalMessage, Header, IDColor, Icons, ImageExpand, ImageHover, ImageReplace, JSColor, Keybinds, Linkify, Main, MascotTools, Mascots, Menu, MutationObserver, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Rice, Sauce, Settings, Style, ThemeTools, Themes, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, editMascot, editTheme, g, userNavigation, __slice = [].slice, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; @@ -52,7 +118,6 @@ 'Miscellaneous': { 'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], 'External Catalog': [false, 'Link to external catalog instead of the internal one.'], - 'Custom Board Navigation': [false, 'Show custom links instead of the full board list.'], 'QR Shortcut': [false, 'Adds a small [QR] link in the header.'], 'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'], '404 Redirect': [true, 'Redirect dead threads and images.'], @@ -64,7 +129,11 @@ 'Thread Expansion': [true, 'Add buttons to expand threads.'], 'Index Navigation': [false, 'Add buttons to navigate between threads.'], 'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'], - 'Check for Updates': [true, 'Check for updated versions of appchan x.'] + 'Check for Updates': [true, 'Check for updated versions of appchan x.'], + 'Emoji': [false, 'Adds icons next to names for different emails'], + 'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'], + 'Remove Spoilers': [false, 'Remove all spoilers in text.'], + 'Indicate Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled.'] }, 'Linkification': { 'Linkify': [true, 'Convert text into links where applicable.'], @@ -101,7 +170,7 @@ 'Monitoring': { 'Thread Updater': [true, 'Fetch and insert new replies. Has more options in its own dialog.'], 'Unread Count': [true, 'Show the unread posts count in the tab title.'], - 'Hide Unread Count at (0)': [false, 'Hide the unread posts count when it reaches 0.'], + 'Hide Unread Count at (0)': [false, 'Hide the unread posts count in the tab title when it reaches 0.'], 'Unread Favicon': [true, 'Show a different favicon when there are unread posts.'], 'Unread Line': [true, 'Show a line to distinguish read posts from unread ones.'], 'Scroll to Last Read Post': [true, 'Scroll back to the last read post when reopening a thread.'], @@ -121,7 +190,8 @@ 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], 'Remember QR Size': [false, 'Remember the size of the quick reply\'s comment field.'], 'Hide Original Post Form': [true, 'Hide the normal post form.'], - 'Cooldown': [true, 'Prevent "flood detected" errors.'] + 'Cooldown': [true, 'Indicate the remaining time before posting again.'], + 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'] }, 'Quote Links': { 'Quote Backlinks': [true, 'Add quote backlinks.'], @@ -132,6 +202,7 @@ 'Quote Highlighting': [true, 'Highlight the previewed post.'], 'Resurrect Quotes': [true, 'Link dead quotes to the archives.'], 'Mark Quotes of You': [true, 'Add \'(You)\' to quotes linking to your posts.'], + 'Highlight Own Posts': [false, 'Highlights own posts if Mark Quotes of You is enabled.'], 'Mark OP Quotes': [true, 'Add \'(OP)\' to OP quotes.'], 'Mark Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes.'], 'Quote Threading': [false, 'Thread conversations'] @@ -161,8 +232,7 @@ '4chan Banner Reflection': [false, 'Adds reflection effects to 4chan\'s image banner.'], 'Faded 4chan Banner': [true, 'Make 4chan\'s image banner translucent.'], 'Icon Orientation': ['horizontal', 'Change the orientation of the appchan x icons.', ['horizontal', 'vertical']], - 'Slideout Watcher': [true, 'Adds an icon you can hover over to show the watcher, as opposed to having the watcher always visible.'], - 'Updater Position': ['top', 'The position of 4chan thread updater and stats', ['top', 'bottom', 'moveable']] + 'Slideout Watcher': [true, 'Adds an icon you can hover over to show the watcher, as opposed to having the watcher always visible.'] }, Posts: { 'Alternate Post Colors': [false, 'Make post background colors alternate every other post.'], @@ -246,10 +316,18 @@ MD5: '' }, sauces: "https://www.google.com/searchbyimage?image_url=%TURL\nhttp://iqdb.org/?url=%TURL\n#//tineye.com/search?url=%TURL\n#http://saucenao.com/search.php?url=%TURL\n#http://3d.iqdb.org/?url=%TURL\n#http://regex.info/exif.cgi?imgurl=%URL\n# uploaders:\n#http://imgur.com/upload?url=%URL;text:Upload to imgur\n#http://ompldr.org/upload?url1=%URL;text:Upload to ompldr\n# \"View Same\" in archives:\n#//archive.foolz.us/_/search/image/%MD5/;text:View same on foolz\n#//archive.foolz.us/%board/search/image/%MD5/;text:View same on foolz /%board/\n#//archive.installgentoo.net/%board/image/%MD5;text:View same on installgentoo /%board/", + 'sageEmoji': 'appchan', + 'emojiPos': 'before', 'Custom CSS': false, - 'Boards Navigation': 'Sticky top', - 'Header auto-hide': false, - 'Header catalog links': false, + Header: { + 'Fixed Header': true, + 'Header auto-hide': false, + 'Bottom Header': false, + 'Hide Header': false, + 'Header catalog links': false, + 'Bottom Board List': true, + 'Custom Board Navigation': true + }, boardnav: '[ toggle-all ] [current-title]', time: '%m/%d/%y(%a)%H:%M:%S', backlink: '>>%id', @@ -258,15 +336,17 @@ usercss: "/* Tripcode Italics: */\n/*\nspan.postertrip {\nfont-style: italic;\n}\n*/\n\n/* Add a rounded border to thumbnails (but not expanded images): */\n/*\n.fileThumb > img:first-child {\nborder: solid 2px rgba(0,0,100,0.5);\nborder-radius: 10px;\n}\n*/\n\n/* Make highlighted posts look inset on the page: */\n/*\ndiv.post:target,\ndiv.post.highlight {\nbox-shadow: inset 2px 2px 2px rgba(0,0,0,0.2);\n}\n*/", hotkeys: { 'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'], - 'Open empty QR': ['l', 'Open QR without post number inserted.'], - 'Open QR': ['Shift+l', 'Open QR with post number inserted.'], + 'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'], + 'Open empty QR': ['i', 'Open QR without post number inserted.'], + 'Open QR': ['Shift+i', 'Open QR with post number inserted.'], 'Open settings': ['Alt+o', 'Open Settings.'], 'Close': ['Esc', 'Close Settings, Notifications or QR.'], 'Spoiler tags': ['Ctrl+s', 'Insert spoiler tags.'], 'Code tags': ['Alt+c', 'Insert code tags.'], 'Eqn tags': ['Alt+e', 'Insert eqn tags.'], 'Math tags': ['Alt+m', 'Insert math tags.'], - 'Submit QR': ['Alt+s', 'Submit post.'], + 'Toggle sage': ['Alt+s', 'Toggle sage in email field'], + 'Submit QR': ['Ctrl+Enter', 'Submit post.'], 'Watch': ['w', 'Watch thread.'], 'Update': ['r', 'Update the thread now.'], 'Expand image': ['Shift+e', 'Expand selected image.'], @@ -276,6 +356,7 @@ 'Open front page': ['Shift+0', 'Open page 0 in a new tab.'], 'Next page': ['Right', 'Jump to the next page.'], 'Previous page': ['Left', 'Jump to the previous page.'], + 'Open catalog': ['Shift+c', 'Open the catalog of the current board'], 'Next thread': ['Down', 'See next thread.'], 'Previous thread': ['Up', 'See previous thread.'], 'Expand thread': ['Ctrl+e', 'Expand thread.'], @@ -2437,6 +2518,59 @@ "4chan SS": 'iVBORw0KGgoAAAANSUhEUgAAAA8AAACWCAMAAAA2YSLzAAAAPFBMVEVkZGRlZWVjY2NmZmZnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dZxmG7AAAAE3RSTlMFFQ0AJD8eQFRqf5CgssDM4+73gHqZRAAAA0pJREFUSMetVlmy5CgMZDMGxK7737Ulgcu8ejMREzHtD7sShJRaKWV/Psq3iz7QGwTF2BZ01hp3N6yasctZJANiN5ZlItDLtNkQDGNeMLU7EqmCbUwhkhZbwsIuNbyWPX7dIyHOrDYOc8SOiEUJjojN0EsWlCXRrq2qvJCsIjic2OcFrwrOpdmTimqVyWG7ZkrWy97p7z/hACd2FUetBcQDpTN+nuKsGng881L5xOz/VQ88xL/eQkyZT3axp+4dUMwvH0Pnhn6wSyR+8IdR4f43/v8XX1BHjXpjwy5RdEcQ7DiuzlBUsFD+GeIFEy6W0pKXoSZOiUz5tf99nvTDD/1sP9VRPvb/un86lT57SVqwSk8KR+L6kgTOlcZslRQe5WmJRKovETW7Anb+HzxUW4Xgnv11fuuj82aKXHz1Tzztx9v4VA9+/6le26B+3VhTC9RMPIr0qx4zaWNsnFRO0s8FWgEIFIRiVUAIlJGciqMmCwpQWyI/OplXA1RrXG1YI2svTQ3ufhWjNlKFqtXFI7Yg+zAXRcBZ+HygJuVHd0ys35bVn6QojLL5cZeVvPht/mVu/r/8s7GMXsLjv2s71GZhgjnEwsEVXogiSl/pl7LWra0IQgO3poTsieoYd4dhWfJlGWqyQf6sLxWt3/MRa4Im04ixeSdAWnxvqCX6tObVmzpZOPOZvrBNJF8gmGciBChsV+YdRYwnAvNpS4AnYFBm0KA2a35Unh+efxjercaLfV7wW0rtUTNl2j715al/9VtfutF+NZ/+aZSa+py/GCpRyvr17EsVLbRhmN++BBY/ik5/+YPK6bKnf2T8fh7P+uEYn0D3E4L3i6QHmvc3+k+8PN6Mb1w52tje6LbAi+M0FT4YneqVbpVDPnL2Xqx7m3tf9ENXHba9H/a/+X3z/+XfCnOo+Zy/o4SgY5Z6iq0nb+9Mc4JxL5f1qYs+xhTP/uiX/cMe4+hDHAfGnmGe+Ev+G88vnG7Ie20wHiUt/S1Kv+6BCM/9fkEfz73/9HNufQ4ZKdzvnwtS/LXltRcJB/yJ23H/mo89nPFa85Li3XOYu435LwTXKVWwO+cnlWFTB47L/AdfR//KI2bvF8sAb0c/M+1+YE3/oS77B8N+UUVHraV6AAAAAElFTkSuQmCC' }; + String.prototype.capitalize = function() { + return this.charAt(0).toUpperCase() + this.slice(1); + }; + + String.prototype.contains = function(string) { + return this.indexOf(string) > -1; + }; + + Array.prototype.add = function(object, position) { + var keep; + + keep = this.slice(position); + this.length = position; + this.push(object); + return this.pushArrays(keep); + }; + + Array.prototype.contains = function(object) { + return this.indexOf(object) > -1; + }; + + Array.prototype.indexOf = function(object) { + var i; + + i = this.length; + while (i--) { + if (this[i] === object) { + break; + } + } + return i; + }; + + Array.prototype.pushArrays = function() { + var arg, args, _i, _len; + + args = arguments; + for (_i = 0, _len = args.length; _i < _len; _i++) { + arg = args[_i]; + this.push.apply(this, arg); + } + }; + + Array.prototype.remove = function(object) { + var index; + + if ((index = this.indexOf(object)) > -1) { + return this.splice(index, 1); + } else { + return false; + } + }; + $ = function(selector, root) { if (root == null) { root = d.body; @@ -2444,15 +2578,6 @@ return root.querySelector(selector); }; - $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))); - - $$ = function(selector, root) { - if (root == null) { - root = d.body; - } - return __slice.call(root.querySelectorAll(selector)); - }; - $.extend = function(object, properties) { var key, val; @@ -2465,609 +2590,439 @@ } }; - $.extend(Array.prototype, { - add: function(object, position) { - var keep; + $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))); - keep = this.slice(position); - this.length = position; - this.push(object); - return this.pushArrays(keep); - }, - contains: function(object) { - return this.indexOf(object) > -1; - }, - indexOf: function(object) { - var i; + $.id = function(id) { + return d.getElementById(id); + }; - i = this.length; - while (i--) { - if (this[i] === object) { - break; - } + $.ready = function(fc) { + var cb, _ref; + + if ((_ref = d.readyState) === 'interactive' || _ref === 'complete') { + $.queueTask(fc); + return; + } + cb = function() { + $.off(d, 'DOMContentLoaded', cb); + return fc(); + }; + return $.on(d, 'DOMContentLoaded', cb); + }; + + $.formData = function(form) { + var fd, key, val; + + if (form instanceof HTMLFormElement) { + return new FormData(form); + } + fd = new FormData(); + for (key in form) { + val = form[key]; + if (!val) { + continue; } - return i; - }, - pushArrays: function() { - var arg, args, _i, _len; - - args = arguments; - for (_i = 0, _len = args.length; _i < _len; _i++) { - arg = args[_i]; - this.push.apply(this, arg); - } - }, - remove: function(object) { - var index; - - if ((index = this.indexOf(object)) > -1) { - return this.splice(index, 1); + if (val.size && val.name) { + fd.append(key, val, val.name); } else { - return false; + fd.append(key, val); } } - }); + return fd; + }; - $.extend(String.prototype, { - capitalize: function() { - return this.charAt(0).toUpperCase() + this.slice(1); - }, - contains: function(string) { - return this.indexOf(string) > -1; + $.ajax = function(url, callbacks, opts) { + var cred, form, headers, key, r, sync, type, upCallbacks, val; + + if (opts == null) { + opts = {}; } - }); + type = opts.type, cred = opts.cred, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form, sync = opts.sync; + r = new XMLHttpRequest(); + r.overrideMimeType('text/html'); + type || (type = form && 'post' || 'get'); + r.open(type, url, !sync); + for (key in headers) { + val = headers[key]; + r.setRequestHeader(key, val); + } + $.extend(r, callbacks); + $.extend(r.upload, upCallbacks); + r.withCredentials = cred; + r.send(form); + return r; + }; - $.extend($, { - id: function(id) { - return d.getElementById(id); - }, - ready: function(fc) { - var cb, _ref; + $.cache = (function() { + var reqs; - if ((_ref = d.readyState) === 'interactive' || _ref === 'complete') { - $.queueTask(fc); + reqs = {}; + return function(url, cb) { + var req, rm; + + if (req = reqs[url]) { + if (req.readyState === 4) { + cb.call(req); + } else { + req.callbacks.push(cb); + } return; } - cb = function() { - $.off(d, 'DOMContentLoaded', cb); - return fc(); + rm = function() { + return delete reqs[url]; }; - return $.on(d, 'DOMContentLoaded', cb); - }, - formData: function(form) { - var fd, key, val; + req = $.ajax(url, { + onload: function(e) { + var _i, _len, _ref; - if (form instanceof HTMLFormElement) { - return new FormData(form); - } - fd = new FormData(); - for (key in form) { - val = form[key]; - if (!val) { - continue; - } - if (val.size && val.name) { - fd.append(key, val, val.name); - } else { - fd.append(key, val); - } - } - return fd; - }, - ajax: function(url, callbacks, opts) { - var cred, form, headers, key, r, sync, type, upCallbacks, val; - - if (opts == null) { - opts = {}; - } - type = opts.type, cred = opts.cred, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form, sync = opts.sync; - r = new XMLHttpRequest(); - r.overrideMimeType('text/html'); - type || (type = form && 'post' || 'get'); - r.open(type, url, !sync); - for (key in headers) { - val = headers[key]; - r.setRequestHeader(key, val); - } - $.extend(r, callbacks); - $.extend(r.upload, upCallbacks); - r.withCredentials = cred; - r.send(form); - return r; - }, - cache: (function() { - var reqs; - - reqs = {}; - return function(url, cb) { - var req, rm; - - if (req = reqs[url]) { - if (req.readyState === 4) { - cb.call(req); - } else { - req.callbacks.push(cb); + _ref = this.callbacks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + cb = _ref[_i]; + cb.call(this, e); } - return; - } - rm = function() { - return delete reqs[url]; - }; - req = $.ajax(url, { - onload: function(e) { - var _i, _len, _ref; - - _ref = this.callbacks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - cb = _ref[_i]; - cb.call(this, e); - } - return delete this.callbacks; - }, - onabort: rm, - onerror: rm - }); - req.callbacks = [cb]; - return reqs[url] = req; - }; - })(), - cb: { - checked: function() { - $.set(this.name, this.checked); - return Conf[this.name] = this.checked; - }, - value: function() { - $.set(this.name, this.value.trim()); - return Conf[this.name] = this.value; - } - }, - asap: function(test, cb) { - if (test()) { - return cb(); - } else { - return setTimeout($.asap, 25, test, cb); - } - }, - addStyle: function(css, id) { - var style; - - style = $.el('style', { - id: id, - textContent: css + return delete this.callbacks; + }, + onabort: rm, + onerror: rm }); - $.asap((function() { - return d.head; - }), function() { - return $.add(d.head, style); - }); - return style; - }, - x: function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, 8, null).singleNodeValue; - }, - X: function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); - }, - addClass: function(el, className) { - return el.classList.add(className); - }, - rmClass: function(el, className) { - return el.classList.remove(className); - }, - toggleClass: function(el, className) { - return el.classList.toggle(className); - }, - hasClass: function(el, className) { - return el.classList.contains(className); - }, - rm: (function() { - if ('remove' in Element.prototype) { - return function(el) { - return el.remove(); - }; - } else { - return function(el) { - var _ref; + req.callbacks = [cb]; + return reqs[url] = req; + }; + })(); - return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; - }; - } - })(), - rmAll: function(root) { - var node; - - while (node = root.firstChild) { - root.removeChild(node); - } + $.cb = { + checked: function() { + $.set(this.name, this.checked); + return Conf[this.name] = this.checked; }, - tn: function(s) { - return d.createTextNode(s); - }, - frag: function() { - return d.createDocumentFragment(); - }, - nodes: function(nodes) { - var frag, node, _i, _len; - - if (!(nodes instanceof Array)) { - return nodes; - } - frag = $.frag(); - for (_i = 0, _len = nodes.length; _i < _len; _i++) { - node = nodes[_i]; - frag.appendChild(node); - } - return frag; - }, - add: function(parent, el) { - return parent.appendChild($.nodes(el)); - }, - prepend: function(parent, el) { - return parent.insertBefore($.nodes(el), parent.firstChild); - }, - after: function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root.nextSibling); - }, - before: function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root); - }, - replace: function(root, el) { - return root.parentNode.replaceChild($.nodes(el), root); - }, - el: function(tag, properties) { - var el; - - el = d.createElement(tag); - if (properties) { - $.extend(el, properties); - } - return el; - }, - on: function(el, events, handler) { - var event, _i, _len, _ref; - - _ref = events.split(' '); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - event = _ref[_i]; - el.addEventListener(event, handler, false); - } - }, - off: function(el, events, handler) { - var event, _i, _len, _ref; - - _ref = events.split(' '); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - event = _ref[_i]; - el.removeEventListener(event, handler, false); - } - }, - event: function(event, detail, root) { - if (root == null) { - root = d; - } - return root.dispatchEvent(new CustomEvent(event, { - bubbles: true, - detail: detail - })); - }, - open: (function() { - if (typeof GM_openInTab !== "undefined" && GM_openInTab !== null) { - return function(URL) { - var a; - - a = $.el('a', { - href: URL - }); - return GM_openInTab(a.href); - }; - } else { - return function(URL) { - return window.open(URL, '_blank'); - }; - } - })(), - debounce: function(wait, fn) { - var args, exec, that, timeout; - - timeout = null; - that = null; - args = null; - exec = function() { - fn.apply(that, args); - return timeout = null; - }; - return function() { - args = arguments; - that = this; - if (timeout) { - clearTimeout(timeout); - } else { - exec(); - } - return timeout = setTimeout(exec, wait); - }; - }, - queueTask: (function() { - var execTask, taskChannel, taskQueue; - - taskQueue = []; - execTask = function() { - var args, func, task; - - task = taskQueue.shift(); - func = task[0]; - args = Array.prototype.slice.call(task, 1); - return func.apply(func, args); - }; - if (window.MessageChannel) { - taskChannel = new MessageChannel(); - taskChannel.port1.onmessage = execTask; - return function() { - taskQueue.push(arguments); - return taskChannel.port2.postMessage(null); - }; - } else { - return function() { - taskQueue.push(arguments); - return setTimeout(execTask, 0); - }; - } - })(), - globalEval: function(code) { - var script; - - script = $.el('script', { - textContent: code - }); - $.add(d.head || doc, script); - return $.rm(script); - }, - bytesToString: function(size) { - var unit; - - unit = 0; - while (size >= 1024) { - size /= 1024; - unit++; - } - size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); - return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit]; - }, - minmax: function(value, min, max) { - return (value < min ? min : value > max ? max : value); - }, - syncing: {}, - sync: (function() { - window.addEventListener('storage', function(e) { - var cb; - - if (cb = $.syncing[e.key]) { - return cb(JSON.parse(e.newValue)); - } - }, false); - return function(key, cb) { - return $.syncing[g.NAMESPACE + key] = cb; - }; - })(), - item: function(key, val) { - var item; - - item = {}; - item[key] = val; - return item; - }, - "delete": function(keys) { - var key, _i, _len; - - if (!(keys instanceof Array)) { - keys = [keys]; - } - for (_i = 0, _len = keys.length; _i < _len; _i++) { - key = keys[_i]; - key = g.NAMESPACE + key; - localStorage.removeItem(key); - GM_deleteValue(key); - } - }, - get: function(key, val, cb) { - var items; - - if (typeof cb === 'function') { - items = $.item(key, val); - } else { - items = key; - cb = val; - } - return $.queueTask(function() { - for (key in items) { - if (val = GM_getValue(g.NAMESPACE + key)) { - items[key] = JSON.parse(val); - } - } - return cb(items); - }); - }, - set: (function() { - var set; - - set = function(key, val) { - key = g.NAMESPACE + key; - val = JSON.stringify(val); - if (key in $.syncing) { - localStorage.setItem(key, val); - } - return GM_setValue(key, val); - }; - return function(keys, val) { - var key; - - if (typeof keys === 'string') { - set(keys, val); - return; - } - for (key in keys) { - val = keys[key]; - set(key, val); - } - }; - })() - }); - - Build = { - spoilerRange: {}, - shortFilename: function(filename, isReply) { - var threshold; - - threshold = isReply ? 30 : 40; - if (filename.length - 4 > threshold) { - return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); - } else { - return filename; - } - }, - postFromObject: function(data, boardID) { - var o; - - o = { - postID: data.no, - threadID: data.resto || data.no, - boardID: boardID, - name: data.name, - capcode: data.capcode, - tripcode: data.trip, - uniqueID: data.id, - email: data.email ? encodeURI(data.email.replace(/"/g, '"')) : '', - subject: data.sub, - flagCode: data.country, - flagName: data.country_name, - date: data.now, - dateUTC: data.time, - comment: data.com, - isSticky: !!data.sticky, - isClosed: !!data.closed - }; - if (data.ext || data.filedeleted) { - o.file = { - name: data.filename + data.ext, - timestamp: "" + data.tim + data.ext, - url: "//images.4chan.org/" + boardID + "/src/" + data.tim + data.ext, - height: data.h, - width: data.w, - MD5: data.md5, - size: data.fsize, - turl: "//thumbs.4chan.org/" + boardID + "/thumb/" + data.tim + "s.jpg", - theight: data.tn_h, - twidth: data.tn_w, - isSpoiler: !!data.spoiler, - isDeleted: !!data.filedeleted - }; - } - return Build.post(o); - }, - post: function(o, isArchived) { - /* - This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS). - @license: https://github.com/4chan/4chan-JS/blob/master/LICENSE - */ - - var a, boardID, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; - - postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file; - isOP = postID === threadID; - staticPath = '//static.4chan.org'; - if (email) { - emailStart = ''; - emailEnd = ''; - } else { - emailStart = ''; - emailEnd = ''; - } - subject = "" + (subject || '') + ""; - userID = !capcode && uniqueID ? (" (ID: ") + ("" + uniqueID + ") ") : ''; - switch (capcode) { - case 'admin': - case 'admin_highlight': - capcodeClass = " capcodeAdmin"; - capcodeStart = " ## Admin"; - capcode = (" "; - break; - case 'mod': - capcodeClass = " capcodeMod"; - capcodeStart = " ## Mod"; - capcode = (" "; - break; - case 'developer': - capcodeClass = " capcodeDeveloper"; - capcodeStart = " ## Developer"; - capcode = (" "; - break; - default: - capcodeClass = ''; - capcodeStart = ''; - capcode = ''; - } - flag = flagCode ? ("  + flagCode + ") : ''; - if (file != null ? file.isDeleted : void 0) { - fileHTML = isOP ? ("
") + ("File deleted.") + "
" : ("
") + ("File deleted.") + "
"; - } else if (file) { - ext = file.name.slice(-3); - if (!file.twidth && !file.theight && ext === 'gif') { - file.twidth = file.width; - file.theight = file.height; - } - fileSize = $.bytesToString(file.size); - fileThumb = file.turl; - if (file.isSpoiler) { - fileSize = "Spoiler Image, " + fileSize; - if (!isArchived) { - fileThumb = '//static.4chan.org/image/spoiler'; - if (spoilerRange = Build.spoilerRange[boardID]) { - fileThumb += ("-" + boardID) + Math.floor(1 + spoilerRange * Math.random()); - } - fileThumb += '.png'; - file.twidth = file.theight = 100; - } - } - if (boardID.ID !== 'f') { - imgSrc = ("") + ("" + fileSize + ""); - } - a = $.el('a', { - innerHTML: file.name - }); - filename = a.textContent.replace(/%22/g, '"'); - a.textContent = Build.shortFilename(filename); - shortFilename = a.innerHTML; - a.textContent = filename; - filename = a.innerHTML.replace(/'/g, '''); - fileDims = ext === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height; - fileInfo = ("File: " + file.timestamp + "") + ("-(" + fileSize + ", " + fileDims + (file.isSpoiler ? '' : ", " + shortFilename + "")) + ")"; - fileHTML = "
" + fileInfo + "
" + imgSrc + "
"; - } else { - fileHTML = ''; - } - tripcode = tripcode ? " " + tripcode + "" : ''; - sticky = isSticky ? ' Sticky' : ''; - closed = isClosed ? ' Closed' : ''; - container = $.el('div', { - id: "pc" + postID, - className: "postContainer " + (isOP ? 'op' : 'reply') + "Container", - innerHTML: (isOP ? '' : "
>>
") + ("
") + ("' + (isOP ? fileHTML : '') + ("' + (isOP ? '' : fileHTML) + ("
" + (comment || '') + "
") + '
' - }); - _ref = $$('.quotelink', container); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; - href = quote.getAttribute('href'); - if (href[0] === '/') { - continue; - } - quote.href = "/" + boardID + "/res/" + href; - } - return container; + value: function() { + $.set(this.name, this.value.trim()); + return Conf[this.name] = this.value; } }; + $.asap = function(test, cb) { + if (test()) { + return cb(); + } else { + return setTimeout($.asap, 25, test, cb); + } + }; + + $.addStyle = function(css, id) { + var style; + + style = $.el('style', { + id: id, + textContent: css + }); + $.asap((function() { + return d.head; + }), function() { + return $.add(d.head, style); + }); + return style; + }; + + $.x = function(path, root) { + root || (root = d.body); + return d.evaluate(path, root, null, 8, null).singleNodeValue; + }; + + $.X = function(path, root) { + root || (root = d.body); + return d.evaluate(path, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); + }; + + $.addClass = function(el, className) { + return el.classList.add(className); + }; + + $.rmClass = function(el, className) { + return el.classList.remove(className); + }; + + $.toggleClass = function(el, className) { + return el.classList.toggle(className); + }; + + $.hasClass = function(el, className) { + return el.classList.contains(className); + }; + + $.rm = (function() { + if ('remove' in Element.prototype) { + return function(el) { + return el.remove(); + }; + } else { + return function(el) { + var _ref; + + return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; + }; + } + })(); + + $.rmAll = function(root) { + var node; + + while (node = root.firstChild) { + root.removeChild(node); + } + }; + + $.tn = function(s) { + return d.createTextNode(s); + }; + + $.frag = function() { + return d.createDocumentFragment(); + }; + + $.nodes = function(nodes) { + var frag, node, _i, _len; + + if (!(nodes instanceof Array)) { + return nodes; + } + frag = $.frag(); + for (_i = 0, _len = nodes.length; _i < _len; _i++) { + node = nodes[_i]; + frag.appendChild(node); + } + return frag; + }; + + $.add = function(parent, el) { + return parent.appendChild($.nodes(el)); + }; + + $.prepend = function(parent, el) { + return parent.insertBefore($.nodes(el), parent.firstChild); + }; + + $.after = function(root, el) { + return root.parentNode.insertBefore($.nodes(el), root.nextSibling); + }; + + $.before = function(root, el) { + return root.parentNode.insertBefore($.nodes(el), root); + }; + + $.replace = function(root, el) { + return root.parentNode.replaceChild($.nodes(el), root); + }; + + $.el = function(tag, properties) { + var el; + + el = d.createElement(tag); + if (properties) { + $.extend(el, properties); + } + return el; + }; + + $.on = function(el, events, handler) { + var event, _i, _len, _ref; + + _ref = events.split(' '); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + event = _ref[_i]; + el.addEventListener(event, handler, false); + } + }; + + $.off = function(el, events, handler) { + var event, _i, _len, _ref; + + _ref = events.split(' '); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + event = _ref[_i]; + el.removeEventListener(event, handler, false); + } + }; + + $.event = function(event, detail, root) { + if (root == null) { + root = d; + } + return root.dispatchEvent(new CustomEvent(event, { + bubbles: true, + detail: detail + })); + }; + + $.open = function(URL) { + return GM_openInTab(($.el('a', { + href: URL + })).href); + }; + + $.debounce = function(wait, fn) { + var args, exec, lastCall, that, timeout; + + lastCall = 0; + timeout = null; + that = null; + args = null; + exec = function() { + lastCall = Date.now(); + return fn.apply(that, args); + }; + return function() { + args = arguments; + that = this; + if (lastCall < Date.now() - wait) { + return exec(); + } + clearTimeout(timeout); + return timeout = setTimeout(exec, wait); + }; + }; + + $.queueTask = (function() { + var execTask, taskChannel, taskQueue; + + taskQueue = []; + execTask = function() { + var args, func, task; + + task = taskQueue.shift(); + func = task[0]; + args = Array.prototype.slice.call(task, 1); + return func.apply(func, args); + }; + if (window.MessageChannel) { + taskChannel = new MessageChannel(); + taskChannel.port1.onmessage = execTask; + return function() { + taskQueue.push(arguments); + return taskChannel.port2.postMessage(null); + }; + } else { + return function() { + taskQueue.push(arguments); + return setTimeout(execTask, 0); + }; + } + })(); + + $.globalEval = function(code) { + var script; + + script = $.el('script', { + textContent: code + }); + $.add(d.head || doc, script); + return $.rm(script); + }; + + $.bytesToString = function(size) { + var unit; + + unit = 0; + while (size >= 1024) { + size /= 1024; + unit++; + } + size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); + return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit]; + }; + + $.minmax = function(value, min, max) { + return (value < min ? min : value > max ? max : value); + }; + + $.syncing = {}; + + $.sync = (function() { + window.addEventListener('storage', function(e) { + var cb; + + if (cb = $.syncing[e.key]) { + return cb(JSON.parse(e.newValue)); + } + }, false); + return function(key, cb) { + return $.syncing[g.NAMESPACE + key] = cb; + }; + })(); + + $.item = function(key, val) { + var item; + + item = {}; + item[key] = val; + return item; + }; + + $["delete"] = function(keys) { + var key, _i, _len; + + if (!(keys instanceof Array)) { + keys = [keys]; + } + for (_i = 0, _len = keys.length; _i < _len; _i++) { + key = keys[_i]; + key = g.NAMESPACE + key; + localStorage.removeItem(key); + GM_deleteValue(key); + } + }; + + $.get = function(key, val, cb) { + var items; + + if (typeof cb === 'function') { + items = $.item(key, val); + } else { + items = key; + cb = val; + } + return $.queueTask(function() { + for (key in items) { + if (val = GM_getValue(g.NAMESPACE + key)) { + items[key] = JSON.parse(val); + } + } + return cb(items); + }); + }; + + $.set = (function() { + var set; + + set = function(key, val) { + key = g.NAMESPACE + key; + val = JSON.stringify(val); + if (key in $.syncing) { + localStorage.setItem(key, val); + } + return GM_setValue(key, val); + }; + return function(keys, val) { + var key; + + if (typeof keys === 'string') { + set(keys, val); + return; + } + for (key in keys) { + val = keys[key]; + set(key, val); + } + }; + })(); + + $$ = function(selector, root) { + if (root == null) { + root = d.body; + } + return __slice.call(root.querySelectorAll(selector)); + }; + Board = (function() { Board.prototype.toString = function() { return this.ID; @@ -3283,7 +3238,7 @@ if (!(strong = $('strong.warning', this.nodes.info))) { strong = $.el('strong', { className: 'warning', - textContent: '[Deleted]' + textContent: this.isReply ? '[Deleted]' : '[Dead]' }); $.after($('input', this.nodes.info), strong); } @@ -3552,7 +3507,7 @@ }); } now = Date.now(); - if ((this.data.lastChecked || 0) < now - 12 * $.HOUR) { + if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) { this.data.lastChecked = now; for (boardID in this.data.boards) { this.ajaxClean(boardID); @@ -3649,6 +3604,500 @@ })(); + Polyfill = { + init: function() { + return Polyfill.visibility(); + }, + visibility: function() { + var event, prefix, property; + + if ('visibilityState' in document || !(prefix = ('webkitVisibilityState' in document ? 'webkit' : 'mozVisibilityState' in document ? 'moz' : void 0))) { + return; + } + property = prefix + 'VisibilityState'; + event = prefix + 'visibilitychange'; + d.visibilityState = d[property]; + d.hidden = d.visibilityState === 'hidden'; + return $.on(d, event, function() { + d.visibilityState = d[property]; + d.hidden = d.visibilityState === 'hidden'; + return $.event('visibilitychange'); + }); + } + }; + + Header = { + init: function() { + var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, + _this = this; + + this.menu = new UI.Menu('header'); + this.menuButton = $.el('span', { + className: 'menu-button', + id: 'main-menu' + }); + barFixedToggler = $.el('label', { + innerHTML: ' Fixed Header' + }); + headerToggler = $.el('label', { + innerHTML: ' Auto-hide header' + }); + barPositionToggler = $.el('label', { + innerHTML: ' Bottom header' + }); + customNavToggler = $.el('label', { + innerHTML: ' Custom board navigation' + }); + footerToggler = $.el('label', { + innerHTML: " Hide bottom board list" + }); + editCustomNav = $.el('a', { + textContent: 'Edit custom board navigation', + href: 'javascript:;' + }); + this.barFixedToggler = barFixedToggler.firstElementChild; + this.barPositionToggler = barPositionToggler.firstElementChild; + this.headerToggler = headerToggler.firstElementChild; + this.footerToggler = footerToggler.firstElementChild; + this.customNavToggler = customNavToggler.firstElementChild; + $.on(this.menuButton, 'click', this.menuToggle); + $.on(this.barFixedToggler, 'change', this.toggleBarFixed); + $.on(this.barPositionToggler, 'change', this.toggleBarPosition); + $.on(this.headerToggler, 'change', this.toggleBarVisibility); + $.on(this.footerToggler, 'change', this.toggleFooterVisibility); + $.on(this.customNavToggler, 'change', this.toggleCustomNav); + $.on(editCustomNav, 'click', this.editCustomNav); + this.setBarFixed(Conf['Fixed Header']); + this.setBarVisibility(Conf['Header auto-hide']); + $.sync('Fixed Header', Header.setBarFixed); + $.sync('Bottom Header', Header.setBarPosition); + $.sync('Header auto-hide', Header.setBarVisibility); + $.event('AddMenuEntry', { + type: 'header', + el: $.el('span', { + textContent: 'Header' + }), + order: 107, + subEntries: [ + { + el: barFixedToggler + }, { + el: headerToggler + }, { + el: barPositionToggler + }, { + el: footerToggler + }, { + el: customNavToggler + }, { + el: editCustomNav + } + ] + }); + $.on(window, 'load hashchange', Header.hashScroll); + $.on(d, 'CreateNotification', this.createNotification); + $.asap((function() { + return d.body; + }), function() { + if (!Main.isThisPageLegit()) { + return; + } + $.asap((function() { + return $.id('boardNavMobile') || d.readyState === 'complete'; + }), Header.setBoardList); + $.prepend(d.body, _this.bar); + $.add(d.body, Header.hover); + return _this.setBarPosition(Conf['Bottom Header']); + }); + return $.ready(function() { + var cs; + + cs = $.id('settingsWindowLink'); + cs.textContent = 'Catalog Settings'; + if (g.VIEW === 'catalog') { + return _this.addShortcut(cs); + } + }); + }, + bar: $.el('div', { + id: 'header-bar' + }), + notify: $.el('div', { + id: 'notifications' + }), + shortcuts: $.el('span', { + id: 'shortcuts' + }), + hover: $.el('div', { + id: 'hoverUI' + }), + toggle: $.el('div', { + id: 'scroll-marker' + }), + setBoardList: function() { + var a, boardList, btn, fourchannav, fullBoardList, settings; + + fourchannav = $.id('boardNavDesktop'); + if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) { + a.className = 'current'; + } + boardList = $.el('span', { + id: 'board-list', + innerHTML: "" + }); + fullBoardList = $('#full-board-list', boardList); + btn = $('.hide-board-list-button', fullBoardList); + $.on(btn, 'click', Header.toggleBoardList); + $.rm($('#navtopright', fullBoardList)); + settings = $.id('navtopright'); + $.prepend(d.body, settings); + $.add(settings, Header.menuButton); + $.add(boardList, fullBoardList); + $.add(Header.bar, [boardList, Header.shortcuts, Header.notify, Header.toggle]); + Header.setCustomNav(Conf['Custom Board Navigation']); + Header.generateBoardList(Conf['boardnav']); + $.sync('Custom Board Navigation', Header.setCustomNav); + return $.sync('boardnav', Header.generateBoardList); + }, + generateBoardList: function(text) { + var as, list, nodes; + + list = $('#custom-board-list', Header.bar); + $.rmAll(list); + if (!text) { + return; + } + as = $$('#full-board-list a', Header.bar); + nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map(function(t) { + var a, board, m, _i, _len; + + if (/^[^\w@]/.test(t)) { + return $.tn(t); + } + if (/^toggle-all/.test(t)) { + a = $.el('a', { + className: 'show-board-list-button', + textContent: (t.match(/-text:"(.+)"/) || [null, '+'])[1], + href: 'javascript:;' + }); + $.on(a, 'click', Header.toggleBoardList); + return a; + } + board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0]; + for (_i = 0, _len = as.length; _i < _len; _i++) { + a = as[_i]; + if (a.textContent === board) { + a = a.cloneNode(true); + if (/-title/.test(t)) { + a.textContent = a.title; + } else if (/-replace/.test(t)) { + if ($.hasClass(a, 'current')) { + a.textContent = a.title; + } + } else if (/-full/.test(t)) { + a.textContent = "/" + board + "/ - " + a.title; + } else if (/-(index|catalog|text)/.test(t)) { + if (m = t.match(/-(index|catalog)/)) { + a.setAttribute('data-only', m[1]); + a.href = "//boards.4chan.org/" + board + "/"; + if (m[1] === 'catalog') { + a.href += 'catalog'; + } + } + if (m = t.match(/-text:"(.+)"/)) { + a.textContent = m[1]; + } + } else if (board === '@') { + $.addClass(a, 'navSmall'); + } + return a; + } + } + return $.tn(t); + }); + return $.add(list, nodes); + }, + toggleBoardList: function() { + var bar, custom, full, showBoardList; + + bar = Header.bar; + custom = $('#custom-board-list', bar); + full = $('#full-board-list', bar); + showBoardList = !full.hidden; + custom.hidden = !showBoardList; + return full.hidden = showBoardList; + }, + setBarPosition: function(bottom) { + Header.barPositionToggler.checked = bottom; + if (bottom) { + $.rmClass(doc, 'top'); + $.addClass(doc, 'bottom'); + $.after(Header.bar, Header.notify); + } else { + $.rmClass(doc, 'bottom'); + $.addClass(doc, 'top'); + $.add(Header.bar, Header.notify); + } + return Style.padding(); + }, + toggleBarPosition: function() { + $.event('CloseMenu'); + Header.setBarPosition(this.checked); + Conf['Bottom Header'] = this.checked; + return $.set('Bottom Header', this.checked); + }, + setBarFixed: function(fixed) { + Header.barFixedToggler.checked = fixed; + if (fixed) { + $.addClass(doc, 'fixed'); + return $.addClass(Header.bar, 'dialog'); + } else { + $.rmClass(doc, 'fixed'); + return $.rmClass(Header.bar, 'dialog'); + } + }, + toggleBarFixed: function() { + $.event('CloseMenu'); + Header.setBarFixed(this.checked); + Conf['Fixed Header'] = this.checked; + return $.set('Fixed Header', this.checked); + }, + setBarVisibility: function(hide) { + Header.headerToggler.checked = hide; + $.event('CloseMenu'); + (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide'); + return (hide ? $.addClass : $.rmClass)(doc, 'autohide'); + }, + toggleBarVisibility: function(e) { + var hide, message; + + if (e.type === 'mousedown' && e.button !== 0) { + return; + } + hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); + Conf['Header auto-hide'] = hide; + $.set('Header auto-hide', hide); + Header.setBarVisibility(hide); + message = hide ? 'The header bar will automatically hide itself.' : 'The header bar will remain visible.'; + return new Notification('info', message, 2); + }, + setCustomNav: function(show) { + var btn, cust, full, _ref; + + Header.customNavToggler.checked = show; + cust = $('#custom-board-list', Header.bar); + full = $('#full-board-list', Header.bar); + btn = $('.hide-board-list-button', full); + return _ref = show ? [false, true] : [true, false], cust.hidden = _ref[0], full.hidden = _ref[1], _ref; + }, + toggleCustomNav: function() { + $.cb.checked.call(this); + return Header.setCustomNav(this.checked); + }, + editCustomNav: function() { + var settings; + + Settings.open('Advanced'); + settings = $.id('fourchanx-settings'); + return $('input[name=boardnav]', settings).focus(); + }, + hashScroll: function() { + var hash, post; + + if (!((hash = this.location.hash) && (post = $.id(hash.slice(1))))) { + return; + } + if ((Get.postFromRoot(post)).isHidden) { + return; + } + return Header.scrollToPost(post); + }, + scrollToPost: function(post) { + var headRect, top; + + top = post.getBoundingClientRect().top; + if (Conf['Fixed Header'] && !Conf['Bottom Header']) { + headRect = Header.bar.getBoundingClientRect(); + top += -headRect.top - headRect.height; + } + return ($.engine === 'webkit' ? d.body : doc).scrollTop += top; + }, + addShortcut: function(el) { + var shortcut; + + shortcut = $.el('span', { + className: 'shortcut' + }); + $.add(shortcut, [$.tn(' ['), el, $.tn(']')]); + return $.prepend(Header.shortcuts, shortcut); + }, + menuToggle: function(e) { + return Header.menu.toggle(e, this, g); + }, + createNotification: function(e) { + var cb, content, lifetime, notif, type, _ref; + + _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; + notif = new Notification(type, content, lifetime); + if (cb) { + return cb(notif); + } + } + }; + + Build = { + spoilerRange: {}, + shortFilename: function(filename, isReply) { + var threshold; + + threshold = isReply ? 30 : 40; + if (filename.length - 4 > threshold) { + return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); + } else { + return filename; + } + }, + postFromObject: function(data, boardID) { + var o; + + o = { + postID: data.no, + threadID: data.resto || data.no, + boardID: boardID, + name: data.name, + capcode: data.capcode, + tripcode: data.trip, + uniqueID: data.id, + email: data.email ? encodeURI(data.email.replace(/"/g, '"')) : '', + subject: data.sub, + flagCode: data.country, + flagName: data.country_name, + date: data.now, + dateUTC: data.time, + comment: data.com, + isSticky: !!data.sticky, + isClosed: !!data.closed + }; + if (data.ext || data.filedeleted) { + o.file = { + name: data.filename + data.ext, + timestamp: "" + data.tim + data.ext, + url: "//images.4chan.org/" + boardID + "/src/" + data.tim + data.ext, + height: data.h, + width: data.w, + MD5: data.md5, + size: data.fsize, + turl: "//thumbs.4chan.org/" + boardID + "/thumb/" + data.tim + "s.jpg", + theight: data.tn_h, + twidth: data.tn_w, + isSpoiler: !!data.spoiler, + isDeleted: !!data.filedeleted + }; + } + return Build.post(o); + }, + post: function(o, isArchived) { + /* + This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS). + @license: https://github.com/4chan/4chan-JS/blob/master/LICENSE + */ + + var a, boardID, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; + + postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file; + isOP = postID === threadID; + staticPath = '//static.4chan.org'; + if (email) { + emailStart = ''; + emailEnd = ''; + } else { + emailStart = ''; + emailEnd = ''; + } + subject = "" + (subject || '') + ""; + userID = !capcode && uniqueID ? (" (ID: ") + ("" + uniqueID + ") ") : ''; + switch (capcode) { + case 'admin': + case 'admin_highlight': + capcodeClass = " capcodeAdmin"; + capcodeStart = " ## Admin"; + capcode = (" "; + break; + case 'mod': + capcodeClass = " capcodeMod"; + capcodeStart = " ## Mod"; + capcode = (" "; + break; + case 'developer': + capcodeClass = " capcodeDeveloper"; + capcodeStart = " ## Developer"; + capcode = (" "; + break; + default: + capcodeClass = ''; + capcodeStart = ''; + capcode = ''; + } + flag = flagCode ? ("  + flagCode + ") : ''; + if (file != null ? file.isDeleted : void 0) { + fileHTML = isOP ? ("
") + ("File deleted.") + "
" : ("
") + ("File deleted.") + "
"; + } else if (file) { + ext = file.name.slice(-3); + if (!file.twidth && !file.theight && ext === 'gif') { + file.twidth = file.width; + file.theight = file.height; + } + fileSize = $.bytesToString(file.size); + fileThumb = file.turl; + if (file.isSpoiler) { + fileSize = "Spoiler Image, " + fileSize; + if (!isArchived) { + fileThumb = '//static.4chan.org/image/spoiler'; + if (spoilerRange = Build.spoilerRange[boardID]) { + fileThumb += ("-" + boardID) + Math.floor(1 + spoilerRange * Math.random()); + } + fileThumb += '.png'; + file.twidth = file.theight = 100; + } + } + if (boardID.ID !== 'f') { + imgSrc = ("") + ("" + fileSize + ""); + } + a = $.el('a', { + innerHTML: file.name + }); + filename = a.textContent.replace(/%22/g, '"'); + a.textContent = Build.shortFilename(filename); + shortFilename = a.innerHTML; + a.textContent = filename; + filename = a.innerHTML.replace(/'/g, '''); + fileDims = ext === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height; + fileInfo = ("File: " + file.timestamp + "") + ("-(" + fileSize + ", " + fileDims + (file.isSpoiler ? '' : ", " + shortFilename + "")) + ")"; + fileHTML = "
" + fileInfo + "
" + imgSrc + "
"; + } else { + fileHTML = ''; + } + tripcode = tripcode ? " " + tripcode + "" : ''; + sticky = isSticky ? ' Sticky' : ''; + closed = isClosed ? ' Closed' : ''; + container = $.el('div', { + id: "pc" + postID, + className: "postContainer " + (isOP ? 'op' : 'reply') + "Container", + innerHTML: (isOP ? '' : "
>>
") + ("
") + ("' + (isOP ? fileHTML : '') + ("' + (isOP ? '' : fileHTML) + ("
" + (comment || '') + "
") + '
' + }); + _ref = $$('.quotelink', container); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quote = _ref[_i]; + href = quote.getAttribute('href'); + if (href[0] === '/') { + continue; + } + quote.href = "/" + boardID + "/res/" + href; + } + return container; + } + }; + Get = { threadExcerpt: function(thread) { var OP, excerpt, _ref; @@ -3905,28 +4354,6 @@ } }; - Polyfill = { - init: function() { - return Polyfill.visibility(); - }, - visibility: function() { - var event, prefix, property; - - if ('visibilityState' in document || !(prefix = ('webkitVisibilityState' in document ? 'webkit' : 'mozVisibilityState' in document ? 'moz' : void 0))) { - return; - } - property = prefix + 'VisibilityState'; - event = prefix + 'visibilitychange'; - d.visibilityState = d[property]; - d.hidden = d.visibilityState === 'hidden'; - return $.on(d, event, function() { - d.visibilityState = d[property]; - d.hidden = d.visibilityState === 'hidden'; - return $.event('visibilitychange'); - }); - } - }; - UI = (function() { var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove; @@ -4195,7 +4622,7 @@ })(); dragstart = function(e) { - var el, isTouching, o, rect, screenHeight, screenWidth; + var el, isTouching, o, rect, screenHeight, screenWidth, _ref; if (e.type === 'mousedown' && e.button !== 0) { return; @@ -4219,6 +4646,7 @@ screenWidth: screenWidth, isTouching: isTouching }; + _ref = Conf['Header auto-hide'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = _ref[0], o.bottomBorder = _ref[1]; if (isTouching) { o.identifier = e.identifier; o.move = touchmove.bind(o); @@ -4251,9 +4679,9 @@ left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; top = clientY - this.dy; - top = top < 10 ? 0 : this.height - top < 10 ? null : top / this.screenHeight * 100 + '%'; + top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%'; right = left === null ? 0 : null; - bottom = top === null ? 0 : null; + bottom = top === null ? this.bottomBorder + 'px' : null; style = this.style; style.left = left; style.right = right; @@ -4656,76 +5084,6 @@ } }; - Recursive = { - recursives: {}, - init: function() { - if (g.VIEW === 'catalog') { - return; - } - return Post.prototype.callbacks.push({ - name: 'Recursive', - cb: this.node - }); - }, - node: function() { - var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; - - if (this.isClone) { - return; - } - _ref = this.quotes; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; - if (obj = Recursive.recursives[quote]) { - _ref1 = obj.recursives; - for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) { - recursive = _ref1[i]; - recursive.apply(null, [this].concat(__slice.call(obj.args[i]))); - } - } - } - }, - add: function() { - var args, obj, post, recursive, _base, _name; - - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; - obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { - recursives: [], - args: [] - }); - obj.recursives.push(recursive); - return obj.args.push(args); - }, - rm: function(recursive, post) { - var i, obj, rec, _i, _len, _ref; - - if (!(obj = Recursive.recursives[post.fullID])) { - return; - } - _ref = obj.recursives; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - rec = _ref[i]; - if (rec === recursive) { - obj.recursives.splice(i, 1); - obj.args.splice(i, 1); - } - } - }, - apply: function() { - var ID, args, fullID, post, recursive, _ref; - - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; - fullID = post.fullID; - _ref = g.posts; - for (ID in _ref) { - post = _ref[ID]; - if (post.quotes.contains(fullID)) { - recursive.apply(null, [post].concat(__slice.call(args))); - } - } - } - }; - PostHiding = { init: function() { if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link']) { @@ -5004,28 +5362,71 @@ } }; - QuoteStrikeThrough = { + Recursive = { + recursives: {}, init: function() { - if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link'] && !Conf['Filter']) { + if (g.VIEW === 'catalog') { return; } return Post.prototype.callbacks.push({ - name: 'Strike-through Quotes', + name: 'Recursive', cb: this.node }); }, node: function() { - var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; + var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; if (this.isClone) { return; } - _ref = this.nodes.quotelinks; + _ref = this.quotes; for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quotelink = _ref[_i]; - _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID; - if ((_ref2 = g.posts["" + boardID + "." + postID]) != null ? _ref2.isHidden : void 0) { - $.addClass(quotelink, 'filtered'); + quote = _ref[_i]; + if (obj = Recursive.recursives[quote]) { + _ref1 = obj.recursives; + for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) { + recursive = _ref1[i]; + recursive.apply(null, [this].concat(__slice.call(obj.args[i]))); + } + } + } + }, + add: function() { + var args, obj, post, recursive, _base, _name; + + recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; + obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { + recursives: [], + args: [] + }); + obj.recursives.push(recursive); + return obj.args.push(args); + }, + rm: function(recursive, post) { + var i, obj, rec, _i, _len, _ref; + + if (!(obj = Recursive.recursives[post.fullID])) { + return; + } + _ref = obj.recursives; + for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { + rec = _ref[i]; + if (rec === recursive) { + obj.recursives.splice(i, 1); + obj.args.splice(i, 1); + } + } + }, + apply: function() { + var ID, args, fullID, post, recursive, _ref; + + recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; + fullID = post.fullID; + _ref = g.posts; + for (ID in _ref) { + post = _ref[ID]; + if (post.quotes.contains(fullID)) { + recursive.apply(null, [post].concat(__slice.call(args))); } } } @@ -5258,455 +5659,646 @@ } }; - FappeTyme = { + QuoteBacklink = { init: function() { - var el; + var format; - if (!Conf['Fappe Tyme'] && (g.VIEW === 'catalog' || g.BOARD === 'f')) { + if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { return; } - el = $.el('a', { - href: 'javascript:;', - id: 'fappeTyme', - title: 'Fappe Tyme' - }); - $.on(el, 'click', FappeTyme.toggle); - $.asap((function() { - return $.id('boardNavMobile'); - }), function() { - return $.add($.id('navtopright'), el); - }); - return Post.prototype.callbacks.push({ - name: 'Fappe Tyme', - cb: this.node - }); - }, - node: function() { - if (this.file) { - return; - } - return $.addClass(this.nodes.root, "noFile"); - }, - toggle: function() { - return $.toggleClass(doc, 'fappeTyme'); - } - }; - - ImageExpand = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { - return; - } - this.EAI = $.el('a', { - id: 'img-controls', - className: 'expand-all-shortcut', - title: 'Expand All Images', - href: 'javascript:;' - }); - $.on(this.EAI, 'click', ImageExpand.cb.toggleAll); + format = Conf['backlink'].replace(/%id/g, "' + id + '"); + this.funk = Function('id', "return '" + format + "'"); + this.containers = {}; Post.prototype.callbacks.push({ - name: 'Image Expansion', - cb: this.node + name: 'Quote Backlinking Part 1', + cb: this.firstNode }); - return $.asap((function() { - return $.id('delform'); - }), function() { - return $.prepend($.id('delform'), ImageExpand.EAI); + return Post.prototype.callbacks.push({ + name: 'Quote Backlinking Part 2', + cb: this.secondNode }); }, - node: function() { - var thumb, _ref; + firstNode: function() { + var a, clone, container, containers, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + if (this.isClone || !this.quotes.length) { return; } - thumb = this.file.thumb; - $.on(thumb.parentNode, 'click', ImageExpand.cb.toggle); - if (this.isClone && $.hasClass(thumb, 'expanding')) { - ImageExpand.contract(this); - ImageExpand.expand(this); - return; - } - if (ImageExpand.on && !this.isHidden) { - return ImageExpand.expand(this); - } - }, - cb: { - toggle: function(e) { - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { - return; - } - e.preventDefault(); - return ImageExpand.toggle(Get.postFromNode(this)); - }, - toggleAll: function() { - var ID, file, func, post, _i, _len, _ref, _ref1; - - $.event('CloseMenu'); - if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { - ImageExpand.EAI.className = 'contract-all-shortcut'; - ImageExpand.EAI.title = 'Contract All Images'; - func = ImageExpand.expand; - } else { - ImageExpand.EAI.className = 'expand-all-shortcut'; - ImageExpand.EAI.title = 'Expand All Images'; - func = ImageExpand.contract; - } - _ref = g.posts; - for (ID in _ref) { - post = _ref[ID]; - _ref1 = [post].concat(post.clones); - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - post = _ref1[_i]; - file = post.file; - if (!(file && file.isImage && doc.contains(post.nodes.root))) { - continue; - } - if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && file.thumb.getBoundingClientRect().top < 0)) { - continue; - } - $.queueTask(func, post); + a = $.el('a', { + href: "/" + this.board + "/res/" + this.thread + "#p" + this, + className: this.isHidden ? 'filtered backlink' : 'backlink', + textContent: (QuoteBacklink.funk(this.ID)) + (Conf['Mark Quotes of You'] && this.info.yours ? QuoteYou.text : '') + }); + _ref = this.quotes; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quote = _ref[_i]; + containers = [QuoteBacklink.getContainer(quote)]; + if ((post = g.posts[quote]) && post.nodes.backlinkContainer) { + _ref1 = post.clones; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + clone = _ref1[_j]; + containers.push(clone.nodes.backlinkContainer); } } - }, - setFitness: function() { - var checked; - - checked = this.checked; - (checked ? $.addClass : $.rmClass)(doc, this.name.toLowerCase().replace(/\s+/g, '-')); - if (this.name !== 'Fit height') { - return; - } - if (checked) { - $.on(window, 'resize', ImageExpand.resize); - if (!ImageExpand.style) { - ImageExpand.style = $.addStyle(null); + for (_k = 0, _len2 = containers.length; _k < _len2; _k++) { + container = containers[_k]; + link = a.cloneNode(true); + if (Conf['Quote Previewing']) { + $.on(link, 'mouseover', QuotePreview.mouseover); } - return ImageExpand.resize(); - } else { - return $.off(window, 'resize', ImageExpand.resize); - } - } - }, - toggle: function(post) { - var headRect, rect, root, thumb, top; - - thumb = post.file.thumb; - if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { - ImageExpand.expand(post); - return; - } - ImageExpand.contract(post); - rect = post.nodes.root.getBoundingClientRect(); - if (!(rect.top <= 0 || rect.left <= 0)) { - return; - } - headRect = Header.bar.getBoundingClientRect(); - top = rect.top - headRect.top - headRect.height; - root = doc; - if (rect.top < 0) { - root.scrollTop += top; - } - if (rect.left < 0) { - return root.scrollLeft = 0; - } - }, - contract: function(post) { - $.rmClass(post.nodes.root, 'expanded-image'); - $.rmClass(post.file.thumb, 'expanding'); - return post.file.isExpanded = false; - }, - expand: function(post, src) { - var img, thumb; - - thumb = post.file.thumb; - if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { - return; - } - $.addClass(thumb, 'expanding'); - if (post.file.fullImage) { - $.asap((function() { - return post.file.fullImage.naturalHeight; - }), function() { - return ImageExpand.completeExpand(post); - }); - return; - } - post.file.fullImage = img = $.el('img', { - className: 'full-image', - src: src || post.file.URL - }); - $.on(img, 'error', ImageExpand.error); - $.asap((function() { - return post.file.fullImage.naturalHeight; - }), function() { - return ImageExpand.completeExpand(post); - }); - return $.after(thumb, img); - }, - completeExpand: function(post) { - var prev, thumb; - - thumb = post.file.thumb; - if (!$.hasClass(thumb, 'expanding')) { - return; - } - post.file.isExpanded = true; - if (!post.nodes.root.parentNode) { - $.addClass(post.nodes.root, 'expanded-image'); - $.rmClass(post.file.thumb, 'expanding'); - return; - } - prev = post.nodes.root.getBoundingClientRect(); - return $.queueTask(function() { - var curr, root; - - $.addClass(post.nodes.root, 'expanded-image'); - $.rmClass(post.file.thumb, 'expanding'); - if (!(prev.top + prev.height <= 0)) { - return; - } - root = doc; - curr = post.nodes.root.getBoundingClientRect(); - return root.scrollTop += curr.height - prev.height + curr.top - prev.top; - }); - }, - error: function() { - var URL, post, src, timeoutID; - - post = Get.postFromNode(this); - $.rm(this); - delete post.file.fullImage; - if (!($.hasClass(post.file.thumb, 'expanding') || $.hasClass(post.nodes.root, 'expanded-image'))) { - return; - } - ImageExpand.contract(post); - src = this.src.split('/'); - if (src[2] === 'images.4chan.org') { - if (URL = Redirect.image(src[3], src[5])) { - setTimeout(ImageExpand.expand, 10000, post, URL); - return; - } - if (g.DEAD || post.isDead || post.file.isDead) { - return; - } - } - timeoutID = setTimeout(ImageExpand.expand, 10000, post); - return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { - onload: function() { - var postObj, _i, _len, _ref; - - if (this.status !== 200) { - return; - } - _ref = JSON.parse(this.response).posts; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - postObj = _ref[_i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - clearTimeout(timeoutID); - return post.kill(); - } else if (postObj.filedeleted) { - clearTimeout(timeoutID); - return post.kill(true); + if (Conf['Quote Inlining']) { + $.on(link, 'click', QuoteInline.toggle); } + $.add(container, [$.tn(' '), link]); } - }); - }, - menu: { - init: function() { - var conf, createSubEntry, el, key, subEntries, _ref; - - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { - return; - } - el = $.el('span', { - textContent: 'Image Expansion', - className: 'image-expansion-link' - }); - createSubEntry = ImageExpand.menu.createSubEntry; - subEntries = []; - _ref = Config.imageExpansion; - for (key in _ref) { - conf = _ref[key]; - subEntries.push(createSubEntry(key, conf)); - } - return $.event('AddMenuEntry', { - type: 'header', - el: el, - order: 105, - subEntries: subEntries - }); - }, - createSubEntry: function(type, config) { - var input, label; - - label = $.el('label', { - innerHTML: " " + type - }); - input = label.firstElementChild; - if (type === 'Fit width' || type === 'Fit height') { - $.on(input, 'change', ImageExpand.cb.setFitness); - } - if (config) { - label.title = config[1]; - input.checked = Conf[type]; - $.event('change', null, input); - $.on(input, 'change', $.cb.checked); - } - return { - el: label - }; } }, - resize: function() { - return ImageExpand.style.textContent = ":root.fit-height .full-image {max-height:" + doc.clientHeight + "px}"; + secondNode: function() { + var container; + + if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { + this.nodes.backlinkContainer = $('.container', this.nodes.info); + return; + } + if (!(this.isReply || Conf['OP Backlinks'])) { + return; + } + container = QuoteBacklink.getContainer(this.fullID); + this.nodes.backlinkContainer = container; + return $.add(this.nodes.info, container); }, - menuToggle: function(e) { - return ImageExpand.opmenu.toggle(e, this, g); + getContainer: function(id) { + var _base; + + return (_base = this.containers)[id] || (_base[id] = $.el('span', { + className: 'container' + })); } }; - ImageHover = { + QuoteCT = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Image Hover']) { + if (g.VIEW === 'catalog' || !Conf['Mark Cross-thread Quotes']) { return; } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + this.text = '\u00A0(Cross-thread)'; return Post.prototype.callbacks.push({ - name: 'Image Hover', + name: 'Mark Cross-thread Quotes', cb: this.node }); }, node: function() { - var _ref; + var board, boardID, quotelink, quotelinks, quotes, thread, threadID, _i, _len, _ref, _ref1; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + if (this.isClone && this.thread === this.context.thread) { return; } - return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover); + if (!(quotes = this.quotes).length) { + return; + } + quotelinks = this.nodes.quotelinks; + _ref = this.isClone ? this.context : this, board = _ref.board, thread = _ref.thread; + for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { + quotelink = quotelinks[_i]; + _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, threadID = _ref1.threadID; + if (!threadID) { + continue; + } + if (this.isClone) { + quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, ''); + } + if (boardID === this.board.ID && threadID !== thread.ID) { + $.add(quotelink, $.tn(QuoteCT.text)); + } + } + } + }; + + QuoteInline = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Quote Inlining']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + return Post.prototype.callbacks.push({ + name: 'Quote Inlining', + cb: this.node + }); + }, + node: function() { + var link, _i, _len, _ref; + + _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + $.on(link, 'click', QuoteInline.toggle); + } + }, + toggle: function(e) { + var boardID, context, postID, threadID, _ref; + + if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { + return; + } + e.preventDefault(); + _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; + context = Get.contextFromLink(this); + if ($.hasClass(this, 'inlined')) { + QuoteInline.rm(this, boardID, threadID, postID, context); + } else { + if ($.x("ancestor::div[@id='p" + postID + "']", this)) { + return; + } + QuoteInline.add(this, boardID, threadID, postID, context); + } + return this.classList.toggle('inlined'); + }, + findRoot: function(quotelink, isBacklink) { + if (isBacklink) { + return quotelink.parentNode.parentNode; + } else { + return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink); + } + }, + add: function(quotelink, boardID, threadID, postID, context) { + var inline, isBacklink, post; + + isBacklink = $.hasClass(quotelink, 'backlink'); + inline = $.el('div', { + id: "i" + postID, + className: 'inline' + }); + $.after(QuoteInline.findRoot(quotelink, isBacklink), inline); + Get.postClone(boardID, threadID, postID, inline, context); + if (!((post = g.posts["" + boardID + "." + postID]) && context.thread === post.thread)) { + return; + } + if (isBacklink && Conf['Forward Hiding']) { + $.addClass(post.nodes.root, 'forwarded'); + post.forwarded++ || (post.forwarded = 1); + } + if (!Unread.posts) { + return; + } + return Unread.readSinglePost(post); + }, + rm: function(quotelink, boardID, threadID, postID, context) { + var el, inlined, isBacklink, post, root, _ref; + + isBacklink = $.hasClass(quotelink, 'backlink'); + root = QuoteInline.findRoot(quotelink, isBacklink); + root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); + $.rm(root); + if (!(el = root.firstElementChild)) { + return; + } + post = g.posts["" + boardID + "." + postID]; + post.rmClone(el.dataset.clone); + if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads["" + boardID + "." + threadID] && !--post.forwarded) { + delete post.forwarded; + $.rmClass(post.nodes.root, 'forwarded'); + } + while (inlined = $('.inlined', el)) { + _ref = Get.postDataFromLink(inlined), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; + QuoteInline.rm(inlined, boardID, threadID, postID, context); + $.rmClass(inlined, 'inlined'); + } + } + }; + + QuoteOP = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Mark OP Quotes']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + this.text = '\u00A0(OP)'; + return Post.prototype.callbacks.push({ + name: 'Mark OP Quotes', + cb: this.node + }); + }, + node: function() { + var boardID, op, postID, quotelink, quotelinks, quotes, _i, _j, _len, _len1, _ref; + + if (this.isClone && this.thread === this.context.thread) { + return; + } + if (!(quotes = this.quotes).length) { + return; + } + quotelinks = this.nodes.quotelinks; + if (this.isClone && quotes.contains(this.thread.fullID)) { + for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { + quotelink = quotelinks[_i]; + quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, ''); + } + } + op = (this.isClone ? this.context : this).thread.fullID; + if (!quotes.contains(op)) { + return; + } + for (_j = 0, _len1 = quotelinks.length; _j < _len1; _j++) { + quotelink = quotelinks[_j]; + _ref = Get.postDataFromLink(quotelink), boardID = _ref.boardID, postID = _ref.postID; + if (("" + boardID + "." + postID) === op) { + $.add(quotelink, $.tn(QuoteOP.text)); + } + } + } + }; + + QuotePreview = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Quote Previewing']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + return Post.prototype.callbacks.push({ + name: 'Quote Previewing', + cb: this.node + }); + }, + node: function() { + var link, _i, _len, _ref; + + _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + $.on(link, 'mouseover', QuotePreview.mouseover); + } }, mouseover: function(e) { - var el, post; + var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; - post = Get.postFromNode(this); - el = $.el('img', { - id: 'ihover', - src: post.file.URL + if ($.hasClass(this, 'inlined')) { + return; + } + _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; + qp = $.el('div', { + id: 'qp', + className: 'dialog' }); - el.setAttribute('data-fullid', post.fullID); - $.add(Header.hover, el); + $.add(Header.hover, qp); + Get.postClone(boardID, threadID, postID, qp, Get.contextFromLink(this)); UI.hover({ root: this, - el: el, + el: qp, latestEvent: e, endEvents: 'mouseout click', + cb: QuotePreview.mouseout, asapTest: function() { - return el.naturalHeight; + return qp.firstElementChild; } }); - return $.on(el, 'error', ImageHover.error); - }, - error: function() { - var URL, post, src, timeoutID, - _this = this; - - if (!doc.contains(this)) { + if (!(origin = g.posts["" + boardID + "." + postID])) { return; } - post = g.posts[this.dataset.fullid]; - src = this.src.split('/'); - if (src[2] === 'images.4chan.org') { - if (URL = Redirect.image(src[3], src[5].replace(/\?.+$/, ''))) { - this.src = URL; - return; - } - if (g.DEAD || post.isDead || post.file.isDead) { - return; + if (Conf['Quote Highlighting']) { + posts = [origin].concat(origin.clones); + posts.pop(); + for (_i = 0, _len = posts.length; _i < _len; _i++) { + post = posts[_i]; + $.addClass(post.nodes.post, 'qphl'); } } - timeoutID = setTimeout((function() { - return _this.src = post.file.URL + '?' + Date.now(); - }), 3000); - return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { - onload: function() { - var postObj, _i, _len, _ref; - - if (this.status !== 200) { - return; - } - _ref = JSON.parse(this.response).posts; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - postObj = _ref[_i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - clearTimeout(timeoutID); - return post.kill(); - } else if (postObj.filedeleted) { - clearTimeout(timeoutID); - return post.kill(true); - } + quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0]; + clone = Get.postFromRoot(qp.firstChild); + _ref1 = clone.nodes.quotelinks.concat(__slice.call(clone.nodes.backlinks)); + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + quote = _ref1[_j]; + if (quote.hash.slice(2) === quoterID) { + $.addClass(quote, 'forwardlink'); } - }); + } + }, + mouseout: function() { + var clone, post, root, _i, _len, _ref; + + if (!(root = this.el.firstElementChild)) { + return; + } + clone = Get.postFromRoot(root); + post = clone.origin; + post.rmClone(root.dataset.clone); + if (!Conf['Quote Highlighting']) { + return; + } + _ref = [post].concat(post.clones); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + post = _ref[_i]; + $.rmClass(post.nodes.post, 'qphl'); + } } }; - ImageReplace = { + QuoteStrikeThrough = { init: function() { - if (g.VIEW === 'catalog') { + if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link'] && !Conf['Filter']) { return; } return Post.prototype.callbacks.push({ - name: 'Image Replace', + name: 'Strike-through Quotes', cb: this.node }); }, node: function() { - var URL, img, style, thumb, type, _ref, _ref1; + var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; - if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { + if (this.isClone) { return; } - _ref1 = this.file, thumb = _ref1.thumb, URL = _ref1.URL; - if (!(Conf["Replace " + ((type = (URL.match(/\w{3}$/))[0].toUpperCase()) === 'PEG' ? 'JPG' : type)] && !/spoiler/.test(thumb.src))) { - return; + _ref = this.nodes.quotelinks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quotelink = _ref[_i]; + _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID; + if ((_ref2 = g.posts["" + boardID + "." + postID]) != null ? _ref2.isHidden : void 0) { + $.addClass(quotelink, 'filtered'); + } } - if (this.file.isSpoiler) { - style = thumb.style; - style.maxHeight = style.maxWidth = this.isReply ? '125px' : '250px'; - } - img = $.el('img'); - $.on(img, 'load', function() { - return thumb.src = URL; - }); - return img.src = URL; } }; - RevealSpoilers = { + /* + <3 aeosynth + */ + + + QuoteThreading = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reveal Spoilers']) { + var input; + + if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { return; } + this.enabled = true; + this.controls = $.el('span', { + innerHTML: '' + }); + input = $('input', this.controls); + $.on(input, 'change', QuoteThreading.toggle); + $.event('AddMenuEntry', { + type: 'header', + el: this.controls, + order: 98 + }); + $.on(d, '4chanXInitFinished', this.setup); return Post.prototype.callbacks.push({ - name: 'Reveal Spoilers', + name: 'Quote Threading', + cb: this.node + }); + }, + setup: function() { + var ID, post, posts; + + $.off(d, '4chanXInitFinished', QuoteThreading.setup); + posts = g.posts; + for (ID in posts) { + post = posts[ID]; + if (post.cb) { + post.cb.call(post); + } + } + return QuoteThreading.hasRun = true; + }, + node: function() { + var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; + + if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { + return; + } + quotes = this.quotes, ID = this.ID, fullID = this.fullID; + posts = g.posts; + if (!(post = posts[fullID]) || post.isHidden) { + return; + } + uniq = {}; + len = ("" + g.BOARD).length + 1; + for (_i = 0, _len = quotes.length; _i < _len; _i++) { + quote = quotes[_i]; + qid = quote; + if (!(qid.slice(len) < ID)) { + continue; + } + if (qid in posts) { + uniq[qid.slice(len)] = true; + } + } + keys = Object.keys(uniq); + if (keys.length !== 1) { + return; + } + this.threaded = "" + g.BOARD + "." + keys[0]; + return this.cb = QuoteThreading.nodeinsert; + }, + nodeinsert: function() { + var bottom, height, posts, qpost, qroot, threadContainer, top, _ref; + + posts = g.posts; + qpost = posts[this.threaded]; + delete this.threaded; + delete this.cb; + if (this.thread.OP === qpost) { + return false; + } + if (QuoteThreading.hasRun) { + height = doc.clientHeight; + _ref = qpost.nodes.root.getBoundingClientRect(), bottom = _ref.bottom, top = _ref.top; + if (!(Unread.posts.contains(qpost) || ((bottom < height) && (top > 0)))) { + return false; + } + } + qroot = qpost.nodes.root; + if (!$.hasClass(qroot, 'threadOP')) { + $.addClass(qroot, 'threadOP'); + threadContainer = $.el('div', { + className: 'threadContainer' + }); + $.after(qroot, threadContainer); + } else { + threadContainer = qroot.nextSibling; + } + $.add(threadContainer, this.nodes.root); + return true; + }, + toggle: function() { + var container, containers, node, nodes, replies, reply, thread, _i, _j, _len, _len1; + + thread = $('.thread'); + replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); + QuoteThreading.enabled = this.checked; + if (this.checked) { + nodes = (function() { + var _i, _len, _results; + + _results = []; + for (_i = 0, _len = replies.length; _i < _len; _i++) { + reply = replies[_i]; + _results.push(Get.postFromNode(reply)); + } + return _results; + })(); + for (_i = 0, _len = nodes.length; _i < _len; _i++) { + node = nodes[_i]; + QuoteThreading.node(node); + } + } else { + replies.sort(function(a, b) { + var aID, bID; + + aID = Number(a.id.slice(2)); + bID = Number(b.id.slice(2)); + return aID - bID; + }); + $.add(thread, replies); + containers = $$('.threadContainer', thread); + for (_j = 0, _len1 = containers.length; _j < _len1; _j++) { + container = containers[_j]; + $.rm(container); + } + Unread.update(true); + } + }, + kb: function() { + var control; + + control = $.id('threadingControl'); + return control.click(); + } + }; + + QuoteYou = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Mark Quotes of You'] || !Conf['Quick Reply']) { + return; + } + this.text = '\u00A0(You)'; + return Post.prototype.callbacks.push({ + name: 'Mark Quotes of You', cb: this.node }); }, node: function() { - var thumb, _ref; + var quotelink, quotelinks, quotes, _i, _len; - if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { + if (this.isClone) { return; } - thumb = this.file.thumb; - thumb.removeAttribute('style'); - return thumb.src = this.file.thumbURL; + if (this.info.yours) { + $.addClass(this.nodes.root, 'yourPost'); + } + if (Conf['Highlight Own Posts']) { + $.addClass(doc, 'highlight-own'); + } + if (!(quotes = this.quotes).length) { + return; + } + quotelinks = this.nodes.quotelinks; + for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { + quotelink = quotelinks[_i]; + if (QR.db.get(Get.postDataFromLink(quotelink))) { + $.add(quotelink, $.tn(QuoteYou.text)); + } + } + } + }; + + Quotify = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Resurrect Quotes']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + return Post.prototype.callbacks.push({ + name: 'Resurrect Quotes', + cb: this.node + }); + }, + node: function() { + var deadlink, _i, _len, _ref; + + _ref = $$('.deadlink', this.nodes.comment); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + deadlink = _ref[_i]; + if (this.isClone) { + if ($.hasClass(deadlink, 'quotelink')) { + this.nodes.quotelinks.push(deadlink); + } + } else { + Quotify.parseDeadlink.call(this, deadlink); + } + } + }, + parseDeadlink: function(deadlink) { + var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; + + if (deadlink.parentNode.className === 'prettyprint') { + $.replace(deadlink, __slice.call(deadlink.childNodes)); + return; + } + quote = deadlink.textContent; + if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) { + return; + } + boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; + quoteID = "" + boardID + "." + postID; + if (post = g.posts[quoteID]) { + if (!post.isDead) { + a = $.el('a', { + href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, + className: 'quotelink', + textContent: quote + }); + } else { + a = $.el('a', { + href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, + className: 'quotelink deadlink', + target: '_blank', + textContent: "" + quote + "\u00A0(Dead)" + }); + a.setAttribute('data-boardid', boardID); + a.setAttribute('data-threadid', post.thread.ID); + a.setAttribute('data-postid', postID); + } + } else if (redirect = Redirect.to({ + boardID: boardID, + threadID: 0, + postID: postID + })) { + a = $.el('a', { + href: redirect, + className: 'deadlink', + target: '_blank', + textContent: "" + quote + "\u00A0(Dead)" + }); + if (Redirect.post(boardID, postID)) { + $.addClass(a, 'quotelink'); + a.setAttribute('data-boardid', boardID); + a.setAttribute('data-postid', postID); + } + } + if (!this.quotes.contains(quoteID)) { + this.quotes.push(quoteID); + } + if (!a) { + deadlink.textContent = "" + quote + "\u00A0(Dead)"; + return; + } + $.replace(deadlink, a); + if ($.hasClass(a, 'quotelink')) { + return this.nodes.quotelinks.push(a); + } } }; @@ -5996,2848 +6588,6 @@ } }; - ArchiveLink = { - init: function() { - var div, entry, type, _i, _len, _ref; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { - return; - } - div = $.el('div', { - textContent: 'Archive' - }); - entry = { - type: 'post', - el: div, - order: 90, - open: function(_arg) { - var ID, board, redirect, thread; - - ID = _arg.ID, thread = _arg.thread, board = _arg.board; - redirect = Redirect.to({ - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - return redirect !== ("//boards.4chan.org/" + board + "/"); - }, - subEntries: [] - }; - _ref = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['E-mail', 'email'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; - entry.subEntries.push(this.createSubEntry(type[0], type[1])); - } - return $.event('AddMenuEntry', entry); - }, - createSubEntry: function(text, type) { - var el, open; - - el = $.el('a', { - textContent: text, - target: '_blank' - }); - open = type === 'post' ? function(_arg) { - var ID, board, thread; - - ID = _arg.ID, thread = _arg.thread, board = _arg.board; - el.href = Redirect.to({ - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - return true; - } : function(post) { - var value; - - value = Filter[type](post); - if (!value) { - return false; - } - el.href = Redirect.to({ - boardID: post.board.ID, - type: type, - value: value, - isSearch: true - }); - return true; - }; - return { - el: el, - open: open - }; - } - }; - - DeleteLink = { - init: function() { - var div, fileEl, fileEntry, postEl, postEntry; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { - return; - } - div = $.el('div', { - className: 'delete-link', - textContent: 'Delete' - }); - postEl = $.el('a', { - className: 'delete-post', - href: 'javascript:;' - }); - fileEl = $.el('a', { - className: 'delete-file', - href: 'javascript:;' - }); - postEntry = { - el: postEl, - open: function() { - postEl.textContent = 'Post'; - $.on(postEl, 'click', DeleteLink["delete"]); - return true; - } - }; - fileEntry = { - el: fileEl, - open: function(_arg) { - var file; - - file = _arg.file; - if (!file || file.isDead) { - return false; - } - fileEl.textContent = 'File'; - $.on(fileEl, 'click', DeleteLink["delete"]); - return true; - } - }; - return $.event('AddMenuEntry', { - type: 'post', - el: div, - order: 40, - open: function(post) { - var node; - - if (post.isDead) { - return false; - } - DeleteLink.post = post; - node = div.firstChild; - node.textContent = 'Delete'; - DeleteLink.cooldown.start(post, node); - return true; - }, - subEntries: [postEntry, fileEntry] - }); - }, - "delete": function() { - var fileOnly, form, link, m, post, pwd; - - post = DeleteLink.post; - if (DeleteLink.cooldown.counting === post) { - return; - } - $.off(this, 'click', DeleteLink["delete"]); - this.textContent = "Deleting " + this.textContent + "..."; - pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $.id('delPassword').value; - fileOnly = $.hasClass(this, 'delete-file'); - form = { - mode: 'usrdel', - onlyimgdel: fileOnly, - pwd: pwd - }; - form[post.ID] = 'delete'; - link = this; - return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), { - onload: function() { - return DeleteLink.load(link, post, fileOnly, this.response); - }, - onerror: function() { - return DeleteLink.error(link); - } - }, { - cred: true, - form: $.formData(form) - }); - }, - load: function(link, post, fileOnly, html) { - var msg, s, tmpDoc; - - tmpDoc = d.implementation.createHTMLDocument(''); - tmpDoc.documentElement.innerHTML = html; - if (tmpDoc.title === '4chan - Banned') { - s = 'Banned!'; - } else if (msg = tmpDoc.getElementById('errmsg')) { - s = msg.textContent; - $.on(link, 'click', DeleteLink["delete"]); - } else { - if (tmpDoc.title === 'Updating index...') { - (post.origin || post).kill(fileOnly); - } - s = 'Deleted'; - } - return link.textContent = s; - }, - error: function(link) { - link.textContent = 'Connection error, please retry.'; - return $.on(link, 'click', DeleteLink["delete"]); - }, - cooldown: { - start: function(post, node) { - var length, seconds, _ref; - - if (!((_ref = QR.db) != null ? _ref.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }) : void 0)) { - delete DeleteLink.cooldown.counting; - return; - } - DeleteLink.cooldown.counting = post; - length = post.board.ID === 'q' ? 600 : 30; - seconds = Math.ceil((length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND); - return DeleteLink.cooldown.count(post, seconds, length, node); - }, - count: function(post, seconds, length, node) { - if (DeleteLink.cooldown.counting !== post) { - return; - } - if (!((0 <= seconds && seconds <= length))) { - if (DeleteLink.cooldown.counting === post) { - node.textContent = 'Delete'; - delete DeleteLink.cooldown.counting; - } - return; - } - setTimeout(DeleteLink.cooldown.count, 1000, post, seconds - 1, length, node); - return node.textContent = "Delete (" + seconds + ")"; - } - } - }; - - DownloadLink = { - init: function() { - var a; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { - return; - } - a = $.el('a', { - className: 'download-link', - textContent: 'Download file' - }); - return $.event('AddMenuEntry', { - type: 'post', - el: a, - order: 70, - open: function(_arg) { - var file; - - file = _arg.file; - if (!file) { - return false; - } - a.href = file.URL; - a.download = file.name; - return true; - } - }); - } - }; - - Menu = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Menu']) { - return; - } - this.menu = new UI.Menu('post'); - return Post.prototype.callbacks.push({ - name: 'Menu', - cb: this.node - }); - }, - node: function() { - var button; - - button = Menu.makeButton(this); - if (this.isClone) { - $.replace($('.menu-button', this.nodes.info), button); - return; - } - return $.add(this.nodes.info, [$.tn('\u00A0'), button]); - }, - makeButton: (function() { - var a; - - a = null; - return function(post) { - var clone; - - a || (a = $.el('a', { - className: 'menu-button', - innerHTML: '[]', - href: 'javascript:;' - })); - clone = a.cloneNode(true); - clone.setAttribute('data-postid', post.fullID); - if (post.isClone) { - clone.setAttribute('data-clone', true); - } - $.on(clone, 'click', Menu.toggle); - return clone; - }; - })(), - toggle: function(e) { - var post; - - post = this.dataset.clone ? Get.postFromNode(this) : g.posts[this.dataset.postid]; - return Menu.menu.toggle(e, this, post); - } - }; - - ReportLink = { - init: function() { - var a; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { - return; - } - a = $.el('a', { - className: 'report-link', - href: 'javascript:;', - textContent: 'Report this post' - }); - $.on(a, 'click', ReportLink.report); - return $.event('AddMenuEntry', { - type: 'post', - el: a, - order: 10, - open: function(post) { - ReportLink.post = post; - return !post.isDead; - } - }); - }, - report: function() { - var id, post, set, url; - - post = ReportLink.post; - url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; - id = Date.now(); - set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"; - return window.open(url, id, set); - } - }; - - PSAHiding = { - init: function() { - if (!Conf['Announcement Hiding']) { - return; - } - return $.on(d, '4chanXInitFinished', this.setup); - }, - setup: function() { - var btn, psa, text; - - $.off(d, '4chanXInitFinished', PSAHiding.setup); - if (!(psa = $.id('globalMessage'))) { - return; - } - PSAHiding.btn = btn = $.el('a', { - title: 'Toggle announcement.', - innerHTML: '', - href: 'javascript:;', - textContent: '[ - ]' - }); - $.on(btn, 'click', PSAHiding.toggle); - $.prepend(psa, btn); - text = PSAHiding.trim(psa); - return $.get('hiddenPSAs', [], function(item) { - return PSAHiding.sync(item['hiddenPSAs']); - }); - }, - toggle: function(e) { - var text; - - text = PSAHiding.trim($.id('globalMessage')); - return $.get('hiddenPSAs', [], function(item) { - var hiddenPSAs; - - hiddenPSAs = item.hiddenPSAs; - hiddenPSAs.push(text); - hiddenPSAs = hiddenPSAs.slice(-5); - PSAHiding.sync(hiddenPSAs); - return $.set('hiddenPSAs', hiddenPSAs); - }); - }, - sync: function(hiddenPSAs) { - var btn, psa; - - btn = PSAHiding.btn; - psa = $.id('globalMessage'); - if (hiddenPSAs.contains(PSAHiding.trim(psa))) { - $.rm(psa); - return Style.iconPositions(); - } - }, - trim: function(psa) { - return psa.textContent.replace(/\W+/g, '').toLowerCase(); - } - }; - - CatalogLinks = { - init: function() { - var el, input; - - $.ready(this.ready); - if (!Conf['Catalog Links']) { - return; - } - el = $.el('label', { - id: 'toggleCatalog', - href: 'javascript:;', - innerHTML: "Catalog Links", - title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "." - }); - input = $('input', el); - $.on(input, 'change', this.toggle); - $.sync('Header catalog links', CatalogLinks.set); - $.event('AddMenuEntry', { - type: 'header', - el: el, - order: 95 - }); - return $.on(d, '4chanXInitFinished', function() { - return CatalogLinks.set(Conf['Header catalog links']); - }); - }, - toggle: function() { - var useCatalog; - - $.event('CloseMenu'); - $.set('Header catalog links', useCatalog = this.checked); - return CatalogLinks.set(useCatalog); - }, - set: function(useCatalog) { - var a, board, path, _i, _len, _ref; - - path = useCatalog ? 'catalog' : ''; - _ref = $$('a', $.id('board-list')); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - a = _ref[_i]; - board = a.pathname.split('/')[1]; - if (['f', 'status', '4chan'].contains(board) || !board) { - continue; - } - if (Conf['External Catalog']) { - a.href = useCatalog ? CatalogLinks.external(board) : "//boards.4chan.org/" + board + "/"; - } else { - a.pathname = "/" + board + "/" + path; - } - a.title = useCatalog ? "" + a.title + " - Catalog" : a.title.replace(/\ -\ Catalog$/, ''); - } - return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; - }, - external: function(board) { - return (['a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'].contains(board) ? "http://catalog.neet.tv/" + board : ['d', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'].contains(board) ? "http://4index.gropes.us/" + board : "//boards.4chan.org/" + board + "/catalog"); - }, - ready: function() { - var catalogLink; - - if (catalogLink = $('.pages.cataloglink a', d.body) || $('[href=".././catalog"]', d.body)) { - if (g.VIEW !== 'thread') { - $.add(d.body, catalogLink); - } - return catalogLink.id = 'catalog'; - } - } - }; - - ExpandComment = { - init: function() { - if (g.VIEW !== 'index' || !Conf['Comment Expansion']) { - return; - } - if (g.BOARD.ID === 'g') { - this.callbacks.push(Fourchan.code); - } - if (g.BOARD.ID === 'sci') { - this.callbacks.push(Fourchan.math); - } - return Post.prototype.callbacks.push({ - name: 'Comment Expansion', - cb: this.node - }); - }, - node: function() { - var a; - - if (a = $('.abbr > a', this.nodes.comment)) { - return $.on(a, 'click', ExpandComment.cb); - } - }, - callbacks: [], - cb: function(e) { - var post; - - e.preventDefault(); - post = Get.postFromNode(this); - return ExpandComment.expand(post); - }, - expand: function(post) { - var a; - - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { - $.replace(post.nodes.shortComment, post.nodes.longComment); - post.nodes.comment = post.nodes.longComment; - return; - } - if (!(a = $('.abbr > a', post.nodes.comment))) { - return; - } - a.textContent = "Post No." + post + " Loading..."; - return $.cache("//api.4chan.org" + a.pathname + ".json", function() { - return ExpandComment.parse(this, a, post); - }); - }, - contract: function(post) { - var a; - - if (!post.nodes.shortComment) { - return; - } - a = $('.abbr > a', post.nodes.shortComment); - a.textContent = 'here'; - $.replace(post.nodes.longComment, post.nodes.shortComment); - return post.nodes.comment = post.nodes.shortComment; - }, - parse: function(req, a, post) { - var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - - status = req.status; - if (![200, 304].contains(status)) { - a.textContent = "Error " + req.statusText + " (" + status + ")"; - return; - } - posts = JSON.parse(req.response).posts; - if (spoilerRange = posts[0].custom_spoiler) { - Build.spoilerRange[g.BOARD] = spoilerRange; - } - for (_i = 0, _len = posts.length; _i < _len; _i++) { - postObj = posts[_i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - a.textContent = "Post No." + post + " not found."; - return; - } - comment = post.nodes.comment; - clone = comment.cloneNode(false); - clone.innerHTML = postObj.com; - _ref = $$('.quotelink', clone); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - quote = _ref[_j]; - href = quote.getAttribute('href'); - if (href[0] === '/') { - continue; - } - quote.href = "/" + post.board + "/res/" + href; - } - post.nodes.shortComment = comment; - $.replace(comment, clone); - post.nodes.comment = post.nodes.longComment = clone; - post.parseComment(); - post.parseQuotes(); - _ref1 = ExpandComment.callbacks; - for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { - callback = _ref1[_k]; - callback.call(post); - } - } - }; - - ExpandThread = { - init: function() { - if (g.VIEW !== 'index' || !Conf['Thread Expansion']) { - return; - } - return Thread.prototype.callbacks.push({ - name: 'Thread Expansion', - cb: this.node - }); - }, - node: function() { - var a, span; - - if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { - return; - } - a = $.el('a', { - textContent: "+ " + span.textContent, - className: 'summary', - href: 'javascript:;' - }); - $.on(a, 'click', ExpandThread.cbToggle); - return $.replace(span, a); - }, - cbToggle: function() { - var op; - - op = Get.postFromRoot(this.previousElementSibling); - return ExpandThread.toggle(op.thread); - }, - toggle: function(thread) { - var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - - threadRoot = thread.OP.nodes.root.parentNode; - a = $('.summary', threadRoot); - switch (thread.isExpanded) { - case false: - case void 0: - thread.isExpanded = 'loading'; - _ref = $$('.thread > .postContainer', threadRoot); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - post = _ref[_i]; - ExpandComment.expand(Get.postFromRoot(post)); - } - if (!a) { - thread.isExpanded = true; - return; - } - thread.isExpanded = 'loading'; - a.textContent = a.textContent.replace('+', '× Loading...'); - $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { - return ExpandThread.parse(this, thread, a); - }); - break; - case 'loading': - thread.isExpanded = false; - if (!a) { - return; - } - a.textContent = a.textContent.replace('× Loading...', '+'); - break; - case true: - thread.isExpanded = false; - if (a) { - a.textContent = a.textContent.replace('-', '+'); - num = (function() { - if (thread.isSticky) { - return 1; - } else { - switch (g.BOARD.ID) { - case 'b': - case 'vg': - case 'q': - return 3; - case 't': - return 1; - default: - return 5; - } - } - })(); - replies = $$('.thread > .replyContainer', threadRoot).slice(0, -num); - for (_j = 0, _len1 = replies.length; _j < _len1; _j++) { - reply = replies[_j]; - if (Conf['Quote Inlining']) { - while (inlined = $('.inlined', reply)) { - inlined.click(); - } - } - $.rm(reply); - } - } - _ref1 = $$('.thread > .postContainer', threadRoot); - for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { - post = _ref1[_k]; - ExpandComment.contract(Get.postFromRoot(post)); - } - } - }, - parse: function(req, thread, a) { - var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; - - if (a.textContent[0] === '+') { - return; - } - status = req.status; - if (![200, 304].contains(status)) { - a.textContent = "Error " + req.statusText + " (" + status + ")"; - $.off(a, 'click', ExpandThread.cb.toggle); - return; - } - thread.isExpanded = true; - a.textContent = a.textContent.replace('× Loading...', '-'); - posts = JSON.parse(req.response).posts; - if (spoilerRange = posts[0].custom_spoiler) { - Build.spoilerRange[g.BOARD] = spoilerRange; - } - replies = posts.slice(1); - posts = []; - nodes = []; - for (_i = 0, _len = replies.length; _i < _len; _i++) { - reply = replies[_i]; - if (post = thread.posts[reply.no]) { - nodes.push(post.nodes.root); - continue; - } - node = Build.postFromObject(reply, thread.board); - post = new Post(node, thread, thread.board); - link = $('a[title="Highlight this post"]', node); - link.href = "res/" + thread + "#p" + post; - link.nextSibling.href = "res/" + thread + "#q" + post; - posts.push(post); - nodes.push(node); - } - Main.callbackNodes(Post, posts); - $.after(a, nodes); - return Fourchan.parseThread(thread.ID, 1, nodes.length); - } - }; - - FileInfo = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) { - return; - } - this.funk = this.createFunc(Conf['fileInfo']); - return Post.prototype.callbacks.push({ - name: 'File Info Formatting', - cb: this.node - }); - }, - node: function() { - if (!this.file || this.isClone) { - return; - } - return this.file.text.innerHTML = FileInfo.funk(FileInfo, this); - }, - createFunc: function(format) { - var code; - - code = format.replace(/%(.)/g, function(s, c) { - if (c in FileInfo.formatters) { - return "' + FileInfo.formatters." + c + ".call(post) + '"; - } else { - return s; - } - }); - return Function('FileInfo', 'post', "return '" + code + "'"); - }, - convertUnit: function(size, unit) { - var i; - - if (unit === 'B') { - return "" + (size.toFixed()) + " Bytes"; - } - i = 1 + ['KB', 'MB'].indexOf(unit); - while (i--) { - size /= 1024; - } - size = unit === 'MB' ? Math.round(size * 100) / 100 : size.toFixed(); - return "" + size + " " + unit; - }, - escape: function(name) { - return name.replace(/<|>/g, function(c) { - return c === '<' && '<' || '>'; - }); - }, - formatters: { - t: function() { - return this.file.URL.match(/\d+\..+$/)[0]; - }, - T: function() { - return "" + (FileInfo.formatters.t.call(this)) + ""; - }, - l: function() { - return "" + (FileInfo.formatters.n.call(this)) + ""; - }, - L: function() { - return "" + (FileInfo.formatters.N.call(this)) + ""; - }, - n: function() { - var fullname, shortname; - - fullname = this.file.name; - shortname = Build.shortFilename(this.file.name, this.isReply); - if (fullname === shortname) { - return FileInfo.escape(fullname); - } else { - return "" + (FileInfo.escape(shortname)) + "" + (FileInfo.escape(fullname)) + ""; - } - }, - N: function() { - return FileInfo.escape(this.file.name); - }, - p: function() { - if (this.file.isSpoiler) { - return 'Spoiler, '; - } else { - return ''; - } - }, - s: function() { - return this.file.size; - }, - B: function() { - return FileInfo.convertUnit(this.file.sizeInBytes, 'B'); - }, - K: function() { - return FileInfo.convertUnit(this.file.sizeInBytes, 'KB'); - }, - M: function() { - return FileInfo.convertUnit(this.file.sizeInBytes, 'MB'); - }, - r: function() { - if (this.file.isImage) { - return this.file.dimensions; - } else { - return 'PDF'; - } - } - } - }; - - Fourchan = { - init: function() { - var board; - - if (g.VIEW === 'catalog') { - return; - } - board = g.BOARD.ID; - if (board === 'g') { - $.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML);\n}, false);"); - Post.prototype.callbacks.push({ - name: 'Parse /g/ code', - cb: this.code - }); - } - if (board === 'sci') { - $.globalEval("window.addEventListener('jsmath', function(e) {\n if (jsMath.loaded) {\n // process one post\n jsMath.ProcessBeforeShowing(e.detail);\n } else {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);"); - return Post.prototype.callbacks.push({ - name: 'Parse /sci/ math', - cb: this.math - }); - } - }, - code: function() { - var pre, _i, _len, _ref; - - if (this.isClone) { - return; - } - _ref = $$('.prettyprint', this.nodes.comment); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - pre = _ref[_i]; - $.event('prettyprint', pre, window); - } - }, - math: function() { - if (this.isClone || !$('.math', this.nodes.comment)) { - return; - } - return $.event('jsmath', this.nodes.post, window); - }, - parseThread: function(threadID, offset, limit) { - return $.event('4chanParsingDone', { - threadId: threadID, - offset: offset, - limit: limit - }); - } - }; - - Header = { - init: function() { - var createSubEntry, headerToggler, setting, subEntries, _i, _len, _ref; - - this.menuButton = $.el('span', { - className: 'menu-button', - id: 'main-menu' - }); - this.menu = new UI.Menu('header'); - headerToggler = $.el('label', { - innerHTML: ' Auto-hide header' - }); - this.headerToggler = headerToggler.firstElementChild; - $.on(this.menuButton, 'click', this.menuToggle); - $.on(window, 'load hashchange', Header.hashScroll); - $.on(this.headerToggler, 'change', this.toggleBarVisibility); - createSubEntry = Header.createSubEntry; - subEntries = []; - _ref = ['Sticky top', 'Sticky bottom', 'Top', 'Hide']; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - setting = _ref[_i]; - subEntries.push(createSubEntry(setting)); - } - subEntries.push({ - el: headerToggler - }); - $.event('AddMenuEntry', { - type: 'header', - el: $.el('span', { - textContent: 'Header' - }), - order: 105, - subEntries: subEntries - }); - $.on(d, 'CreateNotification', this.createNotification); - $.asap((function() { - return d.body; - }), function() { - if (!Main.isThisPageLegit()) { - return; - } - return $.asap((function() { - return $.id('boardNavMobile'); - }), Header.setBoardList); - }); - return $.ready(function() { - return $.add(d.body, Header.hover); - }); - }, - bar: $.el('div', { - id: 'notifications' - }), - shortcuts: $.el('span', { - id: 'shortcuts' - }), - hover: $.el('div', { - id: 'hoverUI' - }), - toggle: $.el('div', { - id: 'scroll-marker' - }), - createSubEntry: function(setting) { - var label; - - label = $.el('label', { - textContent: "" + setting - }); - $.on(label, 'click', Header.setBarPosition); - return { - el: label - }; - }, - setBoardList: function() { - var a, boardList, btn, customBoardList, fullBoardList, nav, settings; - - Header.nav = nav = $.id('boardNavDesktop'); - nav.id = 'header-bar'; - if (a = $("a[href*='/" + g.BOARD + "/']", nav)) { - a.className = 'current'; - } - boardList = $.el('span', { - id: 'board-list' - }); - $.add(boardList, fullBoardList = $.el('span', { - id: 'full-board-list' - })); - Header.setBarPosition.call({ - textContent: "" + Conf['Boards Navigation'] - }); - $.sync('Boards Navigation', Header.changeBarPosition); - Header.setBarVisibility(Conf['Header auto-hide']); - $.sync('Header auto-hide', Header.setBarVisibility); - $.prepend(d.body, settings = $.id('navtopright')); - $.add(settings, Header.menuButton); - $.add(fullBoardList, __slice.call(nav.childNodes)); - $.add(nav, [boardList, Header.shortcuts, Header.bar, Header.toggle]); - if (Conf['Custom Board Navigation']) { - fullBoardList.hidden = true; - customBoardList = $.el('span', { - id: 'custom-board-list' - }); - $.add(boardList, customBoardList); - Header.generateBoardList(Conf['boardnav']); - $.sync('boardnav', Header.generateBoardList); - btn = $.el('span', { - className: 'hide-board-list-button', - innerHTML: '[ - ]\u00A0' - }); - $.on(btn, 'click', Header.toggleBoardList); - return $.prepend(fullBoardList, btn); - } else { - return fullBoardList.hidden = false; - } - }, - generateBoardList: function(text) { - var as, list, nodes; - - list = $('#custom-board-list', Header.nav); - $.rmAll(list); - if (!text) { - return; - } - as = $$('#full-board-list a', Header.nav).slice(0, -2); - nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map(function(t) { - var a, board, m, _i, _len; - - if (/^[^\w@]/.test(t)) { - return $.tn(t); - } - if (/^toggle-all/.test(t)) { - a = $.el('a', { - className: 'show-board-list-button', - textContent: (t.match(/-text:"(.+)"/) || [null, '+'])[1], - href: 'javascript:;' - }); - $.on(a, 'click', Header.toggleBoardList); - return a; - } - board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0]; - for (_i = 0, _len = as.length; _i < _len; _i++) { - a = as[_i]; - if (a.textContent === board) { - a = a.cloneNode(true); - if (/-title/.test(t)) { - a.textContent = a.title; - } else if (/-replace/.test(t)) { - if ($.hasClass(a, 'current')) { - a.textContent = a.title; - } - } else if (/-full/.test(t)) { - a.textContent = "/" + board + "/ - " + a.title; - } else if (/-(index|catalog|text)/.test(t)) { - if (m = t.match(/-(index|catalog)/)) { - a.setAttribute('data-only', m[1]); - a.href = "//boards.4chan.org/" + board + "/"; - if (m[1] === 'catalog') { - a.href += 'catalog'; - } - } - if (m = t.match(/-text:"(.+)"/)) { - a.textContent = m[1]; - } - } else if (board === '@') { - $.addClass(a, 'navSmall'); - } - return a; - } - } - return $.tn(t); - }); - return $.add(list, nodes); - }, - toggleBoardList: function() { - var custom, full, nav, showBoardList; - - nav = Header.nav; - custom = $('#custom-board-list', nav); - full = $('#full-board-list', nav); - showBoardList = !full.hidden; - custom.hidden = !showBoardList; - return full.hidden = showBoardList; - }, - setBarPosition: function() { - $.event('CloseMenu'); - Header.changeBarPosition(this.textContent); - Conf['Boards Navigation'] = this.textContent; - return $.set('Boards Navigation', this.textContent); - }, - changeBarPosition: function(setting) { - $.rmClass(doc, 'top'); - $.rmClass(doc, 'fixed'); - $.rmClass(doc, 'bottom'); - $.rmClass(doc, 'hide'); - switch (setting) { - case 'Sticky top': - $.addClass(doc, 'top'); - return $.addClass(doc, 'fixed'); - case 'Sticky bottom': - $.addClass(doc, 'fixed'); - return $.addClass(doc, 'bottom'); - case 'Top': - return $.addClass(doc, 'top'); - case 'Hide': - return $.addClass(doc, 'hide'); - } - }, - setBarVisibility: function(hide) { - Header.headerToggler.checked = hide; - $.event('CloseMenu'); - return (hide ? $.addClass : $.rmClass)(Header.nav, 'autohide'); - }, - hashScroll: function() { - var post; - - if (!(post = this.location.hash.slice(1))) { - return; - } - if ((Get.postFromRoot(post)).isHidden) { - return; - } - return Header.scrollToPost(post); - }, - scrollToPost: function(post) { - var headRect, top; - - top = post.getBoundingClientRect().top; - if (Conf['Boards Navigation'] === 'sticky top') { - headRect = Header.bar.getBoundingClientRect(); - top += -headRect.top - headRect.height; - } - return doc.scrollTop += top; - }, - toggleBarVisibility: function(e) { - var hide, message; - - if (e.type === 'mousedown' && e.button !== 0) { - return; - } - hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); - Conf['Header auto-hide'] = hide; - $.set('Header auto-hide', hide); - Header.setBarVisibility(hide); - message = hide ? 'The header bar will automatically hide itself.' : 'The header bar will remain visible.'; - return new Notification('info', message, 2); - }, - hashScroll: function() { - var hash, post; - - if (!((hash = this.location.hash) && (post = $.id(hash.slice(1))))) { - return; - } - if ((Get.postFromRoot(post)).isHidden) { - return; - } - return Header.scrollToPost(post); - }, - scrollToPost: function(post) { - var headRect, top; - - top = post.getBoundingClientRect().top; - if (Conf['Boards Navigation'] === 'Sticky top') { - headRect = Header.bar.getBoundingClientRect(); - top += -headRect.top - headRect.height; - } - return doc.scrollTop += top; - }, - addShortcut: function(el) { - var shortcut; - - shortcut = $.el('span', { - className: 'shortcut' - }); - $.add(shortcut, [$.tn(' ['), el, $.tn(']')]); - return $.prepend(Header.shortcuts, shortcut); - }, - menuToggle: function(e) { - return Header.menu.toggle(e, this, g); - }, - createNotification: function(e) { - var cb, content, lifetime, notif, type, _ref; - - _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; - notif = new Notification(type, content, lifetime); - if (cb) { - return cb(notif); - } - } - }; - - Keybinds = { - init: function() { - var init; - - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { - return; - } - init = function() { - var node, _i, _len, _ref; - - $.off(d, '4chanXInitFinished', init); - $.on(d, 'keydown', Keybinds.keydown); - _ref = $$('[accesskey]'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - node.removeAttribute('accesskey'); - } - }; - return $.on(d, '4chanXInitFinished', init); - }, - keydown: function(e) { - var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; - - if (!(key = Keybinds.keyCode(e))) { - return; - } - target = e.target; - if (['INPUT', 'TEXTAREA'].contains(target.nodeName)) { - if (!/(Esc|Alt|Ctrl|Meta)/.test(key)) { - return; - } - } - threadRoot = Nav.getThread(); - if (op = $('.op', threadRoot)) { - thread = Get.postFromNode(op).thread; - } - switch (key) { - case Conf['Toggle board list']: - if (Conf['Custom Board Navigation']) { - Header.toggleBoardList(); - } - break; - case Conf['Open empty QR']: - Keybinds.qr(threadRoot); - break; - case Conf['Open QR']: - Keybinds.qr(threadRoot, true); - break; - case Conf['Open settings']: - Settings.open(); - break; - case Conf['Close']: - if ($.id('fourchanx-settings')) { - Settings.close(); - } else if ((notifications = $$('.notification')).length) { - for (_i = 0, _len = notifications.length; _i < _len; _i++) { - notification = notifications[_i]; - $('.close', notification).click(); - } - } else if (QR.nodes) { - QR.close(); - } - break; - case Conf['Spoiler tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('spoiler', target); - break; - case Conf['Code tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('code', target); - break; - case Conf['Eqn tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('eqn', target); - break; - case Conf['Math tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('math', target); - break; - case Conf['Submit QR']: - if (QR.nodes && !QR.status()) { - QR.submit(); - } - break; - case Conf['Watch']: - ThreadWatcher.toggle(thread); - break; - case Conf['Update']: - ThreadUpdater.update(); - break; - case Conf['Expand image']: - Keybinds.img(threadRoot); - break; - case Conf['Expand images']: - Keybinds.img(threadRoot, true); - break; - case Conf['fappeTyme']: - FappeTyme.toggle(); - break; - case Conf['Front page']: - window.location = "/" + g.BOARD + "/0#delform"; - break; - case Conf['Open front page']: - $.open("/" + g.BOARD + "/#delform"); - break; - case Conf['Next page']: - if (form = $('.next form')) { - window.location = form.action; - } - break; - case Conf['Previous page']: - if (form = $('.prev form')) { - window.location = form.action; - } - break; - case Conf['Next thread']: - if (g.VIEW === 'thread') { - return; - } - Nav.scroll(+1); - break; - case Conf['Previous thread']: - if (g.VIEW === 'thread') { - return; - } - Nav.scroll(-1); - break; - case Conf['Expand thread']: - ExpandThread.toggle(thread); - break; - case Conf['Open thread']: - Keybinds.open(thread); - break; - case Conf['Open thread tab']: - Keybinds.open(thread, true); - break; - case Conf['Next reply']: - Keybinds.hl(+1, threadRoot); - break; - case Conf['Previous reply']: - Keybinds.hl(-1, threadRoot); - break; - case Conf['Hide']: - if (g.VIEW === 'index') { - ThreadHiding.toggle(thread); - } - break; - default: - return; - } - e.preventDefault(); - return e.stopPropagation(); - }, - keyCode: function(e) { - var kc, key; - - key = (function() { - switch (kc = e.keyCode) { - case 8: - return ''; - case 13: - return 'Enter'; - case 27: - return 'Esc'; - case 37: - return 'Left'; - case 38: - return 'Up'; - case 39: - return 'Right'; - case 40: - return 'Down'; - default: - if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { - return String.fromCharCode(kc).toLowerCase(); - } else { - return null; - } - } - })(); - if (key) { - if (e.altKey) { - key = 'Alt+' + key; - } - if (e.ctrlKey) { - key = 'Ctrl+' + key; - } - if (e.metaKey) { - key = 'Meta+' + key; - } - if (e.shiftKey) { - key = 'Shift+' + key; - } - } - return key; - }, - qr: function(thread, quote) { - if (!(Conf['Quick Reply'] && QR.postingIsEnabled)) { - return; - } - QR.open(); - if (quote) { - QR.quote.call($('input', $('.post.highlight', thread) || thread)); - } - QR.nodes.com.focus(); - if (Conf['QR Shortcut']) { - return $.rmClass($('.qr-shortcut'), 'disabled'); - } - }, - tags: function(tag, ta) { - var range, selEnd, selStart, value; - - value = ta.value; - selStart = ta.selectionStart; - selEnd = ta.selectionEnd; - ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd); - range = ("[" + tag + "]").length + selEnd; - ta.setSelectionRange(range, range); - return $.event('input', null, ta); - }, - img: function(thread, all) { - var post; - - if (all) { - return ImageExpand.cb.toggleAll(); - } else { - post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread)); - return ImageExpand.toggle(post); - } - }, - open: function(thread, tab) { - var url; - - if (g.VIEW !== 'index') { - return; - } - url = "/" + thread.board + "/res/" + thread; - if (tab) { - return $.open(url); - } else { - return location.href = url; - } - }, - hl: function(delta, thread) { - var headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; - - if (Conf['Fixed Header'] && Conf['Bottom header']) { - topMargin = 0; - } else { - headRect = Header.bar.getBoundingClientRect(); - topMargin = headRect.top + headRect.height; - } - if (postEl = $('.reply.highlight', thread)) { - $.rmClass(postEl, 'highlight'); - rect = postEl.getBoundingClientRect(); - if (rect.bottom >= topMargin && rect.top <= doc.clientHeight) { - root = postEl.parentNode; - next = $.x('child::div[contains(@class,"post reply")]', delta === +1 ? root.nextElementSibling : root.previousElementSibling); - if (!next) { - this.focus(postEl); - return; - } - if (!(g.VIEW === 'thread' || $.x('ancestor::div[parent::div[@class="board"]]', next) === thread)) { - return; - } - rect = next.getBoundingClientRect(); - if (rect.top < 0 || rect.bottom > doc.clientHeight) { - if (delta === -1) { - window.scrollBy(0, rect.top - topMargin); - } else { - next.scrollIntoView(false); - } - } - this.focus(next); - return; - } - } - replies = $$('.reply', thread); - if (delta === -1) { - replies.reverse(); - } - for (_i = 0, _len = replies.length; _i < _len; _i++) { - reply = replies[_i]; - rect = reply.getBoundingClientRect(); - if (delta === +1 && rect.top >= topMargin || delta === -1 && rect.bottom <= doc.clientHeight) { - this.focus(reply); - return; - } - } - }, - focus: function(post) { - return $.addClass(post, 'highlight'); - } - }; - - Redirect = { - init: function() { - return $.sync('archs', this.updateArchives); - }, - updateArchives: function() { - return $.get('archivers', {}, function(_arg) { - var archivers; - - archivers = _arg.archivers; - return Conf['archivers'] = archivers; - }); - }, - image: function(boardID, filename) { - switch (boardID) { - case 'a': - case 'gd': - case 'jp': - case 'm': - case 'q': - case 'tg': - case 'vg': - case 'vp': - case 'vr': - case 'wsg': - return "//archive.foolz.us/" + boardID + "/full_image/" + filename; - case 'u': - return "//nsfw.foolz.us/" + boardID + "/full_image/" + filename; - case 'po': - return "//archive.thedarkcave.org/" + boardID + "/full_image/" + filename; - case 'hr': - case 'tv': - return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename; - case 'ck': - case 'fa': - case 'lit': - case 's4s': - return "//fuuka.warosu.org/" + boardID + "/full_image/" + filename; - case 'cgl': - case 'g': - case 'mu': - case 'w': - return "//rbt.asia/" + boardID + "/full_image/" + filename; - case 'an': - case 'k': - case 'toy': - case 'x': - return "http://archive.heinessen.com/" + boardID + "/full_image/" + filename; - case 'c': - return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename; - } - }, - post: function(boardID, postID) { - var archive, name, _base, _ref; - - if (Redirect.post[boardID] == null) { - _ref = this.archiver; - for (name in _ref) { - archive = _ref[name]; - if (archive.type === 'foolfuuka' && archive.boards.contains(boardID)) { - Redirect.post[boardID] = archive.base; - break; - } - } - (_base = Redirect.post)[boardID] || (_base[boardID] = false); - } - if (Redirect.post[boardID]) { - return "" + Redirect.post[boardID] + "/_/api/chan/post/?board=" + boardID + "&num=" + postID; - } else { - return null; - } - }, - select: function(board) { - var archive, name, _ref, _results; - - _ref = this.archiver; - _results = []; - for (name in _ref) { - archive = _ref[name]; - if (!archive.boards.contains(board)) { - continue; - } - _results.push(name); - } - return _results; - }, - to: function(data) { - var arch, archive, boardID; - - boardID = data.boardID; - if ((arch = Conf.archivers[boardID]) == null) { - Conf.archivers[boardID] = arch = this.select(boardID)[0]; - $.set('archivers', Conf.archivers); - } - return (arch && (archive = this.archiver[arch]) ? Redirect.path(archive.base, archive.type, data) : data.threadID ? "//boards.4chan.org/" + boardID + "/" : null); - }, - archiver: { - 'Foolz': { - base: 'https://archive.foolz.us', - boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'], - type: 'foolfuuka' - }, - 'NSFWFoolz': { - base: 'https://nsfw.foolz.us', - boards: ['u'], - type: 'foolfuuka' - }, - 'TheDarkCave': { - base: 'http://archive.thedarkcave.org', - boards: ['c', 'int', 'out', 'po'], - type: 'foolfuuka' - }, - '4plebs': { - base: 'http://archive.4plebs.org', - boards: ['hr', 'tg', 'tv', 'x'], - base: 'foolfuuka' - }, - 'Warosu': { - base: '//fuuka.warosu.org', - boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'], - type: 'fuuka' - }, - 'InstallGentoo': { - base: '//archive.installgentoo.net', - boards: ['diy', 'g', 'sci'], - type: 'fuuka' - }, - 'RebeccaBlackTech': { - base: '//rbt.asia', - boards: ['an', 'cgl', 'g', 'mu', 'w'], - type: 'fuuka_mail' - }, - 'Heinessen': { - base: 'http://archive.heinessen.com', - boards: ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'], - type: 'fuuka' - }, - 'Cliche': { - base: '//www.cliché.net/4chan/cgi-board.pl', - boards: ['e'], - type: 'fuuka' - }, - 'NyaFuu': { - base: '//archive.nyafuu.org', - boards: ['c', 'w'], - type: 'fuuka' - } - }, - path: function(base, archiver, data) { - var boardID, path, postID, threadID, type, value; - - if (data.isSearch) { - boardID = data.boardID, type = data.type, value = data.value; - type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; - value = encodeURIComponent(value); - if (archiver === 'foolfuuka') { - return "" + base + "/" + boardID + "/search/" + type + "/" + value; - } else if (type === 'image') { - return "" + base + "/" + boardID + "/?task=search2&search_media_hash=" + value; - } else { - return "" + base + "/" + boardID + "/?task=search2&search_" + type + "=" + value; - } - } - boardID = data.boardID, threadID = data.threadID, postID = data.postID; - path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; - if (archiver === 'foolfuuka') { - path += '/'; - } - if (threadID && postID) { - path += archiver === 'foolfuuka' ? "#" + postID : "#p" + postID; - } - return "" + base + "/" + path; - } - }; - - RelativeDates = { - INTERVAL: $.MINUTE / 2, - init: function() { - if (g.VIEW === 'catalog' || !Conf['Relative Post Dates']) { - return; - } - $.on(d, 'visibilitychange ThreadUpdate', this.flush); - this.flush(); - return Post.prototype.callbacks.push({ - name: 'Relative Post Dates', - cb: this.node - }); - }, - node: function() { - var dateEl; - - if (this.isClone) { - return; - } - dateEl = this.nodes.date; - dateEl.title = dateEl.textContent; - return RelativeDates.setUpdate(this); - }, - relative: function(diff, now, date) { - var days, months, number, rounded, unit, years; - - unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); - rounded = Math.round(number); - if (rounded !== 1) { - unit += 's'; - } - return "" + rounded + " " + unit + " ago"; - }, - stale: [], - flush: function() { - var now, update, _i, _len, _ref; - - if (d.hidden) { - return; - } - now = new Date(); - _ref = RelativeDates.stale; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - update = _ref[_i]; - update(now); - } - RelativeDates.stale = []; - clearTimeout(RelativeDates.timeout); - return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); - }, - setUpdate: function(post) { - var markStale, setOwnTimeout, update; - - setOwnTimeout = function(diff) { - var delay; - - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; - return setTimeout(markStale, delay); - }; - update = function(now) { - var date, diff, relative, singlePost, _i, _len, _ref; - - date = post.info.date; - diff = now - date; - relative = RelativeDates.relative(diff, now, date); - _ref = [post].concat(post.clones); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - singlePost = _ref[_i]; - singlePost.nodes.date.firstChild.textContent = relative; - } - return setOwnTimeout(diff); - }; - markStale = function() { - return RelativeDates.stale.push(update); - }; - return update(new Date()); - } - }; - - Report = { - init: function() { - if (!/report/.test(location.search)) { - return; - } - return $.ready(this.ready); - }, - ready: function() { - var field, form; - - form = $('form'); - field = $.id('recaptcha_response_field'); - $.on(field, 'keydown', function(e) { - if (e.keyCode === 8 && !field.value) { - return $.globalEval('Recaptcha.reload("t")'); - } - }); - return $.on(form, 'submit', function(e) { - var response; - - e.preventDefault(); - response = field.value.trim(); - if (!/\s/.test(response)) { - field.value = "" + response + " " + response; - } - return form.submit(); - }); - } - }; - - Nav = { - init: function() { - var append, next, prev, span; - - switch (g.VIEW) { - case 'index': - if (!Conf['Index Navigation']) { - return; - } - break; - case 'thread': - if (!Conf['Reply Navigation']) { - return; - } - break; - default: - return; - } - span = $.el('span', { - id: 'navlinks' - }); - prev = $.el('a', { - href: 'javascript:;' - }); - next = $.el('a', { - href: 'javascript:;' - }); - $.on(prev, 'click', this.prev); - $.on(next, 'click', this.next); - $.add(span, [prev, $.tn(' '), next]); - append = function() { - $.off(d, '4chanXInitFinished', append); - return $.add(d.body, span); - }; - return $.on(d, '4chanXInitFinished', append); - }, - prev: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, 0); - } else { - return Nav.scroll(-1); - } - }, - next: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, d.body.scrollHeight); - } else { - return Nav.scroll(+1); - } - }, - getThread: function(full) { - var headRect, i, rect, thread, threads, topMargin, _i, _len; - - if (Conf['Bottom header']) { - topMargin = 0; - } else { - headRect = Header.bar.getBoundingClientRect(); - topMargin = headRect.top + headRect.height; - } - threads = $$('.thread:not([hidden])'); - for (i = _i = 0, _len = threads.length; _i < _len; i = ++_i) { - thread = threads[i]; - rect = thread.getBoundingClientRect(); - if (rect.bottom > topMargin) { - if (full) { - return [threads, thread, i, rect, topMargin]; - } else { - return thread; - } - } - } - return $('.board'); - }, - scroll: function(delta) { - var i, rect, thread, threads, top, topMargin, _ref, _ref1; - - _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; - top = rect.top - topMargin; - if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) { - i += delta; - } - top = ((_ref1 = threads[i]) != null ? _ref1.getBoundingClientRect().top : void 0) - topMargin; - return window.scrollBy(0, top); - } - }; - - Sauce = { - init: function() { - var link, links, _i, _len, _ref; - - if (g.VIEW === 'catalog' || !Conf['Sauce']) { - return; - } - links = []; - _ref = Conf['sauces'].split('\n'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - if (link[0] === '#') { - continue; - } - links.push(this.createSauceLink(link.trim())); - } - if (!links.length) { - return; - } - this.links = links; - this.link = $.el('a', { - target: '_blank' - }); - return Post.prototype.callbacks.push({ - name: 'Sauce', - cb: this.node - }); - }, - createSauceLink: function(link) { - var m, text; - - link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { - switch (parameter) { - case '%TURL': - return "' + encodeURIComponent(post.file.thumbURL) + '"; - case '%URL': - return "' + encodeURIComponent(post.file.URL) + '"; - case '%MD5': - return "' + encodeURIComponent(post.file.MD5) + '"; - case '%board': - return "' + encodeURIComponent(post.board) + '"; - default: - return parameter; - } - }); - text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1]; - link = link.replace(/;text:.+$/, ''); - return Function('post', 'a', "a.href = '" + link + "';\na.textContent = '" + text + "';\nreturn a;"); - }, - node: function() { - var link, nodes, _i, _len, _ref; - - if (this.isClone || !this.file) { - return; - } - nodes = []; - _ref = Sauce.links; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - nodes.push($.tn('\u00A0'), link(this, Sauce.link.cloneNode(true))); - } - return $.add(this.file.info, nodes); - } - }; - - Time = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Time Formatting']) { - return; - } - this.funk = this.createFunc(Conf['time']); - return Post.prototype.callbacks.push({ - name: 'Time Formatting', - cb: this.node - }); - }, - node: function() { - if (this.isClone) { - return; - } - return this.nodes.date.textContent = Time.funk(Time, this.info.date); - }, - createFunc: function(format) { - var code; - - code = format.replace(/%([A-Za-z])/g, function(s, c) { - if (c in Time.formatters) { - return "' + Time.formatters." + c + ".call(date) + '"; - } else { - return s; - } - }); - return Function('Time', 'date', "return '" + code + "'"); - }, - day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - zeroPad: function(n) { - if (n < 10) { - return "0" + n; - } else { - return n; - } - }, - formatters: { - a: function() { - return Time.day[this.getDay()].slice(0, 3); - }, - A: function() { - return Time.day[this.getDay()]; - }, - b: function() { - return Time.month[this.getMonth()].slice(0, 3); - }, - B: function() { - return Time.month[this.getMonth()]; - }, - d: function() { - return Time.zeroPad(this.getDate()); - }, - e: function() { - return this.getDate(); - }, - H: function() { - return Time.zeroPad(this.getHours()); - }, - I: function() { - return Time.zeroPad(this.getHours() % 12 || 12); - }, - k: function() { - return this.getHours(); - }, - l: function() { - return this.getHours() % 12 || 12; - }, - m: function() { - return Time.zeroPad(this.getMonth() + 1); - }, - M: function() { - return Time.zeroPad(this.getMinutes()); - }, - p: function() { - if (this.getHours() < 12) { - return 'AM'; - } else { - return 'PM'; - } - }, - P: function() { - if (this.getHours() < 12) { - return 'am'; - } else { - return 'pm'; - } - }, - S: function() { - return Time.zeroPad(this.getSeconds()); - }, - y: function() { - return this.getFullYear() - 2000; - } - } - }; - - Favicon = { - init: function() { - return $.ready(function() { - var href; - - Favicon.el = $('link[rel="shortcut icon"]', d.head); - Favicon.el.type = 'image/x-icon'; - href = Favicon.el.href; - Favicon.SFW = /ws\.ico$/.test(href); - Favicon["default"] = href; - return Favicon["switch"](); - }); - }, - "switch": function() { - var unreadDead; - - unreadDead = Favicon.unreadDeadY = Favicon.unreadSFW = Favicon.unreadSFWY = Favicon.unreadNSFW = Favicon.unreadNSFWY = 'data:image/png;base64,'; - switch (Conf['favicon']) { - case 'ferongr': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAS1BMVEUAAAAAAAAAAAAJAAASAAAZAQAaAQAiAQAkAQAoFBQyAgAzAgA1AgA4AABBAgBXAwBzBQCEBgGvCAG/AADoCwLpDAP/gID/q6v///9zILr8AAAAA3RSTlMAx9dmesIgAAAAc0lEQVQY02WPgQ6DIBBDmTqnbE70Cvb/v3TAnW5OSKB9ybXg3HUBOAmEEH4FQtrSn4gxi+xjVC9SVOEiSvbZI8zSV+/Xo7icnryZ15GObMxvtWUkB/VJW57kHU7fUcHStm8FkncGE/mwP6CGzq/eauHwvT7sWQt3gZLW+AAAAABJRU5ErkJggg=='; - Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///8AcH4AtswA2PJ55fKi6fIA1/FtpPADAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPU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byDqfvqGBp20mB5J3Bi3zYH1BD38/eauHwvT7sEAt1Fb320QAAAABJRU5ErkJggg=='; - break; - case 'xat-': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEX9AAD8AAD/AAD+AADAExKKXl2CfHqLkZFub2yfaF3bZ2PzZGL/zs//iYr/AAASAAAGAAAAAAAAAAAAAADpOCseAAAADHRSTlP9MAcAATVYeprJ5O/MbzqoAAAAXklEQVQY03VPQQ7AIAgz8QAG4dL//3VVcVk2Vw4tDVQp9YVyMACIEkIxDEQEGjHFnBjCbPU5EXBfnBns6WRG1Wbuvbtb0z9jr6Qh2KGQenp2/+xpsFQnrePAuulz7QUTuwm5NnwmIAAAAABJRU5ErkJggg=='; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUBAAACAQELCQkPDQwgFBMzKilOSEdva2iEgoCReHOadXClamDIaWbxcG7+hIX+mpv+m5z+oqP+tLX+zc7//f3+9PT97Oz23t750NDbra3zwL87LCwAAAAGAABHAADPAAD/AABkWeLDAAAAHHRSTlO5/fTv8Na2n42lsMvi8v3+/v749OaITDsDAQABSG2w8gAAAGdJREFUCNdNjtEKgDAIRYVGCmsyqCe7q/3/V2azQfpwPehVyQCIMIt4YYTeO7LHKMiGlDIkuh2qofR6obUqhtc4F637XreU1h+m41gcJX/DHyJWXYHzkCMm+hd3a4GezLNr8PQA4bQHEXEQFRJP5NAAAAAASUVORK5CYII='; - Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEUAAAAAAAAAAAAAAABFRUdsa2yRjop4dXVpZ2tdcI9dfKdBirUzlMBHpdxSquRisfOs2/99xv8umMMAAABljCUFAAAAEHRSTlN7FwUAQVt6kZ2/zej59vTv0aAplgAAAGNJREFUGNNtj1EOwCAIQ5eYIPCD0vvfdYi6LJvy0fICN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kwzZlyTNatC5myzMAAAAOPREWAAAAHnRSTlP4/fz331IPBQIBAAECOly37/7+/v7XwpWktNDy+f7X56yoAAAAZElEQVQI102NwQ7AIAhDMdku3JwkIiaz//+VQ9FkcCgvpUAMoKpX9YEJYww0s7YG4iW9Lwl3QCSUZhZSHsHKslqXknPpRPpDypkmtr0cWBGntnseOeKgGd6UAr1Vj8vw9sKFmz+fERAp5vutHwAAAABJRU5ErkJggg=='; - break; - case 'Mayhem': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABIUlEQVQ4jZ2ScWuDMBDFgw4pIkU0WsoQkWAYIkXZH4N9/+/V3dmfXSrKYIFHwt17j8vdGWNMIkgFuaDgzgQnwRs4EQs5KdolUQtagRN0givEDBTEOjgtGs0Zq8F7cKqqusVxrMQLaDUWcjBSrXkn8gs51tpJSWLk9b3HUa0aNIL5gPBR1/V4kJvR7lTwl8GmAm1Gf9+c3S+89qBHa8502AsmSrtBaEBPbIbj0ah2madlNAPEccdgJDfAtWifBjqWKShRBT6KoiH8QlEUn/qt0CCjnNdmPUwmFWzj9Oe6LpKuZXcwqq88z78Pch3aZU3dPwwc2sWlfZKCW5tWluV8kGvXClLm6dYN4/aUqfCbnEOzNDGhGZbNargvxCzvMGfRJD8UaDVvgkzo6QAAAABJRU5ErkJggg=='; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABj0lEQVQ4y42TQUorQRCGv+oekpj43pOhOyIiKoHBxTMkuAnEtWcwx/AY3sUbBIRcwCw8gCfIMkaTOOUiNdgGRRuKoav+v2qq/i4BakBmXweUwDoxLF5ZhVkC64rYBHYMUAIvwKuBMEwdaFiCNbAAngEC0NHkxBi73vsOsG92HGPsphigY1wOzfNhqhpC6AEd730RQuh9hQEOAY6A/jeAs3a7/f+bWB84ckCpqg+I8Osjgqo+AKUDViJS8LkGMcY+sJrNZssYY387LiIFsBLgL9AC/pg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URBVBjTNY3pcsIwEIM3ePERx/bG5IIe0NIT0ur93w4nDLs/pPlGGlGltNG8IdpwMaoidlGSN8zGJ4mOyQqALtZ17IoRSw3meUYv0q+moTCtZrdbZQr3xAMsCdeW6r1SrnW09XmchjaE9vl0evJbUjZ2Q7+AI/BiVQEylkrO/TfwVgD7ZQ/jiA/g3TPptO7t9/gEfpImIw/wez7/iSEdMZcfBnwB16hJOcGEnFL+f70cnKKKbROa2tq6iOXqBuMXGTe4CAUbAAAAAElFTkSuQmCC'; - break; - case 'Original': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX/////AAD///8AAABBZmS3AAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAKAAAoAAAoKCg4AAA4ODg7OztMAACRAADBwcH/AAD///+WCcPSAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQmAUAxEb4Isk0rwp3EPR3ECcRQrh7C3/nAasPwzmCgYuPBy5AH/NALSImqAK+H1oJRqyJVHNAnZqDITVhj7/PrAciJ9il0BHs/jjU+fnB9sQ0IxX6OBO6Xr0xKAxANLZzUanCWzZQAAAABJRU5ErkJggg=='; - Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///8ul8P///8AAACaqgkzAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; - Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAABBQcHFx4KISoNLToaVW4oKCgul8M4ODg7OzvBwcH///8uS/CdAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWoftRGvdwBEewchM7d9BFbE6pbP4Mgj+R5MjjwgP+qQSkRtQAV8K3lVI2Q648oknIRpWZsMI4988HjgvpU+wO8HgeHzR9cjZYhoRiPkcDd0rXpyUAiRd5YjKC7MvNRgAAAABJRU5ErkJggg=='; - Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///9mzDP///8AAACT0n1lAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; - Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAECAIQIAgWLAsePA8oKCg4ODg6dB07OztmzDPBwcH///+rsf3XAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWofRL4x6O4AhuopWb2P4F7E5prP4MgiaSHHlceMA/jYC0iBrgSnjdKaUacuURTUI2qsyEFcaxvD6wnkifYleAx/N449Mn5wfbkFDM52jgTun6tAQg8QAEvjQg42KY2AAAAABJRU5ErkJggg=='; - } - if (Favicon.SFW) { - Favicon.unread = Favicon.unreadSFW; - return Favicon.unreadY = Favicon.unreadSFWY; - } else { - Favicon.unread = Favicon.unreadNSFW; - return Favicon.unreadY = Favicon.unreadNSFWY; - } - }, - empty: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX////b29sAAAAJ2DVhAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=', - dead: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX/////AAAAAACalQKRAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=' - }; - - ThreadExcerpt = { - init: function() { - if (g.VIEW !== 'thread' || !Conf['Thread Excerpt']) { - return; - } - return Thread.prototype.callbacks.push({ - name: 'Thread Excerpt', - cb: this.node - }); - }, - node: function() { - return d.title = Get.threadExcerpt(this); - } - }; - - ThreadStats = { - init: function() { - var html; - - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { - return; - } - html = '0 / 0'; - if (Conf['Thread Updater']) { - this.dialog = $.el('span', { - innerHTML: "[ " + html + " ]" - }); - } else { - this.dialog = UI.dialog('thread-stats', 'bottom: 0; left: 0;', "
" + html + "
"); - } - this.postCountEl = $('#post-count', this.dialog); - this.fileCountEl = $('#file-count', this.dialog); - return Thread.prototype.callbacks.push({ - name: 'Thread Stats', - cb: this.node - }); - }, - node: function() { - var ID, fileCount, post, postCount, _ref; - - postCount = 0; - fileCount = 0; - _ref = this.posts; - for (ID in _ref) { - post = _ref[ID]; - postCount++; - if (post.file) { - fileCount++; - } - } - ThreadStats.thread = this; - ThreadStats.update(postCount, fileCount); - $.on(d, 'ThreadUpdate', ThreadStats.onUpdate); - if (Conf['Thread Updater']) { - return $.asap((function() { - return $('.move', ThreadUpdater.dialog); - }), function() { - return $.prepend($('.move', ThreadUpdater.dialog), ThreadStats.dialog); - }); - } else { - return $.add(d.body, ThreadStats.dialog); - } - }, - onUpdate: function(e) { - var fileCount, postCount, _ref; - - if (e.detail[404]) { - return; - } - _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount; - return ThreadStats.update(postCount, fileCount); - }, - update: function(postCount, fileCount) { - var fileCountEl, postCountEl, thread; - - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; - postCountEl.textContent = postCount; - fileCountEl.textContent = fileCount; - (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning'); - return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning'); - } - }; - - ThreadUpdater = { - init: function() { - var checked, conf, html, name, _ref; - - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { - return; - } - html = ''; - _ref = Config.updater.checkbox; - for (name in _ref) { - conf = _ref[name]; - checked = Conf[name] ? 'checked' : ''; - html += "
"; - } - checked = Conf['Auto Update'] ? 'checked' : ''; - html = "
\n" + html + "\n
\n
\n
"; - this.dialog = UI.dialog('updater', 'bottom: 0; right: 0;', html); - this.timer = $('#update-timer', this.dialog); - this.status = $('#update-status', this.dialog); - this.checkPostCount = 0; - return Thread.prototype.callbacks.push({ - name: 'Thread Updater', - cb: this.node - }); - }, - node: function() { - var input, _i, _len, _ref; - - ThreadUpdater.thread = this; - ThreadUpdater.root = this.OP.nodes.root.parentNode; - ThreadUpdater.lastPost = +ThreadUpdater.root.lastElementChild.id.match(/\d+/)[0]; - ThreadUpdater.outdateCount = 0; - ThreadUpdater.lastModified = '0'; - _ref = $$('input', ThreadUpdater.dialog); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - input = _ref[_i]; - if (input.type === 'checkbox') { - $.on(input, 'change', $.cb.checked); - } - switch (input.name) { - case 'Scroll BG': - $.on(input, 'change', ThreadUpdater.cb.scrollBG); - ThreadUpdater.cb.scrollBG(); - break; - case 'Auto Update This': - $.on(input, 'change', ThreadUpdater.cb.autoUpdate); - $.event('change', null, input); - break; - case 'Interval': - $.on(input, 'change', ThreadUpdater.cb.interval); - ThreadUpdater.cb.interval.call(input); - break; - case 'Update': - $.on(input, 'click', ThreadUpdater.update); - } - } - $.on(window, 'online offline', ThreadUpdater.cb.online); - $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.post); - $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); - ThreadUpdater.cb.online(); - Rice.nodes(ThreadUpdater.dialog); - return $.add(d.body, ThreadUpdater.dialog); - }, - /* - http://freesound.org/people/pierrecartoons1979/sounds/90112/ - cc-by-nc-3.0 - */ - - beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', - cb: { - online: function() { - if (ThreadUpdater.online = navigator.onLine) { - ThreadUpdater.outdateCount = 0; - ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - if (Conf['Auto Update This']) { - ThreadUpdater.update(); - } - ThreadUpdater.set('status', null, null); - } else { - ThreadUpdater.set('timer', null); - ThreadUpdater.set('status', 'Offline', 'warning'); - } - return ThreadUpdater.cb.autoUpdate(); - }, - post: function(e) { - if (!(Conf['Auto Update This'] && e.detail.threadID === ThreadUpdater.thread.ID)) { - return; - } - ThreadUpdater.outdateCount = 0; - if (ThreadUpdater.seconds > 2) { - return setTimeout(ThreadUpdater.update, 1000); - } - }, - checkpost: function() { - if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 10)) { - return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500); - } - ThreadUpdater.checkPostCount = 0; - delete ThreadUpdater.foundPost; - return delete ThreadUpdater.postID; - }, - visibility: function() { - if (d.hidden) { - return; - } - ThreadUpdater.outdateCount = 0; - if (ThreadUpdater.seconds > ThreadUpdater.interval) { - return ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - } - }, - scrollBG: function() { - return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() { - return true; - } : function() { - return !d.hidden; - }; - }, - autoUpdate: function() { - if (Conf['Auto Update This'] && ThreadUpdater.online) { - return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); - } else { - return clearTimeout(ThreadUpdater.timeoutID); - } - }, - interval: function() { - var val; - - val = parseInt(this.value, 10); - ThreadUpdater.interval = this.value = val; - return $.cb.value.call(this); - }, - load: function() { - var klass, req, text, _ref; - - req = ThreadUpdater.req; - switch (req.status) { - case 200: - g.DEAD = false; - ThreadUpdater.parse(JSON.parse(req.response).posts); - ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified'); - ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - break; - case 404: - g.DEAD = true; - ThreadUpdater.set('timer', null); - ThreadUpdater.set('status', '404', 'warning'); - clearTimeout(ThreadUpdater.timeoutID); - ThreadUpdater.thread.kill(); - $.event('ThreadUpdate', { - 404: true, - thread: ThreadUpdater.thread - }); - break; - default: - ThreadUpdater.outdateCount++; - ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - /* - Status Code 304: Not modified - By sending the `If-Modified-Since` header we get a proper status code, and no response. - This saves bandwidth for both the user and the servers and avoid unnecessary computation. - */ - - _ref = [0, 304].contains(req.status) ? [null, null] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1]; - ThreadUpdater.set('status', text, klass); - } - if (ThreadUpdater.postID) { - ThreadUpdater.cb.checkpost(this.status); - } - return delete ThreadUpdater.req; - } - }, - getInterval: function() { - var i, j; - - i = ThreadUpdater.interval; - j = Math.min(ThreadUpdater.outdateCount, 10); - if (!d.hidden) { - j = Math.min(j, 7); - } - return ThreadUpdater.seconds = Conf['Optional Increase'] ? Math.max(i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j]) : i; - }, - set: function(name, text, klass) { - var el, node; - - el = ThreadUpdater[name]; - if (node = el.firstChild) { - node.data = text; - } else { - el.textContent = text; - } - if (klass !== void 0) { - return el.className = klass; - } - }, - timeout: function() { - var n; - - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); - if (!(n = --ThreadUpdater.seconds)) { - return ThreadUpdater.update(); - } else if (n <= -60) { - ThreadUpdater.set('status', 'Retrying', null); - return ThreadUpdater.update(); - } else if (n > 0) { - return ThreadUpdater.set('timer', n); - } - }, - update: function() { - var url; - - if (!ThreadUpdater.online) { - return; - } - ThreadUpdater.seconds = 0; - ThreadUpdater.set('timer', '...'); - if (ThreadUpdater.req) { - ThreadUpdater.req.onloadend = null; - ThreadUpdater.req.abort(); - } - url = "//api.4chan.org/" + ThreadUpdater.thread.board + "/res/" + ThreadUpdater.thread + ".json"; - return ThreadUpdater.req = $.ajax(url, { - onloadend: ThreadUpdater.cb.load - }, { - headers: { - 'If-Modified-Since': ThreadUpdater.lastModified - } - }); - }, - updateThreadStatus: function(title, OP) { - var icon, message, root, titleLC; - - titleLC = title.toLowerCase(); - if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { - return; - } - if (!(ThreadUpdater.thread["is" + title] = !!OP[titleLC])) { - message = title === 'Sticky' ? 'The thread is not a sticky anymore.' : 'The thread is not closed anymore.'; - new Notification('info', message, 30); - $.rm($("." + titleLC + "Icon", ThreadUpdater.thread.OP.nodes.info)); - return; - } - message = title === 'Sticky' ? 'The thread is now a sticky.' : 'The thread is now closed.'; - new Notification('info', message, 30); - icon = $.el('img', { - src: "//static.4chan.org/image/" + titleLC + ".gif", - alt: title, - title: title, - className: "" + titleLC + "Icon" - }); - root = $('[title="Quote this post"]', ThreadUpdater.thread.OP.nodes.info); - if (title === 'Closed') { - root = $('.stickyIcon', ThreadUpdater.thread.OP.nodes.info) || root; - } - return $.after(root, [$.tn(' '), icon]); - }, - parse: function(postObjects) { - var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, scroll, _i, _len, _ref; - - OP = postObjects[0]; - Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; - ThreadUpdater.updateThreadStatus('Sticky', OP); - ThreadUpdater.updateThreadStatus('Closed', OP); - ThreadUpdater.thread.postLimit = !!OP.bumplimit; - ThreadUpdater.thread.fileLimit = !!OP.imagelimit; - posts = []; - index = []; - files = []; - count = 0; - for (_i = 0, _len = postObjects.length; _i < _len; _i++) { - postObject = postObjects[_i]; - num = postObject.no; - index.push(num); - if (postObject.fsize) { - files.push(num); - } - if (num <= ThreadUpdater.lastPost) { - continue; - } - count++; - node = Build.postFromObject(postObject, ThreadUpdater.thread.board); - posts.push(new Post(node, ThreadUpdater.thread, ThreadUpdater.thread.board)); - } - deletedPosts = []; - deletedFiles = []; - _ref = ThreadUpdater.thread.posts; - for (ID in _ref) { - post = _ref[ID]; - ID = +ID; - if (post.isDead && index.contains(ID)) { - post.resurrect(); - } else if (!index.contains(ID)) { - post.kill(); - deletedPosts.push(post); - } else if (post.file && !post.file.isDead && !files.contains(ID)) { - post.kill(true); - deletedFiles.push(post); - } - if (ThreadUpdater.postID) { - if (ID === ThreadUpdater.postID) { - ThreadUpdater.foundPost = true; - } - } - } - if (!count) { - ThreadUpdater.set('status', null, null); - ThreadUpdater.outdateCount++; - } else { - ThreadUpdater.set('status', "+" + count, 'new'); - ThreadUpdater.outdateCount = 0; - if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) { - if (!ThreadUpdater.audio) { - ThreadUpdater.audio = $.el('audio', { - src: ThreadUpdater.beep - }); - } - ThreadUpdater.audio.play(); - } - ThreadUpdater.lastPost = posts[count - 1].ID; - Main.callbackNodes(Post, posts); - scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; - for (key in posts) { - post = posts[key]; - if (!posts.hasOwnProperty(key)) { - continue; - } - if (post.cb) { - if (!post.cb.call(post)) { - $.add(ThreadUpdater.root, post.nodes.root); - } - } else { - $.add(ThreadUpdater.root, post.nodes.root); - } - } - if (scroll) { - if (Conf['Bottom Scroll']) { - doc.scrollTop = d.body.clientHeight; - } else { - Header.scrollToPost(nodes[0]); - } - } - $.queueTask(function() { - var length, threadID; - - threadID = ThreadUpdater.thread.ID; - length = $$('.thread > .postContainer', ThreadUpdater.root).length; - return Fourchan.parseThread(threadID, length - count, length); - }); - } - return $.event('ThreadUpdate', { - 404: false, - thread: ThreadUpdater.thread, - newPosts: posts, - deletedPosts: deletedPosts, - deletedFiles: deletedFiles, - postCount: OP.replies + 1, - fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead) - }); - } - }; - - ThreadWatcher = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Thread Watcher']) { - return; - } - this.dialog = UI.dialog('watcher', 'top: 50px; left: 0px;', '
Thread Watcher
'); - $.on(d, 'QRPostSuccessful', this.cb.post); - $.on(d, '4chanXInitFinished', this.ready); - $.sync('WatchedThreads', this.refresh); - return Thread.prototype.callbacks.push({ - name: 'Thread Watcher', - cb: this.node - }); - }, - node: function() { - var favicon, - _this = this; - - favicon = $.el('img', { - className: 'favicon' - }); - $.on(favicon, 'click', ThreadWatcher.cb.toggle); - $.before($('input', this.OP.nodes.post), favicon); - if (g.VIEW !== 'thread') { - return; - } - return $.get('AutoWatch', 0, function(item) { - if (item['AutoWatch'] !== _this.ID) { - return; - } - ThreadWatcher.watch(_this); - return $["delete"]('AutoWatch'); - }); - }, - ready: function() { - $.off(d, '4chanXInitFinished', ThreadWatcher.ready); - if (!Main.isThisPageLegit()) { - return; - } - ThreadWatcher.refresh(); - return $.add(d.body, ThreadWatcher.dialog); - }, - refresh: function(watched) { - var ID, board, div, favicon, id, link, nodes, props, thread, x, _ref, _ref1; - - if (!watched) { - $.get('WatchedThreads', {}, function(item) { - return ThreadWatcher.refresh(item['WatchedThreads']); - }); - return; - } - nodes = [$('.move', ThreadWatcher.dialog)]; - for (board in watched) { - _ref = watched[board]; - for (id in _ref) { - props = _ref[id]; - x = $.el('a', { - textContent: '×', - href: 'javascript:;' - }); - $.on(x, 'click', ThreadWatcher.cb.x); - link = $.el('a', props); - link.title = link.textContent; - div = $.el('div'); - $.add(div, [x, $.tn(' '), link]); - nodes.push(div); - } - } - $.rmAll(ThreadWatcher.dialog); - $.add(ThreadWatcher.dialog, nodes); - watched = watched[g.BOARD] || {}; - _ref1 = g.BOARD.threads; - for (ID in _ref1) { - thread = _ref1[ID]; - favicon = $('.favicon', thread.OP.nodes.post); - favicon.src = ID in watched ? Favicon["default"] : Favicon.empty; - } - }, - cb: { - toggle: function() { - return ThreadWatcher.toggle(Get.postFromNode(this).thread); - }, - x: function() { - var thread; - - thread = this.nextElementSibling.pathname.split('/'); - return ThreadWatcher.unwatch(thread[1], thread[3]); - }, - post: function(e) { - var board, postID, threadID, _ref; - - _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; - if (postID === threadID) { - if (Conf['Auto Watch']) { - return $.set('AutoWatch', threadID); - } - } else if (Conf['Auto Watch Reply']) { - return ThreadWatcher.watch(board.threads[threadID]); - } - } - }, - toggle: function(thread) { - if ($('.favicon', thread.OP.nodes.post).src === Favicon.empty) { - return ThreadWatcher.watch(thread); - } else { - return ThreadWatcher.unwatch(thread.board, thread.ID); - } - }, - unwatch: function(board, threadID) { - return $.get('WatchedThreads', {}, function(item) { - var watched; - - watched = item['WatchedThreads']; - delete watched[board][threadID]; - if (!Object.keys(watched[board]).length) { - delete watched[board]; - } - ThreadWatcher.refresh(watched); - return $.set('WatchedThreads', watched); - }); - }, - watch: function(thread) { - return $.get('WatchedThreads', {}, function(item) { - var watched, _name; - - watched = item['WatchedThreads']; - watched[_name = thread.board] || (watched[_name] = {}); - watched[thread.board][thread] = { - href: "/" + thread.board + "/res/" + thread, - textContent: Get.threadExcerpt(thread) - }; - ThreadWatcher.refresh(watched); - return $.set('WatchedThreads', watched); - }); - } - }; - - Unread = { - init: function() { - if (g.VIEW !== 'thread' || !Conf['Unread Count'] && !Conf['Unread Favicon']) { - return; - } - this.db = new DataBoard('lastReadPosts', this.sync); - this.hr = $.el('hr', { - id: 'unread-line' - }); - this.posts = []; - this.postsQuotingYou = []; - return Thread.prototype.callbacks.push({ - name: 'Unread', - cb: this.node - }); - }, - node: function() { - var ID, post, posts, _ref; - - Unread.thread = this; - Unread.title = d.title; - posts = []; - _ref = this.posts; - for (ID in _ref) { - post = _ref[ID]; - if (post.isReply) { - posts.push(post); - } - } - Unread.lastReadPost = Unread.db.get({ - boardID: this.board.ID, - threadID: this.ID, - defaultValue: 0 - }); - Unread.addPosts(posts); - $.on(d, 'ThreadUpdate', Unread.onUpdate); - $.on(d, 'scroll visibilitychange', Unread.read); - if (Conf['Unread Line']) { - $.on(d, 'visibilitychange', Unread.setLine); - } - if (!Conf['Scroll to Last Read Post']) { - return; - } - return $.on(window, 'load', function() { - var hash, root; - - if ((hash = location.hash.match(/\d+/)) && hash[0] in this.posts) { - return; - } - if (Unread.posts.length) { - while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) { - if (!(Get.postFromRoot(root)).isHidden) { - break; - } - } - if (!root) { - return; - } - return root.scrollIntoView(false); - } else if (posts.length) { - return Header.scrollToPost(posts[posts.length - 1].nodes.root); - } - }); - }, - sync: function() { - var lastReadPost; - - lastReadPost = Unread.db.get({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - defaultValue: 0 - }); - if (!(Unread.lastReadPost < lastReadPost)) { - return; - } - Unread.lastReadPost = lastReadPost; - Unread.readArray(Unread.posts); - Unread.readArray(Unread.postsQuotingYou); - Unread.setLine(); - return Unread.update(); - }, - addPosts: function(newPosts) { - var ID, data, post, _i, _len; - - for (_i = 0, _len = newPosts.length; _i < _len; _i++) { - post = newPosts[_i]; - ID = post.ID; - if (ID <= Unread.lastReadPost || post.isHidden) { - continue; - } - if (QR.db) { - data = { - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }; - if (QR.db.get(data)) { - continue; - } - } - Unread.posts.push(post); - Unread.addPostQuotingYou(post); - } - if (Conf['Unread Line']) { - Unread.setLine(newPosts.contains(Unread.posts[0])); - } - Unread.read(); - return Unread.update(); - }, - addPostQuotingYou: function(post) { - var quotelink, _i, _len, _ref; - - if (!QR.db) { - return; - } - _ref = post.nodes.quotelinks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quotelink = _ref[_i]; - if (QR.db.get(Get.postDataFromLink(quotelink))) { - Unread.postsQuotingYou.push(post); - } - } - }, - onUpdate: function(e) { - if (e.detail[404]) { - return Unread.update(); - } else { - return Unread.addPosts(e.detail.newPosts); - } - }, - readSinglePost: function(post) { - var i; - - if ((i = Unread.posts.indexOf(post)) === -1) { - return; - } - Unread.posts.splice(i, 1); - if (i === 0) { - Unread.lastReadPost = post.ID; - Unread.saveLastReadPost(); - } - if ((i = Unread.postsQuotingYou.indexOf(post)) !== -1) { - Unread.postsQuotingYou.splice(i, 1); - } - return Unread.update(); - }, - readArray: function(arr) { - var i, post, _i, _len; - - for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { - post = arr[i]; - if (post.ID > Unread.lastReadPost) { - break; - } - } - return arr.splice(0, i); - }, - read: $.debounce(50, function(e) { - var ID, bottom, height, i, post, posts, read; - - if (d.hidden || !Unread.posts.length) { - return; - } - height = doc.clientHeight; - posts = Unread.posts; - read = []; - i = posts.length; - while (post = posts[--i]) { - bottom = post.nodes.root.getBoundingClientRect().bottom; - if (bottom < height) { - ID = post.ID; - posts.remove(post); - } - } - if (!ID) { - return; - } - Unread.lastReadPost = ID; - Unread.saveLastReadPost(); - Unread.readArray(Unread.postsQuotingYou); - if (e) { - return Unread.update(); - } - }), - saveLastReadPost: $.debounce(2 * $.SECOND, function() { - return Unread.db.set({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - val: Unread.lastReadPost - }); - }), - setLine: function(force) { - var post, root; - - if (!(d.hidden || force === true)) { - return; - } - if (post = Unread.posts[0]) { - root = post.nodes.root; - if (root !== $('.thread > .replyContainer', root.parentNode)) { - return $.before(root, Unread.hr); - } - } else { - return $.rm(Unread.hr); - } - }, - update: function() { - var count; - - count = Unread.posts.length; - if (Conf['Unread Count']) { - d.title = "" + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); - } - if (!Conf['Unread Favicon']) { - return; - } - Favicon.el.href = g.DEAD ? Unread.postsQuotingYou.length ? Favicon.unreadDeadY : count ? Favicon.unreadDead : Favicon.dead : count ? Unread.postsQuotingYou.length ? Favicon.unreadY : Favicon.unread : Favicon["default"]; - return $.add(d.head, Favicon.el); - } - }; - QR = { init: function() { var sc; @@ -8870,14 +6620,16 @@ return $.addClass(doc, 'hide-original-post-form'); }); } - $.on(d, '4chanXInitFinished', this.initReady); + $.ready(this.initReady); + if (Conf['Persistent QR']) { + $.on(d, '4chanXInitFinished', this.persist); + } return Post.prototype.callbacks.push({ name: 'Quick Reply', cb: this.node }); }, initReady: function() { - $.off(d, '4chanXInitFinished', QR.initReady); QR.postingIsEnabled = !!$.id('postForm'); if (!QR.postingIsEnabled) { return; @@ -8897,23 +6649,20 @@ $.on(d, 'dragover', QR.dragOver); $.on(d, 'drop', QR.dropFile); $.on(d, 'dragstart dragend', QR.drag); - $.on(d, 'ThreadUpdate', function() { + return $.on(d, 'ThreadUpdate', function() { if (g.DEAD) { return QR.abort(); } else { return QR.status(); } }); - if (Conf['Persistent QR']) { - return QR.persist(); - } }, node: function() { return $.on($('a[title="Quote this post"]', this.nodes.info), 'click', QR.quote); }, persist: function() { QR.open(); - if (Conf['Auto-Hide QR']) { + if (Conf['Auto Hide QR']) { return QR.hide(); } }, @@ -9150,7 +6899,7 @@ elapsed = Math.floor((now - start) / $.SECOND); if (elapsed >= 0) { seconds = Math.max(seconds, types[type] - elapsed); - if (hasFile && upSpd) { + if (Conf['Cooldown Prediction'] && hasFile && upSpd) { seconds -= Math.floor(post.file.size / upSpd * upSpdAccuracy); seconds = Math.max(seconds, 0); } @@ -9840,7 +7589,7 @@ dialog: function() { var dialog, elm, mimeTypes, name, nodes, thread, _i, _j, _len, _len1, _ref, _ref1; - dialog = UI.dialog('qr', 'top:0;right:0;', "
\n Post Form\n ×\n
\n
\n
\n \n \n \n \n
\n
\n \n \n
\n
\n
\n +\n
\n
\n \n No selected file\n \n ×\n \n \n
\n \n
\n \n
\n \n
".replace(/>\s+<')); + dialog = UI.dialog('qr', 'top:0;right:0;', "
Post Form\n×
No selected file×
"); QR.nodes = nodes = { el: dialog, move: $('.move', dialog), @@ -10023,7 +7772,7 @@ } QR.cleanNotifications(); QR.cooldown.auto = QR.posts.length > 1; - if (Conf['Auto-Hide QR'] && !QR.cooldown.auto) { + if (Conf['Auto Hide QR'] && !QR.cooldown.auto) { QR.hide(); } if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) { @@ -10053,7 +7802,7 @@ QR.cooldown.auto = false; QR.status(); return QR.error($.el('span', { - innerHTML: 'Connection error. You may have been banned.' + innerHTML: "Connection error. You may have been banned.\n[FAQ]" })); } }; @@ -10188,613 +7937,1858 @@ } }; - QuoteBacklink = { + FappeTyme = { init: function() { - var format; + var el; - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { + if (!Conf['Fappe Tyme'] && (g.VIEW === 'catalog' || g.BOARD === 'f')) { return; } - format = Conf['backlink'].replace(/%id/g, "' + id + '"); - this.funk = Function('id', "return '" + format + "'"); - this.containers = {}; - Post.prototype.callbacks.push({ - name: 'Quote Backlinking Part 1', - cb: this.firstNode + el = $.el('a', { + href: 'javascript:;', + id: 'fappeTyme', + title: 'Fappe Tyme' + }); + $.on(el, 'click', FappeTyme.toggle); + $.asap((function() { + return $.id('boardNavMobile'); + }), function() { + return $.add($.id('navtopright'), el); }); return Post.prototype.callbacks.push({ - name: 'Quote Backlinking Part 2', - cb: this.secondNode + name: 'Fappe Tyme', + cb: this.node }); }, - firstNode: function() { - var a, clone, container, containers, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; + node: function() { + if (this.file) { + return; + } + return $.addClass(this.nodes.root, "noFile"); + }, + toggle: function() { + return $.toggleClass(doc, 'fappeTyme'); + } + }; - if (this.isClone || !this.quotes.length) { + ImageExpand = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + return; + } + this.EAI = $.el('a', { + id: 'img-controls', + className: 'expand-all-shortcut', + title: 'Expand All Images', + href: 'javascript:;' + }); + $.on(this.EAI, 'click', ImageExpand.cb.toggleAll); + Post.prototype.callbacks.push({ + name: 'Image Expansion', + cb: this.node + }); + return $.asap((function() { + return $.id('delform'); + }), function() { + return $.prepend($.id('delform'), ImageExpand.EAI); + }); + }, + node: function() { + var thumb, _ref; + + if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + return; + } + thumb = this.file.thumb; + $.on(thumb.parentNode, 'click', ImageExpand.cb.toggle); + if (this.isClone && $.hasClass(thumb, 'expanding')) { + ImageExpand.contract(this); + ImageExpand.expand(this); + return; + } + if (ImageExpand.on && !this.isHidden) { + return ImageExpand.expand(this); + } + }, + cb: { + toggle: function(e) { + if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { + return; + } + e.preventDefault(); + return ImageExpand.toggle(Get.postFromNode(this)); + }, + toggleAll: function() { + var ID, file, func, post, _i, _len, _ref, _ref1; + + $.event('CloseMenu'); + if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { + ImageExpand.EAI.className = 'contract-all-shortcut'; + ImageExpand.EAI.title = 'Contract All Images'; + func = ImageExpand.expand; + } else { + ImageExpand.EAI.className = 'expand-all-shortcut'; + ImageExpand.EAI.title = 'Expand All Images'; + func = ImageExpand.contract; + } + _ref = g.posts; + for (ID in _ref) { + post = _ref[ID]; + _ref1 = [post].concat(post.clones); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + post = _ref1[_i]; + file = post.file; + if (!(file && file.isImage && doc.contains(post.nodes.root))) { + continue; + } + if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && file.thumb.getBoundingClientRect().top < 0)) { + continue; + } + $.queueTask(func, post); + } + } + }, + setFitness: function() { + var checked; + + checked = this.checked; + (checked ? $.addClass : $.rmClass)(doc, this.name.toLowerCase().replace(/\s+/g, '-')); + if (this.name !== 'Fit height') { + return; + } + if (checked) { + $.on(window, 'resize', ImageExpand.resize); + if (!ImageExpand.style) { + ImageExpand.style = $.addStyle(null); + } + return ImageExpand.resize(); + } else { + return $.off(window, 'resize', ImageExpand.resize); + } + } + }, + toggle: function(post) { + var headRect, rect, root, thumb, top; + + thumb = post.file.thumb; + if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { + ImageExpand.expand(post); + return; + } + ImageExpand.contract(post); + rect = post.nodes.root.getBoundingClientRect(); + if (!(rect.top <= 0 || rect.left <= 0)) { + return; + } + top = rect.top; + if (Conf['Fixed Header'] && !Conf['Bottom Header']) { + headRect = Header.bar.getBoundingClientRect(); + top += -headRect.top - headRect.height; + } + root = doc; + if (rect.top < 0) { + root.scrollTop += top; + } + if (rect.left < 0) { + return root.scrollLeft = 0; + } + }, + contract: function(post) { + $.rmClass(post.nodes.root, 'expanded-image'); + $.rmClass(post.file.thumb, 'expanding'); + return post.file.isExpanded = false; + }, + expand: function(post, src) { + var img, thumb; + + thumb = post.file.thumb; + if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { + return; + } + $.addClass(thumb, 'expanding'); + if (post.file.fullImage) { + $.asap((function() { + return post.file.fullImage.naturalHeight; + }), function() { + return ImageExpand.completeExpand(post); + }); + return; + } + post.file.fullImage = img = $.el('img', { + className: 'full-image', + src: src || post.file.URL + }); + $.on(img, 'error', ImageExpand.error); + $.asap((function() { + return post.file.fullImage.naturalHeight; + }), function() { + return ImageExpand.completeExpand(post); + }); + return $.after(thumb, img); + }, + completeExpand: function(post) { + var prev, thumb; + + thumb = post.file.thumb; + if (!$.hasClass(thumb, 'expanding')) { + return; + } + post.file.isExpanded = true; + if (!post.nodes.root.parentNode) { + $.addClass(post.nodes.root, 'expanded-image'); + $.rmClass(post.file.thumb, 'expanding'); + return; + } + prev = post.nodes.root.getBoundingClientRect(); + return $.queueTask(function() { + var curr, root; + + $.addClass(post.nodes.root, 'expanded-image'); + $.rmClass(post.file.thumb, 'expanding'); + if (!(prev.top + prev.height <= 0)) { + return; + } + root = doc; + curr = post.nodes.root.getBoundingClientRect(); + return root.scrollTop += curr.height - prev.height + curr.top - prev.top; + }); + }, + error: function() { + var URL, post, src, timeoutID; + + post = Get.postFromNode(this); + $.rm(this); + delete post.file.fullImage; + if (!($.hasClass(post.file.thumb, 'expanding') || $.hasClass(post.nodes.root, 'expanded-image'))) { + return; + } + ImageExpand.contract(post); + src = this.src.split('/'); + if (src[2] === 'images.4chan.org') { + if (URL = Redirect.image(src[3], src[5])) { + setTimeout(ImageExpand.expand, 10000, post, URL); + return; + } + if (g.DEAD || post.isDead || post.file.isDead) { + return; + } + } + timeoutID = setTimeout(ImageExpand.expand, 10000, post); + return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { + onload: function() { + var postObj, _i, _len, _ref; + + if (this.status !== 200) { + return; + } + _ref = JSON.parse(this.response).posts; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + postObj = _ref[_i]; + if (postObj.no === post.ID) { + break; + } + } + if (postObj.no !== post.ID) { + clearTimeout(timeoutID); + return post.kill(); + } else if (postObj.filedeleted) { + clearTimeout(timeoutID); + return post.kill(true); + } + } + }); + }, + menu: { + init: function() { + var conf, createSubEntry, el, key, subEntries, _ref; + + if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + return; + } + el = $.el('span', { + textContent: 'Image Expansion', + className: 'image-expansion-link' + }); + createSubEntry = ImageExpand.menu.createSubEntry; + subEntries = []; + _ref = Config.imageExpansion; + for (key in _ref) { + conf = _ref[key]; + subEntries.push(createSubEntry(key, conf)); + } + return $.event('AddMenuEntry', { + type: 'header', + el: el, + order: 105, + subEntries: subEntries + }); + }, + createSubEntry: function(type, config) { + var input, label; + + label = $.el('label', { + innerHTML: " " + type + }); + input = label.firstElementChild; + if (type === 'Fit width' || type === 'Fit height') { + $.on(input, 'change', ImageExpand.cb.setFitness); + } + if (config) { + label.title = config[1]; + input.checked = Conf[type]; + $.event('change', null, input); + $.on(input, 'change', $.cb.checked); + } + return { + el: label + }; + } + }, + resize: function() { + return ImageExpand.style.textContent = ":root.fit-height .full-image {max-height:" + doc.clientHeight + "px}"; + }, + menuToggle: function(e) { + return ImageExpand.opmenu.toggle(e, this, g); + } + }; + + ImageHover = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Image Hover']) { + return; + } + return Post.prototype.callbacks.push({ + name: 'Image Hover', + cb: this.node + }); + }, + node: function() { + var _ref; + + if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + return; + } + return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover); + }, + mouseover: function(e) { + var el, post; + + post = Get.postFromNode(this); + el = $.el('img', { + id: 'ihover', + src: post.file.URL + }); + el.setAttribute('data-fullid', post.fullID); + $.add(Header.hover, el); + UI.hover({ + root: this, + el: el, + latestEvent: e, + endEvents: 'mouseout click', + asapTest: function() { + return el.naturalHeight; + } + }); + return $.on(el, 'error', ImageHover.error); + }, + error: function() { + var URL, post, src, timeoutID, + _this = this; + + if (!doc.contains(this)) { + return; + } + post = g.posts[this.dataset.fullid]; + src = this.src.split('/'); + if (src[2] === 'images.4chan.org') { + if (URL = Redirect.image(src[3], src[5].replace(/\?.+$/, ''))) { + this.src = URL; + return; + } + if (g.DEAD || post.isDead || post.file.isDead) { + return; + } + } + timeoutID = setTimeout((function() { + return _this.src = post.file.URL + '?' + Date.now(); + }), 3000); + return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { + onload: function() { + var postObj, _i, _len, _ref; + + if (this.status !== 200) { + return; + } + _ref = JSON.parse(this.response).posts; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + postObj = _ref[_i]; + if (postObj.no === post.ID) { + break; + } + } + if (postObj.no !== post.ID) { + clearTimeout(timeoutID); + return post.kill(); + } else if (postObj.filedeleted) { + clearTimeout(timeoutID); + return post.kill(true); + } + } + }); + } + }; + + ImageReplace = { + init: function() { + if (g.VIEW === 'catalog') { + return; + } + return Post.prototype.callbacks.push({ + name: 'Image Replace', + cb: this.node + }); + }, + node: function() { + var URL, img, style, thumb, type, _ref, _ref1; + + if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { + return; + } + _ref1 = this.file, thumb = _ref1.thumb, URL = _ref1.URL; + if (!(Conf["Replace " + ((type = (URL.match(/\w{3}$/))[0].toUpperCase()) === 'PEG' ? 'JPG' : type)] && !/spoiler/.test(thumb.src))) { + return; + } + if (this.file.isSpoiler) { + style = thumb.style; + style.maxHeight = style.maxWidth = this.isReply ? '125px' : '250px'; + } + img = $.el('img'); + $.on(img, 'load', function() { + return thumb.src = URL; + }); + return img.src = URL; + } + }; + + RevealSpoilers = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Reveal Spoilers']) { + return; + } + return Post.prototype.callbacks.push({ + name: 'Reveal Spoilers', + cb: this.node + }); + }, + node: function() { + var thumb, _ref; + + if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { + return; + } + thumb = this.file.thumb; + thumb.removeAttribute('style'); + return thumb.src = this.file.thumbURL; + } + }; + + ArchiveLink = { + init: function() { + var div, entry, type, _i, _len, _ref; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { + return; + } + div = $.el('div', { + textContent: 'Archive' + }); + entry = { + type: 'post', + el: div, + order: 90, + open: function(_arg) { + var ID, board, redirect, thread; + + ID = _arg.ID, thread = _arg.thread, board = _arg.board; + redirect = Redirect.to({ + postID: ID, + threadID: thread.ID, + boardID: board.ID + }); + return redirect !== ("//boards.4chan.org/" + board + "/"); + }, + subEntries: [] + }; + _ref = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['E-mail', 'email'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + type = _ref[_i]; + entry.subEntries.push(this.createSubEntry(type[0], type[1])); + } + return $.event('AddMenuEntry', entry); + }, + createSubEntry: function(text, type) { + var el, open; + + el = $.el('a', { + textContent: text, + target: '_blank' + }); + open = type === 'post' ? function(_arg) { + var ID, board, thread; + + ID = _arg.ID, thread = _arg.thread, board = _arg.board; + el.href = Redirect.to({ + postID: ID, + threadID: thread.ID, + boardID: board.ID + }); + return true; + } : function(post) { + var value; + + value = Filter[type](post); + if (!value) { + return false; + } + el.href = Redirect.to({ + boardID: post.board.ID, + type: type, + value: value, + isSearch: true + }); + return true; + }; + return { + el: el, + open: open + }; + } + }; + + DeleteLink = { + init: function() { + var div, fileEl, fileEntry, postEl, postEntry; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { + return; + } + div = $.el('div', { + className: 'delete-link', + textContent: 'Delete' + }); + postEl = $.el('a', { + className: 'delete-post', + href: 'javascript:;' + }); + fileEl = $.el('a', { + className: 'delete-file', + href: 'javascript:;' + }); + postEntry = { + el: postEl, + open: function() { + postEl.textContent = 'Post'; + $.on(postEl, 'click', DeleteLink["delete"]); + return true; + } + }; + fileEntry = { + el: fileEl, + open: function(_arg) { + var file; + + file = _arg.file; + if (!file || file.isDead) { + return false; + } + fileEl.textContent = 'File'; + $.on(fileEl, 'click', DeleteLink["delete"]); + return true; + } + }; + return $.event('AddMenuEntry', { + type: 'post', + el: div, + order: 40, + open: function(post) { + var node; + + if (post.isDead) { + return false; + } + DeleteLink.post = post; + node = div.firstChild; + node.textContent = 'Delete'; + DeleteLink.cooldown.start(post, node); + return true; + }, + subEntries: [postEntry, fileEntry] + }); + }, + "delete": function() { + var fileOnly, form, link, m, post, pwd; + + post = DeleteLink.post; + if (DeleteLink.cooldown.counting === post) { + return; + } + $.off(this, 'click', DeleteLink["delete"]); + this.textContent = "Deleting " + this.textContent + "..."; + pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $.id('delPassword').value; + fileOnly = $.hasClass(this, 'delete-file'); + form = { + mode: 'usrdel', + onlyimgdel: fileOnly, + pwd: pwd + }; + form[post.ID] = 'delete'; + link = this; + return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), { + onload: function() { + return DeleteLink.load(link, post, fileOnly, this.response); + }, + onerror: function() { + return DeleteLink.error(link); + } + }, { + cred: true, + form: $.formData(form) + }); + }, + load: function(link, post, fileOnly, html) { + var msg, s, tmpDoc; + + tmpDoc = d.implementation.createHTMLDocument(''); + tmpDoc.documentElement.innerHTML = html; + if (tmpDoc.title === '4chan - Banned') { + s = 'Banned!'; + } else if (msg = tmpDoc.getElementById('errmsg')) { + s = msg.textContent; + $.on(link, 'click', DeleteLink["delete"]); + } else { + if (tmpDoc.title === 'Updating index...') { + (post.origin || post).kill(fileOnly); + } + s = 'Deleted'; + } + return link.textContent = s; + }, + error: function(link) { + link.textContent = 'Connection error, please retry.'; + return $.on(link, 'click', DeleteLink["delete"]); + }, + cooldown: { + start: function(post, node) { + var length, seconds, _ref; + + if (!((_ref = QR.db) != null ? _ref.get({ + boardID: post.board.ID, + threadID: post.thread.ID, + postID: post.ID + }) : void 0)) { + delete DeleteLink.cooldown.counting; + return; + } + DeleteLink.cooldown.counting = post; + length = post.board.ID === 'q' ? 600 : 30; + seconds = Math.ceil((length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND); + return DeleteLink.cooldown.count(post, seconds, length, node); + }, + count: function(post, seconds, length, node) { + if (DeleteLink.cooldown.counting !== post) { + return; + } + if (!((0 <= seconds && seconds <= length))) { + if (DeleteLink.cooldown.counting === post) { + node.textContent = 'Delete'; + delete DeleteLink.cooldown.counting; + } + return; + } + setTimeout(DeleteLink.cooldown.count, 1000, post, seconds - 1, length, node); + return node.textContent = "Delete (" + seconds + ")"; + } + } + }; + + DownloadLink = { + init: function() { + var a; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { return; } a = $.el('a', { - href: "/" + this.board + "/res/" + this.thread + "#p" + this, - className: this.isHidden ? 'filtered backlink' : 'backlink', - textContent: (QuoteBacklink.funk(this.ID)) + (Conf['Mark Quotes of You'] && this.info.yours ? QuoteYou.text : '') + className: 'download-link', + textContent: 'Download file' }); - _ref = this.quotes; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; - containers = [QuoteBacklink.getContainer(quote)]; - if ((post = g.posts[quote]) && post.nodes.backlinkContainer) { - _ref1 = post.clones; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - clone = _ref1[_j]; - containers.push(clone.nodes.backlinkContainer); - } - } - for (_k = 0, _len2 = containers.length; _k < _len2; _k++) { - container = containers[_k]; - link = a.cloneNode(true); - if (Conf['Quote Previewing']) { - $.on(link, 'mouseover', QuotePreview.mouseover); - } - if (Conf['Quote Inlining']) { - $.on(link, 'click', QuoteInline.toggle); - } - $.add(container, [$.tn(' '), link]); - } - } - }, - secondNode: function() { - var container; + return $.event('AddMenuEntry', { + type: 'post', + el: a, + order: 70, + open: function(_arg) { + var file; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { - this.nodes.backlinkContainer = $('.container', this.nodes.info); - return; - } - if (!(this.isReply || Conf['OP Backlinks'])) { - return; - } - container = QuoteBacklink.getContainer(this.fullID); - this.nodes.backlinkContainer = container; - return $.add(this.nodes.info, container); - }, - getContainer: function(id) { - var _base; - - return (_base = this.containers)[id] || (_base[id] = $.el('span', { - className: 'container' - })); + file = _arg.file; + if (!file) { + return false; + } + a.href = file.URL; + a.download = file.name; + return true; + } + }); } }; - QuoteCT = { + Menu = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark Cross-thread Quotes']) { + if (g.VIEW === 'catalog' || !Conf['Menu']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.text = '\u00A0(Cross-thread)'; + this.menu = new UI.Menu('post'); return Post.prototype.callbacks.push({ - name: 'Mark Cross-thread Quotes', + name: 'Menu', cb: this.node }); }, node: function() { - var board, boardID, quotelink, quotelinks, quotes, thread, threadID, _i, _len, _ref, _ref1; + var button; - if (this.isClone && this.thread === this.context.thread) { + button = Menu.makeButton(this); + if (this.isClone) { + $.replace($('.menu-button', this.nodes.info), button); return; } - if (!(quotes = this.quotes).length) { - return; - } - quotelinks = this.nodes.quotelinks; - _ref = this.isClone ? this.context : this, board = _ref.board, thread = _ref.thread; - for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { - quotelink = quotelinks[_i]; - _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, threadID = _ref1.threadID; - if (!threadID) { - continue; - } - if (this.isClone) { - quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, ''); - } - if (boardID === this.board.ID && threadID !== thread.ID) { - $.add(quotelink, $.tn(QuoteCT.text)); - } - } - } - }; - - QuoteInline = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Inlining']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Post.prototype.callbacks.push({ - name: 'Quote Inlining', - cb: this.node - }); + return $.add(this.nodes.info, [$.tn('\u00A0'), button]); }, - node: function() { - var link, _i, _len, _ref; + makeButton: (function() { + var a; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - $.on(link, 'click', QuoteInline.toggle); - } - }, + a = null; + return function(post) { + var clone; + + a || (a = $.el('a', { + className: 'menu-button', + innerHTML: '[]', + href: 'javascript:;' + })); + clone = a.cloneNode(true); + clone.setAttribute('data-postid', post.fullID); + if (post.isClone) { + clone.setAttribute('data-clone', true); + } + $.on(clone, 'click', Menu.toggle); + return clone; + }; + })(), toggle: function(e) { - var boardID, context, postID, threadID, _ref; + var post; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { - return; - } - e.preventDefault(); - _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; - context = Get.contextFromLink(this); - if ($.hasClass(this, 'inlined')) { - QuoteInline.rm(this, boardID, threadID, postID, context); - } else { - if ($.x("ancestor::div[@id='p" + postID + "']", this)) { - return; - } - QuoteInline.add(this, boardID, threadID, postID, context); - } - return this.classList.toggle('inlined'); - }, - findRoot: function(quotelink, isBacklink) { - if (isBacklink) { - return quotelink.parentNode.parentNode; - } else { - return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink); - } - }, - add: function(quotelink, boardID, threadID, postID, context) { - var inline, isBacklink, post; - - isBacklink = $.hasClass(quotelink, 'backlink'); - inline = $.el('div', { - id: "i" + postID, - className: 'inline' - }); - $.after(QuoteInline.findRoot(quotelink, isBacklink), inline); - Get.postClone(boardID, threadID, postID, inline, context); - if (!((post = g.posts["" + boardID + "." + postID]) && context.thread === post.thread)) { - return; - } - if (isBacklink && Conf['Forward Hiding']) { - $.addClass(post.nodes.root, 'forwarded'); - post.forwarded++ || (post.forwarded = 1); - } - if (!Unread.posts) { - return; - } - return Unread.readSinglePost(post); - }, - rm: function(quotelink, boardID, threadID, postID, context) { - var el, inlined, isBacklink, post, root, _ref; - - isBacklink = $.hasClass(quotelink, 'backlink'); - root = QuoteInline.findRoot(quotelink, isBacklink); - root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); - $.rm(root); - if (!(el = root.firstElementChild)) { - return; - } - post = g.posts["" + boardID + "." + postID]; - post.rmClone(el.dataset.clone); - if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads["" + boardID + "." + threadID] && !--post.forwarded) { - delete post.forwarded; - $.rmClass(post.nodes.root, 'forwarded'); - } - while (inlined = $('.inlined', el)) { - _ref = Get.postDataFromLink(inlined), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; - QuoteInline.rm(inlined, boardID, threadID, postID, context); - $.rmClass(inlined, 'inlined'); - } + post = this.dataset.clone ? Get.postFromNode(this) : g.posts[this.dataset.postid]; + return Menu.menu.toggle(e, this, post); } }; - QuoteOP = { + ReportLink = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark OP Quotes']) { + var a; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); + a = $.el('a', { + className: 'report-link', + href: 'javascript:;', + textContent: 'Report this post' + }); + $.on(a, 'click', ReportLink.report); + return $.event('AddMenuEntry', { + type: 'post', + el: a, + order: 10, + open: function(post) { + ReportLink.post = post; + return !post.isDead; + } + }); + }, + report: function() { + var id, post, set, url; + + post = ReportLink.post; + url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; + id = Date.now(); + set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"; + return window.open(url, id, set); + } + }; + + Favicon = { + init: function() { + return $.ready(function() { + var href; + + Favicon.el = $('link[rel="shortcut icon"]', d.head); + Favicon.el.type = 'image/x-icon'; + href = Favicon.el.href; + Favicon.SFW = /ws\.ico$/.test(href); + Favicon["default"] = href; + return Favicon["switch"](); + }); + }, + "switch": function() { + var unreadDead; + + unreadDead = Favicon.unreadDeadY = Favicon.unreadSFW = Favicon.unreadSFWY = Favicon.unreadNSFW = Favicon.unreadNSFWY = 'data:image/png;base64,'; + switch (Conf['favicon']) { + case 'ferongr': + Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; + Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAS1BMVEUAAAAAAAAAAAAJAAASA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UeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; + Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAS1BMVEUAAAAAAAAAAAADCgAGEgAIGgAJGwALJAANJwASNwASOAATOgAVQQAWRAAeWwAgKBsoeQAwkQA/wABJ3ABU/gBV/wHM/7Lu/+b////r+K2AAAAAA3RSTlMAx9dmesIgAAAAc0lEQVQY02WPgQ6DIBBDmTonbk70Cvb/v3TAnW5OSKB9ybXg3HUBOAmEEH4FQtrSn4gxi+xjVC9SVOEiSvbZI8zSV+/Xo7icnryZ15GObMxvtWUmB/VJW0byDqfvqGBp20mB5J3Bi3zYH1BD38/eauHwvT7sEAt1Fb320QAAAABJRU5ErkJggg=='; + break; + case 'xat-': + Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEX9AAD8AAD/AAD+AADAExKKXl2CfHqLkZFub2yfaF3bZ2PzZGL/zs//iYr/AAASAAAGAAAAAAAAAAAAAADpOCseAAAADHRSTlP9MAcAATVYeprJ5O/MbzqoAAAAXklEQVQY03VPQQ7AIAgz8QAG4dL//3VVcVk2Vw4tDVQp9YVyMACIEkIxDEQEGjHFnBjCbPU5EXBfnBns6WRG1Wbuvbtb0z9jr6Qh2KGQenp2/+xpsFQnrePAuulz7QUTuwm5NnwmIAAAAABJRU5ErkJggg=='; + Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUBAAACAQELCQkPDQwgFBMzKilOSEdva2iEgoCReHOadXClamDIaWbxcG7+hIX+mpv+m5z+oqP+tLX+zc7//f3+9PT97Oz23t750NDbra3zwL87LCwAAAAGAABHAADPAAD/AABkWeLDAAAAHHRSTlO5/fTv8Na2n42lsMvi8v3+/v749OaITDsDAQABSG2w8gAAAGdJREFUCNdNjtEKgDAIRYVGCmsyqCe7q/3/V2azQfpwPehVyQCIMIt4YYTeO7LHKMiGlDIkuh2qofR6obUqhtc4F637XreU1h+m41gcJX/DHyJWXYHzkCMm+hd3a4GezLNr8PQA4bQHEXEQFRJP5NAAAAAASUVORK5CYII='; + Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEUAAAAAAAAAAAAAAABFRUdsa2yRjop4dXVpZ2tdcI9dfKdBirUzlMBHpdxSquRisfOs2/99xv8umMMAAABljCUFAAAAEHRSTlN7FwUAQVt6kZ2/zej59vTv0aAplgAAAGNJREFUGNNtj1EOwCAIQ5eYIPCD0vvfdYi6LJvy0fICNVzl864DAECVuVKYAeDuEFVJkxPDmM1+TTh6n7oy0FvrWBmF1aIPYspnUGWvSE1A2KGgcvp2AtU3iGJOmcch6pHftTekXQrRd6slMAAAAABJRU5ErkJggg=='; + Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUAAAAAAAAAAAAAAAAREBAWFRY1NDROTE1iYGFzdXp4eoCAgYVlc4mHjZiYoa6zvcqy1/Pg8v+e1f+b1P6X0f2DyP5jsu49msgymcctkLomc5QbPU0SIiwNFxwumMMAAAAAAADALpU1AAAAHnRSTlPNLgcBAAABBxhdc4WznarD8P7+/v3+8/z9/vz2+PUOYDHSAAAAZElEQVQI102OsQ6AMAhEMWGDpTbUQUvu/79ShDYRhuMFDiAGIKIqEgUT3B0akQVxyhgp1XWYldLnhfXTkF5WHdZb69cz9YdPazNQdA0vRK2ahftQDGNjfHHXZjgSV5cRGQHCwS8j7A9loVSnzwAAAABJRU5ErkJggg=='; + Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAA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MVEUBAAAAAAD/AAD///9nZ2f77Y6hAAAAAXRSTlMAQObYZgAAAEBJREFUeF6NjQEKACAMAnfW/98cAxFiBIngOsTqR8B1IGkeG9p5i7XabgAGZNigXgA8aoCUxvzWAIcBItGiSEwdccYA3BuRAWkAAAAASUVORK5CYII='; + Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAAul8NnZ2f////82iC9AAAAAXRSTlMAQObYZgAAAEFJREFUeNqNjgEKACAMAjvX/98cAkkxgmSgO8Bt/Ai4ApJ6KKhzF3OiEMDASrGB/QWgPEHsUpN+Ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC'; + Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAAul8P///9nZ2cgIeMlAAAAAXRSTlMAQObYZgAAAEBJREFUeF6NjQEKACAMAnfW/98cAxFiBIngOsTqR8B1IGkeG9p5i7XabgAGZNigXgA8aoCUxvzWAIcBItGiSEwdccYA3BuRAWkAAAAASUVORK5CYII='; + Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAElBMVEUBAAAAAABmzDNlyjJnZ2f///+6o7dfAAAAAXRSTlMAQObYZgAAAERJREFUeF6NjkEKADEIA51o///lJZfQxUsHITogWi8AvwZJuxmYa25xDooBLEwOWFTYAsYVhdorLZt9Ng9xCUTCUCQ2H3F4ANrZ2WNiAAAAAElFTkSuQmCC'; + Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAElBMVEUBAAAAAABmzDP///9lyjJnZ2cIHys9AAAAAXRSTlMAQObYZgAAAENJREFUeF6NjUEKwEAMAjNm9/9fLkEslFwqgjoEUn8EfAqSdrkwzj6ieyyTkQEVGWRvANfO1iEX620AjgBEwqR4Y+sBeGAA6d+vQ4IAAAAASUVORK5CYII='; + break; + case 'Original': + Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX/////AAD///8AAABBZmS3AAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAKAAAoAAAoKCg4AAA4ODg7OztMAACRAADBwcH/AAD///+WCcPSAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQmAUAxEb4Isk0rwp3EPR3ECcRQrh7C3/nAasPwzmCgYuPBy5AH/NALSImqAK+H1oJRqyJVHNAnZqDITVhj7/PrAciJ9il0BHs/jjU+fnB9sQ0IxX6OBO6Xr0xKAxANLZzUanCWzZQAAAABJRU5ErkJggg=='; + Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///8ul8P///8AAACaqgkzAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAABBQcHFx4KISoNLToaVW4oKCgul8M4ODg7OzvBwcH///8uS/CdAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWoftRGvdwBEewchM7d9BFbE6pbP4Mgj+R5MjjwgP+qQSkRtQAV8K3lVI2Q648oknIRpWZsMI4988HjgvpU+wO8HgeHzR9cjZYhoRiPkcDd0rXpyUAiRd5YjKC7MvNRgAAAABJRU5ErkJggg=='; + Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///9mzDP///8AAACT0n1lAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAECAIQIAgWLAsePA8oKCg4ODg6dB07OztmzDPBwcH///+rsf3XAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWofRL4x6O4AhuopWb2P4F7E5prP4MgiaSHHlceMA/jYC0iBrgSnjdKaUacuURTUI2qsyEFcaxvD6wnkifYleAx/N449Mn5wfbkFDM52jgTun6tAQg8QAEvjQg42KY2AAAAABJRU5ErkJggg=='; } - this.text = '\u00A0(OP)'; - return Post.prototype.callbacks.push({ - name: 'Mark OP Quotes', + if (Favicon.SFW) { + Favicon.unread = Favicon.unreadSFW; + return Favicon.unreadY = Favicon.unreadSFWY; + } else { + Favicon.unread = Favicon.unreadNSFW; + return Favicon.unreadY = Favicon.unreadNSFWY; + } + }, + empty: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX////b29sAAAAJ2DVhAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=', + dead: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX/////AAAAAACalQKRAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=' + }; + + ThreadExcerpt = { + init: function() { + if (g.VIEW !== 'thread' || !Conf['Thread Excerpt']) { + return; + } + return Thread.prototype.callbacks.push({ + name: 'Thread Excerpt', cb: this.node }); }, node: function() { - var boardID, op, postID, quotelink, quotelinks, quotes, _i, _j, _len, _len1, _ref; - - if (this.isClone && this.thread === this.context.thread) { - return; - } - if (!(quotes = this.quotes).length) { - return; - } - quotelinks = this.nodes.quotelinks; - if (this.isClone && quotes.contains(this.thread.fullID)) { - for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { - quotelink = quotelinks[_i]; - quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, ''); - } - } - op = (this.isClone ? this.context : this).thread.fullID; - if (!quotes.contains(op)) { - return; - } - for (_j = 0, _len1 = quotelinks.length; _j < _len1; _j++) { - quotelink = quotelinks[_j]; - _ref = Get.postDataFromLink(quotelink), boardID = _ref.boardID, postID = _ref.postID; - if (("" + boardID + "." + postID) === op) { - $.add(quotelink, $.tn(QuoteOP.text)); - } - } + return d.title = Get.threadExcerpt(this); } }; - QuotePreview = { + ThreadStats = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Previewing']) { + var sc; + + if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Post.prototype.callbacks.push({ - name: 'Quote Previewing', + this.dialog = sc = $.el('span', { + innerHTML: "0 / 0", + id: 'thread-stats' + }); + this.postCountEl = $('#post-count', sc); + this.fileCountEl = $('#file-count', sc); + Header.addShortcut(sc); + return Thread.prototype.callbacks.push({ + name: 'Thread Stats', cb: this.node }); }, node: function() { - var link, _i, _len, _ref; + var ID, fileCount, post, postCount, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - $.on(link, 'mouseover', QuotePreview.mouseover); + postCount = 0; + fileCount = 0; + _ref = this.posts; + for (ID in _ref) { + post = _ref[ID]; + postCount++; + if (post.file) { + fileCount++; + } } + ThreadStats.thread = this; + ThreadStats.update(postCount, fileCount); + return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate); }, - mouseover: function(e) { - var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; + onUpdate: function(e) { + var fileCount, postCount, _ref; - if ($.hasClass(this, 'inlined')) { + if (e.detail[404]) { return; } - _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; - qp = $.el('div', { - id: 'qp', - className: 'dialog' - }); - $.add(Header.hover, qp); - Get.postClone(boardID, threadID, postID, qp, Get.contextFromLink(this)); - UI.hover({ - root: this, - el: qp, - latestEvent: e, - endEvents: 'mouseout click', - cb: QuotePreview.mouseout, - asapTest: function() { - return qp.firstElementChild; - } - }); - if (!(origin = g.posts["" + boardID + "." + postID])) { - return; - } - if (Conf['Quote Highlighting']) { - posts = [origin].concat(origin.clones); - posts.pop(); - for (_i = 0, _len = posts.length; _i < _len; _i++) { - post = posts[_i]; - $.addClass(post.nodes.post, 'qphl'); - } - } - quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0]; - clone = Get.postFromRoot(qp.firstChild); - _ref1 = clone.nodes.quotelinks.concat(__slice.call(clone.nodes.backlinks)); - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - quote = _ref1[_j]; - if (quote.hash.slice(2) === quoterID) { - $.addClass(quote, 'forwardlink'); - } - } + _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount; + return ThreadStats.update(postCount, fileCount); }, - mouseout: function() { - var clone, post, root, _i, _len, _ref; + update: function(postCount, fileCount) { + var fileCountEl, postCountEl, thread; - if (!(root = this.el.firstElementChild)) { - return; - } - clone = Get.postFromRoot(root); - post = clone.origin; - post.rmClone(root.dataset.clone); - if (!Conf['Quote Highlighting']) { - return; - } - _ref = [post].concat(post.clones); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - post = _ref[_i]; - $.rmClass(post.nodes.post, 'qphl'); - } + thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; + postCountEl.textContent = postCount; + fileCountEl.textContent = fileCount; + (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning'); + return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning'); } }; - /* - <3 aeosynth - */ - - - QuoteThreading = { + ThreadUpdater = { init: function() { - var input; + var checked, conf, el, input, name, sc, settings, subEntries, _ref; - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { + if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { return; } - this.enabled = true; - this.controls = $.el('span', { - innerHTML: '' + checked = Conf['Auto Update'] ? 'checked' : ''; + this.dialog = sc = $.el('span', { + innerHTML: "", + id: 'updater' + }); + this.timer = $('#update-timer', sc); + this.status = $('#update-status', sc); + $.on(this.timer, 'click', ThreadUpdater.update); + $.on(this.status, 'click', ThreadUpdater.update); + this.checkPostCount = 0; + Header.addShortcut(sc); + subEntries = []; + _ref = Config.updater.checkbox; + for (name in _ref) { + conf = _ref[name]; + checked = Conf[name] ? 'checked' : ''; + el = $.el('label', { + title: "" + conf[1], + innerHTML: " " + name + }); + input = el.firstElementChild; + $.on(input, 'change', $.cb.checked); + if (input.name === 'Scroll BG') { + $.on(input, 'change', ThreadUpdater.cb.scrollBG); + ThreadUpdater.cb.scrollBG(); + } else if (input.name === 'Auto Update') { + $.on(input, 'change', ThreadUpdater.update); + } + subEntries.push({ + el: el + }); + } + settings = $.el('span', { + innerHTML: 'Interval' + }); + $.on(settings, 'click', this.intervalShortcut); + subEntries.push({ + el: settings }); - input = $('input', this.controls); - $.on(input, 'change', QuoteThreading.toggle); $.event('AddMenuEntry', { type: 'header', - el: this.controls, - order: 98 + el: $.el('span', { + textContent: 'Updater' + }), + order: 110, + subEntries: subEntries }); - $.on(d, '4chanXInitFinished', this.setup); - return Post.prototype.callbacks.push({ - name: 'Quote Threading', + return Thread.prototype.callbacks.push({ + name: 'Thread Updater', cb: this.node }); }, - setup: function() { - var ID, post, posts; - - $.off(d, '4chanXInitFinished', QuoteThreading.setup); - posts = g.posts; - for (ID in posts) { - post = posts[ID]; - if (post.cb) { - post.cb.call(post); - } - } - return QuoteThreading.hasRun = true; - }, node: function() { - var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; + ThreadUpdater.thread = this; + ThreadUpdater.root = this.OP.nodes.root.parentNode; + ThreadUpdater.lastPost = +ThreadUpdater.root.lastElementChild.id.match(/\d+/)[0]; + ThreadUpdater.outdateCount = 0; + ThreadUpdater.lastModified = '0'; + ThreadUpdater.cb.interval.call($.el('input', { + value: Conf['Interval'] + })); + $.on(window, 'online offline', ThreadUpdater.cb.online); + $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.post); + $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); + ThreadUpdater.cb.online(); + return Rice.nodes(ThreadUpdater.dialog); + }, + /* + http://freesound.org/people/pierrecartoons1979/sounds/90112/ + cc-by-nc-3.0 + */ - if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { + beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', + cb: { + online: function() { + if (ThreadUpdater.online = navigator.onLine) { + ThreadUpdater.outdateCount = 0; + ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + ThreadUpdater.update(); + ThreadUpdater.set('status', null, null); + } else { + ThreadUpdater.set('timer', null); + ThreadUpdater.set('status', 'Offline', 'warning'); + } + return ThreadUpdater.cb.autoUpdate(); + }, + post: function(e) { + if (e.detail.threadID !== ThreadUpdater.thread.ID) { + return; + } + ThreadUpdater.outdateCount = 0; + if (ThreadUpdater.seconds > 2) { + return setTimeout(ThreadUpdater.update, 1000); + } + }, + checkpost: function() { + if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 10)) { + return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500); + } + ThreadUpdater.checkPostCount = 0; + delete ThreadUpdater.foundPost; + return delete ThreadUpdater.postID; + }, + visibility: function() { + if (d.hidden) { + return; + } + ThreadUpdater.outdateCount = 0; + if (ThreadUpdater.seconds > ThreadUpdater.interval) { + return ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + } + }, + scrollBG: function() { + return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() { + return true; + } : function() { + return !d.hidden; + }; + }, + autoUpdate: function() { + if (ThreadUpdater.online) { + return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); + } else { + return clearTimeout(ThreadUpdater.timeoutID); + } + }, + interval: function() { + var val; + + val = +this.value; + if (val < 1) { + val = 1; + } + ThreadUpdater.interval = this.value = val; + return $.cb.value.call(this); + }, + load: function() { + var klass, req, text, _ref; + + req = ThreadUpdater.req; + switch (req.status) { + case 200: + g.DEAD = false; + ThreadUpdater.parse(JSON.parse(req.response).posts); + ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified'); + if (Conf['Auto Update']) { + ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + } + break; + case 404: + g.DEAD = true; + ThreadUpdater.set('timer', null); + ThreadUpdater.set('status', '404', 'warning'); + clearTimeout(ThreadUpdater.timeoutID); + ThreadUpdater.thread.kill(); + $.event('ThreadUpdate', { + 404: true, + thread: ThreadUpdater.thread + }); + break; + default: + if (Conf['Auto Update']) { + ThreadUpdater.outdateCount++; + ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + } + /* + Status Code 304: Not modified + By sending the `If-Modified-Since` header we get a proper status code, and no response. + This saves bandwidth for both the user and the servers and avoid unnecessary computation. + */ + + _ref = [0, 304].contains(req.status) ? [null, null] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1]; + ThreadUpdater.set('status', text, klass); + } + if (ThreadUpdater.postID) { + ThreadUpdater.cb.checkpost(this.status); + } + return delete ThreadUpdater.req; + } + }, + getInterval: function() { + var i, j; + + i = ThreadUpdater.interval; + j = Math.min(ThreadUpdater.outdateCount, 10); + if (!d.hidden) { + j = Math.min(j, 7); + } + return ThreadUpdater.seconds = Conf['Optional Increase'] ? Math.max(i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j]) : i; + }, + intervalShortcut: function() { + var settings; + + Settings.open('Advanced'); + settings = $.id('fourchanx-settings'); + return $('input[name=Interval]', settings).focus(); + }, + set: function(name, text, klass) { + var el, node; + + el = ThreadUpdater[name]; + if (node = el.firstChild) { + node.data = text; + } else { + el.textContent = text; + } + if (klass !== void 0) { + return el.className = klass; + } + }, + timeout: function() { + var n; + + ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); + if (!(n = --ThreadUpdater.seconds)) { + return ThreadUpdater.update(); + } else if (n <= -60) { + ThreadUpdater.set('status', 'Retrying', null); + return ThreadUpdater.update(); + } else if (n > 0) { + return ThreadUpdater.set('timer', n); + } + }, + update: function() { + var url; + + if (!ThreadUpdater.online) { return; } - quotes = this.quotes, ID = this.ID, fullID = this.fullID; - posts = g.posts; - if (!(post = posts[fullID]) || post.isHidden) { + ThreadUpdater.seconds = 0; + if (Conf['Auto Update']) { + ThreadUpdater.set('timer', '...'); + } else { + ThreadUpdater.set('timer', 'Update'); + } + if (ThreadUpdater.req) { + ThreadUpdater.req.onloadend = null; + ThreadUpdater.req.abort(); + } + url = "//api.4chan.org/" + ThreadUpdater.thread.board + "/res/" + ThreadUpdater.thread + ".json"; + return ThreadUpdater.req = $.ajax(url, { + onloadend: ThreadUpdater.cb.load + }, { + headers: { + 'If-Modified-Since': ThreadUpdater.lastModified + } + }); + }, + updateThreadStatus: function(title, OP) { + var icon, message, root, titleLC; + + titleLC = title.toLowerCase(); + if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { return; } - uniq = {}; - len = ("" + g.BOARD).length + 1; - for (_i = 0, _len = quotes.length; _i < _len; _i++) { - quote = quotes[_i]; - qid = quote; - if (!(qid.slice(len) < ID)) { + if (!(ThreadUpdater.thread["is" + title] = !!OP[titleLC])) { + message = title === 'Sticky' ? 'The thread is not a sticky anymore.' : 'The thread is not closed anymore.'; + new Notification('info', message, 30); + $.rm($("." + titleLC + "Icon", ThreadUpdater.thread.OP.nodes.info)); + return; + } + message = title === 'Sticky' ? 'The thread is now a sticky.' : 'The thread is now closed.'; + new Notification('info', message, 30); + icon = $.el('img', { + src: "//static.4chan.org/image/" + titleLC + ".gif", + alt: title, + title: title, + className: "" + titleLC + "Icon" + }); + root = $('[title="Quote this post"]', ThreadUpdater.thread.OP.nodes.info); + if (title === 'Closed') { + root = $('.stickyIcon', ThreadUpdater.thread.OP.nodes.info) || root; + } + return $.after(root, [$.tn(' '), icon]); + }, + parse: function(postObjects) { + var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, scroll, _i, _len, _ref; + + OP = postObjects[0]; + Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; + ThreadUpdater.updateThreadStatus('Sticky', OP); + ThreadUpdater.updateThreadStatus('Closed', OP); + ThreadUpdater.thread.postLimit = !!OP.bumplimit; + ThreadUpdater.thread.fileLimit = !!OP.imagelimit; + posts = []; + index = []; + files = []; + count = 0; + for (_i = 0, _len = postObjects.length; _i < _len; _i++) { + postObject = postObjects[_i]; + num = postObject.no; + index.push(num); + if (postObject.fsize) { + files.push(num); + } + if (num <= ThreadUpdater.lastPost) { continue; } - if (qid in posts) { - uniq[qid.slice(len)] = true; + count++; + node = Build.postFromObject(postObject, ThreadUpdater.thread.board); + posts.push(new Post(node, ThreadUpdater.thread, ThreadUpdater.thread.board)); + } + deletedPosts = []; + deletedFiles = []; + _ref = ThreadUpdater.thread.posts; + for (ID in _ref) { + post = _ref[ID]; + ID = +ID; + if (post.isDead && index.contains(ID)) { + post.resurrect(); + } else if (!index.contains(ID)) { + post.kill(); + deletedPosts.push(post); + } else if (post.file && !post.file.isDead && !files.contains(ID)) { + post.kill(true); + deletedFiles.push(post); } - } - keys = Object.keys(uniq); - if (keys.length !== 1) { - return; - } - this.threaded = "" + g.BOARD + "." + keys[0]; - return this.cb = QuoteThreading.nodeinsert; - }, - nodeinsert: function() { - var bottom, height, posts, qpost, qroot, threadContainer, top, _ref; - - posts = g.posts; - qpost = posts[this.threaded]; - delete this.threaded; - delete this.cb; - if (this.thread.OP === qpost) { - return false; - } - if (QuoteThreading.hasRun) { - height = doc.clientHeight; - _ref = qpost.nodes.root.getBoundingClientRect(), bottom = _ref.bottom, top = _ref.top; - if (!(Unread.posts.contains(qpost) || ((bottom < height) && (top > 0)))) { - return false; - } - } - qroot = qpost.nodes.root; - if (!$.hasClass(qroot, 'threadOP')) { - $.addClass(qroot, 'threadOP'); - threadContainer = $.el('div', { - className: 'threadContainer' - }); - $.after(qroot, threadContainer); - } else { - threadContainer = qroot.nextSibling; - } - $.add(threadContainer, this.nodes.root); - return true; - }, - toggle: function() { - var container, containers, node, nodes, replies, reply, thread, _i, _j, _len, _len1; - - thread = $('.thread'); - replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); - QuoteThreading.enabled = this.checked; - if (this.checked) { - nodes = (function() { - var _i, _len, _results; - - _results = []; - for (_i = 0, _len = replies.length; _i < _len; _i++) { - reply = replies[_i]; - _results.push(Get.postFromNode(reply)); + if (ThreadUpdater.postID) { + if (ID === ThreadUpdater.postID) { + ThreadUpdater.foundPost = true; } - return _results; - })(); - for (_i = 0, _len = nodes.length; _i < _len; _i++) { - node = nodes[_i]; - QuoteThreading.node(node); } + } + if (!count) { + ThreadUpdater.set('status', null, null); + ThreadUpdater.outdateCount++; } else { - replies.sort(function(a, b) { - var aID, bID; + ThreadUpdater.set('status', "+" + count, 'new'); + ThreadUpdater.outdateCount = 0; + if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) { + if (!ThreadUpdater.audio) { + ThreadUpdater.audio = $.el('audio', { + src: ThreadUpdater.beep + }); + } + ThreadUpdater.audio.play(); + } + ThreadUpdater.lastPost = posts[count - 1].ID; + Main.callbackNodes(Post, posts); + scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; + for (key in posts) { + post = posts[key]; + if (!posts.hasOwnProperty(key)) { + continue; + } + if (post.cb) { + if (!post.cb.call(post)) { + $.add(ThreadUpdater.root, post.nodes.root); + } + } else { + $.add(ThreadUpdater.root, post.nodes.root); + } + } + if (scroll) { + if (Conf['Bottom Scroll']) { + doc.scrollTop = d.body.clientHeight; + } else { + Header.scrollToPost(nodes[0]); + } + } + $.queueTask(function() { + var length, threadID; - aID = Number(a.id.slice(2)); - bID = Number(b.id.slice(2)); - return aID - bID; + threadID = ThreadUpdater.thread.ID; + length = $$('.thread > .postContainer', ThreadUpdater.root).length; + return Fourchan.parseThread(threadID, length - count, length); }); - $.add(thread, replies); - containers = $$('.threadContainer', thread); - for (_j = 0, _len1 = containers.length; _j < _len1; _j++) { - container = containers[_j]; - $.rm(container); - } - Unread.update(true); } - }, - kb: function() { - var control; - - control = $.id('threadingControl'); - return control.click(); + return $.event('ThreadUpdate', { + 404: false, + thread: ThreadUpdater.thread, + newPosts: posts, + deletedPosts: deletedPosts, + deletedFiles: deletedFiles, + postCount: OP.replies + 1, + fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead) + }); } }; - QuoteYou = { + ThreadWatcher = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark Quotes of You'] || !Conf['Quick Reply']) { + if (!Conf['Thread Watcher']) { return; } - this.text = '\u00A0(You)'; - return Post.prototype.callbacks.push({ - name: 'Mark Quotes of You', + this.dialog = UI.dialog('watcher', 'top: 50px; left: 0px;', '
Thread Watcher
'); + $.on(d, 'QRPostSuccessful', this.cb.post); + $.on(d, '4chanXInitFinished', this.ready); + $.sync('WatchedThreads', this.refresh); + return Thread.prototype.callbacks.push({ + name: 'Thread Watcher', cb: this.node }); }, node: function() { - var quotelink, quotelinks, quotes, _i, _len; + var favicon, + _this = this; - if (this.isClone) { + favicon = $.el('img', { + className: 'favicon' + }); + $.on(favicon, 'click', ThreadWatcher.cb.toggle); + $.before($('input', this.OP.nodes.post), favicon); + if (g.VIEW !== 'thread') { return; } - if (!(quotes = this.quotes).length) { + return $.get('AutoWatch', 0, function(item) { + if (item['AutoWatch'] !== _this.ID) { + return; + } + ThreadWatcher.watch(_this); + return $["delete"]('AutoWatch'); + }); + }, + ready: function() { + $.off(d, '4chanXInitFinished', ThreadWatcher.ready); + if (!Main.isThisPageLegit()) { return; } - quotelinks = this.nodes.quotelinks; - for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { - quotelink = quotelinks[_i]; - if (QR.db.get(Get.postDataFromLink(quotelink))) { - $.add(quotelink, $.tn(QuoteYou.text)); + ThreadWatcher.refresh(); + return $.add(d.body, ThreadWatcher.dialog); + }, + refresh: function(watched) { + var ID, board, div, favicon, id, link, nodes, props, thread, x, _ref, _ref1; + + if (!watched) { + $.get('WatchedThreads', {}, function(item) { + return ThreadWatcher.refresh(item['WatchedThreads']); + }); + return; + } + nodes = [$('.move', ThreadWatcher.dialog)]; + for (board in watched) { + _ref = watched[board]; + for (id in _ref) { + props = _ref[id]; + x = $.el('a', { + textContent: '×', + href: 'javascript:;' + }); + $.on(x, 'click', ThreadWatcher.cb.x); + link = $.el('a', props); + link.title = link.textContent; + div = $.el('div'); + $.add(div, [x, $.tn(' '), link]); + nodes.push(div); } } + $.rmAll(ThreadWatcher.dialog); + $.add(ThreadWatcher.dialog, nodes); + watched = watched[g.BOARD] || {}; + _ref1 = g.BOARD.threads; + for (ID in _ref1) { + thread = _ref1[ID]; + favicon = $('.favicon', thread.OP.nodes.post); + favicon.src = ID in watched ? Favicon["default"] : Favicon.empty; + } + }, + cb: { + toggle: function() { + return ThreadWatcher.toggle(Get.postFromNode(this).thread); + }, + x: function() { + var thread; + + thread = this.nextElementSibling.pathname.split('/'); + return ThreadWatcher.unwatch(thread[1], thread[3]); + }, + post: function(e) { + var board, postID, threadID, _ref; + + _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; + if (postID === threadID) { + if (Conf['Auto Watch']) { + return $.set('AutoWatch', threadID); + } + } else if (Conf['Auto Watch Reply']) { + return ThreadWatcher.watch(board.threads[threadID]); + } + } + }, + toggle: function(thread) { + if ($('.favicon', thread.OP.nodes.post).src === Favicon.empty) { + return ThreadWatcher.watch(thread); + } else { + return ThreadWatcher.unwatch(thread.board, thread.ID); + } + }, + unwatch: function(board, threadID) { + return $.get('WatchedThreads', {}, function(item) { + var watched; + + watched = item['WatchedThreads']; + delete watched[board][threadID]; + if (!Object.keys(watched[board]).length) { + delete watched[board]; + } + ThreadWatcher.refresh(watched); + return $.set('WatchedThreads', watched); + }); + }, + watch: function(thread) { + return $.get('WatchedThreads', {}, function(item) { + var watched, _name; + + watched = item['WatchedThreads']; + watched[_name = thread.board] || (watched[_name] = {}); + watched[thread.board][thread] = { + href: "/" + thread.board + "/res/" + thread, + textContent: Get.threadExcerpt(thread) + }; + ThreadWatcher.refresh(watched); + return $.set('WatchedThreads', watched); + }); } }; - Quotify = { + Unread = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Resurrect Quotes']) { + if (g.VIEW !== 'thread' || !Conf['Unread Count'] && !Conf['Unread Favicon']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Post.prototype.callbacks.push({ - name: 'Resurrect Quotes', + this.db = new DataBoard('lastReadPosts', this.sync); + this.hr = $.el('hr', { + id: 'unread-line' + }); + this.posts = []; + this.postsQuotingYou = []; + return Thread.prototype.callbacks.push({ + name: 'Unread', cb: this.node }); }, node: function() { - var deadlink, _i, _len, _ref; + Unread.thread = this; + Unread.title = d.title; + Unread.lastReadPost = Unread.db.get({ + boardID: this.board.ID, + threadID: this.ID, + defaultValue: 0 + }); + $.on(d, '4chanXInitFinished', Unread.ready); + $.on(d, 'ThreadUpdate', Unread.onUpdate); + return $.on(d, 'scroll visibilitychange', Unread.read); + }, + ready: function() { + var ID, post, posts, _ref; - _ref = $$('.deadlink', this.nodes.comment); + $.off(d, '4chanXInitFinished', Unread.ready); + posts = []; + _ref = Unread.thread.posts; + for (ID in _ref) { + post = _ref[ID]; + if (post.isReply) { + posts.push(post); + } + } + Unread.addPosts(posts); + if (Conf['Unread Line']) { + Unread.setLine(); + } + if (Conf['Scroll to Last Read Post']) { + return Unread.scroll(); + } + }, + scroll: function() { + var hash, post, posts, prevID, root; + + if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { + return; + } + if (Unread.posts.length) { + prevID = 0; + while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) { + post = Get.postFromRoot(root); + if (prevID === post.ID) { + break; + } + prevID = post.ID; + if (!post.isHidden) { + break; + } + } + root.scrollIntoView(false); + return; + } + posts = Object.keys(Unread.thread.posts); + return Header.scrollToPost(Unread.thread.posts[posts[posts.length - 1]].nodes.root); + }, + sync: function() { + var lastReadPost; + + lastReadPost = Unread.db.get({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + defaultValue: 0 + }); + if (!(Unread.lastReadPost < lastReadPost)) { + return; + } + Unread.lastReadPost = lastReadPost; + Unread.readArray(Unread.posts); + Unread.readArray(Unread.postsQuotingYou); + Unread.setLine(); + return Unread.update(); + }, + addPosts: function(newPosts) { + var ID, data, post, _i, _len; + + for (_i = 0, _len = newPosts.length; _i < _len; _i++) { + post = newPosts[_i]; + ID = post.ID; + if (ID <= Unread.lastReadPost || post.isHidden) { + continue; + } + if (QR.db) { + data = { + boardID: post.board.ID, + threadID: post.thread.ID, + postID: post.ID + }; + if (QR.db.get(data)) { + continue; + } + } + Unread.posts.push(post); + Unread.addPostQuotingYou(post); + } + if (Conf['Unread Line']) { + Unread.setLine(newPosts.contains(Unread.posts[0])); + } + Unread.read(); + return Unread.update(); + }, + addPostQuotingYou: function(post) { + var quotelink, _i, _len, _ref; + + if (!QR.db) { + return; + } + _ref = post.nodes.quotelinks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { - deadlink = _ref[_i]; - if (this.isClone) { - if ($.hasClass(deadlink, 'quotelink')) { - this.nodes.quotelinks.push(deadlink); - } - } else { - Quotify.parseDeadlink.call(this, deadlink); + quotelink = _ref[_i]; + if (QR.db.get(Get.postDataFromLink(quotelink))) { + Unread.postsQuotingYou.push(post); } } }, - parseDeadlink: function(deadlink) { - var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; + onUpdate: function(e) { + if (e.detail[404]) { + return Unread.update(); + } else { + return Unread.addPosts(e.detail.newPosts); + } + }, + readSinglePost: function(post) { + var i; - if (deadlink.parentNode.className === 'prettyprint') { - $.replace(deadlink, __slice.call(deadlink.childNodes)); + if ((i = Unread.posts.indexOf(post)) === -1) { return; } - quote = deadlink.textContent; - if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) { + Unread.posts.splice(i, 1); + if (i === 0) { + Unread.lastReadPost = post.ID; + Unread.saveLastReadPost(); + } + if ((i = Unread.postsQuotingYou.indexOf(post)) !== -1) { + Unread.postsQuotingYou.splice(i, 1); + } + return Unread.update(); + }, + readArray: function(arr) { + var i, post, _i, _len; + + for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { + post = arr[i]; + if (post.ID > Unread.lastReadPost) { + break; + } + } + return arr.splice(0, i); + }, + read: $.debounce(50, function(e) { + var ID, bottom, height, i, post, posts, read; + + if (d.hidden || !Unread.posts.length) { return; } - boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; - quoteID = "" + boardID + "." + postID; - if (post = g.posts[quoteID]) { - if (!post.isDead) { - a = $.el('a', { - href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, - className: 'quotelink', - textContent: quote - }); + height = doc.clientHeight; + posts = Unread.posts; + read = []; + i = posts.length; + while (post = posts[--i]) { + bottom = post.nodes.root.getBoundingClientRect().bottom; + if (bottom < height) { + ID = post.ID; + posts.remove(post); + } + } + if (!ID) { + return; + } + Unread.lastReadPost = ID; + Unread.saveLastReadPost(); + Unread.readArray(Unread.postsQuotingYou); + if (e) { + return Unread.update(); + } + }), + saveLastReadPost: $.debounce(2 * $.SECOND, function() { + return Unread.db.set({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + val: Unread.lastReadPost + }); + }), + setLine: function(force) { + var post, root; + + if (!(d.hidden || force === true)) { + return; + } + if (post = Unread.posts[0]) { + root = post.nodes.root; + if (root !== $('.thread > .replyContainer', root.parentNode)) { + return $.before(root, Unread.hr); + } + } else { + return $.rm(Unread.hr); + } + }, + update: function() { + var count; + + count = Unread.posts.length; + if (Conf['Unread Count']) { + d.title = "" + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); + } + if (!Conf['Unread Favicon']) { + return; + } + Favicon.el.href = g.DEAD ? Unread.postsQuotingYou.length ? Favicon.unreadDeadY : count ? Favicon.unreadDead : Favicon.dead : count ? Unread.postsQuotingYou.length ? Favicon.unreadY : Favicon.unread : Favicon["default"]; + return $.add(d.head, Favicon.el); + } + }; + + Redirect = { + init: function() { + return $.sync('archs', this.updateArchives); + }, + updateArchives: function() { + return $.get('archivers', {}, function(_arg) { + var archivers; + + archivers = _arg.archivers; + return Conf['archivers'] = archivers; + }); + }, + image: function(boardID, filename) { + switch (boardID) { + case 'a': + case 'gd': + case 'jp': + case 'm': + case 'q': + case 'tg': + case 'vp': + case 'vr': + case 'wsg': + return "//archive.foolz.us/" + boardID + "/full_image/" + filename; + case 'u': + return "//nsfw.foolz.us/" + boardID + "/full_image/" + filename; + case 'po': + return "//archive.thedarkcave.org/" + boardID + "/full_image/" + filename; + case 'hr': + case 'tv': + return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename; + case 'ck': + case 'fa': + case 'lit': + case 's4s': + return "//fuuka.warosu.org/" + boardID + "/full_image/" + filename; + case 'cgl': + case 'g': + case 'mu': + case 'w': + return "//rbt.asia/" + boardID + "/full_image/" + filename; + case 'an': + case 'k': + case 'toy': + case 'x': + return "http://archive.heinessen.com/" + boardID + "/full_image/" + filename; + case 'c': + return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename; + } + }, + post: function(boardID, postID) { + var archive, name, _base, _ref; + + if (Redirect.post[boardID] == null) { + _ref = this.archiver; + for (name in _ref) { + archive = _ref[name]; + if (archive.type === 'foolfuuka' && archive.boards.contains(boardID)) { + Redirect.post[boardID] = archive.base; + break; + } + } + (_base = Redirect.post)[boardID] || (_base[boardID] = false); + } + if (Redirect.post[boardID]) { + return "" + Redirect.post[boardID] + "/_/api/chan/post/?board=" + boardID + "&num=" + postID; + } else { + return null; + } + }, + select: function(board) { + var archive, name, _ref, _results; + + _ref = this.archiver; + _results = []; + for (name in _ref) { + archive = _ref[name]; + if (!archive.boards.contains(board)) { + continue; + } + _results.push(name); + } + return _results; + }, + to: function(data) { + var arch, archive, boardID; + + boardID = data.boardID; + if ((arch = Conf.archivers[boardID]) == null) { + Conf.archivers[boardID] = arch = this.select(boardID)[0]; + $.set('archivers', Conf.archivers); + } + return (arch && (archive = this.archiver[arch]) ? Redirect.path(archive.base, archive.type, data) : data.threadID ? "//boards.4chan.org/" + boardID + "/" : null); + }, + archiver: { + 'Foolz': { + base: 'https://archive.foolz.us', + boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg'], + type: 'foolfuuka' + }, + 'NSFWFoolz': { + base: 'https://nsfw.foolz.us', + boards: ['u'], + type: 'foolfuuka' + }, + 'TheDarkCave': { + base: 'http://archive.thedarkcave.org', + boards: ['c', 'int', 'out', 'po'], + type: 'foolfuuka' + }, + '4plebs': { + base: 'http://archive.4plebs.org', + boards: ['hr', 'tg', 'tv', 'x'], + base: 'foolfuuka' + }, + 'Warosu': { + base: '//fuuka.warosu.org', + boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'], + type: 'fuuka' + }, + 'InstallGentoo': { + base: '//archive.installgentoo.net', + boards: ['diy', 'g', 'sci'], + type: 'fuuka' + }, + 'RebeccaBlackTech': { + base: '//rbt.asia', + boards: ['an', 'cgl', 'g', 'mu', 'w'], + type: 'fuuka_mail' + }, + 'Heinessen': { + base: 'http://archive.heinessen.com', + boards: ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'], + type: 'fuuka' + }, + 'Cliche': { + base: '//www.cliché.net/4chan/cgi-board.pl', + boards: ['e'], + type: 'fuuka' + }, + 'NyaFuu': { + base: '//archive.nyafuu.org', + boards: ['c', 'w'], + type: 'fuuka' + } + }, + path: function(base, archiver, data) { + var boardID, path, postID, threadID, type, value; + + if (data.isSearch) { + boardID = data.boardID, type = data.type, value = data.value; + type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; + value = encodeURIComponent(value); + if (archiver === 'foolfuuka') { + return "" + base + "/" + boardID + "/search/" + type + "/" + value; + } else if (type === 'image') { + return "" + base + "/" + boardID + "/?task=search2&search_media_hash=" + value; } else { - a = $.el('a', { - href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, - className: 'quotelink deadlink', - target: '_blank', - textContent: "" + quote + "\u00A0(Dead)" - }); - a.setAttribute('data-boardid', boardID); - a.setAttribute('data-threadid', post.thread.ID); - a.setAttribute('data-postid', postID); - } - } else if (redirect = Redirect.to({ - boardID: boardID, - threadID: 0, - postID: postID - })) { - a = $.el('a', { - href: redirect, - className: 'deadlink', - target: '_blank', - textContent: "" + quote + "\u00A0(Dead)" - }); - if (Redirect.post(boardID, postID)) { - $.addClass(a, 'quotelink'); - a.setAttribute('data-boardid', boardID); - a.setAttribute('data-postid', postID); + return "" + base + "/" + boardID + "/?task=search2&search_" + type + "=" + value; } } - if (!this.quotes.contains(quoteID)) { - this.quotes.push(quoteID); + boardID = data.boardID, threadID = data.threadID, postID = data.postID; + path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; + if (archiver === 'foolfuuka') { + path += '/'; } - if (!a) { - deadlink.textContent = "" + quote + "\u00A0(Dead)"; - return; - } - $.replace(deadlink, a); - if ($.hasClass(a, 'quotelink')) { - return this.nodes.quotelinks.push(a); + if (threadID && postID) { + path += archiver === 'foolfuuka' ? "#" + postID : "#p" + postID; } + return "" + base + "/" + path; } }; @@ -10893,56 +9887,77 @@ } }; - CustomCSS = { - init: function() { - if (!Conf['Custom CSS']) { - return; - } - return this.addStyle(); - }, - addStyle: function() { - return this.style = $.addStyle(Conf['usercss']); - }, - rmStyle: function() { - if (this.style) { - $.rm(this.style); - return delete this.style; - } - }, - update: function() { - if (!this.style) { - this.addStyle(); - } - return this.style.textContent = Conf['usercss']; - } - }; - Emoji = { init: function() { - return Emoji.icons.not.push(['PlanNine', Emoji.icons.not[0][1]]); + Emoji.icons['PlanNine'] = Emoji.icons['Plan9']; + return Emoji.icons['Sage'] = Emoji.sage[Conf['sageEmoji']]; }, css: function(position) { - var category, css, icon, key, margin, name, _conf, _i, _len, _ref; + var category, css, icon, key, name, _conf, _ref; _conf = Conf; - css = []; - margin = "margin-" + (position === "before" ? "right" : "left") + ": " + (parseInt(_conf['Emoji Spacing'])) + "px;"; + css = ["a.useremail[href]:last-of-type::" + position + " {\n vertical-align: top;\n margin-" + (position === "before" ? "right" : "left") + ": 5px;\n}\n"]; _ref = Emoji.icons; for (key in _ref) { category = _ref[key]; + if (!Emoji.icons.hasOwnProperty(key)) { + continue; + } if ((_conf['Emoji'] !== "disable ponies" && key === "pony") || (_conf['Emoji'] !== "only ponies" && key === "not")) { - for (_i = 0, _len = category.length; _i < _len; _i++) { - icon = category[_i]; + for (name in category) { + icon = category[name]; + if (!category.hasOwnProperty(name)) { + continue; + } name = icon[0]; - css[css.length] = "a.useremail[href*='" + name + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toLowerCase()) + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toUpperCase()) + "']:last-of-type::" + position + " {\n content: url('data:image/png;base64," + icon[1] + "');\n vertical-align: top;\n " + margin + "\n}\n"; + css.push("a.useremail[href*='" + name + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toLowerCase()) + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toUpperCase()) + "']:last-of-type::" + position + " {\n content: url('data:image/png;base64," + icon + "');\n}\n"); } } } return css.join(""); }, + sage: { + '4chan SS': 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAYAAACZ3F9/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAa9JREFUKFOdkt0rg2EUwM95b2zlL0CRRLngksznXrJsNtYW1tjYhM3mY6+IXZAbikhTKJp8XZAp81UmWYhIRHHhUi60e7s6ntdCa2449es8PfU7z+k5B6AbyuE/wQlc4BcO2d06unAUBCgFE0hianOd3NHIcy8NPwrUf9NBPZcOEi7ayXZiea/1V7+ljaXeYAfOgg2So2TOwQWGnwQafOgi962TnMFmatozUeNu4yetASspVvgXiUvii5K5Nm6z56ol3Hdtpy+cwSYy+HRUt1nLsoEato0kXyh6wTac+24brThWv6MNOYNW9prlG/uxmbRrFaT0VrCspZoNPSUNJNyCBcoiLZuhLH0o9U6UrAfGKCz7RlLM81Q8XUwqr4oKPLIQmnA8IupBigacVy7yrya/2JouhryJHJJNykg+UxLGOtz6+SQNpEiMcduls4Wvoli9WklVKz+ol5SU4U6ngql8Qj2eRI+GyajBhSRH4r3cUxhSeRVhsYBmWUWiyM+UMDmDUI2nsfuSC1I27nLgYZJlP8jhjJ3PY8iE+L8tWx4kQC6MQA5b1D9HNiRCFhx8AF/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+jq8jy8tV55MNBWI4ohS802CpizKv8q+FgALZAfYgSyAZtNro1oLaU1VvxCA029Oraxs7u/tKnXiNjn8HyKwur6lI++6vPK4V7IA7u+1Dyu1tr183ddNbkHuXP8/zEIYeFqiLRl6YO/p0bHJdflT/PD9qZa1W+ry99fcvlAlcZwUpuUAglIRYVgnDEIOlna4q0M/NPnuO1/PzMwg/045O/XeibUt5/Xangx6viSVFpK2jtMpvdyWCz+5ryf10clX3/amp6eZmJjgd441URWWJY8BAAAAAElFTkSuQmCC'], ['Trisquel', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABjFBMVEX///8AAAAAAAAAAAAAADMAAGYAAAAAHFUAGWYAF10AImYAIGAAHloAHGMAKGsAGmYAJmYAJGEAKnUAJ1gAMXYAJnEAJGQAI2EAK28AK3cAGTEAMHgALXEALXgALG0AFUAAI2oAK3EAMngANoYALXMANIAAM4IANIIAL3gANIcANokANoQANYQAOY0ANIYANooAN4kAN40AOY0APZMANIUAOY0AO5AAPZUAPJAAP5MAPpQAQJUAOYsAPpYANoUAPpoAPpUAM4AAQJkAPZIAPJEAQpgAN4cAPpQAPZUAPJEAO4oAOosAOo8AQJoAOYsAO44AQpsAO48AQp0AP5UAQpoARJwAQ58ARaAAQZgAQ54AQ50AQpgARaIARqMARaMARaIAR6QARaIARaEASakARKEAR6MASqsARKEASKcAR6MARqYAR6UATbEATa8ARqUARKAAR6oARqMASKgATK8AR6QATbIATbAASq0AR6cASKgASqwAR6UASKcATa8ASqoASqwAS6wASKoAS60ATbHn4CTpAAAAhHRSTlMAAQIFBQUGCQoLDxAREhMUFBUYGhobHB0eHh8gIiIjJCQkJCYoLC0xMTE0NDo6Oz1BQUNHSUxOVFVVVldaWl5iY2RkZWZoamtsb3FycnR1ent9f4KDhIiJioyNkJGYm5+foqOkpqamqKmqrKytsLKzs7e4uLy8v8TFxcXGx8rO0NXY2eZc4XYcAAAA00lEQVR4XkWN1VoCUQAG/3NWtwh7CT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INpiwbjZiUMZRloVfJQyaXDKObBpimBScpHFe8KmmXpaKhK3arGrBVuVBclHN2CiPNin1OVs1tVJYlQlyZBxA6DviQVo6ZaOKd7sTplw53BVugruBBzfsRslw7rZPxaczWutSpQV/gzJPxo1JexyfaxKBBpuiEx+tw+CpKdEvGWTprGlhcwqbIzL5/DYKMYndpK3L1hxf3ZfkrzwybUZjPhnOqmvlcmutFF1jis9QSShOrcWNSXJ1MA0ou/NZWc8Ddfe4VGO3bk0JON1dyMMlK+gmxNrZCFhZF2Kng7YNO0awt4b7wLNp2EqtAsF6ImP56SG0B6siovTYpIjg15gapCVhAfJRUyIBFEo6k8AyuTtkcC/qvG/XbDexulWJvqgYH0o0nKhVHFJ40XwFQnWM5OCX+XMg86c3KvVMSMapCmPpSTIygTxGKZZOcOXhrr3Mp4uzkFuG6B3ajE3TELDDU8qEmsmvRATxquKkxAnSTFjwKEfv3JU9JC5unG6rQ1bTkbQ4Yq/DVgxOqwBWt2K9Yne3ZCZvrgHO2k5paHzOhSiVCZSkdNTgzy40JRlPgDhDHBCxUZdCs91G8fLeK87zOl6XSOICZYXMGNhDqX9fDP/mbK2DXVi/szm03eLpejl5pzOfqwOt4JBT8OeYwQt/4R/BR0OzXiLCM5LOCji/4nXt46rpywgG+zor5RxgSdupBzJdglSY+5ZZbl3XNY6mbn7W0Lcx06zBg1WBjtcC6OmG+OmRTrFrnIUZESZeVeCpwh8TpiPsQ47/tloM97T+/6m8mg55mT3tStyL54mhlwwtszNvjzD8/6HH8i7PvvPPRioZdRWuDBZUR6pEWG7I8P9Xs1Jsj36MfvvO5J/+rTw58dP7afJPfBgeef3XGz/gskFVpJc4HwGwAAAABJRU5ErkJggg==' + } } }; @@ -11315,7 +10330,7 @@ return null; } } - position = "" + (Conf['Mascot Position'] === 'bottom' || (Conf['Mascot Position'] === "default" && Conf['Post Form Style'] !== "fixed") ? 0 + ((g.VIEW !== 'thread' || Conf['Boards Navigation'] === 'Sticky bottom') && Conf['4chan SS Navigation'] ? 1.6 : 0) : 20.3 + (g.VIEW !== 'thread' || !!$('#postForm input[name=spoiler]') ? 1.4 : 0) + (Conf['Show Post Form Header'] ? 1.5 : 0) + (Conf['Post Form Decorations'] ? 0.2 : 0)) + "em"; + position = "" + (Conf['Mascot Position'] === 'bottom' || (Conf['Mascot Position'] === "default" && Conf['Post Form Style'] !== "fixed") ? 0 + ((g.VIEW !== 'thread' || Conf['Bottom Header']) && Conf['4chan SS Navigation'] ? 1.6 : 0) : 20.3 + (g.VIEW !== 'thread' || !!$('#postForm input[name=spoiler]') ? 1.4 : 0) + (Conf['Show Post Form Header'] ? 1.5 : 0) + (Conf['Post Form Decorations'] ? 0.2 : 0)) + "em"; if (Conf['editMode']) { if (!(mascot = editMascot || (mascot = Mascots[Conf["mascot"]]))) { return; @@ -11753,7 +10768,7 @@ return setTimeout((function() { var exLink; - Style.padding.nav = Header.nav; + Style.padding.nav = Header.bar; Style.padding.pages = $(".pagelist", d.body); Style.padding(); $.on(window, "resize", Style.padding); @@ -11914,7 +10929,7 @@ hide: 2 }[_conf['Sidebar']] || (252 + Style.sidebarOffset.W); Style.replyMargin = _conf["Post Spacing"]; - return css = "/* Cleanup */\n#absbot,\n#delPassword,\n#delform > hr:last-of-type,\n#navbotright,\n#postForm,\n#styleSwitcher,\n.boardBanner > div,\n.mobile,\n.postingMode,\n.riced,\n.sideArrows,\n.stylechanger,\nbody > br,\nbody > div[style^=\"text-align\"],\nbody > hr {\n display: none;\n}\n/* Empties */\n#qr .warning:empty,\n#qr-thread-select:empty {\n display: none;\n}\n/* File Name Trunctuate */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\n display: none;\n}\n/* Unnecessary */\n#qp input,\n#qp .rice,\n.inline .rice {\n display: none !important;\n}\n/* Hidden Content */\n.forwarded,\n.hidden_thread ~ div,\n.hidden_thread ~ a,\n.replyContainer .stub ~ div,\n.replyContainer .stub ~ a,\n.stub + div,\n[hidden] {\n display: none !important;\n}\n/* Hidden UI */\n#catalog,\n#navlinks,\n#navtopright,\n.cataloglink,\n.navLinks,\na[style=\"cursor: pointer; float: right;\"] {\n position: fixed;\n top: 100%;\n left: 100%;\n}\n/* Hide last horizontal rule, keep clear functionality. */\n.board > hr:last-of-type {\n visibility: hidden;\n}\n/* Fappe Tyme */\n.fappeTyme .thread > .noFile {\n display: none;\n}\n/* Defaults */\na {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n outline: none;\n}\nbody,\nhtml {\n min-height: 100%;\n " + Style.sizing + ": border-box;\n}\nbody {\n outline: none;\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n min-height: 100%;\n margin-top: 0;\n margin-bottom: 0;\n margin-" + Style.sidebarLocation[0] + ": " + (/^boards\.4chan\.org$/.test(location.hostname) ? Style.sidebar : '2') + "px;\n margin-" + Style.sidebarLocation[1] + ": 2px;\n padding: 0 " + (parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px 0 " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"]) + "px;\n}\nbody.unscroll {\n overflow: hidden;\n}\n" + (_conf["4chan SS Sidebar"] && /^boards\.4chan\.org$/.test(location.hostname) ? "body::before { content: ''; position: fixed; top: 0; bottom: 0; " + Style.sidebarLocation[0] + ": 0; width: " + (_conf['Sidebar'] === 'large' ? 305 : _conf['Sidebar'] === 'normal' ? 254 : _conf['Sidebar'] === 'minimal' ? 27 : 0) + "px; z-index: 1; " + Style.sizing + ": border-box; display: block;}body { padding-" + Style.sidebarLocation[0] + ": 2px;}" : "") + "\nbutton,\ninput,\ntextarea {\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n}\nhr {\n clear: both;\n border: 0;\n padding: 0;\n margin: 0 0 1px;\n " + (_conf['Hide Horizontal Rules'] ? 'visibility: hidden;' : '') + "\n}\n.center {\n text-align: center;\n}\n.disabled {\n opacity: 0.5;\n}\n/* Symbols */\n.drop-marker {\n vertical-align: middle;\n display: inline-block;\n margin: 2px 2px 3px;\n border-top: .5em solid;\n border-right: .3em solid transparent;\n border-left: .3em solid transparent;\n}\n.brackets-wrap::before {\n content: \"\\00a0[\";\n}\n.brackets-wrap::after {\n content: \"]\\00a0\";\n}\n/* Thread / Reply Nav */\n#navlinks a {\n position: fixed;\n z-index: 12;\n opacity: 0.5;\n display: inline-block;\n border-right: 6px solid transparent;\n border-left: 6px solid transparent;\n margin: 1.5px;\n}\n/* Header */\n#header-bar {\n z-index: 6;\n border-width: 1px;\n position: absolute;\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + (_conf["Hide Navigation Decorations"] ? " font-size: 0; color: transparent; word-spacing: 2px;" : "") + "\n text-align: " + _conf["Navigation Alignment"] + ";\n}\n.fixed #header-bar {\n position: fixed;\n}\n.top #header-bar {\n top: 0;\n border-top-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : "") + "\"\n}\n.fixed.bottom #header-bar {\n bottom: 0;\n border-bottom-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\"\n}\n.hide #header-bar {\n position: fixed;\n top: 110%;\n bottom: auto;\n}\n/* Header Autohide */\n.fixed #header-bar.autohide:not(:hover) {\n box-shadow: none;\n transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);\n}\n.fixed.top #header-bar.autohide:not(:hover) {\n margin-bottom: -1em;\n " + agent + "transform: translateY(-100%);\n}\n.fixed.bottom #header-bar.autohide:not(:hover) {\n " + agent + "transform: translateY(100%);\n}\n#scroll-marker {\n left: 0;\n right: 0;\n height: 10px;\n position: absolute;\n}\n#header-bar #scroll-marker {\n display: none;\n}\n.fixed #header-bar #scroll-marker {\n display: block;\n}\n.fixed.top header-bar #scroll-marker {\n top: 100%;\n}\n.fixed.bottom #header-bar #scroll-marker {\n bottom: 100%;\n}\n/* Notifications */\n#notifications {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n}\n.fixed.top #notifications {\n position: absolute;\n top: 100%;\n}\n.notification {\n display: block;\n overflow: hidden;\n width: 300px;\n border: 1px solid;\n " + (_conf['Sidebar Location'] === 'left' ? 'margin-left: auto;' : '') + "\n}\n.notification:not(:first-of-type) {\n border-top: none;\n}\n.close {\n float: right;\n}\n/* Main Menu */\n#main-menu {\n margin: 0;\n border: 2px solid;\n border-radius: 10px;\n height: 14px;\n width: 14px;\n " + Style.sizing + ": border-box;\n border-color: rgb(130,130,130);\n color: rgb(130,130,130);\n}\n#main-menu::after {\n content: '';\n font-size: 10px;\n position: absolute;\n top: 50%;\n left: 50%;\n " + agent + "transform: translate(-60%, -50%);\n display: block;\n border-top: 5px solid rgb(130, 130, 130);\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n width: 7px;\n " + Style.sizing + ": border-box;\n} \n/* Pagination */\n.pagelist {\n border-width: 1px;\n text-align: " + _conf["Pagination Alignment"] + ";\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + { + return css = "/* Cleanup */\n#absbot,\n#boardNavDesktop,\n#delPassword,\n#delform > hr:last-of-type,\n#navbotright,\n#postForm,\n#styleSwitcher,\n.boardBanner > div,\n.mobile,\n.postingMode,\n.riced,\n.sideArrows,\n.stylechanger,\nbody > br,\nbody > div[style^=\"text-align\"],\nbody > hr {\n display: none;\n}\n/* Empties */\n#qr .warning:empty,\n#qr-thread-select:empty {\n display: none;\n}\n/* File Name Trunctuate */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\n display: none;\n}\n/* Unnecessary */\n#qp input,\n#qp .rice,\n.inline .rice {\n display: none !important;\n}\n/* Hidden Content */\n.forwarded,\n.hidden_thread ~ div,\n.hidden_thread ~ a,\n.replyContainer .stub ~ div,\n.replyContainer .stub ~ a,\n.stub + div,\n[hidden] {\n display: none !important;\n}\n/* Hidden UI */\n#catalog,\n#navlinks,\n#navtopright,\n.cataloglink,\n.navLinks,\na[style=\"cursor: pointer; float: right;\"] {\n position: fixed;\n top: 100%;\n left: 100%;\n}\n/* Hide last horizontal rule, keep clear functionality. */\n.board > hr:last-of-type {\n visibility: hidden;\n}\n/* Fappe Tyme */\n.fappeTyme .thread > .noFile {\n display: none;\n}\n/* Defaults */\na {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n outline: none;\n}\nbody,\nhtml {\n min-height: 100%;\n " + Style.sizing + ": border-box;\n}\nbody {\n outline: none;\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n min-height: 100%;\n margin-top: 0;\n margin-bottom: 0;\n margin-" + Style.sidebarLocation[0] + ": " + (/^boards\.4chan\.org$/.test(location.hostname) ? Style.sidebar : '2') + "px;\n margin-" + Style.sidebarLocation[1] + ": 2px;\n padding: 0 " + (parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px 0 " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"]) + "px;\n}\nbody.unscroll {\n overflow: hidden;\n}\n" + (_conf["4chan SS Sidebar"] && /^boards\.4chan\.org$/.test(location.hostname) ? "body::before { content: ''; position: fixed; top: 0; bottom: 0; " + Style.sidebarLocation[0] + ": 0; width: " + (_conf['Sidebar'] === 'large' ? 305 : _conf['Sidebar'] === 'normal' ? 254 : _conf['Sidebar'] === 'minimal' ? 27 : 0) + "px; z-index: 1; " + Style.sizing + ": border-box; display: block;}body { padding-" + Style.sidebarLocation[0] + ": 2px;}" : "") + "\nbutton,\ninput,\ntextarea {\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n}\nhr {\n clear: both;\n border: 0;\n padding: 0;\n margin: 0 0 1px;\n " + (_conf['Hide Horizontal Rules'] ? 'visibility: hidden;' : '') + "\n}\n.center {\n text-align: center;\n}\n.disabled {\n opacity: 0.5;\n}\n/* Symbols */\n.drop-marker {\n vertical-align: middle;\n display: inline-block;\n margin: 2px 2px 3px;\n border-top: .5em solid;\n border-right: .3em solid transparent;\n border-left: .3em solid transparent;\n}\n.brackets-wrap::before {\n content: \"\\00a0[\";\n}\n.brackets-wrap::after {\n content: \"]\\00a0\";\n}\n/* Thread / Reply Nav */\n#navlinks a {\n position: fixed;\n z-index: 12;\n opacity: 0.5;\n display: inline-block;\n border-right: 6px solid transparent;\n border-left: 6px solid transparent;\n margin: 1.5px;\n}\n/* Header */\n#header-bar {\n z-index: 6;\n border-width: 1px;\n position: absolute;\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + (_conf["Hide Navigation Decorations"] ? " font-size: 0; color: transparent; word-spacing: 2px;" : "") + "\n text-align: " + _conf["Navigation Alignment"] + ";\n}\n.fixed #header-bar.autohide {\n z-index: 24;\n}\n.fixed #header-bar {\n position: fixed;\n}\n.top #header-bar {\n top: 0;\n border-top-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : "") + "\"\n}\n.fixed.bottom #header-bar {\n bottom: 0;\n border-bottom-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\"\n}\n.hide #header-bar {\n position: fixed;\n top: 110%;\n bottom: auto;\n}\n/* Header Autohide */\n.fixed #header-bar.autohide:not(:hover) {\n box-shadow: none;\n transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);\n}\n.fixed.top #header-bar.autohide:not(:hover) {\n margin-bottom: -1em;\n " + agent + "transform: translateY(-100%);\n}\n.fixed.bottom #header-bar.autohide:not(:hover) {\n " + agent + "transform: translateY(100%);\n}\n#scroll-marker {\n left: 0;\n right: 0;\n height: 10px;\n position: absolute;\n}\n#header-bar #scroll-marker {\n display: none;\n}\n.fixed #header-bar #scroll-marker {\n display: block;\n}\n.fixed.top header-bar #scroll-marker {\n top: 100%;\n}\n.fixed.bottom #header-bar #scroll-marker {\n bottom: 100%;\n}\n/* Notifications */\n#notifications {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n}\n.fixed.top #notifications {\n position: absolute;\n top: 100%;\n}\n.notification {\n display: block;\n overflow: hidden;\n width: 300px;\n border: 1px solid;\n " + (_conf['Sidebar Location'] === 'left' ? 'margin-left: auto;' : '') + "\n}\n.notification:not(:first-of-type) {\n border-top: none;\n}\n.close {\n float: right;\n}\n/* Main Menu */\n#main-menu {\n margin: 0;\n border: 2px solid;\n border-radius: 10px;\n height: 14px;\n width: 14px;\n " + Style.sizing + ": border-box;\n border-color: rgb(130,130,130);\n color: rgb(130,130,130);\n}\n#main-menu::after {\n content: '';\n font-size: 10px;\n position: absolute;\n top: 50%;\n left: 50%;\n " + agent + "transform: translate(-60%, -50%);\n display: block;\n border-top: 5px solid rgb(130, 130, 130);\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n width: 7px;\n " + Style.sizing + ": border-box;\n} \n/* Pagination */\n.pagelist {\n border-width: 1px;\n text-align: " + _conf["Pagination Alignment"] + ";\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + { "sticky top": " position: fixed; top: 0; border-top-width: 0; " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : ""), "sticky bottom": " position: fixed; bottom: 0; border-bottom-width: 0; " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : ""), "top": " position: absolute; top: 0; border-top-width: 0; " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : ""), @@ -11933,7 +10948,7 @@ "under post form": " position: fixed; " + Style.sidebarLocation[0] + ": 2px; bottom: 140px; width: " + width + "px;", "at top": " margin: 12px 0;", "hide": " display: none;" - }[_conf["Board Title"]] + "\n}\n.boardTitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) + 10) + "px;\n}\n.boardSubtitle,\n.boardSubtitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) - 1) + "px;\n}\n/* Dialogs */\n.move {\n cursor: pointer;\n}\n#ihover {\n position: fixed;\n max-height: 97%;\n max-width: 75%;\n padding: 10px;\n z-index: 22;\n}\n#qp {\n position: fixed;\n z-index: 22;\n}\n#qp .postMessage::after {\n clear: both;\n display: block;\n content: \"\";\n}\n#qp .full-image {\n max-height: 300px;\n max-width: 500px;\n}\n#menu {\n position: fixed;\n outline: none;\n z-index: 22;\n}\n/* Updater */\n#updater {\n position: fixed;\n z-index: 10;\n padding: 0 1px 1px;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n#updater:hover {\n z-index: 30;\n} \n#updater:not(:hover) > div:not(.move) {\n display: none;\n}\n#updater input {\n text-align: right;\n}\n#updater .field {\n width: 50px;\n}\n/* Stats */\n#thread-stats {\n position: fixed;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n z-index: 10;\n}\n/* Image Expansion */\n.fit-width .full-image {\n max-width: 100%;\n width: 100%;\n}\n" + (_conf['Images Overlap Post Form'] ? ".full-image { position: relative; z-index: 22;}" : "") + "\n/* Prefetcher */\n#prefetch {\n z-index: 9;\n position: fixed;\n}\n/* Delete Buttons */\n" + (_conf['Hide Delete UI'] ? ".deleteform,.post:not(#exlinks-options) .rice { display: none;}.postInfo { padding: 0 0 0 3px;}" : ".deleteform { position: fixed; z-index: 18; width: 0; bottom: 0; right: 0; border-width: 1px 0 0 1px; border-style: solid; font-size: 0; color: transparent;}.deleteform:hover { width: auto;}.deleteform::before { z-index: 18; border-width: 1px 0 0 1px; border-style: solid; content: 'X'; display: block; position: fixed; bottom: 0; right: 0; font-size: " + _conf['Font Size'] + "px; " + Style.sizing + ": border-box; height: 1.6em; width: 1.4em; text-align: center;}.deleteform:hover::before { display: none;}.deleteform input { margin: 0 1px 0 0;}") + "\n/* Slideout Navigation */\n#boardNavDesktopFoot {\n position: fixed;\n width: " + width + "px;\n " + Style.sidebarLocation[0] + ": 2px;\n text-align: center;\n font-size: 0;\n color: transparent;\n overflow: hidden;\n " + Style.sizing + ": border-box;\n}\n#boardNavDesktopFoot a,\n#boardNavDesktopFoot a::after,\n#boardNavDesktopFoot a::before {\n font-size: " + _conf['Font Size'] + "px;\n}\n#boardNavDesktopFoot:hover {\n overflow-y: auto;\n padding: 2px;\n}\n#boardNavDesktopFoot:not(:hover) {\n border-color: transparent;\n background-color: transparent;\n height: 0;\n overflow: hidden;\n padding: 0;\n border: 0 none;\n}\n" + { + }[_conf["Board Title"]] + "\n}\n.boardTitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) + 10) + "px;\n}\n.boardSubtitle,\n.boardSubtitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) - 1) + "px;\n}\n/* Dialogs */\n.move {\n cursor: pointer;\n}\n#ihover {\n position: fixed;\n max-height: 97%;\n max-width: 75%;\n padding: 10px;\n z-index: 22;\n}\n#qp {\n position: fixed;\n z-index: 22;\n}\n#qp .postMessage::after {\n clear: both;\n display: block;\n content: \"\";\n}\n#qp .full-image {\n max-height: 300px;\n max-width: 500px;\n}\n#menu {\n position: fixed;\n outline: none;\n z-index: 22;\n}\n/* Image Expansion */\n.fit-width .full-image {\n max-width: 100%;\n width: 100%;\n}\n" + (_conf['Images Overlap Post Form'] ? ".full-image { position: relative; z-index: 22;}" : "") + "\n/* Prefetcher */\n#prefetch {\n z-index: 9;\n position: fixed;\n}\n/* Delete Buttons */\n" + (_conf['Hide Delete UI'] ? ".deleteform,.post:not(#exlinks-options) .rice { display: none;}.postInfo { padding: 0 0 0 3px;}" : ".deleteform { position: fixed; z-index: 18; width: 0; bottom: 0; right: 0; border-width: 1px 0 0 1px; border-style: solid; font-size: 0; color: transparent;}.deleteform:hover { width: auto;}.deleteform::before { z-index: 18; border-width: 1px 0 0 1px; border-style: solid; content: 'X'; display: block; position: fixed; bottom: 0; right: 0; font-size: " + _conf['Font Size'] + "px; " + Style.sizing + ": border-box; height: 1.6em; width: 1.4em; text-align: center;}.deleteform:hover::before { display: none;}.deleteform input { margin: 0 1px 0 0;}") + "\n/* Slideout Navigation */\n#boardNavDesktopFoot {\n position: fixed;\n width: " + width + "px;\n " + Style.sidebarLocation[0] + ": 2px;\n text-align: center;\n font-size: 0;\n color: transparent;\n overflow: hidden;\n " + Style.sizing + ": border-box;\n}\n#boardNavDesktopFoot a,\n#boardNavDesktopFoot a::after,\n#boardNavDesktopFoot a::before {\n font-size: " + _conf['Font Size'] + "px;\n}\n#boardNavDesktopFoot:hover {\n overflow-y: auto;\n padding: 2px;\n}\n#boardNavDesktopFoot:not(:hover) {\n border-color: transparent;\n background-color: transparent;\n height: 0;\n overflow: hidden;\n padding: 0;\n border: 0 none;\n}\n" + { compact: "#boardNavDesktopFoot { word-spacing: 1px;}", list: "#boardNavDesktopFoot a { display: block;}#boardNavDesktopFoot:hover { max-height: 400px;}#boardNavDesktopFoot a::after { content: ' - ' attr(title);}#boardNavDesktopFoot a[href*='//boards.4chan.org/']::after,#boardNavDesktopFoot a[href*='//rs.4chan.org/']::after { content: '/ - ' attr(title);}#boardNavDesktopFoot a[href*='//boards.4chan.org/']::before,#boardNavDesktopFoot a[href*='//rs.4chan.org/']::before { content: '/';}", hide: "#boardNavDesktopFoot { display: none;}" @@ -11949,7 +10964,7 @@ "slideout": "#qrtab input,#qrtab .rice { display: none;}#qr { top: auto !important; bottom: 1.7em !important; " + Style.sidebarLocation[0] + ": 0 !important; " + Style.sidebarLocation[1] + ": auto !important; " + agent + "transform: translateX(" + xOffset + "93%);}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transform: translate(0);}", "tabbed slideout": "#qr { top: auto !important; bottom: 1.7em !important; " + Style.sidebarLocation[0] + ": 0 !important; " + Style.sidebarLocation[1] + ": auto !important; " + agent + "transform: translateX(" + xOffset + "100%);}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transform: translateX(0);}#qrtab { " + agent + "transform: rotate(" + (Style.sidebarLocation[0] === "left" ? "" : "-") + "90deg); " + agent + "transform-origin: bottom " + Style.sidebarLocation[0] + "; position: absolute; top: 0; " + Style.sidebarLocation[0] + ": 100%; width: 110px; text-align: center; border-width: 1px 1px 0 1px; cursor: default;}#qr:hover #qrtab,#qr.has-focus #qrtab,#qr.dump #qrtab { opacity: 0; " + Style.sidebarLocation[0] + ": " + (252 + Style.sidebarOffset.W) + "px;}#qrtab input,#qrtab .close,#qrtab .rice,#qrtab span { display: none;}", "transparent fade": "#qr { overflow: visible; top: auto !important; bottom: 1.7em !important; " + Style.sidebarLocation[0] + ": 2px !important; " + Style.sidebarLocation[1] + ": auto !important; opacity: 0.2; " + agent + "transition: opacity .3s ease-in-out 1s;}#qr:hover,#qr.has-focus,#qr.dump { opacity: 1; " + agent + "transition: opacity .3s linear;}" - }[_conf['Post Form Style']] || "") + "\n\n" + (_conf['Post Form Style'] !== 'tabbed slideout' ? (!(_conf['Post Form Style'] === 'float' || _conf['Show Post Form Header']) ? "#qrtab { display: none; }" : _conf['Post Form Style'] !== 'slideout' ? ".autohide:not(:hover):not(.has-focus) > form { display: none !important; }" : "") + "#qrtab { margin-bottom: 1px; }" : "") + "\n\n" + (_conf['Post Form Style'] !== 'float' && _conf["Post Form Slideout Transitions"] ? "#qr { " + agent + "transition: " + agent + "transform .3s ease-in-out 1s;}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transition: " + agent + "transform .3s linear;}#qrtab { " + agent + "transition: opacity .3s ease-in-out 1s;}#qr:hover #qrtab { " + agent + "transition: opacity .3s linear;}" : "") + "\n\n#qr .close {\n float: right;\n padding: 0 3px;\n}\n#qr .warning {\n min-height: 1.6em;\n vertical-align: middle;\n padding: 0 1px;\n border-width: 1px;\n border-style: solid;\n}\n.persona {\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-button {\n width: 10%;\n margin: 0;\n}\n\n" + (_conf['Compact Post Form Inputs'] ? ".persona input.field { width: 29.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 14.8em; min-height: 9em;}#qr.has-captcha textarea.field { height: 9em;}" : ".persona input.field { width: 100%;}.persona input.field[name='name'] { width: 89.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 11.6em; min-height: 6em;}#qr.has-captcha textarea.field { height: 6em;}") + "\n\n" + (_conf["Tripcode Hider"] ? ".tripped:not(:hover):not(:focus) { opacity: 0;}" : "") + "\n\n#qr textarea {\n resize: " + _conf['Textarea Resize'] + ";\n}\n.captcha-img {\n margin: 1px 0 0;\n text-align: center;\n line-height: 0;\n}\n.captcha-img img {\n width: 100%;\n height: 4em;\n width: 246px;\n}\n.captcha-input {\n width: 100%;\n margin: 1px 0 0;\n}\n.field,\n.selectrice,\nbutton,\ninput:not([type=radio]) {\n " + Style.sizing + ": border-box;\n font-size: " + (parseInt(_conf['Font Size'], 10)) + "px;\n height: 1.6em;\n margin: 1px 0 0;\n vertical-align: bottom;\n padding: 0 1px;\n}\n#qr textarea {\n min-width: 100%;\n}\n#qr [type='submit'] {\n width: 25%;\n}\n[type='file'] {\n position: absolute;\n opacity: 0;\n z-index: -1;\n}\n#showQR {\n display: " + (_conf["Hide Show Post Form"] ? "none" : "block") + ";\n z-index: 4;\n " + Style.sidebarLocation[0] + ": 2px;\n width: " + width + "px;\n background-color: transparent;\n text-align: center;\n position: fixed;\n top: auto;\n}\n/* Fake File Input */\n#qr-filename,\n.has-file #qr-no-file {\n display: none;\n}\n#qr-no-file,\n.has-file #qr-filename {\n display: block;\n}\n#qr-filename-container {\n " + Style.sizing + ": border-box;\n display: inline-block;\n position: relative;\n width: 100px;\n min-width: 74.6%;\n max-width: 74.6%;\n margin-right: 0.4%;\n overflow: hidden;\n padding: 2px 1px 0;\n}\n#qr-filerm {\n position: absolute;\n right: 3px;\n top: 2px;\n z-index: 2;\n}\n/* Thread Select / Spoiler Label */\n#qr-thread-select {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n}\n#qr-spoiler-label {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n text-align: right;\n}\n/* Dumping UI */\n.dump #dump-list-container {\n display: block;\n}\n#dump-list-container {\n display: none;\n position: relative;\n overflow-y: hidden;\n margin-top: 1px;\n}\n#dump-list {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: pre;\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-list:hover {\n overflow-x: auto;\n}\n.qr-preview {\n " + Style.sizing + ": border-box;\n counter-increment: thumbnails;\n cursor: move;\n display: inline-block;\n height: 90px;\n width: 90px;\n padding: 2px;\n opacity: .5;\n overflow: hidden;\n position: relative;\n text-shadow: 0 1px 1px #000;\n " + agent + "transition: opacity .25s ease-in-out;\n vertical-align: top;\n}\n.qr-preview:hover,\n.qr-preview:focus {\n opacity: .9;\n}\n.qr-preview::before {\n content: counter(thumbnails);\n color: #fff;\n position: absolute;\n top: 3px;\n right: 3px;\n text-shadow: 0 0 3px #000, 0 0 8px #000;\n}\n.qr-preview#selected {\n opacity: 1;\n}\n.qr-preview.drag {\n box-shadow: 0 0 10px rgba(0,0,0,.5);\n}\n.qr-preview.over {\n border-color: #fff;\n}\n.qr-preview > span {\n color: #fff;\n}\n.remove {\n background: none;\n color: #e00;\n font-weight: 700;\n padding: 3px;\n}\na:only-of-type > .remove {\n display: none;\n}\n.remove:hover::after {\n content: \" Remove\";\n}\n.qr-preview > label {\n background: rgba(0,0,0,.5);\n color: #fff;\n right: 0; bottom: 0; left: 0;\n position: absolute;\n text-align: center;\n}\n.qr-preview > label > input {\n margin: 0;\n}\n#add-post {\n cursor: pointer;\n font-size: 2em;\n position: absolute;\n top: 50%;\n right: 10px;\n " + agent + "transform: translateY(-50%);\n}\n/* Ads */\n.topad img,\n.middlead img,\n.bottomad img {\n opacity: 0.3;\n " + agent + "transition: opacity .3s linear;\n}\n.topad img:hover,\n.middlead img:hover,\n.bottomad img:hover {\n opacity: 1;\n}\n" + (_conf["Block Ads"] ? "/* AdBlock Minus */.bottomad + hr,.topad img,.middlead img,.bottomad img { display: none;}" : "") + "\n" + (_conf["Shrink Ads"] ? ".topad a img,.middlead a img,.bottomad a img { width: 500px; height: auto;}" : "") + "\n/* Options */\n#overlay {\n position: fixed;\n z-index: 30;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: rgba(0,0,0,.5);\n}\n#appchanx-settings {\n width: auto;\n left: 15%;\n right: 15%;\n top: 15%;\n bottom: 15%;\n position: fixed;\n z-index: 31;\n padding: .3em;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.description {\n display: none;\n}\n#appchanx-settings h3,\n.section-keybinds,\n.section-mascots,\n.section-script,\n.style {\n text-align: center;\n}\n.section-keybinds table,\n.section-script fieldset,\n.section-style fieldset {\n text-align: left;\n}\n.section-keybinds table {\n margin: auto;\n}\n#appchanx-settings fieldset {\n padding: 5px 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n vertical-align: top;\n " + (_conf["Single Column Mode"] ? "margin: 0 auto 6px;" : "margin: 0 3px 6px;\n display: inline-block;") + "\n border: 0;\n}\n.section-container {\n overflow: auto;\n position: absolute;\n top: 1.7em;\n right: 5px;\n bottom: 5px;\n left: 5px;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.sections-list {\n padding: 0 3px;\n float: left;\n}\n.sections-list > a {\n cursor: pointer;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\n position: relative;\n padding: 0 4px;\n z-index: 1;\n height: 1.4em;\n display: inline-block;\n border-width: 1px 1px 0 1px;\n border-color: transparent;\n border-style: solid;\n}\n.credits {\n float: right;\n}\n#appchanx-settings h3 {\n margin: 0;\n}\n.section-script fieldset > div,\n.section-style fieldset > div,\n.section-rice fieldset > div {\n overflow: visible;\n padding: 0 5px 0 7px;\n}\n#appchanx-settings tr:nth-of-type(2n+1),\n.section-script fieldset > div:nth-of-type(2n+1),\n.section-rice fieldset > div:nth-of-type(2n+1),\n.section-style fieldset > div:nth-of-type(2n+1),\n.section-keybinds tr:nth-of-type(2n+1),\n#selectrice li:nth-of-type(2n+1) {\n background-color: rgba(0, 0, 0, 0.05);\n}\narticle li {\n margin: 10px 0 10px 2em;\n}\n#appchanx-settings .option {\n width: 50%;\n display: inline-block;\n vertical-align: bottom;\n}\n.option input {\n width: 100%;\n}\n.optionlabel {\n padding-left: 18px;\n}\n.rice + .optionlabel {\n padding-left: 0;\n}\n.section-script fieldset,\n.styleoption {\n text-align: left;\n}\n.section-style fieldset {\n width: 370px;\n}\n.section-script fieldset {\n width: 200px;\n}\n.suboptions,\n#mascotcontent,\n#themecontent {\n overflow: auto;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 1.7em;\n left: 0;\n}\n.mAlign {\n height: 250px;\n vertical-align: middle;\n display: table-cell;\n}\n#themecontent {\n top: 1.7em;\n}\n#save,\n.stylesettings {\n position: absolute;\n right: 10px;\n bottom: 0;\n}\n.section-style .suboptions {\n bottom: 0;\n}\n.section-container textarea {\n font-family: monospace;\n min-height: 350px;\n resize: vertical;\n width: 100%;\n}\n/* Hover Functionality */\n#mouseover {\n z-index: 33;\n position: fixed;\n max-width: 70%;\n}\n#mouseover:empty {\n display: none;\n}\n/* Mascot Tab */\n#mascot_hide {\n padding: 3px;\n position: absolute;\n top: 2px;\n right: 18px;\n}\n#mascot_hide .rice {\n float: left;\n}\n#mascot_hide > div {\n height: 0;\n text-align: right;\n overflow: hidden;\n}\n#mascot_hide:hover > div {\n height: auto;\n}\n#mascot_hide label {\n width: 100%;\n display: block;\n clear: both;\n text-decoration: none;\n}\n.mascots {\n padding: 0;\n text-align: center;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.mascot,\n.mascotcontainer {\n overflow: hidden;\n}\n.mascot {\n position: relative;\n border: none;\n margin: 5px;\n padding: 0;\n width: 200px;\n display: inline-block;\n background-color: transparent;\n}\n.mascotcontainer {\n height: 250px;\n border: 0;\n margin: 0;\n max-height: 250px;\n cursor: pointer;\n bottom: 0;\n border-width: 0 1px 1px;\n border-style: solid;\n border-color: transparent;\n overflow: hidden;\n}\n.mascot img {\n max-width: 200px;\n}\n.mascotname,\n.mascotoptions {\n padding: 0;\n width: 100%;\n}\n.mascot .mascotoptions {\nopacity: 0;\n " + agent + "transition: opacity .3s linear;\n}\n.mascot:hover .mascotoptions {\n opacity: 1;\n}\n.mascotoptions {\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.mascotoptions a {\n display: inline-block;\n width: 33%;\n}\n#upload {\n position: absolute;\n width: 100px;\n left: 50%;\n margin-left: -50px;\n text-align: center;\n bottom: 0;\n}\n#mascots_batch {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Themes Tab */\n#themes h1 {\n position: absolute;\n right: 300px;\n bottom: 10px;\n margin: 0;\n " + agent + "transition: all .2s ease-in-out;\n opacity: 0;\n}\n#themes .selectedtheme h1 {\n right: 11px;\n opacity: 1;\n}\n#themeContainer {\n margin-bottom: 3px;\n}\n#addthemes {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n.theme {\n margin: 1em;\n}\n/* Theme Editor */\n#themeConf {\n position: fixed;\n " + Style.sidebarLocation[1] + ": 2px;\n " + Style.sidebarLocation[0] + ": auto;\n top: 0;\n bottom: 0;\n width: 296px;\n z-index: 10;\n}\n#themebar input {\n width: 30%;\n}\n.option .color {\n width: 10%;\n border-left: none !important;\n color: transparent !important;\n}\n.option .colorfield {\n width: 90%;\n}\n.themevar textarea {\n min-width: 100%;\n max-width: 100%;\n height: 20em;\n resize: vertical;\n}\n/* Mascot Editor */\n#mascotConf {\n position: fixed;\n height: 17em;\n bottom: 0;\n left: 50%;\n width: 500px;\n margin-left: -250px;\n overflow: auto;\n z-index: 10;\n}\n#mascotConf .option,\n#mascotConf .optionlabel {\n " + Style.sizing + ": border-box;\n width: 50%;\n display: inline-block;\n vertical-align: middle;\n}\n#mascotConf .option input {\n width: 100%;\n}\n#close {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Catalog */\n#content .navLinks,\n#info .navLinks,\n.btn-wrap {\n display: block;\n}\n.navLinks > .btn-wrap:not(:first-of-type)::before {\n content: ' - ';\n}\n.button {\n cursor: pointer;\n}\n#content .btn-wrap,\n#info .btn-wrap {\n display: inline-block;\n}\n#settings .selectrice {\n width: 100px;\n display: inline-block;\n}\n#post-preview {\n position: absolute;\n z-index: 22;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n#settings,\n#threads,\n#info .navLinks,\n#content .navLinks {\n text-align: center;\n}\n#threads .thread {\n vertical-align: top;\n display: inline-block;\n word-wrap: break-word;\n overflow: hidden;\n margin-top: 5px;\n padding: 5px 0 3px;\n text-align: center;\n}\n.extended-small .thread,\n.small .thread {\n width: 165px;\n max-height: 320px;\n}\n.small .teaser,\n.large .teaser {\n display: none;\n}\n.extended-large .thread,\n.large .thread {\n width: 270px;\n max-height: 410px;\n}\n.extended-small .thumb,\n.small .thumb {\n max-width: 150px;\n max-height: 150px;\n}\n/* Front Page */\n#logo {\n text-align: center;\n}\n#doc {\n margin: 0 auto;\n width: 1000px;\n position: relative;\n}\n#boards .boxcontent {\n vertical-align: top;\n text-align: center;\n}\n#filter-container,\n#options-container {\n float: right;\n position: relative;\n}\n#optionssmenu {\n top: 100% !important;\n left: 0 !important;\n}\n#boards .column {\n " + Style.sizing + ": border-box;\n display: inline-block;\n width: 16em;\n text-align: left;\n vertical-align: top;\n}\n.bd ul,\n.boxcontent ul {\n vertical-align: top;\n padding: 0;\n}\n.right-box .boxcontent ul {\n padding: 0 10px;\n}\n.yuimenuitem,\n.boxcontent li {\n list-style-type: none;\n}\n.bd ul {\n margin: 0;\n}\n.yuimenuitem::before {\n content: \" [ ] \";\n font-family: monospace;\n}\n.yuimenuitem-checked::before {\n content: \" [x] \"\n}\n.yui-u {\n display: inline-block;\n vertical-align: top;\n width: 475px;\n margin: 10px;\n}\n#recent-images .boxcontent {\n text-align: center;\n}\n#ft {\n text-align: center;\n}\n#ft ul {\n padding: 0;\n}\n#ft li {\n list-style-type: none;\n display: inline-block;\n width: 100px;\n}\n#preview-tooltip-nws,\n#preview-tooltip-ws,\n#ft .fill,\n.clear-bug {\n display: none;\n}"; + }[_conf['Post Form Style']] || "") + "\n\n" + (_conf['Post Form Style'] !== 'tabbed slideout' ? (!(_conf['Post Form Style'] === 'float' || _conf['Show Post Form Header']) ? "#qrtab { display: none; }" : _conf['Post Form Style'] !== 'slideout' ? ".autohide:not(:hover):not(.has-focus) > form { display: none !important; }" : "") + "#qrtab { margin-bottom: 1px; }" : "") + "\n\n" + (_conf['Post Form Style'] !== 'float' && _conf["Post Form Slideout Transitions"] ? "#qr { " + agent + "transition: " + agent + "transform .3s ease-in-out 1s;}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transition: " + agent + "transform .3s linear;}#qrtab { " + agent + "transition: opacity .3s ease-in-out 1s;}#qr:hover #qrtab { " + agent + "transition: opacity .3s linear;}" : "") + "\n\n#qr .close {\n float: right;\n padding: 0 3px;\n}\n#qr .warning {\n min-height: 1.6em;\n vertical-align: middle;\n padding: 0 1px;\n border-width: 1px;\n border-style: solid;\n}\n.persona {\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-button {\n width: 10%;\n margin: 0;\n}\n\n" + (_conf['Compact Post Form Inputs'] ? ".persona input.field { width: 29.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 14.8em; min-height: 9em;}#qr.has-captcha textarea.field { height: 9em;}" : ".persona input.field { width: 100%;}.persona input.field[name='name'] { width: 89.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 11.6em; min-height: 6em;}#qr.has-captcha textarea.field { height: 6em;}") + "\n\n" + (_conf["Tripcode Hider"] ? ".tripped:not(:hover):not(:focus) { opacity: 0;}" : "") + "\n\n#qr textarea {\n resize: " + _conf['Textarea Resize'] + ";\n}\n.captcha-img {\n margin: 1px 0 0;\n text-align: center;\n line-height: 0;\n}\n.captcha-img img {\n width: 100%;\n height: 4em;\n width: 246px;\n}\n.captcha-input {\n width: 100%;\n margin: 1px 0 0;\n}\n.field,\n.selectrice,\nbutton,\ninput:not([type=radio]) {\n " + Style.sizing + ": border-box;\n font-size: " + (parseInt(_conf['Font Size'], 10)) + "px;\n height: 1.6em;\n margin: 1px 0 0;\n vertical-align: bottom;\n padding: 0 1px;\n}\n.selectrice {\n padding-right: 1.6em;\n}\n#qr textarea {\n min-width: 100%;\n}\n#qr [type='submit'] {\n width: 25%;\n}\n[type='file'] {\n position: absolute;\n opacity: 0;\n z-index: -1;\n}\n#showQR {\n display: " + (_conf["Hide Show Post Form"] ? "none" : "block") + ";\n z-index: 4;\n " + Style.sidebarLocation[0] + ": 2px;\n width: " + width + "px;\n background-color: transparent;\n text-align: center;\n position: fixed;\n top: auto;\n}\n/* Fake File Input */\n#qr-filename,\n.has-file #qr-no-file {\n display: none;\n}\n#qr-no-file,\n.has-file #qr-filename {\n display: block;\n}\n#qr-filename-container {\n " + Style.sizing + ": border-box;\n display: inline-block;\n position: relative;\n width: 100px;\n min-width: 74.6%;\n max-width: 74.6%;\n margin-right: 0.4%;\n overflow: hidden;\n padding: 2px 1px 0;\n}\n#qr-filerm {\n position: absolute;\n right: 3px;\n top: 2px;\n z-index: 2;\n}\n/* Thread Select / Spoiler Label */\n#qr-thread-select {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n}\n#qr-spoiler-label {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n text-align: right;\n}\n/* Dumping UI */\n.dump #dump-list-container {\n display: block;\n}\n#dump-list-container {\n display: none;\n position: relative;\n overflow-y: hidden;\n margin-top: 1px;\n}\n#dump-list {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: pre;\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-list:hover {\n overflow-x: auto;\n}\n.qr-preview {\n " + Style.sizing + ": border-box;\n counter-increment: thumbnails;\n cursor: move;\n display: inline-block;\n height: 90px;\n width: 90px;\n padding: 2px;\n opacity: .5;\n overflow: hidden;\n position: relative;\n text-shadow: 0 1px 1px #000;\n " + agent + "transition: opacity .25s ease-in-out;\n vertical-align: top;\n}\n.qr-preview:hover,\n.qr-preview:focus {\n opacity: .9;\n}\n.qr-preview::before {\n content: counter(thumbnails);\n color: #fff;\n position: absolute;\n top: 3px;\n right: 3px;\n text-shadow: 0 0 3px #000, 0 0 8px #000;\n}\n.qr-preview#selected {\n opacity: 1;\n}\n.qr-preview.drag {\n box-shadow: 0 0 10px rgba(0,0,0,.5);\n}\n.qr-preview.over {\n border-color: #fff;\n}\n.qr-preview > span {\n color: #fff;\n}\n.remove {\n background: none;\n color: #e00;\n font-weight: 700;\n padding: 3px;\n}\na:only-of-type > .remove {\n display: none;\n}\n.remove:hover::after {\n content: \" Remove\";\n}\n.qr-preview > label {\n background: rgba(0,0,0,.5);\n color: #fff;\n right: 0; bottom: 0; left: 0;\n position: absolute;\n text-align: center;\n}\n.qr-preview > label > input {\n margin: 0;\n}\n#add-post {\n cursor: pointer;\n font-size: 2em;\n position: absolute;\n top: 50%;\n right: 10px;\n " + agent + "transform: translateY(-50%);\n}\n/* Ads */\n.topad img,\n.middlead img,\n.bottomad img {\n opacity: 0.3;\n " + agent + "transition: opacity .3s linear;\n}\n.topad img:hover,\n.middlead img:hover,\n.bottomad img:hover {\n opacity: 1;\n}\n" + (_conf["Block Ads"] ? "/* AdBlock Minus */.bottomad + hr,.topad img,.middlead img,.bottomad img { display: none;}" : "") + "\n" + (_conf["Shrink Ads"] ? ".topad a img,.middlead a img,.bottomad a img { width: 500px; height: auto;}" : "") + "\n/* Options */\n#overlay {\n position: fixed;\n z-index: 30;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: rgba(0,0,0,.5);\n}\n#appchanx-settings {\n width: auto;\n left: 15%;\n right: 15%;\n top: 15%;\n bottom: 15%;\n position: fixed;\n z-index: 31;\n padding: .3em;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.description {\n display: none;\n}\n#appchanx-settings h3,\n.section-keybinds,\n.section-mascots,\n.section-script,\n.style {\n text-align: center;\n}\n.section-keybinds table,\n.section-script fieldset,\n.section-style fieldset {\n text-align: left;\n}\n.section-keybinds table {\n margin: auto;\n}\n#appchanx-settings fieldset {\n padding: 5px 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n vertical-align: top;\n " + (_conf["Single Column Mode"] ? "margin: 0 auto 6px;" : "margin: 0 3px 6px;\n display: inline-block;") + "\n border: 0;\n}\n#appchanx-settings .section-advanced fieldset {\n display: block;\n margin: 0 auto 6px;\n}\n.section-advanced .selectrice {\n display: inline-block;\n clear: both;\n}\n.section-container {\n overflow: auto;\n position: absolute;\n top: 1.7em;\n right: 5px;\n bottom: 5px;\n left: 5px;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.sections-list {\n padding: 0 3px;\n float: left;\n}\n.sections-list > a {\n cursor: pointer;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\n position: relative;\n padding: 0 4px;\n z-index: 1;\n height: 1.4em;\n display: inline-block;\n border-width: 1px 1px 0 1px;\n border-color: transparent;\n border-style: solid;\n}\n.credits {\n float: right;\n}\n#appchanx-settings h3 {\n margin: 0;\n}\n.section-script fieldset > div,\n.section-style fieldset > div,\n.section-advanced fieldset > div {\n overflow: visible;\n padding: 0 5px 0 7px;\n}\n#appchanx-settings tr:nth-of-type(2n+1),\n.section-script fieldset > div:nth-of-type(2n+1),\n.section-advanced fieldset > div:nth-of-type(2n+1),\n.section-style fieldset > div:nth-of-type(2n+1),\n.section-keybinds tr:nth-of-type(2n+1),\n#selectrice li:nth-of-type(2n+1) {\n background-color: rgba(0, 0, 0, 0.05);\n}\narticle li {\n margin: 10px 0 10px 2em;\n}\n#appchanx-settings .option {\n width: 50%;\n display: inline-block;\n vertical-align: bottom;\n}\n.option input {\n width: 100%;\n}\n.optionlabel {\n padding-left: 18px;\n}\n.rice + .optionlabel {\n padding-left: 0;\n}\n.section-script fieldset,\n.styleoption {\n text-align: left;\n}\n.section-style fieldset {\n width: 370px;\n}\n.section-script fieldset {\n width: 200px;\n}\n.suboptions,\n#mascotcontent,\n#themecontent {\n overflow: auto;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 1.7em;\n left: 0;\n}\n.mAlign {\n height: 250px;\n vertical-align: middle;\n display: table-cell;\n}\n#themecontent {\n top: 1.7em;\n}\n#save,\n.stylesettings {\n position: absolute;\n right: 10px;\n bottom: 0;\n}\n.section-style .suboptions {\n bottom: 0;\n}\n.section-container textarea {\n font-family: monospace;\n min-height: 350px;\n resize: vertical;\n width: 100%;\n}\n/* Hover Functionality */\n#mouseover {\n z-index: 33;\n position: fixed;\n max-width: 70%;\n}\n#mouseover:empty {\n display: none;\n}\n/* Mascot Tab */\n#mascot_hide {\n padding: 3px;\n position: absolute;\n top: 2px;\n right: 18px;\n}\n#mascot_hide .rice {\n float: left;\n}\n#mascot_hide > div {\n height: 0;\n text-align: right;\n overflow: hidden;\n}\n#mascot_hide:hover > div {\n height: auto;\n}\n#mascot_hide label {\n width: 100%;\n display: block;\n clear: both;\n text-decoration: none;\n}\n.mascots {\n padding: 0;\n text-align: center;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.mascot,\n.mascotcontainer {\n overflow: hidden;\n}\n.mascot {\n position: relative;\n border: none;\n margin: 5px;\n padding: 0;\n width: 200px;\n display: inline-block;\n background-color: transparent;\n}\n.mascotcontainer {\n height: 250px;\n border: 0;\n margin: 0;\n max-height: 250px;\n cursor: pointer;\n bottom: 0;\n border-width: 0 1px 1px;\n border-style: solid;\n border-color: transparent;\n overflow: hidden;\n}\n.mascot img {\n max-width: 200px;\n}\n.mascotname,\n.mascotoptions {\n padding: 0;\n width: 100%;\n}\n.mascot .mascotoptions {\nopacity: 0;\n " + agent + "transition: opacity .3s linear;\n}\n.mascot:hover .mascotoptions {\n opacity: 1;\n}\n.mascotoptions {\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.mascotoptions a {\n display: inline-block;\n width: 33%;\n}\n#upload {\n position: absolute;\n width: 100px;\n left: 50%;\n margin-left: -50px;\n text-align: center;\n bottom: 0;\n}\n#mascots_batch {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Themes Tab */\n#themes h1 {\n position: absolute;\n right: 300px;\n bottom: 10px;\n margin: 0;\n " + agent + "transition: all .2s ease-in-out;\n opacity: 0;\n}\n#themes .selectedtheme h1 {\n right: 11px;\n opacity: 1;\n}\n#themeContainer {\n margin-bottom: 3px;\n}\n#addthemes {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n.theme {\n margin: 1em;\n}\n/* Theme Editor */\n#themeConf {\n position: fixed;\n " + Style.sidebarLocation[1] + ": 2px;\n " + Style.sidebarLocation[0] + ": auto;\n top: 0;\n bottom: 0;\n width: 296px;\n z-index: 10;\n}\n#themebar input {\n width: 30%;\n}\n.option .color {\n width: 10%;\n border-left: none !important;\n color: transparent !important;\n}\n.option .colorfield {\n width: 90%;\n}\n.themevar textarea {\n min-width: 100%;\n max-width: 100%;\n height: 20em;\n resize: vertical;\n}\n/* Mascot Editor */\n#mascotConf {\n position: fixed;\n height: 17em;\n bottom: 0;\n left: 50%;\n width: 500px;\n margin-left: -250px;\n overflow: auto;\n z-index: 10;\n}\n#mascotConf .option,\n#mascotConf .optionlabel {\n " + Style.sizing + ": border-box;\n width: 50%;\n display: inline-block;\n vertical-align: middle;\n}\n#mascotConf .option input {\n width: 100%;\n}\n#close {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Catalog */\n#content .navLinks,\n#info .navLinks,\n.btn-wrap {\n display: block;\n}\n.navLinks > .btn-wrap:not(:first-of-type)::before {\n content: ' - ';\n}\n.button {\n cursor: pointer;\n}\n#content .btn-wrap,\n#info .btn-wrap {\n display: inline-block;\n}\n#post-preview {\n position: absolute;\n z-index: 22;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n#settings,\n#threads,\n#info .navLinks,\n#content .navLinks {\n text-align: center;\n}\n#threads .thread {\n vertical-align: top;\n display: inline-block;\n word-wrap: break-word;\n overflow: hidden;\n margin-top: 5px;\n padding: 5px 0 3px;\n text-align: center;\n}\n.extended-small .thread,\n.small .thread {\n width: 165px;\n max-height: 320px;\n}\n.small .teaser,\n.large .teaser {\n display: none;\n}\n.extended-large .thread,\n.large .thread {\n width: 270px;\n max-height: 410px;\n}\n.extended-small .thumb,\n.small .thumb {\n max-width: 150px;\n max-height: 150px;\n}\n/* Front Page */\n#logo {\n text-align: center;\n}\n#doc {\n margin: 0 auto;\n width: 1000px;\n position: relative;\n}\n#boards .boxcontent {\n vertical-align: top;\n text-align: center;\n}\n#filter-container,\n#options-container {\n float: right;\n position: relative;\n}\n#optionssmenu {\n top: 100% !important;\n left: 0 !important;\n}\n#boards .column {\n " + Style.sizing + ": border-box;\n display: inline-block;\n width: 16em;\n text-align: left;\n vertical-align: top;\n}\n.bd ul,\n.boxcontent ul {\n vertical-align: top;\n padding: 0;\n}\n.right-box .boxcontent ul {\n padding: 0 10px;\n}\n.yuimenuitem,\n.boxcontent li {\n list-style-type: none;\n}\n.bd ul {\n margin: 0;\n}\n.yuimenuitem::before {\n content: \" [ ] \";\n font-family: monospace;\n}\n.yuimenuitem-checked::before {\n content: \" [x] \"\n}\n.yui-u {\n display: inline-block;\n vertical-align: top;\n width: 475px;\n margin: 10px;\n}\n#recent-images .boxcontent {\n text-align: center;\n}\n#ft {\n text-align: center;\n}\n#ft ul {\n padding: 0;\n}\n#ft li {\n list-style-type: none;\n display: inline-block;\n width: 100px;\n}\n#preview-tooltip-nws,\n#preview-tooltip-ws,\n#ft .fill,\n.clear-bug {\n display: none;\n}"; }, theme: function(theme) { var agent, background, backgroundC, bgColor, css, fileHeading, icons, replyHeading, _conf; @@ -11959,7 +10974,7 @@ bgColor = new Style.color(Style.colorToHex(backgroundC = theme["Background Color"]) || 'aaaaaa'); Style.lightTheme = bgColor.isLight(); icons = "data:image/png;base64," + Icons[_conf["Icons"]]; - css = ".hide_thread_button span > span,\n.hide_reply_button span > span {\n background-color: " + theme["Links"] + ";\n}\n#mascot_hide label {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\n#content .thumb {\n box-shadow: 0 0 5px " + theme["Reply Border"] + ";\n}\n.mascotname,\n.mascotoptions {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.opContainer.filter_highlight {\n box-shadow: inset 5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\n.filter_highlight > .reply {\n box-shadow: -5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\nhr {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\na[style=\"cursor: pointer; float: right;\"] + div[style^=\"width: 100%;\"] > table > tbody > tr > td {\n background: " + backgroundC + " !important;\n border: 1px solid " + theme["Reply Border"] + " !important;\n}\n#fs_status {\n background: " + theme["Dialog Background"] + " !important;\n}\n#fs_data tr[style=\"background-color: #EA8;\"] {\n background: " + theme["Reply Background"] + " !important;\n}\n#fs_data,\n#fs_data *,\n.threadContainer {\n border-color: " + theme["Reply Border"] + " !important;\n}\nhtml {\n background: " + (backgroundC || '') + ";\n background-image: " + (theme["Background Image"] || '') + ";\n background-repeat: " + (theme["Background Repeat"] || '') + ";\n background-attachment: " + (theme["Background Attachment"] || '') + ";\n background-position: " + (theme["Background Position"] || '') + ";\n}\n.section-container,\n#exlinks-options-content,\n#mascotcontent,\n#themecontent {\n background: " + backgroundC + ";\n border: 1px solid " + theme["Reply Border"] + ";\n padding: 5px;\n}\n.sections-list > a.tab-selected {\n background: " + backgroundC + ";\n border-color: " + theme["Reply Border"] + ";\n border-style: solid;\n}\n.captcha-img img {\n " + (Style.filter(theme["Text"], theme["Input Background"])) + "\n}\n#boardTitle,\n#prefetch,\n#showQR,\n" + (!_conf["Post Form Decorations"] ? '#spoilerLabel,' : '') + "\n#thread-stats {\n text-shadow:\n 1px 1px 0 " + backgroundC + ",\n -1px -1px 0 " + backgroundC + ",\n 1px -1px 0 " + backgroundC + ",\n -1px 1px 0 " + backgroundC + ",\n 0 1px 0 " + backgroundC + ",\n 0 -1px 0 " + backgroundC + ",\n 1px 0 0 " + backgroundC + ",\n -1px 0 0 " + backgroundC + "\n " + (_conf["Sidebar Glow"] ? ", 0 2px 5px " + theme['Text'] + ";" : ";") + "\n}\n/* Fixes text spoilers */\n" + (_conf['Remove Spoilers'] && _conf['Indicate Spoilers'] ? ".spoiler::before,s::before { content: '[spoiler]';}.spoiler::after,s::after { content: '[/spoiler]';}" : !_conf['Remove Spoilers'] ? ".spoiler:not(:hover) *,s:not(:hover) * { color: rgb(0,0,0) !important; text-shadow: none !important;}.spoiler:not(:hover),s:not(:hover) { background-color: rgb(0,0,0); color: rgb(0,0,0) !important; text-shadow: none !important;}" : "") + "\n#exlinks-options,\n#appchanx-settings,\n#qrtab,\n" + (_conf["Post Form Decorations"] ? "#qr," : "") + "\n#updater,\ninput[type=\"submit\"],\ninput[value=\"Report\"],\nspan[style=\"left: 5px; position: absolute;\"] a {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.enabled .mascotcontainer {\n background: " + theme["Buttons Background"] + ";\n border-color: " + theme["Buttons Border"] + ";\n}\n#dump,\n#qr-filename-container,\n#appchanx-settings input,\n.captcha-img,\n.dump #dump:not(:hover):not(:focus),\n.qr-preview,\n.selectrice,\nbutton,\ninput,\ntextarea {\n background: " + theme["Input Background"] + ";\n border: 1px solid " + theme["Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:hover,\n#qr-filename-container:hover,\n#qr-filename-container:hover,\n.selectrice:hover,\n#selectrice li:hover,\n#selectrice li:nth-of-type(2n+1):hover,\ninput:hover,\ntextarea:hover {\n background: " + theme["Hovered Input Background"] + ";\n border-color: " + theme["Hovered Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:active,\n#dump:focus,\n#selectrice li:focus,\n.selectrice:focus,\n#qr-filename-container:active,\n#qr-filename-container:focus,\ninput:focus,\ntextarea:focus,\ntextarea.field:focus {\n background: " + theme["Focused Input Background"] + ";\n border-color: " + theme["Focused Input Border"] + ";\n color: " + theme["Inputs"] + ";\n outline: none;\n}\n#mouseover,\n#post-preview,\n#qp .post,\n#xupdater,\n.reply.post {\n border-width: 1px;\n border-style: solid;\n border-color: " + theme["Reply Border"] + ";\n background: " + theme["Reply Background"] + ";\n}\n.thread > .replyContainer > .reply.post {\n border-width: " + (_conf['Post Spacing'] === "0" ? "1px 1px 0 1px" : '1px') + ";\n}\n.exblock.reply,\n.reply.post.highlight,\n.reply.post:target {\n background: " + theme["Highlighted Reply Background"] + ";\n border: 1px solid " + theme["Highlighted Reply Border"] + ";\n}\n#header-bar,\n.pagelist {\n background: " + theme["Navigation Background"] + ";\n border-style: solid;\n border-color: " + theme["Navigation Border"] + ";\n}\n.thread {\n background: " + theme["Thread Wrapper Background"] + ";\n border: 1px solid " + theme["Thread Wrapper Border"] + ";\n}\n#boardNavDesktopFoot,\n#mascotConf,\n#mascot_hide,\n#menu,\n#selectrice,\n#themeConf,\n#watcher,\n#watcher:hover,\n.notification,\n.submenu,\na[style=\"cursor: pointer; float: right;\"] ~ div[style^=\"width: 100%;\"] > table {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Dialog Border"] + ";\n}\n.deleteform::before,\n.deleteform,\n#qr .warning {\n background: " + theme["Input Background"] + ";\n border-color: " + theme["Input Border"] + ";\n}\n.disabledwarning,\n.warning {\n color: " + theme["Warnings"] + ";\n}\n#navlinks a:first-of-type {\n border-bottom: 11px solid rgb(130,130,130);\n}\n#navlinks a:last-of-type {\n border-top: 11px solid rgb(130,130,130);\n}\n#charCount {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.7)" : "rgba(255,255,255,0.7)") + ";\n}\n.postNum a {\n color: " + theme["Post Numbers"] + ";\n}\n.subject {\n color: " + theme["Subjects"] + " !important;\n}\n.dateTime,\n.post-ago {\n color: " + theme["Timestamps"] + " !important;\n}\n#fs_status a,\n#updater #count:not(.new)::after,\n#showQR,\n#updater,\n.abbr,\n.boxbar,\n.boxcontent,\n.deleteform::before,\n.pages strong,\n.pln,\n.reply,\n.reply.highlight,\n.summary,\nbody,\nbutton,\nspan[style=\"left: 5px; position: absolute;\"] a,\ninput,\ntextarea {\n color: " + theme["Text"] + ";\n}\n#exlinks-options-content > table,\n#appchanx-settings fieldset,\n#selectrice {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n box-shadow: inset " + theme["Shadow Color"] + " 0 0 5px;\n}\n.quote + .spoiler:hover,\n.quote {\n color: " + theme["Greentext"] + ";\n}\n.forwardlink {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n border-bottom: 1px dashed " + theme["Backlinks"] + ";\n}\n.container::before {\n color: " + theme["Timestamps"] + ";\n}\n#menu,\n#post-preview,\n#qp .opContainer,\n#qp .replyContainer,\n.submenu {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.rice {\n background: " + theme["Checkbox Background"] + ";\n border: 1px solid " + theme["Checkbox Border"] + ";\n}\n.selectrice::before {\n border-left: 1px solid " + theme["Input Border"] + ";\n}\n.selectrice::after {\n border-top: .45em solid " + theme["Inputs"] + ";\n}\n#updater input,\n.bd {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.pages a,\n#header-bar a {\n color: " + theme["Navigation Links"] + ";\n}\ninput[type=checkbox]:checked + .rice {\n position: relative;\n}\ninput[type=checkbox]:checked + .rice::after {\n content: \"\";\n display: block;\n width: 4px;\n height: 10px;\n border: solid " + theme["Inputs"] + ";\n border-width: 0 3px 3px 0;\n " + agent + "transform: rotate(45deg);\n position: absolute;\n left: 2px;\n bottom: -1px;\n}\n#addReply,\n#dump,\n.button,\n.entry,\n.replylink,\na {\n color: " + theme["Links"] + ";\n}\n.backlink {\n color: " + theme["Backlinks"] + ";\n}\n.qiQuote,\n.quotelink {\n color: " + theme["Quotelinks"] + ";\n}\n#addReply:hover,\n#dump:hover,\n.entry:hover,\n.sideArrows a:hover,\n.replylink:hover,\n.qiQuote:hover,\n.quotelink:hover,\na .name:hover,\na .postertrip:hover,\na:hover {\n color: " + theme["Hovered Links"] + ";\n}\n#header-bar a:hover,\n#boardTitle a:hover {\n color: " + theme["Hovered Navigation Links"] + ";\n}\n#boardTitle {\n color: " + theme["Board Title"] + ";\n}\n.name,\n.post-author {\n color: " + theme["Names"] + " !important;\n}\n.post-tripcode,\n.postertrip,\n.trip {\n color: " + theme["Tripcodes"] + " !important;\n}\na .postertrip,\na .name {\n color: " + theme["Emails"] + ";\n}\n.post.reply.qphl,\n.post.op.qphl {\n border-color: " + theme["Backlinked Reply Outline"] + ";\n background: " + theme["Highlighted Reply Background"] + ";\n}\n.inline .post {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.placeholder,\n#qr input::" + agent + "placeholder,\n#qr textarea::" + agent + "placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#qr input:" + agent + "placeholder,\n#qr textarea:" + agent + "placeholder,\n.placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#appchanx-settings fieldset,\n.boxcontent dd,\n.selectrice ul {\n border-color: " + (Style.lightTheme ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)") + ";\n}\n#appchanx-settings li,\n#selectrice li:not(:first-of-type) {\n border-top: 1px solid " + (Style.lightTheme ? "rgba(0,0,0,0.05)" : "rgba(255,255,255,0.025)") + ";\n}\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n.navLinks > a:first-of-type::after,\n#watcher::after,\n#globalMessage::after,\n#boardNavDesktopFoot::after,\na[style=\"cursor: pointer; float: right;\"]::after,\n#img-controls,\n#catalog::after,\n#fappeTyme {\n background-image: url('" + icons + "');\n" + (!Style.lightTheme ? "filter: url(\"data:image/svg+xml,#filters\");" : "") + "\n}\n" + theme["Custom CSS"]; + css = ".hide_thread_button span > span,\n.hide_reply_button span > span {\n background-color: " + theme["Links"] + ";\n}\n#mascot_hide label {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\n#content .thumb {\n box-shadow: 0 0 5px " + theme["Reply Border"] + ";\n}\n.mascotname,\n.mascotoptions {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.opContainer.filter_highlight {\n box-shadow: inset 5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\n.filter_highlight > .reply {\n box-shadow: -5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\nhr {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\na[style=\"cursor: pointer; float: right;\"] + div[style^=\"width: 100%;\"] > table > tbody > tr > td {\n background: " + backgroundC + " !important;\n border: 1px solid " + theme["Reply Border"] + " !important;\n}\n#fs_status {\n background: " + theme["Dialog Background"] + " !important;\n}\n#fs_data tr[style=\"background-color: #EA8;\"] {\n background: " + theme["Reply Background"] + " !important;\n}\n#fs_data,\n#fs_data *,\n.threadContainer {\n border-color: " + theme["Reply Border"] + " !important;\n}\nhtml {\n background: " + (backgroundC || '') + ";\n background-image: " + (theme["Background Image"] || '') + ";\n background-repeat: " + (theme["Background Repeat"] || '') + ";\n background-attachment: " + (theme["Background Attachment"] || '') + ";\n background-position: " + (theme["Background Position"] || '') + ";\n}\n.section-container,\n#exlinks-options-content,\n#mascotcontent,\n#themecontent {\n background: " + backgroundC + ";\n border: 1px solid " + theme["Reply Border"] + ";\n padding: 5px;\n}\n.sections-list > a.tab-selected {\n background: " + backgroundC + ";\n border-color: " + theme["Reply Border"] + ";\n border-style: solid;\n}\n.captcha-img img {\n " + (Style.filter(theme["Text"], theme["Input Background"])) + "\n}\n#boardTitle,\n#prefetch,\n#showQR,\n" + (!_conf["Post Form Decorations"] ? '#spoilerLabel,' : '') + "\n#thread-stats {\n text-shadow:\n 1px 1px 0 " + backgroundC + ",\n -1px -1px 0 " + backgroundC + ",\n 1px -1px 0 " + backgroundC + ",\n -1px 1px 0 " + backgroundC + ",\n 0 1px 0 " + backgroundC + ",\n 0 -1px 0 " + backgroundC + ",\n 1px 0 0 " + backgroundC + ",\n -1px 0 0 " + backgroundC + "\n " + (_conf["Sidebar Glow"] ? ", 0 2px 5px " + theme['Text'] + ";" : ";") + "\n}\n/* Fixes text spoilers */\n" + (_conf['Remove Spoilers'] && _conf['Indicate Spoilers'] ? ".spoiler::before,s::before { content: '[spoiler]';}.spoiler::after,s::after { content: '[/spoiler]';}" : !_conf['Remove Spoilers'] ? ".spoiler:not(:hover) *,s:not(:hover) * { color: rgb(0,0,0) !important; text-shadow: none !important;}.spoiler:not(:hover),s:not(:hover) { background-color: rgb(0,0,0); color: rgb(0,0,0) !important; text-shadow: none !important;}" : "") + "\n#exlinks-options,\n#appchanx-settings,\n#qrtab,\n" + (_conf["Post Form Decorations"] ? "#qr," : "") + "\ninput[type=\"submit\"],\ninput[value=\"Report\"],\nspan[style=\"left: 5px; position: absolute;\"] a {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.enabled .mascotcontainer {\n background: " + theme["Buttons Background"] + ";\n border-color: " + theme["Buttons Border"] + ";\n}\n#dump,\n#qr-filename-container,\n#appchanx-settings input,\n.captcha-img,\n.dump #dump:not(:hover):not(:focus),\n.qr-preview,\n.selectrice,\nbutton,\ninput,\ntextarea {\n background: " + theme["Input Background"] + ";\n border: 1px solid " + theme["Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:hover,\n#qr-filename-container:hover,\n#qr-filename-container:hover,\n.selectrice:hover,\n#selectrice li:hover,\n#selectrice li:nth-of-type(2n+1):hover,\ninput:hover,\ntextarea:hover {\n background: " + theme["Hovered Input Background"] + ";\n border-color: " + theme["Hovered Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:active,\n#dump:focus,\n#selectrice li:focus,\n.selectrice:focus,\n#qr-filename-container:active,\n#qr-filename-container:focus,\ninput:focus,\ntextarea:focus,\ntextarea.field:focus {\n background: " + theme["Focused Input Background"] + ";\n border-color: " + theme["Focused Input Border"] + ";\n color: " + theme["Inputs"] + ";\n outline: none;\n}\n#mouseover,\n#post-preview,\n#qp .post,\n#xupdater,\n.reply.post {\n border-width: 1px;\n border-style: solid;\n border-color: " + theme["Reply Border"] + ";\n background: " + theme["Reply Background"] + ";\n}\n.thread > .replyContainer > .reply.post {\n border-width: " + (_conf['Post Spacing'] === "0" ? "1px 1px 0 1px" : '1px') + ";\n}\n.exblock.reply,\n.reply.post.highlight,\n.reply.post:target {\n background: " + theme["Highlighted Reply Background"] + ";\n border: 1px solid " + theme["Highlighted Reply Border"] + ";\n}\n#header-bar,\n.pagelist {\n background: " + theme["Navigation Background"] + ";\n border-style: solid;\n border-color: " + theme["Navigation Border"] + ";\n}\n.thread {\n background: " + theme["Thread Wrapper Background"] + ";\n border: 1px solid " + theme["Thread Wrapper Border"] + ";\n}\n#boardNavDesktopFoot,\n#mascotConf,\n#mascot_hide,\n#menu,\n#selectrice,\n#themeConf,\n#watcher,\n#watcher:hover,\n.notification,\n.submenu,\na[style=\"cursor: pointer; float: right;\"] ~ div[style^=\"width: 100%;\"] > table {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Dialog Border"] + ";\n}\n.deleteform::before,\n.deleteform,\n#qr .warning {\n background: " + theme["Input Background"] + ";\n border-color: " + theme["Input Border"] + ";\n}\n.disabledwarning,\n.warning {\n color: " + theme["Warnings"] + ";\n}\n#navlinks a:first-of-type {\n border-bottom: 11px solid rgb(130,130,130);\n}\n#navlinks a:last-of-type {\n border-top: 11px solid rgb(130,130,130);\n}\n#charCount {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.7)" : "rgba(255,255,255,0.7)") + ";\n}\n.postNum a {\n color: " + theme["Post Numbers"] + ";\n}\n.subject {\n color: " + theme["Subjects"] + " !important;\n}\n.dateTime,\n.post-ago {\n color: " + theme["Timestamps"] + " !important;\n}\n#fs_status a,\n#updater #update-status:not(.new)::after,\n#showQR,\n.abbr,\n.boxbar,\n.boxcontent,\n.deleteform::before,\n.pages strong,\n.pln,\n.reply,\n.reply.highlight,\n.summary,\nbody,\nbutton,\nspan[style=\"left: 5px; position: absolute;\"] a,\ninput,\ntextarea {\n color: " + theme["Text"] + ";\n}\n#exlinks-options-content > table,\n#appchanx-settings fieldset,\n#selectrice {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n box-shadow: inset " + theme["Shadow Color"] + " 0 0 5px;\n}\n.quote + .spoiler:hover,\n.quote {\n color: " + theme["Greentext"] + ";\n}\n.forwardlink {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n border-bottom: 1px dashed " + theme["Backlinks"] + ";\n}\n.container::before {\n color: " + theme["Timestamps"] + ";\n}\n#menu,\n#post-preview,\n#qp .opContainer,\n#qp .replyContainer,\n.submenu {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.rice {\n background: " + theme["Checkbox Background"] + ";\n border: 1px solid " + theme["Checkbox Border"] + ";\n}\n.selectrice::before {\n border-left: 1px solid " + theme["Input Border"] + ";\n}\n.selectrice::after {\n border-top: .45em solid " + theme["Inputs"] + ";\n}\n.bd {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.pages a,\n#header-bar a {\n color: " + theme["Navigation Links"] + ";\n}\ninput[type=checkbox]:checked + .rice {\n position: relative;\n}\ninput[type=checkbox]:checked + .rice::after {\n content: \"\";\n display: block;\n width: 4px;\n height: 10px;\n border: solid " + theme["Inputs"] + ";\n border-width: 0 3px 3px 0;\n " + agent + "transform: rotate(45deg);\n position: absolute;\n left: 2px;\n bottom: -1px;\n}\n#addReply,\n#dump,\n.button,\n.entry,\n.replylink,\na {\n color: " + theme["Links"] + ";\n}\n.backlink {\n color: " + theme["Backlinks"] + ";\n}\n.qiQuote,\n.quotelink {\n color: " + theme["Quotelinks"] + ";\n}\n#addReply:hover,\n#dump:hover,\n.entry:hover,\n.sideArrows a:hover,\n.replylink:hover,\n.qiQuote:hover,\n.quotelink:hover,\na .name:hover,\na .postertrip:hover,\na:hover {\n color: " + theme["Hovered Links"] + ";\n}\n#header-bar a:hover,\n#boardTitle a:hover {\n color: " + theme["Hovered Navigation Links"] + ";\n}\n#boardTitle {\n color: " + theme["Board Title"] + ";\n}\n.name,\n.post-author {\n color: " + theme["Names"] + " !important;\n}\n.post-tripcode,\n.postertrip,\n.trip {\n color: " + theme["Tripcodes"] + " !important;\n}\na .postertrip,\na .name {\n color: " + theme["Emails"] + ";\n}\n.post.reply.qphl,\n.post.op.qphl {\n border-color: " + theme["Backlinked Reply Outline"] + ";\n background: " + theme["Highlighted Reply Background"] + ";\n}\n.inline .post {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.placeholder,\n#qr input::" + agent + "placeholder,\n#qr textarea::" + agent + "placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#qr input:" + agent + "placeholder,\n#qr textarea:" + agent + "placeholder,\n.placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#appchanx-settings fieldset,\n.boxcontent dd,\n.selectrice ul {\n border-color: " + (Style.lightTheme ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)") + ";\n}\n#appchanx-settings li,\n#selectrice li:not(:first-of-type) {\n border-top: 1px solid " + (Style.lightTheme ? "rgba(0,0,0,0.05)" : "rgba(255,255,255,0.025)") + ";\n}\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n.navLinks > a:first-of-type::after,\n#watcher::after,\n#globalMessage::after,\n#boardNavDesktopFoot::after,\na[style=\"cursor: pointer; float: right;\"]::after,\n#img-controls,\n#catalog::after,\n#fappeTyme {\n background-image: url('" + icons + "');\n" + (!Style.lightTheme ? "filter: url(\"data:image/svg+xml,#filters\");" : "") + "\n}\n" + theme["Custom CSS"]; css += (Style.lightTheme ? ".prettyprint {\n background-color: #e7e7e7;\n border: 1px solid #dcdcdc;\n}\n.com {\n color: #dd0000;\n}\n.str,\n.atv {\n color: #7fa61b;\n}\n.pun {\n color: #61663a;\n}\n.tag {\n color: #117743;\n}\n.kwd {\n color: #5a6F9e;\n}\n.typ,\n.atn {\n color: #9474bd;\n}\n.lit {\n color: #368c72;\n}\n" : ".prettyprint {\n background-color: rgba(0,0,0,.1);\n border: 1px solid rgba(0,0,0,0.5);\n}\n.tag {\n color: #96562c;\n}\n.pun {\n color: #5b6f2a;\n}\n.com {\n color: #a34443;\n}\n.str,\n.atv {\n color: #8ba446;\n}\n.kwd {\n color: #987d3e;\n}\n.typ,\n.atn {\n color: #897399;\n}\n.lit {\n color: #558773;\n}\n"); if (_conf["Alternate Post Colors"]) { css += ".replyContainer:not(.hidden):nth-of-type(2n+1) .post {\n background-image: " + agent + "linear-gradient(" + (Style.lightTheme ? "rgba(0,0,0,0.05), rgba(0,0,0,0.05)" : "rgba(255,255,255,0.02), rgba(255,255,255,0.02)") + ");\n}\n"; @@ -12015,45 +11030,38 @@ if (iconOffset < 0) { iconOffset = 0; } - css += "/* 4chan X Options */\n#appchanOptions {\n " + align + ": " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Watcher */\n#watcher::after {\n " + align + ": " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n " + align + ": " + position[i++] + "px;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Expand Images */\n#img-controls {\n " + align + ": " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n " + align + ": " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n " + align + ": " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a {\n margin: 2px;\n top: 1px;\n}\n#navlinks a:last-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#navlinks a:first-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 1.6em;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#boardNavDesktopFoot::after,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#watcher::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\ndiv.navLinks > a:first-of-type::after,\n#catalog::after,\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: 1px !important;\n}\n" + (_conf["Announcements"] === "slideout" ? "#globalMessage," : "") + "\n" + (_conf["Slideout Watcher"] ? "#watcher," : "") + "\n#boardNavDesktopFoot {\n top: 16px !important;\n}\n" + (_conf['Boards Navigation'] === 'Top' || _conf['Boards Navigation'] === 'Sticky top' ? '#header-bar' : _conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? '.pagelist' : void 0) + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}\n"; - if (_conf["Updater Position"] !== 'moveable') { - css += "/* Updater + Stats */\n#updater,\n#thread-stats {\n " + align + ": " + (_conf["Updater Position"] === "bottom" && !_conf["Hide Delete UI"] ? 23 : 2) + "px !important;\n " + Style.sidebarLocation[1] + ": auto !important;\n top: auto !important;\n bottom: auto !important;\n " + (_conf["Updater Position"] === 'top' ? "top: 16px !important" : "bottom: 0 !important") + ";\n}"; - } + css += "/* 4chan X Options */\n#appchanOptions {\n " + align + ": " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Watcher */\n#watcher::after {\n " + align + ": " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n " + align + ": " + position[i++] + "px;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Expand Images */\n#img-controls {\n " + align + ": " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n " + align + ": " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n " + align + ": " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a {\n margin: 2px;\n top: 1px;\n}\n#navlinks a:last-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#navlinks a:first-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 1.6em;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#boardNavDesktopFoot::after,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#watcher::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\ndiv.navLinks > a:first-of-type::after,\n#catalog::after,\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: 1px !important;\n}\n" + (_conf["Announcements"] === "slideout" ? "#globalMessage," : "") + "\n" + (_conf["Slideout Watcher"] ? "#watcher," : "") + "\n#boardNavDesktopFoot {\n top: 16px !important;\n}\n.fixed.top #header-bar" + (_conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? ',\n.pagelist' : '') + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}\n"; } else { position = aligner(2 + (_conf["4chan Banner"] === "at sidebar top" ? Style.logoOffset + 19 : 0), [notEither && _conf['Image Expansion'], true, true, _conf['Slideout Navigation'] !== 'hide', _conf['Announcements'] === 'slideout' && $('#globalMessage', d.body), notCatalog && _conf['Slideout Watcher'] && _conf['Thread Watcher'], notCatalog && $('body > a[style="cursor: pointer; float: right;"]', d.body), $('#navtopright .exlinksOptionsLink', d.body), notEither, g.VIEW === 'thread', notEither && _conf['Fappe Tyme'], navlinks = ((g.VIEW !== 'thread' && _conf['Index Navigation']) || (g.VIEW === 'thread' && _conf['Reply Navigation'])) && notCatalog, navlinks]); iconOffset = (g.VIEW === 'thread' && _conf['Prefetch'] ? 250 + Style.sidebarOffset.W : 20 + (g.VIEW === 'thread' && _conf['Updater Position'] === 'top' ? 100 : 0)) - (_conf['4chan SS Navigation'] ? 0 : Style.sidebar + parseInt(_conf[align.capitalize() + " Thread Padding"], 10)); - css += "/* Expand Images */\n#img-controls {\n top: " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n top: " + position[i++] + "px;\n}\n/* 4chan X Options */\n#appchanOptions {\n top: " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot,\n#boardNavDesktopFoot::after {\n top: " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage,\n#globalMessage::after {\n top: " + position[i++] + "px;\n}\n/* Watcher */\n" + (_conf["Slideout Watcher"] ? "#watcher, #watcher::after" : "") + " {\n top: " + position[i++] + "px !important;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n top: " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n top: " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n top: " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n top: " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a:first-of-type {\n top: " + position[i++] + "px !important;\n}\n#navlinks a:last-of-type {\n top: " + position[i++] + "px !important;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 0;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#navlinks a,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#boardNavDesktopFoot::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\n" + (_conf["Slideout Watcher"] ? "#watcher::after," : "") + "\nbody > a[style=\"cursor: pointer; float: right;\"]::after,\n#catalog::after,\ndiv.navLinks > a:first-of-type::after {\n " + align + ": 3px !important;\n}\n#boardNavDesktopFoot,\n#globalMessage,\n#watcher {\n width: " + (233 + Style.sidebarOffset.W) + "px !important;\n " + align + ": 18px !important;\n}\n" + (_conf['Boards Navigation'] === 'Top' || _conf['Boards Navigation'] === 'Sticky top' ? '#header-bar' : _conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? '.pagelist' : void 0) + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}"; - if (_conf["Updater Position"] !== 'moveable') { - css += "/* Updater + Stats */\n#updater,\n#thread-stats {\n " + align + ": " + (_conf["Updater Position"] === "top" || !_conf["Hide Delete UI"] ? 23 : 2) + "px !important; \n " + Style.sidebarLocation[1] + ": auto !important;\n top: " + (_conf["Updater Position"] === "top" ? "-1px" : "auto") + " !important;\n bottom: " + (_conf["Updater Position"] === "bottom" ? "-2px" : "auto") + " !important;\n}"; - } + css += "/* Expand Images */\n#img-controls {\n top: " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n top: " + position[i++] + "px;\n}\n/* 4chan X Options */\n#appchanOptions {\n top: " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot,\n#boardNavDesktopFoot::after {\n top: " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage,\n#globalMessage::after {\n top: " + position[i++] + "px;\n}\n/* Watcher */\n" + (_conf["Slideout Watcher"] ? "#watcher, #watcher::after" : "") + " {\n top: " + position[i++] + "px !important;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n top: " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n top: " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n top: " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n top: " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a:first-of-type {\n top: " + position[i++] + "px !important;\n}\n#navlinks a:last-of-type {\n top: " + position[i++] + "px !important;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 0;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#navlinks a,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#boardNavDesktopFoot::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\n" + (_conf["Slideout Watcher"] ? "#watcher::after," : "") + "\nbody > a[style=\"cursor: pointer; float: right;\"]::after,\n#catalog::after,\ndiv.navLinks > a:first-of-type::after {\n " + align + ": 3px !important;\n}\n#boardNavDesktopFoot,\n#globalMessage,\n#watcher {\n width: " + (233 + Style.sidebarOffset.W) + "px !important;\n " + align + ": 18px !important;\n}\n.fixed.top #header-bar" + (_conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? ',\n.pagelist' : '') + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}"; } return Style.icons.textContent = css; }, padding: function() { var css, sheet, _conf; - if (!(sheet = Style.paddingSheet)) { + if (!((sheet = Style.paddingSheet) && Style.padding.nav)) { return; } _conf = Conf; - Style.padding.nav.property = _conf["Boards Navigation"].split(" "); - Style.padding.nav.property = Style.padding.nav.property[Style.padding.nav.property.length - 1]; + Style.padding.nav.property = _conf['Bottom Header'] ? 'bottom' : 'top'; if (Style.padding.pages) { Style.padding.pages.property = _conf["Pagination"].split(" "); Style.padding.pages.property = Style.padding.pages.property[Style.padding.pages.property.length - 1]; } css = "body::before {\n"; - if (Style.padding.pages && (_conf["Pagination"] === "sticky top" || _conf["Pagination"] === "sticky bottom")) { + if (Style.padding.pages && ["sticky top", "top", "sticky bottom"].contains(_conf["Pagination"])) { css += " " + Style.padding.pages.property + ": " + Style.padding.pages.offsetHeight + "px !important;\n"; } - if (_conf["Boards Navigation"] === "Sticky top" || _conf["Boards Navigation"] === "Sticky bottom") { + if (_conf['Fixed Header']) { css += " " + Style.padding.nav.property + ": " + Style.padding.nav.offsetHeight + "px !important;\n"; } css += "}\nbody {\n padding-bottom: 0;\n"; - if ((Style.padding.pages != null) && (_conf["Pagination"] === "sticky top" || _conf["Pagination"] === "sticky bottom" || _conf["Pagination"] === "top")) { + if ((Style.padding.pages != null) && ["sticky top", "top", "sticky bottom"].contains(_conf["Pagination"])) { css += " padding-" + Style.padding.pages.property + ": " + Style.padding.pages.offsetHeight + "px;\n"; } - if (_conf["Boards Navigation"] !== "Hide") { + if (!(_conf['Header auto-hide'] || _conf['Hide Header'])) { css += " padding-" + Style.padding.nav.property + ": " + Style.padding.nav.offsetHeight + "px;\n"; } css += "}"; @@ -12456,6 +11464,1343 @@ } }; + PSAHiding = { + init: function() { + var entry; + + if (!Conf['Announcement Hiding']) { + return; + } + entry = { + type: 'header', + el: $.el('a', { + textContent: 'Show announcement', + className: 'show-announcement', + href: 'javascript:;' + }), + order: 50, + open: function() { + var _ref; + + if ((_ref = $.id('globalMessage')) != null ? _ref.hidden : void 0) { + return true; + } + return false; + } + }; + $.event('AddMenuEntry', entry); + $.on(entry.el, 'click', PSAHiding.toggle); + $.addClass(doc, 'hide-announcement'); + return $.on(d, '4chanXInitFinished', this.setup); + }, + setup: function() { + var btn, psa; + + $.off(d, '4chanXInitFinished', PSAHiding.setup); + if (!(psa = $.id('globalMessage'))) { + return; + } + PSAHiding.btn = btn = $.el('a', { + innerHTML: '[ - ]', + title: 'Hide announcement.', + className: 'hide-announcement', + href: 'javascript:;', + textContent: '[ - ]' + }); + $.on(btn, 'click', PSAHiding.toggle); + return $.get('hiddenPSAs', [], function(item) { + return PSAHiding.sync(item['hiddenPSAs']); + }); + }, + toggle: function(e) { + var text; + + text = PSAHiding.trim($.id('globalMessage')); + return $.get('hiddenPSAs', [], function(_arg) { + var hiddenPSAs, i; + + hiddenPSAs = _arg.hiddenPSAs; + if (hide) { + hiddenPSAs.push(text); + hiddenPSAs = hiddenPSAs.slice(-5); + } else { + $.event('CloseMenu'); + i = hiddenPSAs.indexOf(text); + hiddenPSAs.splice(i, 1); + } + PSAHiding.sync(hiddenPSAs); + return $.set('hiddenPSAs', hiddenPSAs); + }); + }, + sync: function(hiddenPSAs) { + var hr, psa; + + psa = $.id('globalMessage'); + psa.hidden = PSAHiding.btn.hidden = hiddenPSAs.contains(PSAHiding.trim(psa)) ? true : false; + if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') { + return hr.hidden = psa.hidden; + } + }, + trim: function(psa) { + return psa.textContent.replace(/\W+/g, '').toLowerCase(); + } + }; + + CatalogLinks = { + init: function() { + var el, input; + + $.ready(this.ready); + if (!Conf['Catalog Links']) { + return; + } + el = $.el('label', { + id: 'toggleCatalog', + href: 'javascript:;', + innerHTML: "Catalog Links", + title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "." + }); + input = $('input', el); + $.on(input, 'change', this.toggle); + $.sync('Header catalog links', CatalogLinks.set); + $.event('AddMenuEntry', { + type: 'header', + el: el, + order: 95 + }); + return $.on(d, '4chanXInitFinished', function() { + return CatalogLinks.set(Conf['Header catalog links']); + }); + }, + toggle: function() { + var useCatalog; + + $.event('CloseMenu'); + $.set('Header catalog links', useCatalog = this.checked); + return CatalogLinks.set(useCatalog); + }, + set: function(useCatalog) { + var a, board, path, _i, _len, _ref; + + path = useCatalog ? 'catalog' : ''; + _ref = $$("#board-list a[href*=\"boards.4chan.org\"],\n#boardNavDesktop a[href*=\"boards.4chan.org\"],\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + a = _ref[_i]; + board = a.pathname.split('/')[1]; + if (['f', 'status', '4chan'].contains(board) || !board) { + continue; + } + if (Conf['External Catalog']) { + a.href = useCatalog ? CatalogLinks.external(board) : "//boards.4chan.org/" + board + "/"; + } else { + a.pathname = "/" + board + "/" + path; + } + a.title = useCatalog ? "" + a.title + " - Catalog" : a.title.replace(/\ -\ Catalog$/, ''); + } + return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; + }, + external: function(board) { + return (['a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'].contains(board) ? "http://catalog.neet.tv/" + board : ['d', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'].contains(board) ? "http://4index.gropes.us/" + board : "//boards.4chan.org/" + board + "/catalog"); + }, + ready: function() { + var catalogLink; + + if (catalogLink = $('.pages.cataloglink a', d.body) || $('[href=".././catalog"]', d.body)) { + if (g.VIEW !== 'thread') { + $.add(d.body, catalogLink); + } + return catalogLink.id = 'catalog'; + } + } + }; + + IDColor = { + init: function() { + if (!Conf['Color User IDs']) { + return; + } + return Post.prototype.callbacks.push({ + name: 'Reveal Spoilers', + cb: this.node + }); + }, + node: function(post) { + var str, uid; + + if (!(uid = $('.hand', this.nodes.uniqueID))) { + return; + } + str = this.info.uniqueID; + if (uid.nodeName === 'SPAN') { + return uid.style.cssText = IDColor.apply.call(str); + } + }, + ids: {}, + compute: function(str) { + var hash, rgb; + + hash = this.hash(str); + rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; + rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; + this.ids[str] = rgb; + return rgb; + }, + apply: function() { + var rgb; + + rgb = IDColor.ids[this] || IDColor.compute(this); + return ("background-color: rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "); color: ") + (rgb[3] ? "black;" : "white; border-radius: 3px; padding: 0px 2px;"); + }, + hash: function(str) { + var i, j, msg; + + msg = 0; + i = 0; + j = str.length; + while (i < j) { + msg = ((msg << 5) - msg) + str.charCodeAt(i); + ++i; + } + return msg; + } + }; + + CustomCSS = { + init: function() { + if (!Conf['Custom CSS']) { + return; + } + return this.addStyle(); + }, + addStyle: function() { + return this.style = $.addStyle(Conf['usercss']); + }, + rmStyle: function() { + if (this.style) { + $.rm(this.style); + return delete this.style; + } + }, + update: function() { + if (!this.style) { + this.addStyle(); + } + return this.style.textContent = Conf['usercss']; + } + }; + + ExpandComment = { + init: function() { + if (g.VIEW !== 'index' || !Conf['Comment Expansion']) { + return; + } + if (g.BOARD.ID === 'g') { + this.callbacks.push(Fourchan.code); + } + if (g.BOARD.ID === 'sci') { + this.callbacks.push(Fourchan.math); + } + return Post.prototype.callbacks.push({ + name: 'Comment Expansion', + cb: this.node + }); + }, + node: function() { + var a; + + if (a = $('.abbr > a', this.nodes.comment)) { + return $.on(a, 'click', ExpandComment.cb); + } + }, + callbacks: [], + cb: function(e) { + var post; + + e.preventDefault(); + post = Get.postFromNode(this); + return ExpandComment.expand(post); + }, + expand: function(post) { + var a; + + if (post.nodes.longComment && !post.nodes.longComment.parentNode) { + $.replace(post.nodes.shortComment, post.nodes.longComment); + post.nodes.comment = post.nodes.longComment; + return; + } + if (!(a = $('.abbr > a', post.nodes.comment))) { + return; + } + a.textContent = "Post No." + post + " Loading..."; + return $.cache("//api.4chan.org" + a.pathname + ".json", function() { + return ExpandComment.parse(this, a, post); + }); + }, + contract: function(post) { + var a; + + if (!post.nodes.shortComment) { + return; + } + a = $('.abbr > a', post.nodes.shortComment); + a.textContent = 'here'; + $.replace(post.nodes.longComment, post.nodes.shortComment); + return post.nodes.comment = post.nodes.shortComment; + }, + parse: function(req, a, post) { + var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; + + status = req.status; + if (![200, 304].contains(status)) { + a.textContent = "Error " + req.statusText + " (" + status + ")"; + return; + } + posts = JSON.parse(req.response).posts; + if (spoilerRange = posts[0].custom_spoiler) { + Build.spoilerRange[g.BOARD] = spoilerRange; + } + for (_i = 0, _len = posts.length; _i < _len; _i++) { + postObj = posts[_i]; + if (postObj.no === post.ID) { + break; + } + } + if (postObj.no !== post.ID) { + a.textContent = "Post No." + post + " not found."; + return; + } + comment = post.nodes.comment; + clone = comment.cloneNode(false); + clone.innerHTML = postObj.com; + _ref = $$('.quotelink', clone); + for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { + quote = _ref[_j]; + href = quote.getAttribute('href'); + if (href[0] === '/') { + continue; + } + quote.href = "/" + post.board + "/res/" + href; + } + post.nodes.shortComment = comment; + $.replace(comment, clone); + post.nodes.comment = post.nodes.longComment = clone; + post.parseComment(); + post.parseQuotes(); + _ref1 = ExpandComment.callbacks; + for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { + callback = _ref1[_k]; + callback.call(post); + } + } + }; + + ExpandThread = { + init: function() { + if (g.VIEW !== 'index' || !Conf['Thread Expansion']) { + return; + } + return Thread.prototype.callbacks.push({ + name: 'Thread Expansion', + cb: this.node + }); + }, + node: function() { + var a, span; + + if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { + return; + } + a = $.el('a', { + textContent: "+ " + span.textContent, + className: 'summary', + href: 'javascript:;' + }); + $.on(a, 'click', ExpandThread.cbToggle); + return $.replace(span, a); + }, + cbToggle: function() { + var op; + + op = Get.postFromRoot(this.previousElementSibling); + return ExpandThread.toggle(op.thread); + }, + toggle: function(thread) { + var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; + + threadRoot = thread.OP.nodes.root.parentNode; + a = $('.summary', threadRoot); + switch (thread.isExpanded) { + case false: + case void 0: + thread.isExpanded = 'loading'; + _ref = $$('.thread > .postContainer', threadRoot); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + post = _ref[_i]; + ExpandComment.expand(Get.postFromRoot(post)); + } + if (!a) { + thread.isExpanded = true; + return; + } + thread.isExpanded = 'loading'; + a.textContent = a.textContent.replace('+', '× Loading...'); + $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { + return ExpandThread.parse(this, thread, a); + }); + break; + case 'loading': + thread.isExpanded = false; + if (!a) { + return; + } + a.textContent = a.textContent.replace('× Loading...', '+'); + break; + case true: + thread.isExpanded = false; + if (a) { + a.textContent = a.textContent.replace('-', '+'); + num = (function() { + if (thread.isSticky) { + return 1; + } else { + switch (g.BOARD.ID) { + case 'b': + case 'vg': + case 'q': + return 3; + case 't': + return 1; + default: + return 5; + } + } + })(); + replies = $$('.thread > .replyContainer', threadRoot).slice(0, -num); + for (_j = 0, _len1 = replies.length; _j < _len1; _j++) { + reply = replies[_j]; + if (Conf['Quote Inlining']) { + while (inlined = $('.inlined', reply)) { + inlined.click(); + } + } + $.rm(reply); + } + } + _ref1 = $$('.thread > .postContainer', threadRoot); + for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { + post = _ref1[_k]; + ExpandComment.contract(Get.postFromRoot(post)); + } + } + }, + parse: function(req, thread, a) { + var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; + + if (a.textContent[0] === '+') { + return; + } + status = req.status; + if (![200, 304].contains(status)) { + a.textContent = "Error " + req.statusText + " (" + status + ")"; + $.off(a, 'click', ExpandThread.cb.toggle); + return; + } + thread.isExpanded = true; + a.textContent = a.textContent.replace('× Loading...', '-'); + posts = JSON.parse(req.response).posts; + if (spoilerRange = posts[0].custom_spoiler) { + Build.spoilerRange[g.BOARD] = spoilerRange; + } + replies = posts.slice(1); + posts = []; + nodes = []; + for (_i = 0, _len = replies.length; _i < _len; _i++) { + reply = replies[_i]; + if (post = thread.posts[reply.no]) { + nodes.push(post.nodes.root); + continue; + } + node = Build.postFromObject(reply, thread.board); + post = new Post(node, thread, thread.board); + link = $('a[title="Highlight this post"]', node); + link.href = "res/" + thread + "#p" + post; + link.nextSibling.href = "res/" + thread + "#q" + post; + posts.push(post); + nodes.push(node); + } + Main.callbackNodes(Post, posts); + $.after(a, nodes); + return Fourchan.parseThread(thread.ID, 1, nodes.length); + } + }; + + FileInfo = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) { + return; + } + this.funk = this.createFunc(Conf['fileInfo']); + return Post.prototype.callbacks.push({ + name: 'File Info Formatting', + cb: this.node + }); + }, + node: function() { + if (!this.file || this.isClone) { + return; + } + return this.file.text.innerHTML = FileInfo.funk(FileInfo, this); + }, + createFunc: function(format) { + var code; + + code = format.replace(/%(.)/g, function(s, c) { + if (c in FileInfo.formatters) { + return "' + FileInfo.formatters." + c + ".call(post) + '"; + } else { + return s; + } + }); + return Function('FileInfo', 'post', "return '" + code + "'"); + }, + convertUnit: function(size, unit) { + var i; + + if (unit === 'B') { + return "" + (size.toFixed()) + " Bytes"; + } + i = 1 + ['KB', 'MB'].indexOf(unit); + while (i--) { + size /= 1024; + } + size = unit === 'MB' ? Math.round(size * 100) / 100 : size.toFixed(); + return "" + size + " " + unit; + }, + escape: function(name) { + return name.replace(/<|>/g, function(c) { + return c === '<' && '<' || '>'; + }); + }, + formatters: { + t: function() { + return this.file.URL.match(/\d+\..+$/)[0]; + }, + T: function() { + return "" + (FileInfo.formatters.t.call(this)) + ""; + }, + l: function() { + return "" + (FileInfo.formatters.n.call(this)) + ""; + }, + L: function() { + return "" + (FileInfo.formatters.N.call(this)) + ""; + }, + n: function() { + var fullname, shortname; + + fullname = this.file.name; + shortname = Build.shortFilename(this.file.name, this.isReply); + if (fullname === shortname) { + return FileInfo.escape(fullname); + } else { + return "" + (FileInfo.escape(shortname)) + "" + (FileInfo.escape(fullname)) + ""; + } + }, + N: function() { + return FileInfo.escape(this.file.name); + }, + p: function() { + if (this.file.isSpoiler) { + return 'Spoiler, '; + } else { + return ''; + } + }, + s: function() { + return this.file.size; + }, + B: function() { + return FileInfo.convertUnit(this.file.sizeInBytes, 'B'); + }, + K: function() { + return FileInfo.convertUnit(this.file.sizeInBytes, 'KB'); + }, + M: function() { + return FileInfo.convertUnit(this.file.sizeInBytes, 'MB'); + }, + r: function() { + if (this.file.isImage) { + return this.file.dimensions; + } else { + return 'PDF'; + } + } + } + }; + + Fourchan = { + init: function() { + var board; + + if (g.VIEW === 'catalog') { + return; + } + board = g.BOARD.ID; + if (board === 'g') { + $.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML);\n}, false);"); + Post.prototype.callbacks.push({ + name: 'Parse /g/ code', + cb: this.code + }); + } + if (board === 'sci') { + $.globalEval("window.addEventListener('jsmath', function(e) {\n if (jsMath.loaded) {\n // process one post\n jsMath.ProcessBeforeShowing(e.detail);\n } else {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);"); + return Post.prototype.callbacks.push({ + name: 'Parse /sci/ math', + cb: this.math + }); + } + }, + code: function() { + var pre, _i, _len, _ref; + + if (this.isClone) { + return; + } + _ref = $$('.prettyprint', this.nodes.comment); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + pre = _ref[_i]; + $.event('prettyprint', pre, window); + } + }, + math: function() { + if (this.isClone || !$('.math', this.nodes.comment)) { + return; + } + return $.event('jsmath', this.nodes.post, window); + }, + parseThread: function(threadID, offset, limit) { + return $.event('4chanParsingDone', { + threadId: threadID, + offset: offset, + limit: limit + }); + } + }; + + Keybinds = { + init: function() { + var init; + + if (g.VIEW === 'catalog' || !Conf['Keybinds']) { + return; + } + init = function() { + var node, _i, _len, _ref; + + $.off(d, '4chanXInitFinished', init); + $.on(d, 'keydown', Keybinds.keydown); + _ref = $$('[accesskey]'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + node = _ref[_i]; + node.removeAttribute('accesskey'); + } + }; + return $.on(d, '4chanXInitFinished', init); + }, + keydown: function(e) { + var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; + + if (!(key = Keybinds.keyCode(e))) { + return; + } + target = e.target; + if (['INPUT', 'TEXTAREA'].contains(target.nodeName)) { + if (!/(Esc|Alt|Ctrl|Meta)/.test(key)) { + return; + } + } + threadRoot = Nav.getThread(); + if (op = $('.op', threadRoot)) { + thread = Get.postFromNode(op).thread; + } + switch (key) { + case Conf['Toggle board list']: + if (Conf['Custom Board Navigation']) { + Header.toggleBoardList(); + } + break; + case Conf['Toggle header']: + if (!$('#menu.left')) { + Header.menuButton.click(); + } + Header.headerToggler.click(); + break; + case Conf['Open empty QR']: + Keybinds.qr(threadRoot); + break; + case Conf['Open QR']: + Keybinds.qr(threadRoot, true); + break; + case Conf['Open settings']: + Settings.open(); + break; + case Conf['Close']: + if ($.id('fourchanx-settings')) { + Settings.close(); + } else if ((notifications = $$('.notification')).length) { + for (_i = 0, _len = notifications.length; _i < _len; _i++) { + notification = notifications[_i]; + $('.close', notification).click(); + } + } else if (QR.nodes) { + QR.close(); + } + break; + case Conf['Spoiler tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('spoiler', target); + break; + case Conf['Code tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('code', target); + break; + case Conf['Eqn tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('eqn', target); + break; + case Conf['Math tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('math', target); + break; + case Conf['Toggle sage']: + if (QR.nodes) { + Keybinds.sage(); + } + break; + case Conf['Submit QR']: + if (QR.nodes && !QR.status()) { + QR.submit(); + } + break; + case Conf['Watch']: + ThreadWatcher.toggle(thread); + break; + case Conf['Update']: + ThreadUpdater.update(); + break; + case Conf['Expand image']: + Keybinds.img(threadRoot); + break; + case Conf['Expand images']: + Keybinds.img(threadRoot, true); + break; + case Conf['fappeTyme']: + FappeTyme.toggle(); + break; + case Conf['Front page']: + window.location = "/" + g.BOARD + "/0#delform"; + break; + case Conf['Open front page']: + $.open("/" + g.BOARD + "/#delform"); + break; + case Conf['Next page']: + if (form = $('.next form')) { + window.location = form.action; + } + break; + case Conf['Previous page']: + if (form = $('.prev form')) { + window.location = form.action; + } + break; + case Conf['Open catalog']: + if (Conf['External Catalog']) { + window.location = CatalogLinks.external(g.BOARD.ID); + } else { + window.location = "/" + g.BOARD + "/catalog"; + } + break; + case Conf['Next thread']: + if (g.VIEW === 'thread') { + return; + } + Nav.scroll(+1); + break; + case Conf['Previous thread']: + if (g.VIEW === 'thread') { + return; + } + Nav.scroll(-1); + break; + case Conf['Expand thread']: + ExpandThread.toggle(thread); + break; + case Conf['Open thread']: + Keybinds.open(thread); + break; + case Conf['Open thread tab']: + Keybinds.open(thread, true); + break; + case Conf['Next reply']: + Keybinds.hl(+1, threadRoot); + break; + case Conf['Previous reply']: + Keybinds.hl(-1, threadRoot); + break; + case Conf['Hide']: + if (g.VIEW === 'index') { + ThreadHiding.toggle(thread); + } + break; + default: + return; + } + e.preventDefault(); + return e.stopPropagation(); + }, + keyCode: function(e) { + var kc, key; + + key = (function() { + switch (kc = e.keyCode) { + case 8: + return ''; + case 13: + return 'Enter'; + case 27: + return 'Esc'; + case 37: + return 'Left'; + case 38: + return 'Up'; + case 39: + return 'Right'; + case 40: + return 'Down'; + default: + if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { + return String.fromCharCode(kc).toLowerCase(); + } else { + return null; + } + } + })(); + if (key) { + if (e.altKey) { + key = 'Alt+' + key; + } + if (e.ctrlKey) { + key = 'Ctrl+' + key; + } + if (e.metaKey) { + key = 'Meta+' + key; + } + if (e.shiftKey) { + key = 'Shift+' + key; + } + } + return key; + }, + qr: function(thread, quote) { + if (!(Conf['Quick Reply'] && QR.postingIsEnabled)) { + return; + } + QR.open(); + if (quote) { + QR.quote.call($('input', $('.post.highlight', thread) || thread)); + } + QR.nodes.com.focus(); + if (Conf['QR Shortcut']) { + return $.rmClass($('.qr-shortcut'), 'disabled'); + } + }, + tags: function(tag, ta) { + var range, selEnd, selStart, value; + + value = ta.value; + selStart = ta.selectionStart; + selEnd = ta.selectionEnd; + ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd); + range = ("[" + tag + "]").length + selEnd; + ta.setSelectionRange(range, range); + return $.event('input', null, ta); + }, + sage: function() { + var isSage; + + isSage = /sage/i.test(QR.nodes.email.value); + return QR.nodes.email.value = isSage ? "" : "sage"; + }, + img: function(thread, all) { + var post; + + if (all) { + return ImageExpand.cb.toggleAll(); + } else { + post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread)); + return ImageExpand.toggle(post); + } + }, + open: function(thread, tab) { + var url; + + if (g.VIEW !== 'index') { + return; + } + url = "/" + thread.board + "/res/" + thread; + if (tab) { + return $.open(url); + } else { + return location.href = url; + } + }, + hl: function(delta, thread) { + var headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; + + if (Conf['Fixed Header'] && Conf['Bottom header']) { + topMargin = 0; + } else { + headRect = Header.bar.getBoundingClientRect(); + topMargin = headRect.top + headRect.height; + } + if (postEl = $('.reply.highlight', thread)) { + $.rmClass(postEl, 'highlight'); + rect = postEl.getBoundingClientRect(); + if (rect.bottom >= topMargin && rect.top <= doc.clientHeight) { + root = postEl.parentNode; + next = $.x('child::div[contains(@class,"post reply")]', delta === +1 ? root.nextElementSibling : root.previousElementSibling); + if (!next) { + this.focus(postEl); + return; + } + if (!(g.VIEW === 'thread' || $.x('ancestor::div[parent::div[@class="board"]]', next) === thread)) { + return; + } + rect = next.getBoundingClientRect(); + if (rect.top < 0 || rect.bottom > doc.clientHeight) { + if (delta === -1) { + window.scrollBy(0, rect.top - topMargin); + } else { + next.scrollIntoView(false); + } + } + this.focus(next); + return; + } + } + replies = $$('.reply', thread); + if (delta === -1) { + replies.reverse(); + } + for (_i = 0, _len = replies.length; _i < _len; _i++) { + reply = replies[_i]; + rect = reply.getBoundingClientRect(); + if (delta === +1 && rect.top >= topMargin || delta === -1 && rect.bottom <= doc.clientHeight) { + this.focus(reply); + return; + } + } + }, + focus: function(post) { + return $.addClass(post, 'highlight'); + } + }; + + Nav = { + init: function() { + var append, next, prev, span; + + switch (g.VIEW) { + case 'index': + if (!Conf['Index Navigation']) { + return; + } + break; + case 'thread': + if (!Conf['Reply Navigation']) { + return; + } + break; + default: + return; + } + span = $.el('span', { + id: 'navlinks' + }); + prev = $.el('a', { + href: 'javascript:;' + }); + next = $.el('a', { + href: 'javascript:;' + }); + $.on(prev, 'click', this.prev); + $.on(next, 'click', this.next); + $.add(span, [prev, $.tn(' '), next]); + append = function() { + $.off(d, '4chanXInitFinished', append); + return $.add(d.body, span); + }; + return $.on(d, '4chanXInitFinished', append); + }, + prev: function() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, 0); + } else { + return Nav.scroll(-1); + } + }, + next: function() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, d.body.scrollHeight); + } else { + return Nav.scroll(+1); + } + }, + getThread: function(full) { + var headRect, i, rect, thread, threads, topMargin, _i, _len; + + if (Conf['Bottom header']) { + topMargin = 0; + } else { + headRect = Header.bar.getBoundingClientRect(); + topMargin = headRect.top + headRect.height; + } + threads = $$('.thread:not([hidden])'); + for (i = _i = 0, _len = threads.length; _i < _len; i = ++_i) { + thread = threads[i]; + rect = thread.getBoundingClientRect(); + if (rect.bottom > topMargin) { + if (full) { + return [threads, thread, i, rect, topMargin]; + } else { + return thread; + } + } + } + return $('.board'); + }, + scroll: function(delta) { + var i, rect, thread, threads, top, topMargin, _ref, _ref1; + + _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; + top = rect.top - topMargin; + if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) { + i += delta; + } + top = ((_ref1 = threads[i]) != null ? _ref1.getBoundingClientRect().top : void 0) - topMargin; + return window.scrollBy(0, top); + } + }; + + RelativeDates = { + INTERVAL: $.MINUTE / 2, + init: function() { + if (g.VIEW === 'catalog' || !Conf['Relative Post Dates']) { + return; + } + $.on(d, 'visibilitychange ThreadUpdate', this.flush); + this.flush(); + return Post.prototype.callbacks.push({ + name: 'Relative Post Dates', + cb: this.node + }); + }, + node: function() { + var dateEl; + + if (this.isClone) { + return; + } + dateEl = this.nodes.date; + dateEl.title = dateEl.textContent; + return RelativeDates.setUpdate(this); + }, + relative: function(diff, now, date) { + var days, months, number, rounded, unit, years; + + unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); + rounded = Math.round(number); + if (rounded !== 1) { + unit += 's'; + } + return "" + rounded + " " + unit + " ago"; + }, + stale: [], + flush: function() { + var now, update, _i, _len, _ref; + + if (d.hidden) { + return; + } + now = new Date(); + _ref = RelativeDates.stale; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + update = _ref[_i]; + update(now); + } + RelativeDates.stale = []; + clearTimeout(RelativeDates.timeout); + return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); + }, + setUpdate: function(post) { + var markStale, setOwnTimeout, update; + + setOwnTimeout = function(diff) { + var delay; + + delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; + return setTimeout(markStale, delay); + }; + update = function(now) { + var date, diff, relative, singlePost, _i, _len, _ref; + + date = post.info.date; + diff = now - date; + relative = RelativeDates.relative(diff, now, date); + _ref = [post].concat(post.clones); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + singlePost = _ref[_i]; + singlePost.nodes.date.firstChild.textContent = relative; + } + return setOwnTimeout(diff); + }; + markStale = function() { + return RelativeDates.stale.push(update); + }; + return update(new Date()); + } + }; + + RemoveSpoilers = { + init: function() { + if (!Conf['Remove Spoilers']) { + return; + } + if (Conf['Indicate Spoilers']) { + this.wrapper = function(text) { + return "[spoiler]" + text + "[/spoiler]"; + }; + } + return Post.prototype.callbacks.push({ + name: 'Reveal Spoilers', + cb: this.node + }); + }, + wrapper: function(text) { + return text; + }, + node: function(post) { + var spoiler, spoilers, _i, _len; + + spoilers = $$('s', this.nodes.comment); + for (_i = 0, _len = spoilers.length; _i < _len; _i++) { + spoiler = spoilers[_i]; + $.replace(spoiler, $.tn(RemoveSpoilers.wrapper(spoiler.textContent))); + } + } + }; + + Report = { + init: function() { + if (!/report/.test(location.search)) { + return; + } + return $.ready(this.ready); + }, + ready: function() { + var field, form; + + form = $('form'); + field = $.id('recaptcha_response_field'); + $.on(field, 'keydown', function(e) { + if (e.keyCode === 8 && !field.value) { + return $.globalEval('Recaptcha.reload("t")'); + } + }); + return $.on(form, 'submit', function(e) { + var response; + + e.preventDefault(); + response = field.value.trim(); + if (!/\s/.test(response)) { + field.value = "" + response + " " + response; + } + return form.submit(); + }); + } + }; + + Sauce = { + init: function() { + var link, links, _i, _len, _ref; + + if (g.VIEW === 'catalog' || !Conf['Sauce']) { + return; + } + links = []; + _ref = Conf['sauces'].split('\n'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + if (link[0] === '#') { + continue; + } + links.push(this.createSauceLink(link.trim())); + } + if (!links.length) { + return; + } + this.links = links; + this.link = $.el('a', { + target: '_blank' + }); + return Post.prototype.callbacks.push({ + name: 'Sauce', + cb: this.node + }); + }, + createSauceLink: function(link) { + var m, text; + + link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { + switch (parameter) { + case '%TURL': + return "' + encodeURIComponent(post.file.thumbURL) + '"; + case '%URL': + return "' + encodeURIComponent(post.file.URL) + '"; + case '%MD5': + return "' + encodeURIComponent(post.file.MD5) + '"; + case '%board': + return "' + encodeURIComponent(post.board) + '"; + default: + return parameter; + } + }); + text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1]; + link = link.replace(/;text:.+$/, ''); + return Function('post', 'a', "a.href = '" + link + "';\na.textContent = '" + text + "';\nreturn a;"); + }, + node: function() { + var link, nodes, _i, _len, _ref; + + if (this.isClone || !this.file) { + return; + } + nodes = []; + _ref = Sauce.links; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + nodes.push($.tn('\u00A0'), link(this, Sauce.link.cloneNode(true))); + } + return $.add(this.file.info, nodes); + } + }; + + Time = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Time Formatting']) { + return; + } + this.funk = this.createFunc(Conf['time']); + return Post.prototype.callbacks.push({ + name: 'Time Formatting', + cb: this.node + }); + }, + node: function() { + if (this.isClone) { + return; + } + return this.nodes.date.textContent = Time.funk(Time, this.info.date); + }, + createFunc: function(format) { + var code; + + code = format.replace(/%([A-Za-z])/g, function(s, c) { + if (c in Time.formatters) { + return "' + Time.formatters." + c + ".call(date) + '"; + } else { + return s; + } + }); + return Function('Time', 'date', "return '" + code + "'"); + }, + day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + zeroPad: function(n) { + if (n < 10) { + return "0" + n; + } else { + return n; + } + }, + formatters: { + a: function() { + return Time.day[this.getDay()].slice(0, 3); + }, + A: function() { + return Time.day[this.getDay()]; + }, + b: function() { + return Time.month[this.getMonth()].slice(0, 3); + }, + B: function() { + return Time.month[this.getMonth()]; + }, + d: function() { + return Time.zeroPad(this.getDate()); + }, + e: function() { + return this.getDate(); + }, + H: function() { + return Time.zeroPad(this.getHours()); + }, + I: function() { + return Time.zeroPad(this.getHours() % 12 || 12); + }, + k: function() { + return this.getHours(); + }, + l: function() { + return this.getHours() % 12 || 12; + }, + m: function() { + return Time.zeroPad(this.getMonth() + 1); + }, + M: function() { + return Time.zeroPad(this.getMinutes()); + }, + p: function() { + if (this.getHours() < 12) { + return 'AM'; + } else { + return 'PM'; + } + }, + P: function() { + if (this.getHours() < 12) { + return 'am'; + } else { + return 'pm'; + } + }, + S: function() { + return Time.zeroPad(this.getSeconds()); + }, + y: function() { + return this.getFullYear() - 2000; + } + } + }; + Settings = { init: function() { var link, settings; @@ -12509,7 +12854,7 @@ Settings.addSection('Script', Settings.main); Settings.addSection('Filter', Settings.filter); Settings.addSection('Sauce', Settings.sauce); - Settings.addSection('Rice', Settings.rice); + Settings.addSection('Advanced', Settings.advanced); Settings.addSection('Keybinds', Settings.keybinds); $.on(d, 'AddSettingsSection', Settings.addSection); $.on(d, 'OpenSettings', function(e) { @@ -12544,7 +12889,7 @@ Settings.dialog = dialog = $.el('div', { id: 'appchanx-settings', "class": 'dialog', - innerHTML: "\n
\n
" + innerHTML: "
" }); Settings.overlay = overlay = $.el('div', { id: 'overlay' @@ -12846,6 +13191,13 @@ }); } data.Conf.WatchedThreads = data.WatchedThreads; + } else if (version[0] === '3') { + data = Settings.convertSettings(data, { + 'Reply Hiding': 'Reply Hiding Buttons', + 'Thread Hiding': 'Thread Hiding Buttons', + 'Bottom header': 'Bottom Header', + 'Unread Tab Icon': 'Unread Favicon' + }); } return $.set(data.Conf); }, @@ -12864,7 +13216,7 @@ filter: function(section) { var select; - section.innerHTML = "\n
"; + section.innerHTML = "
"; select = $('select', section); $.on(select, 'change', Settings.selectFilter); return Settings.selectFilter.call(select); @@ -12887,31 +13239,31 @@ $.add(div, ta); return; } - return div.innerHTML = "
Filter is disabled.
\n

\n Use regular expressions, one per line.
\n Lines starting with a # will be ignored.
\n For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
\n MD5 filtering uses exact string matching, not regular expressions.\n

\n
    You can use these settings with each regular expression, separate them with semicolons:\n
  • \n Per boards, separate them with commas. It is global if not specified.
    \n For example: boards:a,jp;.\n
  • \n
  • \n Filter OPs only along with their threads (`only`), replies only (`no`), or both (`yes`, this is default).
    \n For example: op:only;, op:no; or op:yes;.\n
  • \n
  • \n Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
    \n For example: stub:yes; or stub:no;.\n
  • \n
  • \n Highlight instead of hiding. You can specify a class name to use with a userstyle.
    \n For example: highlight; or highlight:wallpaper;.\n
  • \n
  • \n Highlighted OPs will have their threads put on top of board pages by default.
    \n For example: top:yes; or top:no;.\n
  • \n
"; + return div.innerHTML = "
Filter is disabled.

\nUse regular expressions, one per line.
\nLines starting with a # will be ignored.
\nFor example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
\nMD5 filtering uses exact string matching, not regular expressions.\n

    You can use these settings with each regular expression, separate them with semicolons:\n
  • \n Per boards, separate them with commas. It is global if not specified.
    \n For example: boards:a,jp;.\n
  • \n Filter OPs only along with their threads (`only`), replies only (`no`), or both (`yes`, this is default).
    \n For example: op:only;, op:no; or op:yes;.\n
  • \n Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
    \n For example: stub:yes; or stub:no;.\n
  • \n Highlight instead of hiding. You can specify a class name to use with a userstyle.
    \n For example: highlight; or highlight:wallpaper;.\n
  • \n Highlighted OPs will have their threads put on top of board pages by default.
    \n For example: top:yes; or top:no;.\n
"; }, sauce: function(section) { var sauce; - section.innerHTML = "
Sauce is disabled.
\n
Lines starting with a # will be ignored.
\n
You can specify a display text by appending ;text:[text] to the URL.
\n
    These parameters will be replaced by their corresponding values:\n
  • %TURL: Thumbnail URL.
  • \n
  • %URL: Full image URL.
  • \n
  • %MD5: MD5 hash.
  • \n
  • %board: Current board.
  • \n
\n"; + section.innerHTML = "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
    These parameters will be replaced by their corresponding values:\n
  • %TURL: Thumbnail URL.
  • %URL: Full image URL.
  • %MD5: MD5 hash.
  • %board: Current board.
"; sauce = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { return sauce.value = item['sauces']; }); return $.on(sauce, 'change', $.cb.value); }, - rice: function(section) { + advanced: function(section) { var archiver, event, input, inputs, items, name, toSelect, _i, _j, _len, _len1, _ref; - section.innerHTML = "
\n Archiver\n Select an Archiver for this board:\n \n
\n
\n Custom Board Navigation is disabled.\n
\n
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
\n
\n For example:
\n [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
\n [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
\n
Board link: board
\n
Title link: board-title
\n
Board link (Replace with title when on that board): board-replace
\n
Full text link: board-full
\n
Custom text link: board-text:\"VIP Board\"
\n
Index-only link: board-index
\n
Catalog-only link: board-catalog
\n
Combinations are possible: board-index-text:\"VIP Index\"
\n
Full board list toggle: toggle-all
\n
\n\n
\n Time Formatting is disabled.\n
:
\n \n
Day: %a, %A, %d, %e
\n
Month: %m, %b, %B
\n
Year: %y
\n
Hour: %k, %H, %l, %I, %p, %P
\n
Minute: %M
\n
Second: %S
\n
\n\n
\n Quote Backlinks formatting is disabled.\n
:
\n
\n\n
\n File Info Formatting is disabled.\n
:
\n
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
\n
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
\n
Spoiler indicator: %p
\n
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
\n
Resolution: %r (Displays 'PDF' for PDF files)
\n
\n\n
\n Unread Favicon is disabled.\n \n \n
\n\n
\n Custom CSS\n \n \n
"; + section.innerHTML = "
Archiver
\n Select an Archiver for this board:\n
Custom Board Navigation is disabled.
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
\n For example:
[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
Board link: board
Title link: board-title
Board link (Replace with title when on that board): board-replace
Full text link: board-full
Custom text link: board-text:\"VIP Board\"
Index-only link: board-index
Catalog-only link: board-catalog
Combinations are possible: board-index-text:\"VIP Index\"
Full board list toggle: toggle-all
Time Formatting is disabled.
:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Unread Favicon is disabled.
Emoji is disabled.
\n Sage Icon:
\n Position:
Thread Updater is disabled.
\n Interval:
Custom CSS
"; items = {}; inputs = {}; - _ref = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss']; + _ref = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'emojiPos', 'sageEmoji', 'usercss']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { name = _ref[_i]; input = $("[name='" + name + "']", section); items[name] = Conf[name]; inputs[name] = input; - event = ['favicon', 'usercss'].contains(name) ? 'change' : 'input'; + event = ['favicon', 'usercss', 'sageEmoji', 'emojiPos'].contains(name) ? 'change' : 'input'; $.on(input, event, $.cb.value); } archiver = $('select[name=archiver]', section); @@ -12938,15 +13290,17 @@ for (key in items) { val = items[key]; + if (['usercss', 'emojiPos', 'archiver'].contains(key)) { + continue; + } input = inputs[key]; input.value = val; - if ('usercss' !== name) { - $.on(input, event, Settings[key]); - Settings[key].call(input); - } + $.on(input, event, Settings[key]); + Settings[key].call(input); } + return Rice.nodes(sectionreturn); }); - Rice.nodes(section); + $.on($('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval); $.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss); return $.on($.id('apply-css'), 'click', Settings.usercss); }, @@ -12960,7 +13314,7 @@ return this.nextElementSibling.textContent = funk(Time, new Date()); }, backlink: function() { - return this.nextElementSibling.textContent = Conf['backlink'].replace(/%id/, '123456789'); + return this.nextElementSibling.textContent = this.value.replace(/%id/, '123456789'); }, fileInfo: function() { var data, funk; @@ -12985,7 +13339,10 @@ if (g.VIEW === 'thread' && Conf['Unread Favicon']) { Unread.update(); } - return this.nextElementSibling.innerHTML = "\n\n\n"; + return $.id('favicon-preview').innerHTML = "\n\n\n"; + }, + sageEmoji: function() { + return $.id('sageicon-preview').innerHTML = ""; }, togglecss: function() { if ($('textarea', this.parentNode.parentNode).disabled = !this.checked) { @@ -13001,7 +13358,7 @@ keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; - section.innerHTML = "
Keybinds are disabled.
\n
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
\n
Press Backspace to disable a keybind.
\n\n \n
ActionsKeybinds
"; + section.innerHTML = "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
"; tbody = $('tbody', section); items = {}; inputs = {}; @@ -13654,6 +14011,9 @@ 'Settings': Settings, 'Announcement Hiding': PSAHiding, 'Fourchan thingies': Fourchan, + 'Emoji': Emoji, + 'Color User IDs': IDColor, + 'Remove Spoilers': RemoveSpoilers, 'Custom CSS': CustomCSS, 'Linkify': Linkify, 'Resurrect Quotes': Quotify, @@ -13753,7 +14113,11 @@ Main.handleErrors(errors); } Main.callbackNodes(Thread, threads); - Main.callbackNodes(Post, posts); + Main.callbackNodesDB(Post, posts, function() { + $.event('4chanXInitFinished'); + return Main.checkUpdate(); + }); + return; } $.event('4chanXInitFinished'); return Main.checkUpdate(); @@ -13785,6 +14149,63 @@ return Main.handleErrors(errors); } }, + callbackNodesDB: function(klass, nodes, cb) { + var errors, func, i, len, node, queue, softTask; + + queue = []; + softTask = function() { + var args, func, task; + + task = queue.shift(); + func = task[0]; + args = Array.prototype.slice.call(task, 1); + func.apply(func, args); + if (!queue.length) { + return; + } + if ((queue.length % 7) === 0) { + return setTimeout(softTask, 0); + } else { + return softTask(); + } + }; + len = nodes.length; + i = 0; + errors = null; + func = function(node, i) { + var callback, err, _i, _len, _ref; + + _ref = klass.prototype.callbacks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + callback = _ref[_i]; + try { + callback.cb.call(node); + } catch (_error) { + err = _error; + if (!errors) { + errors = []; + } + errors.push({ + message: "\"" + callback.name + "\" crashed on " + klass.name + " No." + node + " (/" + node.board + "/).", + error: err + }); + } + } + if (i === len) { + if (errors) { + Main.handleErrors(errors); + } + if (cb) { + return cb(); + } + } + }; + while (i < len) { + node = nodes[i]; + queue.push([func, node, ++i]); + } + return softTask(); + }, addCallback: function(e) { var Klass, obj; diff --git a/builds/crx/script.js b/builds/crx/script.js index a36ea02f9..44c3dc36f 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,5 +1,95 @@ +/* +* appchan x - Version 2.0.0 - 2013-04-28 +* +* Licensed under the MIT license. +* https://github.com/zixaphir/appchan-x/blob/master/LICENSE +* +* Appchan X Copyright © 2013-2013 Zixaphir +* http://zixaphir.github.io/appchan-x/ +* 4chan x Copyright © 2009-2011 James Campos +* https://github.com/aeosynth/4chan-x +* 4chan x Copyright © 2012-2013 Nicolas Stepien +* https://4chan-x.just-believe.in/ +* 4chan x Copyright © 2013-2013 Jordan Bates +* http://seaweedchan.github.io/4chan-x/ +* 4chan x Copyright © 2012-2013 ihavenoface +* http://ihavenoface.github.io/4chan-x/ +* 4chan SS Copyright © 2011-2013 Ahodesuka +* https://github.com/ahodesuka/4chan-Style-Script/ +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Contributors: +* aeosynth +* mayhemydg +* noface +* !K.WeEabo0o +* blaise +* that4chanwolf +* desuwa +* seaweed +* e000 +* ahodesuka +* Shou +* ferongr +* xat +* Ongpot +* thisisanon +* Anonymous +* Seiba +* herpaderpderp +* WakiMiko +* btmcsweeney +* AppleBloom +* +* All the people who've taken the time to write bug reports. +* +* Thank you. +*/ + +/* +* Contains data from external sources: +* +* audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/ +* cc-by-nc-3.0 +* +* 4chan/4chan-JS (https://github.com/4chan/4chan-JS) +* Copyright (c) 2012-2013, 4chan LLC +* All rights reserved. +* +* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE +* +* Linkify: (http://userscripts.org/scripts/show/1352) +* Copyright (c) 2011, Anthony Lieuallen +* All rights reserved. +* Originally written by Anthony Lieuallen of http://arantius.com/ +* Licensed for unlimited modification and redistribution as long as +* this notice is kept intact. +* +* license: http://userscripts.org/scripts/review/1352 +* +*/ (function() { - var $, $$, Anonymize, ArchiveLink, Banner, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, GlobalMessage, Header, Icons, ImageExpand, ImageHover, ImageReplace, JSColor, Keybinds, Linkify, Main, MascotTools, Mascots, Menu, MutationObserver, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, Report, ReportLink, RevealSpoilers, Rice, Sauce, Settings, Style, ThemeTools, Themes, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, editMascot, editTheme, g, userNavigation, + var $, $$, Anonymize, ArchiveLink, Banner, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, GlobalMessage, Header, IDColor, Icons, ImageExpand, ImageHover, ImageReplace, JSColor, Keybinds, Linkify, Main, MascotTools, Mascots, Menu, MutationObserver, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Rice, Sauce, Settings, Style, ThemeTools, Themes, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, editMascot, editTheme, g, userNavigation, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, __slice = [].slice, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; @@ -9,7 +99,6 @@ 'Miscellaneous': { 'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], 'External Catalog': [false, 'Link to external catalog instead of the internal one.'], - 'Custom Board Navigation': [false, 'Show custom links instead of the full board list.'], 'QR Shortcut': [false, 'Adds a small [QR] link in the header.'], 'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'], '404 Redirect': [true, 'Redirect dead threads and images.'], @@ -21,7 +110,11 @@ 'Thread Expansion': [true, 'Add buttons to expand threads.'], 'Index Navigation': [false, 'Add buttons to navigate between threads.'], 'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'], - 'Check for Updates': [true, 'Check for updated versions of appchan x.'] + 'Check for Updates': [true, 'Check for updated versions of appchan x.'], + 'Emoji': [false, 'Adds icons next to names for different emails'], + 'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'], + 'Remove Spoilers': [false, 'Remove all spoilers in text.'], + 'Indicate Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled.'] }, 'Linkification': { 'Linkify': [true, 'Convert text into links where applicable.'], @@ -59,7 +152,7 @@ 'Monitoring': { 'Thread Updater': [true, 'Fetch and insert new replies. Has more options in its own dialog.'], 'Unread Count': [true, 'Show the unread posts count in the tab title.'], - 'Hide Unread Count at (0)': [false, 'Hide the unread posts count when it reaches 0.'], + 'Hide Unread Count at (0)': [false, 'Hide the unread posts count in the tab title when it reaches 0.'], 'Unread Favicon': [true, 'Show a different favicon when there are unread posts.'], 'Unread Line': [true, 'Show a line to distinguish read posts from unread ones.'], 'Scroll to Last Read Post': [true, 'Scroll back to the last read post when reopening a thread.'], @@ -78,7 +171,8 @@ 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], 'Remember QR Size': [false, 'Remember the size of the quick reply\'s comment field.'], 'Hide Original Post Form': [true, 'Hide the normal post form.'], - 'Cooldown': [true, 'Prevent "flood detected" errors.'] + 'Cooldown': [true, 'Indicate the remaining time before posting again.'], + 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'] }, 'Quote Links': { 'Quote Backlinks': [true, 'Add quote backlinks.'], @@ -89,6 +183,7 @@ 'Quote Highlighting': [true, 'Highlight the previewed post.'], 'Resurrect Quotes': [true, 'Link dead quotes to the archives.'], 'Mark Quotes of You': [true, 'Add \'(You)\' to quotes linking to your posts.'], + 'Highlight Own Posts': [false, 'Highlights own posts if Mark Quotes of You is enabled.'], 'Mark OP Quotes': [true, 'Add \'(OP)\' to OP quotes.'], 'Mark Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes.'], 'Quote Threading': [false, 'Thread conversations'] @@ -118,8 +213,7 @@ '4chan Banner Reflection': [false, 'Adds reflection effects to 4chan\'s image banner.'], 'Faded 4chan Banner': [true, 'Make 4chan\'s image banner translucent.'], 'Icon Orientation': ['horizontal', 'Change the orientation of the appchan x icons.', ['horizontal', 'vertical']], - 'Slideout Watcher': [true, 'Adds an icon you can hover over to show the watcher, as opposed to having the watcher always visible.'], - 'Updater Position': ['top', 'The position of 4chan thread updater and stats', ['top', 'bottom', 'moveable']] + 'Slideout Watcher': [true, 'Adds an icon you can hover over to show the watcher, as opposed to having the watcher always visible.'] }, Posts: { 'Alternate Post Colors': [false, 'Make post background colors alternate every other post.'], @@ -203,10 +297,18 @@ MD5: '' }, sauces: "https://www.google.com/searchbyimage?image_url=%TURL\nhttp://iqdb.org/?url=%TURL\n#//tineye.com/search?url=%TURL\n#http://saucenao.com/search.php?url=%TURL\n#http://3d.iqdb.org/?url=%TURL\n#http://regex.info/exif.cgi?imgurl=%URL\n# uploaders:\n#http://imgur.com/upload?url=%URL;text:Upload to imgur\n#http://ompldr.org/upload?url1=%URL;text:Upload to ompldr\n# \"View Same\" in archives:\n#//archive.foolz.us/_/search/image/%MD5/;text:View same on foolz\n#//archive.foolz.us/%board/search/image/%MD5/;text:View same on foolz /%board/\n#//archive.installgentoo.net/%board/image/%MD5;text:View same on installgentoo /%board/", + 'sageEmoji': 'appchan', + 'emojiPos': 'before', 'Custom CSS': false, - 'Boards Navigation': 'Sticky top', - 'Header auto-hide': false, - 'Header catalog links': false, + Header: { + 'Fixed Header': true, + 'Header auto-hide': false, + 'Bottom Header': false, + 'Hide Header': false, + 'Header catalog links': false, + 'Bottom Board List': true, + 'Custom Board Navigation': true + }, boardnav: '[ toggle-all ] [current-title]', time: '%m/%d/%y(%a)%H:%M:%S', backlink: '>>%id', @@ -215,15 +317,17 @@ usercss: "/* Tripcode Italics: */\n/*\nspan.postertrip {\nfont-style: italic;\n}\n*/\n\n/* Add a rounded border to thumbnails (but not expanded images): */\n/*\n.fileThumb > img:first-child {\nborder: solid 2px rgba(0,0,100,0.5);\nborder-radius: 10px;\n}\n*/\n\n/* Make highlighted posts look inset on the page: */\n/*\ndiv.post:target,\ndiv.post.highlight {\nbox-shadow: inset 2px 2px 2px rgba(0,0,0,0.2);\n}\n*/", hotkeys: { 'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'], - 'Open empty QR': ['l', 'Open QR without post number inserted.'], - 'Open QR': ['Shift+l', 'Open QR with post number inserted.'], + 'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'], + 'Open empty QR': ['i', 'Open QR without post number inserted.'], + 'Open QR': ['Shift+i', 'Open QR with post number inserted.'], 'Open settings': ['Alt+o', 'Open Settings.'], 'Close': ['Esc', 'Close Settings, Notifications or QR.'], 'Spoiler tags': ['Ctrl+s', 'Insert spoiler tags.'], 'Code tags': ['Alt+c', 'Insert code tags.'], 'Eqn tags': ['Alt+e', 'Insert eqn tags.'], 'Math tags': ['Alt+m', 'Insert math tags.'], - 'Submit QR': ['Alt+s', 'Submit post.'], + 'Toggle sage': ['Alt+s', 'Toggle sage in email field'], + 'Submit QR': ['Ctrl+Enter', 'Submit post.'], 'Watch': ['w', 'Watch thread.'], 'Update': ['r', 'Update the thread now.'], 'Expand image': ['Shift+e', 'Expand selected image.'], @@ -233,6 +337,7 @@ 'Open front page': ['Shift+0', 'Open page 0 in a new tab.'], 'Next page': ['Right', 'Jump to the next page.'], 'Previous page': ['Left', 'Jump to the previous page.'], + 'Open catalog': ['Shift+c', 'Open the catalog of the current board'], 'Next thread': ['Down', 'See next thread.'], 'Previous thread': ['Up', 'See previous thread.'], 'Expand thread': ['Ctrl+e', 'Expand thread.'], @@ -2394,6 +2499,59 @@ "4chan SS": 'iVBORw0KGgoAAAANSUhEUgAAAA8AAACWCAMAAAA2YSLzAAAAPFBMVEVkZGRlZWVjY2NmZmZnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dZxmG7AAAAE3RSTlMFFQ0AJD8eQFRqf5CgssDM4+73gHqZRAAAA0pJREFUSMetVlmy5CgMZDMGxK7737Ulgcu8ejMREzHtD7sShJRaKWV/Psq3iz7QGwTF2BZ01hp3N6yasctZJANiN5ZlItDLtNkQDGNeMLU7EqmCbUwhkhZbwsIuNbyWPX7dIyHOrDYOc8SOiEUJjojN0EsWlCXRrq2qvJCsIjic2OcFrwrOpdmTimqVyWG7ZkrWy97p7z/hACd2FUetBcQDpTN+nuKsGng881L5xOz/VQ88xL/eQkyZT3axp+4dUMwvH0Pnhn6wSyR+8IdR4f43/v8XX1BHjXpjwy5RdEcQ7DiuzlBUsFD+GeIFEy6W0pKXoSZOiUz5tf99nvTDD/1sP9VRPvb/un86lT57SVqwSk8KR+L6kgTOlcZslRQe5WmJRKovETW7Anb+HzxUW4Xgnv11fuuj82aKXHz1Tzztx9v4VA9+/6le26B+3VhTC9RMPIr0qx4zaWNsnFRO0s8FWgEIFIRiVUAIlJGciqMmCwpQWyI/OplXA1RrXG1YI2svTQ3ufhWjNlKFqtXFI7Yg+zAXRcBZ+HygJuVHd0ys35bVn6QojLL5cZeVvPht/mVu/r/8s7GMXsLjv2s71GZhgjnEwsEVXogiSl/pl7LWra0IQgO3poTsieoYd4dhWfJlGWqyQf6sLxWt3/MRa4Im04ixeSdAWnxvqCX6tObVmzpZOPOZvrBNJF8gmGciBChsV+YdRYwnAvNpS4AnYFBm0KA2a35Unh+efxjercaLfV7wW0rtUTNl2j715al/9VtfutF+NZ/+aZSa+py/GCpRyvr17EsVLbRhmN++BBY/ik5/+YPK6bKnf2T8fh7P+uEYn0D3E4L3i6QHmvc3+k+8PN6Mb1w52tje6LbAi+M0FT4YneqVbpVDPnL2Xqx7m3tf9ENXHba9H/a/+X3z/+XfCnOo+Zy/o4SgY5Z6iq0nb+9Mc4JxL5f1qYs+xhTP/uiX/cMe4+hDHAfGnmGe+Ev+G88vnG7Ie20wHiUt/S1Kv+6BCM/9fkEfz73/9HNufQ4ZKdzvnwtS/LXltRcJB/yJ23H/mo89nPFa85Li3XOYu435LwTXKVWwO+cnlWFTB47L/AdfR//KI2bvF8sAb0c/M+1+YE3/oS77B8N+UUVHraV6AAAAAElFTkSuQmCC' }; + String.prototype.capitalize = function() { + return this.charAt(0).toUpperCase() + this.slice(1); + }; + + String.prototype.contains = function(string) { + return this.indexOf(string) > -1; + }; + + Array.prototype.add = function(object, position) { + var keep; + + keep = this.slice(position); + this.length = position; + this.push(object); + return this.pushArrays(keep); + }; + + Array.prototype.contains = function(object) { + return this.indexOf(object) > -1; + }; + + Array.prototype.indexOf = function(object) { + var i; + + i = this.length; + while (i--) { + if (this[i] === object) { + break; + } + } + return i; + }; + + Array.prototype.pushArrays = function() { + var arg, args, _i, _len; + + args = arguments; + for (_i = 0, _len = args.length; _i < _len; _i++) { + arg = args[_i]; + this.push.apply(this, arg); + } + }; + + Array.prototype.remove = function(object) { + var index; + + if ((index = this.indexOf(object)) > -1) { + return this.splice(index, 1); + } else { + return false; + } + }; + $ = function(selector, root) { if (root == null) { root = d.body; @@ -2401,15 +2559,6 @@ return root.querySelector(selector); }; - $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))); - - $$ = function(selector, root) { - if (root == null) { - root = d.body; - } - return __slice.call(root.querySelectorAll(selector)); - }; - $.extend = function(object, properties) { var key, val; @@ -2422,574 +2571,458 @@ } }; - $.extend(Array.prototype, { - add: function(object, position) { - var keep; + $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))); - keep = this.slice(position); - this.length = position; - this.push(object); - return this.pushArrays(keep); - }, - contains: function(object) { - return this.indexOf(object) > -1; - }, - indexOf: function(object) { - var i; + $.id = function(id) { + return d.getElementById(id); + }; - i = this.length; - while (i--) { - if (this[i] === object) { - break; - } + $.ready = function(fc) { + var cb, _ref; + + if ((_ref = d.readyState) === 'interactive' || _ref === 'complete') { + $.queueTask(fc); + return; + } + cb = function() { + $.off(d, 'DOMContentLoaded', cb); + return fc(); + }; + return $.on(d, 'DOMContentLoaded', cb); + }; + + $.formData = function(form) { + var fd, key, val; + + if (form instanceof HTMLFormElement) { + return new FormData(form); + } + fd = new FormData(); + for (key in form) { + val = form[key]; + if (!val) { + continue; } - return i; - }, - pushArrays: function() { - var arg, args, _i, _len; - - args = arguments; - for (_i = 0, _len = args.length; _i < _len; _i++) { - arg = args[_i]; - this.push.apply(this, arg); - } - }, - remove: function(object) { - var index; - - if ((index = this.indexOf(object)) > -1) { - return this.splice(index, 1); + if (val.size && val.name) { + fd.append(key, val, val.name); } else { - return false; + fd.append(key, val); } } - }); + return fd; + }; - $.extend(String.prototype, { - capitalize: function() { - return this.charAt(0).toUpperCase() + this.slice(1); - }, - contains: function(string) { - return this.indexOf(string) > -1; + $.ajax = function(url, callbacks, opts) { + var cred, form, headers, key, r, sync, type, upCallbacks, val; + + if (opts == null) { + opts = {}; } - }); + type = opts.type, cred = opts.cred, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form, sync = opts.sync; + r = new XMLHttpRequest(); + r.overrideMimeType('text/html'); + type || (type = form && 'post' || 'get'); + r.open(type, url, !sync); + for (key in headers) { + val = headers[key]; + r.setRequestHeader(key, val); + } + $.extend(r, callbacks); + $.extend(r.upload, upCallbacks); + r.withCredentials = cred; + r.send(form); + return r; + }; - $.extend($, { - id: function(id) { - return d.getElementById(id); - }, - ready: function(fc) { - var cb, _ref; + $.cache = (function() { + var reqs; - if ((_ref = d.readyState) === 'interactive' || _ref === 'complete') { - $.queueTask(fc); + reqs = {}; + return function(url, cb) { + var req, rm; + + if (req = reqs[url]) { + if (req.readyState === 4) { + cb.call(req); + } else { + req.callbacks.push(cb); + } return; } - cb = function() { - $.off(d, 'DOMContentLoaded', cb); - return fc(); + rm = function() { + return delete reqs[url]; }; - return $.on(d, 'DOMContentLoaded', cb); - }, - formData: function(form) { - var fd, key, val; + req = $.ajax(url, { + onload: function(e) { + var _i, _len, _ref; - if (form instanceof HTMLFormElement) { - return new FormData(form); - } - fd = new FormData(); - for (key in form) { - val = form[key]; - if (!val) { - continue; - } - if (val.size && val.name) { - fd.append(key, val, val.name); - } else { - fd.append(key, val); - } - } - return fd; - }, - ajax: function(url, callbacks, opts) { - var cred, form, headers, key, r, sync, type, upCallbacks, val; - - if (opts == null) { - opts = {}; - } - type = opts.type, cred = opts.cred, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form, sync = opts.sync; - r = new XMLHttpRequest(); - r.overrideMimeType('text/html'); - type || (type = form && 'post' || 'get'); - r.open(type, url, !sync); - for (key in headers) { - val = headers[key]; - r.setRequestHeader(key, val); - } - $.extend(r, callbacks); - $.extend(r.upload, upCallbacks); - r.withCredentials = cred; - r.send(form); - return r; - }, - cache: (function() { - var reqs; - - reqs = {}; - return function(url, cb) { - var req, rm; - - if (req = reqs[url]) { - if (req.readyState === 4) { - cb.call(req); - } else { - req.callbacks.push(cb); + _ref = this.callbacks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + cb = _ref[_i]; + cb.call(this, e); } - return; - } - rm = function() { - return delete reqs[url]; - }; - req = $.ajax(url, { - onload: function(e) { - var _i, _len, _ref; - - _ref = this.callbacks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - cb = _ref[_i]; - cb.call(this, e); - } - return delete this.callbacks; - }, - onabort: rm, - onerror: rm - }); - req.callbacks = [cb]; - return reqs[url] = req; - }; - })(), - cb: { - checked: function() { - $.set(this.name, this.checked); - return Conf[this.name] = this.checked; - }, - value: function() { - $.set(this.name, this.value.trim()); - return Conf[this.name] = this.value; - } - }, - asap: function(test, cb) { - if (test()) { - return cb(); - } else { - return setTimeout($.asap, 25, test, cb); - } - }, - addStyle: function(css, id) { - var style; - - style = $.el('style', { - id: id, - textContent: css + return delete this.callbacks; + }, + onabort: rm, + onerror: rm }); - $.asap((function() { - return d.head; - }), function() { - return $.add(d.head, style); - }); - return style; - }, - x: function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, 8, null).singleNodeValue; - }, - X: function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); - }, - addClass: function(el, className) { - return el.classList.add(className); - }, - rmClass: function(el, className) { - return el.classList.remove(className); - }, - toggleClass: function(el, className) { - return el.classList.toggle(className); - }, - hasClass: function(el, className) { - return el.classList.contains(className); - }, - rm: (function() { - if ('remove' in Element.prototype) { - return function(el) { - return el.remove(); - }; - } else { - return function(el) { - var _ref; + req.callbacks = [cb]; + return reqs[url] = req; + }; + })(); - return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; - }; - } - })(), - rmAll: function(root) { - var node; + $.cb = { + checked: function() { + $.set(this.name, this.checked); + return Conf[this.name] = this.checked; + }, + value: function() { + $.set(this.name, this.value.trim()); + return Conf[this.name] = this.value; + } + }; - while (node = root.firstChild) { - root.removeChild(node); - } - }, - tn: function(s) { - return d.createTextNode(s); - }, - frag: function() { - return d.createDocumentFragment(); - }, - nodes: function(nodes) { - var frag, node, _i, _len; + $.asap = function(test, cb) { + if (test()) { + return cb(); + } else { + return setTimeout($.asap, 25, test, cb); + } + }; - if (!(nodes instanceof Array)) { - return nodes; - } - frag = $.frag(); - for (_i = 0, _len = nodes.length; _i < _len; _i++) { - node = nodes[_i]; - frag.appendChild(node); - } - return frag; - }, - add: function(parent, el) { - return parent.appendChild($.nodes(el)); - }, - prepend: function(parent, el) { - return parent.insertBefore($.nodes(el), parent.firstChild); - }, - after: function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root.nextSibling); - }, - before: function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root); - }, - replace: function(root, el) { - return root.parentNode.replaceChild($.nodes(el), root); - }, - el: function(tag, properties) { - var el; + $.addStyle = function(css, id) { + var style; - el = d.createElement(tag); - if (properties) { - $.extend(el, properties); - } - return el; - }, - on: function(el, events, handler) { - var event, _i, _len, _ref; + style = $.el('style', { + id: id, + textContent: css + }); + $.asap((function() { + return d.head; + }), function() { + return $.add(d.head, style); + }); + return style; + }; - _ref = events.split(' '); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - event = _ref[_i]; - el.addEventListener(event, handler, false); - } - }, - off: function(el, events, handler) { - var event, _i, _len, _ref; + $.x = function(path, root) { + root || (root = d.body); + return d.evaluate(path, root, null, 8, null).singleNodeValue; + }; - _ref = events.split(' '); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - event = _ref[_i]; - el.removeEventListener(event, handler, false); - } - }, - event: function(event, detail, root) { - if (root == null) { - root = d; - } - return root.dispatchEvent(new CustomEvent(event, { - bubbles: true, - detail: detail - })); - }, - open: (function() { - if (typeof GM_openInTab !== "undefined" && GM_openInTab !== null) { - return function(URL) { - var a; + $.X = function(path, root) { + root || (root = d.body); + return d.evaluate(path, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); + }; - a = $.el('a', { - href: URL - }); - return GM_openInTab(a.href); - }; - } else { - return function(URL) { - return window.open(URL, '_blank'); - }; - } - })(), - debounce: function(wait, fn) { - var args, exec, that, timeout; + $.addClass = function(el, className) { + return el.classList.add(className); + }; - timeout = null; - that = null; - args = null; - exec = function() { - fn.apply(that, args); - return timeout = null; + $.rmClass = function(el, className) { + return el.classList.remove(className); + }; + + $.toggleClass = function(el, className) { + return el.classList.toggle(className); + }; + + $.hasClass = function(el, className) { + return el.classList.contains(className); + }; + + $.rm = (function() { + if ('remove' in Element.prototype) { + return function(el) { + return el.remove(); }; + } else { + return function(el) { + var _ref; + + return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; + }; + } + })(); + + $.rmAll = function(root) { + var node; + + while (node = root.firstChild) { + root.removeChild(node); + } + }; + + $.tn = function(s) { + return d.createTextNode(s); + }; + + $.frag = function() { + return d.createDocumentFragment(); + }; + + $.nodes = function(nodes) { + var frag, node, _i, _len; + + if (!(nodes instanceof Array)) { + return nodes; + } + frag = $.frag(); + for (_i = 0, _len = nodes.length; _i < _len; _i++) { + node = nodes[_i]; + frag.appendChild(node); + } + return frag; + }; + + $.add = function(parent, el) { + return parent.appendChild($.nodes(el)); + }; + + $.prepend = function(parent, el) { + return parent.insertBefore($.nodes(el), parent.firstChild); + }; + + $.after = function(root, el) { + return root.parentNode.insertBefore($.nodes(el), root.nextSibling); + }; + + $.before = function(root, el) { + return root.parentNode.insertBefore($.nodes(el), root); + }; + + $.replace = function(root, el) { + return root.parentNode.replaceChild($.nodes(el), root); + }; + + $.el = function(tag, properties) { + var el; + + el = d.createElement(tag); + if (properties) { + $.extend(el, properties); + } + return el; + }; + + $.on = function(el, events, handler) { + var event, _i, _len, _ref; + + _ref = events.split(' '); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + event = _ref[_i]; + el.addEventListener(event, handler, false); + } + }; + + $.off = function(el, events, handler) { + var event, _i, _len, _ref; + + _ref = events.split(' '); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + event = _ref[_i]; + el.removeEventListener(event, handler, false); + } + }; + + $.event = function(event, detail, root) { + if (root == null) { + root = d; + } + return root.dispatchEvent(new CustomEvent(event, { + bubbles: true, + detail: detail + })); + }; + + $.open = function(URL) { + return window.open(URL, '_blank'); + }; + + $.debounce = function(wait, fn) { + var args, exec, lastCall, that, timeout; + + lastCall = 0; + timeout = null; + that = null; + args = null; + exec = function() { + lastCall = Date.now(); + return fn.apply(that, args); + }; + return function() { + args = arguments; + that = this; + if (lastCall < Date.now() - wait) { + return exec(); + } + clearTimeout(timeout); + return timeout = setTimeout(exec, wait); + }; + }; + + $.queueTask = (function() { + var execTask, taskChannel, taskQueue; + + taskQueue = []; + execTask = function() { + var args, func, task; + + task = taskQueue.shift(); + func = task[0]; + args = Array.prototype.slice.call(task, 1); + return func.apply(func, args); + }; + if (window.MessageChannel) { + taskChannel = new MessageChannel(); + taskChannel.port1.onmessage = execTask; return function() { - args = arguments; - that = this; - if (timeout) { - clearTimeout(timeout); - } else { - exec(); - } - return timeout = setTimeout(exec, wait); + taskQueue.push(arguments); + return taskChannel.port2.postMessage(null); }; - }, - queueTask: (function() { - var execTask, taskChannel, taskQueue; - - taskQueue = []; - execTask = function() { - var args, func, task; - - task = taskQueue.shift(); - func = task[0]; - args = Array.prototype.slice.call(task, 1); - return func.apply(func, args); + } else { + return function() { + taskQueue.push(arguments); + return setTimeout(execTask, 0); }; - if (window.MessageChannel) { - taskChannel = new MessageChannel(); - taskChannel.port1.onmessage = execTask; - return function() { - taskQueue.push(arguments); - return taskChannel.port2.postMessage(null); - }; - } else { - return function() { - taskQueue.push(arguments); - return setTimeout(execTask, 0); - }; - } - })(), - globalEval: function(code) { - var script; - - script = $.el('script', { - textContent: code - }); - $.add(d.head || doc, script); - return $.rm(script); - }, - bytesToString: function(size) { - var unit; - - unit = 0; - while (size >= 1024) { - size /= 1024; - unit++; - } - size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); - return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit]; - }, - minmax: function(value, min, max) { - return (value < min ? min : value > max ? max : value); - }, - syncing: {}, - sync: (function() { - chrome.storage.onChanged.addListener(function(changes) { - var cb, key; - - for (key in changes) { - if (cb = $.syncing[key]) { - cb(changes[key].newValue); - } - } - }); - return function(key, cb) { - return $.syncing[key] = cb; - }; - })(), - item: function(key, val) { - var item; - - item = {}; - item[key] = val; - return item; - }, - "delete": function(keys) { - return chrome.storage.sync.remove(keys); - }, - get: function(key, val, cb) { - var items; - - if (typeof cb === 'function') { - items = $.item(key, val); - } else { - items = key; - cb = val; - } - return chrome.storage.sync.get(items, cb); - }, - set: function(key, val) { - var items; - - items = typeof key === 'string' ? $.item(key, val) : key; - return chrome.storage.sync.set(items); } - }); + })(); - Build = { - spoilerRange: {}, - shortFilename: function(filename, isReply) { - var threshold; + $.globalEval = function(code) { + var script; - threshold = isReply ? 30 : 40; - if (filename.length - 4 > threshold) { - return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); - } else { - return filename; - } - }, - postFromObject: function(data, boardID) { - var o; + script = $.el('script', { + textContent: code + }); + $.add(d.head || doc, script); + return $.rm(script); + }; - o = { - postID: data.no, - threadID: data.resto || data.no, - boardID: boardID, - name: data.name, - capcode: data.capcode, - tripcode: data.trip, - uniqueID: data.id, - email: data.email ? encodeURI(data.email.replace(/"/g, '"')) : '', - subject: data.sub, - flagCode: data.country, - flagName: data.country_name, - date: data.now, - dateUTC: data.time, - comment: data.com, - isSticky: !!data.sticky, - isClosed: !!data.closed - }; - if (data.ext || data.filedeleted) { - o.file = { - name: data.filename + data.ext, - timestamp: "" + data.tim + data.ext, - url: "//images.4chan.org/" + boardID + "/src/" + data.tim + data.ext, - height: data.h, - width: data.w, - MD5: data.md5, - size: data.fsize, - turl: "//thumbs.4chan.org/" + boardID + "/thumb/" + data.tim + "s.jpg", - theight: data.tn_h, - twidth: data.tn_w, - isSpoiler: !!data.spoiler, - isDeleted: !!data.filedeleted - }; - } - return Build.post(o); - }, - post: function(o, isArchived) { - /* - This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS). - @license: https://github.com/4chan/4chan-JS/blob/master/LICENSE - */ + $.bytesToString = function(size) { + var unit; - var a, boardID, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; + unit = 0; + while (size >= 1024) { + size /= 1024; + unit++; + } + size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); + return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit]; + }; - postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file; - isOP = postID === threadID; - staticPath = '//static.4chan.org'; - if (email) { - emailStart = ''; - emailEnd = ''; - } else { - emailStart = ''; - emailEnd = ''; - } - subject = "" + (subject || '') + ""; - userID = !capcode && uniqueID ? (" (ID: ") + ("" + uniqueID + ") ") : ''; - switch (capcode) { - case 'admin': - case 'admin_highlight': - capcodeClass = " capcodeAdmin"; - capcodeStart = " ## Admin"; - capcode = (" "; - break; - case 'mod': - capcodeClass = " capcodeMod"; - capcodeStart = " ## Mod"; - capcode = (" "; - break; - case 'developer': - capcodeClass = " capcodeDeveloper"; - capcodeStart = " ## Developer"; - capcode = (" "; - break; - default: - capcodeClass = ''; - capcodeStart = ''; - capcode = ''; - } - flag = flagCode ? ("  + flagCode + ") : ''; - if (file != null ? file.isDeleted : void 0) { - fileHTML = isOP ? ("
") + ("File deleted.") + "
" : ("
") + ("File deleted.") + "
"; - } else if (file) { - ext = file.name.slice(-3); - if (!file.twidth && !file.theight && ext === 'gif') { - file.twidth = file.width; - file.theight = file.height; + $.minmax = function(value, min, max) { + return (value < min ? min : value > max ? max : value); + }; + + $.syncing = {}; + + $.sync = (function() { + chrome.storage.onChanged.addListener(function(changes) { + var cb, key; + + for (key in changes) { + if (cb = $.syncing[key]) { + cb(changes[key].newValue); } - fileSize = $.bytesToString(file.size); - fileThumb = file.turl; - if (file.isSpoiler) { - fileSize = "Spoiler Image, " + fileSize; - if (!isArchived) { - fileThumb = '//static.4chan.org/image/spoiler'; - if (spoilerRange = Build.spoilerRange[boardID]) { - fileThumb += ("-" + boardID) + Math.floor(1 + spoilerRange * Math.random()); - } - fileThumb += '.png'; - file.twidth = file.theight = 100; - } - } - if (boardID.ID !== 'f') { - imgSrc = ("") + ("" + fileSize + ""); - } - a = $.el('a', { - innerHTML: file.name - }); - filename = a.textContent.replace(/%22/g, '"'); - a.textContent = Build.shortFilename(filename); - shortFilename = a.innerHTML; - a.textContent = filename; - filename = a.innerHTML.replace(/'/g, '''); - fileDims = ext === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height; - fileInfo = ("File: " + file.timestamp + "") + ("-(" + fileSize + ", " + fileDims + (file.isSpoiler ? '' : ", " + shortFilename + "")) + ")"; - fileHTML = "
" + fileInfo + "
" + imgSrc + "
"; - } else { - fileHTML = ''; } - tripcode = tripcode ? " " + tripcode + "" : ''; - sticky = isSticky ? ' Sticky' : ''; - closed = isClosed ? ' Closed' : ''; - container = $.el('div', { - id: "pc" + postID, - className: "postContainer " + (isOP ? 'op' : 'reply') + "Container", - innerHTML: (isOP ? '' : "
>>
") + ("
") + ("' + (isOP ? fileHTML : '') + ("' + (isOP ? '' : fileHTML) + ("
" + (comment || '') + "
") + '
' - }); - _ref = $$('.quotelink', container); + }); + return function(key, cb) { + return $.syncing[key] = cb; + }; + })(); + + $.item = function(key, val) { + var item; + + item = {}; + item[key] = val; + return item; + }; + + $.localKeys = ['name', 'uniqueID', 'tripcode', 'capcode', 'email', 'subject', 'comment', 'flag', 'filename', 'dimensions', 'filesize', 'MD5', 'usercss']; + + $["delete"] = function(keys) { + return chrome.storage.sync.remove(keys); + }; + + $.get = function(key, val, cb) { + var count, done, items, localItems, syncItems; + + if (typeof cb === 'function') { + items = $.item(key, val); + } else { + items = key; + cb = val; + } + localItems = null; + syncItems = null; + for (key in items) { + val = items[key]; + if (__indexOf.call($.localKeys, key) >= 0) { + (localItems || (localItems = {}))[key] = val; + } else { + (syncItems || (syncItems = {}))[key] = val; + } + } + items = {}; + count = 0; + done = function(item) { + $.extend(items, item); + if (!--count) { + return cb(items); + } + }; + if (localItems) { + count++; + chrome.storage.local.get(localItems, done); + } + if (syncItems) { + count++; + return chrome.storage.sync.get(syncItems, done); + } + }; + + $.set = (function() { + var items, localItems, set; + + items = {}; + localItems = {}; + set = $.debounce($.SECOND, function() { + var err, key, _i, _len, _ref; + + _ref = $.localKeys; for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; - href = quote.getAttribute('href'); - if (href[0] === '/') { - continue; + key = _ref[_i]; + if (key in items) { + (localItems || (localItems = {}))[key] = items[key]; + delete items[key]; } - quote.href = "/" + boardID + "/res/" + href; } - return container; + try { + chrome.storage.local.set(localItems); + chrome.storage.sync.set(items); + items = {}; + return localItems = {}; + } catch (_error) { + err = _error; + return c.error(err); + } + }); + return function(key, val) { + if (typeof key === 'string') { + items[key] = val; + } else { + $.extend(items, key); + } + return set(); + }; + })(); + + $$ = function(selector, root) { + if (root == null) { + root = d.body; } + return __slice.call(root.querySelectorAll(selector)); }; Board = (function() { @@ -3207,7 +3240,7 @@ if (!(strong = $('strong.warning', this.nodes.info))) { strong = $.el('strong', { className: 'warning', - textContent: '[Deleted]' + textContent: this.isReply ? '[Deleted]' : '[Dead]' }); $.after($('input', this.nodes.info), strong); } @@ -3476,7 +3509,7 @@ }); } now = Date.now(); - if ((this.data.lastChecked || 0) < now - 12 * $.HOUR) { + if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) { this.data.lastChecked = now; for (boardID in this.data.boards) { this.ajaxClean(boardID); @@ -3573,6 +3606,500 @@ })(); + Polyfill = { + init: function() { + return Polyfill.visibility(); + }, + visibility: function() { + var event, prefix, property; + + if ('visibilityState' in document || !(prefix = ('webkitVisibilityState' in document ? 'webkit' : 'mozVisibilityState' in document ? 'moz' : void 0))) { + return; + } + property = prefix + 'VisibilityState'; + event = prefix + 'visibilitychange'; + d.visibilityState = d[property]; + d.hidden = d.visibilityState === 'hidden'; + return $.on(d, event, function() { + d.visibilityState = d[property]; + d.hidden = d.visibilityState === 'hidden'; + return $.event('visibilitychange'); + }); + } + }; + + Header = { + init: function() { + var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, + _this = this; + + this.menu = new UI.Menu('header'); + this.menuButton = $.el('span', { + className: 'menu-button', + id: 'main-menu' + }); + barFixedToggler = $.el('label', { + innerHTML: ' Fixed Header' + }); + headerToggler = $.el('label', { + innerHTML: ' Auto-hide header' + }); + barPositionToggler = $.el('label', { + innerHTML: ' Bottom header' + }); + customNavToggler = $.el('label', { + innerHTML: ' Custom board navigation' + }); + footerToggler = $.el('label', { + innerHTML: " Hide bottom board list" + }); + editCustomNav = $.el('a', { + textContent: 'Edit custom board navigation', + href: 'javascript:;' + }); + this.barFixedToggler = barFixedToggler.firstElementChild; + this.barPositionToggler = barPositionToggler.firstElementChild; + this.headerToggler = headerToggler.firstElementChild; + this.footerToggler = footerToggler.firstElementChild; + this.customNavToggler = customNavToggler.firstElementChild; + $.on(this.menuButton, 'click', this.menuToggle); + $.on(this.barFixedToggler, 'change', this.toggleBarFixed); + $.on(this.barPositionToggler, 'change', this.toggleBarPosition); + $.on(this.headerToggler, 'change', this.toggleBarVisibility); + $.on(this.footerToggler, 'change', this.toggleFooterVisibility); + $.on(this.customNavToggler, 'change', this.toggleCustomNav); + $.on(editCustomNav, 'click', this.editCustomNav); + this.setBarFixed(Conf['Fixed Header']); + this.setBarVisibility(Conf['Header auto-hide']); + $.sync('Fixed Header', Header.setBarFixed); + $.sync('Bottom Header', Header.setBarPosition); + $.sync('Header auto-hide', Header.setBarVisibility); + $.event('AddMenuEntry', { + type: 'header', + el: $.el('span', { + textContent: 'Header' + }), + order: 107, + subEntries: [ + { + el: barFixedToggler + }, { + el: headerToggler + }, { + el: barPositionToggler + }, { + el: footerToggler + }, { + el: customNavToggler + }, { + el: editCustomNav + } + ] + }); + $.on(window, 'load hashchange', Header.hashScroll); + $.on(d, 'CreateNotification', this.createNotification); + $.asap((function() { + return d.body; + }), function() { + if (!Main.isThisPageLegit()) { + return; + } + $.asap((function() { + return $.id('boardNavMobile') || d.readyState === 'complete'; + }), Header.setBoardList); + $.prepend(d.body, _this.bar); + $.add(d.body, Header.hover); + return _this.setBarPosition(Conf['Bottom Header']); + }); + return $.ready(function() { + var cs; + + cs = $.id('settingsWindowLink'); + cs.textContent = 'Catalog Settings'; + if (g.VIEW === 'catalog') { + return _this.addShortcut(cs); + } + }); + }, + bar: $.el('div', { + id: 'header-bar' + }), + notify: $.el('div', { + id: 'notifications' + }), + shortcuts: $.el('span', { + id: 'shortcuts' + }), + hover: $.el('div', { + id: 'hoverUI' + }), + toggle: $.el('div', { + id: 'scroll-marker' + }), + setBoardList: function() { + var a, boardList, btn, fourchannav, fullBoardList, settings; + + fourchannav = $.id('boardNavDesktop'); + if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) { + a.className = 'current'; + } + boardList = $.el('span', { + id: 'board-list', + innerHTML: "" + }); + fullBoardList = $('#full-board-list', boardList); + btn = $('.hide-board-list-button', fullBoardList); + $.on(btn, 'click', Header.toggleBoardList); + $.rm($('#navtopright', fullBoardList)); + settings = $.id('navtopright'); + $.prepend(d.body, settings); + $.add(settings, Header.menuButton); + $.add(boardList, fullBoardList); + $.add(Header.bar, [boardList, Header.shortcuts, Header.notify, Header.toggle]); + Header.setCustomNav(Conf['Custom Board Navigation']); + Header.generateBoardList(Conf['boardnav']); + $.sync('Custom Board Navigation', Header.setCustomNav); + return $.sync('boardnav', Header.generateBoardList); + }, + generateBoardList: function(text) { + var as, list, nodes; + + list = $('#custom-board-list', Header.bar); + $.rmAll(list); + if (!text) { + return; + } + as = $$('#full-board-list a', Header.bar); + nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map(function(t) { + var a, board, m, _i, _len; + + if (/^[^\w@]/.test(t)) { + return $.tn(t); + } + if (/^toggle-all/.test(t)) { + a = $.el('a', { + className: 'show-board-list-button', + textContent: (t.match(/-text:"(.+)"/) || [null, '+'])[1], + href: 'javascript:;' + }); + $.on(a, 'click', Header.toggleBoardList); + return a; + } + board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0]; + for (_i = 0, _len = as.length; _i < _len; _i++) { + a = as[_i]; + if (a.textContent === board) { + a = a.cloneNode(true); + if (/-title/.test(t)) { + a.textContent = a.title; + } else if (/-replace/.test(t)) { + if ($.hasClass(a, 'current')) { + a.textContent = a.title; + } + } else if (/-full/.test(t)) { + a.textContent = "/" + board + "/ - " + a.title; + } else if (/-(index|catalog|text)/.test(t)) { + if (m = t.match(/-(index|catalog)/)) { + a.setAttribute('data-only', m[1]); + a.href = "//boards.4chan.org/" + board + "/"; + if (m[1] === 'catalog') { + a.href += 'catalog'; + } + } + if (m = t.match(/-text:"(.+)"/)) { + a.textContent = m[1]; + } + } else if (board === '@') { + $.addClass(a, 'navSmall'); + } + return a; + } + } + return $.tn(t); + }); + return $.add(list, nodes); + }, + toggleBoardList: function() { + var bar, custom, full, showBoardList; + + bar = Header.bar; + custom = $('#custom-board-list', bar); + full = $('#full-board-list', bar); + showBoardList = !full.hidden; + custom.hidden = !showBoardList; + return full.hidden = showBoardList; + }, + setBarPosition: function(bottom) { + Header.barPositionToggler.checked = bottom; + if (bottom) { + $.rmClass(doc, 'top'); + $.addClass(doc, 'bottom'); + $.after(Header.bar, Header.notify); + } else { + $.rmClass(doc, 'bottom'); + $.addClass(doc, 'top'); + $.add(Header.bar, Header.notify); + } + return Style.padding(); + }, + toggleBarPosition: function() { + $.event('CloseMenu'); + Header.setBarPosition(this.checked); + Conf['Bottom Header'] = this.checked; + return $.set('Bottom Header', this.checked); + }, + setBarFixed: function(fixed) { + Header.barFixedToggler.checked = fixed; + if (fixed) { + $.addClass(doc, 'fixed'); + return $.addClass(Header.bar, 'dialog'); + } else { + $.rmClass(doc, 'fixed'); + return $.rmClass(Header.bar, 'dialog'); + } + }, + toggleBarFixed: function() { + $.event('CloseMenu'); + Header.setBarFixed(this.checked); + Conf['Fixed Header'] = this.checked; + return $.set('Fixed Header', this.checked); + }, + setBarVisibility: function(hide) { + Header.headerToggler.checked = hide; + $.event('CloseMenu'); + (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide'); + return (hide ? $.addClass : $.rmClass)(doc, 'autohide'); + }, + toggleBarVisibility: function(e) { + var hide, message; + + if (e.type === 'mousedown' && e.button !== 0) { + return; + } + hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); + Conf['Header auto-hide'] = hide; + $.set('Header auto-hide', hide); + Header.setBarVisibility(hide); + message = hide ? 'The header bar will automatically hide itself.' : 'The header bar will remain visible.'; + return new Notification('info', message, 2); + }, + setCustomNav: function(show) { + var btn, cust, full, _ref; + + Header.customNavToggler.checked = show; + cust = $('#custom-board-list', Header.bar); + full = $('#full-board-list', Header.bar); + btn = $('.hide-board-list-button', full); + return _ref = show ? [false, true] : [true, false], cust.hidden = _ref[0], full.hidden = _ref[1], _ref; + }, + toggleCustomNav: function() { + $.cb.checked.call(this); + return Header.setCustomNav(this.checked); + }, + editCustomNav: function() { + var settings; + + Settings.open('Advanced'); + settings = $.id('fourchanx-settings'); + return $('input[name=boardnav]', settings).focus(); + }, + hashScroll: function() { + var hash, post; + + if (!((hash = this.location.hash) && (post = $.id(hash.slice(1))))) { + return; + } + if ((Get.postFromRoot(post)).isHidden) { + return; + } + return Header.scrollToPost(post); + }, + scrollToPost: function(post) { + var headRect, top; + + top = post.getBoundingClientRect().top; + if (Conf['Fixed Header'] && !Conf['Bottom Header']) { + headRect = Header.bar.getBoundingClientRect(); + top += -headRect.top - headRect.height; + } + return ($.engine === 'webkit' ? d.body : doc).scrollTop += top; + }, + addShortcut: function(el) { + var shortcut; + + shortcut = $.el('span', { + className: 'shortcut' + }); + $.add(shortcut, [$.tn(' ['), el, $.tn(']')]); + return $.prepend(Header.shortcuts, shortcut); + }, + menuToggle: function(e) { + return Header.menu.toggle(e, this, g); + }, + createNotification: function(e) { + var cb, content, lifetime, notif, type, _ref; + + _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; + notif = new Notification(type, content, lifetime); + if (cb) { + return cb(notif); + } + } + }; + + Build = { + spoilerRange: {}, + shortFilename: function(filename, isReply) { + var threshold; + + threshold = isReply ? 30 : 40; + if (filename.length - 4 > threshold) { + return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); + } else { + return filename; + } + }, + postFromObject: function(data, boardID) { + var o; + + o = { + postID: data.no, + threadID: data.resto || data.no, + boardID: boardID, + name: data.name, + capcode: data.capcode, + tripcode: data.trip, + uniqueID: data.id, + email: data.email ? encodeURI(data.email.replace(/"/g, '"')) : '', + subject: data.sub, + flagCode: data.country, + flagName: data.country_name, + date: data.now, + dateUTC: data.time, + comment: data.com, + isSticky: !!data.sticky, + isClosed: !!data.closed + }; + if (data.ext || data.filedeleted) { + o.file = { + name: data.filename + data.ext, + timestamp: "" + data.tim + data.ext, + url: "//images.4chan.org/" + boardID + "/src/" + data.tim + data.ext, + height: data.h, + width: data.w, + MD5: data.md5, + size: data.fsize, + turl: "//thumbs.4chan.org/" + boardID + "/thumb/" + data.tim + "s.jpg", + theight: data.tn_h, + twidth: data.tn_w, + isSpoiler: !!data.spoiler, + isDeleted: !!data.filedeleted + }; + } + return Build.post(o); + }, + post: function(o, isArchived) { + /* + This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS). + @license: https://github.com/4chan/4chan-JS/blob/master/LICENSE + */ + + var a, boardID, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; + + postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file; + isOP = postID === threadID; + staticPath = '//static.4chan.org'; + if (email) { + emailStart = ''; + emailEnd = ''; + } else { + emailStart = ''; + emailEnd = ''; + } + subject = "" + (subject || '') + ""; + userID = !capcode && uniqueID ? (" (ID: ") + ("" + uniqueID + ") ") : ''; + switch (capcode) { + case 'admin': + case 'admin_highlight': + capcodeClass = " capcodeAdmin"; + capcodeStart = " ## Admin"; + capcode = (" "; + break; + case 'mod': + capcodeClass = " capcodeMod"; + capcodeStart = " ## Mod"; + capcode = (" "; + break; + case 'developer': + capcodeClass = " capcodeDeveloper"; + capcodeStart = " ## Developer"; + capcode = (" "; + break; + default: + capcodeClass = ''; + capcodeStart = ''; + capcode = ''; + } + flag = flagCode ? ("  + flagCode + ") : ''; + if (file != null ? file.isDeleted : void 0) { + fileHTML = isOP ? ("
") + ("File deleted.") + "
" : ("
") + ("File deleted.") + "
"; + } else if (file) { + ext = file.name.slice(-3); + if (!file.twidth && !file.theight && ext === 'gif') { + file.twidth = file.width; + file.theight = file.height; + } + fileSize = $.bytesToString(file.size); + fileThumb = file.turl; + if (file.isSpoiler) { + fileSize = "Spoiler Image, " + fileSize; + if (!isArchived) { + fileThumb = '//static.4chan.org/image/spoiler'; + if (spoilerRange = Build.spoilerRange[boardID]) { + fileThumb += ("-" + boardID) + Math.floor(1 + spoilerRange * Math.random()); + } + fileThumb += '.png'; + file.twidth = file.theight = 100; + } + } + if (boardID.ID !== 'f') { + imgSrc = ("") + ("" + fileSize + ""); + } + a = $.el('a', { + innerHTML: file.name + }); + filename = a.textContent.replace(/%22/g, '"'); + a.textContent = Build.shortFilename(filename); + shortFilename = a.innerHTML; + a.textContent = filename; + filename = a.innerHTML.replace(/'/g, '''); + fileDims = ext === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height; + fileInfo = ("File: " + file.timestamp + "") + ("-(" + fileSize + ", " + fileDims + (file.isSpoiler ? '' : ", " + shortFilename + "")) + ")"; + fileHTML = "
" + fileInfo + "
" + imgSrc + "
"; + } else { + fileHTML = ''; + } + tripcode = tripcode ? " " + tripcode + "" : ''; + sticky = isSticky ? ' Sticky' : ''; + closed = isClosed ? ' Closed' : ''; + container = $.el('div', { + id: "pc" + postID, + className: "postContainer " + (isOP ? 'op' : 'reply') + "Container", + innerHTML: (isOP ? '' : "
>>
") + ("
") + ("' + (isOP ? fileHTML : '') + ("' + (isOP ? '' : fileHTML) + ("
" + (comment || '') + "
") + '
' + }); + _ref = $$('.quotelink', container); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quote = _ref[_i]; + href = quote.getAttribute('href'); + if (href[0] === '/') { + continue; + } + quote.href = "/" + boardID + "/res/" + href; + } + return container; + } + }; + Get = { threadExcerpt: function(thread) { var OP, excerpt, _ref; @@ -3829,28 +4356,6 @@ } }; - Polyfill = { - init: function() { - return Polyfill.visibility(); - }, - visibility: function() { - var event, prefix, property; - - if ('visibilityState' in document || !(prefix = ('webkitVisibilityState' in document ? 'webkit' : 'mozVisibilityState' in document ? 'moz' : void 0))) { - return; - } - property = prefix + 'VisibilityState'; - event = prefix + 'visibilitychange'; - d.visibilityState = d[property]; - d.hidden = d.visibilityState === 'hidden'; - return $.on(d, event, function() { - d.visibilityState = d[property]; - d.hidden = d.visibilityState === 'hidden'; - return $.event('visibilitychange'); - }); - } - }; - UI = (function() { var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove; @@ -4119,7 +4624,7 @@ })(); dragstart = function(e) { - var el, isTouching, o, rect, screenHeight, screenWidth; + var el, isTouching, o, rect, screenHeight, screenWidth, _ref; if (e.type === 'mousedown' && e.button !== 0) { return; @@ -4143,6 +4648,7 @@ screenWidth: screenWidth, isTouching: isTouching }; + _ref = Conf['Header auto-hide'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = _ref[0], o.bottomBorder = _ref[1]; if (isTouching) { o.identifier = e.identifier; o.move = touchmove.bind(o); @@ -4175,9 +4681,9 @@ left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; top = clientY - this.dy; - top = top < 10 ? 0 : this.height - top < 10 ? null : top / this.screenHeight * 100 + '%'; + top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%'; right = left === null ? 0 : null; - bottom = top === null ? 0 : null; + bottom = top === null ? this.bottomBorder + 'px' : null; style = this.style; style.left = left; style.right = right; @@ -4580,76 +5086,6 @@ } }; - Recursive = { - recursives: {}, - init: function() { - if (g.VIEW === 'catalog') { - return; - } - return Post.prototype.callbacks.push({ - name: 'Recursive', - cb: this.node - }); - }, - node: function() { - var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; - - if (this.isClone) { - return; - } - _ref = this.quotes; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; - if (obj = Recursive.recursives[quote]) { - _ref1 = obj.recursives; - for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) { - recursive = _ref1[i]; - recursive.apply(null, [this].concat(__slice.call(obj.args[i]))); - } - } - } - }, - add: function() { - var args, obj, post, recursive, _base, _name; - - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; - obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { - recursives: [], - args: [] - }); - obj.recursives.push(recursive); - return obj.args.push(args); - }, - rm: function(recursive, post) { - var i, obj, rec, _i, _len, _ref; - - if (!(obj = Recursive.recursives[post.fullID])) { - return; - } - _ref = obj.recursives; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - rec = _ref[i]; - if (rec === recursive) { - obj.recursives.splice(i, 1); - obj.args.splice(i, 1); - } - } - }, - apply: function() { - var ID, args, fullID, post, recursive, _ref; - - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; - fullID = post.fullID; - _ref = g.posts; - for (ID in _ref) { - post = _ref[ID]; - if (post.quotes.contains(fullID)) { - recursive.apply(null, [post].concat(__slice.call(args))); - } - } - } - }; - PostHiding = { init: function() { if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link']) { @@ -4928,28 +5364,71 @@ } }; - QuoteStrikeThrough = { + Recursive = { + recursives: {}, init: function() { - if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link'] && !Conf['Filter']) { + if (g.VIEW === 'catalog') { return; } return Post.prototype.callbacks.push({ - name: 'Strike-through Quotes', + name: 'Recursive', cb: this.node }); }, node: function() { - var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; + var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; if (this.isClone) { return; } - _ref = this.nodes.quotelinks; + _ref = this.quotes; for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quotelink = _ref[_i]; - _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID; - if ((_ref2 = g.posts["" + boardID + "." + postID]) != null ? _ref2.isHidden : void 0) { - $.addClass(quotelink, 'filtered'); + quote = _ref[_i]; + if (obj = Recursive.recursives[quote]) { + _ref1 = obj.recursives; + for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) { + recursive = _ref1[i]; + recursive.apply(null, [this].concat(__slice.call(obj.args[i]))); + } + } + } + }, + add: function() { + var args, obj, post, recursive, _base, _name; + + recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; + obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { + recursives: [], + args: [] + }); + obj.recursives.push(recursive); + return obj.args.push(args); + }, + rm: function(recursive, post) { + var i, obj, rec, _i, _len, _ref; + + if (!(obj = Recursive.recursives[post.fullID])) { + return; + } + _ref = obj.recursives; + for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { + rec = _ref[i]; + if (rec === recursive) { + obj.recursives.splice(i, 1); + obj.args.splice(i, 1); + } + } + }, + apply: function() { + var ID, args, fullID, post, recursive, _ref; + + recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; + fullID = post.fullID; + _ref = g.posts; + for (ID in _ref) { + post = _ref[ID]; + if (post.quotes.contains(fullID)) { + recursive.apply(null, [post].concat(__slice.call(args))); } } } @@ -5182,455 +5661,646 @@ } }; - FappeTyme = { + QuoteBacklink = { init: function() { - var el; + var format; - if (!Conf['Fappe Tyme'] && (g.VIEW === 'catalog' || g.BOARD === 'f')) { + if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { return; } - el = $.el('a', { - href: 'javascript:;', - id: 'fappeTyme', - title: 'Fappe Tyme' - }); - $.on(el, 'click', FappeTyme.toggle); - $.asap((function() { - return $.id('boardNavMobile'); - }), function() { - return $.add($.id('navtopright'), el); - }); - return Post.prototype.callbacks.push({ - name: 'Fappe Tyme', - cb: this.node - }); - }, - node: function() { - if (this.file) { - return; - } - return $.addClass(this.nodes.root, "noFile"); - }, - toggle: function() { - return $.toggleClass(doc, 'fappeTyme'); - } - }; - - ImageExpand = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { - return; - } - this.EAI = $.el('a', { - id: 'img-controls', - className: 'expand-all-shortcut', - title: 'Expand All Images', - href: 'javascript:;' - }); - $.on(this.EAI, 'click', ImageExpand.cb.toggleAll); + format = Conf['backlink'].replace(/%id/g, "' + id + '"); + this.funk = Function('id', "return '" + format + "'"); + this.containers = {}; Post.prototype.callbacks.push({ - name: 'Image Expansion', - cb: this.node + name: 'Quote Backlinking Part 1', + cb: this.firstNode }); - return $.asap((function() { - return $.id('delform'); - }), function() { - return $.prepend($.id('delform'), ImageExpand.EAI); + return Post.prototype.callbacks.push({ + name: 'Quote Backlinking Part 2', + cb: this.secondNode }); }, - node: function() { - var thumb, _ref; + firstNode: function() { + var a, clone, container, containers, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + if (this.isClone || !this.quotes.length) { return; } - thumb = this.file.thumb; - $.on(thumb.parentNode, 'click', ImageExpand.cb.toggle); - if (this.isClone && $.hasClass(thumb, 'expanding')) { - ImageExpand.contract(this); - ImageExpand.expand(this); - return; - } - if (ImageExpand.on && !this.isHidden) { - return ImageExpand.expand(this); - } - }, - cb: { - toggle: function(e) { - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { - return; - } - e.preventDefault(); - return ImageExpand.toggle(Get.postFromNode(this)); - }, - toggleAll: function() { - var ID, file, func, post, _i, _len, _ref, _ref1; - - $.event('CloseMenu'); - if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { - ImageExpand.EAI.className = 'contract-all-shortcut'; - ImageExpand.EAI.title = 'Contract All Images'; - func = ImageExpand.expand; - } else { - ImageExpand.EAI.className = 'expand-all-shortcut'; - ImageExpand.EAI.title = 'Expand All Images'; - func = ImageExpand.contract; - } - _ref = g.posts; - for (ID in _ref) { - post = _ref[ID]; - _ref1 = [post].concat(post.clones); - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - post = _ref1[_i]; - file = post.file; - if (!(file && file.isImage && doc.contains(post.nodes.root))) { - continue; - } - if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && file.thumb.getBoundingClientRect().top < 0)) { - continue; - } - $.queueTask(func, post); + a = $.el('a', { + href: "/" + this.board + "/res/" + this.thread + "#p" + this, + className: this.isHidden ? 'filtered backlink' : 'backlink', + textContent: (QuoteBacklink.funk(this.ID)) + (Conf['Mark Quotes of You'] && this.info.yours ? QuoteYou.text : '') + }); + _ref = this.quotes; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quote = _ref[_i]; + containers = [QuoteBacklink.getContainer(quote)]; + if ((post = g.posts[quote]) && post.nodes.backlinkContainer) { + _ref1 = post.clones; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + clone = _ref1[_j]; + containers.push(clone.nodes.backlinkContainer); } } - }, - setFitness: function() { - var checked; - - checked = this.checked; - (checked ? $.addClass : $.rmClass)(doc, this.name.toLowerCase().replace(/\s+/g, '-')); - if (this.name !== 'Fit height') { - return; - } - if (checked) { - $.on(window, 'resize', ImageExpand.resize); - if (!ImageExpand.style) { - ImageExpand.style = $.addStyle(null); + for (_k = 0, _len2 = containers.length; _k < _len2; _k++) { + container = containers[_k]; + link = a.cloneNode(true); + if (Conf['Quote Previewing']) { + $.on(link, 'mouseover', QuotePreview.mouseover); } - return ImageExpand.resize(); - } else { - return $.off(window, 'resize', ImageExpand.resize); - } - } - }, - toggle: function(post) { - var headRect, rect, root, thumb, top; - - thumb = post.file.thumb; - if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { - ImageExpand.expand(post); - return; - } - ImageExpand.contract(post); - rect = post.nodes.root.getBoundingClientRect(); - if (!(rect.top <= 0 || rect.left <= 0)) { - return; - } - headRect = Header.bar.getBoundingClientRect(); - top = rect.top - headRect.top - headRect.height; - root = d.body; - if (rect.top < 0) { - root.scrollTop += top; - } - if (rect.left < 0) { - return root.scrollLeft = 0; - } - }, - contract: function(post) { - $.rmClass(post.nodes.root, 'expanded-image'); - $.rmClass(post.file.thumb, 'expanding'); - return post.file.isExpanded = false; - }, - expand: function(post, src) { - var img, thumb; - - thumb = post.file.thumb; - if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { - return; - } - $.addClass(thumb, 'expanding'); - if (post.file.fullImage) { - $.asap((function() { - return post.file.fullImage.naturalHeight; - }), function() { - return ImageExpand.completeExpand(post); - }); - return; - } - post.file.fullImage = img = $.el('img', { - className: 'full-image', - src: src || post.file.URL - }); - $.on(img, 'error', ImageExpand.error); - $.asap((function() { - return post.file.fullImage.naturalHeight; - }), function() { - return ImageExpand.completeExpand(post); - }); - return $.after(thumb, img); - }, - completeExpand: function(post) { - var prev, thumb; - - thumb = post.file.thumb; - if (!$.hasClass(thumb, 'expanding')) { - return; - } - post.file.isExpanded = true; - if (!post.nodes.root.parentNode) { - $.addClass(post.nodes.root, 'expanded-image'); - $.rmClass(post.file.thumb, 'expanding'); - return; - } - prev = post.nodes.root.getBoundingClientRect(); - return $.queueTask(function() { - var curr, root; - - $.addClass(post.nodes.root, 'expanded-image'); - $.rmClass(post.file.thumb, 'expanding'); - if (!(prev.top + prev.height <= 0)) { - return; - } - root = d.body; - curr = post.nodes.root.getBoundingClientRect(); - return root.scrollTop += curr.height - prev.height + curr.top - prev.top; - }); - }, - error: function() { - var URL, post, src, timeoutID; - - post = Get.postFromNode(this); - $.rm(this); - delete post.file.fullImage; - if (!($.hasClass(post.file.thumb, 'expanding') || $.hasClass(post.nodes.root, 'expanded-image'))) { - return; - } - ImageExpand.contract(post); - src = this.src.split('/'); - if (src[2] === 'images.4chan.org') { - if (URL = Redirect.image(src[3], src[5])) { - setTimeout(ImageExpand.expand, 10000, post, URL); - return; - } - if (g.DEAD || post.isDead || post.file.isDead) { - return; - } - } - timeoutID = setTimeout(ImageExpand.expand, 10000, post); - return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { - onload: function() { - var postObj, _i, _len, _ref; - - if (this.status !== 200) { - return; - } - _ref = JSON.parse(this.response).posts; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - postObj = _ref[_i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - clearTimeout(timeoutID); - return post.kill(); - } else if (postObj.filedeleted) { - clearTimeout(timeoutID); - return post.kill(true); + if (Conf['Quote Inlining']) { + $.on(link, 'click', QuoteInline.toggle); } + $.add(container, [$.tn(' '), link]); } - }); - }, - menu: { - init: function() { - var conf, createSubEntry, el, key, subEntries, _ref; - - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { - return; - } - el = $.el('span', { - textContent: 'Image Expansion', - className: 'image-expansion-link' - }); - createSubEntry = ImageExpand.menu.createSubEntry; - subEntries = []; - _ref = Config.imageExpansion; - for (key in _ref) { - conf = _ref[key]; - subEntries.push(createSubEntry(key, conf)); - } - return $.event('AddMenuEntry', { - type: 'header', - el: el, - order: 105, - subEntries: subEntries - }); - }, - createSubEntry: function(type, config) { - var input, label; - - label = $.el('label', { - innerHTML: " " + type - }); - input = label.firstElementChild; - if (type === 'Fit width' || type === 'Fit height') { - $.on(input, 'change', ImageExpand.cb.setFitness); - } - if (config) { - label.title = config[1]; - input.checked = Conf[type]; - $.event('change', null, input); - $.on(input, 'change', $.cb.checked); - } - return { - el: label - }; } }, - resize: function() { - return ImageExpand.style.textContent = ":root.fit-height .full-image {max-height:" + doc.clientHeight + "px}"; + secondNode: function() { + var container; + + if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { + this.nodes.backlinkContainer = $('.container', this.nodes.info); + return; + } + if (!(this.isReply || Conf['OP Backlinks'])) { + return; + } + container = QuoteBacklink.getContainer(this.fullID); + this.nodes.backlinkContainer = container; + return $.add(this.nodes.info, container); }, - menuToggle: function(e) { - return ImageExpand.opmenu.toggle(e, this, g); + getContainer: function(id) { + var _base; + + return (_base = this.containers)[id] || (_base[id] = $.el('span', { + className: 'container' + })); } }; - ImageHover = { + QuoteCT = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Image Hover']) { + if (g.VIEW === 'catalog' || !Conf['Mark Cross-thread Quotes']) { return; } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + this.text = '\u00A0(Cross-thread)'; return Post.prototype.callbacks.push({ - name: 'Image Hover', + name: 'Mark Cross-thread Quotes', cb: this.node }); }, node: function() { - var _ref; + var board, boardID, quotelink, quotelinks, quotes, thread, threadID, _i, _len, _ref, _ref1; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + if (this.isClone && this.thread === this.context.thread) { return; } - return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover); + if (!(quotes = this.quotes).length) { + return; + } + quotelinks = this.nodes.quotelinks; + _ref = this.isClone ? this.context : this, board = _ref.board, thread = _ref.thread; + for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { + quotelink = quotelinks[_i]; + _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, threadID = _ref1.threadID; + if (!threadID) { + continue; + } + if (this.isClone) { + quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, ''); + } + if (boardID === this.board.ID && threadID !== thread.ID) { + $.add(quotelink, $.tn(QuoteCT.text)); + } + } + } + }; + + QuoteInline = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Quote Inlining']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + return Post.prototype.callbacks.push({ + name: 'Quote Inlining', + cb: this.node + }); + }, + node: function() { + var link, _i, _len, _ref; + + _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + $.on(link, 'click', QuoteInline.toggle); + } + }, + toggle: function(e) { + var boardID, context, postID, threadID, _ref; + + if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { + return; + } + e.preventDefault(); + _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; + context = Get.contextFromLink(this); + if ($.hasClass(this, 'inlined')) { + QuoteInline.rm(this, boardID, threadID, postID, context); + } else { + if ($.x("ancestor::div[@id='p" + postID + "']", this)) { + return; + } + QuoteInline.add(this, boardID, threadID, postID, context); + } + return this.classList.toggle('inlined'); + }, + findRoot: function(quotelink, isBacklink) { + if (isBacklink) { + return quotelink.parentNode.parentNode; + } else { + return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink); + } + }, + add: function(quotelink, boardID, threadID, postID, context) { + var inline, isBacklink, post; + + isBacklink = $.hasClass(quotelink, 'backlink'); + inline = $.el('div', { + id: "i" + postID, + className: 'inline' + }); + $.after(QuoteInline.findRoot(quotelink, isBacklink), inline); + Get.postClone(boardID, threadID, postID, inline, context); + if (!((post = g.posts["" + boardID + "." + postID]) && context.thread === post.thread)) { + return; + } + if (isBacklink && Conf['Forward Hiding']) { + $.addClass(post.nodes.root, 'forwarded'); + post.forwarded++ || (post.forwarded = 1); + } + if (!Unread.posts) { + return; + } + return Unread.readSinglePost(post); + }, + rm: function(quotelink, boardID, threadID, postID, context) { + var el, inlined, isBacklink, post, root, _ref; + + isBacklink = $.hasClass(quotelink, 'backlink'); + root = QuoteInline.findRoot(quotelink, isBacklink); + root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); + $.rm(root); + if (!(el = root.firstElementChild)) { + return; + } + post = g.posts["" + boardID + "." + postID]; + post.rmClone(el.dataset.clone); + if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads["" + boardID + "." + threadID] && !--post.forwarded) { + delete post.forwarded; + $.rmClass(post.nodes.root, 'forwarded'); + } + while (inlined = $('.inlined', el)) { + _ref = Get.postDataFromLink(inlined), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; + QuoteInline.rm(inlined, boardID, threadID, postID, context); + $.rmClass(inlined, 'inlined'); + } + } + }; + + QuoteOP = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Mark OP Quotes']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + this.text = '\u00A0(OP)'; + return Post.prototype.callbacks.push({ + name: 'Mark OP Quotes', + cb: this.node + }); + }, + node: function() { + var boardID, op, postID, quotelink, quotelinks, quotes, _i, _j, _len, _len1, _ref; + + if (this.isClone && this.thread === this.context.thread) { + return; + } + if (!(quotes = this.quotes).length) { + return; + } + quotelinks = this.nodes.quotelinks; + if (this.isClone && quotes.contains(this.thread.fullID)) { + for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { + quotelink = quotelinks[_i]; + quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, ''); + } + } + op = (this.isClone ? this.context : this).thread.fullID; + if (!quotes.contains(op)) { + return; + } + for (_j = 0, _len1 = quotelinks.length; _j < _len1; _j++) { + quotelink = quotelinks[_j]; + _ref = Get.postDataFromLink(quotelink), boardID = _ref.boardID, postID = _ref.postID; + if (("" + boardID + "." + postID) === op) { + $.add(quotelink, $.tn(QuoteOP.text)); + } + } + } + }; + + QuotePreview = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Quote Previewing']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + return Post.prototype.callbacks.push({ + name: 'Quote Previewing', + cb: this.node + }); + }, + node: function() { + var link, _i, _len, _ref; + + _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + $.on(link, 'mouseover', QuotePreview.mouseover); + } }, mouseover: function(e) { - var el, post; + var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; - post = Get.postFromNode(this); - el = $.el('img', { - id: 'ihover', - src: post.file.URL + if ($.hasClass(this, 'inlined')) { + return; + } + _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; + qp = $.el('div', { + id: 'qp', + className: 'dialog' }); - el.setAttribute('data-fullid', post.fullID); - $.add(Header.hover, el); + $.add(Header.hover, qp); + Get.postClone(boardID, threadID, postID, qp, Get.contextFromLink(this)); UI.hover({ root: this, - el: el, + el: qp, latestEvent: e, endEvents: 'mouseout click', + cb: QuotePreview.mouseout, asapTest: function() { - return el.naturalHeight; + return qp.firstElementChild; } }); - return $.on(el, 'error', ImageHover.error); - }, - error: function() { - var URL, post, src, timeoutID, - _this = this; - - if (!doc.contains(this)) { + if (!(origin = g.posts["" + boardID + "." + postID])) { return; } - post = g.posts[this.dataset.fullid]; - src = this.src.split('/'); - if (src[2] === 'images.4chan.org') { - if (URL = Redirect.image(src[3], src[5].replace(/\?.+$/, ''))) { - this.src = URL; - return; - } - if (g.DEAD || post.isDead || post.file.isDead) { - return; + if (Conf['Quote Highlighting']) { + posts = [origin].concat(origin.clones); + posts.pop(); + for (_i = 0, _len = posts.length; _i < _len; _i++) { + post = posts[_i]; + $.addClass(post.nodes.post, 'qphl'); } } - timeoutID = setTimeout((function() { - return _this.src = post.file.URL + '?' + Date.now(); - }), 3000); - return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { - onload: function() { - var postObj, _i, _len, _ref; - - if (this.status !== 200) { - return; - } - _ref = JSON.parse(this.response).posts; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - postObj = _ref[_i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - clearTimeout(timeoutID); - return post.kill(); - } else if (postObj.filedeleted) { - clearTimeout(timeoutID); - return post.kill(true); - } + quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0]; + clone = Get.postFromRoot(qp.firstChild); + _ref1 = clone.nodes.quotelinks.concat(__slice.call(clone.nodes.backlinks)); + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + quote = _ref1[_j]; + if (quote.hash.slice(2) === quoterID) { + $.addClass(quote, 'forwardlink'); } - }); + } + }, + mouseout: function() { + var clone, post, root, _i, _len, _ref; + + if (!(root = this.el.firstElementChild)) { + return; + } + clone = Get.postFromRoot(root); + post = clone.origin; + post.rmClone(root.dataset.clone); + if (!Conf['Quote Highlighting']) { + return; + } + _ref = [post].concat(post.clones); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + post = _ref[_i]; + $.rmClass(post.nodes.post, 'qphl'); + } } }; - ImageReplace = { + QuoteStrikeThrough = { init: function() { - if (g.VIEW === 'catalog') { + if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link'] && !Conf['Filter']) { return; } return Post.prototype.callbacks.push({ - name: 'Image Replace', + name: 'Strike-through Quotes', cb: this.node }); }, node: function() { - var URL, img, style, thumb, type, _ref, _ref1; + var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; - if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { + if (this.isClone) { return; } - _ref1 = this.file, thumb = _ref1.thumb, URL = _ref1.URL; - if (!(Conf["Replace " + ((type = (URL.match(/\w{3}$/))[0].toUpperCase()) === 'PEG' ? 'JPG' : type)] && !/spoiler/.test(thumb.src))) { - return; + _ref = this.nodes.quotelinks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quotelink = _ref[_i]; + _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID; + if ((_ref2 = g.posts["" + boardID + "." + postID]) != null ? _ref2.isHidden : void 0) { + $.addClass(quotelink, 'filtered'); + } } - if (this.file.isSpoiler) { - style = thumb.style; - style.maxHeight = style.maxWidth = this.isReply ? '125px' : '250px'; - } - img = $.el('img'); - $.on(img, 'load', function() { - return thumb.src = URL; - }); - return img.src = URL; } }; - RevealSpoilers = { + /* + <3 aeosynth + */ + + + QuoteThreading = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reveal Spoilers']) { + var input; + + if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { return; } + this.enabled = true; + this.controls = $.el('span', { + innerHTML: '' + }); + input = $('input', this.controls); + $.on(input, 'change', QuoteThreading.toggle); + $.event('AddMenuEntry', { + type: 'header', + el: this.controls, + order: 98 + }); + $.on(d, '4chanXInitFinished', this.setup); return Post.prototype.callbacks.push({ - name: 'Reveal Spoilers', + name: 'Quote Threading', + cb: this.node + }); + }, + setup: function() { + var ID, post, posts; + + $.off(d, '4chanXInitFinished', QuoteThreading.setup); + posts = g.posts; + for (ID in posts) { + post = posts[ID]; + if (post.cb) { + post.cb.call(post); + } + } + return QuoteThreading.hasRun = true; + }, + node: function() { + var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; + + if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { + return; + } + quotes = this.quotes, ID = this.ID, fullID = this.fullID; + posts = g.posts; + if (!(post = posts[fullID]) || post.isHidden) { + return; + } + uniq = {}; + len = ("" + g.BOARD).length + 1; + for (_i = 0, _len = quotes.length; _i < _len; _i++) { + quote = quotes[_i]; + qid = quote; + if (!(qid.slice(len) < ID)) { + continue; + } + if (qid in posts) { + uniq[qid.slice(len)] = true; + } + } + keys = Object.keys(uniq); + if (keys.length !== 1) { + return; + } + this.threaded = "" + g.BOARD + "." + keys[0]; + return this.cb = QuoteThreading.nodeinsert; + }, + nodeinsert: function() { + var bottom, height, posts, qpost, qroot, threadContainer, top, _ref; + + posts = g.posts; + qpost = posts[this.threaded]; + delete this.threaded; + delete this.cb; + if (this.thread.OP === qpost) { + return false; + } + if (QuoteThreading.hasRun) { + height = doc.clientHeight; + _ref = qpost.nodes.root.getBoundingClientRect(), bottom = _ref.bottom, top = _ref.top; + if (!(Unread.posts.contains(qpost) || ((bottom < height) && (top > 0)))) { + return false; + } + } + qroot = qpost.nodes.root; + if (!$.hasClass(qroot, 'threadOP')) { + $.addClass(qroot, 'threadOP'); + threadContainer = $.el('div', { + className: 'threadContainer' + }); + $.after(qroot, threadContainer); + } else { + threadContainer = qroot.nextSibling; + } + $.add(threadContainer, this.nodes.root); + return true; + }, + toggle: function() { + var container, containers, node, nodes, replies, reply, thread, _i, _j, _len, _len1; + + thread = $('.thread'); + replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); + QuoteThreading.enabled = this.checked; + if (this.checked) { + nodes = (function() { + var _i, _len, _results; + + _results = []; + for (_i = 0, _len = replies.length; _i < _len; _i++) { + reply = replies[_i]; + _results.push(Get.postFromNode(reply)); + } + return _results; + })(); + for (_i = 0, _len = nodes.length; _i < _len; _i++) { + node = nodes[_i]; + QuoteThreading.node(node); + } + } else { + replies.sort(function(a, b) { + var aID, bID; + + aID = Number(a.id.slice(2)); + bID = Number(b.id.slice(2)); + return aID - bID; + }); + $.add(thread, replies); + containers = $$('.threadContainer', thread); + for (_j = 0, _len1 = containers.length; _j < _len1; _j++) { + container = containers[_j]; + $.rm(container); + } + Unread.update(true); + } + }, + kb: function() { + var control; + + control = $.id('threadingControl'); + return control.click(); + } + }; + + QuoteYou = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Mark Quotes of You'] || !Conf['Quick Reply']) { + return; + } + this.text = '\u00A0(You)'; + return Post.prototype.callbacks.push({ + name: 'Mark Quotes of You', cb: this.node }); }, node: function() { - var thumb, _ref; + var quotelink, quotelinks, quotes, _i, _len; - if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { + if (this.isClone) { return; } - thumb = this.file.thumb; - thumb.removeAttribute('style'); - return thumb.src = this.file.thumbURL; + if (this.info.yours) { + $.addClass(this.nodes.root, 'yourPost'); + } + if (Conf['Highlight Own Posts']) { + $.addClass(doc, 'highlight-own'); + } + if (!(quotes = this.quotes).length) { + return; + } + quotelinks = this.nodes.quotelinks; + for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { + quotelink = quotelinks[_i]; + if (QR.db.get(Get.postDataFromLink(quotelink))) { + $.add(quotelink, $.tn(QuoteYou.text)); + } + } + } + }; + + Quotify = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Resurrect Quotes']) { + return; + } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + return Post.prototype.callbacks.push({ + name: 'Resurrect Quotes', + cb: this.node + }); + }, + node: function() { + var deadlink, _i, _len, _ref; + + _ref = $$('.deadlink', this.nodes.comment); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + deadlink = _ref[_i]; + if (this.isClone) { + if ($.hasClass(deadlink, 'quotelink')) { + this.nodes.quotelinks.push(deadlink); + } + } else { + Quotify.parseDeadlink.call(this, deadlink); + } + } + }, + parseDeadlink: function(deadlink) { + var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; + + if (deadlink.parentNode.className === 'prettyprint') { + $.replace(deadlink, __slice.call(deadlink.childNodes)); + return; + } + quote = deadlink.textContent; + if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) { + return; + } + boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; + quoteID = "" + boardID + "." + postID; + if (post = g.posts[quoteID]) { + if (!post.isDead) { + a = $.el('a', { + href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, + className: 'quotelink', + textContent: quote + }); + } else { + a = $.el('a', { + href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, + className: 'quotelink deadlink', + target: '_blank', + textContent: "" + quote + "\u00A0(Dead)" + }); + a.setAttribute('data-boardid', boardID); + a.setAttribute('data-threadid', post.thread.ID); + a.setAttribute('data-postid', postID); + } + } else if (redirect = Redirect.to({ + boardID: boardID, + threadID: 0, + postID: postID + })) { + a = $.el('a', { + href: redirect, + className: 'deadlink', + target: '_blank', + textContent: "" + quote + "\u00A0(Dead)" + }); + if (Redirect.post(boardID, postID)) { + $.addClass(a, 'quotelink'); + a.setAttribute('data-boardid', boardID); + a.setAttribute('data-postid', postID); + } + } + if (!this.quotes.contains(quoteID)) { + this.quotes.push(quoteID); + } + if (!a) { + deadlink.textContent = "" + quote + "\u00A0(Dead)"; + return; + } + $.replace(deadlink, a); + if ($.hasClass(a, 'quotelink')) { + return this.nodes.quotelinks.push(a); + } } }; @@ -5920,2853 +6590,6 @@ } }; - ArchiveLink = { - init: function() { - var div, entry, type, _i, _len, _ref; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { - return; - } - div = $.el('div', { - textContent: 'Archive' - }); - entry = { - type: 'post', - el: div, - order: 90, - open: function(_arg) { - var ID, board, redirect, thread; - - ID = _arg.ID, thread = _arg.thread, board = _arg.board; - redirect = Redirect.to({ - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - return redirect !== ("//boards.4chan.org/" + board + "/"); - }, - subEntries: [] - }; - _ref = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['E-mail', 'email'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; - entry.subEntries.push(this.createSubEntry(type[0], type[1])); - } - return $.event('AddMenuEntry', entry); - }, - createSubEntry: function(text, type) { - var el, open; - - el = $.el('a', { - textContent: text, - target: '_blank' - }); - open = type === 'post' ? function(_arg) { - var ID, board, thread; - - ID = _arg.ID, thread = _arg.thread, board = _arg.board; - el.href = Redirect.to({ - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - return true; - } : function(post) { - var value; - - value = Filter[type](post); - if (!value) { - return false; - } - el.href = Redirect.to({ - boardID: post.board.ID, - type: type, - value: value, - isSearch: true - }); - return true; - }; - return { - el: el, - open: open - }; - } - }; - - DeleteLink = { - init: function() { - var div, fileEl, fileEntry, postEl, postEntry; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { - return; - } - div = $.el('div', { - className: 'delete-link', - textContent: 'Delete' - }); - postEl = $.el('a', { - className: 'delete-post', - href: 'javascript:;' - }); - fileEl = $.el('a', { - className: 'delete-file', - href: 'javascript:;' - }); - postEntry = { - el: postEl, - open: function() { - postEl.textContent = 'Post'; - $.on(postEl, 'click', DeleteLink["delete"]); - return true; - } - }; - fileEntry = { - el: fileEl, - open: function(_arg) { - var file; - - file = _arg.file; - if (!file || file.isDead) { - return false; - } - fileEl.textContent = 'File'; - $.on(fileEl, 'click', DeleteLink["delete"]); - return true; - } - }; - return $.event('AddMenuEntry', { - type: 'post', - el: div, - order: 40, - open: function(post) { - var node; - - if (post.isDead) { - return false; - } - DeleteLink.post = post; - node = div.firstChild; - node.textContent = 'Delete'; - DeleteLink.cooldown.start(post, node); - return true; - }, - subEntries: [postEntry, fileEntry] - }); - }, - "delete": function() { - var fileOnly, form, link, m, post, pwd; - - post = DeleteLink.post; - if (DeleteLink.cooldown.counting === post) { - return; - } - $.off(this, 'click', DeleteLink["delete"]); - this.textContent = "Deleting " + this.textContent + "..."; - pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $.id('delPassword').value; - fileOnly = $.hasClass(this, 'delete-file'); - form = { - mode: 'usrdel', - onlyimgdel: fileOnly, - pwd: pwd - }; - form[post.ID] = 'delete'; - link = this; - return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), { - onload: function() { - return DeleteLink.load(link, post, fileOnly, this.response); - }, - onerror: function() { - return DeleteLink.error(link); - } - }, { - cred: true, - form: $.formData(form) - }); - }, - load: function(link, post, fileOnly, html) { - var msg, s, tmpDoc; - - tmpDoc = d.implementation.createHTMLDocument(''); - tmpDoc.documentElement.innerHTML = html; - if (tmpDoc.title === '4chan - Banned') { - s = 'Banned!'; - } else if (msg = tmpDoc.getElementById('errmsg')) { - s = msg.textContent; - $.on(link, 'click', DeleteLink["delete"]); - } else { - if (tmpDoc.title === 'Updating index...') { - (post.origin || post).kill(fileOnly); - } - s = 'Deleted'; - } - return link.textContent = s; - }, - error: function(link) { - link.textContent = 'Connection error, please retry.'; - return $.on(link, 'click', DeleteLink["delete"]); - }, - cooldown: { - start: function(post, node) { - var length, seconds, _ref; - - if (!((_ref = QR.db) != null ? _ref.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }) : void 0)) { - delete DeleteLink.cooldown.counting; - return; - } - DeleteLink.cooldown.counting = post; - length = post.board.ID === 'q' ? 600 : 30; - seconds = Math.ceil((length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND); - return DeleteLink.cooldown.count(post, seconds, length, node); - }, - count: function(post, seconds, length, node) { - if (DeleteLink.cooldown.counting !== post) { - return; - } - if (!((0 <= seconds && seconds <= length))) { - if (DeleteLink.cooldown.counting === post) { - node.textContent = 'Delete'; - delete DeleteLink.cooldown.counting; - } - return; - } - setTimeout(DeleteLink.cooldown.count, 1000, post, seconds - 1, length, node); - return node.textContent = "Delete (" + seconds + ")"; - } - } - }; - - DownloadLink = { - init: function() { - var a; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { - return; - } - a = $.el('a', { - className: 'download-link', - textContent: 'Download file' - }); - return $.event('AddMenuEntry', { - type: 'post', - el: a, - order: 70, - open: function(_arg) { - var file; - - file = _arg.file; - if (!file) { - return false; - } - a.href = file.URL; - a.download = file.name; - return true; - } - }); - } - }; - - Menu = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Menu']) { - return; - } - this.menu = new UI.Menu('post'); - return Post.prototype.callbacks.push({ - name: 'Menu', - cb: this.node - }); - }, - node: function() { - var button; - - button = Menu.makeButton(this); - if (this.isClone) { - $.replace($('.menu-button', this.nodes.info), button); - return; - } - return $.add(this.nodes.info, [$.tn('\u00A0'), button]); - }, - makeButton: (function() { - var a; - - a = null; - return function(post) { - var clone; - - a || (a = $.el('a', { - className: 'menu-button', - innerHTML: '[]', - href: 'javascript:;' - })); - clone = a.cloneNode(true); - clone.setAttribute('data-postid', post.fullID); - if (post.isClone) { - clone.setAttribute('data-clone', true); - } - $.on(clone, 'click', Menu.toggle); - return clone; - }; - })(), - toggle: function(e) { - var post; - - post = this.dataset.clone ? Get.postFromNode(this) : g.posts[this.dataset.postid]; - return Menu.menu.toggle(e, this, post); - } - }; - - ReportLink = { - init: function() { - var a; - - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { - return; - } - a = $.el('a', { - className: 'report-link', - href: 'javascript:;', - textContent: 'Report this post' - }); - $.on(a, 'click', ReportLink.report); - return $.event('AddMenuEntry', { - type: 'post', - el: a, - order: 10, - open: function(post) { - ReportLink.post = post; - return !post.isDead; - } - }); - }, - report: function() { - var id, post, set, url; - - post = ReportLink.post; - url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; - id = Date.now(); - set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"; - return window.open(url, id, set); - } - }; - - PSAHiding = { - init: function() { - if (!Conf['Announcement Hiding']) { - return; - } - return $.on(d, '4chanXInitFinished', this.setup); - }, - setup: function() { - var btn, psa, text; - - $.off(d, '4chanXInitFinished', PSAHiding.setup); - if (!(psa = $.id('globalMessage'))) { - return; - } - PSAHiding.btn = btn = $.el('a', { - title: 'Toggle announcement.', - innerHTML: '', - href: 'javascript:;', - textContent: '[ - ]' - }); - $.on(btn, 'click', PSAHiding.toggle); - $.prepend(psa, btn); - text = PSAHiding.trim(psa); - return $.get('hiddenPSAs', [], function(item) { - return PSAHiding.sync(item['hiddenPSAs']); - }); - }, - toggle: function(e) { - var text; - - text = PSAHiding.trim($.id('globalMessage')); - return $.get('hiddenPSAs', [], function(item) { - var hiddenPSAs; - - hiddenPSAs = item.hiddenPSAs; - hiddenPSAs.push(text); - hiddenPSAs = hiddenPSAs.slice(-5); - PSAHiding.sync(hiddenPSAs); - return $.set('hiddenPSAs', hiddenPSAs); - }); - }, - sync: function(hiddenPSAs) { - var btn, psa; - - btn = PSAHiding.btn; - psa = $.id('globalMessage'); - if (hiddenPSAs.contains(PSAHiding.trim(psa))) { - $.rm(psa); - return Style.iconPositions(); - } - }, - trim: function(psa) { - return psa.textContent.replace(/\W+/g, '').toLowerCase(); - } - }; - - CatalogLinks = { - init: function() { - var el, input; - - $.ready(this.ready); - if (!Conf['Catalog Links']) { - return; - } - el = $.el('label', { - id: 'toggleCatalog', - href: 'javascript:;', - innerHTML: "Catalog Links", - title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "." - }); - input = $('input', el); - $.on(input, 'change', this.toggle); - $.sync('Header catalog links', CatalogLinks.set); - $.event('AddMenuEntry', { - type: 'header', - el: el, - order: 95 - }); - return $.on(d, '4chanXInitFinished', function() { - return CatalogLinks.set(Conf['Header catalog links']); - }); - }, - toggle: function() { - var useCatalog; - - $.event('CloseMenu'); - $.set('Header catalog links', useCatalog = this.checked); - return CatalogLinks.set(useCatalog); - }, - set: function(useCatalog) { - var a, board, path, _i, _len, _ref; - - path = useCatalog ? 'catalog' : ''; - _ref = $$('a', $.id('board-list')); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - a = _ref[_i]; - board = a.pathname.split('/')[1]; - if (['f', 'status', '4chan'].contains(board) || !board) { - continue; - } - if (Conf['External Catalog']) { - a.href = useCatalog ? CatalogLinks.external(board) : "//boards.4chan.org/" + board + "/"; - } else { - a.pathname = "/" + board + "/" + path; - } - a.title = useCatalog ? "" + a.title + " - Catalog" : a.title.replace(/\ -\ Catalog$/, ''); - } - return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; - }, - external: function(board) { - return (['a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'].contains(board) ? "http://catalog.neet.tv/" + board : ['d', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'].contains(board) ? "http://4index.gropes.us/" + board : "//boards.4chan.org/" + board + "/catalog"); - }, - ready: function() { - var catalogLink; - - if (catalogLink = $('.pages.cataloglink a', d.body) || $('[href=".././catalog"]', d.body)) { - if (g.VIEW !== 'thread') { - $.add(d.body, catalogLink); - } - return catalogLink.id = 'catalog'; - } - } - }; - - ExpandComment = { - init: function() { - if (g.VIEW !== 'index' || !Conf['Comment Expansion']) { - return; - } - if (g.BOARD.ID === 'g') { - this.callbacks.push(Fourchan.code); - } - if (g.BOARD.ID === 'sci') { - this.callbacks.push(Fourchan.math); - } - return Post.prototype.callbacks.push({ - name: 'Comment Expansion', - cb: this.node - }); - }, - node: function() { - var a; - - if (a = $('.abbr > a', this.nodes.comment)) { - return $.on(a, 'click', ExpandComment.cb); - } - }, - callbacks: [], - cb: function(e) { - var post; - - e.preventDefault(); - post = Get.postFromNode(this); - return ExpandComment.expand(post); - }, - expand: function(post) { - var a; - - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { - $.replace(post.nodes.shortComment, post.nodes.longComment); - post.nodes.comment = post.nodes.longComment; - return; - } - if (!(a = $('.abbr > a', post.nodes.comment))) { - return; - } - a.textContent = "Post No." + post + " Loading..."; - return $.cache("//api.4chan.org" + a.pathname + ".json", function() { - return ExpandComment.parse(this, a, post); - }); - }, - contract: function(post) { - var a; - - if (!post.nodes.shortComment) { - return; - } - a = $('.abbr > a', post.nodes.shortComment); - a.textContent = 'here'; - $.replace(post.nodes.longComment, post.nodes.shortComment); - return post.nodes.comment = post.nodes.shortComment; - }, - parse: function(req, a, post) { - var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - - status = req.status; - if (![200, 304].contains(status)) { - a.textContent = "Error " + req.statusText + " (" + status + ")"; - return; - } - posts = JSON.parse(req.response).posts; - if (spoilerRange = posts[0].custom_spoiler) { - Build.spoilerRange[g.BOARD] = spoilerRange; - } - for (_i = 0, _len = posts.length; _i < _len; _i++) { - postObj = posts[_i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - a.textContent = "Post No." + post + " not found."; - return; - } - comment = post.nodes.comment; - clone = comment.cloneNode(false); - clone.innerHTML = postObj.com; - _ref = $$('.quotelink', clone); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - quote = _ref[_j]; - href = quote.getAttribute('href'); - if (href[0] === '/') { - continue; - } - quote.href = "/" + post.board + "/res/" + href; - } - post.nodes.shortComment = comment; - $.replace(comment, clone); - post.nodes.comment = post.nodes.longComment = clone; - post.parseComment(); - post.parseQuotes(); - _ref1 = ExpandComment.callbacks; - for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { - callback = _ref1[_k]; - callback.call(post); - } - } - }; - - ExpandThread = { - init: function() { - if (g.VIEW !== 'index' || !Conf['Thread Expansion']) { - return; - } - return Thread.prototype.callbacks.push({ - name: 'Thread Expansion', - cb: this.node - }); - }, - node: function() { - var a, span; - - if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { - return; - } - a = $.el('a', { - textContent: "+ " + span.textContent, - className: 'summary', - href: 'javascript:;' - }); - $.on(a, 'click', ExpandThread.cbToggle); - return $.replace(span, a); - }, - cbToggle: function() { - var op; - - op = Get.postFromRoot(this.previousElementSibling); - return ExpandThread.toggle(op.thread); - }, - toggle: function(thread) { - var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - - threadRoot = thread.OP.nodes.root.parentNode; - a = $('.summary', threadRoot); - switch (thread.isExpanded) { - case false: - case void 0: - thread.isExpanded = 'loading'; - _ref = $$('.thread > .postContainer', threadRoot); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - post = _ref[_i]; - ExpandComment.expand(Get.postFromRoot(post)); - } - if (!a) { - thread.isExpanded = true; - return; - } - thread.isExpanded = 'loading'; - a.textContent = a.textContent.replace('+', '× Loading...'); - $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { - return ExpandThread.parse(this, thread, a); - }); - break; - case 'loading': - thread.isExpanded = false; - if (!a) { - return; - } - a.textContent = a.textContent.replace('× Loading...', '+'); - break; - case true: - thread.isExpanded = false; - if (a) { - a.textContent = a.textContent.replace('-', '+'); - num = (function() { - if (thread.isSticky) { - return 1; - } else { - switch (g.BOARD.ID) { - case 'b': - case 'vg': - case 'q': - return 3; - case 't': - return 1; - default: - return 5; - } - } - })(); - replies = $$('.thread > .replyContainer', threadRoot).slice(0, -num); - for (_j = 0, _len1 = replies.length; _j < _len1; _j++) { - reply = replies[_j]; - if (Conf['Quote Inlining']) { - while (inlined = $('.inlined', reply)) { - inlined.click(); - } - } - $.rm(reply); - } - } - _ref1 = $$('.thread > .postContainer', threadRoot); - for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { - post = _ref1[_k]; - ExpandComment.contract(Get.postFromRoot(post)); - } - } - }, - parse: function(req, thread, a) { - var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; - - if (a.textContent[0] === '+') { - return; - } - status = req.status; - if (![200, 304].contains(status)) { - a.textContent = "Error " + req.statusText + " (" + status + ")"; - $.off(a, 'click', ExpandThread.cb.toggle); - return; - } - thread.isExpanded = true; - a.textContent = a.textContent.replace('× Loading...', '-'); - posts = JSON.parse(req.response).posts; - if (spoilerRange = posts[0].custom_spoiler) { - Build.spoilerRange[g.BOARD] = spoilerRange; - } - replies = posts.slice(1); - posts = []; - nodes = []; - for (_i = 0, _len = replies.length; _i < _len; _i++) { - reply = replies[_i]; - if (post = thread.posts[reply.no]) { - nodes.push(post.nodes.root); - continue; - } - node = Build.postFromObject(reply, thread.board); - post = new Post(node, thread, thread.board); - link = $('a[title="Highlight this post"]', node); - link.href = "res/" + thread + "#p" + post; - link.nextSibling.href = "res/" + thread + "#q" + post; - posts.push(post); - nodes.push(node); - } - Main.callbackNodes(Post, posts); - $.after(a, nodes); - return Fourchan.parseThread(thread.ID, 1, nodes.length); - } - }; - - FileInfo = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) { - return; - } - this.funk = this.createFunc(Conf['fileInfo']); - return Post.prototype.callbacks.push({ - name: 'File Info Formatting', - cb: this.node - }); - }, - node: function() { - if (!this.file || this.isClone) { - return; - } - return this.file.text.innerHTML = FileInfo.funk(FileInfo, this); - }, - createFunc: function(format) { - var code; - - code = format.replace(/%(.)/g, function(s, c) { - if (c in FileInfo.formatters) { - return "' + FileInfo.formatters." + c + ".call(post) + '"; - } else { - return s; - } - }); - return Function('FileInfo', 'post', "return '" + code + "'"); - }, - convertUnit: function(size, unit) { - var i; - - if (unit === 'B') { - return "" + (size.toFixed()) + " Bytes"; - } - i = 1 + ['KB', 'MB'].indexOf(unit); - while (i--) { - size /= 1024; - } - size = unit === 'MB' ? Math.round(size * 100) / 100 : size.toFixed(); - return "" + size + " " + unit; - }, - escape: function(name) { - return name.replace(/<|>/g, function(c) { - return c === '<' && '<' || '>'; - }); - }, - formatters: { - t: function() { - return this.file.URL.match(/\d+\..+$/)[0]; - }, - T: function() { - return "" + (FileInfo.formatters.t.call(this)) + ""; - }, - l: function() { - return "" + (FileInfo.formatters.n.call(this)) + ""; - }, - L: function() { - return "" + (FileInfo.formatters.N.call(this)) + ""; - }, - n: function() { - var fullname, shortname; - - fullname = this.file.name; - shortname = Build.shortFilename(this.file.name, this.isReply); - if (fullname === shortname) { - return FileInfo.escape(fullname); - } else { - return "" + (FileInfo.escape(shortname)) + "" + (FileInfo.escape(fullname)) + ""; - } - }, - N: function() { - return FileInfo.escape(this.file.name); - }, - p: function() { - if (this.file.isSpoiler) { - return 'Spoiler, '; - } else { - return ''; - } - }, - s: function() { - return this.file.size; - }, - B: function() { - return FileInfo.convertUnit(this.file.sizeInBytes, 'B'); - }, - K: function() { - return FileInfo.convertUnit(this.file.sizeInBytes, 'KB'); - }, - M: function() { - return FileInfo.convertUnit(this.file.sizeInBytes, 'MB'); - }, - r: function() { - if (this.file.isImage) { - return this.file.dimensions; - } else { - return 'PDF'; - } - } - } - }; - - Fourchan = { - init: function() { - var board; - - if (g.VIEW === 'catalog') { - return; - } - board = g.BOARD.ID; - if (board === 'g') { - $.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML);\n}, false);"); - Post.prototype.callbacks.push({ - name: 'Parse /g/ code', - cb: this.code - }); - } - if (board === 'sci') { - $.globalEval("window.addEventListener('jsmath', function(e) {\n if (jsMath.loaded) {\n // process one post\n jsMath.ProcessBeforeShowing(e.detail);\n } else {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);"); - return Post.prototype.callbacks.push({ - name: 'Parse /sci/ math', - cb: this.math - }); - } - }, - code: function() { - var pre, _i, _len, _ref; - - if (this.isClone) { - return; - } - _ref = $$('.prettyprint', this.nodes.comment); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - pre = _ref[_i]; - $.event('prettyprint', pre, window); - } - }, - math: function() { - if (this.isClone || !$('.math', this.nodes.comment)) { - return; - } - return $.event('jsmath', this.nodes.post, window); - }, - parseThread: function(threadID, offset, limit) { - return $.event('4chanParsingDone', { - threadId: threadID, - offset: offset, - limit: limit - }); - } - }; - - Header = { - init: function() { - var createSubEntry, headerToggler, setting, subEntries, _i, _len, _ref; - - this.menuButton = $.el('span', { - className: 'menu-button', - id: 'main-menu' - }); - this.menu = new UI.Menu('header'); - headerToggler = $.el('label', { - innerHTML: ' Auto-hide header' - }); - this.headerToggler = headerToggler.firstElementChild; - $.on(this.menuButton, 'click', this.menuToggle); - $.on(window, 'load hashchange', Header.hashScroll); - $.on(this.headerToggler, 'change', this.toggleBarVisibility); - createSubEntry = Header.createSubEntry; - subEntries = []; - _ref = ['Sticky top', 'Sticky bottom', 'Top', 'Hide']; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - setting = _ref[_i]; - subEntries.push(createSubEntry(setting)); - } - subEntries.push({ - el: headerToggler - }); - $.event('AddMenuEntry', { - type: 'header', - el: $.el('span', { - textContent: 'Header' - }), - order: 105, - subEntries: subEntries - }); - $.on(d, 'CreateNotification', this.createNotification); - $.asap((function() { - return d.body; - }), function() { - if (!Main.isThisPageLegit()) { - return; - } - return $.asap((function() { - return $.id('boardNavMobile'); - }), Header.setBoardList); - }); - return $.ready(function() { - return $.add(d.body, Header.hover); - }); - }, - bar: $.el('div', { - id: 'notifications' - }), - shortcuts: $.el('span', { - id: 'shortcuts' - }), - hover: $.el('div', { - id: 'hoverUI' - }), - toggle: $.el('div', { - id: 'scroll-marker' - }), - createSubEntry: function(setting) { - var label; - - label = $.el('label', { - textContent: "" + setting - }); - $.on(label, 'click', Header.setBarPosition); - return { - el: label - }; - }, - setBoardList: function() { - var a, boardList, btn, customBoardList, fullBoardList, nav, settings; - - Header.nav = nav = $.id('boardNavDesktop'); - nav.id = 'header-bar'; - if (a = $("a[href*='/" + g.BOARD + "/']", nav)) { - a.className = 'current'; - } - boardList = $.el('span', { - id: 'board-list' - }); - $.add(boardList, fullBoardList = $.el('span', { - id: 'full-board-list' - })); - Header.setBarPosition.call({ - textContent: "" + Conf['Boards Navigation'] - }); - $.sync('Boards Navigation', Header.changeBarPosition); - Header.setBarVisibility(Conf['Header auto-hide']); - $.sync('Header auto-hide', Header.setBarVisibility); - $.prepend(d.body, settings = $.id('navtopright')); - $.add(settings, Header.menuButton); - $.add(fullBoardList, __slice.call(nav.childNodes)); - $.add(nav, [boardList, Header.shortcuts, Header.bar, Header.toggle]); - if (Conf['Custom Board Navigation']) { - fullBoardList.hidden = true; - customBoardList = $.el('span', { - id: 'custom-board-list' - }); - $.add(boardList, customBoardList); - Header.generateBoardList(Conf['boardnav']); - $.sync('boardnav', Header.generateBoardList); - btn = $.el('span', { - className: 'hide-board-list-button', - innerHTML: '[ - ]\u00A0' - }); - $.on(btn, 'click', Header.toggleBoardList); - return $.prepend(fullBoardList, btn); - } else { - return fullBoardList.hidden = false; - } - }, - generateBoardList: function(text) { - var as, list, nodes; - - list = $('#custom-board-list', Header.nav); - $.rmAll(list); - if (!text) { - return; - } - as = $$('#full-board-list a', Header.nav).slice(0, -2); - nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map(function(t) { - var a, board, m, _i, _len; - - if (/^[^\w@]/.test(t)) { - return $.tn(t); - } - if (/^toggle-all/.test(t)) { - a = $.el('a', { - className: 'show-board-list-button', - textContent: (t.match(/-text:"(.+)"/) || [null, '+'])[1], - href: 'javascript:;' - }); - $.on(a, 'click', Header.toggleBoardList); - return a; - } - board = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0]; - for (_i = 0, _len = as.length; _i < _len; _i++) { - a = as[_i]; - if (a.textContent === board) { - a = a.cloneNode(true); - if (/-title/.test(t)) { - a.textContent = a.title; - } else if (/-replace/.test(t)) { - if ($.hasClass(a, 'current')) { - a.textContent = a.title; - } - } else if (/-full/.test(t)) { - a.textContent = "/" + board + "/ - " + a.title; - } else if (/-(index|catalog|text)/.test(t)) { - if (m = t.match(/-(index|catalog)/)) { - a.setAttribute('data-only', m[1]); - a.href = "//boards.4chan.org/" + board + "/"; - if (m[1] === 'catalog') { - a.href += 'catalog'; - } - } - if (m = t.match(/-text:"(.+)"/)) { - a.textContent = m[1]; - } - } else if (board === '@') { - $.addClass(a, 'navSmall'); - } - return a; - } - } - return $.tn(t); - }); - return $.add(list, nodes); - }, - toggleBoardList: function() { - var custom, full, nav, showBoardList; - - nav = Header.nav; - custom = $('#custom-board-list', nav); - full = $('#full-board-list', nav); - showBoardList = !full.hidden; - custom.hidden = !showBoardList; - return full.hidden = showBoardList; - }, - setBarPosition: function() { - $.event('CloseMenu'); - Header.changeBarPosition(this.textContent); - Conf['Boards Navigation'] = this.textContent; - return $.set('Boards Navigation', this.textContent); - }, - changeBarPosition: function(setting) { - $.rmClass(doc, 'top'); - $.rmClass(doc, 'fixed'); - $.rmClass(doc, 'bottom'); - $.rmClass(doc, 'hide'); - switch (setting) { - case 'Sticky top': - $.addClass(doc, 'top'); - return $.addClass(doc, 'fixed'); - case 'Sticky bottom': - $.addClass(doc, 'fixed'); - return $.addClass(doc, 'bottom'); - case 'Top': - return $.addClass(doc, 'top'); - case 'Hide': - return $.addClass(doc, 'hide'); - } - }, - setBarVisibility: function(hide) { - Header.headerToggler.checked = hide; - $.event('CloseMenu'); - return (hide ? $.addClass : $.rmClass)(Header.nav, 'autohide'); - }, - hashScroll: function() { - var post; - - if (!(post = this.location.hash.slice(1))) { - return; - } - if ((Get.postFromRoot(post)).isHidden) { - return; - } - return Header.scrollToPost(post); - }, - scrollToPost: function(post) { - var headRect, top; - - top = post.getBoundingClientRect().top; - if (Conf['Boards Navigation'] === 'sticky top') { - headRect = Header.bar.getBoundingClientRect(); - top += -headRect.top - headRect.height; - } - return d.body.scrollTop += top; - }, - toggleBarVisibility: function(e) { - var hide, message; - - if (e.type === 'mousedown' && e.button !== 0) { - return; - } - hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); - Conf['Header auto-hide'] = hide; - $.set('Header auto-hide', hide); - Header.setBarVisibility(hide); - message = hide ? 'The header bar will automatically hide itself.' : 'The header bar will remain visible.'; - return new Notification('info', message, 2); - }, - hashScroll: function() { - var hash, post; - - if (!((hash = this.location.hash) && (post = $.id(hash.slice(1))))) { - return; - } - if ((Get.postFromRoot(post)).isHidden) { - return; - } - return Header.scrollToPost(post); - }, - scrollToPost: function(post) { - var headRect, top; - - top = post.getBoundingClientRect().top; - if (Conf['Boards Navigation'] === 'Sticky top') { - headRect = Header.bar.getBoundingClientRect(); - top += -headRect.top - headRect.height; - } - return d.body.scrollTop += top; - }, - addShortcut: function(el) { - var shortcut; - - shortcut = $.el('span', { - className: 'shortcut' - }); - $.add(shortcut, [$.tn(' ['), el, $.tn(']')]); - return $.prepend(Header.shortcuts, shortcut); - }, - menuToggle: function(e) { - return Header.menu.toggle(e, this, g); - }, - createNotification: function(e) { - var cb, content, lifetime, notif, type, _ref; - - _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; - notif = new Notification(type, content, lifetime); - if (cb) { - return cb(notif); - } - } - }; - - Keybinds = { - init: function() { - var init; - - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { - return; - } - init = function() { - var node, _i, _len, _ref; - - $.off(d, '4chanXInitFinished', init); - $.on(d, 'keydown', Keybinds.keydown); - _ref = $$('[accesskey]'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - node.removeAttribute('accesskey'); - } - }; - return $.on(d, '4chanXInitFinished', init); - }, - keydown: function(e) { - var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; - - if (!(key = Keybinds.keyCode(e))) { - return; - } - target = e.target; - if (['INPUT', 'TEXTAREA'].contains(target.nodeName)) { - if (!/(Esc|Alt|Ctrl|Meta)/.test(key)) { - return; - } - } - threadRoot = Nav.getThread(); - if (op = $('.op', threadRoot)) { - thread = Get.postFromNode(op).thread; - } - switch (key) { - case Conf['Toggle board list']: - if (Conf['Custom Board Navigation']) { - Header.toggleBoardList(); - } - break; - case Conf['Open empty QR']: - Keybinds.qr(threadRoot); - break; - case Conf['Open QR']: - Keybinds.qr(threadRoot, true); - break; - case Conf['Open settings']: - Settings.open(); - break; - case Conf['Close']: - if ($.id('fourchanx-settings')) { - Settings.close(); - } else if ((notifications = $$('.notification')).length) { - for (_i = 0, _len = notifications.length; _i < _len; _i++) { - notification = notifications[_i]; - $('.close', notification).click(); - } - } else if (QR.nodes) { - QR.close(); - } - break; - case Conf['Spoiler tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('spoiler', target); - break; - case Conf['Code tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('code', target); - break; - case Conf['Eqn tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('eqn', target); - break; - case Conf['Math tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('math', target); - break; - case Conf['Submit QR']: - if (QR.nodes && !QR.status()) { - QR.submit(); - } - break; - case Conf['Watch']: - ThreadWatcher.toggle(thread); - break; - case Conf['Update']: - ThreadUpdater.update(); - break; - case Conf['Expand image']: - Keybinds.img(threadRoot); - break; - case Conf['Expand images']: - Keybinds.img(threadRoot, true); - break; - case Conf['fappeTyme']: - FappeTyme.toggle(); - break; - case Conf['Front page']: - window.location = "/" + g.BOARD + "/0#delform"; - break; - case Conf['Open front page']: - $.open("/" + g.BOARD + "/#delform"); - break; - case Conf['Next page']: - if (form = $('.next form')) { - window.location = form.action; - } - break; - case Conf['Previous page']: - if (form = $('.prev form')) { - window.location = form.action; - } - break; - case Conf['Next thread']: - if (g.VIEW === 'thread') { - return; - } - Nav.scroll(+1); - break; - case Conf['Previous thread']: - if (g.VIEW === 'thread') { - return; - } - Nav.scroll(-1); - break; - case Conf['Expand thread']: - ExpandThread.toggle(thread); - break; - case Conf['Open thread']: - Keybinds.open(thread); - break; - case Conf['Open thread tab']: - Keybinds.open(thread, true); - break; - case Conf['Next reply']: - Keybinds.hl(+1, threadRoot); - break; - case Conf['Previous reply']: - Keybinds.hl(-1, threadRoot); - break; - case Conf['Hide']: - if (g.VIEW === 'index') { - ThreadHiding.toggle(thread); - } - break; - default: - return; - } - e.preventDefault(); - return e.stopPropagation(); - }, - keyCode: function(e) { - var kc, key; - - key = (function() { - switch (kc = e.keyCode) { - case 8: - return ''; - case 13: - return 'Enter'; - case 27: - return 'Esc'; - case 37: - return 'Left'; - case 38: - return 'Up'; - case 39: - return 'Right'; - case 40: - return 'Down'; - default: - if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { - return String.fromCharCode(kc).toLowerCase(); - } else { - return null; - } - } - })(); - if (key) { - if (e.altKey) { - key = 'Alt+' + key; - } - if (e.ctrlKey) { - key = 'Ctrl+' + key; - } - if (e.metaKey) { - key = 'Meta+' + key; - } - if (e.shiftKey) { - key = 'Shift+' + key; - } - } - return key; - }, - qr: function(thread, quote) { - if (!(Conf['Quick Reply'] && QR.postingIsEnabled)) { - return; - } - QR.open(); - if (quote) { - QR.quote.call($('input', $('.post.highlight', thread) || thread)); - } - QR.nodes.com.focus(); - if (Conf['QR Shortcut']) { - return $.rmClass($('.qr-shortcut'), 'disabled'); - } - }, - tags: function(tag, ta) { - var range, selEnd, selStart, value; - - value = ta.value; - selStart = ta.selectionStart; - selEnd = ta.selectionEnd; - ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd); - range = ("[" + tag + "]").length + selEnd; - ta.setSelectionRange(range, range); - return $.event('input', null, ta); - }, - img: function(thread, all) { - var post; - - if (all) { - return ImageExpand.cb.toggleAll(); - } else { - post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread)); - return ImageExpand.toggle(post); - } - }, - open: function(thread, tab) { - var url; - - if (g.VIEW !== 'index') { - return; - } - url = "/" + thread.board + "/res/" + thread; - if (tab) { - return $.open(url); - } else { - return location.href = url; - } - }, - hl: function(delta, thread) { - var headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; - - if (Conf['Fixed Header'] && Conf['Bottom header']) { - topMargin = 0; - } else { - headRect = Header.bar.getBoundingClientRect(); - topMargin = headRect.top + headRect.height; - } - if (postEl = $('.reply.highlight', thread)) { - $.rmClass(postEl, 'highlight'); - rect = postEl.getBoundingClientRect(); - if (rect.bottom >= topMargin && rect.top <= doc.clientHeight) { - root = postEl.parentNode; - next = $.x('child::div[contains(@class,"post reply")]', delta === +1 ? root.nextElementSibling : root.previousElementSibling); - if (!next) { - this.focus(postEl); - return; - } - if (!(g.VIEW === 'thread' || $.x('ancestor::div[parent::div[@class="board"]]', next) === thread)) { - return; - } - rect = next.getBoundingClientRect(); - if (rect.top < 0 || rect.bottom > doc.clientHeight) { - if (delta === -1) { - window.scrollBy(0, rect.top - topMargin); - } else { - next.scrollIntoView(false); - } - } - this.focus(next); - return; - } - } - replies = $$('.reply', thread); - if (delta === -1) { - replies.reverse(); - } - for (_i = 0, _len = replies.length; _i < _len; _i++) { - reply = replies[_i]; - rect = reply.getBoundingClientRect(); - if (delta === +1 && rect.top >= topMargin || delta === -1 && rect.bottom <= doc.clientHeight) { - this.focus(reply); - return; - } - } - }, - focus: function(post) { - return $.addClass(post, 'highlight'); - } - }; - - Redirect = { - init: function() { - return $.sync('archs', this.updateArchives); - }, - updateArchives: function() { - return $.get('archivers', {}, function(_arg) { - var archivers; - - archivers = _arg.archivers; - return Conf['archivers'] = archivers; - }); - }, - image: function(boardID, filename) { - switch (boardID) { - case 'a': - case 'gd': - case 'jp': - case 'm': - case 'q': - case 'tg': - case 'vg': - case 'vp': - case 'vr': - case 'wsg': - return "//archive.foolz.us/" + boardID + "/full_image/" + filename; - case 'u': - return "//nsfw.foolz.us/" + boardID + "/full_image/" + filename; - case 'po': - return "//archive.thedarkcave.org/" + boardID + "/full_image/" + filename; - case 'hr': - case 'tv': - return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename; - case 'ck': - case 'fa': - case 'lit': - case 's4s': - return "//fuuka.warosu.org/" + boardID + "/full_image/" + filename; - case 'cgl': - case 'g': - case 'mu': - case 'w': - return "//rbt.asia/" + boardID + "/full_image/" + filename; - case 'an': - case 'k': - case 'toy': - case 'x': - return "http://archive.heinessen.com/" + boardID + "/full_image/" + filename; - case 'c': - return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename; - } - }, - post: function(boardID, postID) { - var archive, name, _base, _ref; - - if (Redirect.post[boardID] == null) { - _ref = this.archiver; - for (name in _ref) { - archive = _ref[name]; - if (archive.type === 'foolfuuka' && archive.boards.contains(boardID)) { - Redirect.post[boardID] = archive.base; - break; - } - } - (_base = Redirect.post)[boardID] || (_base[boardID] = false); - } - if (Redirect.post[boardID]) { - return "" + Redirect.post[boardID] + "/_/api/chan/post/?board=" + boardID + "&num=" + postID; - } else { - return null; - } - }, - select: function(board) { - var archive, name, _ref, _results; - - _ref = this.archiver; - _results = []; - for (name in _ref) { - archive = _ref[name]; - if (!archive.boards.contains(board)) { - continue; - } - _results.push(name); - } - return _results; - }, - to: function(data) { - var arch, archive, boardID; - - boardID = data.boardID; - if ((arch = Conf.archivers[boardID]) == null) { - Conf.archivers[boardID] = arch = this.select(boardID)[0]; - $.set('archivers', Conf.archivers); - } - return (arch && (archive = this.archiver[arch]) ? Redirect.path(archive.base, archive.type, data) : data.threadID ? "//boards.4chan.org/" + boardID + "/" : null); - }, - archiver: { - 'Foolz': { - base: 'https://archive.foolz.us', - boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'], - type: 'foolfuuka' - }, - 'NSFWFoolz': { - base: 'https://nsfw.foolz.us', - boards: ['u'], - type: 'foolfuuka' - }, - 'TheDarkCave': { - base: 'http://archive.thedarkcave.org', - boards: ['c', 'int', 'out', 'po'], - type: 'foolfuuka' - }, - '4plebs': { - base: 'http://archive.4plebs.org', - boards: ['hr', 'tg', 'tv', 'x'], - base: 'foolfuuka' - }, - 'Warosu': { - base: '//fuuka.warosu.org', - boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'], - type: 'fuuka' - }, - 'InstallGentoo': { - base: '//archive.installgentoo.net', - boards: ['diy', 'g', 'sci'], - type: 'fuuka' - }, - 'RebeccaBlackTech': { - base: '//rbt.asia', - boards: ['an', 'cgl', 'g', 'mu', 'w'], - type: 'fuuka_mail' - }, - 'Heinessen': { - base: 'http://archive.heinessen.com', - boards: ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'], - type: 'fuuka' - }, - 'Cliche': { - base: '//www.cliché.net/4chan/cgi-board.pl', - boards: ['e'], - type: 'fuuka' - }, - 'NyaFuu': { - base: '//archive.nyafuu.org', - boards: ['c', 'w'], - type: 'fuuka' - } - }, - path: function(base, archiver, data) { - var boardID, path, postID, threadID, type, value; - - if (data.isSearch) { - boardID = data.boardID, type = data.type, value = data.value; - type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; - value = encodeURIComponent(value); - if (archiver === 'foolfuuka') { - return "" + base + "/" + boardID + "/search/" + type + "/" + value; - } else if (type === 'image') { - return "" + base + "/" + boardID + "/?task=search2&search_media_hash=" + value; - } else { - return "" + base + "/" + boardID + "/?task=search2&search_" + type + "=" + value; - } - } - boardID = data.boardID, threadID = data.threadID, postID = data.postID; - path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; - if (archiver === 'foolfuuka') { - path += '/'; - } - if (threadID && postID) { - path += archiver === 'foolfuuka' ? "#" + postID : "#p" + postID; - } - return "" + base + "/" + path; - } - }; - - RelativeDates = { - INTERVAL: $.MINUTE / 2, - init: function() { - if (g.VIEW === 'catalog' || !Conf['Relative Post Dates']) { - return; - } - $.on(d, 'visibilitychange ThreadUpdate', this.flush); - this.flush(); - return Post.prototype.callbacks.push({ - name: 'Relative Post Dates', - cb: this.node - }); - }, - node: function() { - var dateEl; - - if (this.isClone) { - return; - } - dateEl = this.nodes.date; - dateEl.title = dateEl.textContent; - return RelativeDates.setUpdate(this); - }, - relative: function(diff, now, date) { - var days, months, number, rounded, unit, years; - - unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); - rounded = Math.round(number); - if (rounded !== 1) { - unit += 's'; - } - return "" + rounded + " " + unit + " ago"; - }, - stale: [], - flush: function() { - var now, update, _i, _len, _ref; - - if (d.hidden) { - return; - } - now = new Date(); - _ref = RelativeDates.stale; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - update = _ref[_i]; - update(now); - } - RelativeDates.stale = []; - clearTimeout(RelativeDates.timeout); - return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); - }, - setUpdate: function(post) { - var markStale, setOwnTimeout, update; - - setOwnTimeout = function(diff) { - var delay; - - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; - return setTimeout(markStale, delay); - }; - update = function(now) { - var date, diff, relative, singlePost, _i, _len, _ref; - - date = post.info.date; - diff = now - date; - relative = RelativeDates.relative(diff, now, date); - _ref = [post].concat(post.clones); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - singlePost = _ref[_i]; - singlePost.nodes.date.firstChild.textContent = relative; - } - return setOwnTimeout(diff); - }; - markStale = function() { - return RelativeDates.stale.push(update); - }; - return update(new Date()); - } - }; - - Report = { - init: function() { - if (!/report/.test(location.search)) { - return; - } - return $.ready(this.ready); - }, - ready: function() { - var field, form; - - form = $('form'); - field = $.id('recaptcha_response_field'); - $.on(field, 'keydown', function(e) { - if (e.keyCode === 8 && !field.value) { - return $.globalEval('Recaptcha.reload("t")'); - } - }); - return $.on(form, 'submit', function(e) { - var response; - - e.preventDefault(); - response = field.value.trim(); - if (!/\s/.test(response)) { - field.value = "" + response + " " + response; - } - return form.submit(); - }); - } - }; - - Nav = { - init: function() { - var append, next, prev, span; - - switch (g.VIEW) { - case 'index': - if (!Conf['Index Navigation']) { - return; - } - break; - case 'thread': - if (!Conf['Reply Navigation']) { - return; - } - break; - default: - return; - } - span = $.el('span', { - id: 'navlinks' - }); - prev = $.el('a', { - href: 'javascript:;' - }); - next = $.el('a', { - href: 'javascript:;' - }); - $.on(prev, 'click', this.prev); - $.on(next, 'click', this.next); - $.add(span, [prev, $.tn(' '), next]); - append = function() { - $.off(d, '4chanXInitFinished', append); - return $.add(d.body, span); - }; - return $.on(d, '4chanXInitFinished', append); - }, - prev: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, 0); - } else { - return Nav.scroll(-1); - } - }, - next: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, d.body.scrollHeight); - } else { - return Nav.scroll(+1); - } - }, - getThread: function(full) { - var headRect, i, rect, thread, threads, topMargin, _i, _len; - - if (Conf['Bottom header']) { - topMargin = 0; - } else { - headRect = Header.bar.getBoundingClientRect(); - topMargin = headRect.top + headRect.height; - } - threads = $$('.thread:not([hidden])'); - for (i = _i = 0, _len = threads.length; _i < _len; i = ++_i) { - thread = threads[i]; - rect = thread.getBoundingClientRect(); - if (rect.bottom > topMargin) { - if (full) { - return [threads, thread, i, rect, topMargin]; - } else { - return thread; - } - } - } - return $('.board'); - }, - scroll: function(delta) { - var i, rect, thread, threads, top, topMargin, _ref, _ref1; - - _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; - top = rect.top - topMargin; - if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) { - i += delta; - } - top = ((_ref1 = threads[i]) != null ? _ref1.getBoundingClientRect().top : void 0) - topMargin; - return window.scrollBy(0, top); - } - }; - - Sauce = { - init: function() { - var link, links, _i, _len, _ref; - - if (g.VIEW === 'catalog' || !Conf['Sauce']) { - return; - } - links = []; - _ref = Conf['sauces'].split('\n'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - if (link[0] === '#') { - continue; - } - links.push(this.createSauceLink(link.trim())); - } - if (!links.length) { - return; - } - this.links = links; - this.link = $.el('a', { - target: '_blank' - }); - return Post.prototype.callbacks.push({ - name: 'Sauce', - cb: this.node - }); - }, - createSauceLink: function(link) { - var m, text; - - link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { - switch (parameter) { - case '%TURL': - return "' + encodeURIComponent(post.file.thumbURL) + '"; - case '%URL': - return "' + encodeURIComponent(post.file.URL) + '"; - case '%MD5': - return "' + encodeURIComponent(post.file.MD5) + '"; - case '%board': - return "' + encodeURIComponent(post.board) + '"; - default: - return parameter; - } - }); - text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1]; - link = link.replace(/;text:.+$/, ''); - return Function('post', 'a', "a.href = '" + link + "';\na.textContent = '" + text + "';\nreturn a;"); - }, - node: function() { - var link, nodes, _i, _len, _ref; - - if (this.isClone || !this.file) { - return; - } - nodes = []; - _ref = Sauce.links; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - nodes.push($.tn('\u00A0'), link(this, Sauce.link.cloneNode(true))); - } - return $.add(this.file.info, nodes); - } - }; - - Time = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Time Formatting']) { - return; - } - this.funk = this.createFunc(Conf['time']); - return Post.prototype.callbacks.push({ - name: 'Time Formatting', - cb: this.node - }); - }, - node: function() { - if (this.isClone) { - return; - } - return this.nodes.date.textContent = Time.funk(Time, this.info.date); - }, - createFunc: function(format) { - var code; - - code = format.replace(/%([A-Za-z])/g, function(s, c) { - if (c in Time.formatters) { - return "' + Time.formatters." + c + ".call(date) + '"; - } else { - return s; - } - }); - return Function('Time', 'date', "return '" + code + "'"); - }, - day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - zeroPad: function(n) { - if (n < 10) { - return "0" + n; - } else { - return n; - } - }, - formatters: { - a: function() { - return Time.day[this.getDay()].slice(0, 3); - }, - A: function() { - return Time.day[this.getDay()]; - }, - b: function() { - return Time.month[this.getMonth()].slice(0, 3); - }, - B: function() { - return Time.month[this.getMonth()]; - }, - d: function() { - return Time.zeroPad(this.getDate()); - }, - e: function() { - return this.getDate(); - }, - H: function() { - return Time.zeroPad(this.getHours()); - }, - I: function() { - return Time.zeroPad(this.getHours() % 12 || 12); - }, - k: function() { - return this.getHours(); - }, - l: function() { - return this.getHours() % 12 || 12; - }, - m: function() { - return Time.zeroPad(this.getMonth() + 1); - }, - M: function() { - return Time.zeroPad(this.getMinutes()); - }, - p: function() { - if (this.getHours() < 12) { - return 'AM'; - } else { - return 'PM'; - } - }, - P: function() { - if (this.getHours() < 12) { - return 'am'; - } else { - return 'pm'; - } - }, - S: function() { - return Time.zeroPad(this.getSeconds()); - }, - y: function() { - return this.getFullYear() - 2000; - } - } - }; - - Favicon = { - init: function() { - return $.ready(function() { - var href; - - Favicon.el = $('link[rel="shortcut icon"]', d.head); - Favicon.el.type = 'image/x-icon'; - href = Favicon.el.href; - Favicon.SFW = /ws\.ico$/.test(href); - Favicon["default"] = href; - return Favicon["switch"](); - }); - }, - "switch": function() { - var unreadDead; - - unreadDead = Favicon.unreadDeadY = Favicon.unreadSFW = Favicon.unreadSFWY = Favicon.unreadNSFW = Favicon.unreadNSFWY = 'data:image/png;base64,'; - switch (Conf['favicon']) { - case 'ferongr': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAS1BMVEUAAAAAAAAAAAAJAAASAAAZAQAaAQAiAQAkAQAoFBQyAgAzAgA1AgA4AABBAgBXAwBzBQCEBgGvCAG/AADoCwLpDAP/gID/q6v///9zILr8AAAAA3RSTlMAx9dmesIgAAAAc0lEQVQY02WPgQ6DIBBDmTqnbE70Cvb/v3TAnW5OSKB9ybXg3HUBOAmEEH4FQtrSn4gxi+xjVC9SVOEiSvbZI8zSV+/Xo7icnryZ15GObMxvtWUkB/VJW57kHU7fUcHStm8FkncGE/mwP6CGzq/eauHwvT7sWQt3gZLW+AAAAABJRU5ErkJggg=='; - Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///8AcH4AtswA2PJ55fKi6fIA1/FtpPADAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslw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ObMxvtWUmB/VJW0byDqfvqGBp20mB5J3Bi3zYH1BD38/eauHwvT7sEAt1Fb320QAAAABJRU5ErkJggg=='; - break; - case 'xat-': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEX9AAD8AAD/AAD+AADAExKKXl2CfHqLkZFub2yfaF3bZ2PzZGL/zs//iYr/AAASAAAGAAAAAAAAAAAAAADpOCseAAAADHRSTlP9MAcAATVYeprJ5O/MbzqoAAAAXklEQVQY03VPQQ7AIAgz8QAG4dL//3VVcVk2Vw4tDVQp9YVyMACIEkIxDEQEGjHFnBjCbPU5EXBfnBns6WRG1Wbuvbtb0z9jr6Qh2KGQenp2/+xpsFQnrePAuulz7QUTuwm5NnwmIAAAAABJRU5ErkJggg=='; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUBAAACAQELCQkPDQwgFBMzKilOSEdva2iEgoCReHOadXClamDIaWbxcG7+hIX+mpv+m5z+oqP+tLX+zc7//f3+9PT97Oz23t750NDbra3zwL87LCwAAAAGAABHAADPAAD/AABkWeLDAAAAHHRSTlO5/fTv8Na2n42lsMvi8v3+/v749OaITDsDAQABSG2w8gAAAGdJREFUCNdNjtEKgDAIRYVGCmsyqCe7q/3/V2azQfpwPehVyQCIMIt4YYTeO7LHKMiGlDIkuh2qofR6obUqhtc4F637XreU1h+m41gcJX/DHyJWXYHzkCMm+hd3a4GezLNr8PQA4bQHEXEQFRJP5NAAAAAASUVORK5CYII='; - Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEUAAAAAAAAAAAAAAABFRUdsa2yRjop4dXVpZ2tdcI9dfKdBirUzlMBHpdxSquRisfOs2/99xv8umMMAAABljCUFAAAAEHRSTlN7FwUAQVt6kZ2/zej59vTv0aAplgAAAGNJREFUGNNtj1EOwCAIQ5eYIPCD0v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fm1qj2RepFlu2VRkwzZlyTNatC5myzMAAAAOPREWAAAAHnRSTlP4/fz331IPBQIBAAECOly37/7+/v7XwpWktNDy+f7X56yoAAAAZElEQVQI102NwQ7AIAhDMdku3JwkIiaz//+VQ9FkcCgvpUAMoKpX9YEJYww0s7YG4iW9Lwl3QCSUZhZSHsHKslqXknPpRPpDypkmtr0cWBGntnseOeKgGd6UAr1Vj8vw9sKFmz+fERAp5vutHwAAAABJRU5ErkJggg=='; - break; - case 'Mayhem': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABIUlEQVQ4jZ2ScWuDMBDFgw4pIkU0WsoQkWAYIkXZH4N9/+/V3dmfXSrKYIFHwt17j8vdGWNMIkgFuaDgzgQnwRs4EQs5KdolUQtagRN0givEDBTEOjgtGs0Zq8F7cKqqusVxrMQLaDUWcjBSrXkn8gs51tpJSWLk9b3HUa0aNIL5gPBR1/V4kJvR7lTwl8GmAm1Gf9+c3S+89qBHa8502AsmSrtBaEBPbIbj0ah2madlNAPEccdgJDfAtWifBjqWKShRBT6KoiH8QlEUn/qt0CCjnNdmPUwmFWzj9Oe6LpKuZXcwqq88z78Pch3aZU3dPwwc2sWlfZKCW5tWluV8kGvXClLm6dYN4/aUqfCbnEOzNDGhGZbNargvxCzvMGfRJD8UaDVvgkzo6QAAAABJRU5ErkJggg=='; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABj0lEQVQ4y42TQUorQRCGv+oekpj43pOhOyIiKoHBxTMkuAnEtWcwx/AY3sUbBIRcwCw8gCfIMkaTOOUiNdgGRRuKoav+v2qq/i4BakBmXweUwDoxLF5ZhVkC64rYBHYMUAIvwKuBMEwdaFiCNbAAngEC0NHkxBi73vsOsG92HGPsphigY1wOzfNhqhpC6AEd730RQuh9hQEOAY6A/jeAs3a7/f+bWB84ckCpqg+I8Osjgqo+AKUDViJS8LkGMcY+sJrNZssYY387L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c3mzWzBUAAAC+SURBVBjTNY3pcsIwEIM3ePERx/bG5IIe0NIT0ur93w4nDLs/pPlGGlGltNG8IdpwMaoidlGSN8zGJ4mOyQqALtZ17IoRSw3meUYv0q+moTCtZrdbZQr3xAMsCdeW6r1SrnW09XmchjaE9vl0evJbUjZ2Q7+AI/BiVQEylkrO/TfwVgD7ZQ/jiA/g3TPptO7t9/gEfpImIw/wez7/iSEdMZcfBnwB16hJOcGEnFL+f70cnKKKbROa2tq6iOXqBuMXGTe4CAUbAAAAAElFTkSuQmCC'; - break; - case 'Original': - Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX/////AAD///8AAABBZmS3AAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; - Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAKAAAoAAAoKCg4AAA4ODg7OztMAACRAADBwcH/AAD///+WCcPSAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQmAUAxEb4Isk0rwp3EPR3ECcRQrh7C3/nAasPwzmCgYuPBy5AH/NALSImqAK+H1oJRqyJVHNAnZqDITVhj7/PrAciJ9il0BHs/jjU+fnB9sQ0IxX6OBO6Xr0xKAxANLZzUanCWzZQAAAABJRU5ErkJggg=='; - Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///8ul8P///8AAACaqgkzAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; - Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAABBQcHFx4KISoNLToaVW4oKCgul8M4ODg7OzvBwcH///8uS/CdAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWoftRGvdwBEewchM7d9BFbE6pbP4Mgj+R5MjjwgP+qQSkRtQAV8K3lVI2Q648oknIRpWZsMI4988HjgvpU+wO8HgeHzR9cjZYhoRiPkcDd0rXpyUAiRd5YjKC7MvNRgAAAABJRU5ErkJggg=='; - Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///9mzDP///8AAACT0n1lAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; - Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAECAIQIAgWLAsePA8oKCg4ODg6dB07OztmzDPBwcH///+rsf3XAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWofRL4x6O4AhuopWb2P4F7E5prP4MgiaSHHlceMA/jYC0iBrgSnjdKaUacuURTUI2qsyEFcaxvD6wnkifYleAx/N449Mn5wfbkFDM52jgTun6tAQg8QAEvjQg42KY2AAAAABJRU5ErkJggg=='; - } - if (Favicon.SFW) { - Favicon.unread = Favicon.unreadSFW; - return Favicon.unreadY = Favicon.unreadSFWY; - } else { - Favicon.unread = Favicon.unreadNSFW; - return Favicon.unreadY = Favicon.unreadNSFWY; - } - }, - empty: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX////b29sAAAAJ2DVhAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=', - dead: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX/////AAAAAACalQKRAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=' - }; - - ThreadExcerpt = { - init: function() { - if (g.VIEW !== 'thread' || !Conf['Thread Excerpt']) { - return; - } - return Thread.prototype.callbacks.push({ - name: 'Thread Excerpt', - cb: this.node - }); - }, - node: function() { - return d.title = Get.threadExcerpt(this); - } - }; - - ThreadStats = { - init: function() { - var html; - - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { - return; - } - html = '0 / 0'; - if (Conf['Thread Updater']) { - this.dialog = $.el('span', { - innerHTML: "[ " + html + " ]" - }); - } else { - this.dialog = UI.dialog('thread-stats', 'bottom: 0; left: 0;', "
" + html + "
"); - } - this.postCountEl = $('#post-count', this.dialog); - this.fileCountEl = $('#file-count', this.dialog); - return Thread.prototype.callbacks.push({ - name: 'Thread Stats', - cb: this.node - }); - }, - node: function() { - var ID, fileCount, post, postCount, _ref; - - postCount = 0; - fileCount = 0; - _ref = this.posts; - for (ID in _ref) { - post = _ref[ID]; - postCount++; - if (post.file) { - fileCount++; - } - } - ThreadStats.thread = this; - ThreadStats.update(postCount, fileCount); - $.on(d, 'ThreadUpdate', ThreadStats.onUpdate); - if (Conf['Thread Updater']) { - return $.asap((function() { - return $('.move', ThreadUpdater.dialog); - }), function() { - return $.prepend($('.move', ThreadUpdater.dialog), ThreadStats.dialog); - }); - } else { - return $.add(d.body, ThreadStats.dialog); - } - }, - onUpdate: function(e) { - var fileCount, postCount, _ref; - - if (e.detail[404]) { - return; - } - _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount; - return ThreadStats.update(postCount, fileCount); - }, - update: function(postCount, fileCount) { - var fileCountEl, postCountEl, thread; - - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; - postCountEl.textContent = postCount; - fileCountEl.textContent = fileCount; - (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning'); - return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning'); - } - }; - - ThreadUpdater = { - init: function() { - var checked, conf, html, name, _ref; - - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { - return; - } - html = ''; - _ref = Config.updater.checkbox; - for (name in _ref) { - conf = _ref[name]; - checked = Conf[name] ? 'checked' : ''; - html += "
"; - } - checked = Conf['Auto Update'] ? 'checked' : ''; - html = "
\n" + html + "\n
\n
\n
"; - this.dialog = UI.dialog('updater', 'bottom: 0; right: 0;', html); - this.timer = $('#update-timer', this.dialog); - this.status = $('#update-status', this.dialog); - this.checkPostCount = 0; - return Thread.prototype.callbacks.push({ - name: 'Thread Updater', - cb: this.node - }); - }, - node: function() { - var input, _i, _len, _ref; - - ThreadUpdater.thread = this; - ThreadUpdater.root = this.OP.nodes.root.parentNode; - ThreadUpdater.lastPost = +ThreadUpdater.root.lastElementChild.id.match(/\d+/)[0]; - ThreadUpdater.outdateCount = 0; - ThreadUpdater.lastModified = '0'; - _ref = $$('input', ThreadUpdater.dialog); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - input = _ref[_i]; - if (input.type === 'checkbox') { - $.on(input, 'change', $.cb.checked); - } - switch (input.name) { - case 'Scroll BG': - $.on(input, 'change', ThreadUpdater.cb.scrollBG); - ThreadUpdater.cb.scrollBG(); - break; - case 'Auto Update This': - $.on(input, 'change', ThreadUpdater.cb.autoUpdate); - $.event('change', null, input); - break; - case 'Interval': - $.on(input, 'change', ThreadUpdater.cb.interval); - ThreadUpdater.cb.interval.call(input); - break; - case 'Update': - $.on(input, 'click', ThreadUpdater.update); - } - } - $.on(window, 'online offline', ThreadUpdater.cb.online); - $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.post); - $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); - ThreadUpdater.cb.online(); - Rice.nodes(ThreadUpdater.dialog); - return $.add(d.body, ThreadUpdater.dialog); - }, - /* - http://freesound.org/people/pierrecartoons1979/sounds/90112/ - cc-by-nc-3.0 - */ - - beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', - cb: { - online: function() { - if (ThreadUpdater.online = navigator.onLine) { - ThreadUpdater.outdateCount = 0; - ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - if (Conf['Auto Update This']) { - ThreadUpdater.update(); - } - ThreadUpdater.set('status', null, null); - } else { - ThreadUpdater.set('timer', null); - ThreadUpdater.set('status', 'Offline', 'warning'); - } - return ThreadUpdater.cb.autoUpdate(); - }, - post: function(e) { - if (!(Conf['Auto Update This'] && e.detail.threadID === ThreadUpdater.thread.ID)) { - return; - } - ThreadUpdater.outdateCount = 0; - if (ThreadUpdater.seconds > 2) { - return setTimeout(ThreadUpdater.update, 1000); - } - }, - checkpost: function() { - if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 10)) { - return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500); - } - ThreadUpdater.checkPostCount = 0; - delete ThreadUpdater.foundPost; - return delete ThreadUpdater.postID; - }, - visibility: function() { - if (d.hidden) { - return; - } - ThreadUpdater.outdateCount = 0; - if (ThreadUpdater.seconds > ThreadUpdater.interval) { - return ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - } - }, - scrollBG: function() { - return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() { - return true; - } : function() { - return !d.hidden; - }; - }, - autoUpdate: function() { - if (Conf['Auto Update This'] && ThreadUpdater.online) { - return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); - } else { - return clearTimeout(ThreadUpdater.timeoutID); - } - }, - interval: function() { - var val; - - val = parseInt(this.value, 10); - ThreadUpdater.interval = this.value = val; - return $.cb.value.call(this); - }, - load: function() { - var klass, req, text, _ref; - - req = ThreadUpdater.req; - switch (req.status) { - case 200: - g.DEAD = false; - ThreadUpdater.parse(JSON.parse(req.response).posts); - ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified'); - ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - break; - case 404: - g.DEAD = true; - ThreadUpdater.set('timer', null); - ThreadUpdater.set('status', '404', 'warning'); - clearTimeout(ThreadUpdater.timeoutID); - ThreadUpdater.thread.kill(); - $.event('ThreadUpdate', { - 404: true, - thread: ThreadUpdater.thread - }); - break; - default: - ThreadUpdater.outdateCount++; - ThreadUpdater.set('timer', ThreadUpdater.getInterval()); - /* - Status Code 304: Not modified - By sending the `If-Modified-Since` header we get a proper status code, and no response. - This saves bandwidth for both the user and the servers and avoid unnecessary computation. - */ - - _ref = [0, 304].contains(req.status) ? [null, null] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1]; - ThreadUpdater.set('status', text, klass); - } - if (ThreadUpdater.postID) { - ThreadUpdater.cb.checkpost(this.status); - } - return delete ThreadUpdater.req; - } - }, - getInterval: function() { - var i, j; - - i = ThreadUpdater.interval; - j = Math.min(ThreadUpdater.outdateCount, 10); - if (!d.hidden) { - j = Math.min(j, 7); - } - return ThreadUpdater.seconds = Conf['Optional Increase'] ? Math.max(i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j]) : i; - }, - set: function(name, text, klass) { - var el, node; - - el = ThreadUpdater[name]; - if (node = el.firstChild) { - node.data = text; - } else { - el.textContent = text; - } - if (klass !== void 0) { - return el.className = klass; - } - }, - timeout: function() { - var n; - - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); - if (!(n = --ThreadUpdater.seconds)) { - return ThreadUpdater.update(); - } else if (n <= -60) { - ThreadUpdater.set('status', 'Retrying', null); - return ThreadUpdater.update(); - } else if (n > 0) { - return ThreadUpdater.set('timer', n); - } - }, - update: function() { - var url; - - if (!ThreadUpdater.online) { - return; - } - ThreadUpdater.seconds = 0; - ThreadUpdater.set('timer', '...'); - if (ThreadUpdater.req) { - ThreadUpdater.req.onloadend = null; - ThreadUpdater.req.abort(); - } - url = "//api.4chan.org/" + ThreadUpdater.thread.board + "/res/" + ThreadUpdater.thread + ".json"; - return ThreadUpdater.req = $.ajax(url, { - onloadend: ThreadUpdater.cb.load - }, { - headers: { - 'If-Modified-Since': ThreadUpdater.lastModified - } - }); - }, - updateThreadStatus: function(title, OP) { - var icon, message, root, titleLC; - - titleLC = title.toLowerCase(); - if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { - return; - } - if (!(ThreadUpdater.thread["is" + title] = !!OP[titleLC])) { - message = title === 'Sticky' ? 'The thread is not a sticky anymore.' : 'The thread is not closed anymore.'; - new Notification('info', message, 30); - $.rm($("." + titleLC + "Icon", ThreadUpdater.thread.OP.nodes.info)); - return; - } - message = title === 'Sticky' ? 'The thread is now a sticky.' : 'The thread is now closed.'; - new Notification('info', message, 30); - icon = $.el('img', { - src: "//static.4chan.org/image/" + titleLC + ".gif", - alt: title, - title: title, - className: "" + titleLC + "Icon" - }); - root = $('[title="Quote this post"]', ThreadUpdater.thread.OP.nodes.info); - if (title === 'Closed') { - root = $('.stickyIcon', ThreadUpdater.thread.OP.nodes.info) || root; - } - return $.after(root, [$.tn(' '), icon]); - }, - parse: function(postObjects) { - var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, scroll, _i, _len, _ref; - - OP = postObjects[0]; - Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; - ThreadUpdater.updateThreadStatus('Sticky', OP); - ThreadUpdater.updateThreadStatus('Closed', OP); - ThreadUpdater.thread.postLimit = !!OP.bumplimit; - ThreadUpdater.thread.fileLimit = !!OP.imagelimit; - posts = []; - index = []; - files = []; - count = 0; - for (_i = 0, _len = postObjects.length; _i < _len; _i++) { - postObject = postObjects[_i]; - num = postObject.no; - index.push(num); - if (postObject.fsize) { - files.push(num); - } - if (num <= ThreadUpdater.lastPost) { - continue; - } - count++; - node = Build.postFromObject(postObject, ThreadUpdater.thread.board); - posts.push(new Post(node, ThreadUpdater.thread, ThreadUpdater.thread.board)); - } - deletedPosts = []; - deletedFiles = []; - _ref = ThreadUpdater.thread.posts; - for (ID in _ref) { - post = _ref[ID]; - ID = +ID; - if (post.isDead && index.contains(ID)) { - post.resurrect(); - } else if (!index.contains(ID)) { - post.kill(); - deletedPosts.push(post); - } else if (post.file && !post.file.isDead && !files.contains(ID)) { - post.kill(true); - deletedFiles.push(post); - } - if (ThreadUpdater.postID) { - if (ID === ThreadUpdater.postID) { - ThreadUpdater.foundPost = true; - } - } - } - if (!count) { - ThreadUpdater.set('status', null, null); - ThreadUpdater.outdateCount++; - } else { - ThreadUpdater.set('status', "+" + count, 'new'); - ThreadUpdater.outdateCount = 0; - if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) { - if (!ThreadUpdater.audio) { - ThreadUpdater.audio = $.el('audio', { - src: ThreadUpdater.beep - }); - } - ThreadUpdater.audio.play(); - } - ThreadUpdater.lastPost = posts[count - 1].ID; - Main.callbackNodes(Post, posts); - scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; - for (key in posts) { - post = posts[key]; - if (!posts.hasOwnProperty(key)) { - continue; - } - if (post.cb) { - if (!post.cb.call(post)) { - $.add(ThreadUpdater.root, post.nodes.root); - } - } else { - $.add(ThreadUpdater.root, post.nodes.root); - } - } - if (scroll) { - if (Conf['Bottom Scroll']) { - d.body.scrollTop = d.body.clientHeight; - } else { - Header.scrollToPost(nodes[0]); - } - } - $.queueTask(function() { - var length, threadID; - - threadID = ThreadUpdater.thread.ID; - length = $$('.thread > .postContainer', ThreadUpdater.root).length; - return Fourchan.parseThread(threadID, length - count, length); - }); - } - return $.event('ThreadUpdate', { - 404: false, - thread: ThreadUpdater.thread, - newPosts: posts, - deletedPosts: deletedPosts, - deletedFiles: deletedFiles, - postCount: OP.replies + 1, - fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead) - }); - } - }; - - ThreadWatcher = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Thread Watcher']) { - return; - } - this.dialog = UI.dialog('watcher', 'top: 50px; left: 0px;', '
Thread Watcher
'); - $.on(d, 'QRPostSuccessful', this.cb.post); - $.on(d, '4chanXInitFinished', this.ready); - $.sync('WatchedThreads', this.refresh); - return Thread.prototype.callbacks.push({ - name: 'Thread Watcher', - cb: this.node - }); - }, - node: function() { - var favicon, - _this = this; - - favicon = $.el('img', { - className: 'favicon' - }); - $.on(favicon, 'click', ThreadWatcher.cb.toggle); - $.before($('input', this.OP.nodes.post), favicon); - if (g.VIEW !== 'thread') { - return; - } - return $.get('AutoWatch', 0, function(item) { - if (item['AutoWatch'] !== _this.ID) { - return; - } - ThreadWatcher.watch(_this); - return $["delete"]('AutoWatch'); - }); - }, - ready: function() { - $.off(d, '4chanXInitFinished', ThreadWatcher.ready); - if (!Main.isThisPageLegit()) { - return; - } - ThreadWatcher.refresh(); - return $.add(d.body, ThreadWatcher.dialog); - }, - refresh: function(watched) { - var ID, board, div, favicon, id, link, nodes, props, thread, x, _ref, _ref1; - - if (!watched) { - $.get('WatchedThreads', {}, function(item) { - return ThreadWatcher.refresh(item['WatchedThreads']); - }); - return; - } - nodes = [$('.move', ThreadWatcher.dialog)]; - for (board in watched) { - _ref = watched[board]; - for (id in _ref) { - props = _ref[id]; - x = $.el('a', { - textContent: '×', - href: 'javascript:;' - }); - $.on(x, 'click', ThreadWatcher.cb.x); - link = $.el('a', props); - link.title = link.textContent; - div = $.el('div'); - $.add(div, [x, $.tn(' '), link]); - nodes.push(div); - } - } - $.rmAll(ThreadWatcher.dialog); - $.add(ThreadWatcher.dialog, nodes); - watched = watched[g.BOARD] || {}; - _ref1 = g.BOARD.threads; - for (ID in _ref1) { - thread = _ref1[ID]; - favicon = $('.favicon', thread.OP.nodes.post); - favicon.src = ID in watched ? Favicon["default"] : Favicon.empty; - } - }, - cb: { - toggle: function() { - return ThreadWatcher.toggle(Get.postFromNode(this).thread); - }, - x: function() { - var thread; - - thread = this.nextElementSibling.pathname.split('/'); - return ThreadWatcher.unwatch(thread[1], thread[3]); - }, - post: function(e) { - var board, postID, threadID, _ref; - - _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; - if (postID === threadID) { - if (Conf['Auto Watch']) { - return $.set('AutoWatch', threadID); - } - } else if (Conf['Auto Watch Reply']) { - return ThreadWatcher.watch(board.threads[threadID]); - } - } - }, - toggle: function(thread) { - if ($('.favicon', thread.OP.nodes.post).src === Favicon.empty) { - return ThreadWatcher.watch(thread); - } else { - return ThreadWatcher.unwatch(thread.board, thread.ID); - } - }, - unwatch: function(board, threadID) { - return $.get('WatchedThreads', {}, function(item) { - var watched; - - watched = item['WatchedThreads']; - delete watched[board][threadID]; - if (!Object.keys(watched[board]).length) { - delete watched[board]; - } - ThreadWatcher.refresh(watched); - return $.set('WatchedThreads', watched); - }); - }, - watch: function(thread) { - return $.get('WatchedThreads', {}, function(item) { - var watched, _name; - - watched = item['WatchedThreads']; - watched[_name = thread.board] || (watched[_name] = {}); - watched[thread.board][thread] = { - href: "/" + thread.board + "/res/" + thread, - textContent: Get.threadExcerpt(thread) - }; - ThreadWatcher.refresh(watched); - return $.set('WatchedThreads', watched); - }); - } - }; - - Unread = { - init: function() { - if (g.VIEW !== 'thread' || !Conf['Unread Count'] && !Conf['Unread Favicon']) { - return; - } - this.db = new DataBoard('lastReadPosts', this.sync); - this.hr = $.el('hr', { - id: 'unread-line' - }); - this.posts = []; - this.postsQuotingYou = []; - return Thread.prototype.callbacks.push({ - name: 'Unread', - cb: this.node - }); - }, - node: function() { - var ID, post, posts, _ref; - - Unread.thread = this; - Unread.title = d.title; - posts = []; - _ref = this.posts; - for (ID in _ref) { - post = _ref[ID]; - if (post.isReply) { - posts.push(post); - } - } - Unread.lastReadPost = Unread.db.get({ - boardID: this.board.ID, - threadID: this.ID, - defaultValue: 0 - }); - Unread.addPosts(posts); - $.on(d, 'ThreadUpdate', Unread.onUpdate); - $.on(d, 'scroll visibilitychange', Unread.read); - if (Conf['Unread Line']) { - $.on(d, 'visibilitychange', Unread.setLine); - } - if (!Conf['Scroll to Last Read Post']) { - return; - } - return $.on(window, 'load', function() { - var hash, root; - - if ((hash = location.hash.match(/\d+/)) && hash[0] in this.posts) { - return; - } - if (Unread.posts.length) { - while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) { - if (!(Get.postFromRoot(root)).isHidden) { - break; - } - } - if (!root) { - return; - } - return root.scrollIntoView(false); - } else if (posts.length) { - return Header.scrollToPost(posts[posts.length - 1].nodes.root); - } - }); - }, - sync: function() { - var lastReadPost; - - lastReadPost = Unread.db.get({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - defaultValue: 0 - }); - if (!(Unread.lastReadPost < lastReadPost)) { - return; - } - Unread.lastReadPost = lastReadPost; - Unread.readArray(Unread.posts); - Unread.readArray(Unread.postsQuotingYou); - Unread.setLine(); - return Unread.update(); - }, - addPosts: function(newPosts) { - var ID, data, post, _i, _len; - - for (_i = 0, _len = newPosts.length; _i < _len; _i++) { - post = newPosts[_i]; - ID = post.ID; - if (ID <= Unread.lastReadPost || post.isHidden) { - continue; - } - if (QR.db) { - data = { - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }; - if (QR.db.get(data)) { - continue; - } - } - Unread.posts.push(post); - Unread.addPostQuotingYou(post); - } - if (Conf['Unread Line']) { - Unread.setLine(newPosts.contains(Unread.posts[0])); - } - Unread.read(); - return Unread.update(); - }, - addPostQuotingYou: function(post) { - var quotelink, _i, _len, _ref; - - if (!QR.db) { - return; - } - _ref = post.nodes.quotelinks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quotelink = _ref[_i]; - if (QR.db.get(Get.postDataFromLink(quotelink))) { - Unread.postsQuotingYou.push(post); - } - } - }, - onUpdate: function(e) { - if (e.detail[404]) { - return Unread.update(); - } else { - return Unread.addPosts(e.detail.newPosts); - } - }, - readSinglePost: function(post) { - var i; - - if ((i = Unread.posts.indexOf(post)) === -1) { - return; - } - Unread.posts.splice(i, 1); - if (i === 0) { - Unread.lastReadPost = post.ID; - Unread.saveLastReadPost(); - } - if ((i = Unread.postsQuotingYou.indexOf(post)) !== -1) { - Unread.postsQuotingYou.splice(i, 1); - } - return Unread.update(); - }, - readArray: function(arr) { - var i, post, _i, _len; - - for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { - post = arr[i]; - if (post.ID > Unread.lastReadPost) { - break; - } - } - return arr.splice(0, i); - }, - read: $.debounce(50, function(e) { - var ID, bottom, height, i, post, posts, read; - - if (d.hidden || !Unread.posts.length) { - return; - } - height = doc.clientHeight; - posts = Unread.posts; - read = []; - i = posts.length; - while (post = posts[--i]) { - bottom = post.nodes.root.getBoundingClientRect().bottom; - if (bottom < height) { - ID = post.ID; - posts.remove(post); - } - } - if (!ID) { - return; - } - Unread.lastReadPost = ID; - Unread.saveLastReadPost(); - Unread.readArray(Unread.postsQuotingYou); - if (e) { - return Unread.update(); - } - }), - saveLastReadPost: $.debounce(2 * $.SECOND, function() { - return Unread.db.set({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - val: Unread.lastReadPost - }); - }), - setLine: function(force) { - var post, root; - - if (!(d.hidden || force === true)) { - return; - } - if (post = Unread.posts[0]) { - root = post.nodes.root; - if (root !== $('.thread > .replyContainer', root.parentNode)) { - return $.before(root, Unread.hr); - } - } else { - return $.rm(Unread.hr); - } - }, - update: function(dontrepeat) { - var count; - - count = Unread.posts.length; - if (Conf['Unread Count']) { - d.title = "" + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); - if (!dontrepeat) { - setTimeout(function() { - d.title = ''; - return Unread.update(true); - }, $.SECOND); - } - } - if (!Conf['Unread Favicon']) { - return; - } - return Favicon.el.href = g.DEAD ? Unread.postsQuotingYou.length ? Favicon.unreadDeadY : count ? Favicon.unreadDead : Favicon.dead : count ? Unread.postsQuotingYou.length ? Favicon.unreadY : Favicon.unread : Favicon["default"]; - } - }; - QR = { init: function() { var sc; @@ -8799,14 +6622,16 @@ return $.addClass(doc, 'hide-original-post-form'); }); } - $.on(d, '4chanXInitFinished', this.initReady); + $.ready(this.initReady); + if (Conf['Persistent QR']) { + $.on(d, '4chanXInitFinished', this.persist); + } return Post.prototype.callbacks.push({ name: 'Quick Reply', cb: this.node }); }, initReady: function() { - $.off(d, '4chanXInitFinished', QR.initReady); QR.postingIsEnabled = !!$.id('postForm'); if (!QR.postingIsEnabled) { return; @@ -8827,23 +6652,20 @@ $.on(d, 'dragover', QR.dragOver); $.on(d, 'drop', QR.dropFile); $.on(d, 'dragstart dragend', QR.drag); - $.on(d, 'ThreadUpdate', function() { + return $.on(d, 'ThreadUpdate', function() { if (g.DEAD) { return QR.abort(); } else { return QR.status(); } }); - if (Conf['Persistent QR']) { - return QR.persist(); - } }, node: function() { return $.on($('a[title="Quote this post"]', this.nodes.info), 'click', QR.quote); }, persist: function() { QR.open(); - if (Conf['Auto-Hide QR']) { + if (Conf['Auto Hide QR']) { return QR.hide(); } }, @@ -9080,7 +6902,7 @@ elapsed = Math.floor((now - start) / $.SECOND); if (elapsed >= 0) { seconds = Math.max(seconds, types[type] - elapsed); - if (hasFile && upSpd) { + if (Conf['Cooldown Prediction'] && hasFile && upSpd) { seconds -= Math.floor(post.file.size / upSpd * upSpdAccuracy); seconds = Math.max(seconds, 0); } @@ -9762,7 +7584,7 @@ dialog: function() { var dialog, mimeTypes, name, nodes, thread, _i, _len, _ref; - dialog = UI.dialog('qr', 'top:0;right:0;', "
\n Post Form\n ×\n
\n
\n
\n \n \n \n \n
\n
\n \n \n
\n
\n
\n +\n
\n
\n \n No selected file\n \n ×\n \n \n
\n \n
\n \n
\n \n
".replace(/>\s+<')); + dialog = UI.dialog('qr', 'top:0;right:0;', "
Post Form\n×
No selected file×
"); QR.nodes = nodes = { el: dialog, move: $('.move', dialog), @@ -9928,7 +7750,7 @@ } QR.cleanNotifications(); QR.cooldown.auto = QR.posts.length > 1; - if (Conf['Auto-Hide QR'] && !QR.cooldown.auto) { + if (Conf['Auto Hide QR'] && !QR.cooldown.auto) { QR.hide(); } if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) { @@ -9958,7 +7780,7 @@ QR.cooldown.auto = false; QR.status(); return QR.error($.el('span', { - innerHTML: 'Connection error. You may have been banned.' + innerHTML: "Connection error. You may have been banned.\n[FAQ]" })); } }; @@ -10093,613 +7915,1863 @@ } }; - QuoteBacklink = { + FappeTyme = { init: function() { - var format; + var el; - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { + if (!Conf['Fappe Tyme'] && (g.VIEW === 'catalog' || g.BOARD === 'f')) { return; } - format = Conf['backlink'].replace(/%id/g, "' + id + '"); - this.funk = Function('id', "return '" + format + "'"); - this.containers = {}; - Post.prototype.callbacks.push({ - name: 'Quote Backlinking Part 1', - cb: this.firstNode + el = $.el('a', { + href: 'javascript:;', + id: 'fappeTyme', + title: 'Fappe Tyme' + }); + $.on(el, 'click', FappeTyme.toggle); + $.asap((function() { + return $.id('boardNavMobile'); + }), function() { + return $.add($.id('navtopright'), el); }); return Post.prototype.callbacks.push({ - name: 'Quote Backlinking Part 2', - cb: this.secondNode + name: 'Fappe Tyme', + cb: this.node }); }, - firstNode: function() { - var a, clone, container, containers, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; + node: function() { + if (this.file) { + return; + } + return $.addClass(this.nodes.root, "noFile"); + }, + toggle: function() { + return $.toggleClass(doc, 'fappeTyme'); + } + }; - if (this.isClone || !this.quotes.length) { + ImageExpand = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + return; + } + this.EAI = $.el('a', { + id: 'img-controls', + className: 'expand-all-shortcut', + title: 'Expand All Images', + href: 'javascript:;' + }); + $.on(this.EAI, 'click', ImageExpand.cb.toggleAll); + Post.prototype.callbacks.push({ + name: 'Image Expansion', + cb: this.node + }); + return $.asap((function() { + return $.id('delform'); + }), function() { + return $.prepend($.id('delform'), ImageExpand.EAI); + }); + }, + node: function() { + var thumb, _ref; + + if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + return; + } + thumb = this.file.thumb; + $.on(thumb.parentNode, 'click', ImageExpand.cb.toggle); + if (this.isClone && $.hasClass(thumb, 'expanding')) { + ImageExpand.contract(this); + ImageExpand.expand(this); + return; + } + if (ImageExpand.on && !this.isHidden) { + return ImageExpand.expand(this); + } + }, + cb: { + toggle: function(e) { + if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { + return; + } + e.preventDefault(); + return ImageExpand.toggle(Get.postFromNode(this)); + }, + toggleAll: function() { + var ID, file, func, post, _i, _len, _ref, _ref1; + + $.event('CloseMenu'); + if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { + ImageExpand.EAI.className = 'contract-all-shortcut'; + ImageExpand.EAI.title = 'Contract All Images'; + func = ImageExpand.expand; + } else { + ImageExpand.EAI.className = 'expand-all-shortcut'; + ImageExpand.EAI.title = 'Expand All Images'; + func = ImageExpand.contract; + } + _ref = g.posts; + for (ID in _ref) { + post = _ref[ID]; + _ref1 = [post].concat(post.clones); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + post = _ref1[_i]; + file = post.file; + if (!(file && file.isImage && doc.contains(post.nodes.root))) { + continue; + } + if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && file.thumb.getBoundingClientRect().top < 0)) { + continue; + } + $.queueTask(func, post); + } + } + }, + setFitness: function() { + var checked; + + checked = this.checked; + (checked ? $.addClass : $.rmClass)(doc, this.name.toLowerCase().replace(/\s+/g, '-')); + if (this.name !== 'Fit height') { + return; + } + if (checked) { + $.on(window, 'resize', ImageExpand.resize); + if (!ImageExpand.style) { + ImageExpand.style = $.addStyle(null); + } + return ImageExpand.resize(); + } else { + return $.off(window, 'resize', ImageExpand.resize); + } + } + }, + toggle: function(post) { + var headRect, rect, root, thumb, top; + + thumb = post.file.thumb; + if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { + ImageExpand.expand(post); + return; + } + ImageExpand.contract(post); + rect = post.nodes.root.getBoundingClientRect(); + if (!(rect.top <= 0 || rect.left <= 0)) { + return; + } + top = rect.top; + if (Conf['Fixed Header'] && !Conf['Bottom Header']) { + headRect = Header.bar.getBoundingClientRect(); + top += -headRect.top - headRect.height; + } + root = d.body; + if (rect.top < 0) { + root.scrollTop += top; + } + if (rect.left < 0) { + return root.scrollLeft = 0; + } + }, + contract: function(post) { + $.rmClass(post.nodes.root, 'expanded-image'); + $.rmClass(post.file.thumb, 'expanding'); + return post.file.isExpanded = false; + }, + expand: function(post, src) { + var img, thumb; + + thumb = post.file.thumb; + if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { + return; + } + $.addClass(thumb, 'expanding'); + if (post.file.fullImage) { + $.asap((function() { + return post.file.fullImage.naturalHeight; + }), function() { + return ImageExpand.completeExpand(post); + }); + return; + } + post.file.fullImage = img = $.el('img', { + className: 'full-image', + src: src || post.file.URL + }); + $.on(img, 'error', ImageExpand.error); + $.asap((function() { + return post.file.fullImage.naturalHeight; + }), function() { + return ImageExpand.completeExpand(post); + }); + return $.after(thumb, img); + }, + completeExpand: function(post) { + var prev, thumb; + + thumb = post.file.thumb; + if (!$.hasClass(thumb, 'expanding')) { + return; + } + post.file.isExpanded = true; + if (!post.nodes.root.parentNode) { + $.addClass(post.nodes.root, 'expanded-image'); + $.rmClass(post.file.thumb, 'expanding'); + return; + } + prev = post.nodes.root.getBoundingClientRect(); + return $.queueTask(function() { + var curr, root; + + $.addClass(post.nodes.root, 'expanded-image'); + $.rmClass(post.file.thumb, 'expanding'); + if (!(prev.top + prev.height <= 0)) { + return; + } + root = d.body; + curr = post.nodes.root.getBoundingClientRect(); + return root.scrollTop += curr.height - prev.height + curr.top - prev.top; + }); + }, + error: function() { + var URL, post, src, timeoutID; + + post = Get.postFromNode(this); + $.rm(this); + delete post.file.fullImage; + if (!($.hasClass(post.file.thumb, 'expanding') || $.hasClass(post.nodes.root, 'expanded-image'))) { + return; + } + ImageExpand.contract(post); + src = this.src.split('/'); + if (src[2] === 'images.4chan.org') { + if (URL = Redirect.image(src[3], src[5])) { + setTimeout(ImageExpand.expand, 10000, post, URL); + return; + } + if (g.DEAD || post.isDead || post.file.isDead) { + return; + } + } + timeoutID = setTimeout(ImageExpand.expand, 10000, post); + return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { + onload: function() { + var postObj, _i, _len, _ref; + + if (this.status !== 200) { + return; + } + _ref = JSON.parse(this.response).posts; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + postObj = _ref[_i]; + if (postObj.no === post.ID) { + break; + } + } + if (postObj.no !== post.ID) { + clearTimeout(timeoutID); + return post.kill(); + } else if (postObj.filedeleted) { + clearTimeout(timeoutID); + return post.kill(true); + } + } + }); + }, + menu: { + init: function() { + var conf, createSubEntry, el, key, subEntries, _ref; + + if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + return; + } + el = $.el('span', { + textContent: 'Image Expansion', + className: 'image-expansion-link' + }); + createSubEntry = ImageExpand.menu.createSubEntry; + subEntries = []; + _ref = Config.imageExpansion; + for (key in _ref) { + conf = _ref[key]; + subEntries.push(createSubEntry(key, conf)); + } + return $.event('AddMenuEntry', { + type: 'header', + el: el, + order: 105, + subEntries: subEntries + }); + }, + createSubEntry: function(type, config) { + var input, label; + + label = $.el('label', { + innerHTML: " " + type + }); + input = label.firstElementChild; + if (type === 'Fit width' || type === 'Fit height') { + $.on(input, 'change', ImageExpand.cb.setFitness); + } + if (config) { + label.title = config[1]; + input.checked = Conf[type]; + $.event('change', null, input); + $.on(input, 'change', $.cb.checked); + } + return { + el: label + }; + } + }, + resize: function() { + return ImageExpand.style.textContent = ":root.fit-height .full-image {max-height:" + doc.clientHeight + "px}"; + }, + menuToggle: function(e) { + return ImageExpand.opmenu.toggle(e, this, g); + } + }; + + ImageHover = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Image Hover']) { + return; + } + return Post.prototype.callbacks.push({ + name: 'Image Hover', + cb: this.node + }); + }, + node: function() { + var _ref; + + if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { + return; + } + return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover); + }, + mouseover: function(e) { + var el, post; + + post = Get.postFromNode(this); + el = $.el('img', { + id: 'ihover', + src: post.file.URL + }); + el.setAttribute('data-fullid', post.fullID); + $.add(Header.hover, el); + UI.hover({ + root: this, + el: el, + latestEvent: e, + endEvents: 'mouseout click', + asapTest: function() { + return el.naturalHeight; + } + }); + return $.on(el, 'error', ImageHover.error); + }, + error: function() { + var URL, post, src, timeoutID, + _this = this; + + if (!doc.contains(this)) { + return; + } + post = g.posts[this.dataset.fullid]; + src = this.src.split('/'); + if (src[2] === 'images.4chan.org') { + if (URL = Redirect.image(src[3], src[5].replace(/\?.+$/, ''))) { + this.src = URL; + return; + } + if (g.DEAD || post.isDead || post.file.isDead) { + return; + } + } + timeoutID = setTimeout((function() { + return _this.src = post.file.URL + '?' + Date.now(); + }), 3000); + return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { + onload: function() { + var postObj, _i, _len, _ref; + + if (this.status !== 200) { + return; + } + _ref = JSON.parse(this.response).posts; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + postObj = _ref[_i]; + if (postObj.no === post.ID) { + break; + } + } + if (postObj.no !== post.ID) { + clearTimeout(timeoutID); + return post.kill(); + } else if (postObj.filedeleted) { + clearTimeout(timeoutID); + return post.kill(true); + } + } + }); + } + }; + + ImageReplace = { + init: function() { + if (g.VIEW === 'catalog') { + return; + } + return Post.prototype.callbacks.push({ + name: 'Image Replace', + cb: this.node + }); + }, + node: function() { + var URL, img, style, thumb, type, _ref, _ref1; + + if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { + return; + } + _ref1 = this.file, thumb = _ref1.thumb, URL = _ref1.URL; + if (!(Conf["Replace " + ((type = (URL.match(/\w{3}$/))[0].toUpperCase()) === 'PEG' ? 'JPG' : type)] && !/spoiler/.test(thumb.src))) { + return; + } + if (this.file.isSpoiler) { + style = thumb.style; + style.maxHeight = style.maxWidth = this.isReply ? '125px' : '250px'; + } + img = $.el('img'); + $.on(img, 'load', function() { + return thumb.src = URL; + }); + return img.src = URL; + } + }; + + RevealSpoilers = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Reveal Spoilers']) { + return; + } + return Post.prototype.callbacks.push({ + name: 'Reveal Spoilers', + cb: this.node + }); + }, + node: function() { + var thumb, _ref; + + if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { + return; + } + thumb = this.file.thumb; + thumb.removeAttribute('style'); + return thumb.src = this.file.thumbURL; + } + }; + + ArchiveLink = { + init: function() { + var div, entry, type, _i, _len, _ref; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { + return; + } + div = $.el('div', { + textContent: 'Archive' + }); + entry = { + type: 'post', + el: div, + order: 90, + open: function(_arg) { + var ID, board, redirect, thread; + + ID = _arg.ID, thread = _arg.thread, board = _arg.board; + redirect = Redirect.to({ + postID: ID, + threadID: thread.ID, + boardID: board.ID + }); + return redirect !== ("//boards.4chan.org/" + board + "/"); + }, + subEntries: [] + }; + _ref = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['E-mail', 'email'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + type = _ref[_i]; + entry.subEntries.push(this.createSubEntry(type[0], type[1])); + } + return $.event('AddMenuEntry', entry); + }, + createSubEntry: function(text, type) { + var el, open; + + el = $.el('a', { + textContent: text, + target: '_blank' + }); + open = type === 'post' ? function(_arg) { + var ID, board, thread; + + ID = _arg.ID, thread = _arg.thread, board = _arg.board; + el.href = Redirect.to({ + postID: ID, + threadID: thread.ID, + boardID: board.ID + }); + return true; + } : function(post) { + var value; + + value = Filter[type](post); + if (!value) { + return false; + } + el.href = Redirect.to({ + boardID: post.board.ID, + type: type, + value: value, + isSearch: true + }); + return true; + }; + return { + el: el, + open: open + }; + } + }; + + DeleteLink = { + init: function() { + var div, fileEl, fileEntry, postEl, postEntry; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { + return; + } + div = $.el('div', { + className: 'delete-link', + textContent: 'Delete' + }); + postEl = $.el('a', { + className: 'delete-post', + href: 'javascript:;' + }); + fileEl = $.el('a', { + className: 'delete-file', + href: 'javascript:;' + }); + postEntry = { + el: postEl, + open: function() { + postEl.textContent = 'Post'; + $.on(postEl, 'click', DeleteLink["delete"]); + return true; + } + }; + fileEntry = { + el: fileEl, + open: function(_arg) { + var file; + + file = _arg.file; + if (!file || file.isDead) { + return false; + } + fileEl.textContent = 'File'; + $.on(fileEl, 'click', DeleteLink["delete"]); + return true; + } + }; + return $.event('AddMenuEntry', { + type: 'post', + el: div, + order: 40, + open: function(post) { + var node; + + if (post.isDead) { + return false; + } + DeleteLink.post = post; + node = div.firstChild; + node.textContent = 'Delete'; + DeleteLink.cooldown.start(post, node); + return true; + }, + subEntries: [postEntry, fileEntry] + }); + }, + "delete": function() { + var fileOnly, form, link, m, post, pwd; + + post = DeleteLink.post; + if (DeleteLink.cooldown.counting === post) { + return; + } + $.off(this, 'click', DeleteLink["delete"]); + this.textContent = "Deleting " + this.textContent + "..."; + pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $.id('delPassword').value; + fileOnly = $.hasClass(this, 'delete-file'); + form = { + mode: 'usrdel', + onlyimgdel: fileOnly, + pwd: pwd + }; + form[post.ID] = 'delete'; + link = this; + return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), { + onload: function() { + return DeleteLink.load(link, post, fileOnly, this.response); + }, + onerror: function() { + return DeleteLink.error(link); + } + }, { + cred: true, + form: $.formData(form) + }); + }, + load: function(link, post, fileOnly, html) { + var msg, s, tmpDoc; + + tmpDoc = d.implementation.createHTMLDocument(''); + tmpDoc.documentElement.innerHTML = html; + if (tmpDoc.title === '4chan - Banned') { + s = 'Banned!'; + } else if (msg = tmpDoc.getElementById('errmsg')) { + s = msg.textContent; + $.on(link, 'click', DeleteLink["delete"]); + } else { + if (tmpDoc.title === 'Updating index...') { + (post.origin || post).kill(fileOnly); + } + s = 'Deleted'; + } + return link.textContent = s; + }, + error: function(link) { + link.textContent = 'Connection error, please retry.'; + return $.on(link, 'click', DeleteLink["delete"]); + }, + cooldown: { + start: function(post, node) { + var length, seconds, _ref; + + if (!((_ref = QR.db) != null ? _ref.get({ + boardID: post.board.ID, + threadID: post.thread.ID, + postID: post.ID + }) : void 0)) { + delete DeleteLink.cooldown.counting; + return; + } + DeleteLink.cooldown.counting = post; + length = post.board.ID === 'q' ? 600 : 30; + seconds = Math.ceil((length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND); + return DeleteLink.cooldown.count(post, seconds, length, node); + }, + count: function(post, seconds, length, node) { + if (DeleteLink.cooldown.counting !== post) { + return; + } + if (!((0 <= seconds && seconds <= length))) { + if (DeleteLink.cooldown.counting === post) { + node.textContent = 'Delete'; + delete DeleteLink.cooldown.counting; + } + return; + } + setTimeout(DeleteLink.cooldown.count, 1000, post, seconds - 1, length, node); + return node.textContent = "Delete (" + seconds + ")"; + } + } + }; + + DownloadLink = { + init: function() { + var a; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { return; } a = $.el('a', { - href: "/" + this.board + "/res/" + this.thread + "#p" + this, - className: this.isHidden ? 'filtered backlink' : 'backlink', - textContent: (QuoteBacklink.funk(this.ID)) + (Conf['Mark Quotes of You'] && this.info.yours ? QuoteYou.text : '') + className: 'download-link', + textContent: 'Download file' }); - _ref = this.quotes; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; - containers = [QuoteBacklink.getContainer(quote)]; - if ((post = g.posts[quote]) && post.nodes.backlinkContainer) { - _ref1 = post.clones; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - clone = _ref1[_j]; - containers.push(clone.nodes.backlinkContainer); - } - } - for (_k = 0, _len2 = containers.length; _k < _len2; _k++) { - container = containers[_k]; - link = a.cloneNode(true); - if (Conf['Quote Previewing']) { - $.on(link, 'mouseover', QuotePreview.mouseover); - } - if (Conf['Quote Inlining']) { - $.on(link, 'click', QuoteInline.toggle); - } - $.add(container, [$.tn(' '), link]); - } - } - }, - secondNode: function() { - var container; + return $.event('AddMenuEntry', { + type: 'post', + el: a, + order: 70, + open: function(_arg) { + var file; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { - this.nodes.backlinkContainer = $('.container', this.nodes.info); - return; - } - if (!(this.isReply || Conf['OP Backlinks'])) { - return; - } - container = QuoteBacklink.getContainer(this.fullID); - this.nodes.backlinkContainer = container; - return $.add(this.nodes.info, container); - }, - getContainer: function(id) { - var _base; - - return (_base = this.containers)[id] || (_base[id] = $.el('span', { - className: 'container' - })); + file = _arg.file; + if (!file) { + return false; + } + a.href = file.URL; + a.download = file.name; + return true; + } + }); } }; - QuoteCT = { + Menu = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark Cross-thread Quotes']) { + if (g.VIEW === 'catalog' || !Conf['Menu']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.text = '\u00A0(Cross-thread)'; + this.menu = new UI.Menu('post'); return Post.prototype.callbacks.push({ - name: 'Mark Cross-thread Quotes', + name: 'Menu', cb: this.node }); }, node: function() { - var board, boardID, quotelink, quotelinks, quotes, thread, threadID, _i, _len, _ref, _ref1; + var button; - if (this.isClone && this.thread === this.context.thread) { + button = Menu.makeButton(this); + if (this.isClone) { + $.replace($('.menu-button', this.nodes.info), button); return; } - if (!(quotes = this.quotes).length) { - return; - } - quotelinks = this.nodes.quotelinks; - _ref = this.isClone ? this.context : this, board = _ref.board, thread = _ref.thread; - for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { - quotelink = quotelinks[_i]; - _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, threadID = _ref1.threadID; - if (!threadID) { - continue; - } - if (this.isClone) { - quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, ''); - } - if (boardID === this.board.ID && threadID !== thread.ID) { - $.add(quotelink, $.tn(QuoteCT.text)); - } - } - } - }; - - QuoteInline = { - init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Inlining']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Post.prototype.callbacks.push({ - name: 'Quote Inlining', - cb: this.node - }); + return $.add(this.nodes.info, [$.tn('\u00A0'), button]); }, - node: function() { - var link, _i, _len, _ref; + makeButton: (function() { + var a; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - $.on(link, 'click', QuoteInline.toggle); - } - }, + a = null; + return function(post) { + var clone; + + a || (a = $.el('a', { + className: 'menu-button', + innerHTML: '[]', + href: 'javascript:;' + })); + clone = a.cloneNode(true); + clone.setAttribute('data-postid', post.fullID); + if (post.isClone) { + clone.setAttribute('data-clone', true); + } + $.on(clone, 'click', Menu.toggle); + return clone; + }; + })(), toggle: function(e) { - var boardID, context, postID, threadID, _ref; + var post; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { - return; - } - e.preventDefault(); - _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; - context = Get.contextFromLink(this); - if ($.hasClass(this, 'inlined')) { - QuoteInline.rm(this, boardID, threadID, postID, context); - } else { - if ($.x("ancestor::div[@id='p" + postID + "']", this)) { - return; - } - QuoteInline.add(this, boardID, threadID, postID, context); - } - return this.classList.toggle('inlined'); - }, - findRoot: function(quotelink, isBacklink) { - if (isBacklink) { - return quotelink.parentNode.parentNode; - } else { - return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink); - } - }, - add: function(quotelink, boardID, threadID, postID, context) { - var inline, isBacklink, post; - - isBacklink = $.hasClass(quotelink, 'backlink'); - inline = $.el('div', { - id: "i" + postID, - className: 'inline' - }); - $.after(QuoteInline.findRoot(quotelink, isBacklink), inline); - Get.postClone(boardID, threadID, postID, inline, context); - if (!((post = g.posts["" + boardID + "." + postID]) && context.thread === post.thread)) { - return; - } - if (isBacklink && Conf['Forward Hiding']) { - $.addClass(post.nodes.root, 'forwarded'); - post.forwarded++ || (post.forwarded = 1); - } - if (!Unread.posts) { - return; - } - return Unread.readSinglePost(post); - }, - rm: function(quotelink, boardID, threadID, postID, context) { - var el, inlined, isBacklink, post, root, _ref; - - isBacklink = $.hasClass(quotelink, 'backlink'); - root = QuoteInline.findRoot(quotelink, isBacklink); - root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); - $.rm(root); - if (!(el = root.firstElementChild)) { - return; - } - post = g.posts["" + boardID + "." + postID]; - post.rmClone(el.dataset.clone); - if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads["" + boardID + "." + threadID] && !--post.forwarded) { - delete post.forwarded; - $.rmClass(post.nodes.root, 'forwarded'); - } - while (inlined = $('.inlined', el)) { - _ref = Get.postDataFromLink(inlined), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; - QuoteInline.rm(inlined, boardID, threadID, postID, context); - $.rmClass(inlined, 'inlined'); - } + post = this.dataset.clone ? Get.postFromNode(this) : g.posts[this.dataset.postid]; + return Menu.menu.toggle(e, this, post); } }; - QuoteOP = { + ReportLink = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark OP Quotes']) { + var a; + + if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); + a = $.el('a', { + className: 'report-link', + href: 'javascript:;', + textContent: 'Report this post' + }); + $.on(a, 'click', ReportLink.report); + return $.event('AddMenuEntry', { + type: 'post', + el: a, + order: 10, + open: function(post) { + ReportLink.post = post; + return !post.isDead; + } + }); + }, + report: function() { + var id, post, set, url; + + post = ReportLink.post; + url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; + id = Date.now(); + set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"; + return window.open(url, id, set); + } + }; + + Favicon = { + init: function() { + return $.ready(function() { + var href; + + Favicon.el = $('link[rel="shortcut icon"]', d.head); + Favicon.el.type = 'image/x-icon'; + href = Favicon.el.href; + Favicon.SFW = /ws\.ico$/.test(href); + Favicon["default"] = href; + return Favicon["switch"](); + }); + }, + "switch": function() { + var unreadDead; + + unreadDead = Favicon.unreadDeadY = Favicon.unreadSFW = Favicon.unreadSFWY = Favicon.unreadNSFW = Favicon.unreadNSFWY = 'data:image/png;base64,'; + switch (Conf['favicon']) { + case 'ferongr': + Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; + Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAA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+mpv+m5z+oqP+tLX+zc7//f3+9PT97Oz23t750NDbra3zwL87LCwAAAAGAABHAADPAAD/AABkWeLDAAAAHHRSTlO5/fTv8Na2n42lsMvi8v3+/v749OaITDsDAQABSG2w8gAAAGdJREFUCNdNjtEKgDAIRYVGCmsyqCe7q/3/V2azQfpwPehVyQCIMIt4YYTeO7LHKMiGlDIkuh2qofR6obUqhtc4F637XreU1h+m41gcJX/DHyJWXYHzkCMm+hd3a4GezLNr8PQA4bQHEXEQFRJP5NAAAAAASUVORK5CYII='; + Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEUAAAAAAAAAAAAAAABFRUdsa2yRjop4dXVpZ2tdcI9dfKdBirUzlMBHpdxSquRisfOs2/99xv8umMMAAABljCUFAAAAEHRSTlN7FwUAQVt6kZ2/zej59vTv0aAplgAAAGNJREFUGNNtj1EOwCAIQ5eYIPCD0vvfdYi6LJvy0fICNVzl864DAECVuVKYAeDuEFVJkxPDmM1+TTh6n7oy0FvrWBmF1aIPYspnUGWvSE1A2KGgcvp2AtU3iGJOmcch6pHftTekXQrRd6slMAAAAABJRU5ErkJggg=='; + Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAMAAACuAq9NAAAAY1BMVEUAAAAAAAAAAAAAAAAREBAWFRY1NDROTE1iYGFzdXp4eoCAgYVlc4mHjZiYoa6zvcqy1/Pg8v+e1f+b1P6X0f2DyP5jsu49msgymcctkLomc5QbPU0SIiwNFxwumMMAAAAAAADALpU1AAAAHnRSTlPNLgcBAAABBxhdc4WznarD8P7+/v3+8/z9/vz2+PUOYDHSAAAAZElEQVQI102OsQ6AMAhEMWGDpTbUQUvu/79ShDYRhuMFDiAGIKIqEgUT3B0akQVxyhgp1XWYldLnhfXTkF5WHdZb69cz9YdPazNQdA0vRK2ahftQDGNjfHHXZjgSV5cRGQHCwS8j7A9loVSnzwAAAABJRU5ErkJggg=='; + Favicon.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w0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAD/AAD///9nZ2f77Y6hAAAAAXRSTlMAQObYZgAAAEBJREFUeF6NjQEKACAMAnfW/98cAxFiBIngOsTqR8B1IGkeG9p5i7XabgAGZNigXgA8aoCUxvzWAIcBItGiSEwdccYA3BuRAWkAAAAASUVORK5CYII='; + Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAAul8NnZ2f////82iC9AAAAAXRSTlMAQObYZgAAAEFJREFUeNqNjgEKACAMAjvX/98cAkkxgmSgO8Bt/Ai4ApJ6KKhzF3OiEMDASrGB/QWgPEHsUpN+Ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC'; + Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAAul8P///9nZ2cgIeMlAAAAAXRSTlMAQObYZgAAAEBJREFUeF6NjQEKACAMAnfW/98cAxFiBIngOsTqR8B1IGkeG9p5i7XabgAGZNigXgA8aoCUxvzWAIcBItGiSEwdccYA3BuRAWkAAAAASUVORK5CYII='; + Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAElBMVEUBAAAAAABmzDNlyjJnZ2f///+6o7dfAAAAAXRSTlMAQObYZgAAAERJREFUeF6NjkEKADEIA51o///lJZfQxUsHITogWi8AvwZJuxmYa25xDooBLEwOWFTYAsYVhdorLZt9Ng9xCUTCUCQ2H3F4ANrZ2WNiAAAAAElFTkSuQmCC'; + Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAElBMVEUBAAAAAABmzDP///9lyjJnZ2cIHys9AAAAAXRSTlMAQObYZgAAAENJREFUeF6NjUEKwEAMAjNm9/9fLkEslFwqgjoEUn8EfAqSdrkwzj6ieyyTkQEVGWRvANfO1iEX620AjgBEwqR4Y+sBeGAA6d+vQ4IAAAAASUVORK5CYII='; + break; + case 'Original': + Favicon.unreadDead += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX/////AAD///8AAABBZmS3AAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + Favicon.unreadDeadY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAKAAAoAAAoKCg4AAA4ODg7OztMAACRAADBwcH/AAD///+WCcPSAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQmAUAxEb4Isk0rwp3EPR3ECcRQrh7C3/nAasPwzmCgYuPBy5AH/NALSImqAK+H1oJRqyJVHNAnZqDITVhj7/PrAciJ9il0BHs/jjU+fnB9sQ0IxX6OBO6Xr0xKAxANLZzUanCWzZQAAAABJRU5ErkJggg=='; + Favicon.unreadSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///8ul8P///8AAACaqgkzAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + Favicon.unreadSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAABBQcHFx4KISoNLToaVW4oKCgul8M4ODg7OzvBwcH///8uS/CdAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWoftRGvdwBEewchM7d9BFbE6pbP4Mgj+R5MjjwgP+qQSkRtQAV8K3lVI2Q648oknIRpWZsMI4988HjgvpU+wO8HgeHzR9cjZYhoRiPkcDd0rXpyUAiRd5YjKC7MvNRgAAAABJRU5ErkJggg=='; + Favicon.unreadNSFW += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///9mzDP///8AAACT0n1lAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + Favicon.unreadNSFWY += 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAALVBMVEUAAAAAAAAAAAAAAAAECAIQIAgWLAsePA8oKCg4ODg6dB07OztmzDPBwcH///+rsf3XAAAAA3RSTlMAx9dmesIgAAAAZ0lEQVQI1z2LsQ2AUAhEbwKWofRL4x6O4AhuopWb2P4F7E5prP4MgiaSHHlceMA/jYC0iBrgSnjdKaUacuURTUI2qsyEFcaxvD6wnkifYleAx/N449Mn5wfbkFDM52jgTun6tAQg8QAEvjQg42KY2AAAAABJRU5ErkJggg=='; } - this.text = '\u00A0(OP)'; - return Post.prototype.callbacks.push({ - name: 'Mark OP Quotes', + if (Favicon.SFW) { + Favicon.unread = Favicon.unreadSFW; + return Favicon.unreadY = Favicon.unreadSFWY; + } else { + Favicon.unread = Favicon.unreadNSFW; + return Favicon.unreadY = Favicon.unreadNSFWY; + } + }, + empty: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX////b29sAAAAJ2DVhAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=', + dead: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX/////AAAAAACalQKRAAAAAXRSTlMAQObYZgAAAD1JREFUeF5NyrENgEAMxVArFZcpaD4z/TKjZIwrMyoSQoJXuDKf7BhUyyyrkGVycviZhLD6Wd7sq4jzaABukdYKjYsxq7wAAAAASUVORK5CYII=' + }; + + ThreadExcerpt = { + init: function() { + if (g.VIEW !== 'thread' || !Conf['Thread Excerpt']) { + return; + } + return Thread.prototype.callbacks.push({ + name: 'Thread Excerpt', cb: this.node }); }, node: function() { - var boardID, op, postID, quotelink, quotelinks, quotes, _i, _j, _len, _len1, _ref; - - if (this.isClone && this.thread === this.context.thread) { - return; - } - if (!(quotes = this.quotes).length) { - return; - } - quotelinks = this.nodes.quotelinks; - if (this.isClone && quotes.contains(this.thread.fullID)) { - for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { - quotelink = quotelinks[_i]; - quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, ''); - } - } - op = (this.isClone ? this.context : this).thread.fullID; - if (!quotes.contains(op)) { - return; - } - for (_j = 0, _len1 = quotelinks.length; _j < _len1; _j++) { - quotelink = quotelinks[_j]; - _ref = Get.postDataFromLink(quotelink), boardID = _ref.boardID, postID = _ref.postID; - if (("" + boardID + "." + postID) === op) { - $.add(quotelink, $.tn(QuoteOP.text)); - } - } + return d.title = Get.threadExcerpt(this); } }; - QuotePreview = { + ThreadStats = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Previewing']) { + var sc; + + if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Post.prototype.callbacks.push({ - name: 'Quote Previewing', + this.dialog = sc = $.el('span', { + innerHTML: "0 / 0", + id: 'thread-stats' + }); + this.postCountEl = $('#post-count', sc); + this.fileCountEl = $('#file-count', sc); + Header.addShortcut(sc); + return Thread.prototype.callbacks.push({ + name: 'Thread Stats', cb: this.node }); }, node: function() { - var link, _i, _len, _ref; + var ID, fileCount, post, postCount, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - $.on(link, 'mouseover', QuotePreview.mouseover); + postCount = 0; + fileCount = 0; + _ref = this.posts; + for (ID in _ref) { + post = _ref[ID]; + postCount++; + if (post.file) { + fileCount++; + } } + ThreadStats.thread = this; + ThreadStats.update(postCount, fileCount); + return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate); }, - mouseover: function(e) { - var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; + onUpdate: function(e) { + var fileCount, postCount, _ref; - if ($.hasClass(this, 'inlined')) { + if (e.detail[404]) { return; } - _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID; - qp = $.el('div', { - id: 'qp', - className: 'dialog' - }); - $.add(Header.hover, qp); - Get.postClone(boardID, threadID, postID, qp, Get.contextFromLink(this)); - UI.hover({ - root: this, - el: qp, - latestEvent: e, - endEvents: 'mouseout click', - cb: QuotePreview.mouseout, - asapTest: function() { - return qp.firstElementChild; - } - }); - if (!(origin = g.posts["" + boardID + "." + postID])) { - return; - } - if (Conf['Quote Highlighting']) { - posts = [origin].concat(origin.clones); - posts.pop(); - for (_i = 0, _len = posts.length; _i < _len; _i++) { - post = posts[_i]; - $.addClass(post.nodes.post, 'qphl'); - } - } - quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0]; - clone = Get.postFromRoot(qp.firstChild); - _ref1 = clone.nodes.quotelinks.concat(__slice.call(clone.nodes.backlinks)); - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - quote = _ref1[_j]; - if (quote.hash.slice(2) === quoterID) { - $.addClass(quote, 'forwardlink'); - } - } + _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount; + return ThreadStats.update(postCount, fileCount); }, - mouseout: function() { - var clone, post, root, _i, _len, _ref; + update: function(postCount, fileCount) { + var fileCountEl, postCountEl, thread; - if (!(root = this.el.firstElementChild)) { - return; - } - clone = Get.postFromRoot(root); - post = clone.origin; - post.rmClone(root.dataset.clone); - if (!Conf['Quote Highlighting']) { - return; - } - _ref = [post].concat(post.clones); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - post = _ref[_i]; - $.rmClass(post.nodes.post, 'qphl'); - } + thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; + postCountEl.textContent = postCount; + fileCountEl.textContent = fileCount; + (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning'); + return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning'); } }; - /* - <3 aeosynth - */ - - - QuoteThreading = { + ThreadUpdater = { init: function() { - var input; + var checked, conf, el, input, name, sc, settings, subEntries, _ref; - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { + if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { return; } - this.enabled = true; - this.controls = $.el('span', { - innerHTML: '' + checked = Conf['Auto Update'] ? 'checked' : ''; + this.dialog = sc = $.el('span', { + innerHTML: "", + id: 'updater' + }); + this.timer = $('#update-timer', sc); + this.status = $('#update-status', sc); + $.on(this.timer, 'click', ThreadUpdater.update); + $.on(this.status, 'click', ThreadUpdater.update); + this.checkPostCount = 0; + Header.addShortcut(sc); + subEntries = []; + _ref = Config.updater.checkbox; + for (name in _ref) { + conf = _ref[name]; + checked = Conf[name] ? 'checked' : ''; + el = $.el('label', { + title: "" + conf[1], + innerHTML: " " + name + }); + input = el.firstElementChild; + $.on(input, 'change', $.cb.checked); + if (input.name === 'Scroll BG') { + $.on(input, 'change', ThreadUpdater.cb.scrollBG); + ThreadUpdater.cb.scrollBG(); + } else if (input.name === 'Auto Update') { + $.on(input, 'change', ThreadUpdater.update); + } + subEntries.push({ + el: el + }); + } + settings = $.el('span', { + innerHTML: 'Interval' + }); + $.on(settings, 'click', this.intervalShortcut); + subEntries.push({ + el: settings }); - input = $('input', this.controls); - $.on(input, 'change', QuoteThreading.toggle); $.event('AddMenuEntry', { type: 'header', - el: this.controls, - order: 98 + el: $.el('span', { + textContent: 'Updater' + }), + order: 110, + subEntries: subEntries }); - $.on(d, '4chanXInitFinished', this.setup); - return Post.prototype.callbacks.push({ - name: 'Quote Threading', + return Thread.prototype.callbacks.push({ + name: 'Thread Updater', cb: this.node }); }, - setup: function() { - var ID, post, posts; - - $.off(d, '4chanXInitFinished', QuoteThreading.setup); - posts = g.posts; - for (ID in posts) { - post = posts[ID]; - if (post.cb) { - post.cb.call(post); - } - } - return QuoteThreading.hasRun = true; - }, node: function() { - var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; + ThreadUpdater.thread = this; + ThreadUpdater.root = this.OP.nodes.root.parentNode; + ThreadUpdater.lastPost = +ThreadUpdater.root.lastElementChild.id.match(/\d+/)[0]; + ThreadUpdater.outdateCount = 0; + ThreadUpdater.lastModified = '0'; + ThreadUpdater.cb.interval.call($.el('input', { + value: Conf['Interval'] + })); + $.on(window, 'online offline', ThreadUpdater.cb.online); + $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.post); + $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); + ThreadUpdater.cb.online(); + return Rice.nodes(ThreadUpdater.dialog); + }, + /* + http://freesound.org/people/pierrecartoons1979/sounds/90112/ + cc-by-nc-3.0 + */ - if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { + beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', + cb: { + online: function() { + if (ThreadUpdater.online = navigator.onLine) { + ThreadUpdater.outdateCount = 0; + ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + ThreadUpdater.update(); + ThreadUpdater.set('status', null, null); + } else { + ThreadUpdater.set('timer', null); + ThreadUpdater.set('status', 'Offline', 'warning'); + } + return ThreadUpdater.cb.autoUpdate(); + }, + post: function(e) { + if (e.detail.threadID !== ThreadUpdater.thread.ID) { + return; + } + ThreadUpdater.outdateCount = 0; + if (ThreadUpdater.seconds > 2) { + return setTimeout(ThreadUpdater.update, 1000); + } + }, + checkpost: function() { + if (!(g.DEAD || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 10)) { + return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * 500); + } + ThreadUpdater.checkPostCount = 0; + delete ThreadUpdater.foundPost; + return delete ThreadUpdater.postID; + }, + visibility: function() { + if (d.hidden) { + return; + } + ThreadUpdater.outdateCount = 0; + if (ThreadUpdater.seconds > ThreadUpdater.interval) { + return ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + } + }, + scrollBG: function() { + return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() { + return true; + } : function() { + return !d.hidden; + }; + }, + autoUpdate: function() { + if (ThreadUpdater.online) { + return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); + } else { + return clearTimeout(ThreadUpdater.timeoutID); + } + }, + interval: function() { + var val; + + val = +this.value; + if (val < 1) { + val = 1; + } + ThreadUpdater.interval = this.value = val; + return $.cb.value.call(this); + }, + load: function() { + var klass, req, text, _ref; + + req = ThreadUpdater.req; + switch (req.status) { + case 200: + g.DEAD = false; + ThreadUpdater.parse(JSON.parse(req.response).posts); + ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified'); + if (Conf['Auto Update']) { + ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + } + break; + case 404: + g.DEAD = true; + ThreadUpdater.set('timer', null); + ThreadUpdater.set('status', '404', 'warning'); + clearTimeout(ThreadUpdater.timeoutID); + ThreadUpdater.thread.kill(); + $.event('ThreadUpdate', { + 404: true, + thread: ThreadUpdater.thread + }); + break; + default: + if (Conf['Auto Update']) { + ThreadUpdater.outdateCount++; + ThreadUpdater.set('timer', ThreadUpdater.getInterval()); + } + /* + Status Code 304: Not modified + By sending the `If-Modified-Since` header we get a proper status code, and no response. + This saves bandwidth for both the user and the servers and avoid unnecessary computation. + */ + + _ref = [0, 304].contains(req.status) ? [null, null] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1]; + ThreadUpdater.set('status', text, klass); + } + if (ThreadUpdater.postID) { + ThreadUpdater.cb.checkpost(this.status); + } + return delete ThreadUpdater.req; + } + }, + getInterval: function() { + var i, j; + + i = ThreadUpdater.interval; + j = Math.min(ThreadUpdater.outdateCount, 10); + if (!d.hidden) { + j = Math.min(j, 7); + } + return ThreadUpdater.seconds = Conf['Optional Increase'] ? Math.max(i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j]) : i; + }, + intervalShortcut: function() { + var settings; + + Settings.open('Advanced'); + settings = $.id('fourchanx-settings'); + return $('input[name=Interval]', settings).focus(); + }, + set: function(name, text, klass) { + var el, node; + + el = ThreadUpdater[name]; + if (node = el.firstChild) { + node.data = text; + } else { + el.textContent = text; + } + if (klass !== void 0) { + return el.className = klass; + } + }, + timeout: function() { + var n; + + ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); + if (!(n = --ThreadUpdater.seconds)) { + return ThreadUpdater.update(); + } else if (n <= -60) { + ThreadUpdater.set('status', 'Retrying', null); + return ThreadUpdater.update(); + } else if (n > 0) { + return ThreadUpdater.set('timer', n); + } + }, + update: function() { + var url; + + if (!ThreadUpdater.online) { return; } - quotes = this.quotes, ID = this.ID, fullID = this.fullID; - posts = g.posts; - if (!(post = posts[fullID]) || post.isHidden) { + ThreadUpdater.seconds = 0; + if (Conf['Auto Update']) { + ThreadUpdater.set('timer', '...'); + } else { + ThreadUpdater.set('timer', 'Update'); + } + if (ThreadUpdater.req) { + ThreadUpdater.req.onloadend = null; + ThreadUpdater.req.abort(); + } + url = "//api.4chan.org/" + ThreadUpdater.thread.board + "/res/" + ThreadUpdater.thread + ".json"; + return ThreadUpdater.req = $.ajax(url, { + onloadend: ThreadUpdater.cb.load + }, { + headers: { + 'If-Modified-Since': ThreadUpdater.lastModified + } + }); + }, + updateThreadStatus: function(title, OP) { + var icon, message, root, titleLC; + + titleLC = title.toLowerCase(); + if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { return; } - uniq = {}; - len = ("" + g.BOARD).length + 1; - for (_i = 0, _len = quotes.length; _i < _len; _i++) { - quote = quotes[_i]; - qid = quote; - if (!(qid.slice(len) < ID)) { + if (!(ThreadUpdater.thread["is" + title] = !!OP[titleLC])) { + message = title === 'Sticky' ? 'The thread is not a sticky anymore.' : 'The thread is not closed anymore.'; + new Notification('info', message, 30); + $.rm($("." + titleLC + "Icon", ThreadUpdater.thread.OP.nodes.info)); + return; + } + message = title === 'Sticky' ? 'The thread is now a sticky.' : 'The thread is now closed.'; + new Notification('info', message, 30); + icon = $.el('img', { + src: "//static.4chan.org/image/" + titleLC + ".gif", + alt: title, + title: title, + className: "" + titleLC + "Icon" + }); + root = $('[title="Quote this post"]', ThreadUpdater.thread.OP.nodes.info); + if (title === 'Closed') { + root = $('.stickyIcon', ThreadUpdater.thread.OP.nodes.info) || root; + } + return $.after(root, [$.tn(' '), icon]); + }, + parse: function(postObjects) { + var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, scroll, _i, _len, _ref; + + OP = postObjects[0]; + Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; + ThreadUpdater.updateThreadStatus('Sticky', OP); + ThreadUpdater.updateThreadStatus('Closed', OP); + ThreadUpdater.thread.postLimit = !!OP.bumplimit; + ThreadUpdater.thread.fileLimit = !!OP.imagelimit; + posts = []; + index = []; + files = []; + count = 0; + for (_i = 0, _len = postObjects.length; _i < _len; _i++) { + postObject = postObjects[_i]; + num = postObject.no; + index.push(num); + if (postObject.fsize) { + files.push(num); + } + if (num <= ThreadUpdater.lastPost) { continue; } - if (qid in posts) { - uniq[qid.slice(len)] = true; + count++; + node = Build.postFromObject(postObject, ThreadUpdater.thread.board); + posts.push(new Post(node, ThreadUpdater.thread, ThreadUpdater.thread.board)); + } + deletedPosts = []; + deletedFiles = []; + _ref = ThreadUpdater.thread.posts; + for (ID in _ref) { + post = _ref[ID]; + ID = +ID; + if (post.isDead && index.contains(ID)) { + post.resurrect(); + } else if (!index.contains(ID)) { + post.kill(); + deletedPosts.push(post); + } else if (post.file && !post.file.isDead && !files.contains(ID)) { + post.kill(true); + deletedFiles.push(post); } - } - keys = Object.keys(uniq); - if (keys.length !== 1) { - return; - } - this.threaded = "" + g.BOARD + "." + keys[0]; - return this.cb = QuoteThreading.nodeinsert; - }, - nodeinsert: function() { - var bottom, height, posts, qpost, qroot, threadContainer, top, _ref; - - posts = g.posts; - qpost = posts[this.threaded]; - delete this.threaded; - delete this.cb; - if (this.thread.OP === qpost) { - return false; - } - if (QuoteThreading.hasRun) { - height = doc.clientHeight; - _ref = qpost.nodes.root.getBoundingClientRect(), bottom = _ref.bottom, top = _ref.top; - if (!(Unread.posts.contains(qpost) || ((bottom < height) && (top > 0)))) { - return false; - } - } - qroot = qpost.nodes.root; - if (!$.hasClass(qroot, 'threadOP')) { - $.addClass(qroot, 'threadOP'); - threadContainer = $.el('div', { - className: 'threadContainer' - }); - $.after(qroot, threadContainer); - } else { - threadContainer = qroot.nextSibling; - } - $.add(threadContainer, this.nodes.root); - return true; - }, - toggle: function() { - var container, containers, node, nodes, replies, reply, thread, _i, _j, _len, _len1; - - thread = $('.thread'); - replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); - QuoteThreading.enabled = this.checked; - if (this.checked) { - nodes = (function() { - var _i, _len, _results; - - _results = []; - for (_i = 0, _len = replies.length; _i < _len; _i++) { - reply = replies[_i]; - _results.push(Get.postFromNode(reply)); + if (ThreadUpdater.postID) { + if (ID === ThreadUpdater.postID) { + ThreadUpdater.foundPost = true; } - return _results; - })(); - for (_i = 0, _len = nodes.length; _i < _len; _i++) { - node = nodes[_i]; - QuoteThreading.node(node); } + } + if (!count) { + ThreadUpdater.set('status', null, null); + ThreadUpdater.outdateCount++; } else { - replies.sort(function(a, b) { - var aID, bID; + ThreadUpdater.set('status', "+" + count, 'new'); + ThreadUpdater.outdateCount = 0; + if (Conf['Beep'] && d.hidden && Unread.posts && !Unread.posts.length) { + if (!ThreadUpdater.audio) { + ThreadUpdater.audio = $.el('audio', { + src: ThreadUpdater.beep + }); + } + ThreadUpdater.audio.play(); + } + ThreadUpdater.lastPost = posts[count - 1].ID; + Main.callbackNodes(Post, posts); + scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; + for (key in posts) { + post = posts[key]; + if (!posts.hasOwnProperty(key)) { + continue; + } + if (post.cb) { + if (!post.cb.call(post)) { + $.add(ThreadUpdater.root, post.nodes.root); + } + } else { + $.add(ThreadUpdater.root, post.nodes.root); + } + } + if (scroll) { + if (Conf['Bottom Scroll']) { + d.body.scrollTop = d.body.clientHeight; + } else { + Header.scrollToPost(nodes[0]); + } + } + $.queueTask(function() { + var length, threadID; - aID = Number(a.id.slice(2)); - bID = Number(b.id.slice(2)); - return aID - bID; + threadID = ThreadUpdater.thread.ID; + length = $$('.thread > .postContainer', ThreadUpdater.root).length; + return Fourchan.parseThread(threadID, length - count, length); }); - $.add(thread, replies); - containers = $$('.threadContainer', thread); - for (_j = 0, _len1 = containers.length; _j < _len1; _j++) { - container = containers[_j]; - $.rm(container); - } - Unread.update(true); } - }, - kb: function() { - var control; - - control = $.id('threadingControl'); - return control.click(); + return $.event('ThreadUpdate', { + 404: false, + thread: ThreadUpdater.thread, + newPosts: posts, + deletedPosts: deletedPosts, + deletedFiles: deletedFiles, + postCount: OP.replies + 1, + fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead) + }); } }; - QuoteYou = { + ThreadWatcher = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark Quotes of You'] || !Conf['Quick Reply']) { + if (!Conf['Thread Watcher']) { return; } - this.text = '\u00A0(You)'; - return Post.prototype.callbacks.push({ - name: 'Mark Quotes of You', + this.dialog = UI.dialog('watcher', 'top: 50px; left: 0px;', '
Thread Watcher
'); + $.on(d, 'QRPostSuccessful', this.cb.post); + $.on(d, '4chanXInitFinished', this.ready); + $.sync('WatchedThreads', this.refresh); + return Thread.prototype.callbacks.push({ + name: 'Thread Watcher', cb: this.node }); }, node: function() { - var quotelink, quotelinks, quotes, _i, _len; + var favicon, + _this = this; - if (this.isClone) { + favicon = $.el('img', { + className: 'favicon' + }); + $.on(favicon, 'click', ThreadWatcher.cb.toggle); + $.before($('input', this.OP.nodes.post), favicon); + if (g.VIEW !== 'thread') { return; } - if (!(quotes = this.quotes).length) { + return $.get('AutoWatch', 0, function(item) { + if (item['AutoWatch'] !== _this.ID) { + return; + } + ThreadWatcher.watch(_this); + return $["delete"]('AutoWatch'); + }); + }, + ready: function() { + $.off(d, '4chanXInitFinished', ThreadWatcher.ready); + if (!Main.isThisPageLegit()) { return; } - quotelinks = this.nodes.quotelinks; - for (_i = 0, _len = quotelinks.length; _i < _len; _i++) { - quotelink = quotelinks[_i]; - if (QR.db.get(Get.postDataFromLink(quotelink))) { - $.add(quotelink, $.tn(QuoteYou.text)); + ThreadWatcher.refresh(); + return $.add(d.body, ThreadWatcher.dialog); + }, + refresh: function(watched) { + var ID, board, div, favicon, id, link, nodes, props, thread, x, _ref, _ref1; + + if (!watched) { + $.get('WatchedThreads', {}, function(item) { + return ThreadWatcher.refresh(item['WatchedThreads']); + }); + return; + } + nodes = [$('.move', ThreadWatcher.dialog)]; + for (board in watched) { + _ref = watched[board]; + for (id in _ref) { + props = _ref[id]; + x = $.el('a', { + textContent: '×', + href: 'javascript:;' + }); + $.on(x, 'click', ThreadWatcher.cb.x); + link = $.el('a', props); + link.title = link.textContent; + div = $.el('div'); + $.add(div, [x, $.tn(' '), link]); + nodes.push(div); } } + $.rmAll(ThreadWatcher.dialog); + $.add(ThreadWatcher.dialog, nodes); + watched = watched[g.BOARD] || {}; + _ref1 = g.BOARD.threads; + for (ID in _ref1) { + thread = _ref1[ID]; + favicon = $('.favicon', thread.OP.nodes.post); + favicon.src = ID in watched ? Favicon["default"] : Favicon.empty; + } + }, + cb: { + toggle: function() { + return ThreadWatcher.toggle(Get.postFromNode(this).thread); + }, + x: function() { + var thread; + + thread = this.nextElementSibling.pathname.split('/'); + return ThreadWatcher.unwatch(thread[1], thread[3]); + }, + post: function(e) { + var board, postID, threadID, _ref; + + _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; + if (postID === threadID) { + if (Conf['Auto Watch']) { + return $.set('AutoWatch', threadID); + } + } else if (Conf['Auto Watch Reply']) { + return ThreadWatcher.watch(board.threads[threadID]); + } + } + }, + toggle: function(thread) { + if ($('.favicon', thread.OP.nodes.post).src === Favicon.empty) { + return ThreadWatcher.watch(thread); + } else { + return ThreadWatcher.unwatch(thread.board, thread.ID); + } + }, + unwatch: function(board, threadID) { + return $.get('WatchedThreads', {}, function(item) { + var watched; + + watched = item['WatchedThreads']; + delete watched[board][threadID]; + if (!Object.keys(watched[board]).length) { + delete watched[board]; + } + ThreadWatcher.refresh(watched); + return $.set('WatchedThreads', watched); + }); + }, + watch: function(thread) { + return $.get('WatchedThreads', {}, function(item) { + var watched, _name; + + watched = item['WatchedThreads']; + watched[_name = thread.board] || (watched[_name] = {}); + watched[thread.board][thread] = { + href: "/" + thread.board + "/res/" + thread, + textContent: Get.threadExcerpt(thread) + }; + ThreadWatcher.refresh(watched); + return $.set('WatchedThreads', watched); + }); } }; - Quotify = { + Unread = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Resurrect Quotes']) { + if (g.VIEW !== 'thread' || !Conf['Unread Count'] && !Conf['Unread Favicon']) { return; } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Post.prototype.callbacks.push({ - name: 'Resurrect Quotes', + this.db = new DataBoard('lastReadPosts', this.sync); + this.hr = $.el('hr', { + id: 'unread-line' + }); + this.posts = []; + this.postsQuotingYou = []; + return Thread.prototype.callbacks.push({ + name: 'Unread', cb: this.node }); }, node: function() { - var deadlink, _i, _len, _ref; + Unread.thread = this; + Unread.title = d.title; + Unread.lastReadPost = Unread.db.get({ + boardID: this.board.ID, + threadID: this.ID, + defaultValue: 0 + }); + $.on(d, '4chanXInitFinished', Unread.ready); + $.on(d, 'ThreadUpdate', Unread.onUpdate); + return $.on(d, 'scroll visibilitychange', Unread.read); + }, + ready: function() { + var ID, post, posts, _ref; - _ref = $$('.deadlink', this.nodes.comment); + $.off(d, '4chanXInitFinished', Unread.ready); + posts = []; + _ref = Unread.thread.posts; + for (ID in _ref) { + post = _ref[ID]; + if (post.isReply) { + posts.push(post); + } + } + Unread.addPosts(posts); + if (Conf['Unread Line']) { + Unread.setLine(); + } + if (Conf['Scroll to Last Read Post']) { + return Unread.scroll(); + } + }, + scroll: function() { + var hash, post, posts, prevID, root; + + if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { + return; + } + if (Unread.posts.length) { + prevID = 0; + while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) { + post = Get.postFromRoot(root); + if (prevID === post.ID) { + break; + } + prevID = post.ID; + if (!post.isHidden) { + break; + } + } + root.scrollIntoView(false); + return; + } + posts = Object.keys(Unread.thread.posts); + return Header.scrollToPost(Unread.thread.posts[posts[posts.length - 1]].nodes.root); + }, + sync: function() { + var lastReadPost; + + lastReadPost = Unread.db.get({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + defaultValue: 0 + }); + if (!(Unread.lastReadPost < lastReadPost)) { + return; + } + Unread.lastReadPost = lastReadPost; + Unread.readArray(Unread.posts); + Unread.readArray(Unread.postsQuotingYou); + Unread.setLine(); + return Unread.update(); + }, + addPosts: function(newPosts) { + var ID, data, post, _i, _len; + + for (_i = 0, _len = newPosts.length; _i < _len; _i++) { + post = newPosts[_i]; + ID = post.ID; + if (ID <= Unread.lastReadPost || post.isHidden) { + continue; + } + if (QR.db) { + data = { + boardID: post.board.ID, + threadID: post.thread.ID, + postID: post.ID + }; + if (QR.db.get(data)) { + continue; + } + } + Unread.posts.push(post); + Unread.addPostQuotingYou(post); + } + if (Conf['Unread Line']) { + Unread.setLine(newPosts.contains(Unread.posts[0])); + } + Unread.read(); + return Unread.update(); + }, + addPostQuotingYou: function(post) { + var quotelink, _i, _len, _ref; + + if (!QR.db) { + return; + } + _ref = post.nodes.quotelinks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { - deadlink = _ref[_i]; - if (this.isClone) { - if ($.hasClass(deadlink, 'quotelink')) { - this.nodes.quotelinks.push(deadlink); - } - } else { - Quotify.parseDeadlink.call(this, deadlink); + quotelink = _ref[_i]; + if (QR.db.get(Get.postDataFromLink(quotelink))) { + Unread.postsQuotingYou.push(post); } } }, - parseDeadlink: function(deadlink) { - var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; + onUpdate: function(e) { + if (e.detail[404]) { + return Unread.update(); + } else { + return Unread.addPosts(e.detail.newPosts); + } + }, + readSinglePost: function(post) { + var i; - if (deadlink.parentNode.className === 'prettyprint') { - $.replace(deadlink, __slice.call(deadlink.childNodes)); + if ((i = Unread.posts.indexOf(post)) === -1) { return; } - quote = deadlink.textContent; - if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) { + Unread.posts.splice(i, 1); + if (i === 0) { + Unread.lastReadPost = post.ID; + Unread.saveLastReadPost(); + } + if ((i = Unread.postsQuotingYou.indexOf(post)) !== -1) { + Unread.postsQuotingYou.splice(i, 1); + } + return Unread.update(); + }, + readArray: function(arr) { + var i, post, _i, _len; + + for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { + post = arr[i]; + if (post.ID > Unread.lastReadPost) { + break; + } + } + return arr.splice(0, i); + }, + read: $.debounce(50, function(e) { + var ID, bottom, height, i, post, posts, read; + + if (d.hidden || !Unread.posts.length) { return; } - boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; - quoteID = "" + boardID + "." + postID; - if (post = g.posts[quoteID]) { - if (!post.isDead) { - a = $.el('a', { - href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, - className: 'quotelink', - textContent: quote - }); + height = doc.clientHeight; + posts = Unread.posts; + read = []; + i = posts.length; + while (post = posts[--i]) { + bottom = post.nodes.root.getBoundingClientRect().bottom; + if (bottom < height) { + ID = post.ID; + posts.remove(post); + } + } + if (!ID) { + return; + } + Unread.lastReadPost = ID; + Unread.saveLastReadPost(); + Unread.readArray(Unread.postsQuotingYou); + if (e) { + return Unread.update(); + } + }), + saveLastReadPost: $.debounce(2 * $.SECOND, function() { + return Unread.db.set({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + val: Unread.lastReadPost + }); + }), + setLine: function(force) { + var post, root; + + if (!(d.hidden || force === true)) { + return; + } + if (post = Unread.posts[0]) { + root = post.nodes.root; + if (root !== $('.thread > .replyContainer', root.parentNode)) { + return $.before(root, Unread.hr); + } + } else { + return $.rm(Unread.hr); + } + }, + update: function(dontrepeat) { + var count; + + count = Unread.posts.length; + if (Conf['Unread Count']) { + d.title = "" + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); + if (!dontrepeat) { + setTimeout(function() { + d.title = ''; + return Unread.update(true); + }, $.SECOND); + } + } + if (!Conf['Unread Favicon']) { + return; + } + return Favicon.el.href = g.DEAD ? Unread.postsQuotingYou.length ? Favicon.unreadDeadY : count ? Favicon.unreadDead : Favicon.dead : count ? Unread.postsQuotingYou.length ? Favicon.unreadY : Favicon.unread : Favicon["default"]; + } + }; + + Redirect = { + init: function() { + return $.sync('archs', this.updateArchives); + }, + updateArchives: function() { + return $.get('archivers', {}, function(_arg) { + var archivers; + + archivers = _arg.archivers; + return Conf['archivers'] = archivers; + }); + }, + image: function(boardID, filename) { + switch (boardID) { + case 'a': + case 'gd': + case 'jp': + case 'm': + case 'q': + case 'tg': + case 'vp': + case 'vr': + case 'wsg': + return "//archive.foolz.us/" + boardID + "/full_image/" + filename; + case 'u': + return "//nsfw.foolz.us/" + boardID + "/full_image/" + filename; + case 'po': + return "//archive.thedarkcave.org/" + boardID + "/full_image/" + filename; + case 'hr': + case 'tv': + return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename; + case 'ck': + case 'fa': + case 'lit': + case 's4s': + return "//fuuka.warosu.org/" + boardID + "/full_image/" + filename; + case 'cgl': + case 'g': + case 'mu': + case 'w': + return "//rbt.asia/" + boardID + "/full_image/" + filename; + case 'an': + case 'k': + case 'toy': + case 'x': + return "http://archive.heinessen.com/" + boardID + "/full_image/" + filename; + case 'c': + return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename; + } + }, + post: function(boardID, postID) { + var archive, name, _base, _ref; + + if (Redirect.post[boardID] == null) { + _ref = this.archiver; + for (name in _ref) { + archive = _ref[name]; + if (archive.type === 'foolfuuka' && archive.boards.contains(boardID)) { + Redirect.post[boardID] = archive.base; + break; + } + } + (_base = Redirect.post)[boardID] || (_base[boardID] = false); + } + if (Redirect.post[boardID]) { + return "" + Redirect.post[boardID] + "/_/api/chan/post/?board=" + boardID + "&num=" + postID; + } else { + return null; + } + }, + select: function(board) { + var archive, name, _ref, _results; + + _ref = this.archiver; + _results = []; + for (name in _ref) { + archive = _ref[name]; + if (!archive.boards.contains(board)) { + continue; + } + _results.push(name); + } + return _results; + }, + to: function(data) { + var arch, archive, boardID; + + boardID = data.boardID; + if ((arch = Conf.archivers[boardID]) == null) { + Conf.archivers[boardID] = arch = this.select(boardID)[0]; + $.set('archivers', Conf.archivers); + } + return (arch && (archive = this.archiver[arch]) ? Redirect.path(archive.base, archive.type, data) : data.threadID ? "//boards.4chan.org/" + boardID + "/" : null); + }, + archiver: { + 'Foolz': { + base: 'https://archive.foolz.us', + boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg'], + type: 'foolfuuka' + }, + 'NSFWFoolz': { + base: 'https://nsfw.foolz.us', + boards: ['u'], + type: 'foolfuuka' + }, + 'TheDarkCave': { + base: 'http://archive.thedarkcave.org', + boards: ['c', 'int', 'out', 'po'], + type: 'foolfuuka' + }, + '4plebs': { + base: 'http://archive.4plebs.org', + boards: ['hr', 'tg', 'tv', 'x'], + base: 'foolfuuka' + }, + 'Warosu': { + base: '//fuuka.warosu.org', + boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'], + type: 'fuuka' + }, + 'InstallGentoo': { + base: '//archive.installgentoo.net', + boards: ['diy', 'g', 'sci'], + type: 'fuuka' + }, + 'RebeccaBlackTech': { + base: '//rbt.asia', + boards: ['an', 'cgl', 'g', 'mu', 'w'], + type: 'fuuka_mail' + }, + 'Heinessen': { + base: 'http://archive.heinessen.com', + boards: ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x'], + type: 'fuuka' + }, + 'Cliche': { + base: '//www.cliché.net/4chan/cgi-board.pl', + boards: ['e'], + type: 'fuuka' + }, + 'NyaFuu': { + base: '//archive.nyafuu.org', + boards: ['c', 'w'], + type: 'fuuka' + } + }, + path: function(base, archiver, data) { + var boardID, path, postID, threadID, type, value; + + if (data.isSearch) { + boardID = data.boardID, type = data.type, value = data.value; + type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; + value = encodeURIComponent(value); + if (archiver === 'foolfuuka') { + return "" + base + "/" + boardID + "/search/" + type + "/" + value; + } else if (type === 'image') { + return "" + base + "/" + boardID + "/?task=search2&search_media_hash=" + value; } else { - a = $.el('a', { - href: "/" + boardID + "/" + post.thread + "/res/#p" + postID, - className: 'quotelink deadlink', - target: '_blank', - textContent: "" + quote + "\u00A0(Dead)" - }); - a.setAttribute('data-boardid', boardID); - a.setAttribute('data-threadid', post.thread.ID); - a.setAttribute('data-postid', postID); - } - } else if (redirect = Redirect.to({ - boardID: boardID, - threadID: 0, - postID: postID - })) { - a = $.el('a', { - href: redirect, - className: 'deadlink', - target: '_blank', - textContent: "" + quote + "\u00A0(Dead)" - }); - if (Redirect.post(boardID, postID)) { - $.addClass(a, 'quotelink'); - a.setAttribute('data-boardid', boardID); - a.setAttribute('data-postid', postID); + return "" + base + "/" + boardID + "/?task=search2&search_" + type + "=" + value; } } - if (!this.quotes.contains(quoteID)) { - this.quotes.push(quoteID); + boardID = data.boardID, threadID = data.threadID, postID = data.postID; + path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; + if (archiver === 'foolfuuka') { + path += '/'; } - if (!a) { - deadlink.textContent = "" + quote + "\u00A0(Dead)"; - return; - } - $.replace(deadlink, a); - if ($.hasClass(a, 'quotelink')) { - return this.nodes.quotelinks.push(a); + if (threadID && postID) { + path += archiver === 'foolfuuka' ? "#" + postID : "#p" + postID; } + return "" + base + "/" + path; } }; @@ -10798,56 +9870,77 @@ } }; - CustomCSS = { - init: function() { - if (!Conf['Custom CSS']) { - return; - } - return this.addStyle(); - }, - addStyle: function() { - return this.style = $.addStyle(Conf['usercss']); - }, - rmStyle: function() { - if (this.style) { - $.rm(this.style); - return delete this.style; - } - }, - update: function() { - if (!this.style) { - this.addStyle(); - } - return this.style.textContent = Conf['usercss']; - } - }; - Emoji = { init: function() { - return Emoji.icons.not.push(['PlanNine', Emoji.icons.not[0][1]]); + Emoji.icons['PlanNine'] = Emoji.icons['Plan9']; + return Emoji.icons['Sage'] = Emoji.sage[Conf['sageEmoji']]; }, css: function(position) { - var category, css, icon, key, margin, name, _conf, _i, _len, _ref; + var category, css, icon, key, name, _conf, _ref; _conf = Conf; - css = []; - margin = "margin-" + (position === "before" ? "right" : "left") + ": " + (parseInt(_conf['Emoji Spacing'])) + "px;"; + css = ["a.useremail[href]:last-of-type::" + position + " {\n vertical-align: top;\n margin-" + (position === "before" ? "right" : "left") + ": 5px;\n}\n"]; _ref = Emoji.icons; for (key in _ref) { category = _ref[key]; + if (!Emoji.icons.hasOwnProperty(key)) { + continue; + } if ((_conf['Emoji'] !== "disable ponies" && key === "pony") || (_conf['Emoji'] !== "only ponies" && key === "not")) { - for (_i = 0, _len = category.length; _i < _len; _i++) { - icon = category[_i]; + for (name in category) { + icon = category[name]; + if (!category.hasOwnProperty(name)) { + continue; + } name = icon[0]; - css[css.length] = "a.useremail[href*='" + name + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toLowerCase()) + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toUpperCase()) + "']:last-of-type::" + position + " {\n content: url('data:image/png;base64," + icon[1] + "');\n vertical-align: top;\n " + margin + "\n}\n"; + css.push("a.useremail[href*='" + name + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toLowerCase()) + "']:last-of-type::" + position + ",\na.useremail[href*='" + (name.toUpperCase()) + "']:last-of-type::" + position + " {\n content: url('data:image/png;base64," + icon + "');\n}\n"); } } } return css.join(""); }, + sage: { + '4chan SS': 'iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAYAAACZ3F9/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAa9JREFUKFOdkt0rg2EUwM95b2zlL0CRRLngksznXrJsNtYW1tjYhM3mY6+IXZAbikhTKJp8XZAp81UmWYhIRHHhUi60e7s6ntdCa2449es8PfU7z+k5B6AbyuE/wQlc4BcO2d06unAUBCgFE0hianOd3NHIcy8NPwrUf9NBPZcOEi7ayXZiea/1V7+ljaXeYAfOgg2So2TOwQWGnwQafOgi962TnMFmatozUeNu4yetASspVvgXiUvii5K5Nm6z56ol3Hdtpy+cwSYy+HRUt1nLsoEato0kXyh6wTac+24brThWv6MNOYNW9prlG/uxmbRrFaT0VrCspZoNPSUNJNyCBcoiLZuhLH0o9U6UrAfGKCz7RlLM81Q8XUwqr4oKPLIQmnA8IupBigacVy7yrya/2JouhryJHJJNykg+UxLGOtz6+SQNpEiMcduls4Wvoli9WklVKz+ol5SU4U6ngql8Qj2eRI+GyajBhSRH4r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NsSB7h6SKZdL8xsUOnpx9j1KbTdARACIowArYe1ergfNT2i0mIbJys0GI6PT3N1/hJvrPxOFdRJNBQIy/FapI4Bpgohgcjuw+jq8jy8tV55MNBWI4ohS802CpizKv8q+FgALZAfYgSyAZtNro1oLaU1VvxCA029Oraxs7u/tKnXiNjn8HyKwur6lI++6vPK4V7IA7u+1Dyu1tr183ddNbkHuXP8/zEIYeFqiLRl6YO/p0bHJdflT/PD9qZa1W+ry99fcvlAlcZwUpuUAglIRYVgnDEIOlna4q0M/NPnuO1/PzMwg/045O/XeibUt5/Xangx6viSVFpK2jtMpvdyWCz+5ryf10clX3/amp6eZmJjgd441URWWJY8BAAAAAElFTkSuQmCC'], ['Trisquel', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABjFBMVEX///8AAAAAAAAAAAAAADMAAGYAAAAAHFUAGWYAF10AImYAIGAAHloAHGMAKGsAGmYAJmYAJGEAKnUAJ1gAMXYAJnEAJGQAI2EAK28AK3cAGTEAMHgALXEALXgALG0AFUAAI2oAK3EAMngANoYALXMANIAAM4IANIIAL3gANIcANokANoQANYQAOY0ANIYANooAN4kAN40AOY0APZMANIUAOY0AO5AAPZUAPJAAP5MAPpQAQJUAOYsAPpYANoUAPpoAPpUAM4AAQJkAPZIAPJEAQpgAN4cAPpQAPZUAPJEAO4oAOosAOo8AQJoAOYsAO44AQpsAO48AQp0AP5UAQpoARJwAQ58ARaAAQZgAQ54AQ50AQpgARaIARqMARaMARaIAR6QARaIARaEASakARKEAR6MASqsARKEASKcAR6MARqYAR6UATbEATa8ARqUARKAAR6oARqMASKgATK8AR6QATbIATbAASq0AR6cASKgASqwAR6UASKcATa8ASqoASqwAS6wASKoAS60ATbHn4CTpAAAAhHRSTlMAAQIFBQUGCQoLDxAREhMUFBUYGhobHB0eHh8gIiIjJCQkJCYoLC0xMTE0NDo6Oz1BQUNHSUxOVFVVVldaWl5iY2RkZWZoamtsb3FycnR1ent9f4KDhIiJioyNk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1KbTdARACIowArYe1ergfNT2i0mIbJys0GI6PT3N1/hJvrPxOFdRJNBQIy/FapI4Bpgohgcjuw+jq8jy8tV55MNBWI4ohS802CpizKv8q+FgALZAfYgSyAZtNro1oLaU1VvxCA029Oraxs7u/tKnXiNjn8HyKwur6lI++6vPK4V7IA7u+1Dyu1tr183ddNbkHuXP8/zEIYeFqiLRl6YO/p0bHJdflT/PD9qZa1W+ry99fcvlAlcZwUpuUAglIRYVgnDEIOlna4q0M/NPnuO1/PzMwg/045O/XeibUt5/Xangx6viSVFpK2jtMpvdyWCz+5ryf10clX3/amp6eZmJjgd441URWWJY8BAAAAAElFTkSuQmCC', + 'Trisquel': 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABjFBMVEX///8AAAAAAAAAAAAAADMAAGYAAAAAHFUAGWYAF10AImYAIGAAHloAHGMAKGsAGmYAJmYAJGEAKnUAJ1gAMXYAJnEAJGQAI2EAK28AK3cAGTEAMHgALXEALXgALG0AFUAAI2oAK3EAMngANoYALXMANIAAM4IANIIAL3gANIcANokANoQANYQAOY0ANIYANooAN4kAN40AOY0APZMANIUAOY0AO5AAPZUAPJAAP5MAPpQAQJUAOYsAPpYANoUAPpoAPpUAM4AAQJkAPZIAPJEAQpgAN4cAPpQAPZUAPJEAO4oAOosAOo8AQJoAOYsAO44AQpsAO48AQp0AP5UAQpoARJwAQ58ARaAAQZgAQ54AQ50AQpgARaIARqMARaMARaIAR6QARaIARaEASakARKEAR6MASqsARKEASKcAR6MARqYAR6UATbEATa8ARqUARKAAR6oARqMASKgATK8AR6QATbIATbAASq0AR6cASKgASqwAR6UASKcATa8ASqoASqwAS6wASKoAS60ATbHn4CTpAAAAhHRSTlMAAQIFBQUGCQoLDxAREhMUFBUYGhobHB0eHh8gIiIjJCQkJCYoLC0xMTE0NDo6Oz1BQUNHSUxOVFVVVldaWl5iY2RkZWZoamtsb3FycnR1ent9f4KDhIiJioyNkJGYm5+foqOkpqamqKmqrKytsL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4kxgZxegzVkBzlQ2NKBG2+iJIMqMok9r8OLRIMqApToSqmAWTmk9B2+o2YW79oshU7ABcuvAFrVGWXkVKpBYoSaBSxIS2mINpiwbjZiUMZRloVfJQyaXDKObBpimBScpHFe8KmmXpaKhK3arGrBVuVBclHN2CiPNin1OVs1tVJYlQlyZBxA6DviQVo6ZaOKd7sTplw53BVugruBBzfsRslw7rZPxaczWutSpQV/gzJPxo1JexyfaxKBBpuiEx+tw+CpKdEvGWTprGlhcwqbIzL5/DYKMYndpK3L1hxf3ZfkrzwybUZjPhnOqmvlcmutFF1jis9QSShOrcWNSXJ1MA0ou/NZWc8Ddfe4VGO3bk0JON1dyMMlK+gmxNrZCFhZF2Kng7YNO0awt4b7wLNp2EqtAsF6ImP56SG0B6siovTYpIjg15gapCVhAfJRUyIBFEo6k8AyuTtkcC/qvG/XbDexulWJvqgYH0o0nKhVHFJ40XwFQnWM5OCX+XMg86c3KvVMSMapCmPpSTIygTxGKZZOcOXhrr3Mp4uzkFuG6B3ajE3TELDDU8qEmsmvRATxquKkxAnSTFjwKEfv3JU9JC5unG6rQ1bTkbQ4Yq/DVgxOqwBWt2K9Yne3ZCZvrgHO2k5paHzOhSiVCZSkdNTgzy40JRlPgDhDHBCxUZdCs91G8fLeK87zOl6XSOICZYXMGNhDqX9fDP/mbK2DXVi/szm03eLpejl5pzOfqwOt4JBT8OeYwQt/4R/BR0OzXiLCM5LOCji/4nXt46rpywgG+zor5RxgSdupBzJdglSY+5ZZbl3XNY6mbn7W0Lcx06zBg1WBjtcC6OmG+OmRTrFrnIUZESZeVeCpwh8TpiPsQ47/tloM97T+/6m8mg55mT3tStyL54mhlwwtszNvjzD8/6HH8i7PvvPPRioZdRWuDBZUR6pEWG7I8P9Xs1Jsj36MfvvO5J/+rTw58dP7afJPfBgeef3XGz/gskFVpJc4HwGwAAAABJRU5ErkJggg==' + } } }; @@ -11220,7 +10313,7 @@ return null; } } - position = "" + (Conf['Mascot Position'] === 'bottom' || (Conf['Mascot Position'] === "default" && Conf['Post Form Style'] !== "fixed") ? 0 + ((g.VIEW !== 'thread' || Conf['Boards Navigation'] === 'Sticky bottom') && Conf['4chan SS Navigation'] ? 1.6 : 0) : 20.3 + (g.VIEW !== 'thread' || !!$('#postForm input[name=spoiler]') ? 1.4 : 0) + (Conf['Show Post Form Header'] ? 1.5 : 0) + (Conf['Post Form Decorations'] ? 0.2 : 0)) + "em"; + position = "" + (Conf['Mascot Position'] === 'bottom' || (Conf['Mascot Position'] === "default" && Conf['Post Form Style'] !== "fixed") ? 0 + ((g.VIEW !== 'thread' || Conf['Bottom Header']) && Conf['4chan SS Navigation'] ? 1.6 : 0) : 20.3 + (g.VIEW !== 'thread' || !!$('#postForm input[name=spoiler]') ? 1.4 : 0) + (Conf['Show Post Form Header'] ? 1.5 : 0) + (Conf['Post Form Decorations'] ? 0.2 : 0)) + "em"; if (Conf['editMode']) { if (!(mascot = editMascot || (mascot = Mascots[Conf["mascot"]]))) { return; @@ -11658,7 +10751,7 @@ return setTimeout((function() { var exLink; - Style.padding.nav = Header.nav; + Style.padding.nav = Header.bar; Style.padding.pages = $(".pagelist", d.body); Style.padding(); $.on(window, "resize", Style.padding); @@ -11819,7 +10912,7 @@ hide: 2 }[_conf['Sidebar']] || (252 + Style.sidebarOffset.W); Style.replyMargin = _conf["Post Spacing"]; - return css = "/* Cleanup */\n#absbot,\n#delPassword,\n#delform > hr:last-of-type,\n#navbotright,\n#postForm,\n#styleSwitcher,\n.boardBanner > div,\n.mobile,\n.postingMode,\n.riced,\n.sideArrows,\n.stylechanger,\nbody > br,\nbody > div[style^=\"text-align\"],\nbody > hr {\n display: none;\n}\n/* Empties */\n#qr .warning:empty,\n#qr-thread-select:empty {\n display: none;\n}\n/* File Name Trunctuate */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\n display: none;\n}\n/* Unnecessary */\n#qp input,\n#qp .rice,\n.inline .rice {\n display: none !important;\n}\n/* Hidden Content */\n.forwarded,\n.hidden_thread ~ div,\n.hidden_thread ~ a,\n.replyContainer .stub ~ div,\n.replyContainer .stub ~ a,\n.stub + div,\n[hidden] {\n display: none !important;\n}\n/* Hidden UI */\n#catalog,\n#navlinks,\n#navtopright,\n.cataloglink,\n.navLinks,\na[style=\"cursor: pointer; float: right;\"] {\n position: fixed;\n top: 100%;\n left: 100%;\n}\n/* Hide last horizontal rule, keep clear functionality. */\n.board > hr:last-of-type {\n visibility: hidden;\n}\n/* Fappe Tyme */\n.fappeTyme .thread > .noFile {\n display: none;\n}\n/* Defaults */\na {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n outline: none;\n}\nbody,\nhtml {\n min-height: 100%;\n " + Style.sizing + ": border-box;\n}\nbody {\n outline: none;\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n min-height: 100%;\n margin-top: 0;\n margin-bottom: 0;\n margin-" + Style.sidebarLocation[0] + ": " + (/^boards\.4chan\.org$/.test(location.hostname) ? Style.sidebar : '2') + "px;\n margin-" + Style.sidebarLocation[1] + ": 2px;\n padding: 0 " + (parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px 0 " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"]) + "px;\n}\nbody.unscroll {\n overflow: hidden;\n}\n" + (_conf["4chan SS Sidebar"] && /^boards\.4chan\.org$/.test(location.hostname) ? "body::before { content: ''; position: fixed; top: 0; bottom: 0; " + Style.sidebarLocation[0] + ": 0; width: " + (_conf['Sidebar'] === 'large' ? 305 : _conf['Sidebar'] === 'normal' ? 254 : _conf['Sidebar'] === 'minimal' ? 27 : 0) + "px; z-index: 1; " + Style.sizing + ": border-box; display: block;}body { padding-" + Style.sidebarLocation[0] + ": 2px;}" : "") + "\nbutton,\ninput,\ntextarea {\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n}\nhr {\n clear: both;\n border: 0;\n padding: 0;\n margin: 0 0 1px;\n " + (_conf['Hide Horizontal Rules'] ? 'visibility: hidden;' : '') + "\n}\n.center {\n text-align: center;\n}\n.disabled {\n opacity: 0.5;\n}\n/* Symbols */\n.drop-marker {\n vertical-align: middle;\n display: inline-block;\n margin: 2px 2px 3px;\n border-top: .5em solid;\n border-right: .3em solid transparent;\n border-left: .3em solid transparent;\n}\n.brackets-wrap::before {\n content: \"\\00a0[\";\n}\n.brackets-wrap::after {\n content: \"]\\00a0\";\n}\n/* Thread / Reply Nav */\n#navlinks a {\n position: fixed;\n z-index: 12;\n opacity: 0.5;\n display: inline-block;\n border-right: 6px solid transparent;\n border-left: 6px solid transparent;\n margin: 1.5px;\n}\n/* Header */\n#header-bar {\n z-index: 6;\n border-width: 1px;\n position: absolute;\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + (_conf["Hide Navigation Decorations"] ? " font-size: 0; color: transparent; word-spacing: 2px;" : "") + "\n text-align: " + _conf["Navigation Alignment"] + ";\n}\n.fixed #header-bar {\n position: fixed;\n}\n.top #header-bar {\n top: 0;\n border-top-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : "") + "\"\n}\n.fixed.bottom #header-bar {\n bottom: 0;\n border-bottom-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\"\n}\n.hide #header-bar {\n position: fixed;\n top: 110%;\n bottom: auto;\n}\n/* Header Autohide */\n.fixed #header-bar.autohide:not(:hover) {\n box-shadow: none;\n transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);\n}\n.fixed.top #header-bar.autohide:not(:hover) {\n margin-bottom: -1em;\n " + agent + "transform: translateY(-100%);\n}\n.fixed.bottom #header-bar.autohide:not(:hover) {\n " + agent + "transform: translateY(100%);\n}\n#scroll-marker {\n left: 0;\n right: 0;\n height: 10px;\n position: absolute;\n}\n#header-bar #scroll-marker {\n display: none;\n}\n.fixed #header-bar #scroll-marker {\n display: block;\n}\n.fixed.top header-bar #scroll-marker {\n top: 100%;\n}\n.fixed.bottom #header-bar #scroll-marker {\n bottom: 100%;\n}\n/* Notifications */\n#notifications {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n}\n.fixed.top #notifications {\n position: absolute;\n top: 100%;\n}\n.notification {\n display: block;\n overflow: hidden;\n width: 300px;\n border: 1px solid;\n " + (_conf['Sidebar Location'] === 'left' ? 'margin-left: auto;' : '') + "\n}\n.notification:not(:first-of-type) {\n border-top: none;\n}\n.close {\n float: right;\n}\n/* Main Menu */\n#main-menu {\n margin: 0;\n border: 2px solid;\n border-radius: 10px;\n height: 14px;\n width: 14px;\n " + Style.sizing + ": border-box;\n border-color: rgb(130,130,130);\n color: rgb(130,130,130);\n}\n#main-menu::after {\n content: '';\n font-size: 10px;\n position: absolute;\n top: 50%;\n left: 50%;\n " + agent + "transform: translate(-60%, -50%);\n display: block;\n border-top: 5px solid rgb(130, 130, 130);\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n width: 7px;\n " + Style.sizing + ": border-box;\n} \n/* Pagination */\n.pagelist {\n border-width: 1px;\n text-align: " + _conf["Pagination Alignment"] + ";\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + { + return css = "/* Cleanup */\n#absbot,\n#boardNavDesktop,\n#delPassword,\n#delform > hr:last-of-type,\n#navbotright,\n#postForm,\n#styleSwitcher,\n.boardBanner > div,\n.mobile,\n.postingMode,\n.riced,\n.sideArrows,\n.stylechanger,\nbody > br,\nbody > div[style^=\"text-align\"],\nbody > hr {\n display: none;\n}\n/* Empties */\n#qr .warning:empty,\n#qr-thread-select:empty {\n display: none;\n}\n/* File Name Trunctuate */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\n display: none;\n}\n/* Unnecessary */\n#qp input,\n#qp .rice,\n.inline .rice {\n display: none !important;\n}\n/* Hidden Content */\n.forwarded,\n.hidden_thread ~ div,\n.hidden_thread ~ a,\n.replyContainer .stub ~ div,\n.replyContainer .stub ~ a,\n.stub + div,\n[hidden] {\n display: none !important;\n}\n/* Hidden UI */\n#catalog,\n#navlinks,\n#navtopright,\n.cataloglink,\n.navLinks,\na[style=\"cursor: pointer; float: right;\"] {\n position: fixed;\n top: 100%;\n left: 100%;\n}\n/* Hide last horizontal rule, keep clear functionality. */\n.board > hr:last-of-type {\n visibility: hidden;\n}\n/* Fappe Tyme */\n.fappeTyme .thread > .noFile {\n display: none;\n}\n/* Defaults */\na {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n outline: none;\n}\nbody,\nhtml {\n min-height: 100%;\n " + Style.sizing + ": border-box;\n}\nbody {\n outline: none;\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n min-height: 100%;\n margin-top: 0;\n margin-bottom: 0;\n margin-" + Style.sidebarLocation[0] + ": " + (/^boards\.4chan\.org$/.test(location.hostname) ? Style.sidebar : '2') + "px;\n margin-" + Style.sidebarLocation[1] + ": 2px;\n padding: 0 " + (parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px 0 " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"]) + "px;\n}\nbody.unscroll {\n overflow: hidden;\n}\n" + (_conf["4chan SS Sidebar"] && /^boards\.4chan\.org$/.test(location.hostname) ? "body::before { content: ''; position: fixed; top: 0; bottom: 0; " + Style.sidebarLocation[0] + ": 0; width: " + (_conf['Sidebar'] === 'large' ? 305 : _conf['Sidebar'] === 'normal' ? 254 : _conf['Sidebar'] === 'minimal' ? 27 : 0) + "px; z-index: 1; " + Style.sizing + ": border-box; display: block;}body { padding-" + Style.sidebarLocation[0] + ": 2px;}" : "") + "\nbutton,\ninput,\ntextarea {\n font-size: " + (parseInt(_conf["Font Size"], 10)) + "px;\n font-family: " + _conf["Font"] + ";\n}\nhr {\n clear: both;\n border: 0;\n padding: 0;\n margin: 0 0 1px;\n " + (_conf['Hide Horizontal Rules'] ? 'visibility: hidden;' : '') + "\n}\n.center {\n text-align: center;\n}\n.disabled {\n opacity: 0.5;\n}\n/* Symbols */\n.drop-marker {\n vertical-align: middle;\n display: inline-block;\n margin: 2px 2px 3px;\n border-top: .5em solid;\n border-right: .3em solid transparent;\n border-left: .3em solid transparent;\n}\n.brackets-wrap::before {\n content: \"\\00a0[\";\n}\n.brackets-wrap::after {\n content: \"]\\00a0\";\n}\n/* Thread / Reply Nav */\n#navlinks a {\n position: fixed;\n z-index: 12;\n opacity: 0.5;\n display: inline-block;\n border-right: 6px solid transparent;\n border-left: 6px solid transparent;\n margin: 1.5px;\n}\n/* Header */\n#header-bar {\n z-index: 6;\n border-width: 1px;\n position: absolute;\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + (_conf["Hide Navigation Decorations"] ? " font-size: 0; color: transparent; word-spacing: 2px;" : "") + "\n text-align: " + _conf["Navigation Alignment"] + ";\n}\n.fixed #header-bar.autohide {\n z-index: 24;\n}\n.fixed #header-bar {\n position: fixed;\n}\n.top #header-bar {\n top: 0;\n border-top-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : "") + "\"\n}\n.fixed.bottom #header-bar {\n bottom: 0;\n border-bottom-width: 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\"\n}\n.hide #header-bar {\n position: fixed;\n top: 110%;\n bottom: auto;\n}\n/* Header Autohide */\n.fixed #header-bar.autohide:not(:hover) {\n box-shadow: none;\n transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);\n}\n.fixed.top #header-bar.autohide:not(:hover) {\n margin-bottom: -1em;\n " + agent + "transform: translateY(-100%);\n}\n.fixed.bottom #header-bar.autohide:not(:hover) {\n " + agent + "transform: translateY(100%);\n}\n#scroll-marker {\n left: 0;\n right: 0;\n height: 10px;\n position: absolute;\n}\n#header-bar #scroll-marker {\n display: none;\n}\n.fixed #header-bar #scroll-marker {\n display: block;\n}\n.fixed.top header-bar #scroll-marker {\n top: 100%;\n}\n.fixed.bottom #header-bar #scroll-marker {\n bottom: 100%;\n}\n/* Notifications */\n#notifications {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n}\n.fixed.top #notifications {\n position: absolute;\n top: 100%;\n}\n.notification {\n display: block;\n overflow: hidden;\n width: 300px;\n border: 1px solid;\n " + (_conf['Sidebar Location'] === 'left' ? 'margin-left: auto;' : '') + "\n}\n.notification:not(:first-of-type) {\n border-top: none;\n}\n.close {\n float: right;\n}\n/* Main Menu */\n#main-menu {\n margin: 0;\n border: 2px solid;\n border-radius: 10px;\n height: 14px;\n width: 14px;\n " + Style.sizing + ": border-box;\n border-color: rgb(130,130,130);\n color: rgb(130,130,130);\n}\n#main-menu::after {\n content: '';\n font-size: 10px;\n position: absolute;\n top: 50%;\n left: 50%;\n " + agent + "transform: translate(-60%, -50%);\n display: block;\n border-top: 5px solid rgb(130, 130, 130);\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n width: 7px;\n " + Style.sizing + ": border-box;\n} \n/* Pagination */\n.pagelist {\n border-width: 1px;\n text-align: " + _conf["Pagination Alignment"] + ";\n" + (_conf['4chan SS Navigation'] ? " left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important;" : " " + Style.sidebarLocation[0] + ": " + (Style.sidebar + parseInt(_conf["Right Thread Padding"], 10) + editSpace["right"]) + "px; " + Style.sidebarLocation[1] + ": " + (parseInt(_conf["Left Thread Padding"], 10) + editSpace["left"] + 2) + "px;") + "\n" + { "sticky top": " position: fixed; top: 0; border-top-width: 0; " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : ""), "sticky bottom": " position: fixed; bottom: 0; border-bottom-width: 0; " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : ""), "top": " position: absolute; top: 0; border-top-width: 0; " + (_conf["Rounded Edges"] ? "border-radius: 0 0 3px 3px;" : ""), @@ -11838,7 +10931,7 @@ "under post form": " position: fixed; " + Style.sidebarLocation[0] + ": 2px; bottom: 140px; width: " + width + "px;", "at top": " margin: 12px 0;", "hide": " display: none;" - }[_conf["Board Title"]] + "\n}\n.boardTitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) + 10) + "px;\n}\n.boardSubtitle,\n.boardSubtitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) - 1) + "px;\n}\n/* Dialogs */\n.move {\n cursor: pointer;\n}\n#ihover {\n position: fixed;\n max-height: 97%;\n max-width: 75%;\n padding: 10px;\n z-index: 22;\n}\n#qp {\n position: fixed;\n z-index: 22;\n}\n#qp .postMessage::after {\n clear: both;\n display: block;\n content: \"\";\n}\n#qp .full-image {\n max-height: 300px;\n max-width: 500px;\n}\n#menu {\n position: fixed;\n outline: none;\n z-index: 22;\n}\n/* Updater */\n#updater {\n position: fixed;\n z-index: 10;\n padding: 0 1px 1px;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n#updater:hover {\n z-index: 30;\n} \n#updater:not(:hover) > div:not(.move) {\n display: none;\n}\n#updater input {\n text-align: right;\n}\n#updater .field {\n width: 50px;\n}\n/* Stats */\n#thread-stats {\n position: fixed;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n z-index: 10;\n}\n/* Image Expansion */\n.fit-width .full-image {\n max-width: 100%;\n width: 100%;\n}\n" + (_conf['Images Overlap Post Form'] ? ".full-image { position: relative; z-index: 22;}" : "") + "\n/* Prefetcher */\n#prefetch {\n z-index: 9;\n position: fixed;\n}\n/* Delete Buttons */\n" + (_conf['Hide Delete UI'] ? ".deleteform,.post:not(#exlinks-options) .rice { display: none;}.postInfo { padding: 0 0 0 3px;}" : ".deleteform { position: fixed; z-index: 18; width: 0; bottom: 0; right: 0; border-width: 1px 0 0 1px; border-style: solid; font-size: 0; color: transparent;}.deleteform:hover { width: auto;}.deleteform::before { z-index: 18; border-width: 1px 0 0 1px; border-style: solid; content: 'X'; display: block; position: fixed; bottom: 0; right: 0; font-size: " + _conf['Font Size'] + "px; " + Style.sizing + ": border-box; height: 1.6em; width: 1.4em; text-align: center;}.deleteform:hover::before { display: none;}.deleteform input { margin: 0 1px 0 0;}") + "\n/* Slideout Navigation */\n#boardNavDesktopFoot {\n position: fixed;\n width: " + width + "px;\n " + Style.sidebarLocation[0] + ": 2px;\n text-align: center;\n font-size: 0;\n color: transparent;\n overflow: hidden;\n " + Style.sizing + ": border-box;\n}\n#boardNavDesktopFoot a,\n#boardNavDesktopFoot a::after,\n#boardNavDesktopFoot a::before {\n font-size: " + _conf['Font Size'] + "px;\n}\n#boardNavDesktopFoot:hover {\n overflow-y: auto;\n padding: 2px;\n}\n#boardNavDesktopFoot:not(:hover) {\n border-color: transparent;\n background-color: transparent;\n height: 0;\n overflow: hidden;\n padding: 0;\n border: 0 none;\n}\n" + { + }[_conf["Board Title"]] + "\n}\n.boardTitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) + 10) + "px;\n}\n.boardSubtitle,\n.boardSubtitle a {\n font-size: " + (parseInt(_conf["Font Size"], 10) - 1) + "px;\n}\n/* Dialogs */\n.move {\n cursor: pointer;\n}\n#ihover {\n position: fixed;\n max-height: 97%;\n max-width: 75%;\n padding: 10px;\n z-index: 22;\n}\n#qp {\n position: fixed;\n z-index: 22;\n}\n#qp .postMessage::after {\n clear: both;\n display: block;\n content: \"\";\n}\n#qp .full-image {\n max-height: 300px;\n max-width: 500px;\n}\n#menu {\n position: fixed;\n outline: none;\n z-index: 22;\n}\n/* Image Expansion */\n.fit-width .full-image {\n max-width: 100%;\n width: 100%;\n}\n" + (_conf['Images Overlap Post Form'] ? ".full-image { position: relative; z-index: 22;}" : "") + "\n/* Prefetcher */\n#prefetch {\n z-index: 9;\n position: fixed;\n}\n/* Delete Buttons */\n" + (_conf['Hide Delete UI'] ? ".deleteform,.post:not(#exlinks-options) .rice { display: none;}.postInfo { padding: 0 0 0 3px;}" : ".deleteform { position: fixed; z-index: 18; width: 0; bottom: 0; right: 0; border-width: 1px 0 0 1px; border-style: solid; font-size: 0; color: transparent;}.deleteform:hover { width: auto;}.deleteform::before { z-index: 18; border-width: 1px 0 0 1px; border-style: solid; content: 'X'; display: block; position: fixed; bottom: 0; right: 0; font-size: " + _conf['Font Size'] + "px; " + Style.sizing + ": border-box; height: 1.6em; width: 1.4em; text-align: center;}.deleteform:hover::before { display: none;}.deleteform input { margin: 0 1px 0 0;}") + "\n/* Slideout Navigation */\n#boardNavDesktopFoot {\n position: fixed;\n width: " + width + "px;\n " + Style.sidebarLocation[0] + ": 2px;\n text-align: center;\n font-size: 0;\n color: transparent;\n overflow: hidden;\n " + Style.sizing + ": border-box;\n}\n#boardNavDesktopFoot a,\n#boardNavDesktopFoot a::after,\n#boardNavDesktopFoot a::before {\n font-size: " + _conf['Font Size'] + "px;\n}\n#boardNavDesktopFoot:hover {\n overflow-y: auto;\n padding: 2px;\n}\n#boardNavDesktopFoot:not(:hover) {\n border-color: transparent;\n background-color: transparent;\n height: 0;\n overflow: hidden;\n padding: 0;\n border: 0 none;\n}\n" + { compact: "#boardNavDesktopFoot { word-spacing: 1px;}", list: "#boardNavDesktopFoot a { display: block;}#boardNavDesktopFoot:hover { max-height: 400px;}#boardNavDesktopFoot a::after { content: ' - ' attr(title);}#boardNavDesktopFoot a[href*='//boards.4chan.org/']::after,#boardNavDesktopFoot a[href*='//rs.4chan.org/']::after { content: '/ - ' attr(title);}#boardNavDesktopFoot a[href*='//boards.4chan.org/']::before,#boardNavDesktopFoot a[href*='//rs.4chan.org/']::before { content: '/';}", hide: "#boardNavDesktopFoot { display: none;}" @@ -11854,7 +10947,7 @@ "slideout": "#qrtab input,#qrtab .rice { display: none;}#qr { top: auto !important; bottom: 1.7em !important; " + Style.sidebarLocation[0] + ": 0 !important; " + Style.sidebarLocation[1] + ": auto !important; " + agent + "transform: translateX(" + xOffset + "93%);}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transform: translate(0);}", "tabbed slideout": "#qr { top: auto !important; bottom: 1.7em !important; " + Style.sidebarLocation[0] + ": 0 !important; " + Style.sidebarLocation[1] + ": auto !important; " + agent + "transform: translateX(" + xOffset + "100%);}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transform: translateX(0);}#qrtab { " + agent + "transform: rotate(" + (Style.sidebarLocation[0] === "left" ? "" : "-") + "90deg); " + agent + "transform-origin: bottom " + Style.sidebarLocation[0] + "; position: absolute; top: 0; " + Style.sidebarLocation[0] + ": 100%; width: 110px; text-align: center; border-width: 1px 1px 0 1px; cursor: default;}#qr:hover #qrtab,#qr.has-focus #qrtab,#qr.dump #qrtab { opacity: 0; " + Style.sidebarLocation[0] + ": " + (252 + Style.sidebarOffset.W) + "px;}#qrtab input,#qrtab .close,#qrtab .rice,#qrtab span { display: none;}", "transparent fade": "#qr { overflow: visible; top: auto !important; bottom: 1.7em !important; " + Style.sidebarLocation[0] + ": 2px !important; " + Style.sidebarLocation[1] + ": auto !important; opacity: 0.2; " + agent + "transition: opacity .3s ease-in-out 1s;}#qr:hover,#qr.has-focus,#qr.dump { opacity: 1; " + agent + "transition: opacity .3s linear;}" - }[_conf['Post Form Style']] || "") + "\n\n" + (_conf['Post Form Style'] !== 'tabbed slideout' ? (!(_conf['Post Form Style'] === 'float' || _conf['Show Post Form Header']) ? "#qrtab { display: none; }" : _conf['Post Form Style'] !== 'slideout' ? ".autohide:not(:hover):not(.has-focus) > form { display: none !important; }" : "") + "#qrtab { margin-bottom: 1px; }" : "") + "\n\n" + (_conf['Post Form Style'] !== 'float' && _conf["Post Form Slideout Transitions"] ? "#qr { " + agent + "transition: " + agent + "transform .3s ease-in-out 1s;}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transition: " + agent + "transform .3s linear;}#qrtab { " + agent + "transition: opacity .3s ease-in-out 1s;}#qr:hover #qrtab { " + agent + "transition: opacity .3s linear;}" : "") + "\n\n#qr .close {\n float: right;\n padding: 0 3px;\n}\n#qr .warning {\n min-height: 1.6em;\n vertical-align: middle;\n padding: 0 1px;\n border-width: 1px;\n border-style: solid;\n}\n.persona {\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-button {\n width: 10%;\n margin: 0;\n}\n\n" + (_conf['Compact Post Form Inputs'] ? ".persona input.field { width: 29.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 14.8em; min-height: 9em;}#qr.has-captcha textarea.field { height: 9em;}" : ".persona input.field { width: 100%;}.persona input.field[name='name'] { width: 89.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 11.6em; min-height: 6em;}#qr.has-captcha textarea.field { height: 6em;}") + "\n\n" + (_conf["Tripcode Hider"] ? ".tripped:not(:hover):not(:focus) { opacity: 0;}" : "") + "\n\n#qr textarea {\n resize: " + _conf['Textarea Resize'] + ";\n}\n.captcha-img {\n margin: 1px 0 0;\n text-align: center;\n line-height: 0;\n}\n.captcha-img img {\n width: 100%;\n height: 4em;\n width: 246px;\n}\n.captcha-input {\n width: 100%;\n margin: 1px 0 0;\n}\n.field,\n.selectrice,\nbutton,\ninput:not([type=radio]) {\n " + Style.sizing + ": border-box;\n font-size: " + (parseInt(_conf['Font Size'], 10)) + "px;\n height: 1.6em;\n margin: 1px 0 0;\n vertical-align: bottom;\n padding: 0 1px;\n}\n#qr textarea {\n min-width: 100%;\n}\n#qr [type='submit'] {\n width: 25%;\n}\n[type='file'] {\n position: absolute;\n opacity: 0;\n z-index: -1;\n}\n#showQR {\n display: " + (_conf["Hide Show Post Form"] ? "none" : "block") + ";\n z-index: 4;\n " + Style.sidebarLocation[0] + ": 2px;\n width: " + width + "px;\n background-color: transparent;\n text-align: center;\n position: fixed;\n top: auto;\n}\n/* Fake File Input */\n#qr-filename,\n.has-file #qr-no-file {\n display: none;\n}\n#qr-no-file,\n.has-file #qr-filename {\n display: block;\n}\n#qr-filename-container {\n " + Style.sizing + ": border-box;\n display: inline-block;\n position: relative;\n width: 100px;\n min-width: 74.6%;\n max-width: 74.6%;\n margin-right: 0.4%;\n overflow: hidden;\n padding: 2px 1px 0;\n}\n#qr-filerm {\n position: absolute;\n right: 3px;\n top: 2px;\n z-index: 2;\n}\n/* Thread Select / Spoiler Label */\n#qr-thread-select {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n}\n#qr-spoiler-label {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n text-align: right;\n}\n/* Dumping UI */\n.dump #dump-list-container {\n display: block;\n}\n#dump-list-container {\n display: none;\n position: relative;\n overflow-y: hidden;\n margin-top: 1px;\n}\n#dump-list {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: pre;\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-list:hover {\n overflow-x: auto;\n}\n.qr-preview {\n " + Style.sizing + ": border-box;\n counter-increment: thumbnails;\n cursor: move;\n display: inline-block;\n height: 90px;\n width: 90px;\n padding: 2px;\n opacity: .5;\n overflow: hidden;\n position: relative;\n text-shadow: 0 1px 1px #000;\n " + agent + "transition: opacity .25s ease-in-out;\n vertical-align: top;\n}\n.qr-preview:hover,\n.qr-preview:focus {\n opacity: .9;\n}\n.qr-preview::before {\n content: counter(thumbnails);\n color: #fff;\n position: absolute;\n top: 3px;\n right: 3px;\n text-shadow: 0 0 3px #000, 0 0 8px #000;\n}\n.qr-preview#selected {\n opacity: 1;\n}\n.qr-preview.drag {\n box-shadow: 0 0 10px rgba(0,0,0,.5);\n}\n.qr-preview.over {\n border-color: #fff;\n}\n.qr-preview > span {\n color: #fff;\n}\n.remove {\n background: none;\n color: #e00;\n font-weight: 700;\n padding: 3px;\n}\na:only-of-type > .remove {\n display: none;\n}\n.remove:hover::after {\n content: \" Remove\";\n}\n.qr-preview > label {\n background: rgba(0,0,0,.5);\n color: #fff;\n right: 0; bottom: 0; left: 0;\n position: absolute;\n text-align: center;\n}\n.qr-preview > label > input {\n margin: 0;\n}\n#add-post {\n cursor: pointer;\n font-size: 2em;\n position: absolute;\n top: 50%;\n right: 10px;\n " + agent + "transform: translateY(-50%);\n}\n/* Ads */\n.topad img,\n.middlead img,\n.bottomad img {\n opacity: 0.3;\n " + agent + "transition: opacity .3s linear;\n}\n.topad img:hover,\n.middlead img:hover,\n.bottomad img:hover {\n opacity: 1;\n}\n" + (_conf["Block Ads"] ? "/* AdBlock Minus */.bottomad + hr,.topad img,.middlead img,.bottomad img { display: none;}" : "") + "\n" + (_conf["Shrink Ads"] ? ".topad a img,.middlead a img,.bottomad a img { width: 500px; height: auto;}" : "") + "\n/* Options */\n#overlay {\n position: fixed;\n z-index: 30;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: rgba(0,0,0,.5);\n}\n#appchanx-settings {\n width: auto;\n left: 15%;\n right: 15%;\n top: 15%;\n bottom: 15%;\n position: fixed;\n z-index: 31;\n padding: .3em;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.description {\n display: none;\n}\n#appchanx-settings h3,\n.section-keybinds,\n.section-mascots,\n.section-script,\n.style {\n text-align: center;\n}\n.section-keybinds table,\n.section-script fieldset,\n.section-style fieldset {\n text-align: left;\n}\n.section-keybinds table {\n margin: auto;\n}\n#appchanx-settings fieldset {\n padding: 5px 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n vertical-align: top;\n " + (_conf["Single Column Mode"] ? "margin: 0 auto 6px;" : "margin: 0 3px 6px;\n display: inline-block;") + "\n border: 0;\n}\n.section-container {\n overflow: auto;\n position: absolute;\n top: 1.7em;\n right: 5px;\n bottom: 5px;\n left: 5px;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.sections-list {\n padding: 0 3px;\n float: left;\n}\n.sections-list > a {\n cursor: pointer;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\n position: relative;\n padding: 0 4px;\n z-index: 1;\n height: 1.4em;\n display: inline-block;\n border-width: 1px 1px 0 1px;\n border-color: transparent;\n border-style: solid;\n}\n.credits {\n float: right;\n}\n#appchanx-settings h3 {\n margin: 0;\n}\n.section-script fieldset > div,\n.section-style fieldset > div,\n.section-rice fieldset > div {\n overflow: visible;\n padding: 0 5px 0 7px;\n}\n#appchanx-settings tr:nth-of-type(2n+1),\n.section-script fieldset > div:nth-of-type(2n+1),\n.section-rice fieldset > div:nth-of-type(2n+1),\n.section-style fieldset > div:nth-of-type(2n+1),\n.section-keybinds tr:nth-of-type(2n+1),\n#selectrice li:nth-of-type(2n+1) {\n background-color: rgba(0, 0, 0, 0.05);\n}\narticle li {\n margin: 10px 0 10px 2em;\n}\n#appchanx-settings .option {\n width: 50%;\n display: inline-block;\n vertical-align: bottom;\n}\n.option input {\n width: 100%;\n}\n.optionlabel {\n padding-left: 18px;\n}\n.rice + .optionlabel {\n padding-left: 0;\n}\n.section-script fieldset,\n.styleoption {\n text-align: left;\n}\n.section-style fieldset {\n width: 370px;\n}\n.section-script fieldset {\n width: 200px;\n}\n.suboptions,\n#mascotcontent,\n#themecontent {\n overflow: auto;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 1.7em;\n left: 0;\n}\n.mAlign {\n height: 250px;\n vertical-align: middle;\n display: table-cell;\n}\n#themecontent {\n top: 1.7em;\n}\n#save,\n.stylesettings {\n position: absolute;\n right: 10px;\n bottom: 0;\n}\n.section-style .suboptions {\n bottom: 0;\n}\n.section-container textarea {\n font-family: monospace;\n min-height: 350px;\n resize: vertical;\n width: 100%;\n}\n/* Hover Functionality */\n#mouseover {\n z-index: 33;\n position: fixed;\n max-width: 70%;\n}\n#mouseover:empty {\n display: none;\n}\n/* Mascot Tab */\n#mascot_hide {\n padding: 3px;\n position: absolute;\n top: 2px;\n right: 18px;\n}\n#mascot_hide .rice {\n float: left;\n}\n#mascot_hide > div {\n height: 0;\n text-align: right;\n overflow: hidden;\n}\n#mascot_hide:hover > div {\n height: auto;\n}\n#mascot_hide label {\n width: 100%;\n display: block;\n clear: both;\n text-decoration: none;\n}\n.mascots {\n padding: 0;\n text-align: center;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.mascot,\n.mascotcontainer {\n overflow: hidden;\n}\n.mascot {\n position: relative;\n border: none;\n margin: 5px;\n padding: 0;\n width: 200px;\n display: inline-block;\n background-color: transparent;\n}\n.mascotcontainer {\n height: 250px;\n border: 0;\n margin: 0;\n max-height: 250px;\n cursor: pointer;\n bottom: 0;\n border-width: 0 1px 1px;\n border-style: solid;\n border-color: transparent;\n overflow: hidden;\n}\n.mascot img {\n max-width: 200px;\n}\n.mascotname,\n.mascotoptions {\n padding: 0;\n width: 100%;\n}\n.mascot .mascotoptions {\nopacity: 0;\n " + agent + "transition: opacity .3s linear;\n}\n.mascot:hover .mascotoptions {\n opacity: 1;\n}\n.mascotoptions {\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.mascotoptions a {\n display: inline-block;\n width: 33%;\n}\n#upload {\n position: absolute;\n width: 100px;\n left: 50%;\n margin-left: -50px;\n text-align: center;\n bottom: 0;\n}\n#mascots_batch {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Themes Tab */\n#themes h1 {\n position: absolute;\n right: 300px;\n bottom: 10px;\n margin: 0;\n " + agent + "transition: all .2s ease-in-out;\n opacity: 0;\n}\n#themes .selectedtheme h1 {\n right: 11px;\n opacity: 1;\n}\n#themeContainer {\n margin-bottom: 3px;\n}\n#addthemes {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n.theme {\n margin: 1em;\n}\n/* Theme Editor */\n#themeConf {\n position: fixed;\n " + Style.sidebarLocation[1] + ": 2px;\n " + Style.sidebarLocation[0] + ": auto;\n top: 0;\n bottom: 0;\n width: 296px;\n z-index: 10;\n}\n#themebar input {\n width: 30%;\n}\n.option .color {\n width: 10%;\n border-left: none !important;\n color: transparent !important;\n}\n.option .colorfield {\n width: 90%;\n}\n.themevar textarea {\n min-width: 100%;\n max-width: 100%;\n height: 20em;\n resize: vertical;\n}\n/* Mascot Editor */\n#mascotConf {\n position: fixed;\n height: 17em;\n bottom: 0;\n left: 50%;\n width: 500px;\n margin-left: -250px;\n overflow: auto;\n z-index: 10;\n}\n#mascotConf .option,\n#mascotConf .optionlabel {\n " + Style.sizing + ": border-box;\n width: 50%;\n display: inline-block;\n vertical-align: middle;\n}\n#mascotConf .option input {\n width: 100%;\n}\n#close {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Catalog */\n#content .navLinks,\n#info .navLinks,\n.btn-wrap {\n display: block;\n}\n.navLinks > .btn-wrap:not(:first-of-type)::before {\n content: ' - ';\n}\n.button {\n cursor: pointer;\n}\n#content .btn-wrap,\n#info .btn-wrap {\n display: inline-block;\n}\n#settings .selectrice {\n width: 100px;\n display: inline-block;\n}\n#post-preview {\n position: absolute;\n z-index: 22;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n#settings,\n#threads,\n#info .navLinks,\n#content .navLinks {\n text-align: center;\n}\n#threads .thread {\n vertical-align: top;\n display: inline-block;\n word-wrap: break-word;\n overflow: hidden;\n margin-top: 5px;\n padding: 5px 0 3px;\n text-align: center;\n}\n.extended-small .thread,\n.small .thread {\n width: 165px;\n max-height: 320px;\n}\n.small .teaser,\n.large .teaser {\n display: none;\n}\n.extended-large .thread,\n.large .thread {\n width: 270px;\n max-height: 410px;\n}\n.extended-small .thumb,\n.small .thumb {\n max-width: 150px;\n max-height: 150px;\n}\n/* Front Page */\n#logo {\n text-align: center;\n}\n#doc {\n margin: 0 auto;\n width: 1000px;\n position: relative;\n}\n#boards .boxcontent {\n vertical-align: top;\n text-align: center;\n}\n#filter-container,\n#options-container {\n float: right;\n position: relative;\n}\n#optionssmenu {\n top: 100% !important;\n left: 0 !important;\n}\n#boards .column {\n " + Style.sizing + ": border-box;\n display: inline-block;\n width: 16em;\n text-align: left;\n vertical-align: top;\n}\n.bd ul,\n.boxcontent ul {\n vertical-align: top;\n padding: 0;\n}\n.right-box .boxcontent ul {\n padding: 0 10px;\n}\n.yuimenuitem,\n.boxcontent li {\n list-style-type: none;\n}\n.bd ul {\n margin: 0;\n}\n.yuimenuitem::before {\n content: \" [ ] \";\n font-family: monospace;\n}\n.yuimenuitem-checked::before {\n content: \" [x] \"\n}\n.yui-u {\n display: inline-block;\n vertical-align: top;\n width: 475px;\n margin: 10px;\n}\n#recent-images .boxcontent {\n text-align: center;\n}\n#ft {\n text-align: center;\n}\n#ft ul {\n padding: 0;\n}\n#ft li {\n list-style-type: none;\n display: inline-block;\n width: 100px;\n}\n#preview-tooltip-nws,\n#preview-tooltip-ws,\n#ft .fill,\n.clear-bug {\n display: none;\n}"; + }[_conf['Post Form Style']] || "") + "\n\n" + (_conf['Post Form Style'] !== 'tabbed slideout' ? (!(_conf['Post Form Style'] === 'float' || _conf['Show Post Form Header']) ? "#qrtab { display: none; }" : _conf['Post Form Style'] !== 'slideout' ? ".autohide:not(:hover):not(.has-focus) > form { display: none !important; }" : "") + "#qrtab { margin-bottom: 1px; }" : "") + "\n\n" + (_conf['Post Form Style'] !== 'float' && _conf["Post Form Slideout Transitions"] ? "#qr { " + agent + "transition: " + agent + "transform .3s ease-in-out 1s;}#qr:hover,#qr.has-focus,#qr.dump { " + agent + "transition: " + agent + "transform .3s linear;}#qrtab { " + agent + "transition: opacity .3s ease-in-out 1s;}#qr:hover #qrtab { " + agent + "transition: opacity .3s linear;}" : "") + "\n\n#qr .close {\n float: right;\n padding: 0 3px;\n}\n#qr .warning {\n min-height: 1.6em;\n vertical-align: middle;\n padding: 0 1px;\n border-width: 1px;\n border-style: solid;\n}\n.persona {\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-button {\n width: 10%;\n margin: 0;\n}\n\n" + (_conf['Compact Post Form Inputs'] ? ".persona input.field { width: 29.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 14.8em; min-height: 9em;}#qr.has-captcha textarea.field { height: 9em;}" : ".persona input.field { width: 100%;}.persona input.field[name='name'] { width: 89.6%; margin: 0 0 0 0.4%;}#qr textarea.field { height: 11.6em; min-height: 6em;}#qr.has-captcha textarea.field { height: 6em;}") + "\n\n" + (_conf["Tripcode Hider"] ? ".tripped:not(:hover):not(:focus) { opacity: 0;}" : "") + "\n\n#qr textarea {\n resize: " + _conf['Textarea Resize'] + ";\n}\n.captcha-img {\n margin: 1px 0 0;\n text-align: center;\n line-height: 0;\n}\n.captcha-img img {\n width: 100%;\n height: 4em;\n width: 246px;\n}\n.captcha-input {\n width: 100%;\n margin: 1px 0 0;\n}\n.field,\n.selectrice,\nbutton,\ninput:not([type=radio]) {\n " + Style.sizing + ": border-box;\n font-size: " + (parseInt(_conf['Font Size'], 10)) + "px;\n height: 1.6em;\n margin: 1px 0 0;\n vertical-align: bottom;\n padding: 0 1px;\n}\n.selectrice {\n padding-right: 1.6em;\n}\n#qr textarea {\n min-width: 100%;\n}\n#qr [type='submit'] {\n width: 25%;\n}\n[type='file'] {\n position: absolute;\n opacity: 0;\n z-index: -1;\n}\n#showQR {\n display: " + (_conf["Hide Show Post Form"] ? "none" : "block") + ";\n z-index: 4;\n " + Style.sidebarLocation[0] + ": 2px;\n width: " + width + "px;\n background-color: transparent;\n text-align: center;\n position: fixed;\n top: auto;\n}\n/* Fake File Input */\n#qr-filename,\n.has-file #qr-no-file {\n display: none;\n}\n#qr-no-file,\n.has-file #qr-filename {\n display: block;\n}\n#qr-filename-container {\n " + Style.sizing + ": border-box;\n display: inline-block;\n position: relative;\n width: 100px;\n min-width: 74.6%;\n max-width: 74.6%;\n margin-right: 0.4%;\n overflow: hidden;\n padding: 2px 1px 0;\n}\n#qr-filerm {\n position: absolute;\n right: 3px;\n top: 2px;\n z-index: 2;\n}\n/* Thread Select / Spoiler Label */\n#qr-thread-select {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n}\n#qr-spoiler-label {\n vertical-align: bottom;\n width: 49%;\n display: inline-block;\n text-align: right;\n}\n/* Dumping UI */\n.dump #dump-list-container {\n display: block;\n}\n#dump-list-container {\n display: none;\n position: relative;\n overflow-y: hidden;\n margin-top: 1px;\n}\n#dump-list {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: pre;\n width: 248px;\n max-width: 100%;\n min-width: 100%;\n}\n#dump-list:hover {\n overflow-x: auto;\n}\n.qr-preview {\n " + Style.sizing + ": border-box;\n counter-increment: thumbnails;\n cursor: move;\n display: inline-block;\n height: 90px;\n width: 90px;\n padding: 2px;\n opacity: .5;\n overflow: hidden;\n position: relative;\n text-shadow: 0 1px 1px #000;\n " + agent + "transition: opacity .25s ease-in-out;\n vertical-align: top;\n}\n.qr-preview:hover,\n.qr-preview:focus {\n opacity: .9;\n}\n.qr-preview::before {\n content: counter(thumbnails);\n color: #fff;\n position: absolute;\n top: 3px;\n right: 3px;\n text-shadow: 0 0 3px #000, 0 0 8px #000;\n}\n.qr-preview#selected {\n opacity: 1;\n}\n.qr-preview.drag {\n box-shadow: 0 0 10px rgba(0,0,0,.5);\n}\n.qr-preview.over {\n border-color: #fff;\n}\n.qr-preview > span {\n color: #fff;\n}\n.remove {\n background: none;\n color: #e00;\n font-weight: 700;\n padding: 3px;\n}\na:only-of-type > .remove {\n display: none;\n}\n.remove:hover::after {\n content: \" Remove\";\n}\n.qr-preview > label {\n background: rgba(0,0,0,.5);\n color: #fff;\n right: 0; bottom: 0; left: 0;\n position: absolute;\n text-align: center;\n}\n.qr-preview > label > input {\n margin: 0;\n}\n#add-post {\n cursor: pointer;\n font-size: 2em;\n position: absolute;\n top: 50%;\n right: 10px;\n " + agent + "transform: translateY(-50%);\n}\n/* Ads */\n.topad img,\n.middlead img,\n.bottomad img {\n opacity: 0.3;\n " + agent + "transition: opacity .3s linear;\n}\n.topad img:hover,\n.middlead img:hover,\n.bottomad img:hover {\n opacity: 1;\n}\n" + (_conf["Block Ads"] ? "/* AdBlock Minus */.bottomad + hr,.topad img,.middlead img,.bottomad img { display: none;}" : "") + "\n" + (_conf["Shrink Ads"] ? ".topad a img,.middlead a img,.bottomad a img { width: 500px; height: auto;}" : "") + "\n/* Options */\n#overlay {\n position: fixed;\n z-index: 30;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: rgba(0,0,0,.5);\n}\n#appchanx-settings {\n width: auto;\n left: 15%;\n right: 15%;\n top: 15%;\n bottom: 15%;\n position: fixed;\n z-index: 31;\n padding: .3em;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.description {\n display: none;\n}\n#appchanx-settings h3,\n.section-keybinds,\n.section-mascots,\n.section-script,\n.style {\n text-align: center;\n}\n.section-keybinds table,\n.section-script fieldset,\n.section-style fieldset {\n text-align: left;\n}\n.section-keybinds table {\n margin: auto;\n}\n#appchanx-settings fieldset {\n padding: 5px 0;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n vertical-align: top;\n " + (_conf["Single Column Mode"] ? "margin: 0 auto 6px;" : "margin: 0 3px 6px;\n display: inline-block;") + "\n border: 0;\n}\n#appchanx-settings .section-advanced fieldset {\n display: block;\n margin: 0 auto 6px;\n}\n.section-advanced .selectrice {\n display: inline-block;\n clear: both;\n}\n.section-container {\n overflow: auto;\n position: absolute;\n top: 1.7em;\n right: 5px;\n bottom: 5px;\n left: 5px;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.sections-list {\n padding: 0 3px;\n float: left;\n}\n.sections-list > a {\n cursor: pointer;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px 3px 0 0;" : "") + "\n position: relative;\n padding: 0 4px;\n z-index: 1;\n height: 1.4em;\n display: inline-block;\n border-width: 1px 1px 0 1px;\n border-color: transparent;\n border-style: solid;\n}\n.credits {\n float: right;\n}\n#appchanx-settings h3 {\n margin: 0;\n}\n.section-script fieldset > div,\n.section-style fieldset > div,\n.section-advanced fieldset > div {\n overflow: visible;\n padding: 0 5px 0 7px;\n}\n#appchanx-settings tr:nth-of-type(2n+1),\n.section-script fieldset > div:nth-of-type(2n+1),\n.section-advanced fieldset > div:nth-of-type(2n+1),\n.section-style fieldset > div:nth-of-type(2n+1),\n.section-keybinds tr:nth-of-type(2n+1),\n#selectrice li:nth-of-type(2n+1) {\n background-color: rgba(0, 0, 0, 0.05);\n}\narticle li {\n margin: 10px 0 10px 2em;\n}\n#appchanx-settings .option {\n width: 50%;\n display: inline-block;\n vertical-align: bottom;\n}\n.option input {\n width: 100%;\n}\n.optionlabel {\n padding-left: 18px;\n}\n.rice + .optionlabel {\n padding-left: 0;\n}\n.section-script fieldset,\n.styleoption {\n text-align: left;\n}\n.section-style fieldset {\n width: 370px;\n}\n.section-script fieldset {\n width: 200px;\n}\n.suboptions,\n#mascotcontent,\n#themecontent {\n overflow: auto;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 1.7em;\n left: 0;\n}\n.mAlign {\n height: 250px;\n vertical-align: middle;\n display: table-cell;\n}\n#themecontent {\n top: 1.7em;\n}\n#save,\n.stylesettings {\n position: absolute;\n right: 10px;\n bottom: 0;\n}\n.section-style .suboptions {\n bottom: 0;\n}\n.section-container textarea {\n font-family: monospace;\n min-height: 350px;\n resize: vertical;\n width: 100%;\n}\n/* Hover Functionality */\n#mouseover {\n z-index: 33;\n position: fixed;\n max-width: 70%;\n}\n#mouseover:empty {\n display: none;\n}\n/* Mascot Tab */\n#mascot_hide {\n padding: 3px;\n position: absolute;\n top: 2px;\n right: 18px;\n}\n#mascot_hide .rice {\n float: left;\n}\n#mascot_hide > div {\n height: 0;\n text-align: right;\n overflow: hidden;\n}\n#mascot_hide:hover > div {\n height: auto;\n}\n#mascot_hide label {\n width: 100%;\n display: block;\n clear: both;\n text-decoration: none;\n}\n.mascots {\n padding: 0;\n text-align: center;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n.mascot,\n.mascotcontainer {\n overflow: hidden;\n}\n.mascot {\n position: relative;\n border: none;\n margin: 5px;\n padding: 0;\n width: 200px;\n display: inline-block;\n background-color: transparent;\n}\n.mascotcontainer {\n height: 250px;\n border: 0;\n margin: 0;\n max-height: 250px;\n cursor: pointer;\n bottom: 0;\n border-width: 0 1px 1px;\n border-style: solid;\n border-color: transparent;\n overflow: hidden;\n}\n.mascot img {\n max-width: 200px;\n}\n.mascotname,\n.mascotoptions {\n padding: 0;\n width: 100%;\n}\n.mascot .mascotoptions {\nopacity: 0;\n " + agent + "transition: opacity .3s linear;\n}\n.mascot:hover .mascotoptions {\n opacity: 1;\n}\n.mascotoptions {\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.mascotoptions a {\n display: inline-block;\n width: 33%;\n}\n#upload {\n position: absolute;\n width: 100px;\n left: 50%;\n margin-left: -50px;\n text-align: center;\n bottom: 0;\n}\n#mascots_batch {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Themes Tab */\n#themes h1 {\n position: absolute;\n right: 300px;\n bottom: 10px;\n margin: 0;\n " + agent + "transition: all .2s ease-in-out;\n opacity: 0;\n}\n#themes .selectedtheme h1 {\n right: 11px;\n opacity: 1;\n}\n#themeContainer {\n margin-bottom: 3px;\n}\n#addthemes {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n.theme {\n margin: 1em;\n}\n/* Theme Editor */\n#themeConf {\n position: fixed;\n " + Style.sidebarLocation[1] + ": 2px;\n " + Style.sidebarLocation[0] + ": auto;\n top: 0;\n bottom: 0;\n width: 296px;\n z-index: 10;\n}\n#themebar input {\n width: 30%;\n}\n.option .color {\n width: 10%;\n border-left: none !important;\n color: transparent !important;\n}\n.option .colorfield {\n width: 90%;\n}\n.themevar textarea {\n min-width: 100%;\n max-width: 100%;\n height: 20em;\n resize: vertical;\n}\n/* Mascot Editor */\n#mascotConf {\n position: fixed;\n height: 17em;\n bottom: 0;\n left: 50%;\n width: 500px;\n margin-left: -250px;\n overflow: auto;\n z-index: 10;\n}\n#mascotConf .option,\n#mascotConf .optionlabel {\n " + Style.sizing + ": border-box;\n width: 50%;\n display: inline-block;\n vertical-align: middle;\n}\n#mascotConf .option input {\n width: 100%;\n}\n#close {\n position: absolute;\n left: 10px;\n bottom: 0;\n}\n/* Catalog */\n#content .navLinks,\n#info .navLinks,\n.btn-wrap {\n display: block;\n}\n.navLinks > .btn-wrap:not(:first-of-type)::before {\n content: ' - ';\n}\n.button {\n cursor: pointer;\n}\n#content .btn-wrap,\n#info .btn-wrap {\n display: inline-block;\n}\n#post-preview {\n position: absolute;\n z-index: 22;\n " + (_conf["Rounded Edges"] ? "border-radius: 3px;" : "") + "\n}\n#settings,\n#threads,\n#info .navLinks,\n#content .navLinks {\n text-align: center;\n}\n#threads .thread {\n vertical-align: top;\n display: inline-block;\n word-wrap: break-word;\n overflow: hidden;\n margin-top: 5px;\n padding: 5px 0 3px;\n text-align: center;\n}\n.extended-small .thread,\n.small .thread {\n width: 165px;\n max-height: 320px;\n}\n.small .teaser,\n.large .teaser {\n display: none;\n}\n.extended-large .thread,\n.large .thread {\n width: 270px;\n max-height: 410px;\n}\n.extended-small .thumb,\n.small .thumb {\n max-width: 150px;\n max-height: 150px;\n}\n/* Front Page */\n#logo {\n text-align: center;\n}\n#doc {\n margin: 0 auto;\n width: 1000px;\n position: relative;\n}\n#boards .boxcontent {\n vertical-align: top;\n text-align: center;\n}\n#filter-container,\n#options-container {\n float: right;\n position: relative;\n}\n#optionssmenu {\n top: 100% !important;\n left: 0 !important;\n}\n#boards .column {\n " + Style.sizing + ": border-box;\n display: inline-block;\n width: 16em;\n text-align: left;\n vertical-align: top;\n}\n.bd ul,\n.boxcontent ul {\n vertical-align: top;\n padding: 0;\n}\n.right-box .boxcontent ul {\n padding: 0 10px;\n}\n.yuimenuitem,\n.boxcontent li {\n list-style-type: none;\n}\n.bd ul {\n margin: 0;\n}\n.yuimenuitem::before {\n content: \" [ ] \";\n font-family: monospace;\n}\n.yuimenuitem-checked::before {\n content: \" [x] \"\n}\n.yui-u {\n display: inline-block;\n vertical-align: top;\n width: 475px;\n margin: 10px;\n}\n#recent-images .boxcontent {\n text-align: center;\n}\n#ft {\n text-align: center;\n}\n#ft ul {\n padding: 0;\n}\n#ft li {\n list-style-type: none;\n display: inline-block;\n width: 100px;\n}\n#preview-tooltip-nws,\n#preview-tooltip-ws,\n#ft .fill,\n.clear-bug {\n display: none;\n}"; }, theme: function(theme) { var agent, background, backgroundC, bgColor, css, fileHeading, icons, replyHeading, _conf; @@ -11864,7 +10957,7 @@ bgColor = new Style.color(Style.colorToHex(backgroundC = theme["Background Color"]) || 'aaaaaa'); Style.lightTheme = bgColor.isLight(); icons = "data:image/png;base64," + Icons[_conf["Icons"]]; - css = ".hide_thread_button span > span,\n.hide_reply_button span > span {\n background-color: " + theme["Links"] + ";\n}\n#mascot_hide label {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\n#content .thumb {\n box-shadow: 0 0 5px " + theme["Reply Border"] + ";\n}\n.mascotname,\n.mascotoptions {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.opContainer.filter_highlight {\n box-shadow: inset 5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\n.filter_highlight > .reply {\n box-shadow: -5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\nhr {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\na[style=\"cursor: pointer; float: right;\"] + div[style^=\"width: 100%;\"] > table > tbody > tr > td {\n background: " + backgroundC + " !important;\n border: 1px solid " + theme["Reply Border"] + " !important;\n}\n#fs_status {\n background: " + theme["Dialog Background"] + " !important;\n}\n#fs_data tr[style=\"background-color: #EA8;\"] {\n background: " + theme["Reply Background"] + " !important;\n}\n#fs_data,\n#fs_data *,\n.threadContainer {\n border-color: " + theme["Reply Border"] + " !important;\n}\nhtml {\n background: " + (backgroundC || '') + ";\n background-image: " + (theme["Background Image"] || '') + ";\n background-repeat: " + (theme["Background Repeat"] || '') + ";\n background-attachment: " + (theme["Background Attachment"] || '') + ";\n background-position: " + (theme["Background Position"] || '') + ";\n}\n.section-container,\n#exlinks-options-content,\n#mascotcontent,\n#themecontent {\n background: " + backgroundC + ";\n border: 1px solid " + theme["Reply Border"] + ";\n padding: 5px;\n}\n.sections-list > a.tab-selected {\n background: " + backgroundC + ";\n border-color: " + theme["Reply Border"] + ";\n border-style: solid;\n}\n.captcha-img img {\n " + (Style.filter(theme["Text"], theme["Input Background"])) + "\n}\n#boardTitle,\n#prefetch,\n#showQR,\n" + (!_conf["Post Form Decorations"] ? '#spoilerLabel,' : '') + "\n#thread-stats {\n text-shadow:\n 1px 1px 0 " + backgroundC + ",\n -1px -1px 0 " + backgroundC + ",\n 1px -1px 0 " + backgroundC + ",\n -1px 1px 0 " + backgroundC + ",\n 0 1px 0 " + backgroundC + ",\n 0 -1px 0 " + backgroundC + ",\n 1px 0 0 " + backgroundC + ",\n -1px 0 0 " + backgroundC + "\n " + (_conf["Sidebar Glow"] ? ", 0 2px 5px " + theme['Text'] + ";" : ";") + "\n}\n/* Fixes text spoilers */\n" + (_conf['Remove Spoilers'] && _conf['Indicate Spoilers'] ? ".spoiler::before,s::before { content: '[spoiler]';}.spoiler::after,s::after { content: '[/spoiler]';}" : !_conf['Remove Spoilers'] ? ".spoiler:not(:hover) *,s:not(:hover) * { color: rgb(0,0,0) !important; text-shadow: none !important;}.spoiler:not(:hover),s:not(:hover) { background-color: rgb(0,0,0); color: rgb(0,0,0) !important; text-shadow: none !important;}" : "") + "\n#exlinks-options,\n#appchanx-settings,\n#qrtab,\n" + (_conf["Post Form Decorations"] ? "#qr," : "") + "\n#updater,\ninput[type=\"submit\"],\ninput[value=\"Report\"],\nspan[style=\"left: 5px; position: absolute;\"] a {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.enabled .mascotcontainer {\n background: " + theme["Buttons Background"] + ";\n border-color: " + theme["Buttons Border"] + ";\n}\n#dump,\n#qr-filename-container,\n#appchanx-settings input,\n.captcha-img,\n.dump #dump:not(:hover):not(:focus),\n.qr-preview,\n.selectrice,\nbutton,\ninput,\ntextarea {\n background: " + theme["Input Background"] + ";\n border: 1px solid " + theme["Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:hover,\n#qr-filename-container:hover,\n#qr-filename-container:hover,\n.selectrice:hover,\n#selectrice li:hover,\n#selectrice li:nth-of-type(2n+1):hover,\ninput:hover,\ntextarea:hover {\n background: " + theme["Hovered Input Background"] + ";\n border-color: " + theme["Hovered Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:active,\n#dump:focus,\n#selectrice li:focus,\n.selectrice:focus,\n#qr-filename-container:active,\n#qr-filename-container:focus,\ninput:focus,\ntextarea:focus,\ntextarea.field:focus {\n background: " + theme["Focused Input Background"] + ";\n border-color: " + theme["Focused Input Border"] + ";\n color: " + theme["Inputs"] + ";\n outline: none;\n}\n#mouseover,\n#post-preview,\n#qp .post,\n#xupdater,\n.reply.post {\n border-width: 1px;\n border-style: solid;\n border-color: " + theme["Reply Border"] + ";\n background: " + theme["Reply Background"] + ";\n}\n.thread > .replyContainer > .reply.post {\n border-width: " + (_conf['Post Spacing'] === "0" ? "1px 1px 0 1px" : '1px') + ";\n}\n.exblock.reply,\n.reply.post.highlight,\n.reply.post:target {\n background: " + theme["Highlighted Reply Background"] + ";\n border: 1px solid " + theme["Highlighted Reply Border"] + ";\n}\n#header-bar,\n.pagelist {\n background: " + theme["Navigation Background"] + ";\n border-style: solid;\n border-color: " + theme["Navigation Border"] + ";\n}\n.thread {\n background: " + theme["Thread Wrapper Background"] + ";\n border: 1px solid " + theme["Thread Wrapper Border"] + ";\n}\n#boardNavDesktopFoot,\n#mascotConf,\n#mascot_hide,\n#menu,\n#selectrice,\n#themeConf,\n#watcher,\n#watcher:hover,\n.notification,\n.submenu,\na[style=\"cursor: pointer; float: right;\"] ~ div[style^=\"width: 100%;\"] > table {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Dialog Border"] + ";\n}\n.deleteform::before,\n.deleteform,\n#qr .warning {\n background: " + theme["Input Background"] + ";\n border-color: " + theme["Input Border"] + ";\n}\n.disabledwarning,\n.warning {\n color: " + theme["Warnings"] + ";\n}\n#navlinks a:first-of-type {\n border-bottom: 11px solid rgb(130,130,130);\n}\n#navlinks a:last-of-type {\n border-top: 11px solid rgb(130,130,130);\n}\n#charCount {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.7)" : "rgba(255,255,255,0.7)") + ";\n}\n.postNum a {\n color: " + theme["Post Numbers"] + ";\n}\n.subject {\n color: " + theme["Subjects"] + " !important;\n}\n.dateTime,\n.post-ago {\n color: " + theme["Timestamps"] + " !important;\n}\n#fs_status a,\n#updater #count:not(.new)::after,\n#showQR,\n#updater,\n.abbr,\n.boxbar,\n.boxcontent,\n.deleteform::before,\n.pages strong,\n.pln,\n.reply,\n.reply.highlight,\n.summary,\nbody,\nbutton,\nspan[style=\"left: 5px; position: absolute;\"] a,\ninput,\ntextarea {\n color: " + theme["Text"] + ";\n}\n#exlinks-options-content > table,\n#appchanx-settings fieldset,\n#selectrice {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n box-shadow: inset " + theme["Shadow Color"] + " 0 0 5px;\n}\n.quote + .spoiler:hover,\n.quote {\n color: " + theme["Greentext"] + ";\n}\n.forwardlink {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n border-bottom: 1px dashed " + theme["Backlinks"] + ";\n}\n.container::before {\n color: " + theme["Timestamps"] + ";\n}\n#menu,\n#post-preview,\n#qp .opContainer,\n#qp .replyContainer,\n.submenu {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.rice {\n background: " + theme["Checkbox Background"] + ";\n border: 1px solid " + theme["Checkbox Border"] + ";\n}\n.selectrice::before {\n border-left: 1px solid " + theme["Input Border"] + ";\n}\n.selectrice::after {\n border-top: .45em solid " + theme["Inputs"] + ";\n}\n#updater input,\n.bd {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.pages a,\n#header-bar a {\n color: " + theme["Navigation Links"] + ";\n}\ninput[type=checkbox]:checked + .rice {\n position: relative;\n}\ninput[type=checkbox]:checked + .rice::after {\n content: \"\";\n display: block;\n width: 4px;\n height: 10px;\n border: solid " + theme["Inputs"] + ";\n border-width: 0 3px 3px 0;\n " + agent + "transform: rotate(45deg);\n position: absolute;\n left: 2px;\n bottom: -1px;\n}\n#addReply,\n#dump,\n.button,\n.entry,\n.replylink,\na {\n color: " + theme["Links"] + ";\n}\n.backlink {\n color: " + theme["Backlinks"] + ";\n}\n.qiQuote,\n.quotelink {\n color: " + theme["Quotelinks"] + ";\n}\n#addReply:hover,\n#dump:hover,\n.entry:hover,\n.sideArrows a:hover,\n.replylink:hover,\n.qiQuote:hover,\n.quotelink:hover,\na .name:hover,\na .postertrip:hover,\na:hover {\n color: " + theme["Hovered Links"] + ";\n}\n#header-bar a:hover,\n#boardTitle a:hover {\n color: " + theme["Hovered Navigation Links"] + ";\n}\n#boardTitle {\n color: " + theme["Board Title"] + ";\n}\n.name,\n.post-author {\n color: " + theme["Names"] + " !important;\n}\n.post-tripcode,\n.postertrip,\n.trip {\n color: " + theme["Tripcodes"] + " !important;\n}\na .postertrip,\na .name {\n color: " + theme["Emails"] + ";\n}\n.post.reply.qphl,\n.post.op.qphl {\n border-color: " + theme["Backlinked Reply Outline"] + ";\n background: " + theme["Highlighted Reply Background"] + ";\n}\n.inline .post {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.placeholder,\n#qr input::" + agent + "placeholder,\n#qr textarea::" + agent + "placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#qr input:" + agent + "placeholder,\n#qr textarea:" + agent + "placeholder,\n.placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#appchanx-settings fieldset,\n.boxcontent dd,\n.selectrice ul {\n border-color: " + (Style.lightTheme ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)") + ";\n}\n#appchanx-settings li,\n#selectrice li:not(:first-of-type) {\n border-top: 1px solid " + (Style.lightTheme ? "rgba(0,0,0,0.05)" : "rgba(255,255,255,0.025)") + ";\n}\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n.navLinks > a:first-of-type::after,\n#watcher::after,\n#globalMessage::after,\n#boardNavDesktopFoot::after,\na[style=\"cursor: pointer; float: right;\"]::after,\n#img-controls,\n#catalog::after,\n#fappeTyme {\n background-image: url('" + icons + "');\n" + (!Style.lightTheme ? "filter: url(\"data:image/svg+xml,#filters\");" : "") + "\n}\n" + theme["Custom CSS"]; + css = ".hide_thread_button span > span,\n.hide_reply_button span > span {\n background-color: " + theme["Links"] + ";\n}\n#mascot_hide label {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\n#content .thumb {\n box-shadow: 0 0 5px " + theme["Reply Border"] + ";\n}\n.mascotname,\n.mascotoptions {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.opContainer.filter_highlight {\n box-shadow: inset 5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\n.filter_highlight > .reply {\n box-shadow: -5px 0 " + theme["Backlinked Reply Outline"] + ";\n}\nhr {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n}\na[style=\"cursor: pointer; float: right;\"] + div[style^=\"width: 100%;\"] > table > tbody > tr > td {\n background: " + backgroundC + " !important;\n border: 1px solid " + theme["Reply Border"] + " !important;\n}\n#fs_status {\n background: " + theme["Dialog Background"] + " !important;\n}\n#fs_data tr[style=\"background-color: #EA8;\"] {\n background: " + theme["Reply Background"] + " !important;\n}\n#fs_data,\n#fs_data *,\n.threadContainer {\n border-color: " + theme["Reply Border"] + " !important;\n}\nhtml {\n background: " + (backgroundC || '') + ";\n background-image: " + (theme["Background Image"] || '') + ";\n background-repeat: " + (theme["Background Repeat"] || '') + ";\n background-attachment: " + (theme["Background Attachment"] || '') + ";\n background-position: " + (theme["Background Position"] || '') + ";\n}\n.section-container,\n#exlinks-options-content,\n#mascotcontent,\n#themecontent {\n background: " + backgroundC + ";\n border: 1px solid " + theme["Reply Border"] + ";\n padding: 5px;\n}\n.sections-list > a.tab-selected {\n background: " + backgroundC + ";\n border-color: " + theme["Reply Border"] + ";\n border-style: solid;\n}\n.captcha-img img {\n " + (Style.filter(theme["Text"], theme["Input Background"])) + "\n}\n#boardTitle,\n#prefetch,\n#showQR,\n" + (!_conf["Post Form Decorations"] ? '#spoilerLabel,' : '') + "\n#thread-stats {\n text-shadow:\n 1px 1px 0 " + backgroundC + ",\n -1px -1px 0 " + backgroundC + ",\n 1px -1px 0 " + backgroundC + ",\n -1px 1px 0 " + backgroundC + ",\n 0 1px 0 " + backgroundC + ",\n 0 -1px 0 " + backgroundC + ",\n 1px 0 0 " + backgroundC + ",\n -1px 0 0 " + backgroundC + "\n " + (_conf["Sidebar Glow"] ? ", 0 2px 5px " + theme['Text'] + ";" : ";") + "\n}\n/* Fixes text spoilers */\n" + (_conf['Remove Spoilers'] && _conf['Indicate Spoilers'] ? ".spoiler::before,s::before { content: '[spoiler]';}.spoiler::after,s::after { content: '[/spoiler]';}" : !_conf['Remove Spoilers'] ? ".spoiler:not(:hover) *,s:not(:hover) * { color: rgb(0,0,0) !important; text-shadow: none !important;}.spoiler:not(:hover),s:not(:hover) { background-color: rgb(0,0,0); color: rgb(0,0,0) !important; text-shadow: none !important;}" : "") + "\n#exlinks-options,\n#appchanx-settings,\n#qrtab,\n" + (_conf["Post Form Decorations"] ? "#qr," : "") + "\ninput[type=\"submit\"],\ninput[value=\"Report\"],\nspan[style=\"left: 5px; position: absolute;\"] a {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.enabled .mascotcontainer {\n background: " + theme["Buttons Background"] + ";\n border-color: " + theme["Buttons Border"] + ";\n}\n#dump,\n#qr-filename-container,\n#appchanx-settings input,\n.captcha-img,\n.dump #dump:not(:hover):not(:focus),\n.qr-preview,\n.selectrice,\nbutton,\ninput,\ntextarea {\n background: " + theme["Input Background"] + ";\n border: 1px solid " + theme["Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:hover,\n#qr-filename-container:hover,\n#qr-filename-container:hover,\n.selectrice:hover,\n#selectrice li:hover,\n#selectrice li:nth-of-type(2n+1):hover,\ninput:hover,\ntextarea:hover {\n background: " + theme["Hovered Input Background"] + ";\n border-color: " + theme["Hovered Input Border"] + ";\n color: " + theme["Inputs"] + ";\n}\n#dump:active,\n#dump:focus,\n#selectrice li:focus,\n.selectrice:focus,\n#qr-filename-container:active,\n#qr-filename-container:focus,\ninput:focus,\ntextarea:focus,\ntextarea.field:focus {\n background: " + theme["Focused Input Background"] + ";\n border-color: " + theme["Focused Input Border"] + ";\n color: " + theme["Inputs"] + ";\n outline: none;\n}\n#mouseover,\n#post-preview,\n#qp .post,\n#xupdater,\n.reply.post {\n border-width: 1px;\n border-style: solid;\n border-color: " + theme["Reply Border"] + ";\n background: " + theme["Reply Background"] + ";\n}\n.thread > .replyContainer > .reply.post {\n border-width: " + (_conf['Post Spacing'] === "0" ? "1px 1px 0 1px" : '1px') + ";\n}\n.exblock.reply,\n.reply.post.highlight,\n.reply.post:target {\n background: " + theme["Highlighted Reply Background"] + ";\n border: 1px solid " + theme["Highlighted Reply Border"] + ";\n}\n#header-bar,\n.pagelist {\n background: " + theme["Navigation Background"] + ";\n border-style: solid;\n border-color: " + theme["Navigation Border"] + ";\n}\n.thread {\n background: " + theme["Thread Wrapper Background"] + ";\n border: 1px solid " + theme["Thread Wrapper Border"] + ";\n}\n#boardNavDesktopFoot,\n#mascotConf,\n#mascot_hide,\n#menu,\n#selectrice,\n#themeConf,\n#watcher,\n#watcher:hover,\n.notification,\n.submenu,\na[style=\"cursor: pointer; float: right;\"] ~ div[style^=\"width: 100%;\"] > table {\n background: " + theme["Dialog Background"] + ";\n border: 1px solid " + theme["Dialog Border"] + ";\n}\n.deleteform::before,\n.deleteform,\n#qr .warning {\n background: " + theme["Input Background"] + ";\n border-color: " + theme["Input Border"] + ";\n}\n.disabledwarning,\n.warning {\n color: " + theme["Warnings"] + ";\n}\n#navlinks a:first-of-type {\n border-bottom: 11px solid rgb(130,130,130);\n}\n#navlinks a:last-of-type {\n border-top: 11px solid rgb(130,130,130);\n}\n#charCount {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.7)" : "rgba(255,255,255,0.7)") + ";\n}\n.postNum a {\n color: " + theme["Post Numbers"] + ";\n}\n.subject {\n color: " + theme["Subjects"] + " !important;\n}\n.dateTime,\n.post-ago {\n color: " + theme["Timestamps"] + " !important;\n}\n#fs_status a,\n#updater #update-status:not(.new)::after,\n#showQR,\n.abbr,\n.boxbar,\n.boxcontent,\n.deleteform::before,\n.pages strong,\n.pln,\n.reply,\n.reply.highlight,\n.summary,\nbody,\nbutton,\nspan[style=\"left: 5px; position: absolute;\"] a,\ninput,\ntextarea {\n color: " + theme["Text"] + ";\n}\n#exlinks-options-content > table,\n#appchanx-settings fieldset,\n#selectrice {\n border-bottom: 1px solid " + theme["Reply Border"] + ";\n box-shadow: inset " + theme["Shadow Color"] + " 0 0 5px;\n}\n.quote + .spoiler:hover,\n.quote {\n color: " + theme["Greentext"] + ";\n}\n.forwardlink {\n text-decoration: " + (_conf["Underline Links"] ? "underline" : "none") + ";\n border-bottom: 1px dashed " + theme["Backlinks"] + ";\n}\n.container::before {\n color: " + theme["Timestamps"] + ";\n}\n#menu,\n#post-preview,\n#qp .opContainer,\n#qp .replyContainer,\n.submenu {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.rice {\n background: " + theme["Checkbox Background"] + ";\n border: 1px solid " + theme["Checkbox Border"] + ";\n}\n.selectrice::before {\n border-left: 1px solid " + theme["Input Border"] + ";\n}\n.selectrice::after {\n border-top: .45em solid " + theme["Inputs"] + ";\n}\n.bd {\n background: " + theme["Buttons Background"] + ";\n border: 1px solid " + theme["Buttons Border"] + ";\n}\n.pages a,\n#header-bar a {\n color: " + theme["Navigation Links"] + ";\n}\ninput[type=checkbox]:checked + .rice {\n position: relative;\n}\ninput[type=checkbox]:checked + .rice::after {\n content: \"\";\n display: block;\n width: 4px;\n height: 10px;\n border: solid " + theme["Inputs"] + ";\n border-width: 0 3px 3px 0;\n " + agent + "transform: rotate(45deg);\n position: absolute;\n left: 2px;\n bottom: -1px;\n}\n#addReply,\n#dump,\n.button,\n.entry,\n.replylink,\na {\n color: " + theme["Links"] + ";\n}\n.backlink {\n color: " + theme["Backlinks"] + ";\n}\n.qiQuote,\n.quotelink {\n color: " + theme["Quotelinks"] + ";\n}\n#addReply:hover,\n#dump:hover,\n.entry:hover,\n.sideArrows a:hover,\n.replylink:hover,\n.qiQuote:hover,\n.quotelink:hover,\na .name:hover,\na .postertrip:hover,\na:hover {\n color: " + theme["Hovered Links"] + ";\n}\n#header-bar a:hover,\n#boardTitle a:hover {\n color: " + theme["Hovered Navigation Links"] + ";\n}\n#boardTitle {\n color: " + theme["Board Title"] + ";\n}\n.name,\n.post-author {\n color: " + theme["Names"] + " !important;\n}\n.post-tripcode,\n.postertrip,\n.trip {\n color: " + theme["Tripcodes"] + " !important;\n}\na .postertrip,\na .name {\n color: " + theme["Emails"] + ";\n}\n.post.reply.qphl,\n.post.op.qphl {\n border-color: " + theme["Backlinked Reply Outline"] + ";\n background: " + theme["Highlighted Reply Background"] + ";\n}\n.inline .post {\n box-shadow: " + (_conf['Quote Shadows'] ? "5px 5px 5px " + theme['Shadow Color'] : "") + ";\n}\n.placeholder,\n#qr input::" + agent + "placeholder,\n#qr textarea::" + agent + "placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#qr input:" + agent + "placeholder,\n#qr textarea:" + agent + "placeholder,\n.placeholder {\n color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important;\n}\n#appchanx-settings fieldset,\n.boxcontent dd,\n.selectrice ul {\n border-color: " + (Style.lightTheme ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)") + ";\n}\n#appchanx-settings li,\n#selectrice li:not(:first-of-type) {\n border-top: 1px solid " + (Style.lightTheme ? "rgba(0,0,0,0.05)" : "rgba(255,255,255,0.025)") + ";\n}\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n.navLinks > a:first-of-type::after,\n#watcher::after,\n#globalMessage::after,\n#boardNavDesktopFoot::after,\na[style=\"cursor: pointer; float: right;\"]::after,\n#img-controls,\n#catalog::after,\n#fappeTyme {\n background-image: url('" + icons + "');\n" + (!Style.lightTheme ? "filter: url(\"data:image/svg+xml,#filters\");" : "") + "\n}\n" + theme["Custom CSS"]; css += (Style.lightTheme ? ".prettyprint {\n background-color: #e7e7e7;\n border: 1px solid #dcdcdc;\n}\n.com {\n color: #dd0000;\n}\n.str,\n.atv {\n color: #7fa61b;\n}\n.pun {\n color: #61663a;\n}\n.tag {\n color: #117743;\n}\n.kwd {\n color: #5a6F9e;\n}\n.typ,\n.atn {\n color: #9474bd;\n}\n.lit {\n color: #368c72;\n}\n" : ".prettyprint {\n background-color: rgba(0,0,0,.1);\n border: 1px solid rgba(0,0,0,0.5);\n}\n.tag {\n color: #96562c;\n}\n.pun {\n color: #5b6f2a;\n}\n.com {\n color: #a34443;\n}\n.str,\n.atv {\n color: #8ba446;\n}\n.kwd {\n color: #987d3e;\n}\n.typ,\n.atn {\n color: #897399;\n}\n.lit {\n color: #558773;\n}\n"); if (_conf["Alternate Post Colors"]) { css += ".replyContainer:not(.hidden):nth-of-type(2n+1) .post {\n background-image: " + agent + "linear-gradient(" + (Style.lightTheme ? "rgba(0,0,0,0.05), rgba(0,0,0,0.05)" : "rgba(255,255,255,0.02), rgba(255,255,255,0.02)") + ");\n}\n"; @@ -11920,45 +11013,38 @@ if (iconOffset < 0) { iconOffset = 0; } - css += "/* 4chan X Options */\n#appchanOptions {\n " + align + ": " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Watcher */\n#watcher::after {\n " + align + ": " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n " + align + ": " + position[i++] + "px;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Expand Images */\n#img-controls {\n " + align + ": " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n " + align + ": " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n " + align + ": " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a {\n margin: 2px;\n top: 1px;\n}\n#navlinks a:last-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#navlinks a:first-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 1.6em;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#boardNavDesktopFoot::after,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#watcher::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\ndiv.navLinks > a:first-of-type::after,\n#catalog::after,\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: 1px !important;\n}\n" + (_conf["Announcements"] === "slideout" ? "#globalMessage," : "") + "\n" + (_conf["Slideout Watcher"] ? "#watcher," : "") + "\n#boardNavDesktopFoot {\n top: 16px !important;\n}\n" + (_conf['Boards Navigation'] === 'Top' || _conf['Boards Navigation'] === 'Sticky top' ? '#header-bar' : _conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? '.pagelist' : void 0) + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}\n"; - if (_conf["Updater Position"] !== 'moveable') { - css += "/* Updater + Stats */\n#updater,\n#thread-stats {\n " + align + ": " + (_conf["Updater Position"] === "bottom" && !_conf["Hide Delete UI"] ? 23 : 2) + "px !important;\n " + Style.sidebarLocation[1] + ": auto !important;\n top: auto !important;\n bottom: auto !important;\n " + (_conf["Updater Position"] === 'top' ? "top: 16px !important" : "bottom: 0 !important") + ";\n}"; - } + css += "/* 4chan X Options */\n#appchanOptions {\n " + align + ": " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Watcher */\n#watcher::after {\n " + align + ": " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n " + align + ": " + position[i++] + "px;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Expand Images */\n#img-controls {\n " + align + ": " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n " + align + ": " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n " + align + ": " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n " + align + ": " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a {\n margin: 2px;\n top: 1px;\n}\n#navlinks a:last-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#navlinks a:first-of-type {\n " + align + ": " + position[i++] + "px;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 1.6em;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#boardNavDesktopFoot::after,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#watcher::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\ndiv.navLinks > a:first-of-type::after,\n#catalog::after,\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: 1px !important;\n}\n" + (_conf["Announcements"] === "slideout" ? "#globalMessage," : "") + "\n" + (_conf["Slideout Watcher"] ? "#watcher," : "") + "\n#boardNavDesktopFoot {\n top: 16px !important;\n}\n.fixed.top #header-bar" + (_conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? ',\n.pagelist' : '') + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}\n"; } else { position = aligner(2 + (_conf["4chan Banner"] === "at sidebar top" ? Style.logoOffset + 19 : 0), [notEither && _conf['Image Expansion'], true, true, _conf['Slideout Navigation'] !== 'hide', _conf['Announcements'] === 'slideout' && $('#globalMessage', d.body), notCatalog && _conf['Slideout Watcher'] && _conf['Thread Watcher'], notCatalog && $('body > a[style="cursor: pointer; float: right;"]', d.body), $('#navtopright .exlinksOptionsLink', d.body), notEither, g.VIEW === 'thread', notEither && _conf['Fappe Tyme'], navlinks = ((g.VIEW !== 'thread' && _conf['Index Navigation']) || (g.VIEW === 'thread' && _conf['Reply Navigation'])) && notCatalog, navlinks]); iconOffset = (g.VIEW === 'thread' && _conf['Prefetch'] ? 250 + Style.sidebarOffset.W : 20 + (g.VIEW === 'thread' && _conf['Updater Position'] === 'top' ? 100 : 0)) - (_conf['4chan SS Navigation'] ? 0 : Style.sidebar + parseInt(_conf[align.capitalize() + " Thread Padding"], 10)); - css += "/* Expand Images */\n#img-controls {\n top: " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n top: " + position[i++] + "px;\n}\n/* 4chan X Options */\n#appchanOptions {\n top: " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot,\n#boardNavDesktopFoot::after {\n top: " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage,\n#globalMessage::after {\n top: " + position[i++] + "px;\n}\n/* Watcher */\n" + (_conf["Slideout Watcher"] ? "#watcher, #watcher::after" : "") + " {\n top: " + position[i++] + "px !important;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n top: " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n top: " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n top: " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n top: " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a:first-of-type {\n top: " + position[i++] + "px !important;\n}\n#navlinks a:last-of-type {\n top: " + position[i++] + "px !important;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 0;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#navlinks a,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#boardNavDesktopFoot::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\n" + (_conf["Slideout Watcher"] ? "#watcher::after," : "") + "\nbody > a[style=\"cursor: pointer; float: right;\"]::after,\n#catalog::after,\ndiv.navLinks > a:first-of-type::after {\n " + align + ": 3px !important;\n}\n#boardNavDesktopFoot,\n#globalMessage,\n#watcher {\n width: " + (233 + Style.sidebarOffset.W) + "px !important;\n " + align + ": 18px !important;\n}\n" + (_conf['Boards Navigation'] === 'Top' || _conf['Boards Navigation'] === 'Sticky top' ? '#header-bar' : _conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? '.pagelist' : void 0) + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}"; - if (_conf["Updater Position"] !== 'moveable') { - css += "/* Updater + Stats */\n#updater,\n#thread-stats {\n " + align + ": " + (_conf["Updater Position"] === "top" || !_conf["Hide Delete UI"] ? 23 : 2) + "px !important; \n " + Style.sidebarLocation[1] + ": auto !important;\n top: " + (_conf["Updater Position"] === "top" ? "-1px" : "auto") + " !important;\n bottom: " + (_conf["Updater Position"] === "bottom" ? "-2px" : "auto") + " !important;\n}"; - } + css += "/* Expand Images */\n#img-controls {\n top: " + position[i++] + "px;\n}\n/* Main Menu */\n#main-menu {\n top: " + position[i++] + "px;\n}\n/* 4chan X Options */\n#appchanOptions {\n top: " + position[i++] + "px;\n}\n/* Slideout Navigation */\n#boardNavDesktopFoot,\n#boardNavDesktopFoot::after {\n top: " + position[i++] + "px;\n}\n/* Global Message */\n#globalMessage,\n#globalMessage::after {\n top: " + position[i++] + "px;\n}\n/* Watcher */\n" + (_conf["Slideout Watcher"] ? "#watcher, #watcher::after" : "") + " {\n top: " + position[i++] + "px !important;\n}\n/* 4sight */\nbody > a[style=\"cursor: pointer; float: right;\"]::after {\n top: " + position[i++] + "px;\n}\n/* ExLinks */\n#navtopright .exlinksOptionsLink::after {\n top: " + position[i++] + "px;\n}\n/* 4chan Catalog */\n#catalog::after {\n top: " + position[i++] + "px;\n}\n/* Back */\ndiv.navLinks > a:first-of-type::after {\n top: " + position[i++] + "px;\n}\n/* Fappe Tyme */\n#fappeTyme {\n top: " + position[i++] + "px;\n}\n/* Thread Navigation Links */\n#navlinks a:first-of-type {\n top: " + position[i++] + "px !important;\n}\n#navlinks a:last-of-type {\n top: " + position[i++] + "px !important;\n}\n#prefetch {\n width: " + (248 + Style.sidebarOffset.W) + "px;\n " + align + ": 2px;\n top: 0;\n text-align: " + Style.sidebarLocation[1] + ";\n}\n#navlinks a,\n#navtopright .exlinksOptionsLink::after,\n#appchanOptions,\n#boardNavDesktopFoot::after,\n#globalMessage::after,\n#img-controls,\n#main-menu,\n#fappeTyme,\n" + (_conf["Slideout Watcher"] ? "#watcher::after," : "") + "\nbody > a[style=\"cursor: pointer; float: right;\"]::after,\n#catalog::after,\ndiv.navLinks > a:first-of-type::after {\n " + align + ": 3px !important;\n}\n#boardNavDesktopFoot,\n#globalMessage,\n#watcher {\n width: " + (233 + Style.sidebarOffset.W) + "px !important;\n " + align + ": 18px !important;\n}\n.fixed.top #header-bar" + (_conf['Pagination'] === 'top' || _conf['Pagination'] === 'sticky top' ? ',\n.pagelist' : '') + " {\n " + (_conf['4chan SS Navigation'] ? "padding-" + align + ": " + iconOffset + "px;" : "margin-" + align + ": " + iconOffset + "px;") + "\n}"; } return Style.icons.textContent = css; }, padding: function() { var css, sheet, _conf; - if (!(sheet = Style.paddingSheet)) { + if (!((sheet = Style.paddingSheet) && Style.padding.nav)) { return; } _conf = Conf; - Style.padding.nav.property = _conf["Boards Navigation"].split(" "); - Style.padding.nav.property = Style.padding.nav.property[Style.padding.nav.property.length - 1]; + Style.padding.nav.property = _conf['Bottom Header'] ? 'bottom' : 'top'; if (Style.padding.pages) { Style.padding.pages.property = _conf["Pagination"].split(" "); Style.padding.pages.property = Style.padding.pages.property[Style.padding.pages.property.length - 1]; } css = "body::before {\n"; - if (Style.padding.pages && (_conf["Pagination"] === "sticky top" || _conf["Pagination"] === "sticky bottom")) { + if (Style.padding.pages && ["sticky top", "top", "sticky bottom"].contains(_conf["Pagination"])) { css += " " + Style.padding.pages.property + ": " + Style.padding.pages.offsetHeight + "px !important;\n"; } - if (_conf["Boards Navigation"] === "Sticky top" || _conf["Boards Navigation"] === "Sticky bottom") { + if (_conf['Fixed Header']) { css += " " + Style.padding.nav.property + ": " + Style.padding.nav.offsetHeight + "px !important;\n"; } css += "}\nbody {\n padding-bottom: 0;\n"; - if ((Style.padding.pages != null) && (_conf["Pagination"] === "sticky top" || _conf["Pagination"] === "sticky bottom" || _conf["Pagination"] === "top")) { + if ((Style.padding.pages != null) && ["sticky top", "top", "sticky bottom"].contains(_conf["Pagination"])) { css += " padding-" + Style.padding.pages.property + ": " + Style.padding.pages.offsetHeight + "px;\n"; } - if (_conf["Boards Navigation"] !== "Hide") { + if (!(_conf['Header auto-hide'] || _conf['Hide Header'])) { css += " padding-" + Style.padding.nav.property + ": " + Style.padding.nav.offsetHeight + "px;\n"; } css += "}"; @@ -12361,6 +11447,1343 @@ } }; + PSAHiding = { + init: function() { + var entry; + + if (!Conf['Announcement Hiding']) { + return; + } + entry = { + type: 'header', + el: $.el('a', { + textContent: 'Show announcement', + className: 'show-announcement', + href: 'javascript:;' + }), + order: 50, + open: function() { + var _ref; + + if ((_ref = $.id('globalMessage')) != null ? _ref.hidden : void 0) { + return true; + } + return false; + } + }; + $.event('AddMenuEntry', entry); + $.on(entry.el, 'click', PSAHiding.toggle); + $.addClass(doc, 'hide-announcement'); + return $.on(d, '4chanXInitFinished', this.setup); + }, + setup: function() { + var btn, psa; + + $.off(d, '4chanXInitFinished', PSAHiding.setup); + if (!(psa = $.id('globalMessage'))) { + return; + } + PSAHiding.btn = btn = $.el('a', { + innerHTML: '[ - ]', + title: 'Hide announcement.', + className: 'hide-announcement', + href: 'javascript:;', + textContent: '[ - ]' + }); + $.on(btn, 'click', PSAHiding.toggle); + return $.get('hiddenPSAs', [], function(item) { + return PSAHiding.sync(item['hiddenPSAs']); + }); + }, + toggle: function(e) { + var text; + + text = PSAHiding.trim($.id('globalMessage')); + return $.get('hiddenPSAs', [], function(_arg) { + var hiddenPSAs, i; + + hiddenPSAs = _arg.hiddenPSAs; + if (hide) { + hiddenPSAs.push(text); + hiddenPSAs = hiddenPSAs.slice(-5); + } else { + $.event('CloseMenu'); + i = hiddenPSAs.indexOf(text); + hiddenPSAs.splice(i, 1); + } + PSAHiding.sync(hiddenPSAs); + return $.set('hiddenPSAs', hiddenPSAs); + }); + }, + sync: function(hiddenPSAs) { + var hr, psa; + + psa = $.id('globalMessage'); + psa.hidden = PSAHiding.btn.hidden = hiddenPSAs.contains(PSAHiding.trim(psa)) ? true : false; + if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') { + return hr.hidden = psa.hidden; + } + }, + trim: function(psa) { + return psa.textContent.replace(/\W+/g, '').toLowerCase(); + } + }; + + CatalogLinks = { + init: function() { + var el, input; + + $.ready(this.ready); + if (!Conf['Catalog Links']) { + return; + } + el = $.el('label', { + id: 'toggleCatalog', + href: 'javascript:;', + innerHTML: "Catalog Links", + title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "." + }); + input = $('input', el); + $.on(input, 'change', this.toggle); + $.sync('Header catalog links', CatalogLinks.set); + $.event('AddMenuEntry', { + type: 'header', + el: el, + order: 95 + }); + return $.on(d, '4chanXInitFinished', function() { + return CatalogLinks.set(Conf['Header catalog links']); + }); + }, + toggle: function() { + var useCatalog; + + $.event('CloseMenu'); + $.set('Header catalog links', useCatalog = this.checked); + return CatalogLinks.set(useCatalog); + }, + set: function(useCatalog) { + var a, board, path, _i, _len, _ref; + + path = useCatalog ? 'catalog' : ''; + _ref = $$("#board-list a[href*=\"boards.4chan.org\"],\n#boardNavDesktop a[href*=\"boards.4chan.org\"],\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + a = _ref[_i]; + board = a.pathname.split('/')[1]; + if (['f', 'status', '4chan'].contains(board) || !board) { + continue; + } + if (Conf['External Catalog']) { + a.href = useCatalog ? CatalogLinks.external(board) : "//boards.4chan.org/" + board + "/"; + } else { + a.pathname = "/" + board + "/" + path; + } + a.title = useCatalog ? "" + a.title + " - Catalog" : a.title.replace(/\ -\ Catalog$/, ''); + } + return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; + }, + external: function(board) { + return (['a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'].contains(board) ? "http://catalog.neet.tv/" + board : ['d', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'].contains(board) ? "http://4index.gropes.us/" + board : "//boards.4chan.org/" + board + "/catalog"); + }, + ready: function() { + var catalogLink; + + if (catalogLink = $('.pages.cataloglink a', d.body) || $('[href=".././catalog"]', d.body)) { + if (g.VIEW !== 'thread') { + $.add(d.body, catalogLink); + } + return catalogLink.id = 'catalog'; + } + } + }; + + IDColor = { + init: function() { + if (!Conf['Color User IDs']) { + return; + } + return Post.prototype.callbacks.push({ + name: 'Reveal Spoilers', + cb: this.node + }); + }, + node: function(post) { + var str, uid; + + if (!(uid = $('.hand', this.nodes.uniqueID))) { + return; + } + str = this.info.uniqueID; + if (uid.nodeName === 'SPAN') { + return uid.style.cssText = IDColor.apply.call(str); + } + }, + ids: {}, + compute: function(str) { + var hash, rgb; + + hash = this.hash(str); + rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; + rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; + this.ids[str] = rgb; + return rgb; + }, + apply: function() { + var rgb; + + rgb = IDColor.ids[this] || IDColor.compute(this); + return ("background-color: rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "); color: ") + (rgb[3] ? "black;" : "white; border-radius: 3px; padding: 0px 2px;"); + }, + hash: function(str) { + var i, j, msg; + + msg = 0; + i = 0; + j = str.length; + while (i < j) { + msg = ((msg << 5) - msg) + str.charCodeAt(i); + ++i; + } + return msg; + } + }; + + CustomCSS = { + init: function() { + if (!Conf['Custom CSS']) { + return; + } + return this.addStyle(); + }, + addStyle: function() { + return this.style = $.addStyle(Conf['usercss']); + }, + rmStyle: function() { + if (this.style) { + $.rm(this.style); + return delete this.style; + } + }, + update: function() { + if (!this.style) { + this.addStyle(); + } + return this.style.textContent = Conf['usercss']; + } + }; + + ExpandComment = { + init: function() { + if (g.VIEW !== 'index' || !Conf['Comment Expansion']) { + return; + } + if (g.BOARD.ID === 'g') { + this.callbacks.push(Fourchan.code); + } + if (g.BOARD.ID === 'sci') { + this.callbacks.push(Fourchan.math); + } + return Post.prototype.callbacks.push({ + name: 'Comment Expansion', + cb: this.node + }); + }, + node: function() { + var a; + + if (a = $('.abbr > a', this.nodes.comment)) { + return $.on(a, 'click', ExpandComment.cb); + } + }, + callbacks: [], + cb: function(e) { + var post; + + e.preventDefault(); + post = Get.postFromNode(this); + return ExpandComment.expand(post); + }, + expand: function(post) { + var a; + + if (post.nodes.longComment && !post.nodes.longComment.parentNode) { + $.replace(post.nodes.shortComment, post.nodes.longComment); + post.nodes.comment = post.nodes.longComment; + return; + } + if (!(a = $('.abbr > a', post.nodes.comment))) { + return; + } + a.textContent = "Post No." + post + " Loading..."; + return $.cache("//api.4chan.org" + a.pathname + ".json", function() { + return ExpandComment.parse(this, a, post); + }); + }, + contract: function(post) { + var a; + + if (!post.nodes.shortComment) { + return; + } + a = $('.abbr > a', post.nodes.shortComment); + a.textContent = 'here'; + $.replace(post.nodes.longComment, post.nodes.shortComment); + return post.nodes.comment = post.nodes.shortComment; + }, + parse: function(req, a, post) { + var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; + + status = req.status; + if (![200, 304].contains(status)) { + a.textContent = "Error " + req.statusText + " (" + status + ")"; + return; + } + posts = JSON.parse(req.response).posts; + if (spoilerRange = posts[0].custom_spoiler) { + Build.spoilerRange[g.BOARD] = spoilerRange; + } + for (_i = 0, _len = posts.length; _i < _len; _i++) { + postObj = posts[_i]; + if (postObj.no === post.ID) { + break; + } + } + if (postObj.no !== post.ID) { + a.textContent = "Post No." + post + " not found."; + return; + } + comment = post.nodes.comment; + clone = comment.cloneNode(false); + clone.innerHTML = postObj.com; + _ref = $$('.quotelink', clone); + for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { + quote = _ref[_j]; + href = quote.getAttribute('href'); + if (href[0] === '/') { + continue; + } + quote.href = "/" + post.board + "/res/" + href; + } + post.nodes.shortComment = comment; + $.replace(comment, clone); + post.nodes.comment = post.nodes.longComment = clone; + post.parseComment(); + post.parseQuotes(); + _ref1 = ExpandComment.callbacks; + for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { + callback = _ref1[_k]; + callback.call(post); + } + } + }; + + ExpandThread = { + init: function() { + if (g.VIEW !== 'index' || !Conf['Thread Expansion']) { + return; + } + return Thread.prototype.callbacks.push({ + name: 'Thread Expansion', + cb: this.node + }); + }, + node: function() { + var a, span; + + if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { + return; + } + a = $.el('a', { + textContent: "+ " + span.textContent, + className: 'summary', + href: 'javascript:;' + }); + $.on(a, 'click', ExpandThread.cbToggle); + return $.replace(span, a); + }, + cbToggle: function() { + var op; + + op = Get.postFromRoot(this.previousElementSibling); + return ExpandThread.toggle(op.thread); + }, + toggle: function(thread) { + var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; + + threadRoot = thread.OP.nodes.root.parentNode; + a = $('.summary', threadRoot); + switch (thread.isExpanded) { + case false: + case void 0: + thread.isExpanded = 'loading'; + _ref = $$('.thread > .postContainer', threadRoot); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + post = _ref[_i]; + ExpandComment.expand(Get.postFromRoot(post)); + } + if (!a) { + thread.isExpanded = true; + return; + } + thread.isExpanded = 'loading'; + a.textContent = a.textContent.replace('+', '× Loading...'); + $.cache("//api.4chan.org/" + thread.board + "/res/" + thread + ".json", function() { + return ExpandThread.parse(this, thread, a); + }); + break; + case 'loading': + thread.isExpanded = false; + if (!a) { + return; + } + a.textContent = a.textContent.replace('× Loading...', '+'); + break; + case true: + thread.isExpanded = false; + if (a) { + a.textContent = a.textContent.replace('-', '+'); + num = (function() { + if (thread.isSticky) { + return 1; + } else { + switch (g.BOARD.ID) { + case 'b': + case 'vg': + case 'q': + return 3; + case 't': + return 1; + default: + return 5; + } + } + })(); + replies = $$('.thread > .replyContainer', threadRoot).slice(0, -num); + for (_j = 0, _len1 = replies.length; _j < _len1; _j++) { + reply = replies[_j]; + if (Conf['Quote Inlining']) { + while (inlined = $('.inlined', reply)) { + inlined.click(); + } + } + $.rm(reply); + } + } + _ref1 = $$('.thread > .postContainer', threadRoot); + for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { + post = _ref1[_k]; + ExpandComment.contract(Get.postFromRoot(post)); + } + } + }, + parse: function(req, thread, a) { + var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; + + if (a.textContent[0] === '+') { + return; + } + status = req.status; + if (![200, 304].contains(status)) { + a.textContent = "Error " + req.statusText + " (" + status + ")"; + $.off(a, 'click', ExpandThread.cb.toggle); + return; + } + thread.isExpanded = true; + a.textContent = a.textContent.replace('× Loading...', '-'); + posts = JSON.parse(req.response).posts; + if (spoilerRange = posts[0].custom_spoiler) { + Build.spoilerRange[g.BOARD] = spoilerRange; + } + replies = posts.slice(1); + posts = []; + nodes = []; + for (_i = 0, _len = replies.length; _i < _len; _i++) { + reply = replies[_i]; + if (post = thread.posts[reply.no]) { + nodes.push(post.nodes.root); + continue; + } + node = Build.postFromObject(reply, thread.board); + post = new Post(node, thread, thread.board); + link = $('a[title="Highlight this post"]', node); + link.href = "res/" + thread + "#p" + post; + link.nextSibling.href = "res/" + thread + "#q" + post; + posts.push(post); + nodes.push(node); + } + Main.callbackNodes(Post, posts); + $.after(a, nodes); + return Fourchan.parseThread(thread.ID, 1, nodes.length); + } + }; + + FileInfo = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) { + return; + } + this.funk = this.createFunc(Conf['fileInfo']); + return Post.prototype.callbacks.push({ + name: 'File Info Formatting', + cb: this.node + }); + }, + node: function() { + if (!this.file || this.isClone) { + return; + } + return this.file.text.innerHTML = FileInfo.funk(FileInfo, this); + }, + createFunc: function(format) { + var code; + + code = format.replace(/%(.)/g, function(s, c) { + if (c in FileInfo.formatters) { + return "' + FileInfo.formatters." + c + ".call(post) + '"; + } else { + return s; + } + }); + return Function('FileInfo', 'post', "return '" + code + "'"); + }, + convertUnit: function(size, unit) { + var i; + + if (unit === 'B') { + return "" + (size.toFixed()) + " Bytes"; + } + i = 1 + ['KB', 'MB'].indexOf(unit); + while (i--) { + size /= 1024; + } + size = unit === 'MB' ? Math.round(size * 100) / 100 : size.toFixed(); + return "" + size + " " + unit; + }, + escape: function(name) { + return name.replace(/<|>/g, function(c) { + return c === '<' && '<' || '>'; + }); + }, + formatters: { + t: function() { + return this.file.URL.match(/\d+\..+$/)[0]; + }, + T: function() { + return "" + (FileInfo.formatters.t.call(this)) + ""; + }, + l: function() { + return "" + (FileInfo.formatters.n.call(this)) + ""; + }, + L: function() { + return "" + (FileInfo.formatters.N.call(this)) + ""; + }, + n: function() { + var fullname, shortname; + + fullname = this.file.name; + shortname = Build.shortFilename(this.file.name, this.isReply); + if (fullname === shortname) { + return FileInfo.escape(fullname); + } else { + return "" + (FileInfo.escape(shortname)) + "" + (FileInfo.escape(fullname)) + ""; + } + }, + N: function() { + return FileInfo.escape(this.file.name); + }, + p: function() { + if (this.file.isSpoiler) { + return 'Spoiler, '; + } else { + return ''; + } + }, + s: function() { + return this.file.size; + }, + B: function() { + return FileInfo.convertUnit(this.file.sizeInBytes, 'B'); + }, + K: function() { + return FileInfo.convertUnit(this.file.sizeInBytes, 'KB'); + }, + M: function() { + return FileInfo.convertUnit(this.file.sizeInBytes, 'MB'); + }, + r: function() { + if (this.file.isImage) { + return this.file.dimensions; + } else { + return 'PDF'; + } + } + } + }; + + Fourchan = { + init: function() { + var board; + + if (g.VIEW === 'catalog') { + return; + } + board = g.BOARD.ID; + if (board === 'g') { + $.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML);\n}, false);"); + Post.prototype.callbacks.push({ + name: 'Parse /g/ code', + cb: this.code + }); + } + if (board === 'sci') { + $.globalEval("window.addEventListener('jsmath', function(e) {\n if (jsMath.loaded) {\n // process one post\n jsMath.ProcessBeforeShowing(e.detail);\n } else {\n // load jsMath and process whole document\n jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]);\n jsMath.Autoload.LoadJsMath();\n }\n}, false);"); + return Post.prototype.callbacks.push({ + name: 'Parse /sci/ math', + cb: this.math + }); + } + }, + code: function() { + var pre, _i, _len, _ref; + + if (this.isClone) { + return; + } + _ref = $$('.prettyprint', this.nodes.comment); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + pre = _ref[_i]; + $.event('prettyprint', pre, window); + } + }, + math: function() { + if (this.isClone || !$('.math', this.nodes.comment)) { + return; + } + return $.event('jsmath', this.nodes.post, window); + }, + parseThread: function(threadID, offset, limit) { + return $.event('4chanParsingDone', { + threadId: threadID, + offset: offset, + limit: limit + }); + } + }; + + Keybinds = { + init: function() { + var init; + + if (g.VIEW === 'catalog' || !Conf['Keybinds']) { + return; + } + init = function() { + var node, _i, _len, _ref; + + $.off(d, '4chanXInitFinished', init); + $.on(d, 'keydown', Keybinds.keydown); + _ref = $$('[accesskey]'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + node = _ref[_i]; + node.removeAttribute('accesskey'); + } + }; + return $.on(d, '4chanXInitFinished', init); + }, + keydown: function(e) { + var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; + + if (!(key = Keybinds.keyCode(e))) { + return; + } + target = e.target; + if (['INPUT', 'TEXTAREA'].contains(target.nodeName)) { + if (!/(Esc|Alt|Ctrl|Meta)/.test(key)) { + return; + } + } + threadRoot = Nav.getThread(); + if (op = $('.op', threadRoot)) { + thread = Get.postFromNode(op).thread; + } + switch (key) { + case Conf['Toggle board list']: + if (Conf['Custom Board Navigation']) { + Header.toggleBoardList(); + } + break; + case Conf['Toggle header']: + if (!$('#menu.left')) { + Header.menuButton.click(); + } + Header.headerToggler.click(); + break; + case Conf['Open empty QR']: + Keybinds.qr(threadRoot); + break; + case Conf['Open QR']: + Keybinds.qr(threadRoot, true); + break; + case Conf['Open settings']: + Settings.open(); + break; + case Conf['Close']: + if ($.id('fourchanx-settings')) { + Settings.close(); + } else if ((notifications = $$('.notification')).length) { + for (_i = 0, _len = notifications.length; _i < _len; _i++) { + notification = notifications[_i]; + $('.close', notification).click(); + } + } else if (QR.nodes) { + QR.close(); + } + break; + case Conf['Spoiler tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('spoiler', target); + break; + case Conf['Code tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('code', target); + break; + case Conf['Eqn tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('eqn', target); + break; + case Conf['Math tags']: + if (target.nodeName !== 'TEXTAREA') { + return; + } + Keybinds.tags('math', target); + break; + case Conf['Toggle sage']: + if (QR.nodes) { + Keybinds.sage(); + } + break; + case Conf['Submit QR']: + if (QR.nodes && !QR.status()) { + QR.submit(); + } + break; + case Conf['Watch']: + ThreadWatcher.toggle(thread); + break; + case Conf['Update']: + ThreadUpdater.update(); + break; + case Conf['Expand image']: + Keybinds.img(threadRoot); + break; + case Conf['Expand images']: + Keybinds.img(threadRoot, true); + break; + case Conf['fappeTyme']: + FappeTyme.toggle(); + break; + case Conf['Front page']: + window.location = "/" + g.BOARD + "/0#delform"; + break; + case Conf['Open front page']: + $.open("/" + g.BOARD + "/#delform"); + break; + case Conf['Next page']: + if (form = $('.next form')) { + window.location = form.action; + } + break; + case Conf['Previous page']: + if (form = $('.prev form')) { + window.location = form.action; + } + break; + case Conf['Open catalog']: + if (Conf['External Catalog']) { + window.location = CatalogLinks.external(g.BOARD.ID); + } else { + window.location = "/" + g.BOARD + "/catalog"; + } + break; + case Conf['Next thread']: + if (g.VIEW === 'thread') { + return; + } + Nav.scroll(+1); + break; + case Conf['Previous thread']: + if (g.VIEW === 'thread') { + return; + } + Nav.scroll(-1); + break; + case Conf['Expand thread']: + ExpandThread.toggle(thread); + break; + case Conf['Open thread']: + Keybinds.open(thread); + break; + case Conf['Open thread tab']: + Keybinds.open(thread, true); + break; + case Conf['Next reply']: + Keybinds.hl(+1, threadRoot); + break; + case Conf['Previous reply']: + Keybinds.hl(-1, threadRoot); + break; + case Conf['Hide']: + if (g.VIEW === 'index') { + ThreadHiding.toggle(thread); + } + break; + default: + return; + } + e.preventDefault(); + return e.stopPropagation(); + }, + keyCode: function(e) { + var kc, key; + + key = (function() { + switch (kc = e.keyCode) { + case 8: + return ''; + case 13: + return 'Enter'; + case 27: + return 'Esc'; + case 37: + return 'Left'; + case 38: + return 'Up'; + case 39: + return 'Right'; + case 40: + return 'Down'; + default: + if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { + return String.fromCharCode(kc).toLowerCase(); + } else { + return null; + } + } + })(); + if (key) { + if (e.altKey) { + key = 'Alt+' + key; + } + if (e.ctrlKey) { + key = 'Ctrl+' + key; + } + if (e.metaKey) { + key = 'Meta+' + key; + } + if (e.shiftKey) { + key = 'Shift+' + key; + } + } + return key; + }, + qr: function(thread, quote) { + if (!(Conf['Quick Reply'] && QR.postingIsEnabled)) { + return; + } + QR.open(); + if (quote) { + QR.quote.call($('input', $('.post.highlight', thread) || thread)); + } + QR.nodes.com.focus(); + if (Conf['QR Shortcut']) { + return $.rmClass($('.qr-shortcut'), 'disabled'); + } + }, + tags: function(tag, ta) { + var range, selEnd, selStart, value; + + value = ta.value; + selStart = ta.selectionStart; + selEnd = ta.selectionEnd; + ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd); + range = ("[" + tag + "]").length + selEnd; + ta.setSelectionRange(range, range); + return $.event('input', null, ta); + }, + sage: function() { + var isSage; + + isSage = /sage/i.test(QR.nodes.email.value); + return QR.nodes.email.value = isSage ? "" : "sage"; + }, + img: function(thread, all) { + var post; + + if (all) { + return ImageExpand.cb.toggleAll(); + } else { + post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread)); + return ImageExpand.toggle(post); + } + }, + open: function(thread, tab) { + var url; + + if (g.VIEW !== 'index') { + return; + } + url = "/" + thread.board + "/res/" + thread; + if (tab) { + return $.open(url); + } else { + return location.href = url; + } + }, + hl: function(delta, thread) { + var headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; + + if (Conf['Fixed Header'] && Conf['Bottom header']) { + topMargin = 0; + } else { + headRect = Header.bar.getBoundingClientRect(); + topMargin = headRect.top + headRect.height; + } + if (postEl = $('.reply.highlight', thread)) { + $.rmClass(postEl, 'highlight'); + rect = postEl.getBoundingClientRect(); + if (rect.bottom >= topMargin && rect.top <= doc.clientHeight) { + root = postEl.parentNode; + next = $.x('child::div[contains(@class,"post reply")]', delta === +1 ? root.nextElementSibling : root.previousElementSibling); + if (!next) { + this.focus(postEl); + return; + } + if (!(g.VIEW === 'thread' || $.x('ancestor::div[parent::div[@class="board"]]', next) === thread)) { + return; + } + rect = next.getBoundingClientRect(); + if (rect.top < 0 || rect.bottom > doc.clientHeight) { + if (delta === -1) { + window.scrollBy(0, rect.top - topMargin); + } else { + next.scrollIntoView(false); + } + } + this.focus(next); + return; + } + } + replies = $$('.reply', thread); + if (delta === -1) { + replies.reverse(); + } + for (_i = 0, _len = replies.length; _i < _len; _i++) { + reply = replies[_i]; + rect = reply.getBoundingClientRect(); + if (delta === +1 && rect.top >= topMargin || delta === -1 && rect.bottom <= doc.clientHeight) { + this.focus(reply); + return; + } + } + }, + focus: function(post) { + return $.addClass(post, 'highlight'); + } + }; + + Nav = { + init: function() { + var append, next, prev, span; + + switch (g.VIEW) { + case 'index': + if (!Conf['Index Navigation']) { + return; + } + break; + case 'thread': + if (!Conf['Reply Navigation']) { + return; + } + break; + default: + return; + } + span = $.el('span', { + id: 'navlinks' + }); + prev = $.el('a', { + href: 'javascript:;' + }); + next = $.el('a', { + href: 'javascript:;' + }); + $.on(prev, 'click', this.prev); + $.on(next, 'click', this.next); + $.add(span, [prev, $.tn(' '), next]); + append = function() { + $.off(d, '4chanXInitFinished', append); + return $.add(d.body, span); + }; + return $.on(d, '4chanXInitFinished', append); + }, + prev: function() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, 0); + } else { + return Nav.scroll(-1); + } + }, + next: function() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, d.body.scrollHeight); + } else { + return Nav.scroll(+1); + } + }, + getThread: function(full) { + var headRect, i, rect, thread, threads, topMargin, _i, _len; + + if (Conf['Bottom header']) { + topMargin = 0; + } else { + headRect = Header.bar.getBoundingClientRect(); + topMargin = headRect.top + headRect.height; + } + threads = $$('.thread:not([hidden])'); + for (i = _i = 0, _len = threads.length; _i < _len; i = ++_i) { + thread = threads[i]; + rect = thread.getBoundingClientRect(); + if (rect.bottom > topMargin) { + if (full) { + return [threads, thread, i, rect, topMargin]; + } else { + return thread; + } + } + } + return $('.board'); + }, + scroll: function(delta) { + var i, rect, thread, threads, top, topMargin, _ref, _ref1; + + _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; + top = rect.top - topMargin; + if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) { + i += delta; + } + top = ((_ref1 = threads[i]) != null ? _ref1.getBoundingClientRect().top : void 0) - topMargin; + return window.scrollBy(0, top); + } + }; + + RelativeDates = { + INTERVAL: $.MINUTE / 2, + init: function() { + if (g.VIEW === 'catalog' || !Conf['Relative Post Dates']) { + return; + } + $.on(d, 'visibilitychange ThreadUpdate', this.flush); + this.flush(); + return Post.prototype.callbacks.push({ + name: 'Relative Post Dates', + cb: this.node + }); + }, + node: function() { + var dateEl; + + if (this.isClone) { + return; + } + dateEl = this.nodes.date; + dateEl.title = dateEl.textContent; + return RelativeDates.setUpdate(this); + }, + relative: function(diff, now, date) { + var days, months, number, rounded, unit, years; + + unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); + rounded = Math.round(number); + if (rounded !== 1) { + unit += 's'; + } + return "" + rounded + " " + unit + " ago"; + }, + stale: [], + flush: function() { + var now, update, _i, _len, _ref; + + if (d.hidden) { + return; + } + now = new Date(); + _ref = RelativeDates.stale; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + update = _ref[_i]; + update(now); + } + RelativeDates.stale = []; + clearTimeout(RelativeDates.timeout); + return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); + }, + setUpdate: function(post) { + var markStale, setOwnTimeout, update; + + setOwnTimeout = function(diff) { + var delay; + + delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; + return setTimeout(markStale, delay); + }; + update = function(now) { + var date, diff, relative, singlePost, _i, _len, _ref; + + date = post.info.date; + diff = now - date; + relative = RelativeDates.relative(diff, now, date); + _ref = [post].concat(post.clones); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + singlePost = _ref[_i]; + singlePost.nodes.date.firstChild.textContent = relative; + } + return setOwnTimeout(diff); + }; + markStale = function() { + return RelativeDates.stale.push(update); + }; + return update(new Date()); + } + }; + + RemoveSpoilers = { + init: function() { + if (!Conf['Remove Spoilers']) { + return; + } + if (Conf['Indicate Spoilers']) { + this.wrapper = function(text) { + return "[spoiler]" + text + "[/spoiler]"; + }; + } + return Post.prototype.callbacks.push({ + name: 'Reveal Spoilers', + cb: this.node + }); + }, + wrapper: function(text) { + return text; + }, + node: function(post) { + var spoiler, spoilers, _i, _len; + + spoilers = $$('s', this.nodes.comment); + for (_i = 0, _len = spoilers.length; _i < _len; _i++) { + spoiler = spoilers[_i]; + $.replace(spoiler, $.tn(RemoveSpoilers.wrapper(spoiler.textContent))); + } + } + }; + + Report = { + init: function() { + if (!/report/.test(location.search)) { + return; + } + return $.ready(this.ready); + }, + ready: function() { + var field, form; + + form = $('form'); + field = $.id('recaptcha_response_field'); + $.on(field, 'keydown', function(e) { + if (e.keyCode === 8 && !field.value) { + return $.globalEval('Recaptcha.reload("t")'); + } + }); + return $.on(form, 'submit', function(e) { + var response; + + e.preventDefault(); + response = field.value.trim(); + if (!/\s/.test(response)) { + field.value = "" + response + " " + response; + } + return form.submit(); + }); + } + }; + + Sauce = { + init: function() { + var link, links, _i, _len, _ref; + + if (g.VIEW === 'catalog' || !Conf['Sauce']) { + return; + } + links = []; + _ref = Conf['sauces'].split('\n'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + if (link[0] === '#') { + continue; + } + links.push(this.createSauceLink(link.trim())); + } + if (!links.length) { + return; + } + this.links = links; + this.link = $.el('a', { + target: '_blank' + }); + return Post.prototype.callbacks.push({ + name: 'Sauce', + cb: this.node + }); + }, + createSauceLink: function(link) { + var m, text; + + link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { + switch (parameter) { + case '%TURL': + return "' + encodeURIComponent(post.file.thumbURL) + '"; + case '%URL': + return "' + encodeURIComponent(post.file.URL) + '"; + case '%MD5': + return "' + encodeURIComponent(post.file.MD5) + '"; + case '%board': + return "' + encodeURIComponent(post.board) + '"; + default: + return parameter; + } + }); + text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1]; + link = link.replace(/;text:.+$/, ''); + return Function('post', 'a', "a.href = '" + link + "';\na.textContent = '" + text + "';\nreturn a;"); + }, + node: function() { + var link, nodes, _i, _len, _ref; + + if (this.isClone || !this.file) { + return; + } + nodes = []; + _ref = Sauce.links; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + nodes.push($.tn('\u00A0'), link(this, Sauce.link.cloneNode(true))); + } + return $.add(this.file.info, nodes); + } + }; + + Time = { + init: function() { + if (g.VIEW === 'catalog' || !Conf['Time Formatting']) { + return; + } + this.funk = this.createFunc(Conf['time']); + return Post.prototype.callbacks.push({ + name: 'Time Formatting', + cb: this.node + }); + }, + node: function() { + if (this.isClone) { + return; + } + return this.nodes.date.textContent = Time.funk(Time, this.info.date); + }, + createFunc: function(format) { + var code; + + code = format.replace(/%([A-Za-z])/g, function(s, c) { + if (c in Time.formatters) { + return "' + Time.formatters." + c + ".call(date) + '"; + } else { + return s; + } + }); + return Function('Time', 'date', "return '" + code + "'"); + }, + day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + zeroPad: function(n) { + if (n < 10) { + return "0" + n; + } else { + return n; + } + }, + formatters: { + a: function() { + return Time.day[this.getDay()].slice(0, 3); + }, + A: function() { + return Time.day[this.getDay()]; + }, + b: function() { + return Time.month[this.getMonth()].slice(0, 3); + }, + B: function() { + return Time.month[this.getMonth()]; + }, + d: function() { + return Time.zeroPad(this.getDate()); + }, + e: function() { + return this.getDate(); + }, + H: function() { + return Time.zeroPad(this.getHours()); + }, + I: function() { + return Time.zeroPad(this.getHours() % 12 || 12); + }, + k: function() { + return this.getHours(); + }, + l: function() { + return this.getHours() % 12 || 12; + }, + m: function() { + return Time.zeroPad(this.getMonth() + 1); + }, + M: function() { + return Time.zeroPad(this.getMinutes()); + }, + p: function() { + if (this.getHours() < 12) { + return 'AM'; + } else { + return 'PM'; + } + }, + P: function() { + if (this.getHours() < 12) { + return 'am'; + } else { + return 'pm'; + } + }, + S: function() { + return Time.zeroPad(this.getSeconds()); + }, + y: function() { + return this.getFullYear() - 2000; + } + } + }; + Settings = { init: function() { var link, settings; @@ -12414,7 +12837,7 @@ Settings.addSection('Script', Settings.main); Settings.addSection('Filter', Settings.filter); Settings.addSection('Sauce', Settings.sauce); - Settings.addSection('Rice', Settings.rice); + Settings.addSection('Advanced', Settings.advanced); Settings.addSection('Keybinds', Settings.keybinds); $.on(d, 'AddSettingsSection', Settings.addSection); $.on(d, 'OpenSettings', function(e) { @@ -12449,7 +12872,7 @@ Settings.dialog = dialog = $.el('div', { id: 'appchanx-settings', "class": 'dialog', - innerHTML: "\n
\n
" + innerHTML: "
" }); Settings.overlay = overlay = $.el('div', { id: 'overlay' @@ -12753,6 +13176,13 @@ }); } data.Conf.WatchedThreads = data.WatchedThreads; + } else if (version[0] === '3') { + data = Settings.convertSettings(data, { + 'Reply Hiding': 'Reply Hiding Buttons', + 'Thread Hiding': 'Thread Hiding Buttons', + 'Bottom header': 'Bottom Header', + 'Unread Tab Icon': 'Unread Favicon' + }); } return $.set(data.Conf); }, @@ -12771,7 +13201,7 @@ filter: function(section) { var select; - section.innerHTML = "\n
"; + section.innerHTML = "
"; select = $('select', section); $.on(select, 'change', Settings.selectFilter); return Settings.selectFilter.call(select); @@ -12794,31 +13224,31 @@ $.add(div, ta); return; } - return div.innerHTML = "
Filter is disabled.
\n

\n Use regular expressions, one per line.
\n Lines starting with a # will be ignored.
\n For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
\n MD5 filtering uses exact string matching, not regular expressions.\n

\n
    You can use these settings with each regular expression, separate them with semicolons:\n
  • \n Per boards, separate them with commas. It is global if not specified.
    \n For example: boards:a,jp;.\n
  • \n
  • \n Filter OPs only along with their threads (`only`), replies only (`no`), or both (`yes`, this is default).
    \n For example: op:only;, op:no; or op:yes;.\n
  • \n
  • \n Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
    \n For example: stub:yes; or stub:no;.\n
  • \n
  • \n Highlight instead of hiding. You can specify a class name to use with a userstyle.
    \n For example: highlight; or highlight:wallpaper;.\n
  • \n
  • \n Highlighted OPs will have their threads put on top of board pages by default.
    \n For example: top:yes; or top:no;.\n
  • \n
"; + return div.innerHTML = "
Filter is disabled.

\nUse regular expressions, one per line.
\nLines starting with a # will be ignored.
\nFor example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
\nMD5 filtering uses exact string matching, not regular expressions.\n

    You can use these settings with each regular expression, separate them with semicolons:\n
  • \n Per boards, separate them with commas. It is global if not specified.
    \n For example: boards:a,jp;.\n
  • \n Filter OPs only along with their threads (`only`), replies only (`no`), or both (`yes`, this is default).
    \n For example: op:only;, op:no; or op:yes;.\n
  • \n Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
    \n For example: stub:yes; or stub:no;.\n
  • \n Highlight instead of hiding. You can specify a class name to use with a userstyle.
    \n For example: highlight; or highlight:wallpaper;.\n
  • \n Highlighted OPs will have their threads put on top of board pages by default.
    \n For example: top:yes; or top:no;.\n
"; }, sauce: function(section) { var sauce; - section.innerHTML = "
Sauce is disabled.
\n
Lines starting with a # will be ignored.
\n
You can specify a display text by appending ;text:[text] to the URL.
\n
    These parameters will be replaced by their corresponding values:\n
  • %TURL: Thumbnail URL.
  • \n
  • %URL: Full image URL.
  • \n
  • %MD5: MD5 hash.
  • \n
  • %board: Current board.
  • \n
\n"; + section.innerHTML = "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
    These parameters will be replaced by their corresponding values:\n
  • %TURL: Thumbnail URL.
  • %URL: Full image URL.
  • %MD5: MD5 hash.
  • %board: Current board.
"; sauce = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { return sauce.value = item['sauces']; }); return $.on(sauce, 'change', $.cb.value); }, - rice: function(section) { + advanced: function(section) { var archiver, event, input, inputs, items, name, toSelect, _i, _j, _len, _len1, _ref; - section.innerHTML = "
\n Archiver\n Select an Archiver for this board:\n \n
\n
\n Custom Board Navigation is disabled.\n
\n
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
\n
\n For example:
\n [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
\n [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
\n
Board link: board
\n
Title link: board-title
\n
Board link (Replace with title when on that board): board-replace
\n
Full text link: board-full
\n
Custom text link: board-text:\"VIP Board\"
\n
Index-only link: board-index
\n
Catalog-only link: board-catalog
\n
Combinations are possible: board-index-text:\"VIP Index\"
\n
Full board list toggle: toggle-all
\n
\n\n
\n Time Formatting is disabled.\n
:
\n \n
Day: %a, %A, %d, %e
\n
Month: %m, %b, %B
\n
Year: %y
\n
Hour: %k, %H, %l, %I, %p, %P
\n
Minute: %M
\n
Second: %S
\n
\n\n
\n Quote Backlinks formatting is disabled.\n
:
\n
\n\n
\n File Info Formatting is disabled.\n
:
\n
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
\n
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
\n
Spoiler indicator: %p
\n
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
\n
Resolution: %r (Displays 'PDF' for PDF files)
\n
\n\n
\n Unread Favicon is disabled.\n \n \n
\n\n
\n Custom CSS\n \n \n
"; + section.innerHTML = "
Archiver
\n Select an Archiver for this board:\n
Custom Board Navigation is disabled.
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
\n For example:
[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
Board link: board
Title link: board-title
Board link (Replace with title when on that board): board-replace
Full text link: board-full
Custom text link: board-text:\"VIP Board\"
Index-only link: board-index
Catalog-only link: board-catalog
Combinations are possible: board-index-text:\"VIP Index\"
Full board list toggle: toggle-all
Time Formatting is disabled.
:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Unread Favicon is disabled.
Emoji is disabled.
\n Sage Icon:
\n Position:
Thread Updater is disabled.
\n Interval:
Custom CSS
"; items = {}; inputs = {}; - _ref = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss']; + _ref = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'emojiPos', 'sageEmoji', 'usercss']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { name = _ref[_i]; input = $("[name='" + name + "']", section); items[name] = Conf[name]; inputs[name] = input; - event = ['favicon', 'usercss'].contains(name) ? 'change' : 'input'; + event = ['favicon', 'usercss', 'sageEmoji', 'emojiPos'].contains(name) ? 'change' : 'input'; $.on(input, event, $.cb.value); } archiver = $('select[name=archiver]', section); @@ -12845,15 +13275,17 @@ for (key in items) { val = items[key]; + if (['usercss', 'emojiPos', 'archiver'].contains(key)) { + continue; + } input = inputs[key]; input.value = val; - if ('usercss' !== name) { - $.on(input, event, Settings[key]); - Settings[key].call(input); - } + $.on(input, event, Settings[key]); + Settings[key].call(input); } + return Rice.nodes(sectionreturn); }); - Rice.nodes(section); + $.on($('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval); $.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss); return $.on($.id('apply-css'), 'click', Settings.usercss); }, @@ -12867,7 +13299,7 @@ return this.nextElementSibling.textContent = funk(Time, new Date()); }, backlink: function() { - return this.nextElementSibling.textContent = Conf['backlink'].replace(/%id/, '123456789'); + return this.nextElementSibling.textContent = this.value.replace(/%id/, '123456789'); }, fileInfo: function() { var data, funk; @@ -12892,7 +13324,10 @@ if (g.VIEW === 'thread' && Conf['Unread Favicon']) { Unread.update(); } - return this.nextElementSibling.innerHTML = "\n\n\n"; + return $.id('favicon-preview').innerHTML = "\n\n\n"; + }, + sageEmoji: function() { + return $.id('sageicon-preview').innerHTML = ""; }, togglecss: function() { if ($('textarea', this.parentNode.parentNode).disabled = !this.checked) { @@ -12908,7 +13343,7 @@ keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; - section.innerHTML = "
Keybinds are disabled.
\n
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
\n
Press Backspace to disable a keybind.
\n\n \n
ActionsKeybinds
"; + section.innerHTML = "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
"; tbody = $('tbody', section); items = {}; inputs = {}; @@ -13561,6 +13996,9 @@ 'Settings': Settings, 'Announcement Hiding': PSAHiding, 'Fourchan thingies': Fourchan, + 'Emoji': Emoji, + 'Color User IDs': IDColor, + 'Remove Spoilers': RemoveSpoilers, 'Custom CSS': CustomCSS, 'Linkify': Linkify, 'Resurrect Quotes': Quotify, @@ -13660,7 +14098,11 @@ Main.handleErrors(errors); } Main.callbackNodes(Thread, threads); - Main.callbackNodes(Post, posts); + Main.callbackNodesDB(Post, posts, function() { + $.event('4chanXInitFinished'); + return Main.checkUpdate(); + }); + return; } $.event('4chanXInitFinished'); return Main.checkUpdate(); @@ -13692,6 +14134,63 @@ return Main.handleErrors(errors); } }, + callbackNodesDB: function(klass, nodes, cb) { + var errors, func, i, len, node, queue, softTask; + + queue = []; + softTask = function() { + var args, func, task; + + task = queue.shift(); + func = task[0]; + args = Array.prototype.slice.call(task, 1); + func.apply(func, args); + if (!queue.length) { + return; + } + if ((queue.length % 7) === 0) { + return setTimeout(softTask, 0); + } else { + return softTask(); + } + }; + len = nodes.length; + i = 0; + errors = null; + func = function(node, i) { + var callback, err, _i, _len, _ref; + + _ref = klass.prototype.callbacks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + callback = _ref[_i]; + try { + callback.cb.call(node); + } catch (_error) { + err = _error; + if (!errors) { + errors = []; + } + errors.push({ + message: "\"" + callback.name + "\" crashed on " + klass.name + " No." + node + " (/" + node.board + "/).", + error: err + }); + } + } + if (i === len) { + if (errors) { + Main.handleErrors(errors); + } + if (cb) { + return cb(); + } + } + }; + while (i < len) { + node = nodes[i]; + queue.push([func, node, ++i]); + } + return softTask(); + }, addCallback: function(e) { var Klass, obj; diff --git a/changelog-old b/changelog-old deleted file mode 100644 index 1c0046608..000000000 --- a/changelog-old +++ /dev/null @@ -1,1320 +0,0 @@ -master -- Zixaphir - Removed "Mayhem"chan X v3 Header. - Anything that was previously in the header has been moved back to it's 4chan X pre-v3 position, but with v3 "enhancements". - Added Linkification, Embedding, and Title Link. - Added External Catalog Links. - Removed Updater Limitier. - Added Thumbnail Replacement for PNG, GIF, and JP(E)Gs. - GIF thumbnail replacement, unlike Auto-GIF, actually works in /gif/ and /wsg/. - Various little performance and readability tweaks. - -2.39.3 -- Mayhem - Add /fa/ and /s4s/ archive redirection. - -2.39.2 -- Mayhem - Fix importing settings containing unicode characters. - -2.39.1 -- Mayhem - Add /gd/, /out/, /vp/ and /vr/ archive redirection. - -2.39.0 -- Queue - Fix rare bug in Relative Post Dates. -- Mayhem - Add Import/Export settings. - -2.38.1 -- Mayhem - Fix a little regression introduced in 2.38.0 for webkit browsers. - -2.38.0 -- Queue - Add Relative Post Dates ("35 seconds ago"), disabled by default. -- Mayhem - Add /int/ archive redirection for threads, and post resurrection. - -2.37.6 -- Mayhem - Fix image expanding. - -2.37.5 -- Mayhem - Fix quoting inside inlined backlinks. - -2.37.4 -- James Campos - Don't expand pdfs -- Mayhem - Add /po/ archive redirection for threads, images and post resurrection. - Fix quoting. - -2.37.3 -- Mayhem - Fix successful posting causing errors. - Fix 4chan X trying to interact with >>>/board/rules links. - -2.37.2 -- aeosynth - Beep on new post to completely read thread -- Mayhem - Fix dead quotes. - -2.37.1 -- noface - Fix Anonymize not working on stubs. -- Mayhem - Fix selection quoting on Opera. - Fix history bug with Persistent QR enabled on Chrome. - Fix posting warning not displaying the reason. - Fix deadquotes showing up in code-tags. - -2.37.0 -- noface - Add Catalog Links toggle. - Fix Anonymize not working on hovered posts. -- Mayhem - Added catalog support. - Sync thread hiding between index and catalog. - Add /c/ archived thread and image redirection. - -2.36.3 -- Mayhem - Fix next/previous page keybinds. - -2.36.2 -- noface - Add tags support on /f/. -- Mayhem - Add /mu/ archived image redirection. - -2.36.1 -- noface - The Menu now has search links for Archivers. -- Mayhem - Added possibility to display unix timestamps with File Info Formatting. - -2.36.0 -- Mayhem - Added thread creation QR cooldown. - Fix QR cooldown timer between non-sage and sage posts. You can submit a non-sage post 30 seconds after a sage one. - Fix /q/ QR cooldowns for image and sage posts. - -2.35.4 -- Mayhem - Removed the obnoxious 4chan Pass ad in captcha errors when posting. - Fix 'Administrator/Moderator/Developer Replies' creating extra backlinks on /q/, again. - -2.35.3 -- Mayhem - Larger Comment text input by default for 4chan Pass users and on /f/ (no captcha). - -2.35.2 -- Mayhem - Fix 4chan Pass with QR on Firefox. - -2.35.1 -- Mayhem - Add support for 4chan Pass. - You can now use 'Enter' in keybind combinations. - -2.35.0 -- Mayhem - Use 4chan's API to fetch posts for: - - Thread Updater. - - Quote Inlining. - - Quote Previewing. - - Thread Expansion. - - Comment Expansion. - This will make fetching faster, and reduce bandwidth usage. - Add an option to disable 4chan's inline extension. Enabled by default. - Fix compatibility with Scriptish's auto-udpater. - -2.34.10 -- Mayhem - Fix 4chan X. Blame moot. - -2.34.9 -- Mayhem - Add /g/, /k/, /w/, /an/, /cgl/, /ck/, /lit/, /toy/ and /x/ archived image redirection. - One-word-captcha now works in the report window. - Fix duplicate file upload error link. - -2.34.8 -- Mayhem - One-word-captcha: you don't need to input an extra space anymore, the true word will be duplicated. - -2.34.7 -- Mayhem - Fix one-word-captcha, you'll need to leave a space for the fake word now. - -2.34.6 -- Mayhem - Fix error caused by change in 4chan's HTML about hidden filename in case of spoiler. - -2.34.5 -- Mayhem - Fix cooldown on /q/. - Fix thread creation with no file on /q/. - Fix 'Administrator/Moderator/Developer Replies' creating extra backlinks on /q/. - Add /mlp/ archive redirection. - -2.34.4 -- Mayhem - Add /q/ archive redirection. - -2.34.3 -- Mayhem - Update /k/ archive redirection. - -2.34.2 -- Mayhem - Adjust background tabs max update interval down to 5 minutes instead of 10. - Divide the Delete Link in the Menu into a Post and Image deletion links. - The Delete Links in the Menu now have a cooldown. - Add /fit/ archive redirection. - -2.34.1 -- Mayhem - Add /wsg/ archive redirection. - -2.34.0 -- Mayhem - New feature: Menu, which - - replaces and includes Report Button and Delete Button. - - add one-click Filter buttons. - - add download links to automatically save the file with its original filename. Chrome-only currently. - - add archive links. - - can integrate features from external userscripts/extensions, see https://github.com/MayhemYDG/4chan-x/wiki/Menu-API - The updater's refresh interval will now increase gradually in inactive threads: - - "Inactive thread" defines a thread that has not received any replies since its last refresh. - - Threads receiving a reply will have its updater interval reset to user's setting. - - The refresh interval will grow up to 90 seconds on visible tabs. - - Unfocused tabs will grow up to 120, 300, then 600 seconds. - - It takes at least 230 seconds to get to 120, at least 350 seconds to get to 300, and at least 650 seconds to get to 600. - - Focusing back to a tab will reset its inactivity state to normal. - - It basically changes nothing, but it salvages 4chan from being slaughtered by a massive amount of concurrent connections. - - see http://www.4chan.org/tmp/extensions.html - The updater's refresh interval is now limited to 5 seconds minimum. - Fix the Settings' window size on small screens, should be useable on Opera Mobile. - -2.33.8 -- Mayhem - Add Country filtering. - -2.33.7 -- Mayhem - Add /ck/ archive redirection. - -2.33.6 -- Mayhem - Update/fix archive redirection method. - -2.33.5 -- Mayhem - Add /sp/ archive redirection. - -2.33.4 -- Mayhem - Fix QR with the new captcha loading method. - The QR will now work on /f/ too. - -2.33.3 -- Mayhem - Revert changes that broke fetchers in Firefox. - -2.33.2 -- Mayhem - After 1000+ characters, a character counter will appear in the QR. - Add /soc/ archive redirection. - -2.33.1 -- Mayhem - Add /r9k/ archive redirection. - -2.33.0 -- btmcsweeney - Allow users to specify text for sauce links. -- Mayhem - Dead quotes can now be previewed or inlined with compatible archivers. - Opera fixes. - /f/ fixes. - -2.32.1 -- Mayhem - Fix images uploaded as spoilers. - -2.32.0 -- aeosynth - delete button -- Mayhem - Fix spoiler/code tag keybinds being ignored on post submission. - -2.31.6 -- Mayhem - Update captcha longevity to 5 minutes max, as according to 4chan's change. - -2.31.5 -- Mayhem - Fix spoiler and code tag keybinds regression. - -2.31.4 -- Mayhem - Add /an/ and /toy/ archive redirection. - -2.31.3 -- Mayhem - Add /cgl/, /e/, /mu/ and /w/ archive redirection. - -2.31.2 -- Mayhem - Add /x/ archive redirection. - -2.31.1 -- Mayhem - Fix some stub issues. - -2.31.0 -- Mayhem - Add a per filter stub setting. - -2.30.8 -- Mayhem - Fix quote previewing of forward hidden posts. - -2.30.7 -- aeosynth - Fix expanding comments. -- Mayhem - Fix file size info in case of spoiler image. - -2.30.6 -- Mayhem - Fix file size formatting always using integers. - -2.30.5 -- Mayhem - Fix syntax highlighting in code of fetched posts on /g/. - Add quick [code] tags keybind (alt+c). - -2.30.4 -- Mayhem - Add /co/ and /k/ archive redirection. - Fix quote resurrection of existing posts. - -2.30.3 -- Mayhem - Various bug fixes. - -2.30.2 -- Mayhem - Various bug fixes. - Add seconds as a supported Time Formatting specifier. - -2.30.1 -- Mayhem - Fix 4chan X not affecting fetched posts on Firefox Stable and Opera. - -2.30.0 -- Mayhem - Support 4chan's new HTML. - Add Spoiler indicator option in File Info Formatting - Remove archive.no-ip.org archive redirections. - -2.29.5 -- Mayhem - Fix QR filetype checking on /w/. - -2.29.4 -- Mayhem - Auto-GIF will not run in /gif/. - Fix QR filetype checking. - -2.29.3 -- Mayhem - Update Quick Reply posting method, this fixes compatibility for uncommon browsers such as - Opera Mobile 12 and Luakit for example. - -2.29.2 -- Mayhem - Add HTTPS support. - Ban support improvements and fixes. - -2.29.1 -- Mayhem - Update posting support to use https with sys.4chan.org according to 4chan's latest change. This fixes the 'referer' error. - Update redirection to installgentoo's archives. - -2.29.0 -- Mayhem - New feature: Quote Resurrection, automatically linkifying dead quotes to archives. - -2.28.1 -- Mayhem - General performance improvements. - Threads will now be updated instantly after posting through the QR. - Your own posts will not count toward the unread count after posting through the QR. - Performance issues are now lessened with QR thumbnails of high-res pictures. - You can now use Shift+Click on the file input to remove the selected reply's file. - Reply navigation keybinds will now scroll as you navigate. -- noface - Add unique ID to filter. - -2.28.0 -- ahodesuka - Reply/Thread File Info Formatting: - - Link: %l, %L (Original file names are shown inside threads). - - Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default). - - Resolution/PDF: %r - - Original filename: %n, %N. -- noface - Update imagelimit for /mlp/. - Fix stubs if poster has unique ID. -- Mayhem - You can now filter or highlight admin/mod posts. - New sauce parameter. $4: Current board. - -2.27.1 -- Mayhem - Fix stubs with the new filter. - Fix mail filtering. - The MD5 will now check for exact string matching, it will not use regular expressions. - -2.27.0 -- aeosynth / ahodesuka - new option: expand images from current position -- ahodesuka - Add Open Reply in New Tab option for replies made from the main board (not dumping). - Scroll back up (top of anchor - 42px) when unexpanding images. -- Mayhem - The Filter now has per filter settings: - - Filter the OP only along its thread, replies only, or both. - - Per boards, or global. - - Highlight, or hide. - - Highlighted OPs will have their threads put on top of the board page by default. - New filter group: Image dimensions. - Fix posting on Safari. - Fix rare case where the QR would not accept certain image types. - -2.26.4 -- Mayhem - Add /vg/ archive redirection. - Update ban support with the QR. - Fix history issues on Chrome. - -2.26.3 -- Mayhem - Ensure fresh captcha on QR load. - There is now a reply counter in the QR dump list. - Fix unXXXifier on pages starting with not XXXed numbers. - Update image limit indicator for /vg/. - -2.26.2 -- Mayhem - New option to fix XXX'd post numbers. - Fix post number quoting on /b/ and /v/. - Update archive redirection for /v/. - -2.26.1 -- Mayhem - You can now drag replies in the dump list to reorder them. - Fix sauce links with spoiled thumbnails. - -2.26.0 -- desuwa - New option: remember the size of the QR on Firefox. -- aeosynth - prevent post form flicker -- Mayhem - Load QR's iframe to sys.4chan.org faster, unless you use Greasemonkey. Thanks desuwa. - Increase Sauce linking possibilites: - Thumbnails, full images, MD5 hashes. - New option: Recursive Filtering: Filter replies of filtered posts. - Unread Favicon is now optional, independent of Unread Count. - Fix some compatibility issues with file drag and drop, notably with QuickDrag extension. - -2.25.5 -- Mayhem - Hide the normal post form by default, optional. - -2.25.4 -- Mayhem - Fix text inputs not sent/saved correctly in the QR when pasted for example. - Revert hidding normal post form. - -2.25.3 -- Mayhem - Fix image spoiler always enabled, bug introduced in 2.25.2. - -2.25.2 -- Mayhem - Reverted updater's scrolling behavior. - Fix image posting on Firefox along with Unicode characters in the form. - Ghettofix Greasemonkey compatibility with the new QR. - Greasemonkey is still NOT RECOMMENDED, use Scriptish instead. - -2.25.1 -- Mayhem - Fix missing image filename uploads. Thanks desuwa. - -2.25.0 -- Mayhem - Fix 4chan X on /f/. - Support for the normal post form has been phased out in favor of the new QR. - New rewritten and redesigned Quick Reply. Highlights include: - - Easy dumping for image, text, or samefagging. - - Toggle auto-posting by trying to submit during the cooldown. - - Multiple file selection. - - Image thumbnails. - - Drag and drop files on the page will add these files to the QR. - - Cache captchas with Shift + Enter. - - Create new threads with the QR, will auto-noko. - - Also includes all the previous features: - - Cooldown and auto-posting. - - Posting error detection and prevention. - - Captcha reloading on backspace. - - Auto Watch on reply/thread creation. - - Text selection to quote. - - Etc... - CAUTION: - Images posted with the new QR on Firefox/Aurora/Nightly will have their filename missing. - see https://github.com/MayhemYDG/4chan-x/issues/137 - Greasemonkey is buggy, use Scriptish instead. - -2.24.5 -- Mayhem - Index Navigation and the See next/previous thread keybinds will not cycle through board pages anymore. - Fix archive redirection in Opera. - Opera support will now be temporarily on hold. - see https://github.com/MayhemYDG/4chan-x/issues/136 - -2.24.4 -- ahodesuka - Scroll back up when unexpanding images. -- e000 - Prevent absurd cooldown durations. -- Mayhem - Better image expanding reload, should fool CloudFlare's cache. -- seaweed - Prevent the hover image to be partially masked by the url preview/status bar. - -2.24.3 -- Mayhem - Set image limit in Thread Stats to 252 for /a/ and /v/, default to 152. - Fix 4chan X in locked threads. - -2.24.2 -- mayhem - fix options popping up everytime a page loads - -2.24.1 -- mayhem - fix Open thread in new tab keybind for Safari with Ninjakit - fix Index/Reply Navigation working in both cases when only one is enabled - -2.24.0 -- mayhem - redirect 404'd pictures to archives when possible - new keybind to open the options: ctrl+o - the unread count will decrease when inlining quotes of unread posts - the report button can open multiple popups again - add omploader to the list of optional flavors (http://ompldr.org/upload?url1=) - update archive redirections, add /lit/ and /u/ - fit horizontally for Image Hover - -2.23.7 -- mayhem - update archive redirections - -2.23.6 -- mayhem - fix empty sauce or all flavors commented out from breaking 4chan X - -2.23.5 -- mayhem - increase the thread updater retry timeout limit at each retry - fix selection to quote when selecting started from the end of a line on Firefox - -2.23.4 -- mayhem - thread updater network optimization - prevent regexp errors with the filter - -2.23.3 -- mayhem - fix 2.32.2 regression duplicating new posts in rare cases - -2.23.2 -- mayhem - hide original posts from inlined backlinks - optional - enable autoposting when submitting a captcha while on cooldown - fix caret position when quoting on Opera - -2.23.1 -- mayhem - fix favicon updating on Opera - fix compatibility with Tampermonkey - -2.23.0 -- mayhem - multiple unread favicons to chose in the options - quotes are now inserted at the caret position in the QR - quotes also replace the text selection in the QR - open QR focused when using the `Open QR without post number inserted` keybind - fix thread updater for Opera -- aeosynth - update the captcha caching expiration date to 30mins - -2.22.2 -- mayhem - indicate if the settings require a feature to be enabled - fix obscure and continuous prompts to auto update - -2.22.1 -- mayhem - change 'Duckroll' for 'Cross-thread' - fix image expanding fitness with an inlined backlink on Firefox - -2.22.0 -- mayhem - new Indicate Duckrolls feature - put regex.info sauce back - disabled by default - fix for auto image reloading in 404'd threads on Firefox - -2.21.4 -- mayhem - fix 4chan X version updater - -2.21.3 -- mayhem - fix locked thread icons with fit width/screen enabled on Firefox - fix fit width on Opera - for userstylers: you can use the rendering engine body class - -2.21.2 -- mayhem - fix time formatting year in Opera - fix QR keybinds - fix QR posts getting swallowed by sys.4chan.org - -2.21.1 -- mayhem - fix Opera - -2.21.0 -- mayhem - initiate 4chan X earlier - performance improvements - regular expressions based filter - remove image preloading - automatically reload expanded pictures on error - handle bans with the thread updater - use unread favicons by ferongr - -2.20.3 -- mayhem - fix DST for two days of the year - -2.20.2 -- mayhem - update archive redirection -- aeosynth - hopefully fix qr error / update messages - rm support throd link - -2.20.1 -- mayhem - fix regression: qr not preventing errors - -2.20.0 -- mayhem - do not display inlined quotes within the quote preview - fix cross threads quotes in expanded threads or inlined cross quotes - default post styling for quote previews -- aeosynth - script auto updating - -2.19.3 -- mayhem - quote inlining default styling (by xat) - add up/down/right/left keybinding support -- aeosynth - fixed bug that caused script to fail when time formatting enabled - -2.19.2 -- mayhem - update archives redirections -- aeosynth - change unread favicons (by xat-) - -2.19.1 -- mayhem - fix OP indication in expanded comments - fix no.id links within cross thread/board inlined quote - -2.19.0 -- mayhem - backlink formatting - distinguishable unread favicons on white backgrounds - fix updater refreshing 404'd threads - fix backlinks added into inlined quotes -- aeosynth - fix tab title for 404d threads - -2.18.3 -- mayhem - fix quote features in expanded comments - fix scrolling onto a quote not showing the preview - -2.18.2 -- aeosynth: - fix long thread watcher titles - fix normal form errors with an open empty QR - -2.18.1 -- mayhem: - fix persistent qr not cleaning the file input -- aeosynth: - updater: scroll background tabs - -2.18.0 -- mayhem: - back to normal versioning - bring back auto posting - don't start the cooldown on thread creation - limit the file upload dialog to the accepted file types (qr) -- aeosynth: - show linebreaks as spaces in title & watcher - auto posting fixes - option to remember qr spoiler state - -11.8.15 -- aeosynth: - convert qr from hidden iframes to ajax - derp, nevermind. ajaxing reverted, still working on it in dev branch - -11.8.11.1 -- aeosynth: - fix qr autohiding - -11.8.11.0 -- aeosynth: - - rm auto post checkbox - if (captcha filled or cached) and (text or file) - auto post after cooldown - - options updated immediately instead of requiring page refresh - -11.8.10.1 -- aeosynth: - - persistent captchas (expiring after 4 hours, 55 minutes) - - files upload in 'correct' order - - manually submitting will use cached captchas - -11.8.10.0 -- aeosynth: - - fix captcha caching on blank content - -11.8.9.0 -- aeosynth: - - change green oval archive to gentoomen - - validate filesize asap - - show correct captcha cache length when creating qr - - 1s delay when autoposting after errors to not look so automated - - cache captcha on blank text / file - -11.8.6.0 -- mayhem: - - fix post links in expanded threads - - fix 4chan X in closed threads -- aeosynth: - - only auto scroll focused tabs - - quote inlining: only work on unmodified left-click - - select multiple files (one at a time) - - captcha caching - - qr: optional auto hiding - - copy old textarea value - - scroll to bottom of page if post isn't found (thumbnail generation takes - time) - - only scroll focused tabs - - time: %e, %k, %l - - reverted hovering fix - -2.17.1 -- mayhem: - - fix updater when there is a hash in the url -- aeosynth: - - better hovering fix - -2.17.0 -- mayhem: - - Make updater's settings dynamic - - Multi-line quoting - - keybinds: z: reset unread count (useful when page is not scrollable) - - fix remember updater's interval settings - - fix wrong keybind input in options - - fix time preview - - fix backlink inlining removing its container - - fix options key/keybinds key variables. -- aeosynth: - - new imgur upload link commented out in the sauces - - link to dup file in the QR error - - fix bug with hovering elements not disappearing - -2.16.1 -- mayhem: - - fix updater's custom settings - -2.16.0 -- mayhem: - - Thread Stats performance fix, especially on long threads - - Sauce performance improvement - - fix Quote Inlining for a pattern - - other minor performance improvements and bug fixes -- aeosynth: - - fix an upgrading problem (1.x -> 2.x) - - fix minor bugs with auto-posting - - add updater scrolling - - enable auto-updating by default - - alphabetize option groups - -2.15.1 -- mayhem: - - prevent upload of too large files - - fix options height for netbooks - - /a/ is now archived on easymodo - -2.15.0 -- mayhem: - - custom hotkey binding - - image spoiler revealer - - optional auto noko - - add a class for reply stubs - - fix options centering on Opera - - fix append '#watch' only when auto watch is enabled - - fix cooldown with the normal post form - - fix `Select next reply` hotkey behaviour -- aeosynth: - - keep options dialog at constant size - - drop firefox 3.6 support (again...) - - comment out tineye - - trying to post during cooldown will enable auto-post - - fix errors w/ noscript - -2.14.0 -- mayhem: - - firstrun dialog - - fix backlinking future posts - - fix op non-backlinking - - fix thread expansion on /t/ - - fix sage cooldown - - fix extra link area around images - - fix persistent qr -- aeosynth: - - reply navigation - - fix time formatting of xhr posts - - fix %P time formatting - -2.13.0 -- mayhem: - - fix various bugs - - keybinds: 0: actually refresh page 0 - - auto posting - - add google sauce -- arbitrary time formatting -- rewrite options dialog, lightboxing -- various fixes - -2.12.0 -- revert the status bar blocking changes -- add a 5px padding-bottom to #qp - -2.11.4 -- fix another quoting bug - -2.11.3 -- really fix quoting - -2.11.2 -- fix quoting stuff - -2.11.1 -- work on firefox < 6.0 - -2.11.0 -mayhem: - - fix quote highlighting -- block status bar when hovering quotes / images (may break image leeching) - -2.10.0 -mayhem: - space between backlinks (to prevent them from spilling out of the page) - thread stats: fix wrong selector id when image limit reached - fix localized time + inlined quotes -- fix edge hovering (flip to left of mouse @ right screen edge) -- work on closed threads (some stickies) -- op backlinking option -- quote highlighting option -- (maybe) work on fx3 - -2.9.0 -- mayhem: - better placement of inlined backquotes - fix qr in expanded threads - inline quote fixes - fetch name, mail and pass in cookies at each qr opening - highlight quoted post during quote preview - add ' (OP)' to op quotes - am/pm localized time - give visual feedback on which quote has been inlined - fix paypal link - cooldown: alert only when posting from normal post form - fix cooldown - thread stats - auto noko - fix jumping hover dialogs -- forwardlinks -- rewrite image expansion/fitting -- image expansion option: fit height -- keybind: e - toggle thread expansion -- fix bug where x-board links on chrome are unclickable -- fix x-board / x-thread quoting - -2.8.1 -- tab over captcha - -2.8.0 -- mayhem: - redesigned options - don't backlink op on index pages - base64 donate button -- fix qr replying to wrong thread -- small tweaks - -2.7.0 -- mayhem: - add class to reply hider and report buttons - fix anonymizer -- inline quoting -- don't break on >>>/board/ links (links w/o an id) -- remove op backlinking -- fix qr on expanded posts -- image hover: fit height - -2.6.0 -- mayhem: - start backlinks - fix watcher refresh false positive -- backlinks -- cross-board previews -- fix menu for opera -- slightly bigger qr textarea - -2.5.0 -- mayhem: - qp: better cross-thread op quoting - qp: fix overflowing preview - qr: prevent email field from popping out - qr: fix cloning values -- keybinds: fix m - -2.4.2 -- fix nodeInserted (work on new posts) -- qr: remember name - -2.4.1 -- fix image expansion bug - -2.4.0 -- mayhem: - auto watch reply - fix report button splitting over two lines - start merging /b/ackwash -- quote previews -- qr remix - -2.3.0 -- mayhem: - refresh watcher list on un/watch - auto refresh watcher list - update no-ip.org archive - fix auto-watch -- flavor comments - -2.2.2 -- hopefully fix upgrading issues - -2.2.1 -- mayhem: - fix op image expansion bug - fix op comment expansion - -- fix /b/ackwash multiple links bug -- make cooldown timer optional, disabled by default - -2.2.0 -- mayhem: - - don't select text when moving dialogs - - fix thread watcher's padding - - remove captcha logos from quick reply - - post in title - show default title when no subject/comment - - update tab title on 404 - - chrome - fix favicons - - fix 404 favicon - - fix updater retrying - - set timer to 0 on manual update - - fix threading when op's file is deleted - -- fix navigating past hidden threads -- fix updater option - verbose -- only navigate to pages that exist -- use Greasemonkey api (sigh) -- rewrite, reenable cooldown -- better image resize algorithm - -2.1.0 -- added back the 0 keybind - go to board's front page - -2.0.0 -- [chrome] qr error notifications -- x-browser auto-watch -- image expansion w/o horizontal scrollbars -- removed reply nav -- floating thread nav -- fix /b/ thread nav -- ignore middle clicks on images -- smarter redirect -- remove all GM_ functions -- [chrome] fix slow scrolling w/ unread post count in titlebar -- keybind: x: hide thread -- qr: remove `auto` -- rewrite / reorganize code - -1.27.8 -- fix qr image posting -- fix thread hiding -- fix movement - -1.27.7 -- fix qr persist -- fix updater defaults - -1.27.6 -- fix 'update now' button - -1.27.5 -- fix regression - reload captcha after posting - -1.27.4 -- fix imageHover on chrome - -1.27.3 -- fix regression - movement - -1.27.2 -- fix regression - close / refresh qr on chrome -- add updateURL for scriptish - -1.27.1 -- fix regression - unhide qr when quoting - -1.27.0 -- x-browser qr error checking (except for batshit insane chrome - see - http://code.google.com/p/chromium/issues/detail?id=20773) -- fix opera movement, again -- bigger options button -- move updater to bottom-right by default - -1.26.3 -- don't enable reply nav by default -- reset file input after posting (persistent qr) -- remove restore ids -- check for dst - -1.26.2 -- fix thread watcher position; remember new position - -1.26.1 -- fix unread count for opera -- fix default thread watcher placement - -1.26.0 -- image hover -- support/donate - -1.25.0 -- auto gif -- only preload in threads -- fix autohide -- sage cooldown = 60s - -1.24.0 -- image preloading - -1.23.1 -- fix updater notifications - -1.23.0 -- 'verbose' updater option -- remove /new/, /r9k/ from archivers -- tweak 'fit width' to get rid of horizontal scrollbar, only partially working - -1.22.0 -- update archives -- tweak updater feedback/ui - -1.21.0 -- image expansion types -- move global auto update option to updater dialog - -1.20.4 -- fix options - -1.20.3 -- update archives -- fool the cache - -1.20.2 -- fix qr again - -1.20.1 -- fix disappearing updater bug -- only restore ids on /b/ and /v/ -- fix JK keybinds - -1.20.0 -- keybinds - - add u - update now - - remove hHlLjk, numerical prefixes - - use [vimus](http://userscripts.org/scripts/show/93187) for non-chan keybinds -- fix slow scrolling -- add replies in original order so backlinks resolve properly -- fix qr quoting - -1.19.0 -- restore ids -- thread updater - -1.18.4 -- fix qr quoting of selected text - -1.18.3 -- fix w / i / I keybinds -- git rid of body padding - -1.18.2 -- logic fail - -1.18.1 -- only adding padding when not in replies - -1.18.0 -- body { padding-bottom } when Thread Navigation -- keybinds - - insert mode - ^s - quick spoiler - escape - remove quick reply - - normal mode - h/l - scroll left/right, H/L - move pages - m/M - expand selected / all images - w - watch thread (changed from m) - -1.17.5 -- fix threading -- fix images - -1.17.4 -- yeah i guess margin is cool too - -1.17.3 -- a img { float: left; } - -1.17.2 -- expand images in new posts - -1.17.1 -- don't affect image clicks when ctrl | alt | shift held -- add .hide class so thumbnail hiding works - -1.17.0 -- image expansion - -1.16.0 -- I - open blank quick reply - -1.15.0 -- add archive at 173.74.0.45 - -1.14.1 -- fix thread nav - -1.14.0 -- reply keybinds: i, J, K - -1.13.0 -- localize time - -1.12.1 -- actually disable keybinds by default - -1.12.0 -- disable keybinds by default -- qr to replies -- J/K - select next / previous reply -- smarter scrolling - -1.11.1 -- fix reply mode switching (bringing up quick reply now correctly disables -keybinds) - -1.11.0 -- reply keybinds -- repeatable keybinds -- change keybinds: - - o = open thread in new tab - - i = enter insert mode and open quick reply - -1.10.1 -- fix kb thread nav -- hack to focus qr -- absolute positioning for `g` keybind - -1.10.0 -- keyboard actions: - - m to _mark (watch) threads - - t to open threads in _tabs - - o to _open quick reply -- better mode switching -- turn on keyboard actions - -1.9.1 -- add `count` for keynav -- disable keynav when quick replying -- make keynav disabled by default - -1.9.0 -- add keyboard navigation - -1.8.3 -- try to fix remaining bugs by making global variables explicitly global - -1.8.2 -- fix chromium - -1.8.1 -- fix bugs in 1.8.0 - -1.8.0 -- add backspace recaptcha refreshing to reports page - -1.7.4 -- fix thread watching - -1.7.3 -- fixed descriptions - -1.7.2 -- add option descriptions - -1.7.0 -- add auto in qr - -1.6.0 -- add cooldown timer - -1.5.0 -1.4.4 -- mirror options button on bottom of page -- add 4chan sauce -- add 404 redirect -- add post in title -- reload captcha on backspace - -1.4.3 -- clear captcha on submit - -1.4.2 -- fix for firefox 4.0b6 - -1.4.1 -- unhide qr when reply link clicked -- clear textarea on successful qr -- reload captcha AFTER removing qr - -1.4 -- add 'Persistent QR' -- QR autohiding - -1.3 -- auto reload captcha on success - -1.2 -- alert on no captcha - -1.1 -- re-add button to clear hidden posts. - -1.0 -- Complete rewrite (well, like 98%). -- Split off updater - 4chan x Updater - -0.26 -- Fix /b/ quick reply -- Add initial 'Auto Watch' implementation - -0.25 -- fix Opera 10.50 thread updater bug -- require Opera 10.50 -- remove 'Quick Post' (just use noko) -- remove / automate 'manual clear' -- make thread stubs clickable - -0.24 - Worksafe threads show the correct favicon. Thanks for the art, Ongpot! - -0.23 - Show post count for hidden threads - -0.22 - thread navigating now can navigate to previous pages, fixed opera issue - -0.21 - chrome compatibility - -0.20 - added selection quoting, quick post, unread reply count in title. - -0.19 - added quick reply error notifications - -0.17 - added 'Update Favicon' option. Thanks thisisanon! - -0.16 - added new reply notifications. scroll to end of thread to remove them. - -0.15 - added thread updater button - -0.14 - moved reply hiding to 4chan filter - -0.13 - added thread watcher close button, thread watcher toggle button - -0.12 - added Show Hidden (NOTE: not fully compatible w/ 4chan filter yet); thread updater works through connection problems - -0.11 - made hidden replies persistent, added Clear Hidden. - -0.10 - report button added - -0.9 - forced anon added - -0.8 - all watched threads visible all the time - -0.7 - added reply nav buttons - -0.6 - added thread updating - -0.4.1/0.5 - added options, quick reply shading - -0.4 - added quick reply - -0.3 - added thread watching - -0.2 - added post expanding - -0.1 - added post hiding - -0.0 - thread hiding, expanding, navigating diff --git a/package.json b/package.json index 7985850d2..10661d34e 100644 --- a/package.json +++ b/package.json @@ -14,16 +14,20 @@ "*://boards.4chan.org/*", "*://images.4chan.org/*", "*://sys.4chan.org/*" - ] + ], + "files": { + "metajs": "4chan_X.meta.js", + "userjs": "4chan_X.user.js" + } }, "devDependencies": { "grunt": "~0.4.1", "grunt-bump": "~0.0.2", "grunt-concurrent": "~0.2.0", "grunt-contrib-clean": "~0.4.1", - "grunt-contrib-coffee": "~0.6.7", - "grunt-contrib-compress": "~0.4.10", - "grunt-contrib-concat": "~0.2.0", + "grunt-contrib-coffee": "~0.7.0", + "grunt-contrib-compress": "~0.5.0", + "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-watch": "~0.3.1", "grunt-shell": "~0.2.2" diff --git a/src/features/misc/redirection.coffee b/src/Archive/Redirect.coffee similarity index 97% rename from src/features/misc/redirection.coffee rename to src/Archive/Redirect.coffee index c3ecd3b6c..b51e8878a 100644 --- a/src/features/misc/redirection.coffee +++ b/src/Archive/Redirect.coffee @@ -9,7 +9,7 @@ Redirect = image: (boardID, filename) -> # Do not use g.BOARD, the image url can originate from a cross-quote. switch boardID - when 'a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg' + when 'a', 'gd', 'jp', 'm', 'q', 'tg', 'vp', 'vr', 'wsg' "//archive.foolz.us/#{boardID}/full_image/#{filename}" when 'u' "//nsfw.foolz.us/#{boardID}/full_image/#{filename}" @@ -61,7 +61,7 @@ Redirect = archiver: 'Foolz': base: 'https://archive.foolz.us' - boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'] + boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg'] type: 'foolfuuka' 'NSFWFoolz': base: 'https://nsfw.foolz.us' @@ -130,4 +130,4 @@ Redirect = "##{postID}" else "#p#{postID}" - "#{base}/#{path}" \ No newline at end of file + "#{base}/#{path}" diff --git a/src/features/filtering/anonymize.coffee b/src/Filtering/Anonymize.coffee similarity index 100% rename from src/features/filtering/anonymize.coffee rename to src/Filtering/Anonymize.coffee diff --git a/src/features/filtering/filter.coffee b/src/Filtering/Filter.coffee similarity index 100% rename from src/features/filtering/filter.coffee rename to src/Filtering/Filter.coffee diff --git a/src/features/filtering/replyhiding.coffee b/src/Filtering/PostHiding.coffee similarity index 100% rename from src/features/filtering/replyhiding.coffee rename to src/Filtering/PostHiding.coffee diff --git a/src/features/filtering/recursion.coffee b/src/Filtering/Recursive.coffee similarity index 100% rename from src/features/filtering/recursion.coffee rename to src/Filtering/Recursive.coffee diff --git a/src/features/filtering/threadhiding.coffee b/src/Filtering/ThreadHiding.coffee similarity index 100% rename from src/features/filtering/threadhiding.coffee rename to src/Filtering/ThreadHiding.coffee diff --git a/src/lib/build.coffee b/src/General/Build.coffee similarity index 100% rename from src/lib/build.coffee rename to src/General/Build.coffee diff --git a/src/config.coffee b/src/General/Config.coffee similarity index 94% rename from src/config.coffee rename to src/General/Config.coffee index 21f02bff4..2518f75b9 100644 --- a/src/config.coffee +++ b/src/General/Config.coffee @@ -9,10 +9,6 @@ Config = false 'Link to external catalog instead of the internal one.' ] - 'Custom Board Navigation': [ - false - 'Show custom links instead of the full board list.' - ] 'QR Shortcut': [ false, 'Adds a small [QR] link in the header.' @@ -61,6 +57,22 @@ Config = true 'Check for updated versions of <%= meta.name %>.' ] + 'Emoji': [ + false + 'Adds icons next to names for different emails' + ] + 'Color User IDs': [ + false + 'Assign unique colors to user IDs on boards that use them' + ] + 'Remove Spoilers': [ + false + 'Remove all spoilers in text.' + ] + 'Indicate Spoilers': [ + false + 'Indicate spoilers if Remove Spoilers is enabled.' + ] 'Linkification': 'Linkify': [ @@ -183,7 +195,7 @@ Config = ] 'Hide Unread Count at (0)': [ false - 'Hide the unread posts count when it reaches 0.' + 'Hide the unread posts count in the tab title when it reaches 0.' ] 'Unread Favicon': [ true @@ -259,7 +271,11 @@ Config = ] 'Cooldown': [ true - 'Prevent "flood detected" errors.' + 'Indicate the remaining time before posting again.' + ] + 'Cooldown Prediction': [ + true + 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.' ] 'Quote Links': @@ -295,6 +311,10 @@ Config = true 'Add \'(You)\' to quotes linking to your posts.' ] + 'Highlight Own Posts': [ + false + 'Highlights own posts if Mark Quotes of You is enabled.' + ] 'Mark OP Quotes': [ true 'Add \'(OP)\' to OP quotes.' @@ -410,11 +430,6 @@ Config = true 'Adds an icon you can hover over to show the watcher, as opposed to having the watcher always visible.' ] - 'Updater Position': [ - 'top' - 'The position of 4chan thread updater and stats' - ['top', 'bottom', 'moveable'] - ] Posts: 'Alternate Post Colors': [ @@ -734,14 +749,20 @@ http://iqdb.org/?url=%TURL #//archive.foolz.us/%board/search/image/%MD5/;text:View same on foolz /%board/ #//archive.installgentoo.net/%board/image/%MD5;text:View same on installgentoo /%board/ """ - + 'sageEmoji': 'appchan' + + 'emojiPos': 'before' + 'Custom CSS': false - 'Boards Navigation': 'Sticky top' - - 'Header auto-hide': false - - 'Header catalog links': false + Header: + 'Fixed Header': true + 'Header auto-hide': false + 'Bottom Header': false + 'Hide Header': false + 'Header catalog links': false + 'Bottom Board List': true + 'Custom Board Navigation': true boardnav: '[ toggle-all ] [current-title]' @@ -784,12 +805,16 @@ box-shadow: inset 2px 2px 2px rgba(0,0,0,0.2); 'Ctrl+b' 'Toggle the full board list.' ] + 'Toggle header': [ + 'Shift+h' + 'Toggle the auto-hide option of the header.' + ] 'Open empty QR': [ - 'l' + 'i' 'Open QR without post number inserted.' ] 'Open QR': [ - 'Shift+l' + 'Shift+i' 'Open QR with post number inserted.' ] 'Open settings': [ @@ -816,8 +841,12 @@ box-shadow: inset 2px 2px 2px rgba(0,0,0,0.2); 'Alt+m' 'Insert math tags.' ] - 'Submit QR': [ + 'Toggle sage': [ 'Alt+s' + 'Toggle sage in email field' + ] + 'Submit QR': [ + 'Ctrl+Enter' 'Submit post.' ] # Thread related @@ -859,6 +888,10 @@ box-shadow: inset 2px 2px 2px rgba(0,0,0,0.2); 'Left' 'Jump to the previous page.' ] + 'Open catalog': [ + 'Shift+c' + 'Open the catalog of the current board' + ] # Thread Navigation 'Next thread': [ 'Down' diff --git a/src/lib/get.coffee b/src/General/Get.coffee similarity index 100% rename from src/lib/get.coffee rename to src/General/Get.coffee diff --git a/src/globals.coffee b/src/General/Globals.coffee similarity index 99% rename from src/globals.coffee rename to src/General/Globals.coffee index b68fb2c2e..b9b3c0e48 100644 --- a/src/globals.coffee +++ b/src/General/Globals.coffee @@ -2810,5 +2810,5 @@ textarea, }""" Icons = - oneechan: '<%= grunt.file.read("src/img/icons/oneechan.png", {encoding: "base64"}) %>' - "4chan SS": '<%= grunt.file.read("src/img/icons/4chanSS.png", {encoding: "base64"}) %>' + oneechan: '<%= grunt.file.read("src/General/img/icons/oneechan.png", {encoding: "base64"}) %>' + "4chan SS": '<%= grunt.file.read("src/General/img/icons/4chanSS.png", {encoding: "base64"}) %>' diff --git a/src/General/Header.coffee b/src/General/Header.coffee new file mode 100644 index 000000000..9caad551b --- /dev/null +++ b/src/General/Header.coffee @@ -0,0 +1,267 @@ +Header = + init: -> + @menu = new UI.Menu 'header' + @menuButton = $.el 'span', + className: 'menu-button' + id: 'main-menu' + + barFixedToggler = $.el 'label', + innerHTML: ' Fixed Header' + headerToggler = $.el 'label', + innerHTML: ' Auto-hide header' + barPositionToggler = $.el 'label', + innerHTML: ' Bottom header' + customNavToggler = $.el 'label', + innerHTML: ' Custom board navigation' + footerToggler = $.el 'label', + innerHTML: " Hide bottom board list" + editCustomNav = $.el 'a', + textContent: 'Edit custom board navigation' + href: 'javascript:;' + + @barFixedToggler = barFixedToggler.firstElementChild + @barPositionToggler = barPositionToggler.firstElementChild + @headerToggler = headerToggler.firstElementChild + @footerToggler = footerToggler.firstElementChild + @customNavToggler = customNavToggler.firstElementChild + + $.on @menuButton, 'click', @menuToggle + $.on @barFixedToggler, 'change', @toggleBarFixed + $.on @barPositionToggler, 'change', @toggleBarPosition + $.on @headerToggler, 'change', @toggleBarVisibility + $.on @footerToggler, 'change', @toggleFooterVisibility + $.on @customNavToggler, 'change', @toggleCustomNav + $.on editCustomNav, 'click', @editCustomNav + + @setBarFixed Conf['Fixed Header'] + @setBarVisibility Conf['Header auto-hide'] + + $.sync 'Fixed Header', Header.setBarFixed + $.sync 'Bottom Header', Header.setBarPosition + $.sync 'Header auto-hide', Header.setBarVisibility + + $.event 'AddMenuEntry', + type: 'header' + el: $.el 'span', + textContent: 'Header' + order: 107 + subEntries: [ + {el: barFixedToggler} + {el: headerToggler} + {el: barPositionToggler} + {el: footerToggler} + {el: customNavToggler} + {el: editCustomNav} + ] + + $.on window, 'load hashchange', Header.hashScroll + $.on d, 'CreateNotification', @createNotification + + $.asap (-> d.body), => + return unless Main.isThisPageLegit() + # Wait for #boardNavMobile instead of #boardNavDesktop, + # it might be incomplete otherwise. + $.asap (-> $.id('boardNavMobile') or d.readyState is 'complete'), Header.setBoardList + $.prepend d.body, @bar + $.add d.body, Header.hover + @setBarPosition Conf['Bottom Header'] + + $.ready => + cs = $.id('settingsWindowLink') + cs.textContent = 'Catalog Settings' + @addShortcut cs if g.VIEW is 'catalog' + + bar: $.el 'div', + id: 'header-bar' + + notify: $.el 'div', + id: 'notifications' + + shortcuts: $.el 'span', + id: 'shortcuts' + + hover: $.el 'div', + id: 'hoverUI' + + toggle: $.el 'div', + id: 'scroll-marker' + + setBoardList: -> + fourchannav = $.id 'boardNavDesktop' + if a = $ "a[href*='/#{g.BOARD}/']", fourchannav + a.className = 'current' + + boardList = $.el 'span', + id: 'board-list' + innerHTML: "" + fullBoardList = $ '#full-board-list', boardList + btn = $ '.hide-board-list-button', fullBoardList + $.on btn, 'click', Header.toggleBoardList + + $.rm $ '#navtopright', fullBoardList + + settings = $.id('navtopright') + $.prepend d.body, settings + $.add settings, Header.menuButton + + $.add boardList, fullBoardList + $.add Header.bar, [boardList, Header.shortcuts, Header.notify, Header.toggle] + + Header.setCustomNav Conf['Custom Board Navigation'] + Header.generateBoardList Conf['boardnav'] + + $.sync 'Custom Board Navigation', Header.setCustomNav + $.sync 'boardnav', Header.generateBoardList + + generateBoardList: (text) -> + list = $ '#custom-board-list', Header.bar + $.rmAll list + return unless text + as = $$('#full-board-list a', Header.bar) + nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map (t) -> + if /^[^\w@]/.test t + return $.tn t + if /^toggle-all/.test t + a = $.el 'a', + className: 'show-board-list-button' + textContent: (t.match(/-text:"(.+)"/) || [null, '+'])[1] + href: 'javascript:;' + $.on a, 'click', Header.toggleBoardList + return a + board = if /^current/.test t + g.BOARD.ID + else + t.match(/^[^-]+/)[0] + for a in as + if a.textContent is board + a = a.cloneNode true + if /-title/.test t + a.textContent = a.title + else if /-replace/.test t + if $.hasClass a, 'current' + a.textContent = a.title + else if /-full/.test t + a.textContent = "/#{board}/ - #{a.title}" + else if /-(index|catalog|text)/.test t + if m = t.match /-(index|catalog)/ + a.setAttribute 'data-only', m[1] + a.href = "//boards.4chan.org/#{board}/" + a.href += 'catalog' if m[1] is 'catalog' + if m = t.match /-text:"(.+)"/ + a.textContent = m[1] + else if board is '@' + $.addClass a, 'navSmall' + return a + $.tn t + $.add list, nodes + + toggleBoardList: -> + {bar} = Header + custom = $ '#custom-board-list', bar + full = $ '#full-board-list', bar + showBoardList = !full.hidden + custom.hidden = !showBoardList + full.hidden = showBoardList + + setBarPosition: (bottom) -> + Header.barPositionToggler.checked = bottom + if bottom + $.rmClass doc, 'top' + $.addClass doc, 'bottom' + $.after Header.bar, Header.notify + else + $.rmClass doc, 'bottom' + $.addClass doc, 'top' + $.add Header.bar, Header.notify + Style.padding() + + toggleBarPosition: -> + $.event 'CloseMenu' + + Header.setBarPosition @checked + + Conf['Bottom Header'] = @checked + $.set 'Bottom Header', @checked + + setBarFixed: (fixed) -> + Header.barFixedToggler.checked = fixed + if fixed + $.addClass doc, 'fixed' + $.addClass Header.bar, 'dialog' + else + $.rmClass doc, 'fixed' + $.rmClass Header.bar, 'dialog' + + toggleBarFixed: -> + $.event 'CloseMenu' + + Header.setBarFixed @checked + + Conf['Fixed Header'] = @checked + $.set 'Fixed Header', @checked + + setBarVisibility: (hide) -> + Header.headerToggler.checked = hide + $.event 'CloseMenu' + (if hide then $.addClass else $.rmClass) Header.bar, 'autohide' + (if hide then $.addClass else $.rmClass) doc, 'autohide' + + toggleBarVisibility: (e) -> + return if e.type is 'mousedown' and e.button isnt 0 # not LMB + hide = if @nodeName is 'INPUT' + @checked + else + !$.hasClass Header.bar, 'autohide' + Conf['Header auto-hide'] = hide + $.set 'Header auto-hide', hide + Header.setBarVisibility hide + message = if hide + 'The header bar will automatically hide itself.' + else + 'The header bar will remain visible.' + new Notification 'info', message, 2 + + setCustomNav: (show) -> + Header.customNavToggler.checked = show + cust = $ '#custom-board-list', Header.bar + full = $ '#full-board-list', Header.bar + btn = $ '.hide-board-list-button', full + [cust.hidden, full.hidden] = if show + [false, true] + else + [true, false] + + toggleCustomNav: -> + $.cb.checked.call @ + Header.setCustomNav @checked + + editCustomNav: -> + Settings.open 'Advanced' + settings = $.id 'fourchanx-settings' + $('input[name=boardnav]', settings).focus() + + hashScroll: -> + return unless (hash = @location.hash) and post = $.id hash[1..] + return if (Get.postFromRoot post).isHidden + Header.scrollToPost post + + scrollToPost: (post) -> + {top} = post.getBoundingClientRect() + if Conf['Fixed Header'] and not Conf['Bottom Header'] + headRect = Header.bar.getBoundingClientRect() + top += - headRect.top - headRect.height + (if $.engine is 'webkit' then d.body else doc).scrollTop += top + + addShortcut: (el) -> + shortcut = $.el 'span', + className: 'shortcut' + $.add shortcut, [$.tn(' ['), el, $.tn(']')] + $.prepend Header.shortcuts, shortcut + + menuToggle: (e) -> + Header.menu.toggle e, @, g + + createNotification: (e) -> + {type, content, lifetime, cb} = e.detail + notif = new Notification type, content, lifetime + cb notif if cb diff --git a/src/main.coffee b/src/General/Main.coffee similarity index 89% rename from src/main.coffee rename to src/General/Main.coffee index ab21d015d..e9a008329 100644 --- a/src/main.coffee +++ b/src/General/Main.coffee @@ -75,7 +75,7 @@ Main = for name, module of features # c.time "#{name} initialization" try - do module.init + module.init() catch err Main.handleErrors message: "\"#{name}\" initialization crashed." @@ -99,6 +99,9 @@ Main = 'Settings': Settings 'Announcement Hiding': PSAHiding 'Fourchan thingies': Fourchan + 'Emoji': Emoji + 'Color User IDs': IDColor + 'Remove Spoilers': RemoveSpoilers 'Custom CSS': CustomCSS 'Linkify': Linkify 'Resurrect Quotes': Quotify @@ -183,7 +186,11 @@ Main = Main.handleErrors errors if errors Main.callbackNodes Thread, threads - Main.callbackNodes Post, posts + Main.callbackNodesDB Post, posts, -> + $.event '4chanXInitFinished' + Main.checkUpdate() + + return $.event '4chanXInitFinished' Main.checkUpdate() @@ -206,6 +213,45 @@ Main = # c.profileEnd callback.name Main.handleErrors errors if errors + callbackNodesDB: (klass, nodes, cb) -> + queue = [] + softTask = -> + task = queue.shift() + func = task[0] + args = Array::slice.call task, 1 + func.apply func, args + return unless queue.length + if (queue.length % 7) is 0 + setTimeout softTask, 0 + else + softTask() + + # get the nodes' length only once + len = nodes.length + i = 0 + errors = null + + func = (node, i) -> + for callback in klass::callbacks + try + callback.cb.call node + catch err + unless errors + errors = [] + errors.push + message: "\"#{callback.name}\" crashed on #{klass.name} No.#{node} (/#{node.board}/)." + error: err + # finish + if i is len + Main.handleErrors errors if errors + cb() if cb + + while i < len + node = nodes[i] + queue.push [func, node, ++i] + + softTask() + addCallback: (e) -> obj = e.detail unless typeof obj.callback.name is 'string' diff --git a/src/settings.coffee b/src/General/Settings.coffee similarity index 78% rename from src/settings.coffee rename to src/General/Settings.coffee index b63c4eb63..903a5d77b 100644 --- a/src/settings.coffee +++ b/src/General/Settings.coffee @@ -40,7 +40,7 @@ Settings = Settings.addSection 'Script', Settings.main Settings.addSection 'Filter', Settings.filter Settings.addSection 'Sauce', Settings.sauce - Settings.addSection 'Rice', Settings.rice + Settings.addSection 'Advanced', Settings.advanced Settings.addSection 'Keybinds', Settings.keybinds $.on d, 'AddSettingsSection', Settings.addSection @@ -68,22 +68,7 @@ Settings = Settings.dialog = dialog = $.el 'div', id: 'appchanx-settings' class: 'dialog' - innerHTML: """ - -
-
""" + innerHTML: """<%= grunt.file.read('src/General/html/Settings/Settings.html').replace(/>\s+<').trim() %>""" Settings.overlay = overlay = $.el 'div', id: 'overlay' @@ -306,6 +291,12 @@ Settings = data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, (s) -> "#{s[0].toUpperCase()}#{s[1..]}").replace /(^|.+\+)[A-Z]$/g, (s) -> "Shift+#{s[0...-1]}#{s[-1..].toLowerCase()}" data.Conf.WatchedThreads = data.WatchedThreads + else if version[0] is '3' + data = Settings.convertSettings data, + 'Reply Hiding': 'Reply Hiding Buttons' + 'Thread Hiding': 'Thread Hiding Buttons' + 'Bottom header': 'Bottom Header' + 'Unread Tab Icon': 'Unread Favicon' $.set data.Conf convertSettings: (data, map) -> @@ -316,22 +307,7 @@ Settings = filter: (section) -> section.innerHTML = """ - -
+ <%= grunt.file.read('src/General/html/Settings/Filter-select.html').replace(/>\s+<').trim() %> """ select = $ 'select', section $.on select, 'change', Settings.selectFilter @@ -351,135 +327,27 @@ Settings = $.add div, ta return div.innerHTML = """ -
Filter is disabled.
-

- Use regular expressions, one per line.
- Lines starting with a # will be ignored.
- For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
- MD5 filtering uses exact string matching, not regular expressions. -

-
    You can use these settings with each regular expression, separate them with semicolons: -
  • - Per boards, separate them with commas. It is global if not specified.
    - For example: boards:a,jp;. -
  • -
  • - Filter OPs only along with their threads (`only`), replies only (`no`), or both (`yes`, this is default).
    - For example: op:only;, op:no; or op:yes;. -
  • -
  • - Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
    - For example: stub:yes; or stub:no;. -
  • -
  • - Highlight instead of hiding. You can specify a class name to use with a userstyle.
    - For example: highlight; or highlight:wallpaper;. -
  • -
  • - Highlighted OPs will have their threads put on top of board pages by default.
    - For example: top:yes; or top:no;. -
  • -
+ <%= grunt.file.read('src/General/html/Settings/Filter-guide.html').replace(/>\s+<').trim() %> """ sauce: (section) -> section.innerHTML = """ -
Sauce is disabled.
-
Lines starting with a # will be ignored.
-
You can specify a display text by appending ;text:[text] to the URL.
-
    These parameters will be replaced by their corresponding values: -
  • %TURL: Thumbnail URL.
  • -
  • %URL: Full image URL.
  • -
  • %MD5: MD5 hash.
  • -
  • %board: Current board.
  • -
- + <%= grunt.file.read('src/General/html/Settings/Sauce.html').replace(/>\s+<').trim() %> """ sauce = $ 'textarea', section $.get 'sauces', Conf['sauces'], (item) -> sauce.value = item['sauces'] $.on sauce, 'change', $.cb.value - rice: (section) -> - section.innerHTML = """ -
- Archiver - Select an Archiver for this board: - -
-
- Custom Board Navigation is disabled. -
-
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
-
- For example:
- [ 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/. -
-
Board link: board
-
Title link: board-title
-
Board link (Replace with title when on that board): board-replace
-
Full text link: board-full
-
Custom text link: board-text:"VIP Board"
-
Index-only link: board-index
-
Catalog-only link: board-catalog
-
Combinations are possible: board-index-text:"VIP Index"
-
Full board list toggle: toggle-all
-
- -
- Time Formatting is disabled. -
:
- -
Day: %a, %A, %d, %e
-
Month: %m, %b, %B
-
Year: %y
-
Hour: %k, %H, %l, %I, %p, %P
-
Minute: %M
-
Second: %S
-
- -
- Quote Backlinks formatting is disabled. -
:
-
- -
- File Info Formatting is disabled. -
:
-
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
-
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
-
Spoiler indicator: %p
-
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
-
Resolution: %r (Displays 'PDF' for PDF files)
-
- -
- Unread Favicon is disabled. - - -
- -
- Custom CSS - - -
- """ + advanced: (section) -> + section.innerHTML = """<%= grunt.file.read('src/General/html/Settings/Advanced.html').replace(/>\s+<').trim() %>""" items = {} inputs = {} - for name in ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss'] + for name in ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'emojiPos', 'sageEmoji', 'usercss'] input = $ "[name='#{name}']", section items[name] = Conf[name] inputs[name] = input - event = if ['favicon', 'usercss'].contains name + event = if ['favicon', 'usercss', 'sageEmoji', 'emojiPos'].contains name 'change' else 'input' @@ -501,13 +369,14 @@ Settings = $.get items, (items) -> for key, val of items + continue if ['usercss', 'emojiPos', 'archiver'].contains key input = inputs[key] input.value = val - unless 'usercss' is name - $.on input, event, Settings[key] - Settings[key].call input - return - Rice.nodes section + $.on input, event, Settings[key] + Settings[key].call input + Rice.nodes sectionreturn + + $.on $('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval $.on $('input[name="Custom CSS"]', section), 'change', Settings.togglecss $.on $.id('apply-css'), 'click', Settings.usercss @@ -519,7 +388,7 @@ Settings = @nextElementSibling.textContent = funk Time, new Date() backlink: -> - @nextElementSibling.textContent = Conf['backlink'].replace /%id/, '123456789' + @nextElementSibling.textContent = @value.replace /%id/, '123456789' fileInfo: -> data = @@ -538,13 +407,18 @@ Settings = favicon: -> Favicon.switch() Unread.update() if g.VIEW is 'thread' and Conf['Unread Favicon'] - @nextElementSibling.innerHTML = """ + $.id('favicon-preview').innerHTML = """ """ + sageEmoji: -> + $.id('sageicon-preview').innerHTML = """ + + """ + togglecss: -> if $('textarea', @parentNode.parentNode).disabled = !@checked CustomCSS.rmStyle() @@ -557,12 +431,7 @@ Settings = keybinds: (section) -> section.innerHTML = """ -
Keybinds are disabled.
-
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
-
Press Backspace to disable a keybind.
- - -
ActionsKeybinds
+ <%= grunt.file.read('src/General/html/Settings/Keybinds.html').replace(/>\s+<').trim() %> """ tbody = $ 'tbody', section items = {} @@ -1116,4 +985,4 @@ Settings = userThemes = item["userThemes"] userThemes[@id] = Themes[@id] $.set 'userThemes', userThemes - $.rm @ + $.rm @ \ No newline at end of file diff --git a/src/lib/ui.coffee b/src/General/UI.coffee similarity index 96% rename from src/lib/ui.coffee rename to src/General/UI.coffee index ed887e69f..17f005e0b 100644 --- a/src/lib/ui.coffee +++ b/src/General/UI.coffee @@ -54,7 +54,7 @@ UI = do -> menu = @makeMenu() currentMenu = menu lastToggledButton = button - + @entries.sort (first, second) -> first.order - second.order @@ -226,6 +226,14 @@ UI = do -> screenWidth: screenWidth isTouching: isTouching } + + [o.topBorder, o.bottomBorder] = if Conf['Header auto-hide'] + [0, 0] + else if Conf['Bottom Header'] + [0, Header.bar.getBoundingClientRect().height] + else + [Header.bar.getBoundingClientRect().height, 0] + if isTouching o.identifier = e.identifier o.move = touchmove.bind o @@ -256,9 +264,9 @@ UI = do -> left / @screenWidth * 100 + '%' top = clientY - @dy - top = if top < 10 - 0 - else if @height - top < 10 + top = if top < (10 + @topBorder) + @topBorder + 'px' + else if @height - top < (10 + @bottomBorder) null else top / @screenHeight * 100 + '%' @@ -267,8 +275,9 @@ UI = do -> 0 else null + bottom = if top is null - 0 + @bottomBorder + 'px' else null diff --git a/src/audio/beep.wav b/src/General/audio/beep.wav similarity index 100% rename from src/audio/beep.wav rename to src/General/audio/beep.wav diff --git a/src/css/icons.base.css b/src/General/css/icons.base.css similarity index 100% rename from src/css/icons.base.css rename to src/General/css/icons.base.css diff --git a/src/css/icons.horz.css b/src/General/css/icons.horz.css similarity index 89% rename from src/css/icons.horz.css rename to src/General/css/icons.horz.css index 76486a09c..9c3852d13 100644 --- a/src/css/icons.horz.css +++ b/src/General/css/icons.horz.css @@ -78,7 +78,7 @@ body > a[style="cursor: pointer; float: right;"]::after { #boardNavDesktopFoot { top: 16px !important; } -#{if _conf['Boards Navigation'] is 'Top' or _conf['Boards Navigation'] is 'Sticky top' then '#header-bar' else if _conf['Pagination'] is 'top' or _conf['Pagination'] is 'sticky top' then '.pagelist'} { +.fixed.top #header-bar#{if _conf['Pagination'] is 'top' or _conf['Pagination'] is 'sticky top' then ',\n.pagelist' else ''} { #{if _conf['4chan SS Navigation'] "padding-#{align}: #{iconOffset}px;" else diff --git a/src/css/icons.vert.css b/src/General/css/icons.vert.css similarity index 90% rename from src/css/icons.vert.css rename to src/General/css/icons.vert.css index 9acbb747a..72f4099d6 100644 --- a/src/css/icons.vert.css +++ b/src/General/css/icons.vert.css @@ -78,7 +78,7 @@ div.navLinks > a:first-of-type::after { width: #{233 + Style.sidebarOffset.W}px !important; #{align}: 18px !important; } -#{if _conf['Boards Navigation'] is 'Top' or _conf['Boards Navigation'] is 'Sticky top' then '#header-bar' else if _conf['Pagination'] is 'top' or _conf['Pagination'] is 'sticky top' then '.pagelist'} { +.fixed.top #header-bar#{if _conf['Pagination'] is 'top' or _conf['Pagination'] is 'sticky top' then ',\n.pagelist' else ''} { #{if _conf['4chan SS Navigation'] "padding-#{align}: #{iconOffset}px;" else diff --git a/src/css/jscolor.css b/src/General/css/jscolor.css similarity index 100% rename from src/css/jscolor.css rename to src/General/css/jscolor.css diff --git a/src/css/layout.css b/src/General/css/layout.css similarity index 98% rename from src/css/layout.css rename to src/General/css/layout.css index 93c207252..b8e055608 100644 --- a/src/css/layout.css +++ b/src/General/css/layout.css @@ -1,5 +1,6 @@ /* Cleanup */ #absbot, +#boardNavDesktop, #delPassword, #delform > hr:last-of-type, #navbotright, @@ -168,6 +169,9 @@ else " " else ""} text-align: #{_conf["Navigation Alignment"]}; } +.fixed #header-bar.autohide { + z-index: 24; +} .fixed #header-bar { position: fixed; } @@ -500,31 +504,6 @@ else " outline: none; z-index: 22; } -/* Updater */ -#updater { - position: fixed; - z-index: 10; - padding: 0 1px 1px; - #{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""} -} -#updater:hover { - z-index: 30; -} -#updater:not(:hover) > div:not(.move) { - display: none; -} -#updater input { - text-align: right; -} -#updater .field { - width: 50px; -} -/* Stats */ -#thread-stats { - position: fixed; - #{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""} - z-index: 10; -} /* Image Expansion */ .fit-width .full-image { max-width: 100%; @@ -1297,6 +1276,9 @@ input:not([type=radio]) { vertical-align: bottom; padding: 0 1px; } +.selectrice { + padding-right: 1.6em; +} #qr textarea { min-width: 100%; } @@ -1521,6 +1503,14 @@ a:only-of-type > .remove { #{if _conf["Single Column Mode"] then "margin: 0 auto 6px;" else "margin: 0 3px 6px;\n display: inline-block;"} border: 0; } +#appchanx-settings .section-advanced fieldset { + display: block; + margin: 0 auto 6px; +} +.section-advanced .selectrice { + display: inline-block; + clear: both; +} .section-container { overflow: auto; position: absolute; @@ -1554,13 +1544,13 @@ a:only-of-type > .remove { } .section-script fieldset > div, .section-style fieldset > div, -.section-rice fieldset > div { +.section-advanced fieldset > div { overflow: visible; padding: 0 5px 0 7px; } #appchanx-settings tr:nth-of-type(2n+1), .section-script fieldset > div:nth-of-type(2n+1), -.section-rice fieldset > div:nth-of-type(2n+1), +.section-advanced fieldset > div:nth-of-type(2n+1), .section-style fieldset > div:nth-of-type(2n+1), .section-keybinds tr:nth-of-type(2n+1), #selectrice li:nth-of-type(2n+1) { @@ -1820,10 +1810,6 @@ opacity: 0; #info .btn-wrap { display: inline-block; } -#settings .selectrice { - width: 100px; - display: inline-block; -} #post-preview { position: absolute; z-index: 22; diff --git a/src/css/prettyprint.css b/src/General/css/prettyprint.css similarity index 100% rename from src/css/prettyprint.css rename to src/General/css/prettyprint.css diff --git a/src/css/theme.4chanss.css b/src/General/css/theme.4chanss.css similarity index 100% rename from src/css/theme.4chanss.css rename to src/General/css/theme.4chanss.css diff --git a/src/css/theme.css b/src/General/css/theme.css similarity index 99% rename from src/css/theme.css rename to src/General/css/theme.css index 519192482..feed535d3 100644 --- a/src/css/theme.css +++ b/src/General/css/theme.css @@ -103,7 +103,6 @@ s:not(:hover) { #appchanx-settings, #qrtab, #{if _conf["Post Form Decorations"] then "#qr," else ""} -#updater, input[type="submit"], input[value="Report"], span[style="left: 5px; position: absolute;"] a { @@ -227,9 +226,8 @@ a[style="cursor: pointer; float: right;"] ~ div[style^="width: 100%;"] > table { color: #{theme["Timestamps"]} !important; } #fs_status a, -#updater #count:not(.new)::after, +#updater #update-status:not(.new)::after, #showQR, -#updater, .abbr, .boxbar, .boxcontent, @@ -280,7 +278,6 @@ textarea { .selectrice::after { border-top: .45em solid #{theme["Inputs"]}; } -#updater input, .bd { background: #{theme["Buttons Background"]}; border: 1px solid #{theme["Buttons Border"]}; diff --git a/src/css/theme.oneechan.css b/src/General/css/theme.oneechan.css similarity index 100% rename from src/css/theme.oneechan.css rename to src/General/css/theme.oneechan.css diff --git a/src/css/themeoptions.css b/src/General/css/themeoptions.css similarity index 96% rename from src/css/themeoptions.css rename to src/General/css/themeoptions.css index 11dfefe40..efcc945ee 100644 --- a/src/css/themeoptions.css +++ b/src/General/css/themeoptions.css @@ -116,7 +116,7 @@ a.useremail[href*="SAGE"]:last-of-type::#{_conf["Sage Highlight Position"]} { a.useremail[href*="sage"]:last-of-type::#{_conf["Sage Highlight Position"]}, a.useremail[href*="Sage"]:last-of-type::#{_conf["Sage Highlight Position"]}, a.useremail[href*="SAGE"]:last-of-type::#{_conf["Sage Highlight Position"]} { - content: url("data:image/png;base64,<%= grunt.file.read("src/img/emoji/sage.png", {encoding: "base64"}) %>"); + content: url("data:image/png;base64,<%= grunt.file.read("src/General/img/emoji/sage.png", {encoding: "base64"}) %>"); vertical-align: top; margin-#{if _conf["Sage Highlight Position"] is "before" then "right" else "left"}: #{parseInt _conf['Emoji Spacing']}px; }\n diff --git a/src/General/html/Features/QuickReply.html b/src/General/html/Features/QuickReply.html new file mode 100644 index 000000000..76467565f --- /dev/null +++ b/src/General/html/Features/QuickReply.html @@ -0,0 +1,37 @@ +
+ Post Form + × +
+
+
+ + + + +
+
+ + +
+
+
+ + +
+
+ + No selected file + + × + + +
+ +
+ +
+ +
diff --git a/src/General/html/Settings/Advanced.html b/src/General/html/Settings/Advanced.html new file mode 100644 index 000000000..c256ad7af --- /dev/null +++ b/src/General/html/Settings/Advanced.html @@ -0,0 +1,101 @@ +
+ Archiver +
+ Select an Archiver for this board: + +
+
+
+ Custom Board Navigation is disabled. +
+
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
+
+ For example:
+ [ 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/. +
+
Board link: board
+
Title link: board-title
+
Board link (Replace with title when on that board): board-replace
+
Full text link: board-full
+
Custom text link: board-text:"VIP Board"
+
Index-only link: board-index
+
Catalog-only link: board-catalog
+
Combinations are possible: board-index-text:"VIP Index"
+
Full board list toggle: toggle-all
+
+ +
+ Time Formatting is disabled. +
:
+ +
Day: %a, %A, %d, %e
+
Month: %m, %b, %B
+
Year: %y
+
Hour: %k, %H, %l, %I, %p, %P
+
Minute: %M
+
Second: %S
+
+ +
+ Quote Backlinks formatting is disabled. +
:
+
+ +
+ File Info Formatting is disabled. +
:
+
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
+
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
+
Spoiler indicator: %p
+
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
+
Resolution: %r (Displays 'PDF' for PDF files)
+
+ +
+ Unread Favicon is disabled. +
+ + +
+
+ +
+ Emoji is disabled. +
+ Sage Icon: + +
+
+ Position: +
+
+ +
+ Thread Updater is disabled. +
+ Interval: +
+
+ +
+ Custom CSS +
+ + +
+
\ No newline at end of file diff --git a/src/General/html/Settings/Filter-guide.html b/src/General/html/Settings/Filter-guide.html new file mode 100644 index 000000000..3e50d37e3 --- /dev/null +++ b/src/General/html/Settings/Filter-guide.html @@ -0,0 +1,29 @@ +
Filter is disabled.
+

+ Use regular expressions, one per line.
+ Lines starting with a # will be ignored.
+ For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
+ MD5 filtering uses exact string matching, not regular expressions. +

+
    You can use these settings with each regular expression, separate them with semicolons: +
  • + Per boards, separate them with commas. It is global if not specified.
    + For example: boards:a,jp;. +
  • +
  • + Filter OPs only along with their threads (`only`), replies only (`no`), or both (`yes`, this is default).
    + For example: op:only;, op:no; or op:yes;. +
  • +
  • + Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
    + For example: stub:yes; or stub:no;. +
  • +
  • + Highlight instead of hiding. You can specify a class name to use with a userstyle.
    + For example: highlight; or highlight:wallpaper;. +
  • +
  • + Highlighted OPs will have their threads put on top of board pages by default.
    + For example: top:yes; or top:no;. +
  • +
\ No newline at end of file diff --git a/src/General/html/Settings/Filter-select.html b/src/General/html/Settings/Filter-select.html new file mode 100644 index 000000000..b65eb3d05 --- /dev/null +++ b/src/General/html/Settings/Filter-select.html @@ -0,0 +1,16 @@ + +
\ No newline at end of file diff --git a/src/General/html/Settings/Keybinds.html b/src/General/html/Settings/Keybinds.html new file mode 100644 index 000000000..e8c29434c --- /dev/null +++ b/src/General/html/Settings/Keybinds.html @@ -0,0 +1,6 @@ +
Keybinds are disabled.
+
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
+
Press Backspace to disable a keybind.
+ + +
ActionsKeybinds
\ No newline at end of file diff --git a/src/General/html/Settings/Sauce.html b/src/General/html/Settings/Sauce.html new file mode 100644 index 000000000..d4e9df83c --- /dev/null +++ b/src/General/html/Settings/Sauce.html @@ -0,0 +1,10 @@ +
Sauce is disabled.
+
Lines starting with a # will be ignored.
+
You can specify a display text by appending ;text:[text] to the URL.
+
    These parameters will be replaced by their corresponding values: +
  • %TURL: Thumbnail URL.
  • +
  • %URL: Full image URL.
  • +
  • %MD5: MD5 hash.
  • +
  • %board: Current board.
  • +
+ \ No newline at end of file diff --git a/src/General/html/Settings/Settings.html b/src/General/html/Settings/Settings.html new file mode 100644 index 000000000..0724f26c3 --- /dev/null +++ b/src/General/html/Settings/Settings.html @@ -0,0 +1,15 @@ + +
+
\ No newline at end of file diff --git a/src/General/img/emoji/SS-sage.png b/src/General/img/emoji/SS-sage.png new file mode 100644 index 000000000..942c87624 Binary files /dev/null and b/src/General/img/emoji/SS-sage.png differ diff --git a/src/img/emoji/sage.png b/src/General/img/emoji/appchan-sage.png similarity index 100% rename from src/img/emoji/sage.png rename to src/General/img/emoji/appchan-sage.png diff --git a/src/img/emoji/applejack.png b/src/General/img/emoji/applejack.png similarity index 100% rename from src/img/emoji/applejack.png rename to src/General/img/emoji/applejack.png diff --git a/src/img/emoji/arch.png b/src/General/img/emoji/arch.png similarity index 100% rename from src/img/emoji/arch.png rename to src/General/img/emoji/arch.png diff --git a/src/img/emoji/baka.png b/src/General/img/emoji/baka.png similarity index 100% rename from src/img/emoji/baka.png rename to src/General/img/emoji/baka.png diff --git a/src/img/emoji/centos.png b/src/General/img/emoji/centos.png similarity index 100% rename from src/img/emoji/centos.png rename to src/General/img/emoji/centos.png diff --git a/src/General/img/emoji/crunchbang.png b/src/General/img/emoji/crunchbang.png new file mode 100644 index 000000000..2d44f9a59 Binary files /dev/null and b/src/General/img/emoji/crunchbang.png differ diff --git a/src/img/emoji/debian.png b/src/General/img/emoji/debian.png similarity index 100% rename from src/img/emoji/debian.png rename to src/General/img/emoji/debian.png diff --git a/src/img/emoji/fedora.png b/src/General/img/emoji/fedora.png similarity index 100% rename from src/img/emoji/fedora.png rename to src/General/img/emoji/fedora.png diff --git a/src/img/emoji/fluttershy.png b/src/General/img/emoji/fluttershy.png similarity index 100% rename from src/img/emoji/fluttershy.png rename to src/General/img/emoji/fluttershy.png diff --git a/src/img/emoji/freebsd.png b/src/General/img/emoji/freebsd.png similarity index 100% rename from src/img/emoji/freebsd.png rename to src/General/img/emoji/freebsd.png diff --git a/src/img/emoji/gentoo.png b/src/General/img/emoji/gentoo.png similarity index 100% rename from src/img/emoji/gentoo.png rename to src/General/img/emoji/gentoo.png diff --git a/src/img/emoji/gnu.png b/src/General/img/emoji/gnu.png similarity index 100% rename from src/img/emoji/gnu.png rename to src/General/img/emoji/gnu.png diff --git a/src/img/emoji/madotsuki.png b/src/General/img/emoji/madotsuki.png similarity index 100% rename from src/img/emoji/madotsuki.png rename to src/General/img/emoji/madotsuki.png diff --git a/src/img/emoji/mint.png b/src/General/img/emoji/mint.png similarity index 100% rename from src/img/emoji/mint.png rename to src/General/img/emoji/mint.png diff --git a/src/img/emoji/neko.png b/src/General/img/emoji/neko.png similarity index 100% rename from src/img/emoji/neko.png rename to src/General/img/emoji/neko.png diff --git a/src/img/emoji/openbsd.png b/src/General/img/emoji/openbsd.png similarity index 100% rename from src/img/emoji/openbsd.png rename to src/General/img/emoji/openbsd.png diff --git a/src/img/emoji/osx.png b/src/General/img/emoji/osx.png similarity index 100% rename from src/img/emoji/osx.png rename to src/General/img/emoji/osx.png diff --git a/src/img/emoji/pinkie.png b/src/General/img/emoji/pinkie.png similarity index 100% rename from src/img/emoji/pinkie.png rename to src/General/img/emoji/pinkie.png diff --git a/src/img/emoji/plan9.png b/src/General/img/emoji/plan9.png similarity index 100% rename from src/img/emoji/plan9.png rename to src/General/img/emoji/plan9.png diff --git a/src/img/emoji/ponyo.png b/src/General/img/emoji/ponyo.png similarity index 100% rename from src/img/emoji/ponyo.png rename to src/General/img/emoji/ponyo.png diff --git a/src/img/emoji/rabite.png b/src/General/img/emoji/rabite.png similarity index 100% rename from src/img/emoji/rabite.png rename to src/General/img/emoji/rabite.png diff --git a/src/img/emoji/rainbow.png b/src/General/img/emoji/rainbow.png similarity index 100% rename from src/img/emoji/rainbow.png rename to src/General/img/emoji/rainbow.png diff --git a/src/img/emoji/rarity.png b/src/General/img/emoji/rarity.png similarity index 100% rename from src/img/emoji/rarity.png rename to src/General/img/emoji/rarity.png diff --git a/src/img/emoji/rhel.png b/src/General/img/emoji/rhel.png similarity index 100% rename from src/img/emoji/rhel.png rename to src/General/img/emoji/rhel.png diff --git a/src/img/emoji/sabayon.png b/src/General/img/emoji/sabayon.png similarity index 100% rename from src/img/emoji/sabayon.png rename to src/General/img/emoji/sabayon.png diff --git a/src/General/img/emoji/sage.png b/src/General/img/emoji/sage.png new file mode 100644 index 000000000..385a60900 Binary files /dev/null and b/src/General/img/emoji/sage.png differ diff --git a/src/img/emoji/sakamoto.png b/src/General/img/emoji/sakamoto.png similarity index 100% rename from src/img/emoji/sakamoto.png rename to src/General/img/emoji/sakamoto.png diff --git a/src/img/emoji/sega.png b/src/General/img/emoji/sega.png similarity index 100% rename from src/img/emoji/sega.png rename to src/General/img/emoji/sega.png diff --git a/src/img/emoji/slackware.png b/src/General/img/emoji/slackware.png similarity index 100% rename from src/img/emoji/slackware.png rename to src/General/img/emoji/slackware.png diff --git a/src/img/emoji/spike.png b/src/General/img/emoji/spike.png similarity index 100% rename from src/img/emoji/spike.png rename to src/General/img/emoji/spike.png diff --git a/src/img/emoji/trisquel.png b/src/General/img/emoji/trisquel.png similarity index 100% rename from src/img/emoji/trisquel.png rename to src/General/img/emoji/trisquel.png diff --git a/src/img/emoji/twilight.png b/src/General/img/emoji/twilight.png similarity index 100% rename from src/img/emoji/twilight.png rename to src/General/img/emoji/twilight.png diff --git a/src/img/emoji/ubuntu.png b/src/General/img/emoji/ubuntu.png similarity index 100% rename from src/img/emoji/ubuntu.png rename to src/General/img/emoji/ubuntu.png diff --git a/src/img/emoji/windows.png b/src/General/img/emoji/windows.png similarity index 100% rename from src/img/emoji/windows.png rename to src/General/img/emoji/windows.png diff --git a/src/img/emoji/yuno.png b/src/General/img/emoji/yuno.png similarity index 100% rename from src/img/emoji/yuno.png rename to src/General/img/emoji/yuno.png diff --git a/src/General/img/favicons/4chanJS/unreadDead.png b/src/General/img/favicons/4chanJS/unreadDead.png new file mode 100644 index 000000000..090bc366d Binary files /dev/null and b/src/General/img/favicons/4chanJS/unreadDead.png differ diff --git a/src/General/img/favicons/4chanJS/unreadDeadY.png b/src/General/img/favicons/4chanJS/unreadDeadY.png new file mode 100644 index 000000000..aaefd78b4 Binary files /dev/null and b/src/General/img/favicons/4chanJS/unreadDeadY.png differ diff --git a/src/General/img/favicons/4chanJS/unreadNSFW.png b/src/General/img/favicons/4chanJS/unreadNSFW.png new file mode 100644 index 000000000..9fcaf2e4a Binary files /dev/null and b/src/General/img/favicons/4chanJS/unreadNSFW.png differ diff --git a/src/General/img/favicons/4chanJS/unreadNSFWY.png b/src/General/img/favicons/4chanJS/unreadNSFWY.png new file mode 100644 index 000000000..a03cb6ee0 Binary files /dev/null and b/src/General/img/favicons/4chanJS/unreadNSFWY.png differ diff --git a/src/General/img/favicons/4chanJS/unreadSFW.png b/src/General/img/favicons/4chanJS/unreadSFW.png new file mode 100644 index 000000000..77c3ae1bb Binary files /dev/null and b/src/General/img/favicons/4chanJS/unreadSFW.png differ diff --git a/src/General/img/favicons/4chanJS/unreadSFWY.png b/src/General/img/favicons/4chanJS/unreadSFWY.png new file mode 100644 index 000000000..58e69ab96 Binary files /dev/null and b/src/General/img/favicons/4chanJS/unreadSFWY.png differ diff --git a/src/img/favicons/Mayhem/unreadDead.png b/src/General/img/favicons/Mayhem/unreadDead.png similarity index 100% rename from src/img/favicons/Mayhem/unreadDead.png rename to src/General/img/favicons/Mayhem/unreadDead.png diff --git a/src/img/favicons/Mayhem/unreadDeadY.png b/src/General/img/favicons/Mayhem/unreadDeadY.png similarity index 100% rename from src/img/favicons/Mayhem/unreadDeadY.png rename to src/General/img/favicons/Mayhem/unreadDeadY.png diff --git a/src/img/favicons/Mayhem/unreadNSFW.png b/src/General/img/favicons/Mayhem/unreadNSFW.png similarity index 100% rename from src/img/favicons/Mayhem/unreadNSFW.png rename to src/General/img/favicons/Mayhem/unreadNSFW.png diff --git a/src/img/favicons/Mayhem/unreadNSFWY.png b/src/General/img/favicons/Mayhem/unreadNSFWY.png similarity index 100% rename from src/img/favicons/Mayhem/unreadNSFWY.png rename to src/General/img/favicons/Mayhem/unreadNSFWY.png diff --git a/src/img/favicons/Mayhem/unreadSFW.png b/src/General/img/favicons/Mayhem/unreadSFW.png similarity index 100% rename from src/img/favicons/Mayhem/unreadSFW.png rename to src/General/img/favicons/Mayhem/unreadSFW.png diff --git a/src/img/favicons/Mayhem/unreadSFWY.png b/src/General/img/favicons/Mayhem/unreadSFWY.png similarity index 100% rename from src/img/favicons/Mayhem/unreadSFWY.png rename to src/General/img/favicons/Mayhem/unreadSFWY.png diff --git a/src/General/img/favicons/Original/unreadDead.gif b/src/General/img/favicons/Original/unreadDead.gif new file mode 100644 index 000000000..ba3b3fb6f Binary files /dev/null and b/src/General/img/favicons/Original/unreadDead.gif differ diff --git a/src/img/favicons/Original/unreadDead.png b/src/General/img/favicons/Original/unreadDead.png similarity index 100% rename from src/img/favicons/Original/unreadDead.png rename to src/General/img/favicons/Original/unreadDead.png diff --git a/src/img/favicons/Original/unreadDeadY.png b/src/General/img/favicons/Original/unreadDeadY.png similarity index 100% rename from src/img/favicons/Original/unreadDeadY.png rename to src/General/img/favicons/Original/unreadDeadY.png diff --git a/src/General/img/favicons/Original/unreadNSFW.gif b/src/General/img/favicons/Original/unreadNSFW.gif new file mode 100644 index 000000000..d0ccae384 Binary files /dev/null and b/src/General/img/favicons/Original/unreadNSFW.gif differ diff --git a/src/img/favicons/Original/unreadNSFW.png b/src/General/img/favicons/Original/unreadNSFW.png similarity index 100% rename from src/img/favicons/Original/unreadNSFW.png rename to src/General/img/favicons/Original/unreadNSFW.png diff --git a/src/img/favicons/Original/unreadNSFWY.png b/src/General/img/favicons/Original/unreadNSFWY.png similarity index 100% rename from src/img/favicons/Original/unreadNSFWY.png rename to src/General/img/favicons/Original/unreadNSFWY.png diff --git a/src/General/img/favicons/Original/unreadSFW.gif b/src/General/img/favicons/Original/unreadSFW.gif new file mode 100644 index 000000000..6196ce77a Binary files /dev/null and b/src/General/img/favicons/Original/unreadSFW.gif differ diff --git a/src/img/favicons/Original/unreadSFW.png b/src/General/img/favicons/Original/unreadSFW.png similarity index 100% rename from src/img/favicons/Original/unreadSFW.png rename to src/General/img/favicons/Original/unreadSFW.png diff --git a/src/img/favicons/Original/unreadSFWY.png b/src/General/img/favicons/Original/unreadSFWY.png similarity index 100% rename from src/img/favicons/Original/unreadSFWY.png rename to src/General/img/favicons/Original/unreadSFWY.png diff --git a/src/General/img/favicons/dead.gif b/src/General/img/favicons/dead.gif new file mode 100644 index 000000000..04def8819 Binary files /dev/null and b/src/General/img/favicons/dead.gif differ diff --git a/src/img/favicons/dead.png b/src/General/img/favicons/dead.png similarity index 100% rename from src/img/favicons/dead.png rename to src/General/img/favicons/dead.png diff --git a/src/General/img/favicons/empty.gif b/src/General/img/favicons/empty.gif new file mode 100644 index 000000000..5ad41fc95 Binary files /dev/null and b/src/General/img/favicons/empty.gif differ diff --git a/src/img/favicons/empty.png b/src/General/img/favicons/empty.png similarity index 100% rename from src/img/favicons/empty.png rename to src/General/img/favicons/empty.png diff --git a/src/img/favicons/exclamation.png b/src/General/img/favicons/exclamation.png similarity index 100% rename from src/img/favicons/exclamation.png rename to src/General/img/favicons/exclamation.png diff --git a/src/General/img/favicons/ferongr/unreadDead.gif b/src/General/img/favicons/ferongr/unreadDead.gif new file mode 100644 index 000000000..e569bc99a Binary files /dev/null and b/src/General/img/favicons/ferongr/unreadDead.gif differ diff --git a/src/img/favicons/ferongr/unreadDead.png b/src/General/img/favicons/ferongr/unreadDead.png similarity index 100% rename from src/img/favicons/ferongr/unreadDead.png rename to src/General/img/favicons/ferongr/unreadDead.png diff --git a/src/img/favicons/ferongr/unreadDeadY.png b/src/General/img/favicons/ferongr/unreadDeadY.png similarity index 100% rename from src/img/favicons/ferongr/unreadDeadY.png rename to src/General/img/favicons/ferongr/unreadDeadY.png diff --git a/src/General/img/favicons/ferongr/unreadNSFW.gif b/src/General/img/favicons/ferongr/unreadNSFW.gif new file mode 100644 index 000000000..451c8c623 Binary files /dev/null and b/src/General/img/favicons/ferongr/unreadNSFW.gif differ diff --git a/src/img/favicons/ferongr/unreadNSFW.png b/src/General/img/favicons/ferongr/unreadNSFW.png similarity index 100% rename from src/img/favicons/ferongr/unreadNSFW.png rename to src/General/img/favicons/ferongr/unreadNSFW.png diff --git a/src/img/favicons/ferongr/unreadNSFWY.png b/src/General/img/favicons/ferongr/unreadNSFWY.png similarity index 100% rename from src/img/favicons/ferongr/unreadNSFWY.png rename to src/General/img/favicons/ferongr/unreadNSFWY.png diff --git a/src/General/img/favicons/ferongr/unreadSFW.gif b/src/General/img/favicons/ferongr/unreadSFW.gif new file mode 100644 index 000000000..35e2d9d04 Binary files /dev/null and b/src/General/img/favicons/ferongr/unreadSFW.gif differ diff --git a/src/img/favicons/ferongr/unreadSFW.png b/src/General/img/favicons/ferongr/unreadSFW.png similarity index 100% rename from src/img/favicons/ferongr/unreadSFW.png rename to src/General/img/favicons/ferongr/unreadSFW.png diff --git a/src/img/favicons/ferongr/unreadSFWY.png b/src/General/img/favicons/ferongr/unreadSFWY.png similarity index 100% rename from src/img/favicons/ferongr/unreadSFWY.png rename to src/General/img/favicons/ferongr/unreadSFWY.png diff --git a/src/img/favicons/xat-/unreadDead.png b/src/General/img/favicons/xat-/unreadDead.png similarity index 100% rename from src/img/favicons/xat-/unreadDead.png rename to src/General/img/favicons/xat-/unreadDead.png diff --git a/src/img/favicons/xat-/unreadDeadY.png b/src/General/img/favicons/xat-/unreadDeadY.png similarity index 100% rename from src/img/favicons/xat-/unreadDeadY.png rename to src/General/img/favicons/xat-/unreadDeadY.png diff --git a/src/img/favicons/xat-/unreadNSFW.png b/src/General/img/favicons/xat-/unreadNSFW.png similarity index 100% rename from src/img/favicons/xat-/unreadNSFW.png rename to src/General/img/favicons/xat-/unreadNSFW.png diff --git a/src/img/favicons/xat-/unreadNSFWY.png b/src/General/img/favicons/xat-/unreadNSFWY.png similarity index 100% rename from src/img/favicons/xat-/unreadNSFWY.png rename to src/General/img/favicons/xat-/unreadNSFWY.png diff --git a/src/img/favicons/xat-/unreadSFW.png b/src/General/img/favicons/xat-/unreadSFW.png similarity index 100% rename from src/img/favicons/xat-/unreadSFW.png rename to src/General/img/favicons/xat-/unreadSFW.png diff --git a/src/img/favicons/xat-/unreadSFWY.png b/src/General/img/favicons/xat-/unreadSFWY.png similarity index 100% rename from src/img/favicons/xat-/unreadSFWY.png rename to src/General/img/favicons/xat-/unreadSFWY.png diff --git a/src/img/icon.gif b/src/General/img/icon.gif similarity index 100% rename from src/img/icon.gif rename to src/General/img/icon.gif diff --git a/src/img/icon128.png b/src/General/img/icon128.png similarity index 100% rename from src/img/icon128.png rename to src/General/img/icon128.png diff --git a/src/img/icon16.png b/src/General/img/icon16.png similarity index 100% rename from src/img/icon16.png rename to src/General/img/icon16.png diff --git a/src/img/icon48.png b/src/General/img/icon48.png similarity index 100% rename from src/img/icon48.png rename to src/General/img/icon48.png diff --git a/src/img/icons/4chanSS.png b/src/General/img/icons/4chanSS.png similarity index 100% rename from src/img/icons/4chanSS.png rename to src/General/img/icons/4chanSS.png diff --git a/src/img/icons/oneechan.png b/src/General/img/icons/oneechan.png similarity index 100% rename from src/img/icons/oneechan.png rename to src/General/img/icons/oneechan.png diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee new file mode 100644 index 000000000..f5cccad99 --- /dev/null +++ b/src/General/lib/$.coffee @@ -0,0 +1,472 @@ +String::capitalize = -> + @charAt(0).toUpperCase() + @slice(1); + +String::contains = (string) -> + @indexOf(string) > -1 + +Array::add = (object, position) -> + keep = @slice position + @length = position + @push object + @pushArrays keep + +Array::contains = (object) -> + @indexOf(object) > -1 + +Array::indexOf = (object) -> + i = @length + while i-- + break if @[i] is object + return i + +Array::pushArrays = -> + args = arguments + for arg in args + @push.apply @, arg + return + +Array::remove = (object) -> + if (index = @indexOf object) > -1 + @splice index, 1 + else + false + +# loosely follows the jquery api: +# http://api.jquery.com/ +# not chainable +$ = (selector, root=d.body) -> + root.querySelector selector + +$.extend = (object, properties) -> + for key, val of properties + continue unless properties.hasOwnProperty key + object[key] = val + return + +$.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))) + +$.id = (id) -> + d.getElementById id + +$.ready = (fc) -> + if d.readyState in ['interactive', 'complete'] + $.queueTask fc + return + cb = -> + $.off d, 'DOMContentLoaded', cb + fc() + $.on d, 'DOMContentLoaded', cb + +$.formData = (form) -> + if form instanceof HTMLFormElement + return new FormData form + fd = new FormData() + for key, val of form + continue unless val + # XXX GM bug + # if val instanceof Blob + if val.size and val.name + fd.append key, val, val.name + else + fd.append key, val + fd + +$.ajax = (url, callbacks, opts={}) -> + {type, cred, headers, upCallbacks, form, sync} = opts + r = new XMLHttpRequest() + r.overrideMimeType 'text/html' + type or= form and 'post' or 'get' + r.open type, url, !sync + for key, val of headers + r.setRequestHeader key, val + $.extend r, callbacks + $.extend r.upload, upCallbacks + r.withCredentials = cred + r.send form + r + +$.cache = do -> + reqs = {} + (url, cb) -> + if req = reqs[url] + if req.readyState is 4 + cb.call req + else + req.callbacks.push cb + return + rm = -> delete reqs[url] + req = $.ajax url, + onload: (e) -> + cb.call @, e for cb in @callbacks + delete @callbacks + onabort: rm + onerror: rm + req.callbacks = [cb] + reqs[url] = req + +$.cb = + checked: -> + $.set @name, @checked + Conf[@name] = @checked + value: -> + $.set @name, @value.trim() + Conf[@name] = @value + +$.asap = (test, cb) -> + if test() + cb() + else + setTimeout $.asap, 25, test, cb + +$.addStyle = (css, id) -> + style = $.el 'style', + id: id + textContent: css + $.asap (-> d.head), -> + $.add d.head, style + style + +$.x = (path, root) -> + root or= d.body + # XPathResult.ANY_UNORDERED_NODE_TYPE === 8 + d.evaluate(path, root, null, 8, null).singleNodeValue + +$.X = (path, root) -> + root or= d.body + d.evaluate path, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null + +$.addClass = (el, className) -> + el.classList.add className + +$.rmClass = (el, className) -> + el.classList.remove className + +$.toggleClass = (el, className) -> + el.classList.toggle className + +$.hasClass = (el, className) -> + el.classList.contains className + +$.rm = do -> + if 'remove' of Element.prototype + (el) -> el.remove() + else + (el) -> el.parentNode?.removeChild el + +$.rmAll = (root) -> + # jsperf.com/emptify-element + while node = root.firstChild + # HTMLSelectElement.remove !== Element.remove + root.removeChild node + return + +$.tn = (s) -> + d.createTextNode s + +$.frag = -> + d.createDocumentFragment() + +$.nodes = (nodes) -> + unless nodes instanceof Array + return nodes + frag = $.frag() + for node in nodes + frag.appendChild node + frag + +$.add = (parent, el) -> + parent.appendChild $.nodes el + +$.prepend = (parent, el) -> + parent.insertBefore $.nodes(el), parent.firstChild + +$.after = (root, el) -> + root.parentNode.insertBefore $.nodes(el), root.nextSibling + +$.before = (root, el) -> + root.parentNode.insertBefore $.nodes(el), root + +$.replace = (root, el) -> + root.parentNode.replaceChild $.nodes(el), root + +$.el = (tag, properties) -> + el = d.createElement tag + $.extend el, properties if properties + el + +$.on = (el, events, handler) -> + for event in events.split ' ' + el.addEventListener event, handler, false + return + +$.off = (el, events, handler) -> + for event in events.split ' ' + el.removeEventListener event, handler, false + return + +$.event = (event, detail, root=d) -> + root.dispatchEvent new CustomEvent event, {bubbles: true, detail} + +$.open = (URL) -> +<% if (type === 'userscript') { %> + # XXX fix GM opening file://// for protocol-less URLs. + # https://github.com/greasemonkey/greasemonkey/issues/1719 + GM_openInTab ($.el 'a', href: URL).href +<% } else { %> + window.open URL, '_blank' +<% } %> + +$.debounce = (wait, fn) -> + lastCall = 0 + timeout = null + that = null + args = null + exec = -> + lastCall = Date.now() + fn.apply that, args + -> + args = arguments + that = this + if lastCall < Date.now() - wait + return exec() + # stop current reset + clearTimeout timeout + # after wait, let next invocation execute immediately + timeout = setTimeout exec, wait + +$.queueTask = do -> + # inspired by https://www.w3.org/Bugs/Public/show_bug.cgi?id=15007 + taskQueue = [] + execTask = -> + task = taskQueue.shift() + func = task[0] + args = Array::slice.call task, 1 + func.apply func, args + if window.MessageChannel + taskChannel = new MessageChannel() + taskChannel.port1.onmessage = execTask + -> + taskQueue.push arguments + taskChannel.port2.postMessage null + else # XXX Firefox + -> + taskQueue.push arguments + setTimeout execTask, 0 + +$.globalEval = (code) -> + script = $.el 'script', + textContent: code + $.add (d.head or doc), script + $.rm script + +$.bytesToString = (size) -> + unit = 0 # Bytes + while size >= 1024 + size /= 1024 + unit++ + # Remove trailing 0s. + size = + if unit > 1 + # Keep the size as a float if the size is greater than 2^20 B. + # Round to hundredth. + Math.round(size * 100) / 100 + else + # Round to an integer otherwise. + Math.round size + "#{size} #{['B', 'KB', 'MB', 'GB'][unit]}" + +$.minmax = (value, min, max) -> + return ( + if value < min + min + else + if value > max + max + else + value + ) + +$.syncing = {} + +$.sync = do -> +<% if (type === 'crx') { %> + chrome.storage.onChanged.addListener (changes) -> + for key of changes + if cb = $.syncing[key] + cb changes[key].newValue + return + (key, cb) -> $.syncing[key] = cb +<% } else { %> + window.addEventListener 'storage', (e) -> + if cb = $.syncing[e.key] + cb JSON.parse e.newValue + , false + (key, cb) -> $.syncing[g.NAMESPACE + key] = cb +<% } %> + +$.item = (key, val) -> + item = {} + item[key] = val + item +<% if (type === 'crx') { %> +$.localKeys = [ + # filters + 'name', + 'uniqueID', + 'tripcode', + 'capcode', + 'email', + 'subject', + 'comment', + 'flag', + 'filename', + 'dimensions', + 'filesize', + 'MD5', + # custom css + 'usercss' +] + +# https://developer.chrome.com/extensions/storage.html + +$.delete = (keys) -> + chrome.storage.sync.remove keys + +$.get = (key, val, cb) -> + if typeof cb is 'function' + items = $.item key, val + else + items = key + cb = val + localItems = null + syncItems = null + for key, val of items + if key in $.localKeys + (localItems or= {})[key] = val + else + (syncItems or= {})[key] = val + + items = {} + count = 0 + done = (item) -> + $.extend items, item + cb items unless --count + + if localItems + count++ + chrome.storage.local.get localItems, done + if syncItems + count++ + chrome.storage.sync.get syncItems, done +$.set = do -> + items = {} + localItems = {} + + set = $.debounce $.SECOND, -> + for key in $.localKeys + if key of items + (localItems or= {})[key] = items[key] + delete items[key] + try + chrome.storage.local.set localItems + chrome.storage.sync.set items + items = {} + localItems = {} + catch err + c.error err + + (key, val) -> + if typeof key is 'string' + items[key] = val + else + $.extend items, key + set() + +<% } else if (type === 'userjs') { %> +do -> + # http://www.opera.com/docs/userjs/specs/#scriptstorage + # http://www.opera.com/docs/userjs/using/#securepages + # The scriptStorage object is available only during + # the main User JavaScript thread, being therefore + # accessible only in the main body of the user script. + # To access the storage object later, keep a reference + # to the object. + {scriptStorage} = opera + $.delete = (keys) -> + unless keys instanceof Array + keys = [keys] + for key in keys + key = g.NAMESPACE + key + localStorage.removeItem key + delete scriptStorage[key] + return + $.get = (key, val, cb) -> + if typeof cb is 'function' + items = $.item key, val + else + items = key + cb = val + $.queueTask -> + for key of items + if val = scriptStorage[g.NAMESPACE + key] + items[key] = JSON.parse val + cb items + $.set = do -> + set = (key, val) -> + key = g.NAMESPACE + key + val = JSON.stringify val + if key of $.syncing + # for `storage` events + localStorage.setItem key, val + scriptStorage[key] = val + (keys, val) -> + if typeof keys is 'string' + set keys, val + return + for key, val of keys + set key, val + return + return +<% } else { %> + +# http://wiki.greasespot.net/Main_Page +$.delete = (keys) -> + unless keys instanceof Array + keys = [keys] + for key in keys + key = g.NAMESPACE + key + localStorage.removeItem key + GM_deleteValue key + return + +$.get = (key, val, cb) -> + if typeof cb is 'function' + items = $.item key, val + else + items = key + cb = val + $.queueTask -> + for key of items + if val = GM_getValue g.NAMESPACE + key + items[key] = JSON.parse val + cb items + +$.set = do -> + set = (key, val) -> + key = g.NAMESPACE + key + val = JSON.stringify val + if key of $.syncing + # for `storage` events + localStorage.setItem key, val + GM_setValue key, val + (keys, val) -> + if typeof keys is 'string' + set keys, val + return + for key, val of keys + set key, val + return +<% } %> + +$$ = (selector, root=d.body) -> + [root.querySelectorAll(selector)...] diff --git a/src/lib/board.class b/src/General/lib/board.class similarity index 100% rename from src/lib/board.class rename to src/General/lib/board.class diff --git a/src/General/lib/classes.coffee b/src/General/lib/classes.coffee new file mode 100644 index 000000000..260d3d7e1 --- /dev/null +++ b/src/General/lib/classes.coffee @@ -0,0 +1,6 @@ +<%= grunt.file.read('src/General/lib/board.class') %> +<%= grunt.file.read('src/General/lib/thread.class') %> +<%= grunt.file.read('src/General/lib/post.class') %> +<%= grunt.file.read('src/General/lib/clone.class') %> +<%= grunt.file.read('src/General/lib/databoard.class') %> +<%= grunt.file.read('src/General/lib/notification.class') %> \ No newline at end of file diff --git a/src/lib/clone.class b/src/General/lib/clone.class similarity index 100% rename from src/lib/clone.class rename to src/General/lib/clone.class diff --git a/src/lib/databoard.class b/src/General/lib/databoard.class similarity index 98% rename from src/lib/databoard.class rename to src/General/lib/databoard.class index 7ebf35d12..056018ba0 100644 --- a/src/lib/databoard.class +++ b/src/General/lib/databoard.class @@ -63,7 +63,7 @@ class DataBoard @deleteIfEmpty {boardID} now = Date.now() - if (@data.lastChecked or 0) < now - 12 * $.HOUR + if (@data.lastChecked or 0) < now - 2 * $.HOUR @data.lastChecked = now for boardID of @data.boards @ajaxClean boardID diff --git a/src/lib/notification.class b/src/General/lib/notification.class similarity index 100% rename from src/lib/notification.class rename to src/General/lib/notification.class diff --git a/src/lib/polyfill.coffee b/src/General/lib/polyfill.coffee similarity index 100% rename from src/lib/polyfill.coffee rename to src/General/lib/polyfill.coffee diff --git a/src/lib/post.class b/src/General/lib/post.class similarity index 98% rename from src/lib/post.class rename to src/General/lib/post.class index 30bfec808..0d9f356f2 100644 --- a/src/lib/post.class +++ b/src/General/lib/post.class @@ -153,7 +153,7 @@ class Post unless strong = $ 'strong.warning', @nodes.info strong = $.el 'strong', className: 'warning' - textContent: '[Deleted]' + textContent: if @isReply then '[Deleted]' else '[Dead]' $.after $('input', @nodes.info), strong strong.textContent = if file then '[File deleted]' else '[Deleted]' diff --git a/src/lib/thread.class b/src/General/lib/thread.class similarity index 100% rename from src/lib/thread.class rename to src/General/lib/thread.class diff --git a/src/General/meta/banner.js b/src/General/meta/banner.js new file mode 100644 index 000000000..ef02c4782 --- /dev/null +++ b/src/General/meta/banner.js @@ -0,0 +1,89 @@ +/* +* <%= meta.name %> - Version <%= version %> - <%= grunt.template.today('yyyy-mm-dd') %> +* +* Licensed under the MIT license. +* <%= meta.repo %>blob/master/LICENSE +* +* Appchan X Copyright © 2013-2013 Zixaphir +* http://zixaphir.github.io/appchan-x/ +* 4chan x Copyright © 2009-2011 James Campos +* https://github.com/aeosynth/4chan-x +* 4chan x Copyright © 2012-<%= grunt.template.today('yyyy') %> Nicolas Stepien +* https://4chan-x.just-believe.in/ +* 4chan x Copyright © 2013-<%= grunt.template.today('yyyy') %> Jordan Bates +* http://seaweedchan.github.io/4chan-x/ +* 4chan x Copyright © 2012-<%= grunt.template.today('yyyy') %> ihavenoface +* http://ihavenoface.github.io/4chan-x/ +* 4chan SS Copyright © 2011-2013 Ahodesuka +* https://github.com/ahodesuka/4chan-Style-Script/ +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Contributors: +* aeosynth +* mayhemydg +* noface +* !K.WeEabo0o +* blaise +* that4chanwolf +* desuwa +* seaweed +* e000 +* ahodesuka +* Shou +* ferongr +* xat +* Ongpot +* thisisanon +* Anonymous +* Seiba +* herpaderpderp +* WakiMiko +* btmcsweeney +* AppleBloom +* +* All the people who've taken the time to write bug reports. +* +* Thank you. +*/ + +/* +* Contains data from external sources: +* +* audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/ +* cc-by-nc-3.0 +* +* 4chan/4chan-JS (https://github.com/4chan/4chan-JS) +* Copyright (c) 2012-2013, 4chan LLC +* All rights reserved. +* +* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE +* +* Linkify: (http://userscripts.org/scripts/show/1352) +* Copyright (c) 2011, Anthony Lieuallen +* All rights reserved. +* Originally written by Anthony Lieuallen of http://arantius.com/ +* Licensed for unlimited modification and redistribution as long as +* this notice is kept intact. +* +* license: http://userscripts.org/scripts/review/1352 +* +*/ \ No newline at end of file diff --git a/src/meta/manifest.json b/src/General/meta/manifest.json similarity index 100% rename from src/meta/manifest.json rename to src/General/meta/manifest.json diff --git a/src/meta/metadata.js b/src/General/meta/metadata.js similarity index 60% rename from src/meta/metadata.js rename to src/General/meta/metadata.js index 77f5d0192..e872f8243 100644 --- a/src/meta/metadata.js +++ b/src/General/meta/metadata.js @@ -3,8 +3,7 @@ // @version <%= version %> // @namespace <%= meta.namespace %> // @description <%= description %> -// @copyright 2012-2013 Zixaphir -// @license MIT; http://en.wikipedia.org/wiki/Mit_license +// @license MIT; <%= meta.repo %>blob/<%= meta.mainBranch %>/LICENSE <%= meta.matches.map(function(match) { return '// @match ' + match; @@ -15,7 +14,7 @@ // @grant GM_deleteValue // @grant GM_openInTab // @run-at document-start -// @updateURL <%= meta.page %><%= meta.buildsPath %><%= name %>.meta.js -// @downloadURL <%= meta.page %><%= meta.buildsPath %><%= name %>.user.js -// @icon data:image/png;base64,<%= grunt.file.read('src/img/icon48.png', {encoding: 'base64'}) %> +// @updateURL <%= meta.repo %>raw/stable/builds/<%= meta.files.metajs %> +// @downloadURL <%= meta.repo %>raw/stable/builds/<%= meta.files.userjs %> +// @icon data:image/png;base64,<%= grunt.file.read('src/General/img/icon48.png', {encoding: 'base64'}) %> // ==/UserScript== diff --git a/src/features/imaging/fappetyme.coffee b/src/Images/FappeTyme.coffee similarity index 100% rename from src/features/imaging/fappetyme.coffee rename to src/Images/FappeTyme.coffee diff --git a/src/features/imaging/imageexpand.coffee b/src/Images/ImageExpand.coffee similarity index 96% rename from src/features/imaging/imageexpand.coffee rename to src/Images/ImageExpand.coffee index 8bbb6ba84..9c53e8934 100644 --- a/src/features/imaging/imageexpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -75,10 +75,11 @@ ImageExpand = rect = post.nodes.root.getBoundingClientRect() return unless rect.top <= 0 or rect.left <= 0 - # Scroll back to the thumbnail when contracting the image - # to avoid being left miles away from the relevant post. - headRect = Header.bar.getBoundingClientRect() - top = rect.top - headRect.top - headRect.height + {top} = rect + if Conf['Fixed Header'] and not Conf['Bottom Header'] + headRect = Header.bar.getBoundingClientRect() + top += - headRect.top - headRect.height + root = <% if (type === 'crx') { %>d.body<% } else { %>doc<% } %> root.scrollTop += top if rect.top < 0 diff --git a/src/features/imaging/imagehover.coffee b/src/Images/ImageHover.coffee similarity index 100% rename from src/features/imaging/imagehover.coffee rename to src/Images/ImageHover.coffee diff --git a/src/features/imaging/imagereplace.coffee b/src/Images/ImageReplace.coffee similarity index 100% rename from src/features/imaging/imagereplace.coffee rename to src/Images/ImageReplace.coffee diff --git a/src/features/imaging/revealspoiler.coffee b/src/Images/RevealSpoilers.coffee similarity index 100% rename from src/features/imaging/revealspoiler.coffee rename to src/Images/RevealSpoilers.coffee diff --git a/src/features/linkification/linkify.coffee b/src/Linkification/Linkify.coffee similarity index 100% rename from src/features/linkification/linkify.coffee rename to src/Linkification/Linkify.coffee diff --git a/src/features/menu/archivelink.coffee b/src/Menu/ArchiveLink.coffee similarity index 100% rename from src/features/menu/archivelink.coffee rename to src/Menu/ArchiveLink.coffee diff --git a/src/features/menu/deletelink.coffee b/src/Menu/DeleteLink.coffee similarity index 100% rename from src/features/menu/deletelink.coffee rename to src/Menu/DeleteLink.coffee diff --git a/src/features/menu/downloadlink.coffee b/src/Menu/DownloadLink.coffee similarity index 100% rename from src/features/menu/downloadlink.coffee rename to src/Menu/DownloadLink.coffee diff --git a/src/features/menu/menu.coffee b/src/Menu/Menu.coffee similarity index 100% rename from src/features/menu/menu.coffee rename to src/Menu/Menu.coffee diff --git a/src/features/menu/reportlink.coffee b/src/Menu/ReportLink.coffee similarity index 100% rename from src/features/menu/reportlink.coffee rename to src/Menu/ReportLink.coffee diff --git a/src/Miscellaneous/AnnouncementHiding.coffee b/src/Miscellaneous/AnnouncementHiding.coffee new file mode 100644 index 000000000..1bab3f5e2 --- /dev/null +++ b/src/Miscellaneous/AnnouncementHiding.coffee @@ -0,0 +1,62 @@ +PSAHiding = + init: -> + return unless Conf['Announcement Hiding'] + + entry = + type: 'header' + el: $.el 'a', + textContent: 'Show announcement' + className: 'show-announcement' + href: 'javascript:;' + order: 50 + open: -> + if $.id('globalMessage')?.hidden + return true + false + $.event 'AddMenuEntry', entry + + $.on entry.el, 'click', PSAHiding.toggle + $.addClass doc, 'hide-announcement' + + $.on d, '4chanXInitFinished', @setup + + setup: -> + $.off d, '4chanXInitFinished', PSAHiding.setup + + unless psa = $.id 'globalMessage' + return + + PSAHiding.btn = btn = $.el 'a', + innerHTML: '[ - ]' + title: 'Hide announcement.' + className: 'hide-announcement' + href: 'javascript:;' + textContent: '[ - ]' + $.on btn, 'click', PSAHiding.toggle + + $.get 'hiddenPSAs', [], (item) -> + PSAHiding.sync item['hiddenPSAs'] + + toggle: (e) -> + text = PSAHiding.trim $.id 'globalMessage' + $.get 'hiddenPSAs', [], ({hiddenPSAs}) -> + if hide + hiddenPSAs.push text + hiddenPSAs = hiddenPSAs[-5..] + else + $.event 'CloseMenu' + i = hiddenPSAs.indexOf text + hiddenPSAs.splice i, 1 + PSAHiding.sync hiddenPSAs + $.set 'hiddenPSAs', hiddenPSAs + + sync: (hiddenPSAs) -> + psa = $.id 'globalMessage' + psa.hidden = PSAHiding.btn.hidden = if hiddenPSAs.contains PSAHiding.trim(psa) + true + else + false + if (hr = psa.nextElementSibling) and hr.nodeName is 'HR' + hr.hidden = psa.hidden + trim: (psa) -> + psa.textContent.replace(/\W+/g, '').toLowerCase() diff --git a/src/features/misc/cataloglinks.coffee b/src/Miscellaneous/CatalogLinks.coffee similarity index 92% rename from src/features/misc/cataloglinks.coffee rename to src/Miscellaneous/CatalogLinks.coffee index aaa1fd524..500a2888a 100644 --- a/src/features/misc/cataloglinks.coffee +++ b/src/Miscellaneous/CatalogLinks.coffee @@ -28,7 +28,11 @@ CatalogLinks = set: (useCatalog) -> path = if useCatalog then 'catalog' else '' - for a in $$ 'a', $.id('board-list') + for a in $$ """ + #board-list a[href*="boards.4chan.org"], + #boardNavDesktop a[href*="boards.4chan.org"], + #boardNavDesktopFoot a[href*="boards.4chan.org"] + """ board = a.pathname.split('/')[1] continue if ['f', 'status', '4chan'].contains(board) or !board if Conf['External Catalog'] diff --git a/src/Miscellaneous/ColorUserIDs.coffee b/src/Miscellaneous/ColorUserIDs.coffee new file mode 100644 index 000000000..fcd69847d --- /dev/null +++ b/src/Miscellaneous/ColorUserIDs.coffee @@ -0,0 +1,41 @@ +IDColor = + init: -> + return unless Conf['Color User IDs'] + + Post::callbacks.push + name: 'Reveal Spoilers' + cb: @node + + node: (post) -> + return unless uid = $ '.hand', @nodes.uniqueID + str = @info.uniqueID + if uid.nodeName is 'SPAN' + uid.style.cssText = IDColor.apply.call str + + ids: {} + + compute: (str) -> + hash = @hash str + + rgb = [ + (hash >> 24) & 0xFF + (hash >> 16) & 0xFF + (hash >> 8) & 0xFF + ] + rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125 + + @ids[str] = rgb + rgb + + apply: -> + rgb = IDColor.ids[@] or IDColor.compute @ + "background-color: rgb(#{rgb[0]},#{rgb[1]},#{rgb[2]}); color: " + if rgb[3] then "black;" else "white; border-radius: 3px; padding: 0px 2px;" + + hash: (str) -> + msg = 0 + i = 0 + j = str.length + while i < j + msg = ((msg << 5) - msg) + str.charCodeAt i + ++i + msg \ No newline at end of file diff --git a/src/features/theming/customcss.coffee b/src/Miscellaneous/CustomCSS.coffee similarity index 100% rename from src/features/theming/customcss.coffee rename to src/Miscellaneous/CustomCSS.coffee diff --git a/src/features/misc/expandcomment.coffee b/src/Miscellaneous/ExpandComment.coffee similarity index 100% rename from src/features/misc/expandcomment.coffee rename to src/Miscellaneous/ExpandComment.coffee diff --git a/src/features/misc/expandthread.coffee b/src/Miscellaneous/ExpandThread.coffee similarity index 100% rename from src/features/misc/expandthread.coffee rename to src/Miscellaneous/ExpandThread.coffee diff --git a/src/features/misc/fileinfo.coffee b/src/Miscellaneous/FileInfo.coffee similarity index 100% rename from src/features/misc/fileinfo.coffee rename to src/Miscellaneous/FileInfo.coffee diff --git a/src/features/misc/fourchan.coffee b/src/Miscellaneous/Fourchan.coffee similarity index 100% rename from src/features/misc/fourchan.coffee rename to src/Miscellaneous/Fourchan.coffee diff --git a/src/features/misc/keybinds.coffee b/src/Miscellaneous/Keybinds.coffee similarity index 91% rename from src/features/misc/keybinds.coffee rename to src/Miscellaneous/Keybinds.coffee index d892c8d44..b8f7054b2 100644 --- a/src/features/misc/keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -24,6 +24,10 @@ Keybinds = when Conf['Toggle board list'] if Conf['Custom Board Navigation'] Header.toggleBoardList() + when Conf['Toggle header'] + unless $('#menu.left') + Header.menuButton.click() + Header.headerToggler.click() when Conf['Open empty QR'] Keybinds.qr threadRoot when Conf['Open QR'] @@ -50,6 +54,8 @@ Keybinds = when Conf['Math tags'] return if target.nodeName isnt 'TEXTAREA' Keybinds.tags 'math', target + when Conf['Toggle sage'] + Keybinds.sage() if QR.nodes when Conf['Submit QR'] QR.submit() if QR.nodes and !QR.status() # Thread related @@ -63,7 +69,7 @@ Keybinds = when Conf['Expand images'] Keybinds.img threadRoot, true when Conf['fappeTyme'] - do FappeTyme.toggle + FappeTyme.toggle() # Board Navigation when Conf['Front page'] window.location = "/#{g.BOARD}/0#delform" @@ -75,6 +81,11 @@ Keybinds = when Conf['Previous page'] if form = $ '.prev form' window.location = form.action + when Conf['Open catalog'] + if Conf['External Catalog'] + window.location = CatalogLinks.external(g.BOARD.ID) + else + window.location = "/#{g.BOARD}/catalog" # Thread Navigation when Conf['Next thread'] return if g.VIEW is 'thread' @@ -155,6 +166,12 @@ Keybinds = # Fire the 'input' event $.event 'input', null, ta + sage: -> + isSage = /sage/i.test QR.nodes.email.value + QR.nodes.email.value = if isSage + "" + else "sage" + img: (thread, all) -> if all do ImageExpand.cb.toggleAll diff --git a/src/features/misc/rtnavigation.coffee b/src/Miscellaneous/Nav.coffee similarity index 100% rename from src/features/misc/rtnavigation.coffee rename to src/Miscellaneous/Nav.coffee diff --git a/src/features/misc/relativedates.coffee b/src/Miscellaneous/RelativeDates.coffee similarity index 100% rename from src/features/misc/relativedates.coffee rename to src/Miscellaneous/RelativeDates.coffee diff --git a/src/Miscellaneous/RemoveSpoilers.coffee b/src/Miscellaneous/RemoveSpoilers.coffee new file mode 100644 index 000000000..62ec1c6cc --- /dev/null +++ b/src/Miscellaneous/RemoveSpoilers.coffee @@ -0,0 +1,20 @@ +RemoveSpoilers = + init: -> + return unless Conf['Remove Spoilers'] + + if Conf['Indicate Spoilers'] + @wrapper = (text) -> + "[spoiler]#{text}[/spoiler]" + + Post::callbacks.push + name: 'Reveal Spoilers' + cb: @node + + wrapper: (text) -> + text + + node: (post) -> + spoilers = $$ 's', @nodes.comment + for spoiler in spoilers + $.replace spoiler, $.tn RemoveSpoilers.wrapper spoiler.textContent + return \ No newline at end of file diff --git a/src/features/misc/report.coffee b/src/Miscellaneous/Report.coffee similarity index 100% rename from src/features/misc/report.coffee rename to src/Miscellaneous/Report.coffee diff --git a/src/features/misc/sauce.coffee b/src/Miscellaneous/Sauce.coffee similarity index 100% rename from src/features/misc/sauce.coffee rename to src/Miscellaneous/Sauce.coffee diff --git a/src/features/misc/timeformatting.coffee b/src/Miscellaneous/Time.coffee similarity index 100% rename from src/features/misc/timeformatting.coffee rename to src/Miscellaneous/Time.coffee diff --git a/src/Monitoring/Favicon.coffee b/src/Monitoring/Favicon.coffee new file mode 100644 index 000000000..871a586c6 --- /dev/null +++ b/src/Monitoring/Favicon.coffee @@ -0,0 +1,57 @@ +Favicon = + init: -> + $.ready -> + Favicon.el = $ 'link[rel="shortcut icon"]', d.head + Favicon.el.type = 'image/x-icon' + {href} = Favicon.el + Favicon.SFW = /ws\.ico$/.test href + Favicon.default = href + Favicon.switch() + + switch: -> + unreadDead = Favicon.unreadDeadY = Favicon.unreadSFW = Favicon.unreadSFWY = Favicon.unreadNSFW = Favicon.unreadNSFWY = 'data:image/png;base64,' + switch Conf['favicon'] + when 'ferongr' + Favicon.unreadDead += '<%= grunt.file.read("src/General/img/favicons/ferongr/unreadDead.png", {encoding: "base64"}) %>' + Favicon.unreadDeadY += '<%= grunt.file.read("src/General/img/favicons/ferongr/unreadDeadY.png", {encoding: "base64"}) %>' + Favicon.unreadSFW += '<%= grunt.file.read("src/General/img/favicons/ferongr/unreadSFW.png", {encoding: "base64"}) %>' + Favicon.unreadSFWY += '<%= grunt.file.read("src/General/img/favicons/ferongr/unreadSFWY.png", {encoding: "base64"}) %>' + Favicon.unreadNSFW += '<%= grunt.file.read("src/General/img/favicons/ferongr/unreadNSFW.png", {encoding: "base64"}) %>' + Favicon.unreadNSFWY += '<%= grunt.file.read("src/General/img/favicons/ferongr/unreadNSFWY.png", {encoding: "base64"}) %>' + when 'xat-' + Favicon.unreadDead += '<%= grunt.file.read("src/General/img/favicons/xat-/unreadDead.png", {encoding: "base64"}) %>' + Favicon.unreadDeadY += '<%= grunt.file.read("src/General/img/favicons/xat-/unreadDeadY.png", {encoding: "base64"}) %>' + Favicon.unreadSFW += '<%= grunt.file.read("src/General/img/favicons/xat-/unreadSFW.png", {encoding: "base64"}) %>' + Favicon.unreadSFWY += '<%= grunt.file.read("src/General/img/favicons/xat-/unreadSFWY.png", {encoding: "base64"}) %>' + Favicon.unreadNSFW += '<%= grunt.file.read("src/General/img/favicons/xat-/unreadNSFW.png", {encoding: "base64"}) %>' + Favicon.unreadNSFWY += '<%= grunt.file.read("src/General/img/favicons/xat-/unreadNSFWY.png", {encoding: "base64"}) %>' + when 'Mayhem' + Favicon.unreadDead += '<%= grunt.file.read("src/General/img/favicons/Mayhem/unreadDead.png", {encoding: "base64"}) %>' + Favicon.unreadDeadY += '<%= grunt.file.read("src/General/img/favicons/Mayhem/unreadDeadY.png", {encoding: "base64"}) %>' + Favicon.unreadSFW += '<%= grunt.file.read("src/General/img/favicons/Mayhem/unreadSFW.png", {encoding: "base64"}) %>' + Favicon.unreadSFWY += '<%= grunt.file.read("src/General/img/favicons/Mayhem/unreadSFWY.png", {encoding: "base64"}) %>' + Favicon.unreadNSFW += '<%= grunt.file.read("src/General/img/favicons/Mayhem/unreadNSFW.png", {encoding: "base64"}) %>' + Favicon.unreadNSFWY += '<%= grunt.file.read("src/General/img/favicons/Mayhem/unreadNSFWY.png", {encoding: "base64"}) %>' + when '4chanJS' + Favicon.unreadDead += '<%= grunt.file.read("src/General/img/favicons/4chanJS/unreadDead.png", {encoding: "base64"}) %>' + Favicon.unreadDeadY += '<%= grunt.file.read("src/General/img/favicons/4chanJS/unreadDeadY.png", {encoding: "base64"}) %>' + Favicon.unreadSFW += '<%= grunt.file.read("src/General/img/favicons/4chanJS/unreadSFW.png", {encoding: "base64"}) %>' + Favicon.unreadSFWY += '<%= grunt.file.read("src/General/img/favicons/4chanJS/unreadSFWY.png", {encoding: "base64"}) %>' + Favicon.unreadNSFW += '<%= grunt.file.read("src/General/img/favicons/4chanJS/unreadNSFW.png", {encoding: "base64"}) %>' + Favicon.unreadNSFWY += '<%= grunt.file.read("src/General/img/favicons/4chanJS/unreadNSFWY.png", {encoding: "base64"}) %>' + when 'Original' + Favicon.unreadDead += '<%= grunt.file.read("src/General/img/favicons/Original/unreadDead.png", {encoding: "base64"}) %>' + Favicon.unreadDeadY += '<%= grunt.file.read("src/General/img/favicons/Original/unreadDeadY.png", {encoding: "base64"}) %>' + Favicon.unreadSFW += '<%= grunt.file.read("src/General/img/favicons/Original/unreadSFW.png", {encoding: "base64"}) %>' + Favicon.unreadSFWY += '<%= grunt.file.read("src/General/img/favicons/Original/unreadSFWY.png", {encoding: "base64"}) %>' + Favicon.unreadNSFW += '<%= grunt.file.read("src/General/img/favicons/Original/unreadNSFW.png", {encoding: "base64"}) %>' + Favicon.unreadNSFWY += '<%= grunt.file.read("src/General/img/favicons/Original/unreadNSFWY.png", {encoding: "base64"}) %>' + if Favicon.SFW + Favicon.unread = Favicon.unreadSFW + Favicon.unreadY = Favicon.unreadSFWY + else + Favicon.unread = Favicon.unreadNSFW + Favicon.unreadY = Favicon.unreadNSFWY + + empty: 'data:image/png;base64,<%= grunt.file.read("src/General/img/favicons/empty.png", {encoding: "base64"}) %>' + dead: 'data:image/png;base64,<%= grunt.file.read("src/General/img/favicons/dead.png", {encoding: "base64"}) %>' \ No newline at end of file diff --git a/src/features/monitoring/threadexcerpt.coffee b/src/Monitoring/ThreadExcerpt.coffee similarity index 100% rename from src/features/monitoring/threadexcerpt.coffee rename to src/Monitoring/ThreadExcerpt.coffee diff --git a/src/features/monitoring/threadstats.coffee b/src/Monitoring/ThreadStats.coffee similarity index 58% rename from src/features/monitoring/threadstats.coffee rename to src/Monitoring/ThreadStats.coffee index 37b074df3..ff08b53d7 100644 --- a/src/features/monitoring/threadstats.coffee +++ b/src/Monitoring/ThreadStats.coffee @@ -1,17 +1,14 @@ ThreadStats = init: -> return if g.VIEW isnt 'thread' or !Conf['Thread Stats'] - html = '0 / 0' - if Conf['Thread Updater'] - @dialog = $.el 'span', - innerHTML: "[ #{html} ]" - else - @dialog = UI.dialog 'thread-stats', 'bottom: 0; left: 0;', """ -
#{html}
- """ + @dialog = sc = $.el 'span', + innerHTML: "0 / 0" + id: 'thread-stats' - @postCountEl = $ '#post-count', @dialog - @fileCountEl = $ '#file-count', @dialog + @postCountEl = $ '#post-count', sc + @fileCountEl = $ '#file-count', sc + + Header.addShortcut sc Thread::callbacks.push name: 'Thread Stats' @@ -26,11 +23,6 @@ ThreadStats = ThreadStats.thread = @ ThreadStats.update postCount, fileCount $.on d, 'ThreadUpdate', ThreadStats.onUpdate - if Conf['Thread Updater'] - $.asap (-> $('.move', ThreadUpdater.dialog)), -> - $.prepend $('.move', ThreadUpdater.dialog), ThreadStats.dialog - else - $.add d.body, ThreadStats.dialog onUpdate: (e) -> return if e.detail[404] diff --git a/src/features/monitoring/threadupdater.coffee b/src/Monitoring/ThreadUpdater.coffee similarity index 81% rename from src/features/monitoring/threadupdater.coffee rename to src/Monitoring/ThreadUpdater.coffee index 70197e4c6..f49b51b23 100644 --- a/src/features/monitoring/threadupdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -2,24 +2,49 @@ ThreadUpdater = init: -> return if g.VIEW isnt 'thread' or !Conf['Thread Updater'] - html = '' + checked = if Conf['Auto Update'] then 'checked' else '' + @dialog = sc = $.el 'span', + innerHTML: "" + id: 'updater' + + @timer = $ '#update-timer', sc + @status = $ '#update-status', sc + + $.on @timer, 'click', ThreadUpdater.update + $.on @status, 'click', ThreadUpdater.update + + @checkPostCount = 0 + + Header.addShortcut sc + + subEntries = [] for name, conf of Config.updater.checkbox checked = if Conf[name] then 'checked' else '' - html += "
" + el = $.el 'label', + title: "#{conf[1]}" + innerHTML: " #{name}" + input = el.firstElementChild + $.on input, 'change', $.cb.checked + if input.name is 'Scroll BG' + $.on input, 'change', ThreadUpdater.cb.scrollBG + ThreadUpdater.cb.scrollBG() + else if input.name is 'Auto Update' + $.on input, 'change', ThreadUpdater.update + subEntries.push el: el - checked = if Conf['Auto Update'] then 'checked' else '' - html = """ -
- #{html} -
-
-
- """ + settings = $.el 'span', + innerHTML: 'Interval' - @dialog = UI.dialog 'updater', 'bottom: 0; right: 0;', html - @timer = $ '#update-timer', @dialog - @status = $ '#update-status', @dialog - @checkPostCount = 0 + $.on settings, 'click', @intervalShortcut + + subEntries.push el: settings + + $.event 'AddMenuEntry', + type: 'header' + el: $.el 'span', + textContent: 'Updater' + order: 110 + subEntries: subEntries Thread::callbacks.push name: 'Thread Updater' @@ -32,21 +57,7 @@ ThreadUpdater = ThreadUpdater.outdateCount = 0 ThreadUpdater.lastModified = '0' - for input in $$ 'input', ThreadUpdater.dialog - if input.type is 'checkbox' - $.on input, 'change', $.cb.checked - switch input.name - when 'Scroll BG' - $.on input, 'change', ThreadUpdater.cb.scrollBG - ThreadUpdater.cb.scrollBG() - when 'Auto Update This' - $.on input, 'change', ThreadUpdater.cb.autoUpdate - $.event 'change', null, input - when 'Interval' - $.on input, 'change', ThreadUpdater.cb.interval - ThreadUpdater.cb.interval.call input - when 'Update' - $.on input, 'click', ThreadUpdater.update + ThreadUpdater.cb.interval.call $.el 'input', value: Conf['Interval'] $.on window, 'online offline', ThreadUpdater.cb.online $.on d, 'QRPostSuccessful', ThreadUpdater.cb.post @@ -54,27 +65,28 @@ ThreadUpdater = ThreadUpdater.cb.online() Rice.nodes ThreadUpdater.dialog - $.add d.body, ThreadUpdater.dialog ### http://freesound.org/people/pierrecartoons1979/sounds/90112/ cc-by-nc-3.0 ### - beep: 'data:audio/wav;base64,<%= grunt.file.read("src/audio/beep.wav", {encoding: "base64"}) %>' + beep: 'data:audio/wav;base64,<%= grunt.file.read("src/General/audio/beep.wav", {encoding: "base64"}) %>' cb: online: -> if ThreadUpdater.online = navigator.onLine ThreadUpdater.outdateCount = 0 ThreadUpdater.set 'timer', ThreadUpdater.getInterval() - ThreadUpdater.update() if Conf['Auto Update This'] + + ThreadUpdater.update() + ThreadUpdater.set 'status', null, null else ThreadUpdater.set 'timer', null ThreadUpdater.set 'status', 'Offline', 'warning' ThreadUpdater.cb.autoUpdate() post: (e) -> - return unless Conf['Auto Update This'] and e.detail.threadID is ThreadUpdater.thread.ID + return unless e.detail.threadID is ThreadUpdater.thread.ID ThreadUpdater.outdateCount = 0 setTimeout ThreadUpdater.update, 1000 if ThreadUpdater.seconds > 2 checkpost: -> @@ -95,12 +107,13 @@ ThreadUpdater = else -> not d.hidden autoUpdate: -> - if Conf['Auto Update This'] and ThreadUpdater.online + if ThreadUpdater.online ThreadUpdater.timeoutID = setTimeout ThreadUpdater.timeout, 1000 else clearTimeout ThreadUpdater.timeoutID interval: -> - val = parseInt @value, 10 + val = +@value + if val < 1 then val = 1 ThreadUpdater.interval = @value = val $.cb.value.call @ load: -> @@ -110,7 +123,8 @@ ThreadUpdater = g.DEAD = false ThreadUpdater.parse JSON.parse(req.response).posts ThreadUpdater.lastModified = req.getResponseHeader 'Last-Modified' - ThreadUpdater.set 'timer', ThreadUpdater.getInterval() + if Conf['Auto Update'] + ThreadUpdater.set 'timer', ThreadUpdater.getInterval() when 404 g.DEAD = true ThreadUpdater.set 'timer', null @@ -121,8 +135,9 @@ ThreadUpdater = 404: true thread: ThreadUpdater.thread else - ThreadUpdater.outdateCount++ - ThreadUpdater.set 'timer', ThreadUpdater.getInterval() + if Conf['Auto Update'] + ThreadUpdater.outdateCount++ + ThreadUpdater.set 'timer', ThreadUpdater.getInterval() ### Status Code 304: Not modified By sending the `If-Modified-Since` header we get a proper status code, and no response. @@ -152,6 +167,11 @@ ThreadUpdater = else i + intervalShortcut: -> + Settings.open 'Advanced' + settings = $.id 'fourchanx-settings' + $('input[name=Interval]', settings).focus() + set: (name, text, klass) -> el = ThreadUpdater[name] if node = el.firstChild @@ -175,7 +195,10 @@ ThreadUpdater = update: -> return unless ThreadUpdater.online ThreadUpdater.seconds = 0 - ThreadUpdater.set 'timer', '...' + if Conf['Auto Update'] + ThreadUpdater.set 'timer', '...' + else + ThreadUpdater.set 'timer', 'Update' if ThreadUpdater.req # abort() triggers onloadend, we don't want that. ThreadUpdater.req.onloadend = null @@ -271,7 +294,7 @@ ThreadUpdater = scroll = Conf['Auto Scroll'] and ThreadUpdater.scrollBG() and ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25 - + for key, post of posts continue unless posts.hasOwnProperty key if post.cb @@ -299,4 +322,4 @@ ThreadUpdater = deletedPosts: deletedPosts deletedFiles: deletedFiles postCount: OP.replies + 1 - fileCount: OP.images + (!!ThreadUpdater.thread.OP.file and !ThreadUpdater.thread.OP.file.isDead) \ No newline at end of file + fileCount: OP.images + (!!ThreadUpdater.thread.OP.file and !ThreadUpdater.thread.OP.file.isDead) diff --git a/src/features/monitoring/threadwatcher.coffee b/src/Monitoring/ThreadWatcher.coffee similarity index 96% rename from src/features/monitoring/threadwatcher.coffee rename to src/Monitoring/ThreadWatcher.coffee index b7bf6a2fb..e4cf75da0 100644 --- a/src/features/monitoring/threadwatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -1,6 +1,6 @@ ThreadWatcher = init: -> - return if g.VIEW is 'catalog' or !Conf['Thread Watcher'] + return unless Conf['Thread Watcher'] @dialog = UI.dialog 'watcher', 'top: 50px; left: 0px;', '
Thread Watcher
' diff --git a/src/features/monitoring/unread.coffee b/src/Monitoring/Unread.coffee similarity index 82% rename from src/features/monitoring/unread.coffee rename to src/Monitoring/Unread.coffee index 8ff735c2a..46a42a9d1 100644 --- a/src/features/monitoring/unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -15,32 +15,39 @@ Unread = node: -> Unread.thread = @ Unread.title = d.title - posts = [] - for ID, post of @posts - posts.push post if post.isReply Unread.lastReadPost = Unread.db.get boardID: @board.ID threadID: @ID defaultValue: 0 - Unread.addPosts posts + $.on d, '4chanXInitFinished', Unread.ready $.on d, 'ThreadUpdate', Unread.onUpdate $.on d, 'scroll visibilitychange', Unread.read - $.on d, 'visibilitychange', Unread.setLine if Conf['Unread Line'] - return unless Conf['Scroll to Last Read Post'] + ready: -> + $.off d, '4chanXInitFinished', Unread.ready + posts = [] + for ID, post of Unread.thread.posts + posts.push post if post.isReply + Unread.addPosts posts + Unread.setLine() if Conf['Unread Line'] + Unread.scroll() if Conf['Scroll to Last Read Post'] - $.on window, 'load', -> - # Let the header's onload callback handle it. - return if (hash = location.hash.match /\d+/) and hash[0] of @posts - if Unread.posts.length - # Scroll to before the first unread post. - while root = $.x 'preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root - break unless (Get.postFromRoot root).isHidden - return unless root - root.scrollIntoView false - else if posts.length - # Scroll to the last read post. - Header.scrollToPost (posts[posts.length - 1]).nodes.root + scroll: -> + # Let the header's onload callback handle it. + return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts + if Unread.posts.length + # Scroll to before the first unread post. + prevID = 0 + while root = $.x 'preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root + post = Get.postFromRoot root + break if prevID is post.ID + prevID = post.ID + break unless post.isHidden + root.scrollIntoView false + return + # Scroll to the last read post. + posts = Object.keys Unread.thread.posts + Header.scrollToPost Unread.thread.posts[posts[posts.length - 1]].nodes.root sync: -> lastReadPost = Unread.db.get @@ -176,4 +183,4 @@ Unread = # `favicon.href = href` isn't enough on Opera. # Opera won't always update the favicon if the href didn't change. $.add d.head, Favicon.el - <% } %> \ No newline at end of file + <% } %> diff --git a/src/features/posting/qr.coffee b/src/Posting/QuickReply.coffee similarity index 94% rename from src/features/posting/qr.coffee rename to src/Posting/QuickReply.coffee index 3fcb371d4..c50e42fe4 100644 --- a/src/features/posting/qr.coffee +++ b/src/Posting/QuickReply.coffee @@ -23,14 +23,14 @@ QR = if Conf['Hide Original Post Form'] $.asap (-> doc), -> $.addClass doc, 'hide-original-post-form' - $.on d, '4chanXInitFinished', @initReady + $.ready @initReady + $.on d, '4chanXInitFinished', @persist if Conf['Persistent QR'] Post::callbacks.push name: 'Quick Reply' cb: @node initReady: -> - $.off d, '4chanXInitFinished', QR.initReady QR.postingIsEnabled = !!$.id 'postForm' return unless QR.postingIsEnabled @@ -51,14 +51,13 @@ QR = else QR.status() - QR.persist() if Conf['Persistent QR'] node: -> $.on $('a[title="Quote this post"]', @nodes.info), 'click', QR.quote persist: -> QR.open() - QR.hide() if Conf['Auto-Hide QR'] + QR.hide() if Conf['Auto Hide QR'] open: -> if QR.nodes @@ -255,7 +254,7 @@ QR = elapsed = Math.floor (now - start) / $.SECOND if elapsed >= 0 # clock changed since then? seconds = Math.max seconds, types[type] - elapsed - if hasFile and upSpd + if Conf['Cooldown Prediction'] and hasFile and upSpd seconds -= Math.floor post.file.size / upSpd * upSpdAccuracy seconds = Math.max seconds, 0 unless start <= now <= cooldown.timeout @@ -776,44 +775,8 @@ QR = dialog: -> dialog = UI.dialog 'qr', 'top:0;right:0;', """ -
- Post Form - × -
-
-
- - - - -
-
- - -
-
-
- + -
-
- - No selected file - - × - - -
- -
- -
- -
- """.replace />\s+<' # get rid of spaces between elements + <%= grunt.file.read('src/General/html/Features/QuickReply.html').replace(/>\s+<').trim() %> + """ QR.nodes = nodes = el: dialog @@ -988,7 +951,7 @@ QR = # Enable auto-posting if we have stuff to post, disable it otherwise. QR.cooldown.auto = QR.posts.length > 1 - if Conf['Auto-Hide QR'] and !QR.cooldown.auto + if Conf['Auto Hide QR'] and !QR.cooldown.auto QR.hide() if !QR.cooldown.auto and $.x 'ancestor::div[@id="qr"]', d.activeElement # Unfocus the focused element if it is one within the QR and we're not auto-posting. @@ -1021,7 +984,10 @@ QR = QR.cooldown.auto = false QR.status() QR.error $.el 'span', - innerHTML: 'Connection error. You may have been banned.' + innerHTML: """ + Connection error. You may have been banned. + [FAQ] + """ opts = cred: true form: $.formData postData diff --git a/src/features/quoting/quotebacklinks.coffee b/src/Quotelinks/QuoteBacklink.coffee similarity index 100% rename from src/features/quoting/quotebacklinks.coffee rename to src/Quotelinks/QuoteBacklink.coffee diff --git a/src/features/quoting/quotecrossthread.coffee b/src/Quotelinks/QuoteCT.coffee similarity index 100% rename from src/features/quoting/quotecrossthread.coffee rename to src/Quotelinks/QuoteCT.coffee diff --git a/src/features/quoting/quoteinline.coffee b/src/Quotelinks/QuoteInline.coffee similarity index 100% rename from src/features/quoting/quoteinline.coffee rename to src/Quotelinks/QuoteInline.coffee diff --git a/src/features/quoting/quoteop.coffee b/src/Quotelinks/QuoteOP.coffee similarity index 100% rename from src/features/quoting/quoteop.coffee rename to src/Quotelinks/QuoteOP.coffee diff --git a/src/features/quoting/quotepreview.coffee b/src/Quotelinks/QuotePreview.coffee similarity index 100% rename from src/features/quoting/quotepreview.coffee rename to src/Quotelinks/QuotePreview.coffee diff --git a/src/features/filtering/strikethrough.coffee b/src/Quotelinks/QuoteStrikeThrough.coffee similarity index 100% rename from src/features/filtering/strikethrough.coffee rename to src/Quotelinks/QuoteStrikeThrough.coffee diff --git a/src/features/quoting/quotethreading.coffee b/src/Quotelinks/QuoteThreading.coffee similarity index 100% rename from src/features/quoting/quotethreading.coffee rename to src/Quotelinks/QuoteThreading.coffee diff --git a/src/features/quoting/quoteyou.coffee b/src/Quotelinks/QuoteYou.coffee similarity index 79% rename from src/features/quoting/quoteyou.coffee rename to src/Quotelinks/QuoteYou.coffee index 36b7d06ff..923e61b18 100644 --- a/src/features/quoting/quoteyou.coffee +++ b/src/Quotelinks/QuoteYou.coffee @@ -10,6 +10,13 @@ QuoteYou = node: -> # Stop there if it's a clone. return if @isClone + + if @info.yours + $.addClass @nodes.root, 'yourPost' + + if Conf['Highlight Own Posts'] + $.addClass doc, 'highlight-own' + # Stop there if there's no quotes in that post. return unless (quotes = @quotes).length {quotelinks} = @nodes diff --git a/src/features/quoting/quotify.coffee b/src/Quotelinks/Quotify.coffee similarity index 100% rename from src/features/quoting/quotify.coffee rename to src/Quotelinks/Quotify.coffee diff --git a/src/features/theming/banner.coffee b/src/Theming/Banner.coffee similarity index 100% rename from src/features/theming/banner.coffee rename to src/Theming/Banner.coffee diff --git a/src/Theming/Emoji.coffee b/src/Theming/Emoji.coffee new file mode 100644 index 000000000..fd2b175f2 --- /dev/null +++ b/src/Theming/Emoji.coffee @@ -0,0 +1,69 @@ +Emoji = + init: -> + Emoji.icons['PlanNine'] = Emoji.icons['Plan9'] + Emoji.icons['Sage'] = Emoji.sage[Conf['sageEmoji']] + + css: (position) -> + _conf = Conf + css = [""" +a.useremail[href]:last-of-type::#{position} { + vertical-align: top; + margin-#{if position is "before" then "right" else "left"}: 5px; +}\n + """] + + for key, category of Emoji.icons + continue unless Emoji.icons.hasOwnProperty key + if (_conf['Emoji'] isnt "disable ponies" and key is "pony") or (_conf['Emoji'] isnt "only ponies" and key is "not") + for name, icon of category + continue unless category.hasOwnProperty name + name = icon[0] + css.push """ +a.useremail[href*='#{name}']:last-of-type::#{position}, +a.useremail[href*='#{name.toLowerCase()}']:last-of-type::#{position}, +a.useremail[href*='#{name.toUpperCase()}']:last-of-type::#{position} { + content: url('data:image/png;base64,#{icon}'); +}\n +""" + css.join "" + + sage: + '4chan SS': '<%= grunt.file.read("src/General/img/emoji/SS-sage.png", {encoding: "base64"}) %>' + 'appchan': '<%= grunt.file.read("src/General/img/emoji/appchan-sage.png", {encoding: "base64"}) %>' + + icons: + pony: + 'Pinkie': '<%= grunt.file.read("src/General/img/emoji/pinkie.png", {encoding: "base64"}) %>' + 'Applejack': '<%= grunt.file.read("src/General/img/emoji/applejack.png", {encoding: "base64"}) %>' + 'Fluttershy': '<%= grunt.file.read("src/General/img/emoji/fluttershy.png", {encoding: "base64"}) %>' + 'Twilight': '<%= grunt.file.read("src/General/img/emoji/twilight.png", {encoding: "base64"}) %>' + 'Rainbow': '<%= grunt.file.read("src/General/img/emoji/rainbow.png", {encoding: "base64"}) %>' + 'Rarity': '<%= grunt.file.read("src/General/img/emoji/rarity.png", {encoding: "base64"}) %>' + 'Spike': '<%= grunt.file.read("src/General/img/emoji/spike.png", {encoding: "base64"}) %>' + not: + 'Plan9': '<%= grunt.file.read("src/General/img/emoji/plan9.png", {encoding: "base64"}) %>' + 'Neko': '<%= grunt.file.read("src/General/img/emoji/neko.png", {encoding: "base64"}) %>' + 'Madotsuki': '<%= grunt.file.read("src/General/img/emoji/madotsuki.png", {encoding: "base64"}) %>' + 'Sega': '<%= grunt.file.read("src/General/img/emoji/sega.png", {encoding: "base64"}) %>' + 'Sakamoto': '<%= grunt.file.read("src/General/img/emoji/sakamoto.png", {encoding: "base64"}) %>' + 'Baka': '<%= grunt.file.read("src/General/img/emoji/baka.png", {encoding: "base64"}) %>' + 'Ponyo': '<%= grunt.file.read("src/General/img/emoji/ponyo.png", {encoding: "base64"}) %>' + 'Rabite': '<%= grunt.file.read("src/General/img/emoji/rabite.png", {encoding: "base64"}) %>' + 'Arch': '<%= grunt.file.read("src/General/img/emoji/arch.png", {encoding: "base64"}) %>' + 'CentOS': '<%= grunt.file.read("src/General/img/emoji/centos.png", {encoding: "base64"}) %>' + 'Debian': '<%= grunt.file.read("src/General/img/emoji/debian.png", {encoding: "base64"}) %>' + 'Fedora': '<%= grunt.file.read("src/General/img/emoji/fedora.png", {encoding: "base64"}) %>' + 'FreeBSD': '<%= grunt.file.read("src/General/img/emoji/freebsd.png", {encoding: "base64"}) %>' + 'Gentoo': '<%= grunt.file.read("src/General/img/emoji/gentoo.png", {encoding: "base64"}) %>' + 'Mint': '<%= grunt.file.read("src/General/img/emoji/mint.png", {encoding: "base64"}) %>' + 'Osx': '<%= grunt.file.read("src/General/img/emoji/osx.png", {encoding: "base64"}) %>' + 'Rhel': '<%= grunt.file.read("src/General/img/emoji/rhel.png", {encoding: "base64"}) %>' + 'Sabayon': '<%= grunt.file.read("src/General/img/emoji/sabayon.png", {encoding: "base64"}) %>' + 'Slackware': '<%= grunt.file.read("src/General/img/emoji/slackware.png", {encoding: "base64"}) %>' + 'Trisquel': '<%= grunt.file.read("src/General/img/emoji/trisquel.png", {encoding: "base64"}) %>' + 'Ubuntu': '<%= grunt.file.read("src/General/img/emoji/ubuntu.png", {encoding: "base64"}) %>' + 'Windows': '<%= grunt.file.read("src/General/img/emoji/windows.png", {encoding: "base64"}) %>' + 'OpenBSD': '<%= grunt.file.read("src/General/img/emoji/openbsd.png", {encoding: "base64"}) %>' + 'Gnu': '<%= grunt.file.read("src/General/img/emoji/gnu.png", {encoding: "base64"}) %>' + 'CrunchBang': '<%= grunt.file.read("src/General/img/emoji/crunchbang.png", {encoding: "base64"}) %>' + 'Yuno': '<%= grunt.file.read("src/General/img/emoji/yuno.png", {encoding: "base64"}) %>' \ No newline at end of file diff --git a/src/features/theming/globalmessage.coffee b/src/Theming/GlobalMessage.coffee similarity index 100% rename from src/features/theming/globalmessage.coffee rename to src/Theming/GlobalMessage.coffee diff --git a/src/features/theming/jscolor.coffee b/src/Theming/JSColor.coffee similarity index 99% rename from src/features/theming/jscolor.coffee rename to src/Theming/JSColor.coffee index 5ca0a70ac..ee460bf66 100644 --- a/src/features/theming/jscolor.coffee +++ b/src/Theming/JSColor.coffee @@ -9,7 +9,7 @@ JSColor = css: -> agent = Style.agent - """<%= grunt.file.read('src/css/jscolor.css') %>""" + """<%= grunt.file.read('src/General/css/jscolor.css') %>""" bind: (el) -> el.color = new JSColor.color(el) if not el.color diff --git a/src/features/theming/mascots.coffee b/src/Theming/Mascots.coffee similarity index 98% rename from src/features/theming/mascots.coffee rename to src/Theming/Mascots.coffee index 87e75898d..2723c5e26 100644 --- a/src/features/theming/mascots.coffee +++ b/src/Theming/Mascots.coffee @@ -8,7 +8,7 @@ MascotTools = return if el then el.src = "" else null position = "#{if Conf['Mascot Position'] is 'bottom' or (Conf['Mascot Position'] is "default" and Conf['Post Form Style'] isnt "fixed") - 0 + (if (g.VIEW isnt 'thread' or Conf['Boards Navigation'] is 'Sticky bottom') and Conf['4chan SS Navigation'] then 1.6 else 0) + 0 + (if (g.VIEW isnt 'thread' or Conf['Bottom Header']) and Conf['4chan SS Navigation'] then 1.6 else 0) else 20.3 + (if g.VIEW isnt 'thread' or !!$ '#postForm input[name=spoiler]' then 1.4 else 0) + (if Conf['Show Post Form Header'] then 1.5 else 0) + (if Conf['Post Form Decorations'] then 0.2 else 0) }em" diff --git a/src/features/theming/rice.coffee b/src/Theming/Rice.coffee similarity index 100% rename from src/features/theming/rice.coffee rename to src/Theming/Rice.coffee diff --git a/src/features/theming/style.coffee b/src/Theming/Style.coffee similarity index 88% rename from src/features/theming/style.coffee rename to src/Theming/Style.coffee index b205221cb..0d904de37 100644 --- a/src/features/theming/style.coffee +++ b/src/Theming/Style.coffee @@ -8,7 +8,7 @@ Style = # Give ExLinks and 4sight a little time to append their dialog links setTimeout (-> - Style.padding.nav = Header.nav + Style.padding.nav = Header.bar Style.padding.pages = $(".pagelist", d.body) Style.padding() $.on window, "resize", Style.padding @@ -185,7 +185,7 @@ Style = Style.replyMargin = _conf["Post Spacing"] - css = """<%= grunt.file.read('src/css/layout.css') %>""" + css = """<%= grunt.file.read('src/General/css/layout.css') %>""" theme: (theme) -> _conf = Conf @@ -197,14 +197,14 @@ Style = icons = "data:image/png;base64,#{Icons[_conf["Icons"]]}" - css = """<%= grunt.file.read('src/css/theme.css') %>""" + css = """<%= grunt.file.read('src/General/css/theme.css') %>""" - <%= grunt.file.read('src/css/themeoptions.css') %> + <%= grunt.file.read('src/General/css/themeoptions.css') %> css iconPositions: -> - css = """<%= grunt.file.read('src/css/icons.base.css') %>""" + css = """<%= grunt.file.read('src/General/css/icons.base.css') %>""" i = 0 align = Style.sidebarLocation[0] @@ -256,10 +256,8 @@ Style = Style.sidebar + parseInt(_conf["Right Thread Padding"], 10)) if iconOffset < 0 then iconOffset = 0 - css += """<%= grunt.file.read('src/css/icons.horz.css') %>""" + css += """<%= grunt.file.read('src/General/css/icons.horz.css') %>""" - if _conf["Updater Position"] isnt 'moveable' - css += """<%= grunt.file.read('src/css/icons.horz.tu.css') %>""" else position = aligner( @@ -298,26 +296,22 @@ Style = Style.sidebar + parseInt _conf[align.capitalize() + " Thread Padding"], 10 ) - css += """<%= grunt.file.read('src/css/icons.vert.css') %>""" - - if _conf["Updater Position"] isnt 'moveable' - css += """<%= grunt.file.read('src/css/icons.vert.tu.css') %>""" + css += """<%= grunt.file.read('src/General/css/icons.vert.css') %>""" Style.icons.textContent = css padding: -> - return unless sheet = Style.paddingSheet + return unless (sheet = Style.paddingSheet) and Style.padding.nav _conf = Conf - Style.padding.nav.property = _conf["Boards Navigation"].split(" ") - Style.padding.nav.property = Style.padding.nav.property[Style.padding.nav.property.length - 1] + Style.padding.nav.property = if _conf['Bottom Header'] then 'bottom' else 'top' if Style.padding.pages Style.padding.pages.property = _conf["Pagination"].split(" ") Style.padding.pages.property = Style.padding.pages.property[Style.padding.pages.property.length - 1] css = "body::before {\n" - if Style.padding.pages and (_conf["Pagination"] is "sticky top" or _conf["Pagination"] is "sticky bottom") + if Style.padding.pages and ["sticky top", "top", "sticky bottom"].contains _conf["Pagination"] css += " #{Style.padding.pages.property}: #{Style.padding.pages.offsetHeight}px !important;\n" - if _conf["Boards Navigation"] is "Sticky top" or _conf["Boards Navigation"] is "Sticky bottom" + if _conf['Fixed Header'] css += " #{Style.padding.nav.property}: #{Style.padding.nav.offsetHeight}px !important;\n" css += """ @@ -326,15 +320,15 @@ body { padding-bottom: 0;\n """ - if Style.padding.pages? and (_conf["Pagination"] is "sticky top" or _conf["Pagination"] is "sticky bottom" or _conf["Pagination"] is "top") + if Style.padding.pages? and ["sticky top", "top", "sticky bottom"].contains _conf["Pagination"] css += " padding-#{Style.padding.pages.property}: #{Style.padding.pages.offsetHeight}px;\n" - unless _conf["Boards Navigation"] is "Hide" + unless _conf['Header auto-hide'] or _conf['Hide Header'] css += " padding-#{Style.padding.nav.property}: #{Style.padding.nav.offsetHeight}px;\n" css += "}" - sheet.textContent = css + sheet.textContent = css color: (hex) -> @hex = "#" + hex diff --git a/src/features/theming/themes.coffee b/src/Theming/Themes.coffee similarity index 98% rename from src/features/theming/themes.coffee rename to src/Theming/Themes.coffee index d6bc6ca7a..268756c57 100644 --- a/src/features/theming/themes.coffee +++ b/src/Theming/Themes.coffee @@ -304,7 +304,7 @@ ThemeTools = 'Inputs' : "rgb(#{textColor.rgb})" 'Warnings' : "rgb(#{sageColor.rgb})" 'Shadow Color' : "rgba(0,0,0,0.1)" - 'Custom CSS' : """<%= grunt.file.read('src/css/theme.oneechan.css') %> #{imported.customCSS or ''}""" + 'Custom CSS' : """<%= grunt.file.read('src/General/css/theme.oneechan.css') %> #{imported.customCSS or ''}""" else if origin == "SS" Themes[name] = @@ -356,7 +356,7 @@ ThemeTools = 'Inputs' : "rgb(#{textColor.rgb})" 'Warnings' : "rgb(#{sageColor.rgb})" 'Shadow Color' : "rgba(0,0,0,0.1)" - 'Custom CSS' : """<%= grunt.file.read('src/css/theme.4chanss.css') %> #{imported.customCSS or ''}""" + 'Custom CSS' : """<%= grunt.file.read('src/General/css/theme.4chanss.css') %> #{imported.customCSS or ''}""" else if origin == 'appchan' Themes[name] = imported diff --git a/src/css/icons.horz.tu.css b/src/css/icons.horz.tu.css deleted file mode 100644 index f537dbbfe..000000000 --- a/src/css/icons.horz.tu.css +++ /dev/null @@ -1,9 +0,0 @@ -/* Updater + Stats */ -#updater, -#thread-stats { - #{align}: #{if _conf["Updater Position"] is "bottom" and not _conf["Hide Delete UI"] then 23 else 2}px !important; - #{Style.sidebarLocation[1]}: auto !important; - top: auto !important; - bottom: auto !important; - #{if _conf["Updater Position"] is 'top' then "top: 16px !important" else "bottom: 0 !important"}; -} \ No newline at end of file diff --git a/src/css/icons.vert.tu.css b/src/css/icons.vert.tu.css deleted file mode 100644 index 261828fb8..000000000 --- a/src/css/icons.vert.tu.css +++ /dev/null @@ -1,8 +0,0 @@ -/* Updater + Stats */ -#updater, -#thread-stats { - #{align}: #{if _conf["Updater Position"] is "top" or not _conf["Hide Delete UI"] then 23 else 2}px !important; - #{Style.sidebarLocation[1]}: auto !important; - top: #{if _conf["Updater Position"] == "top" then "-1px" else "auto"} !important; - bottom: #{if _conf["Updater Position"] == "bottom" then "-2px" else "auto"} !important; -} \ No newline at end of file diff --git a/src/features/misc/announcementhiding.coffee b/src/features/misc/announcementhiding.coffee deleted file mode 100644 index 3ffdc8214..000000000 --- a/src/features/misc/announcementhiding.coffee +++ /dev/null @@ -1,43 +0,0 @@ -PSAHiding = - init: -> - return unless Conf['Announcement Hiding'] - - $.on d, '4chanXInitFinished', @setup - - setup: -> - $.off d, '4chanXInitFinished', PSAHiding.setup - - unless psa = $.id 'globalMessage' - return - - PSAHiding.btn = btn = $.el 'a', - title: 'Toggle announcement.' - innerHTML: '' - href: 'javascript:;' - textContent: '[ - ]' - $.on btn, 'click', PSAHiding.toggle - - $.prepend psa, btn - - text = PSAHiding.trim psa - $.get 'hiddenPSAs', [], (item) -> - PSAHiding.sync item['hiddenPSAs'] - - toggle: (e) -> - text = PSAHiding.trim $.id 'globalMessage' - $.get 'hiddenPSAs', [], (item) -> - {hiddenPSAs} = item - hiddenPSAs.push text - hiddenPSAs = hiddenPSAs[-5..] - PSAHiding.sync hiddenPSAs - $.set 'hiddenPSAs', hiddenPSAs - - sync: (hiddenPSAs) -> - {btn} = PSAHiding - psa = $.id 'globalMessage' - if hiddenPSAs.contains PSAHiding.trim psa - $.rm psa - do Style.iconPositions - - trim: (psa) -> - psa.textContent.replace(/\W+/g, '').toLowerCase() \ No newline at end of file diff --git a/src/features/misc/header.coffee b/src/features/misc/header.coffee deleted file mode 100644 index 37705ba56..000000000 --- a/src/features/misc/header.coffee +++ /dev/null @@ -1,237 +0,0 @@ -Header = - init: -> - @menuButton = $.el 'span', - className: 'menu-button' - id: 'main-menu' - - @menu = new UI.Menu 'header' - - headerToggler = $.el 'label', - innerHTML: ' Auto-hide header' - - @headerToggler = headerToggler.firstElementChild - - $.on @menuButton, 'click', @menuToggle - $.on window, 'load hashchange', Header.hashScroll - $.on @headerToggler, 'change', @toggleBarVisibility - - {createSubEntry} = Header - subEntries = [] - for setting in ['Sticky top', 'Sticky bottom', 'Top', 'Hide'] - subEntries.push createSubEntry setting - - subEntries.push {el: headerToggler} - - $.event 'AddMenuEntry', - type: 'header' - el: $.el 'span', - textContent: 'Header' - order: 105 - subEntries: subEntries - - $.on d, 'CreateNotification', @createNotification - - $.asap (-> d.body), -> - return unless Main.isThisPageLegit() - # Wait for #boardNavMobile instead of #boardNavDesktop, - # it might be incomplete otherwise. - $.asap (-> $.id 'boardNavMobile'), Header.setBoardList - - $.ready -> - $.add d.body, Header.hover - - bar: $.el 'div', - id: 'notifications' - - shortcuts: $.el 'span', - id: 'shortcuts' - - hover: $.el 'div', - id: 'hoverUI' - - toggle: $.el 'div', - id: 'scroll-marker' - - createSubEntry: (setting) -> - label = $.el 'label', - textContent: "#{setting}" - - $.on label, 'click', Header.setBarPosition - - el: label - - setBoardList: -> - Header.nav = nav = $.id 'boardNavDesktop' - nav.id = 'header-bar' - if a = $ "a[href*='/#{g.BOARD}/']", nav - a.className = 'current' - - boardList = $.el 'span', - id: 'board-list' - - $.add boardList, fullBoardList = $.el 'span', - id: 'full-board-list' - - Header.setBarPosition.call textContent: "#{Conf['Boards Navigation']}" - $.sync 'Boards Navigation', Header.changeBarPosition - - Header.setBarVisibility Conf['Header auto-hide'] - $.sync 'Header auto-hide', Header.setBarVisibility - - $.prepend d.body, settings = $.id 'navtopright' - $.add settings, Header.menuButton - - $.add fullBoardList, [nav.childNodes...] - $.add nav, [boardList, Header.shortcuts, Header.bar, Header.toggle] - - if Conf['Custom Board Navigation'] - fullBoardList.hidden = true - customBoardList = $.el 'span', - id: 'custom-board-list' - $.add boardList, customBoardList - - Header.generateBoardList Conf['boardnav'] - $.sync 'boardnav', Header.generateBoardList - - btn = $.el 'span', - className: 'hide-board-list-button' - innerHTML: '[ - ]\u00A0' - $.on btn, 'click', Header.toggleBoardList - - $.prepend fullBoardList, btn - - else - fullBoardList.hidden = false - - generateBoardList: (text) -> - list = $ '#custom-board-list', Header.nav - $.rmAll list - return unless text - as = $$('#full-board-list a', Header.nav)[0...-2] # ignore the Settings and Home links - nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map (t) -> - if /^[^\w@]/.test t - return $.tn t - if /^toggle-all/.test t - a = $.el 'a', - className: 'show-board-list-button' - textContent: (t.match(/-text:"(.+)"/) || [null, '+'])[1] - href: 'javascript:;' - $.on a, 'click', Header.toggleBoardList - return a - board = if /^current/.test t - g.BOARD.ID - else - t.match(/^[^-]+/)[0] - for a in as - if a.textContent is board - a = a.cloneNode true - if /-title/.test t - a.textContent = a.title - else if /-replace/.test t - if $.hasClass a, 'current' - a.textContent = a.title - else if /-full/.test t - a.textContent = "/#{board}/ - #{a.title}" - else if /-(index|catalog|text)/.test t - if m = t.match /-(index|catalog)/ - a.setAttribute 'data-only', m[1] - a.href = "//boards.4chan.org/#{board}/" - a.href += 'catalog' if m[1] is 'catalog' - if m = t.match /-text:"(.+)"/ - a.textContent = m[1] - else if board is '@' - $.addClass a, 'navSmall' - return a - $.tn t - $.add list, nodes - - toggleBoardList: -> - {nav} = Header - custom = $ '#custom-board-list', nav - full = $ '#full-board-list', nav - showBoardList = !full.hidden - custom.hidden = !showBoardList - full.hidden = showBoardList - - setBarPosition: -> - $.event 'CloseMenu' - - Header.changeBarPosition @textContent - - Conf['Boards Navigation'] = @textContent - $.set 'Boards Navigation', @textContent - - changeBarPosition: (setting) -> - $.rmClass doc, 'top' - $.rmClass doc, 'fixed' - $.rmClass doc, 'bottom' - $.rmClass doc, 'hide' - switch setting - when 'Sticky top' - $.addClass doc, 'top' - $.addClass doc, 'fixed' - when 'Sticky bottom' - $.addClass doc, 'fixed' - $.addClass doc, 'bottom' - when 'Top' - $.addClass doc, 'top' - when 'Hide' - $.addClass doc, 'hide' - - setBarVisibility: (hide) -> - Header.headerToggler.checked = hide - $.event 'CloseMenu' - (if hide then $.addClass else $.rmClass) Header.nav, 'autohide' - - hashScroll: -> - return unless post = @location.hash[1..] - return if (Get.postFromRoot post).isHidden - Header.scrollToPost post - - scrollToPost: (post) -> - {top} = post.getBoundingClientRect() - if Conf['Boards Navigation'] is 'sticky top' - headRect = Header.bar.getBoundingClientRect() - top += - headRect.top - headRect.height - <% if (type === 'crx') { %>d.body<% } else { %>doc<% } %>.scrollTop += top - - toggleBarVisibility: (e) -> - return if e.type is 'mousedown' and e.button isnt 0 # not LMB - hide = if @nodeName is 'INPUT' - @checked - else - !$.hasClass Header.bar, 'autohide' - Conf['Header auto-hide'] = hide - $.set 'Header auto-hide', hide - Header.setBarVisibility hide - message = if hide - 'The header bar will automatically hide itself.' - else - 'The header bar will remain visible.' - new Notification 'info', message, 2 - - hashScroll: -> - return unless (hash = @location.hash) and post = $.id hash[1..] - return if (Get.postFromRoot post).isHidden - Header.scrollToPost post - - scrollToPost: (post) -> - {top} = post.getBoundingClientRect() - if Conf['Boards Navigation'] is 'Sticky top' - headRect = Header.bar.getBoundingClientRect() - top += - headRect.top - headRect.height - <% if (type === 'crx') { %>d.body<% } else { %>doc<% } %>.scrollTop += top - - addShortcut: (el) -> - shortcut = $.el 'span', - className: 'shortcut' - $.add shortcut, [$.tn(' ['), el, $.tn(']')] - $.prepend Header.shortcuts, shortcut - - menuToggle: (e) -> - Header.menu.toggle e, @, g - - createNotification: (e) -> - {type, content, lifetime, cb} = e.detail - notif = new Notification type, content, lifetime - cb notif if cb \ No newline at end of file diff --git a/src/features/monitoring/favicon.coffee b/src/features/monitoring/favicon.coffee deleted file mode 100644 index c526ea6c4..000000000 --- a/src/features/monitoring/favicon.coffee +++ /dev/null @@ -1,50 +0,0 @@ -Favicon = - init: -> - $.ready -> - Favicon.el = $ 'link[rel="shortcut icon"]', d.head - Favicon.el.type = 'image/x-icon' - {href} = Favicon.el - Favicon.SFW = /ws\.ico$/.test href - Favicon.default = href - Favicon.switch() - - switch: -> - unreadDead = Favicon.unreadDeadY = Favicon.unreadSFW = Favicon.unreadSFWY = Favicon.unreadNSFW = Favicon.unreadNSFWY = 'data:image/png;base64,' - switch Conf['favicon'] - when 'ferongr' - Favicon.unreadDead += '<%= grunt.file.read("src/img/favicons/ferongr/unreadDead.png", {encoding: "base64"}) %>' - Favicon.unreadDeadY += '<%= grunt.file.read("src/img/favicons/ferongr/unreadDeadY.png", {encoding: "base64"}) %>' - Favicon.unreadSFW += '<%= grunt.file.read("src/img/favicons/ferongr/unreadSFW.png", {encoding: "base64"}) %>' - Favicon.unreadSFWY += '<%= grunt.file.read("src/img/favicons/ferongr/unreadSFWY.png", {encoding: "base64"}) %>' - Favicon.unreadNSFW += '<%= grunt.file.read("src/img/favicons/ferongr/unreadNSFW.png", {encoding: "base64"}) %>' - Favicon.unreadNSFWY += '<%= grunt.file.read("src/img/favicons/ferongr/unreadNSFWY.png", {encoding: "base64"}) %>' - when 'xat-' - Favicon.unreadDead += '<%= grunt.file.read("src/img/favicons/xat-/unreadDead.png", {encoding: "base64"}) %>' - Favicon.unreadDeadY += '<%= grunt.file.read("src/img/favicons/xat-/unreadDeadY.png", {encoding: "base64"}) %>' - Favicon.unreadSFW += '<%= grunt.file.read("src/img/favicons/xat-/unreadSFW.png", {encoding: "base64"}) %>' - Favicon.unreadSFWY += '<%= grunt.file.read("src/img/favicons/xat-/unreadSFWY.png", {encoding: "base64"}) %>' - Favicon.unreadNSFW += '<%= grunt.file.read("src/img/favicons/xat-/unreadNSFW.png", {encoding: "base64"}) %>' - Favicon.unreadNSFWY += '<%= grunt.file.read("src/img/favicons/xat-/unreadNSFWY.png", {encoding: "base64"}) %>' - when 'Mayhem' - Favicon.unreadDead += '<%= grunt.file.read("src/img/favicons/Mayhem/unreadDead.png", {encoding: "base64"}) %>' - Favicon.unreadDeadY += '<%= grunt.file.read("src/img/favicons/Mayhem/unreadDeadY.png", {encoding: "base64"}) %>' - Favicon.unreadSFW += '<%= grunt.file.read("src/img/favicons/Mayhem/unreadSFW.png", {encoding: "base64"}) %>' - Favicon.unreadSFWY += '<%= grunt.file.read("src/img/favicons/Mayhem/unreadSFWY.png", {encoding: "base64"}) %>' - Favicon.unreadNSFW += '<%= grunt.file.read("src/img/favicons/Mayhem/unreadNSFW.png", {encoding: "base64"}) %>' - Favicon.unreadNSFWY += '<%= grunt.file.read("src/img/favicons/Mayhem/unreadNSFWY.png", {encoding: "base64"}) %>' - when 'Original' - Favicon.unreadDead += '<%= grunt.file.read("src/img/favicons/Original/unreadDead.png", {encoding: "base64"}) %>' - Favicon.unreadDeadY += '<%= grunt.file.read("src/img/favicons/Original/unreadDeadY.png", {encoding: "base64"}) %>' - Favicon.unreadSFW += '<%= grunt.file.read("src/img/favicons/Original/unreadSFW.png", {encoding: "base64"}) %>' - Favicon.unreadSFWY += '<%= grunt.file.read("src/img/favicons/Original/unreadSFWY.png", {encoding: "base64"}) %>' - Favicon.unreadNSFW += '<%= grunt.file.read("src/img/favicons/Original/unreadNSFW.png", {encoding: "base64"}) %>' - Favicon.unreadNSFWY += '<%= grunt.file.read("src/img/favicons/Original/unreadNSFWY.png", {encoding: "base64"}) %>' - if Favicon.SFW - Favicon.unread = Favicon.unreadSFW - Favicon.unreadY = Favicon.unreadSFWY - else - Favicon.unread = Favicon.unreadNSFW - Favicon.unreadY = Favicon.unreadNSFWY - - empty: 'data:image/png;base64,<%= grunt.file.read("src/img/favicons/empty.png", {encoding: "base64"}) %>' - dead: 'data:image/png;base64,<%= grunt.file.read("src/img/favicons/dead.png", {encoding: "base64"}) %>' \ No newline at end of file diff --git a/src/features/theming/emoji.coffee b/src/features/theming/emoji.coffee deleted file mode 100644 index 88a62b4e3..000000000 --- a/src/features/theming/emoji.coffee +++ /dev/null @@ -1,62 +0,0 @@ -Emoji = - init: -> - Emoji.icons.not.push ['PlanNine', Emoji.icons.not[0][1]] - - css: (position) -> - _conf = Conf - css = [] - margin = "margin-#{if position is "before" then "right" else "left"}: #{parseInt _conf['Emoji Spacing']}px;" - - for key, category of Emoji.icons - if (_conf['Emoji'] isnt "disable ponies" and key is "pony") or (_conf['Emoji'] isnt "only ponies" and key is "not") - for icon in category - name = icon[0] - css[css.length] = """ -a.useremail[href*='#{name}']:last-of-type::#{position}, -a.useremail[href*='#{name.toLowerCase()}']:last-of-type::#{position}, -a.useremail[href*='#{name.toUpperCase()}']:last-of-type::#{position} { - content: url('data:image/png;base64,#{icon[1]}'); - vertical-align: top; - #{margin} -}\n -""" - css.join "" - - icons: - pony: [ - ['Pinkie', '<%= grunt.file.read("src/img/emoji/pinkie.png", {encoding: "base64"}) %>'] - ['Applejack', '<%= grunt.file.read("src/img/emoji/applejack.png", {encoding: "base64"}) %>'] - ['Fluttershy', '<%= grunt.file.read("src/img/emoji/fluttershy.png", {encoding: "base64"}) %>'] - ['Twilight', '<%= grunt.file.read("src/img/emoji/twilight.png", {encoding: "base64"}) %>'] - ['Rainbow', '<%= grunt.file.read("src/img/emoji/rainbow.png", {encoding: "base64"}) %>'] - ['Rarity', '<%= grunt.file.read("src/img/emoji/rarity.png", {encoding: "base64"}) %>'] - ['Spike', '<%= grunt.file.read("src/img/emoji/spike.png", {encoding: "base64"}) %>'] - ] - not: [ - ['Plan9', '<%= grunt.file.read("src/img/emoji/plan9.png", {encoding: "base64"}) %>'] - ['Neko', '<%= grunt.file.read("src/img/emoji/neko.png", {encoding: "base64"}) %>'] - ['Madotsuki', '<%= grunt.file.read("src/img/emoji/madotsuki.png", {encoding: "base64"}) %>'] - ['Sega', '<%= grunt.file.read("src/img/emoji/sega.png", {encoding: "base64"}) %>'] - ['Sakamoto', '<%= grunt.file.read("src/img/emoji/sakamoto.png", {encoding: "base64"}) %>'] - ['Baka', '<%= grunt.file.read("src/img/emoji/baka.png", {encoding: "base64"}) %>'] - ['Ponyo', '<%= grunt.file.read("src/img/emoji/ponyo.png", {encoding: "base64"}) %>'] - ['Rabite', '<%= grunt.file.read("src/img/emoji/rabite.png", {encoding: "base64"}) %>'] - ['Arch', '<%= grunt.file.read("src/img/emoji/arch.png", {encoding: "base64"}) %>'] - ['CentOS', '<%= grunt.file.read("src/img/emoji/centos.png", {encoding: "base64"}) %>'] - ['Debian', '<%= grunt.file.read("src/img/emoji/debian.png", {encoding: "base64"}) %>'] - ['Fedora', '<%= grunt.file.read("src/img/emoji/fedora.png", {encoding: "base64"}) %>'] - ['FreeBSD', '<%= grunt.file.read("src/img/emoji/freebsd.png", {encoding: "base64"}) %>'] - ['Gentoo', '<%= grunt.file.read("src/img/emoji/gentoo.png", {encoding: "base64"}) %>'] - ['Mint', '<%= grunt.file.read("src/img/emoji/mint.png", {encoding: "base64"}) %>'] - ['Osx', '<%= grunt.file.read("src/img/emoji/osx.png", {encoding: "base64"}) %>'] - ['Rhel', '<%= grunt.file.read("src/img/emoji/rhel.png", {encoding: "base64"}) %>'] - ['Sabayon', '<%= grunt.file.read("src/img/emoji/sabayon.png", {encoding: "base64"}) %>'] - ['Slackware', '<%= grunt.file.read("src/img/emoji/slackware.png", {encoding: "base64"}) %>'] - ['Trisquel', '<%= grunt.file.read("src/img/emoji/trisquel.png", {encoding: "base64"}) %>'] - ['Ubuntu', '<%= grunt.file.read("src/img/emoji/ubuntu.png", {encoding: "base64"}) %>'] - ['Windows', '<%= grunt.file.read("src/img/emoji/windows.png", {encoding: "base64"}) %>'] - ['OpenBSD', '<%= grunt.file.read("src/img/emoji/openbsd.png", {encoding: "base64"}) %>'] - ['Gnu', '<%= grunt.file.read("src/img/emoji/gnu.png", {encoding: "base64"}) %>'] - ['CrunchBang', '<%= grunt.file.read("src/img/emoji/crunchbang.png", {encoding: "base64"}) %>'] - ['Yuno', '<%= grunt.file.read("src/img/emoji/yuno.png", {encoding: "base64"}) %>'] - ] \ No newline at end of file diff --git a/src/img/emoji/crunchbang.png b/src/img/emoji/crunchbang.png deleted file mode 100644 index f5cae1d67..000000000 Binary files a/src/img/emoji/crunchbang.png and /dev/null differ diff --git a/src/lib/$.coffee b/src/lib/$.coffee deleted file mode 100644 index bfefd49b5..000000000 --- a/src/lib/$.coffee +++ /dev/null @@ -1,380 +0,0 @@ -# loosely follows the jquery api: -# http://api.jquery.com/ -# not chainable -$ = (selector, root=d.body) -> - root.querySelector selector - -$.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))) - -$$ = (selector, root=d.body) -> - [root.querySelectorAll(selector)...] - -$.extend = (object, properties) -> - for key, val of properties - continue unless properties.hasOwnProperty key - object[key] = val - return - -# Various prototypes I've wanted or needed to add. -$.extend Array::, - add: (object, position) -> - keep = @slice position - @length = position - @push object - @pushArrays keep - - contains: (object) -> - @indexOf(object) > -1 - - indexOf: (object) -> - i = @length - while i-- - break if @[i] is object - return i - - pushArrays: -> - args = arguments - for arg in args - @push.apply @, arg - return - - remove: (object) -> - if (index = @indexOf object) > -1 - @splice index, 1 - else - false - -$.extend String::, - capitalize: -> - @charAt(0).toUpperCase() + @slice(1); - - contains: (string) -> - @indexOf(string) > -1 - -$.extend $, - id: (id) -> - d.getElementById id - ready: (fc) -> - if d.readyState in ['interactive', 'complete'] - $.queueTask fc - return - cb = -> - $.off d, 'DOMContentLoaded', cb - fc() - $.on d, 'DOMContentLoaded', cb - formData: (form) -> - if form instanceof HTMLFormElement - return new FormData form - fd = new FormData() - for key, val of form - continue unless val - # XXX GM bug - # if val instanceof Blob - if val.size and val.name - fd.append key, val, val.name - else - fd.append key, val - fd - ajax: (url, callbacks, opts={}) -> - {type, cred, headers, upCallbacks, form, sync} = opts - r = new XMLHttpRequest() - r.overrideMimeType 'text/html' - type or= form and 'post' or 'get' - r.open type, url, !sync - for key, val of headers - r.setRequestHeader key, val - $.extend r, callbacks - $.extend r.upload, upCallbacks - r.withCredentials = cred - r.send form - r - cache: do -> - reqs = {} - (url, cb) -> - if req = reqs[url] - if req.readyState is 4 - cb.call req - else - req.callbacks.push cb - return - rm = -> delete reqs[url] - req = $.ajax url, - onload: (e) -> - cb.call @, e for cb in @callbacks - delete @callbacks - onabort: rm - onerror: rm - req.callbacks = [cb] - reqs[url] = req - cb: - checked: -> - $.set @name, @checked - Conf[@name] = @checked - value: -> - $.set @name, @value.trim() - Conf[@name] = @value - asap: (test, cb) -> - if test() - cb() - else - setTimeout $.asap, 25, test, cb - addStyle: (css, id) -> - style = $.el 'style', - id: id - textContent: css - $.asap (-> d.head), -> - $.add d.head, style - style - x: (path, root) -> - root or= d.body - # XPathResult.ANY_UNORDERED_NODE_TYPE === 8 - d.evaluate(path, root, null, 8, null).singleNodeValue - X: (path, root) -> - root or= d.body - d.evaluate path, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null - addClass: (el, className) -> - el.classList.add className - rmClass: (el, className) -> - el.classList.remove className - toggleClass: (el, className) -> - el.classList.toggle className - hasClass: (el, className) -> - el.classList.contains className - rm: do -> - if 'remove' of Element.prototype - (el) -> el.remove() - else - (el) -> el.parentNode?.removeChild el - rmAll: (root) -> - # jsperf.com/emptify-element - while node = root.firstChild - # HTMLSelectElement.remove !== Element.remove - root.removeChild node - return - tn: (s) -> - d.createTextNode s - frag: -> - d.createDocumentFragment() - nodes: (nodes) -> - unless nodes instanceof Array - return nodes - frag = $.frag() - for node in nodes - frag.appendChild node - frag - add: (parent, el) -> - parent.appendChild $.nodes el - prepend: (parent, el) -> - parent.insertBefore $.nodes(el), parent.firstChild - after: (root, el) -> - root.parentNode.insertBefore $.nodes(el), root.nextSibling - before: (root, el) -> - root.parentNode.insertBefore $.nodes(el), root - replace: (root, el) -> - root.parentNode.replaceChild $.nodes(el), root - el: (tag, properties) -> - el = d.createElement tag - $.extend el, properties if properties - el - on: (el, events, handler) -> - for event in events.split ' ' - el.addEventListener event, handler, false - return - off: (el, events, handler) -> - for event in events.split ' ' - el.removeEventListener event, handler, false - return - event: (event, detail, root=d) -> - root.dispatchEvent new CustomEvent event, {bubbles: true, detail} - open: do -> - if GM_openInTab? - (URL) -> - # XXX fix GM opening file://// for protocol-less URLs. - a = $.el 'a', href: URL - GM_openInTab a.href - else - (URL) -> window.open URL, '_blank' - debounce: (wait, fn) -> - timeout = null - that = null - args = null - exec = -> - fn.apply that, args - timeout = null - -> - args = arguments - that = this - if timeout - # stop current reset - clearTimeout timeout - else - exec() - - # after wait, let next invocation execute immediately - timeout = setTimeout exec, wait - queueTask: do -> - # inspired by https://www.w3.org/Bugs/Public/show_bug.cgi?id=15007 - taskQueue = [] - execTask = -> - task = taskQueue.shift() - func = task[0] - args = Array::slice.call task, 1 - func.apply func, args - if window.MessageChannel - taskChannel = new MessageChannel() - taskChannel.port1.onmessage = execTask - -> - taskQueue.push arguments - taskChannel.port2.postMessage null - else # XXX Firefox - -> - taskQueue.push arguments - setTimeout execTask, 0 - globalEval: (code) -> - script = $.el 'script', - textContent: code - $.add (d.head or doc), script - $.rm script - bytesToString: (size) -> - unit = 0 # Bytes - while size >= 1024 - size /= 1024 - unit++ - # Remove trailing 0s. - size = - if unit > 1 - # Keep the size as a float if the size is greater than 2^20 B. - # Round to hundredth. - Math.round(size * 100) / 100 - else - # Round to an integer otherwise. - Math.round size - "#{size} #{['B', 'KB', 'MB', 'GB'][unit]}" - minmax: (value, min, max) -> - return ( - if value < min - min - else - if value > max - max - else - value - ) - syncing: {} - sync: do -> -<% if (type === 'crx') { %> - chrome.storage.onChanged.addListener (changes) -> - for key of changes - if cb = $.syncing[key] - cb changes[key].newValue - return - (key, cb) -> $.syncing[key] = cb -<% } else { %> - window.addEventListener 'storage', (e) -> - if cb = $.syncing[e.key] - cb JSON.parse e.newValue - , false - (key, cb) -> $.syncing[g.NAMESPACE + key] = cb -<% } %> - item: (key, val) -> - item = {} - item[key] = val - item -<% if (type === 'crx') { %> - # https://developer.chrome.com/extensions/storage.html - delete: (keys) -> - chrome.storage.sync.remove keys - get: (key, val, cb) -> - if typeof cb is 'function' - items = $.item key, val - else - items = key - cb = val - chrome.storage.sync.get items, cb - set: (key, val) -> - items = if typeof key is 'string' - $.item key, val - else - key - chrome.storage.sync.set items -<% } else if (type === 'userjs') { %> -do -> - # http://www.opera.com/docs/userjs/specs/#scriptstorage - # http://www.opera.com/docs/userjs/using/#securepages - # The scriptStorage object is available only during - # the main User JavaScript thread, being therefore - # accessible only in the main body of the user script. - # To access the storage object later, keep a reference - # to the object. - {scriptStorage} = opera - $.delete = (keys) -> - unless keys instanceof Array - keys = [keys] - for key in keys - key = g.NAMESPACE + key - localStorage.removeItem key - delete scriptStorage[key] - return - $.get = (key, val, cb) -> - if typeof cb is 'function' - items = $.item key, val - else - items = key - cb = val - $.queueTask -> - for key of items - if val = scriptStorage[g.NAMESPACE + key] - items[key] = JSON.parse val - cb items - $.set = do -> - set = (key, val) -> - key = g.NAMESPACE + key - val = JSON.stringify val - if key of $.syncing - # for `storage` events - localStorage.setItem key, val - scriptStorage[key] = val - (keys, val) -> - if typeof keys is 'string' - set keys, val - return - for key, val of keys - set key, val - return -<% } else { %> - # http://wiki.greasespot.net/Main_Page - delete: (keys) -> - unless keys instanceof Array - keys = [keys] - for key in keys - key = g.NAMESPACE + key - localStorage.removeItem key - GM_deleteValue key - return - get: (key, val, cb) -> - if typeof cb is 'function' - items = $.item key, val - else - items = key - cb = val - $.queueTask -> - for key of items - if val = GM_getValue g.NAMESPACE + key - items[key] = JSON.parse val - cb items - set: do -> - set = (key, val) -> - key = g.NAMESPACE + key - val = JSON.stringify val - if key of $.syncing - # for `storage` events - localStorage.setItem key, val - GM_setValue key, val - (keys, val) -> - if typeof keys is 'string' - set keys, val - return - for key, val of keys - set key, val - return -<% } %> diff --git a/src/lib/classes.coffee b/src/lib/classes.coffee deleted file mode 100644 index f337c4f0f..000000000 --- a/src/lib/classes.coffee +++ /dev/null @@ -1,6 +0,0 @@ -<%= grunt.file.read('src/lib/board.class') %> -<%= grunt.file.read('src/lib/thread.class') %> -<%= grunt.file.read('src/lib/post.class') %> -<%= grunt.file.read('src/lib/clone.class') %> -<%= grunt.file.read('src/lib/databoard.class') %> -<%= grunt.file.read('src/lib/notification.class') %> \ No newline at end of file diff --git a/src/meta/banner.js b/src/meta/banner.js deleted file mode 100644 index f7d4ace23..000000000 --- a/src/meta/banner.js +++ /dev/null @@ -1,21 +0,0 @@ -/* <%= meta.name %> - Version <%= version %> - <%= grunt.template.today('yyyy-mm-dd') %> - * <%= meta.page %> - * - * Copyright (c) 2009-2011 James Campos - * Copyright (c) 2012-<%= grunt.template.today('yyyy') %> Nicolas Stepien - * Licensed under the MIT license. - * <%= meta.repo %>blob/master/LICENSE - * - * Contributors: - * <%= meta.repo %>graphs/contributors - * Non-GitHub contributors: - * ferongr, xat-, Ongpot, thisisanon and Anonymous - favicon contributions - * e000 - cooldown sanity check - * Seiba - chrome quick reply focusing - * herpaderpderp - recaptcha fixes - * WakiMiko - recaptcha tab order http://userscripts.org/scripts/show/82657 - * - * All the people who've taken the time to write bug reports. - * - * Thank you. - */