Greasy Fork is available in English.

appchan x

The most comprehensive 4chan userscript.

// Generated by CoffeeScript
// ==UserScript==
// @name         appchan x
// @version      2.10.15
// @minGMVer     1.14
// @minFFVer     26
// @namespace    zixaphir
// @description  The most comprehensive 4chan userscript.
// @license      MIT; https://github.com/zixaphir/appchan-x/blob/master/LICENSE 
// @match        *://*.4chan.org/*
// @match        *://boards.4chan.org/*
// @match        *://sys.4chan.org/*
// @match        *://a.4cdn.org/*
// @match        *://i.4cdn.org/*
// @match        *://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc
// @exclude      *://blog.4chan.org/*
// @exclude      *://dis.4chan.org/*
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_deleteValue
// @grant        GM_listValues
// @grant        GM_openInTab
// @grant        GM_xmlhttpRequest
// @run-at       document-start
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEX///8EZgR8ulSk0oT///8EAgQ1A88mAAAAAXRSTlMAQObYZgAAAIpJREFUeF6t0sENwjAMhWF84N4H6gAYMUBkdQMYwfuvwmstEeD4kl892P0OaaWcpga2/K0SGII1HNBXARgu7veoY3ANd+esgMHZIz85u0EABrbms3pl/bkC1Tn5ihGOfQwqHeZ/FdYdirEMgCG2ZAQWDTL0m9FvjAhcvoGNAK2gZhGYYX9+ZgFm9gaiNmNkMENY4QAAAABJRU5ErkJggg==
// ==/UserScript==

/*
* appchan x - Version 2.10.15 - 2016-02-12
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
*
* Appchan X Copyright © 2013-2016 Zixaphir <zixaphirmoxphar@gmail.com>
* http://zixaphir.github.io/appchan-x/ 
* 4chan x Copyright © 2009-2011 James Campos <james.r.campos@gmail.com>
* https://github.com/aeosynth/4chan-x
* 4chan x Copyright © 2012-2016 Nicolas Stepien <stepien.nicolas@gmail.com>
* https://4chan-x.just-believe.in/
* 4chan x Copyright © 2013-2016 Jordan Bates <saudrapsmann@gmail.com>
* http://seaweedchan.github.io/4chan-x/
* 4chan x Copyright © 2012-2016 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
* detharonil
*
* 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
*
* jsColor: (http://jscolor.com/)
*   Copyright (c) Jan Odvarko, http://odvarko.cz
*
*   license: http://www.gnu.org/copyleft/lesser.html
*
*/
'use strict';

(function() {
  var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Color, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Flash, Fourchan, Gallery, Get, GlobalMessage, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, JSColor, Keybinds, Labels, Linkify, Main, MarkNewIPs, MascotTools, Mascots, Menu, Nav, Navigate, Notice, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteInline, QuoteMarkers, QuotePreview, QuoteStrikeThrough, QuoteThreading, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReportLink, RevealSpoilers, Rice, Sauce, Settings, ShimSet, SimpleDict, Style, ThemeTools, Themes, Thread, ThreadExcerpt, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, editMascot, editTheme, g, userNavigation,
    __slice = [].slice,
    __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; },
    __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; },
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

  Array.prototype.indexOf = function(val, i) {
    var len;
    i || (i = 0);
    len = this.length;
    while (i < len) {
      if (this[i] === val) {
        return i;
      }
      i++;
    }
    return -1;
  };

  __indexOf = [].indexOf;

  Config = {
    main: {
      'Miscellaneous': {
        'JSON Navigation': [true, 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'],
        'Update Stale Index': [true, 'Updates the board index if it hasn\'t been updated in ten or more minutes when 4chan gains browser focus (like switching tabs or windows).'],
        '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.'],
        'Desktop Notifications': [false, 'Enables desktop notifications across various appchan x features.'],
        '404 Redirect': [true, 'Redirect dead threads and images.'],
        'Exempt Archives from Encryption': [false, 'Permit loading content from, and warningless redirects to, HTTP-only archives from HTTPS pages.'],
        'Keybinds': [true, 'Bind actions to keyboard shortcuts.'],
        'Time Formatting': [true, 'Localize and format timestamps.'],
        'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'],
        'Relative Date Title': [false, 'Show Relative Post Date only when hovering over dates.', 1],
        'File Info Formatting': [true, 'Reformat the file information.'],
        'Thread Expansion': [true, 'Add buttons to expand threads.'],
        'Comment Expansion': [false, 'Expand Comments that are too long to display on the index. Does not work with JSON Navigation.'],
        'Index Navigation': [false, 'Add buttons to navigate between threads.'],
        'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'],
        'Show Dice Roll': [true, 'Show dice that were entered into the email field.'],
        'Color User IDs': [true, 'Assign unique colors to user IDs on boards that use them'],
        'Remove Spoilers': [false, 'Remove all spoilers in text.'],
        'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'],
        'Show Support Message': [true, 'Warn if your browser is unsupported. appchan x may not operate correctly on unsupported browser versions.'],
        'Normalize URL': [true, 'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'],
        'Announcement Hiding': [true, 'Enable announcements to be hidden.'],
        'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.']
      },
      'Linkification': {
        'Linkify': [true, 'Convert text into links where applicable.'],
        'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud, and Github gists', 1],
        'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1],
        'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2],
        'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2]
      },
      'Filtering': {
        'Anonymize': [false, 'Make everyone Anonymous.'],
        'Filter': [true, 'Self-moderation placebo.'],
        'Recursive Hiding': [true, 'Hide replies of hidden posts, recursively.'],
        'Post Hiding': [false, 'Add buttons to hide posts.'],
        'Filtered Backlinks': [true, 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.'],
        'Stubs': [true, 'Show stubs of hidden threads / replies.']
      },
      'Images and Videos': {
        'Image Expansion': [true, 'Expand images / videos.'],
        'Image Hover': [true, 'Show full image / video on mouseover.'],
        'Image Hover in Catalog': [false, 'Show full image / video on mouseover on hover in the catalog.'],
        'Gallery': [true, 'Adds a simple and cute image gallery.'],
        'Fullscreen Gallery': [false, 'Open gallery in fullscreen mode.', 1],
        'PDF in Gallery': [false, 'Show PDF files in gallery.', 1],
        'Sauce': [true, 'Add sauce links to images.'],
        'Reveal Spoiler Thumbnails': [false, 'Replace spoiler thumbnails with the original image.'],
        'Replace GIF': [false, 'Replace gif thumbnails with the actual image.'],
        'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'],
        'Replace PNG': [false, 'Replace png thumbnails with the actual image.'],
        'Replace WEBM': [false, 'Replace webm thumbnails with the actual webm video. Probably will degrade browser performance ;)'],
        'Image Prefetching': [false, 'Add link in header menu to turn on image preloading.'],
        'Fappe Tyme': [false, 'Hide posts without images when header menu item is checked. *hint* *hint*'],
        'Werk Tyme': [false, 'Hide all post images when header menu item is checked.'],
        'Autoplay': [true, 'Videos begin playing immediately when opened.'],
        'Restart when Opened': [true, 'Restart GIFs and WebMs when you hover over or expand them.'],
        'Show Controls': [true, 'Show controls on videos expanded inline. Turn this off if you want to contract videos by clicking on them.'],
        'Loop in New Tab': [true, 'Loop videos opened in their own tabs.'],
        'Add Download Attribute to Filename': [true, 'Adds the Download attribute to the file link above image thumbnails. Useful for download managers like DownThemAll 3.0 that support renaming downloads with the download attribute.']
      },
      'Menu': {
        'Menu': [true, 'Add a drop-down menu to posts.'],
        'Report Link': [true, 'Add a report link to the menu.', 1],
        'Post Hiding Link': [true, 'Add a link to hide posts.', 1],
        'Delete Link': [true, 'Add post and image deletion links to the menu.', 1],
        'Download Link': [true, 'Add a download with original filename link to the menu.', 1],
        'Archive Link': [true, 'Add an archive link to the menu.', 1]
      },
      '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.'],
        'Quoted Title': [false, 'Change the page title to reflect you\'ve been quoted.', 1],
        'Hide Unread Count at (0)': [false, 'Hide the unread posts count in the tab title when it reaches 0.', 1],
        '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.'],
        'Thread Stats': [true, 'Display reply and image count.'],
        'IP Count in Stats': [true, 'Display the unique IP count in the thread stats.', 1],
        'Page Count in Stats': [true, 'Display the page count in the thread stats.', 1],
        'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'],
        'Thread Watcher': [true, 'Bookmark threads.'],
        'Mark New IPs': [false, 'Label each post from a new IP with the thread\'s current IP count.']
      },
      'Posting': {
        'Header Shortcut': [true, 'Add a shortcut to the header to toggle the QR.'],
        'Page Shortcut': [false, 'Add a shortcut to the top of the page to toggle the QR.'],
        'Persistent QR': [true, 'The Quick reply won\'t disappear after posting.'],
        'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.'],
        'Open Post in New Tab': [true, 'Open new threads or replies to a thread from the index in a new tab.'],
        'Remember QR Size': [false, 'Remember the size of the quick reply\'s comment field.'],
        'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
        'Show Name and Subject': [false, 'Show the classic name, email, and subject fields in the QR, even when 4chan doesn\'t use them all.'],
        'Cooldown': [true, 'Indicate the remaining time before posting again.'],
        'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.'],
        'Captcha Warning Notifications': [true, 'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.'],
        'Dump List Before Comment': [false, 'Position of the QR\'s Dump List.'],
        'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.'],
        'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.'],
        'Captcha Fixes': [true, 'Make captcha easier to use, especially with the keyboard.'],
        'Use Recaptcha v1': [false, 'Use the old text version of Recaptcha.']
      },
      'Quote Links': {
        'Quote Backlinks': [true, 'Add quote backlinks.'],
        'OP Backlinks': [true, 'Add backlinks to the OP.', 1],
        'Quote Inlining': [true, 'Inline quoted post on click.'],
        'Quote Hash Navigation': [false, 'Include an extra link after quotes for autoscrolling to quoted posts.', 1],
        'Forward Hiding': [true, 'Hide original posts of inlined backlinks.', 1],
        'Quote Previewing': [true, 'Show quoted post on hover.'],
        'Quote Highlighting': [true, 'Highlight the previewed post.', 1],
        'Resurrect Quotes': [true, 'Link dead quotes to the archives.'],
        'Mark Quotes of You': [true, 'Add \'(You)\' to quotes linking to your posts.'],
        'Highlight Posts Quoting You': [false, 'Highlights any posts that contain a quote to your post.', 1],
        'Highlight Own Posts': [false, 'Highlights own posts if Quote Markers are enabled.', 1],
        'Double Beep': [false, 'Beeps twice to notify you of a post made that is quoting you.', 1],
        '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']
      }
    },
    imageExpansion: {
      'Fit width': [true, ''],
      'Fit height': [false, ''],
      'Scroll into view': [true, 'Scroll down when expanding images to bring the full image into view.'],
      'Expand spoilers': [false, 'Expand all images along with spoilers.'],
      'Expand videos': [false, 'Expand all images also expands videos.'],
      'Expand from here': [false, 'Expand all images only from current position to thread end.'],
      'Advance on contract': [false, 'Advance to next post when contracting an expanded image.']
    },
    gallery: {
      'Hide Thumbnails': [false],
      'Fit Width': [true],
      'Fit Height': [true],
      'Scroll to Post': [true],
      'Slide Delay': [6.0]
    },
    style: {
      Interface: {
        'Single Column Mode': [true, 'Presents options in a single column, rather than in blocks.'],
        'Sidebar': ['normal', 'Alter the sidebar size. Completely hiding it can cause content to overlap, but with the correct option combinations can create a minimal 4chan layout that has more efficient screen real-estate than vanilla 4chan.', ['large', 'normal', 'minimal', 'hide']],
        'Sidebar Location': ['right', 'The side of the page the sidebar content is on. It is highly recommended that you do not hide the sidebar if you change this option.', ['left', 'right']],
        'Top Thread Padding': ['0', 'Add some spacing between the top edge of document and the threads.', 'text'],
        'Bottom Thread Padding': ['0', 'Add some spacing between the bottom edge of document and the threads.', 'text'],
        'Left Thread Padding': ['0', 'Add some spacing between the left edge of document and the threads.', 'text'],
        'Right Thread Padding': ['0', 'Add some spacing between the right edge of document and the threads.', 'text'],
        'Announcements': ['slideout', 'The style of announcements and the ability to hide them.', ['4chan default', 'slideout', 'hide']],
        'Board Title': ['at sidebar top', 'The positioning of the board\'s logo and subtitle.', ['at sidebar top', 'at sidebar bottom', 'at top', 'under post form', 'hide']],
        'Custom Board Titles': [false, 'Customize Board Titles by shift-clicking the board title or subtitle.'],
        'Persistent Custom Board Titles': [false, 'Forces custom board titles to be persistent, even if moot updates the board titles.'],
        'Board Subtitle': [true, 'Show the board subtitle.'],
        '4chan Banner': ['at sidebar top', 'The positioning of 4chan\'s image banner.', ['at sidebar top', 'at sidebar bottom', 'under post form', 'at top', 'hide']],
        '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.'],
        'Hide Navlinks': [false, 'Hides the UI at the top of the page that allows you to navigate between pages, like "Return", "Catalog", "Bottom".']
      },
      Posts: {
        'Alternate Post Colors': [false, 'Make post background colors alternate every other post.'],
        'Color Reply Headings': [false, 'Give the post info a background.'],
        'Color File Info': [false, 'Give the file info a background.'],
        'OP Background': [false, 'Adds a border and background color to the OP Post, as if it were a reply.'],
        'Backlinks Position': ['default', 'The position of backlinks in relation to the post.', ['default', 'lower left', 'lower right']],
        'Filtered Backlinks': [true, 'Hide backlinks to filtered posts.'],
        'Force Reply Break': [false, 'Force replies to occupy their own line and not be adjacent to the OP image.'],
        'Fit Width Replies': [false, 'Replies fit the entire width of the page.'],
        'Indent Replies': [true, 'Indent posts under the OP.'],
        'Hide Delete UI': [false, 'Hides vanilla report and delete functionality and UI. This does not affect Appchan\'s Menu functionality.'],
        'Post Spacing': ['3', 'The amount of space between replies.', 'text'],
        'Vertical Post Padding': ['5', 'The vertical padding around post content of replies.', 'text'],
        'Horizontal Post Padding': ['20', 'The horizontal padding around post content of replies.', 'text'],
        'Hide Horizontal Rules': [false, 'Hides lines between threads.'],
        'Backlink Icons': [false, 'Replaces backlink text with a small, compact icon.'],
        'Compact File Text': [false, 'Shrink the font of the file text to be less obtrusive.']
      },
      Aesthetics: {
        '4chan SS Navigation': [false, 'Try to emulate the appearance of 4chan SS\'s Navigation.'],
        '4chan SS Sidebar': [false, 'Try to emulate the appearance of 4chan SS\'s Sidebar.'],
        '4chan Banner Reflection': [false, 'Adds reflection effects to 4chan\'s image banner.'],
        'Faded 4chan Banner': [true, 'Make 4chan\'s image banner translucent.'],
        'Hide Ads': [false, 'Block advertisements. It\'s probably better to use AdBlock for this.'],
        'Shrink Ads': [false, 'Make 4chan advertisements smaller.'],
        'Fade Ads': [true, 'Make 4chan\'s ads translucent.'],
        'Bolds': [true, 'Bold text for names and such.'],
        'Italics': [false, 'Give tripcodes italics.'],
        'Sidebar Glow': [false, 'Adds a glow to the sidebar\'s text.'],
        'Circle Checkboxes': [false, 'Make checkboxes circular.'],
        'Font': ['sans-serif', 'The font used by all elements of 4chan.', 'text'],
        'Font Size': ['13', 'The font size of posts and various UI. This changes most, but not all, font sizes.', 'text'],
        'Icons': ['oneechan', 'Icon theme which Appchan will use.', ['oneechan', '4chan SS']],
        'Invisible Icons': [false, 'Makes icons invisible unless hovered. Invisible really is "invisible", so don\'t use it if you don\'t have your icons memorized or don\'t use keybinds.'],
        'Quote Shadows': [true, 'Add shadows to the quote previews and inline quotes.'],
        'Rounded Edges': [false, 'Round the edges of various 4chan elements.'],
        'Underline Links': [false, 'Put lines under hyperlinks.'],
        'NSFW/SFW Themes': [false, 'Choose your theme based on the SFW status of the board you are viewing.']
      },
      Mascots: {
        'Mascots': [true, 'Add a pretty picture of your waifu to Appchan.'],
        'Click to Toggle': [true, 'Click your current mascot to switch between your enabled mascots.'],
        'Mascot Location': ['sidebar', 'Change where your mascot is located.', ['sidebar', 'opposite']],
        'Mascot Position': ['default', 'Change where your mascot is placed in relation to the post form.', ['above post form', 'default', 'bottom', 'middle']],
        'Mascots Overlap Posts': [true, 'Mascots overlap threads and posts.'],
        'NSFW/SFW Mascots': [false, 'Enable or disable mascots based on the SFW status of the board you are viewing.'],
        'Grayscale Mascots': [false, 'Force mascots to be monochrome.'],
        'Mascot Opacity': ['1.00', 'Make Mascots transparent.', 'text'],
        'Hide Mascots on Catalog': [false, 'Do not show mascots on the official catalog pages.'],
        'Silhouettize Mascots': [false, 'Apply a filter to mascots to try to turn them into silhouettes.'],
        'Silhouette Contrast': ['0', 'A number to increase the contrast of silhouettes. Suggested values: 0, 8, 16 ...', 'text']
      },
      Navigation: {
        'Navigation Alignment': ['left', 'Change the text alignment of the navigation.', ['left', 'center', 'right']],
        'Slideout Navigation': ['compact', 'How the slideout navigation will be displayed.', ['compact', 'list', 'hide']],
        'Pagination': ['sticky bottom', 'The position of 4chan page navigation', ['sticky top', 'sticky bottom', 'top', 'bottom', 'on side', 'hide']],
        'Pagination Alignment': ['center', 'Change the text alignment of the pagination.', ['left', 'center', 'right']],
        'Hide Navigation Decorations': [false, 'Hide non-link text in the board navigation and pagination. This also disables the delimiters in <code>Custom Navigation</code>']
      },
      'Post Form': {
        'Compact Post Form Inputs': [true, 'Use compact inputs on the post form.'],
        'Show Post Form Header': [false, 'Force the Post Form to have a header.'],
        'Post Form Style': ['tabbed slideout', 'How the post form will sit on the page.', ['fixed', 'slideout', 'tabbed slideout', 'slideup', 'tabbed slideup', 'float']],
        'Post Form Slideout Transitions': [true, 'Animate slideouts for the post form.'],
        'Transparent Post Form': [false, 'Make the post form almost invisible.'],
        'Post Form Decorations': [false, 'Add a border and background to the post form (does not apply to the "float" post form style.'],
        'Textarea Resize': ['vertical', 'Options to resize the post form\'s comment box.', ['both', 'horizontal', 'vertical', 'none']],
        'Tripcode Hider': [true, 'Intelligent name field hiding.'],
        'Images Overlap Post Form': [true, 'Images expand over the post form and sidebar content, usually used with "Expand images" set to "full".'],
        'Captcha Filter': [false, 'Apply an SVG filter to the captcha to make it match your theme. WARNING: May cause invisible captchas.']
      }
    },
    threadWatcher: {
      'Current Board': [false, 'Only show watched threads from the current board.'],
      'Auto Update Thread Watcher': [true, 'Periodically check status of watched threads.'],
      'Auto Watch': [false, 'Automatically watch threads you start.'],
      'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'],
      'Auto Prune': [false, 'Automatically remove dead threads.'],
      'Show Unread Count': [true, 'Show number of unread posts in watched threads.']
    },
    filter: {
      name: "# Filter any namefags:\n#/^(?!Anonymous$)/",
      uniqueID: "# Filter a specific ID:\n#/Txhvk1Tl/",
      tripcode: "# Filter any tripfag\n#/^!/",
      capcode: "# Set a custom class for mods:\n#/Mod$/;highlight:mod;op:yes\n# Set a custom class for moot:\n#/Admin$/;highlight:moot;op:yes",
      subject: "# Filter Generals on /v/:\n#/general/i;boards:v;op:only",
      comment: "# Filter Stallman copypasta on /g/:\n#/what you\'re refer+ing to as linux/i;boards:g",
      flag: '',
      filename: '',
      dimensions: "# Highlight potential wallpapers:\n#/1920x1080/;op:yes;highlight;top:no;boards:w,wg",
      filesize: '',
      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/",
    FappeT: {
      fappe: false,
      werk: false
    },
    'Custom CSS': false,
    Index: {
      'Index Mode': 'paged',
      'Previous Index Mode': 'paged',
      'Index Sort': 'bump',
      'Index Size': 'small',
      'Threads per Page': 0,
      'Open threads in a new tab': false,
      'Show Replies': true,
      'Pin Watched Threads': false,
      'Anchor Hidden Threads': true,
      'Refreshed Navigation': false
    },
    Header: {
      'Fixed Header': true,
      'Header auto-hide': false,
      'Header auto-hide on scroll': false,
      'Bottom Header': false,
      'Header catalog links': false,
      'Bottom Board List': true,
      'Custom Board Navigation': true
    },
    boardnav: "[ toggle-all ]\na-replace\nc-replace\ng-replace\nk-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nco-replace\nfit-replace\njp-replace\nmu-replace\nsp-replace\ntv-replace\nvp-replace\n[external-text:\"FAQ\",\"https://github.com/zixaphir/appchan-x/wiki/Frequently-Asked-Questions\"]",
    QR: {
      'QR.personas': "#options:\"sage\";boards:jp;always"
    },
    time: '%m/%d/%y(%a)%H:%M:%S',
    backlink: '>>%id',
    fileInfo: '%l (%p%s, %r)',
    favicon: 'ferongr',
    usercss: "/* Tripcode Italics: */\n/*\nspan.postertrip {\n  font-style: italic;\n}\n*/\n\n/* Add a rounded border to thumbnails (but not expanded images): */\n/*\n.fileThumb > img:first-child {\n  border: solid 2px rgba(0,0,100,0.5);\n  border-radius: 10px;\n}\n*/\n\n/* Make highlighted posts look inset on the page: */\n/*\ndiv.post:target,\ndiv.post.highlight {\n  box-shadow: inset 2px 2px 2px rgba(0,0,0,0.2);\n}\n*/",
    hotkeys: {
      'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'],
      '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.'],
      'Toggle sage': ['Alt+s', 'Toggle sage in options field.'],
      'Submit QR': ['Ctrl+Enter', 'Submit post.'],
      'Post Without Name': ['Alt+n', 'Clear name field and then submits post.'],
      'Watch': ['w', 'Watch thread.'],
      'Update': ['r', 'Update the thread / refresh the index.'],
      'Expand image': ['Shift+e', 'Expand selected image.'],
      'Expand images': ['e', 'Expand all images.'],
      'Open Gallery': ['g', 'Opens the gallery.'],
      'Pause': ['p', 'Pause/play videos in the gallery.'],
      'Slideshow': ['s', 'Toggle the gallery slideshow mode.'],
      'fappeTyme': ['f', 'Toggle Fappe Tyme.'],
      'werkTyme': ['Shift+w', 'Toggle Werk Tyme'],
      'Front page': ['1', 'Jump to front page.'],
      'Open front page': ['Shift+1', 'Open front page in a new tab.'],
      'Next page': ['Ctrl+Right', 'Jump to the next page.'],
      'Previous page': ['Ctrl+Left', 'Jump to the previous page.'],
      'Open catalog': ['Shift+c', 'Open the catalog of the current board.'],
      'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'],
      'Paged mode': ['Alt+1', 'Sets the index mode to paged.'],
      'All pages mode': ['Alt+2', 'Sets the index mode to all threads.'],
      'Catalog mode': ['Alt+3', 'Sets the index mode to catalog.'],
      'Cycle sort type': ['Alt+x', 'Cycle through index sort types.'],
      'Next thread': ['Ctrl+Down', 'See next thread.'],
      'Previous thread': ['Ctrl+Up', 'See previous thread.'],
      'Expand thread': ['Ctrl+e', 'Expand thread.'],
      'Open thread': ['o', 'Open thread in current tab.'],
      'Open thread tab': ['Shift+o', 'Open thread in new tab.'],
      'Next reply': ['j', 'Select next reply.'],
      'Previous reply': ['k', 'Select previous reply.'],
      'Deselect reply': ['Shift+d', 'Deselect reply.'],
      'Hide': ['x', 'Hide thread.'],
      'Previous Post Quoting You': ['Alt+Up', 'Scroll to the previous post that quotes you.'],
      'Next Post Quoting You': ['Alt+Down', 'Scroll to the next post that quotes you.']
    },
    updater: {
      checkbox: {
        'Beep': [false, 'Beep on new post to completely read thread.'],
        'Auto Scroll': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'],
        'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'],
        'Scroll BG': [false, 'Auto-scroll background tabs.'],
        'Auto Update': [true, 'Automatically fetch new posts.'],
        'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.']
      },
      'Interval': 30
    },
    embedWidth: 640,
    embedHeight: 390,
    theme: 'Yotsuba B',
    'theme_sfw': 'Yotsuba B',
    'theme_nsfw': 'Yotsuba',
    mascot: ''
  };

  editTheme = {};

  editMascot = {};

  userNavigation = {};

  Conf = {};

  c = console;

  d = document;

  doc = d.documentElement;

  g = {
    VERSION: '2.10.15',
    NAMESPACE: 'appchan_x.',
    NAME: 'appchan x',
    FAQ: 'https://github.com/zixaphir/appchan-x/wiki/Frequently-Asked-Questions',
    CHANGELOG: 'https://github.com/zixaphir/appchan-x/blob/master/CHANGELOG.md',
    boards: {}
  };

  E = (function() {
    var fn, r, regex, str;
    str = {
      '&': '&amp;',
      "'": '&#039;',
      '"': '&quot;',
      '<': '&lt;',
      '>': '&gt;'
    };
    r = String.prototype.replace;
    regex = /[&"'<>]/g;
    fn = function(x) {
      return str[x];
    };
    return function(text) {
      return r.call(text, regex, fn);
    };
  })();

  Mascots = {
    'Akiyama_Mio': {
      category: 'Anime',
      image: '//i.minus.com/ibrWLbKvjRnHZS.png'
    },
    'Akiyama_Mio_2': {
      category: 'Anime',
      image: '//i.minus.com/ibmZgHvl3ZSxYk.png'
    },
    'Akiyama_Mio_3': {
      category: 'Anime',
      image: '//i.minus.com/irFbpefCFt1cT.png',
      center: true
    },
    'Applejack': {
      category: 'Ponies',
      image: '//i.minus.com/inZ8jSVsEhfnC.png',
      center: true
    },
    'Asuka_Langley_Soryu': {
      category: 'Anime',
      image: '//i.minus.com/ib2z9ME9QKEBaS.png',
      center: true
    },
    'Asuka_Langley_Soryu_2': {
      category: 'Anime',
      image: '//i.minus.com/iI3QR5SywNfg9.png',
      center: true
    },
    'Asuka_Langley_Soryu_3': {
      category: 'Anime',
      image: '//i4.minus.com/jbq2hFrE4q75KT.png',
      center: true
    },
    'Asuka_Langley_Soryu_4': {
      category: 'Anime',
      image: '//i.minus.com/ibiiInQGLGnYNj.png',
      center: true
    },
    'Asuka_Langley_Soryu_6': {
      category: 'Anime',
      image: '//i.minus.com/ibzbnBcaEtoqck.png',
      position: 'bottom'
    },
    'Ayanami_Rei': {
      category: 'Anime',
      image: '//i.minus.com/ib0ft5OmqRZx2r.png',
      center: true
    },
    'Ayase': {
      category: 'Anime',
      image: '//i.minus.com/ibmArq5Wb4Po4v.png',
      center: true
    },
    'BLACK_ROCK_SHOOTER': {
      category: 'Anime',
      image: '//i.minus.com/ibMe9MrTMdvAT.png',
      center: true
    },
    'Brioche_d_Arquien': {
      category: 'Anime',
      image: '//i.minus.com/ibobXYJ2k3JXK.png',
      center: true
    },
    'CC': {
      category: 'Anime',
      image: '//i.minus.com/iwndO4Pn6SO0X.png',
      center: true
    },
    'Chie': {
      category: 'Anime',
      image: '//i.minus.com/ib0HI16h9FSjSp.png',
      center: true
    },
    'Cirno_2': {
      category: 'Anime',
      image: '//i.minus.com/iSZ06ZxrcqAKq.png',
      center: true
    },
    'Dawn_Hikari': {
      category: 'Anime',
      image: '//i.minus.com/iL3J1EmcDkFzE.png',
      center: true
    },
    'Doppleganger': {
      category: 'Anime',
      image: '//i.minus.com/iPvv86W9r3Rxm.png'
    },
    'Dragonkid': {
      category: 'Anime',
      image: '//i.minus.com/iq9fuyWSjIDWf.png',
      center: true
    },
    'Dragonkid_2': {
      category: 'Anime',
      image: '//i.minus.com/i7sdxK3G12RB6.png',
      center: true
    },
    'Eclair': {
      category: 'Anime',
      image: '//i.minus.com/ibsk5mMYVR5zuA.png',
      center: true
    },
    'Evangeline_AK_McDowell': {
      category: 'Anime',
      image: '//i.minus.com/ibuq7a8zWKi2gl.png',
      center: true
    },
    'Fluttershy': {
      category: 'Ponies',
      image: '//i.minus.com/ibwEFEGlRm0Uxy.png'
    },
    'Fluttershy_2': {
      category: 'Ponies',
      image: '//i.minus.com/ibjtz6EU2OFPgh.png',
      center: true
    },
    'Fluttershy_Cutiemark': {
      category: 'Ponies',
      image: '//i.minus.com/i5WVpIAlHQdhs.png',
      center: true
    },
    'Fujiwara_no_Mokou': {
      category: 'Anime',
      image: '//i.minus.com/ibpwDyMGodvni6.png'
    },
    'Furudo_Erika': {
      category: 'Anime',
      image: '//i.minus.com/iCrRzQ8WvHiSM.png',
      center: true
    },
    'Gally': {
      category: 'Anime',
      image: '//i.minus.com/iblWZGuSlWtDI6.png',
      center: true
    },
    'Gasai_Yuno': {
      category: 'Anime',
      image: '//i.minus.com/iEQsK6K85jX2n.png'
    },
    'George_Costanza': {
      category: 'Western',
      image: '//i.minus.com/iFWdpFGfzLs6v.png'
    },
    'Hanako': {
      category: 'Anime',
      image: '//i.minus.com/iRLF8gCIZbGjo.png',
      center: true
    },
    'Hasekura_Youko': {
      category: 'Anime',
      image: '//i.minus.com/iqBTFZf5UhLpR.png',
      center: true
    },
    'Hatsune_Miku_3': {
      category: 'Anime',
      image: '//i.minus.com/iLJ4uDTcg1T8r.png',
      center: true
    },
    'Hatsune_Miku_4': {
      category: 'Anime',
      image: '//i.minus.com/ibjkPMLT8Uxitp.png',
      center: true
    },
    'Hatsune_Miku_5': {
      category: 'Anime',
      image: '//i.minus.com/i9Evu9dyvok4G.png',
      center: true
    },
    'Hirasawa_Yui': {
      category: 'Anime',
      image: '//i.minus.com/iuGe5uDaTNmhR.png',
      center: true
    },
    'Homura_Akemi': {
      category: 'Anime',
      image: '//i.minus.com/iPtrwFEEtPLhn.png'
    },
    'Horo': {
      category: 'Silhouette',
      image: '//i.minus.com/ibbMKiznORGJ00.png',
      silhouette: true
    },
    'Horo_2': {
      category: 'Silhouette',
      image: '//i.minus.com/ibyT9dlTe1HN5P.png',
      silhouette: true,
      width: 205
    },
    'Ika_Musume': {
      category: 'Anime',
      image: '//i.minus.com/ibqVu5GNfKx5bC.png',
      center: true
    },
    'Ika_Musume_2': {
      category: 'Anime',
      image: '//i.minus.com/ibhnEiE8HabEqC.png',
      center: true
    },
    'Iwakura_Lain': {
      category: 'Anime',
      image: '//i.minus.com/iBXRRT19scoHf.png',
      center: true
    },
    'Iwakura_Lain_2': {
      category: 'Anime',
      image: '//i.minus.com/ioMltWNYUWeJ3.png',
      center: true
    },
    'KOn_Girls': {
      category: 'Anime',
      image: '//i.minus.com/ibndVLiH09uINs.png',
      center: true
    },
    'Kagamine_Rin_2': {
      category: 'Anime',
      image: '//i.minus.com/jbkL01TIeJwEN6.png'
    },
    'Kagari_Izuriha': {
      category: 'Anime',
      image: '//i.minus.com/ihaFHsvFfL0vH.png'
    },
    'Kaname_Madoka': {
      category: 'Anime',
      image: '//i.minus.com/iRuEFK8cdAHxB.png',
      center: true
    },
    'Karina': {
      category: 'Anime',
      image: '//i.minus.com/iUADBOpQYPfeP.png',
      center: true
    },
    'Kigurumi_Harokitei': {
      category: 'Anime',
      image: '//i.minus.com/ibb17W5i3rQvut.png',
      center: true
    },
    'Kinomoto_Sakura': {
      category: 'Anime',
      image: '//i.minus.com/iVmsLKa4zLwZR.png',
      center: true
    },
    'Kirisame_Marisa': {
      category: 'Anime',
      image: '//i.minus.com/ibikDZH5CZ0V30.png'
    },
    'Koiwai_Yotsuba': {
      category: 'Anime',
      image: '//i.minus.com/iKFKyVVBato2N.png',
      center: true
    },
    'Koko': {
      category: 'Anime',
      image: '//i.minus.com/ieVyNMSjXpBs2.png',
      center: true
    },
    'Kotobuki_Tsumugi': {
      category: 'Anime',
      image: '//i.minus.com/i6doAUnM6jMAY.png',
      center: true
    },
    'Kurisu_Makise': {
      category: 'Anime',
      image: '//i.minus.com/ib1eMtRHdvc9ix.png'
    },
    'Kuroko_Shirai': {
      category: 'Anime',
      image: '//i.minus.com/i3K8F7lu2SHfn.png'
    },
    'Kyouko_Sakura': {
      category: 'Anime',
      image: '//i.minus.com/iMrFOS1mfzIJP.png',
      center: true
    },
    'Kyubee': {
      category: 'Anime',
      image: '//i.minus.com/iD0SEJPeZa0Dw.png'
    },
    'Kyubee_2': {
      category: 'Anime',
      image: '//i.minus.com/iGlKiDZvM3xi8.png',
      center: true
    },
    'Li_Syaoran': {
      category: 'Anime',
      image: '//i.minus.com/ib0IWPBRSHyiDe.png'
    },
    'Link': {
      category: 'Anime',
      image: '//i.minus.com/ibd1JShAMTdJBH.png',
      center: true
    },
    'Lizardgirl': {
      category: 'Anime',
      image: '//i.minus.com/is7h27Q6lsmyx.png'
    },
    'Luka': {
      category: 'Anime',
      image: '//i.minus.com/inds5h2BOmVBy.png'
    },
    'Madotsuki': {
      category: 'Anime',
      image: '//i.minus.com/ik6QYfTfgx9Za.png'
    },
    'Makoto': {
      category: 'Anime',
      image: '//i.minus.com/i7q6aOuUqqA9F.png',
      center: true
    },
    'Mantis': {
      category: 'Anime',
      image: '//i.minus.com/iBmluUJOZivY2.png'
    },
    'Megurine_Luka': {
      category: 'Anime',
      image: '//i.minus.com/ibxe63yidpz9Gz.png',
      center: true
    },
    'Mei_Sunohara': {
      category: 'Anime',
      image: '//i.minus.com/i7ElzNY4xQHHz.png',
      center: true
    },
    'Millefiori': {
      category: 'Anime',
      image: '//i.minus.com/ifVzPtH8JHXjl.png',
      center: true
    },
    'Millefiori_2': {
      category: 'Anime',
      image: '//i.minus.com/iMSUiQxRBylQG.png',
      center: true
    },
    'Millefiori_3': {
      category: 'Anime',
      image: '//i.minus.com/iDOe3ltSvOYXZ.png',
      center: true
    },
    'Misaki_Mei': {
      category: 'Anime',
      image: '//i.minus.com/icmYGJ9vIOFjr.png',
      center: true
    },
    'Mizunashi_Akari': {
      category: 'Anime',
      image: '//i.minus.com/iNy9kHlNsUoVK.png',
      center: true
    },
    'Motoko': {
      category: 'Anime',
      image: '//i.minus.com/irFtkWWyMChSA.png',
      center: true
    },
    'Nagato_Yuki': {
      category: 'Anime',
      image: '//i.minus.com/it3pEawWIxY84.png',
      center: true
    },
    'Nagato_Yuki_2': {
      category: 'Anime',
      image: '//i.minus.com/iuspcZbLvmqpb.png',
      center: true
    },
    'Nagato_Yuki_3': {
      category: 'Anime',
      image: '//i.minus.com/ibndIkldw4njbD.png',
      center: true
    },
    'Nagato_Yuki_5': {
      category: 'Silhouette',
      width: 202,
      image: '//i.minus.com/iFQQPEaC3aEV7.png',
      silhouette: true,
      center: true
    },
    'Nakano_Azusa': {
      category: 'Anime',
      image: '//i.minus.com/iiptfoMlr4v1k.png'
    },
    'Nichijou': {
      category: 'Anime',
      image: '//i.minus.com/iE8lbZ5f3OT2B.png'
    },
    'Noir_VinoCacao': {
      category: 'Anime',
      image: '//i.minus.com/ibo8aCWF0OwNwP.png',
      center: true
    },
    'Pinkie_Pie': {
      category: 'Ponies',
      image: '//i.minus.com/ib1kcpqxvsyZWG.png',
      center: true
    },
    'Pinkie_Pie_2': {
      category: 'Ponies',
      image: '//i.minus.com/i8QRRgE7iKpw7.png',
      center: true
    },
    'Oshino_Shinobu': {
      category: 'Anime',
      image: '//i.minus.com/ibwhAyR6D7OBAB.png'
    },
    'Oshino_Shinobu_2': {
      category: 'Anime',
      image: '//i.minus.com/ibqoNiWzynsVvg.png',
      position: 'bottom'
    },
    'Patchouli_Knowledge': {
      category: 'Anime',
      image: '//i.minus.com/ibnOEAxXaKlctB.png',
      center: true
    },
    'Patchouli_Knowledge_2': {
      category: 'Anime',
      image: '//i.minus.com/i1MOPTmohOsMD.png'
    },
    'Pink_Doggy': {
      category: 'Anime',
      image: '//i.minus.com/i1SpWAzfcIEQc.png',
      center: true
    },
    'Pink_Hair': {
      category: 'Anime',
      image: '//i.minus.com/ibdwMaIPwdscao.png',
      center: true
    },
    'Railgun_2': {
      category: 'Anime',
      image: '//i.minus.com/iNhpDDO0GSTeM.png',
      center: true
    },
    'Railgun_3': {
      category: 'Anime',
      image: '//i.minus.com/iiW02dmqUwRcy.png'
    },
    'Railgun_4': {
      category: 'Anime',
      image: '//i.minus.com/iR3j0mGgd1927.png',
      center: true
    },
    'Rainbow_Dash': {
      category: 'Ponies',
      image: '//i.minus.com/ibthr5EDMZHV9j.png',
      center: true
    },
    'Rarity': {
      category: 'Ponies',
      image: '//i.minus.com/ibkraGhhUh25CU.png',
      center: true
    },
    'Revi': {
      category: 'Anime',
      image: '//i.minus.com/ivUMKcy5ow6Ab.png',
      position: 'bottom',
      center: true
    },
    'Ruri_Gokou': {
      category: 'Anime',
      image: '//i.minus.com/ibtZo1fdOk8NCB.png',
      position: 'bottom',
      center: true
    },
    'Ryuu': {
      category: 'Anime',
      image: '//i.minus.com/iecVz4p2SuqK4.png',
      position: 'bottom'
    },
    'Samus_Aran': {
      category: 'Anime',
      image: '//i.minus.com/iWG1GFJ89A05p.png',
      center: true
    },
    'Samus_Aran_2': {
      category: 'Anime',
      image: '//i.minus.com/ibl4efsNtHpkXg.png'
    },
    'Shana': {
      category: 'Anime',
      image: '//i.minus.com/ib2cTJMF0cYIde.png',
      center: true
    },
    'Shana_2': {
      category: 'Anime',
      image: '//i.minus.com/ioRICGu0Ipzj9.png',
      center: true
    },
    'Shiki': {
      category: 'Anime',
      image: '//i.minus.com/iIZm1JxxDIDQ1.png'
    },
    'Shinji_and_Girls': {
      category: 'Anime',
      image: '//i.minus.com/itMrEn56GzvzE.png',
      center: true
    },
    'Shinonome_Hakase': {
      category: 'Anime',
      image: '//i.minus.com/iocCwDCnNgI19.png',
      center: true
    },
    'Shirakiin_Ririchiyo': {
      category: 'Anime',
      image: '//i.minus.com/i1m0rdzmVLYLa.png',
      position: 'bottom',
      center: true
    },
    'Shirohibe': {
      category: 'Anime',
      image: '//i.minus.com/iGu91k3KZeg00.png',
      position: 'bottom'
    },
    'Suruga_Kanbaru': {
      category: 'Anime',
      image: '//i.minus.com/irEL7AgC80qKD.png',
      center: true
    },
    'Suzumiya_Haruhi': {
      category: 'Anime',
      image: '//i.minus.com/iM9qMfUNh9Qi9.png',
      center: true
    },
    'Suzumiya_Haruhi_2': {
      category: 'Anime',
      image: '//i.minus.com/ibnomd5iasjceY.png',
      center: true
    },
    'Tardis': {
      category: 'Western',
      image: '//i.minus.com/iQL2bwpDfOgk.png',
      center: true
    },
    'Tewi_Inaba': {
      category: 'Anime',
      image: '//i.minus.com/ib2k9lwQIkmb66.png'
    },
    'Tomozo_Kaoru': {
      category: 'Anime',
      image: '//i.minus.com/islUcBaPRYAgv.png',
      center: true
    },
    'Twilight_Sparkle': {
      category: 'Ponies',
      image: '//i.minus.com/ibnMYVTZEykrKU.png',
      center: true
    },
    'Vivian_James_1': {
      category: 'Anime',
      image: '//i.minus.com/iYZ05HyI7aPUA.png'
    },
    'Vivian_James_2': {
      category: 'Anime',
      image: '//i.minus.com/ibtKEioz8jN37k.png'
    },
    'White_Curious': {
      category: 'Anime',
      image: '//i.minus.com/ibfkj5osu99axe.png',
      center: true
    },
    'Yakumo_Ran': {
      category: 'Anime',
      image: '//i.minus.com/ivKqn8vL9A8cQ.png'
    },
    'Yin': {
      category: 'Anime',
      image: '//i.minus.com/iL9DlVtaAGFdq.png'
    },
    'Yin_2': {
      category: 'Anime',
      image: '//i.minus.com/izkTpyjr1XlLR.png',
      center: true
    },
    'Yoko_Littner_2': {
      category: 'Anime',
      image: '//i.minus.com/i7aUDY4h9uB1T.png',
      center: true
    },
    'Yoko_Littner_3': {
      category: 'Anime',
      image: '//i.minus.com/iYVd5DhCmB7VJ.png',
      center: true
    },
    'Yozora_Mikazuki': {
      category: 'Anime',
      image: '//i.minus.com/iIFEsDzoDALQd.png'
    },
    'Yuzuki_Yukari': {
      category: 'Anime',
      image: '//i.minus.com/iYQOz0iGM9ygq.png',
      center: true
    },
    'Yukkikaze': {
      category: 'Anime',
      image: '//i.minus.com/ioQJAnyXebHDJ.png',
      center: true
    },
    'Yukkihaze_2': {
      category: 'Anime',
      image: '//i.minus.com/inpgaDlJtZ9Sc.png',
      center: true
    }
  };

  Themes = {
    'AppChan': {
      'Author': 'Zixaphir',
      'Author Tripcode': '!..NoTrip..',
      'Background Color': 'rgba(44,44,44,1)',
      'Thread Wrapper Background': 'rgba(0,0,0,0)',
      'Thread Wrapper Border': 'rgba(0,0,0,0)',
      'Dialog Background': 'rgba(44,44,44,1)',
      'Dialog Border': 'rgba(44,44,44,1)',
      'Reply Background': 'rgba(51,51,51,1)',
      'Reply Border': 'rgba(51,51,51,1)',
      'Highlighted Reply Background': 'rgba(57,57,57,1)',
      'Highlighted Reply Border': 'rgba(57,57,57,1)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Input Background': 'rgba(51,51,51,1)',
      'Input Border': 'rgba(51,51,51,1)',
      'Checkbox Background': 'rgba(68,68,68,1)',
      'Checkbox Border': 'rgba(68,68,68,1)',
      'Buttons Background': 'rgba(48,48,48,1)',
      'Buttons Border': 'rgba(48,48,48,1)',
      'Focused Input Background': 'rgba(63,63,63,1)',
      'Focused Input Border': 'rgba(63,63,63,1)',
      'Hovered Input Background': 'rgba(57,57,57,1)',
      'Hovered Input Border': 'rgba(57,57,57,1)',
      'Navigation Background': 'rgba(44,44,44,0.9)',
      'Navigation Border': 'rgba(44,44,44,0.9)',
      'Quotelinks': 'rgb(79,95,143)',
      'Backlinks': 'rgb(79,95,143)',
      'Links': 'rgb(102,136,170)',
      'Hovered Links': 'rgb(78,110,142)',
      'Navigation Links': 'rgb(170,170,170)',
      'Hovered Navigation Links': 'rgb(78,110,142)',
      'Names': 'rgb(170,170,170)',
      'Tripcodes': 'rgb(170,170,170)',
      'Emails': 'rgb(102,136,170)',
      'Subjects': 'rgb(144,144,144)',
      'Text': 'rgb(170,170,170)',
      'Inputs': 'rgb(170,170,170)',
      'Post Numbers': 'rgb(102,136,170)',
      'Greentext': 'rgb(120,153,34)',
      'Sage': 'rgb(150,150,150)',
      'Board Title': 'rgb(170,170,170)',
      'Timestamps': 'rgb(170,170,170)',
      'Warnings': 'rgb(102,136,170)',
      'Shadow Color': 'rgba(0,0,0,.1)',
      'Custom CSS': ''
    },
    'BakaBT': {
      'Author': 'seaweed',
      'Author Tripcode': '!POMF.9waa',
      'Background Image': 'url("http://i.imgur.com/rTkxi.jpg")',
      'Background Attachment': 'fixed',
      'Background Position': '20px 20px',
      'Background Repeat': 'repeat',
      'Background Color': 'rgba(238,238,238,1)',
      'Thread Wrapper Background': 'rgba(255,255,255,1)',
      'Thread Wrapper Border': 'rgba(204,204,204,1)',
      'Dialog Background': 'rgba(238,221,255,1)',
      'Dialog Border': 'rgba(238,221,255,1)',
      'Reply Background': 'rgba(238,221,255,1)',
      'Reply Border': 'rgba(209,162,255,1)',
      'Highlighted Reply Background': 'rgba(238,221,255,1)',
      'Highlighted Reply Border': 'rgba(209,162,255,1)',
      'Backlinked Reply Outline': 'rgba(204,101,99,1)',
      'Input Background': 'rgba(255,255,255,1)',
      'Input Border': 'rgba(204,204,204,1)',
      'Checkbox Background': 'rgba(255,255,238,1)',
      'Checkbox Border': 'rgba(204,204,204,1)',
      'Buttons Background': 'rgba(255,255,255,1)',
      'Buttons Border': 'rgba(204,204,204,1)',
      'Focused Input Background': 'rgba(255,255,255,1)',
      'Focused Input Border': 'rgba(209,162,255,1)',
      'Hovered Input Background': 'rgba(238,221,255,1)',
      'Hovered Input Border': 'rgba(204,204,204,1)',
      'Navigation Background': 'rgba(255,255,255,0.8)',
      'Navigation Border': 'rgba(255,255,255,0.8)',
      'Quotelinks': 'rgb(146,92,141)',
      'Backlinks': 'rgb(146,92,141)',
      'Links': 'rgb(133,76,158)',
      'Hovered Links': 'rgb(198,23,230)',
      'Navigation Links': 'rgb(17,17,17)',
      'Hovered Navigation Links': 'rgb(198,23,230)',
      'Names': 'rgb(133,76,158)',
      'Tripcodes': 'rgb(146,92,141)',
      'Emails': 'rgb(133,76,158)',
      'Subjects': 'rgb(17,17,17)',
      'Text': 'rgb(0,0,0)',
      'Inputs': 'rgb(0,0,0)',
      'Post Numbers': 'rgb(146,92,141)',
      'Greentext': 'rgb(129,153,65)',
      'Sage': 'rgb(146,92,141)',
      'Board Title': 'rgb(133,76,158)',
      'Timestamps': 'rgb(0,0,0)',
      'Warnings': 'rgb(133,76,158)',
      'Shadow Color': 'rgba(0,0,0,.05)',
      'Custom CSS': ".board {\n  box-shadow: 0px 10px 10px 2px rgba(128,128,128,0.5);\n  border-radius: 3px;\n}\n.board .thread {\n  padding:10px;\n}\n#appchanx-settings.reply.dialog,\n#appchanx-settings .dialog {\n  background-color:#FFF;\n  color:#000;\n  border:2px solid #CCC;\n}\n#appchanx-settings ul {\n  border-bottom:1px solid #DBD8D2;\n}\n#appchanx-settings ul:last-of-type{\n  border:none;\n}\n#qp div.post{\n  background-color:rgba(255,255,255,0.9);\n  border:1px solid #D1A2FF;\n  color:#000;\n}"
    },
    'Blackberry Jam': {
      'Author': 'seaweed',
      'Author Tripcode': '!POMF.9waa',
      'Dialog Background': 'rgba(27,27,27,1)',
      'Dialog Border': 'rgba(27,27,27,1)',
      'Background Color': 'rgba(45,45,45,1)',
      'Thread Wrapper Background': 'rgba(0,0,0,0)',
      'Thread Wrapper Border': 'rgba(0,0,0,0)',
      'Reply Background': 'rgba(27,27,27,1)',
      'Reply Border': 'rgba(38,38,38,1)',
      'Highlighted Reply Background': 'rgba(17,17,17,1)',
      'Highlighted Reply Border': 'rgba(17,17,17,1)',
      'Backlinked Reply Outline': 'rgba(103,204,232,1)',
      'Checkbox Background': 'rgba(51,51,51,1)',
      'Checkbox Border': 'rgba(51,51,51,1)',
      'Input Background': 'rgba(27,27,27,1)',
      'Input Border': 'rgba(27,27,27,1)',
      'Focused Input Background': 'rgba(27,27,27,1)',
      'Focused Input Border': 'rgba(27,27,27,1)',
      'Hovered Input Background': 'rgba(17,17,17,1)',
      'Hovered Input Border': 'rgba(17,17,17,1)',
      'Buttons Background': 'rgba(27,27,27,1)',
      'Buttons Border': 'rgba(27,27,27,1)',
      'Navigation Background': 'rgba(45,45,45,0.9)',
      'Navigation Border': 'rgba(45,45,45,0.9)',
      'Links': 'rgb(218,105,224)',
      'Hovered Links': 'rgb(255,0,255)',
      'Navigation Links': 'rgb(241,241,241)',
      'Hovered Navigation Links': 'rgb(255,0,255)',
      'Subjects': 'rgb(241,241,241)',
      'Names': 'rgb(103,204,232)',
      'Sage': 'rgb(103,204,232)',
      'Tripcodes': 'rgb(103,204,232)',
      'Emails': 'rgb(218,105,224)',
      'Post Numbers': 'rgb(218,105,224)',
      'Text': 'rgb(241,241,241)',
      'Quotelinks': 'rgb(223,153,247)',
      'Backlinks': 'rgb(223,153,247)',
      'Greentext': 'rgb(108,204,102)',
      'Board Title': 'rgb(103,204,232)',
      'Timestamps': 'rgb(218,105,224)',
      'Inputs': 'rgb(218,105,224)',
      'Warnings': 'rgb(103,204,232)',
      'Shadow Color': 'rgba(0,0,0,.1)',
      'Custom CSS': ".reply.post {\n  box-shadow: inset 0px 1px 2px 1px #111;\n}\n#qr {\n  box-shadow: none;\n}\n#qr textarea,\n#qr input[name=\"name\"],\n#qr input[name=\"email\"],\n#qr input[name=\"sub\"],\n#qr input[title=\"Verification\"] {\n  box-shadow: inset 0px 1px 2px 0px #111;\n}\n#qp .post {\n  background-color: rgba(29,29,33,1);\n  border: 1px solid rgba(95,137,172,0.4);\n}"
    },
    'Midnight Caek': {
      'Author': 'Zixaphir',
      'Author Tripcode': '!M.........',
      'Background Color': 'rgba(16,16,16,1)',
      'Thread Wrapper Background': 'rgba(0,0,0,0)',
      'Thread Wrapper Border': 'rgba(0,0,0,0)',
      'Dialog Background': 'rgba(28,28,28,1)',
      'Dialog Border': 'rgba(28,28,28,1)',
      'Reply Background': 'rgba(28,28,28,1)',
      'Reply Border': 'rgba(28,28,28,1)',
      'Highlighted Reply Background': 'rgba(24,24,24,1)',
      'Highlighted Reply Border': 'rgba(24,24,24,1)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Input Background': 'rgba(28,28,28,1)',
      'Input Border': 'rgba(28,28,28,1)',
      'Hovered Input Background': 'rgba(24,24,24,1)',
      'Hovered Input Border': 'rgba(24,24,24,1)',
      'Focused Input Background': 'rgba(16,16,16,1)',
      'Focused Input Border': 'rgba(28,28,28,1)',
      'Checkbox Background': 'rgba(0,0,0,1)',
      'Checkbox Border': 'rgba(60,60,60,1)',
      'Buttons Background': 'rgba(24,24,24,1)',
      'Buttons Border': 'rgba(24,24,24,1)',
      'Navigation Background': 'rgba(16,16,16,0.9)',
      'Navigation Border': 'rgba(16,16,16,0.9)',
      'Quotelinks': 'rgb(71,71,91)',
      'Backlinks': 'rgb(66,66,71)',
      'Links': 'rgb(87,87,123)',
      'Hovered Links': 'rgb(71,71,91)',
      'Navigation Links': 'rgb(144,144,144)',
      'Hovered Navigation Links': 'rgb(71,71,91)',
      'Names': 'rgb(124,45,45)',
      'Tripcodes': 'rgb(62,113,87)',
      'Emails': 'rgb(68,68,68)',
      'Subjects': 'rgb(170,170,170)',
      'Text': 'rgb(144,144,144)',
      'Inputs': 'rgb(144,144,144)',
      'Post Numbers': 'rgb(144,144,144)',
      'Greentext': 'rgb(113,121,62)',
      'Sage': 'rgb(68,68,68)',
      'Board Title': 'rgb(144,144,144)',
      'Timestamps': 'rgb(144,144,144)',
      'Warnings': 'rgb(87,87,123)',
      'Shadow Color': 'rgba(0,0,0,.1)',
      'Custom CSS': ''
    },
    'Minimalistic Mayhem': {
      'Author': 'Mayhem',
      'Author Tripcode': '!MayhemYDG.',
      'Background Image': 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAAXNSR0IArs4c6QAAACdJREFUCNdNxzEBADAMwzCnOMwfWYDs2JNPCgCoH9m0zQa4jXob4AGJFwxchPNwQAAAAABJRU5ErkJggg==")',
      'Background Color': 'rgba(25,25,25,1)',
      'Dialog Background': 'rgba(34,34,34,1)',
      'Dialog Border': 'rgba(41,41,41,1)',
      'Thread Wrapper Background': 'rgba(34,34,34,1)',
      'Thread Wrapper Border': 'rgba(0,0,0,1)',
      'Reply Background': 'rgba(51,51,51,1)',
      'Reply Border': 'rgba(17,17,17,1)',
      'Highlighted Reply Background': 'rgba(37,38,42,1)',
      'Highlighted Reply Border': 'rgba(85,85,85,1)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Checkbox Background': 'rgba(57,57,57,1)',
      'Checkbox Border': 'rgba(25,25,25,1)',
      'Input Background': 'rgba(34,34,34,1)',
      'Input Border': 'rgba(21,21,21,1)',
      'Focused Input Background': 'rgba(32,32,32,1)',
      'Focused Input Border': 'rgba(102,102,102,1)',
      'Hovered Input Background': 'rgba(24,24,24,1)',
      'Hovered Input Border': 'rgba(21,21,21,1)',
      'Buttons Background': 'rgba(32,32,32,1)',
      'Buttons Border': 'rgba(16,16,16,1)',
      'Navigation Background': 'rgba(26,26,26,0.9)',
      'Navigation Border': 'rgba(26,26,26,0.9)',
      'Links': 'rgb(85,156,122)',
      'Hovered Links': 'rgb(199,222,26)',
      'Navigation Links': 'rgb(144,144,144)',
      'Hovered Navigation Links': 'rgb(198,23,230)',
      'Subjects': 'rgb(72,98,115)',
      'Names': 'rgb(46,136,166)',
      'Sage': 'rgb(124,45,45)',
      'Tripcodes': 'rgb(140,93,42)',
      'Emails': 'rgb(174,43,41)',
      'Post Numbers': 'rgb(137,115,153)',
      'Text': 'rgb(221,221,221)',
      'Quotelinks': 'rgb(139,164,70)',
      'Backlinks': 'rgb(139,164,70)',
      'Greentext': 'rgb(139,164,70)',
      'Board Title': 'rgb(187,187,187)',
      'Timestamps': 'rgb(221,221,221)',
      'Inputs': 'rgb(187,187,187)',
      'Warnings': 'rgb(87,87,123)',
      'Shadow Color': 'rgba(0,0,0,.1)',
      'Custom CSS': ".nameBlock > .useremail > postertrip {\n  color: rgb(137,115,153);\n}\na.backlink:hover {\n  color: rgb(198,23,230);\n}\n.reply:target,\n.reply.highlight:target {\n  background:rgb(37,38,42);\n}\n[alt=\"sticky\"] + a {\n  color: rgb(242,141,0);\n}\n[alt=\"closed\"] + a {\n  color: rgb(178,171,130);\n}\ninput:checked .rice {\n  border-color:rgb(21,21,21);\n}\ninput[type=\"submit\"],\ninput[type=\"button\"],\nbutton {\n  background: linear-gradient(#393939, #292929);\n  border: 1px solid #191919;\n  color: #AAA;\n  text-shadow: 0 1px 1px #191919;\n}\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\nbackground-color: #393939;\n  border: 1px solid #191919;\n}\ninput[type=\"checkbox\"]:checked,\ninput[type=\"radio\"]:checked {\n  background: linear-gradient(#595959, #393939);\n  border: 1px solid #151515;\n}\n.board .thread {\n  padding: 7px;\n}\n.subject:hover,\ndiv.post:hover .subject {\n  color: #3F8DBF !important;\n}\n.postertrip:hover,\ndiv.post:hover .postertrip {\n  color:#CC7212 !important;\n}\n.name:hover,\ndiv.post:hover .name {\n  color: #0AAEE7 !important;\n}\n.name,\n.subject,\n.postertrip {\n  -webkit-transition:color .3s ease-in-out;\n  -moz-transition:color .3s ease-in-out;\n  -o-transition:color .3s ease-in-out;\n}"
    },
    'ObsidianChan': {
      'Author': 'seaweed',
      'Author Tripcode': '!POMF.9waa',
      'Background Image': 'url("http://i.imgur.com/sbi8u.png")',
      'Background Attachment': 'fixed',
      'Dialog Background': 'rgba(0,0,0,0.7)',
      'Dialog Border': 'rgba(0,0,0,0.7)',
      'Background Color': 'rgba(0,0,0,1)',
      'Thread Wrapper Background': 'rgba(0,0,0,0.3)',
      'Thread Wrapper Border': 'rgba(51,51,51,1)',
      'Reply Background': 'rgba(0,0,0,0.6)',
      'Reply Border': 'rgba(0,0,0,0.6)',
      'Highlighted Reply Background': 'rgba(0,0,0,0.4)',
      'Highlighted Reply Border': 'rgba(0,0,0,0.4)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Checkbox Background': 'rgba(68,68,68,1)',
      'Checkbox Border': 'rgba(68,68,68,1)',
      'Input Background': 'rgba(0,0,0,0.6)',
      'Input Border': 'rgba(0,0,0,0.6)',
      'Hovered Input Background': 'rgba(0,0,0,0.4)',
      'Hovered Input Border': 'rgba(0,0,0,0.4)',
      'Focused Input Background': 'rgba(0,0,0,0.4)',
      'Focused Input Border': 'rgba(0,0,0,0.4)',
      'Buttons Background': 'rgba(0,0,0,0.4)',
      'Buttons Border': 'rgba(0,0,0,0.4)',
      'Navigation Background': 'rgba(0,0,0,0.7)',
      'Navigation Border': 'rgba(0,0,0,0.7)',
      'Links': 'rgb(0,255,255)',
      'Hovered Links': 'rgb(0,255,255)',
      'Navigation Links': 'rgb(253,254,255)',
      'Hovered Navigation Links': 'rgb(253,254,255)',
      'Subjects': 'rgb(144,144,144)',
      'Names': 'rgb(253,254,255)',
      'Sage': 'rgb(253,254,255)',
      'Tripcodes': 'rgb(255,82,203)',
      'Emails': 'rgb(0,255,255)',
      'Post Numbers': 'rgb(0,255,255)',
      'Text': 'rgb(253,254,255)',
      'Quotelinks': 'rgb(0,255,255)',
      'Backlinks': 'rgb(0,255,255)',
      'Greentext': 'rgb(67,204,103)',
      'Board Title': 'rgb(253,254,255)',
      'Timestamps': 'rgb(253,254,255)',
      'Inputs': 'rgb(253,254,255)',
      'Warnings': 'rgb(0,255,255)',
      'Shadow Color': 'rgba(0,0,0,.1)',
      'Custom CSS': "#qp div.post{\n  background-color:rgba(0,0,0,0.8);\n  border: 1px solid #333;\n}\n#qr {\n  background-color: rgba(0,0,0,0.7);\n  border: 1px solid #333;\n}"
    },
    'PaisleyChan': {
      'Author': 'Ubuntufriend',
      'Author Tripcode': '!TRip.C0d3',
      'Background Image': 'url(http://i.imgur.com/DRaZf.jpg)',
      'Background Attachment': 'fixed',
      'Background Repeat': 'repeat',
      'Background Color': 'rgba(19,19,19,1)',
      'Dialog Background': 'rgba(16,16,16,1)',
      'Dialog Border': 'rgba(16,16,16,1)',
      'Thread Wrapper Background': 'rgba(52,56,56,0.3)',
      'Thread Wrapper Border': 'rgba(52,56,56,0.3)',
      'Reply Background': 'rgba(52,56,56,1)',
      'Reply Border': 'rgba(0,0,0,0)',
      'Highlighted Reply Background': 'rgba(0,0,0,0)',
      'Highlighted Reply Border': 'rgba(0,0,0,0)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Checkbox Background': 'rgba(34,34,34,1)',
      'Checkbox Border': 'rgba(60,60,60,1)',
      'Input Background': 'rgba(28,28,28,1)',
      'Input Border': 'rgba(28,28,28,1)',
      'Hovered Input Background': 'rgba(24,24,24,1)',
      'Hovered Input Border': 'rgba(24,24,24,1)',
      'Focused Input Background': 'rgba(32,32,32,1)',
      'Focused Input Border': 'rgba(32,32,32,1)',
      'Buttons Background': 'rgba(32,32,32,1)',
      'Buttons Border': 'rgba(32,32,32,1)',
      'Navigation Background': 'rgba(16,16,16,0.9)',
      'Navigation Border': 'rgba(16,16,16,0.9)',
      'Links': 'rgb(187,187,187)',
      'Hovered Links': 'rgb(0,223,252)',
      'Navigation Links': 'rgb(153,153,153)',
      'Hovered Navigation Links': 'rgb(0,223,252)',
      'Subjects': 'rgb(170,170,170)',
      'Names': 'rgb(128,172,206)',
      'Sage': 'rgb(153,153,153)',
      'Tripcodes': 'rgb(128,172,206)',
      'Emails': 'rgb(187,187,187)',
      'Post Numbers': 'rgb(153,153,153)',
      'Text': 'rgb(153,153,153)',
      'Quotelinks': 'rgb(212,212,212)',
      'Backlinks': 'rgb(212,212,212)',
      'Greentext': 'rgb(152,185,98)',
      'Board Title': 'rgb(153,153,153)',
      'Timestamps': 'rgb(153,153,153)',
      'Inputs': 'rgb(153,153,153)',
      'Warnings': 'rgb(187,187,187)',
      'Shadow Color': 'rgba(0,0,0,.1)',
      'Custom CSS': "#appchanx-settings {\n  background-color: rgba(16,16,16,1) !important;\n}\n#delform blockquote {\n  border-radius:3px;\n  color:#bbb;\n  background:#343838;\n  padding:8px;\n  box-shadow:0px 0px 20px rgba(25,25,25,0.6);\n  border:1px solid #343838;\n  border-bottom:2px solid #444848;\n  border-radius:0px 6px 6px 6px;\n  padding-top:15px;\n}\n.name {\n  font-weight:800;\n}\n.nameBlock > .useremail > .name:hover,\n.nameBlock> .useremail> .postertrip:hover {\n  color:#00dffc;\n}\na.forwardlink {\n  color:#608cae;\n  font-weight:800;\n}\ndiv.reply,\n.reply.highlight {\n  padding:0;\n}\n#qp div.post {\n  border:1px solid rgba(128,172,206,0.5) !important;\n  background-color: rgba(24,24,24,0.9) !important;\n}\n.name,\n.postertrip {\n  text-shadow:0px 0px 6px rgba(20,20,20,0.9);\n  font-weight:bold;\n  background:#343838;\n  border:1px solid #343838;\n  border-radius:5px 5px 0px 0px;\n  padding:4px 6px;\n  padding-top:2px;\n}\n.board,\n.board blockquote {\n  margin:0 10px 15px 0 !important;\n  padding:0px;\n}\na {\n  -moz-transition:all 0.5s ease;\n  -webkit-transition:all 0.5s ease;\n  -o-transition:all 0.5s ease;\n}\na.pointer{\n  font-weight:bold;\n  font-weight:normal;\n  color:#777;\n  padding-right:5px;\n}\n.board .opContainer,\n.board .replyContainer {\n  opacity:0.45;\n  transition:all 0.5s ease;\n}\n.board .opContainer:hover,\n.board .replyContainer:hover {\n  opacity:1;\n}\n.reply.post,\n.reply.highlight {\n  background:transparent;\n  border:0px;\n  padding:0px;\n  padding-bottom:0px;\n  border-radius:6px;\n}\n#delform blockquote {\n  padding:5px;\n  background:#343838;\n  margin-top:0px;\n  min-height:20px;\n  padding-top:10px;\n  clear:none;\n}\n#delform blockquote::after {\n  content: ' ';\n  clear: both;\n}\n#delform .file + blockquote {\n  margin-top: -1.4em !important;\n  padding-top: 1.4em !important;\n  padding-left:165px !important;\n}\n.file {\n  margin-top: 2px;\n}\na.backlink{\nborder:1px solid #343838;\nborder-radius:5px 5px 0px 0px;\nbackground:#343838;\npadding:2px 4px 2px;\n  text-decoration:none;\n}\na.forwardlink{\n  color:#608CAE;\n  text-shadow:0 0 6px rgba(96,140,174,0.8);\n}\n.subject{\n  font-weight: bold;\n  letter-spacing: 3px;\n  background: transparent;\n}\n.reply.post {\n  background-color: rgba(0,0,0,0) !important;\n  border: none !important;\n}\n#qp div.post .name,\n#qp div.post a.backlink,\n#qp div.post blockquote {\n  background:none !important;\n  border:none !important;\n  box-shadow:none !important;\n  border-radius:0px !important;\n}"
    },
    'Photon': {
      'Author': 'seaweed',
      'Author Tripcode': '!POMF.9waa',
      'Background Color': 'rgba(238,238,238,1)',
      'Dialog Background': 'rgba(238,238,238,1)',
      'Dialog Border': 'rgba(204,204,204,1)',
      'Thread Wrapper Background': 'rgba(0,0,0,0)',
      'Thread Wrapper Border': 'rgba(0,0,0,0)',
      'Reply Background': 'rgba(221,221,221,1)',
      'Reply Border': 'rgba(204,204,204,1)',
      'Highlighted Reply Background': 'rgba(204,204,204,1)',
      'Highlighted Reply Border': 'rgba(204,204,204,1)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Checkbox Background': 'rgba(255,255,238)',
      'Checkbox Border': 'rgba(255,255,238)',
      'Input Background': 'rgba(255,255,255,1)',
      'Input Border': 'rgba(204,204,204,1)',
      'Hovered Input Background': 'rgba(204,204,204,1)',
      'Hovered Input Border': 'rgba(204,204,204,1)',
      'Focused Input Background': 'rgba(255,255,255,1)',
      'Focused Input Border': 'rgba(0,74,153,1)',
      'Buttons Background': 'rgba(255,255,238,1)',
      'Buttons Border': 'rgba(204,204,204,1)',
      'Navigation Background': 'rgba(238,238,238,0.9)',
      'Navigation Border': 'rgba(238,238,238,0.9)',
      'Links': 'rgb(255,102,0)',
      'Hovered Links': 'rgb(255,51,0)',
      'Navigation Links': 'rgb(17,17,17)',
      'Hovered Navigation Links': 'rgb(255,51,0)',
      'Subjects': 'rgb(17,17,17)',
      'Names': 'rgb(0,74,153)',
      'Sage': 'rgb(51,51,51)',
      'Tripcodes': 'rgb(255,51,0)',
      'Emails': 'rgb(255,102,0)',
      'Post Numbers': 'rgb(51,51,51)',
      'Text': 'rgb(51,51,51)',
      'Quotelinks': 'rgb(17,17,17)',
      'Backlinks': 'rgb(17,17,17)',
      'Greentext': 'rgb(120,153,34)',
      'Board Title': 'rgb(0,74,153)',
      'Timestamps': 'rgb(51,51,51)',
      'Inputs': 'rgb(0,0,0)',
      'Warnings': 'rgb(51,51,51)',
      'Shadow Color': 'rgba(0,0,0,.05)',
      'Custom CSS': ".fileText{\n  color: rgb(102,102,102);\n}\n.boardTitle {\n  color: #004a99 !important;\n  text-shadow: 1px 1px 1px #222 !important;\n}\n.boardSubtitle,\n.boardBanner .boardSubtitle > a  {\n  text-shadow: none !important;\n}"
    },
    'RedUX': {
      'Author': 'Zixaphir',
      'Author Tripcode': '!VGsTHECURE',
      'Background Image': 'linear-gradient(rgba(210,210,210,0.7), rgba(240,240,240,0.4) 400px, rgba(240,240,240,0.3)), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAACEAQMAAABrihHkAAAABlBMVEX///8AAABVwtN+AAAAAnRSTlMASuCaZbYAAAA+SURBVHhe7c2xCQAgDAXRKywsHcFRdDNxchtBkhHk4Lp88ui7hhaztBCkyYZ7fFHzI/Jk/GRpaWlpaWlpaR3scHNQSY3kigAAAABJRU5ErkJggg==")',
      'Background Attachment': 'fixed, scroll',
      'Background Position': 'top, center',
      'Background Repeat': 'no-repeat, repeat',
      'Background Color': 'rgba(238,242,255,1)',
      'Thread Wrapper Background': 'rgb(230,230,230)',
      'Thread Wrapper Border': 'rgba(204,204,204,1)',
      'Dialog Background': 'linear-gradient(rgb(222,222,222), rgb(240,240,240) 200px, rgb(240,240,240))',
      'Dialog Border': 'rgb(220,210,210)',
      'Reply Background': 'rgba(230,230,230,1)',
      'Reply Border': 'rgba(204,204,204,1)',
      'Highlighted Reply Background': 'rgba(219,219,219,1)',
      'Highlighted Reply Border': 'rgba(219,219,219,1)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Input Background': 'linear-gradient(rgb(222,222,222), rgb(240,240,240)), rgb(240,240,240)',
      'Input Border': 'rgb(220,210,210)',
      'Hovered Input Background': 'linear-gradient(rgba(214,186,208,0.7), rgb(240,240,240)), rgb(240,240,240)',
      'Hovered Input Border': 'rgba(214,186,208,1)',
      'Focused Input Background': 'rgb(240,240,240)',
      'Focused Input Border': 'rgb(220,210,210)',
      'Checkbox Background': 'rgba(238,242,255,1)',
      'Checkbox Border': 'rgba(180,180,180,1)',
      'Buttons Background': 'linear-gradient(rgb(222,222,222), rgb(240,240,240)), rgb(240,240,240)',
      'Buttons Border': 'rgb(220,210,210)',
      'Navigation Background': 'rgba(230,230,230,0.8)',
      'Navigation Border': 'rgba(204,204,204,1)',
      'Quotelinks': 'rgb(153,51,51)',
      'Backlinks': 'rgb(153,51,51)',
      'Links': 'rgb(87,87,123)',
      'Hovered Links': 'rgb(221,0,0)',
      'Navigation Links': 'rgb(0,0,0)',
      'Hovered Navigation Links': 'rgb(87,87,123)',
      'Names': 'rgb(119,51,51)',
      'Tripcodes': 'rgb(119,51,51)',
      'Emails': 'rgb(87,87,123)',
      'Subjects': 'rgb(15,12,93)',
      'Text': 'rgb(0,0,0)',
      'Inputs': 'rgb(0,0,0)',
      'Post Numbers': 'rgb(0,0,0)',
      'Greentext': 'rgb(34,133,34)',
      'Sage': 'rgb(87,87,123)',
      'Board Title': 'rgb(119,51,51)',
      'Timestamps': 'rgb(0,0,0)',
      'Warnings': 'rgb(87,87,123)',
      'Shadow Color': 'rgba(0,0,0,.07)',
      'Custom CSS': ".board .reply {\n  background-color: transparent;\n  border-color: #ccc transparent transparent transparent;\n  border-style: solid;\n  border-radius: 0 !important;\n  margin-bottom: 0;\n}\n#themes {\n  text-shadow: none;\n}\n#qp {\n  text-shadow: 1px 0 0 rgb(0,0,0),\n    1px 1px 0 rgb(0,0,0),\n    0 1px 0 rgb(0,0,0),\n    1px 1px 2px rgb(0,0,0);\n}\n#qp .op.post,\n#qp .reply.post {\n  border: 1px rgba(0,0,0,0.7) solid;\n  background: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.5)), transparent;\n}\n#qp div.post,\n#qp .pln,\n#qp .postNum a {\n  color: #fcd;\n}\n#qp .dateTime {\n  color: #fcd !important;\n}\n#qp .subject,\n#qp .nameBlock > .useremail > .name,\n#qp .nameBlock > .useremail > .postertrip,\n#qp .name,\n#qp .postertrip,\n#qp .trip {\n  color: #ffaac0 !important;\n}\n#qp a {\n  color: #aaaac8;\n}\n.boardBanner a,\n#qp a.backlink,\n#qp span.quote > a.quotelink {\n  color: rgb(255,255,255);\n}\n#qp span.quote {\n  color: rgb(130,163,100);\n}\n.board {\n  box-shadow: 0 20px 40px 10px rgba(0,0,0,0.1);\n  border-radius: 4px;\n}\n:not(#themes) .rice {\n  box-shadow:rgba(170, 170, 170,0.3) 0 1px;\n}\n#qp .prettyprint {\n  background-color: rgba(0,0,0,0.3);\n  border: 1px solid rgba(0,0,0,0.5);\n}\n#qp span.tag {\n  color: #96562c;\n}\n#qp span.pun {\n  color: #5b6f2a;\n}\n#qp span.com {\n  color: #a34443;\n}\n#qp span.str,\n#qp span.atv {\n  color: #8ba446;\n}\n#qp span.kwd {\n  color: #987d3e;\n}\n#qp span.typ,\n#qp span.atn {\n  color: #897399;\n}\n#qp span.lit {\n  color: #558773;\n}"
    },
    'Solarized': {
      'Author': 'ubuntufriend',
      'Author Tripcode': '!TRip.C0d',
      'Background Color': 'rgba(7,54,66,1)',
      'Dialog Background': 'rgba(0,43,54,1)',
      'Dialog Border': 'rgba(0,43,54,1)',
      'Thread Wrapper Background': 'rgba(0,0,0,0)',
      'Thread Wrapper Border': 'rgba(0,0,0,0)',
      'Reply Background': 'rgba(0,43,54,1)',
      'Reply Border': 'rgba(0,43,54,1)',
      'Highlighted Reply Background': 'rgba(7,54,66,1)',
      'Highlighted Reply Border': 'rgba(7,54,66,1)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Checkbox Background': 'rgba(88,110,117,1)',
      'Checkbox Border': 'rgba(88,110,117,1)',
      'Input Background': 'rgba(0,43,54,1)',
      'Input Border': 'rgba(0,43,54,1)',
      'Hovered Input Background': 'rgba(7,54,66,1)',
      'Hovered Input Border': 'rgba(7,54,66,1)',
      'Focused Input Background': 'rgba(7,54,66,1)',
      'Focused Input Border': 'rgba(7,54,66,1)',
      'Buttons Background': 'rgba(0,43,54,1)',
      'Buttons Border': 'rgba(0,43,54,1)',
      'Navigation Background': 'rgba(7,54,66,1)',
      'Navigation Border': 'rgba(7,54,66,1)',
      'Links': 'rgb(108,113,196)',
      'Hovered Links': 'rgb(211,54,130)',
      'Navigation Links': 'rgb(147,161,161)',
      'Hovered Navigation Links': 'rgb(211,54,130)',
      'Subjects': 'rgb(203,75,22)',
      'Names': 'rgb(88,110,117)',
      'Sage': 'rgb(108,113,196)',
      'Tripcodes': 'rgb(42,161,152)',
      'Emails': 'rgb(108,113,196)',
      'Post Numbers': 'rgb(147,161,161)',
      'Text': 'rgb(147,161,161)',
      'Quotelinks': 'rgb(79,95,143)',
      'Backlinks': 'rgb(79,95,143)',
      'Greentext': 'rgb(133,153,0)',
      'Board Title': 'rgb(147,161,161)',
      'Timestamps': 'rgb(147,161,161)',
      'Inputs': 'rgb(147,161,161)',
      'Warnings': 'rgb(108,113,196)',
      'Shadow Color': 'rgba(0,0,0,.1)',
      'Custom CSS': "#qp div.post {\n  background-color:rgba(7,54,66,0.9);\n  border:1px solid rgba(79,95,143,0.9);\n}"
    },
    'Yotsuba': {
      'Author': 'moot',
      'Author Tripcode': '!Ep8pui8Vw2',
      'Background Image': 'linear-gradient(rgb(254,214,175), rgb(255,255,238) 200px, rgb(255,255,238))',
      'Background Color': 'rgba(255,255,238,1)',
      'Dialog Background': 'rgba(240,224,214,1)',
      'Dialog Border': 'rgba(217,191,183,1)',
      'Thread Wrapper Background': 'rgba(0,0,0,0)',
      'Thread Wrapper Border': 'rgba(0,0,0,0)',
      'Reply Background': 'rgba(240,224,214,1)',
      'Reply Border': 'rgba(217,191,183,1)',
      'Highlighted Reply Background': 'rgba(240,192,176,1)',
      'Highlighted Reply Border': 'rgba(217,191,183,1)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Checkbox Background': 'rgba(255,255,238,1)',
      'Checkbox Border': 'rgba(217,191,183,1)',
      'Input Background': 'rgba(240,224,214,1)',
      'Input Border': 'rgba(217,191,183,1)',
      'Hovered Input Background': 'rgba(240,224,214,1)',
      'Hovered Input Border': 'rgba(217,191,183,1)',
      'Focused Input Background': 'rgba(255,255,255,1)',
      'Focused Input Border': 'rgba(128,0,0,1)',
      'Buttons Background': 'rgba(240,192,176,1)',
      'Buttons Border': 'rgba(217,191,183,1)',
      'Navigation Background': 'rgba(240,192,176,0.7)',
      'Navigation Border': 'rgba(217,191,183,1)',
      'Links': 'rgb(186,0,0)',
      'Hovered Links': 'rgb(221,0,0)',
      'Navigation Links': 'rgb(128,0,0)',
      'Hovered Navigation Links': 'rgb(221,0,0)',
      'Subjects': 'rgb(204,17,5)',
      'Names': 'rgb(17,119,67)',
      'Sage': 'rgb(204,17,17)',
      'Tripcodes': 'rgb(34,136,84)',
      'Emails': 'rgb(186,0,0)',
      'Post Numbers': 'rgb(128,0,0)',
      'Text': 'rgb(128,0,0)',
      'Quotelinks': 'rgb(221,0,0)',
      'Backlinks': 'rgb(220,0,0)',
      'Greentext': 'rgb(120,153,34)',
      'Board Title': 'rgb(204,17,5)',
      'Timestamps': 'rgb(186,0,0)',
      'Inputs': 'rgb(0,0,0)',
      'Warnings': 'rgb(128,0,0)',
      'Shadow Color': 'rgba(0,0,0,.05)',
      'Custom CSS': "#qp div.post {\n  background-color:rgba(240,192,176,1);\n  box-shadow:5px 5px 5px rgba(128,128,128,0.5);\n}\n.reply.post {\n  border-color: transparent rgba(240,224,214,1) rgba(240,224,214,1) transparent;\n}"
    },
    'Yotsuba B': {
      'Author': 'moot',
      'Author Tripcode': '!Ep8pui8Vw2',
      'Background Image': 'linear-gradient(rgb(209,213,238), rgb(238,242,255) 200px, rgb(238,242,255))',
      'Background Color': 'rgba(238,242,255,1)',
      'Dialog Background': 'rgba(214,218,240,1)',
      'Dialog Border': 'rgba(183,197,217,1)',
      'Thread Wrapper Background': 'rgba(0,0,0,0)',
      'Thread Wrapper Border': 'rgba(0,0,0,0)',
      'Reply Background': 'rgba(214,218,240,1)',
      'Reply Border': 'rgba(183,197,217,1)',
      'Highlighted Reply Background': 'rgba(214,186,208,1)',
      'Highlighted Reply Border': 'rgba(183,197,217,1)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Checkbox Background': 'rgba(238,242,255,1)',
      'Checkbox Border': 'rgba(183,197,217,1)',
      'Input Background': 'rgba(238,242,255,1)',
      'Input Border': 'rgba(183,197,217,1)',
      'Hovered Input Background': 'rgba(214,186,208,1)',
      'Hovered Input Border': 'rgba(183,197,217,1)',
      'Focused Input Background': 'rgba(214,218,240,1)',
      'Focused Input Border': 'rgba(153,136,238,1)',
      'Buttons Background': 'rgba(214,218,240,1)',
      'Buttons Border': 'rgba(183,197,217,1)',
      'Navigation Background': 'rgba(211,215,238,0.7)',
      'Navigation Border': 'rgba(183,197,217,1)',
      'Links': 'rgb(52,52,92)',
      'Hovered Links': 'rgb(221,0,0)',
      'Navigation Links': 'rgb(0,0,0)',
      'Hovered Navigation Links': 'rgb(221,0,0)',
      'Subjects': 'rgb(15,12,93)',
      'Names': 'rgb(17,119,67)',
      'Sage': 'rgb(153,0,0)',
      'Tripcodes': 'rgb(34,136,84)',
      'Emails': 'rgb(87,87,123)',
      'Post Numbers': 'rgb(0,0,0)',
      'Text': 'rgb(0,0,0)',
      'Quotelinks': 'rgb(221,0,0)',
      'Backlinks': 'rgb(52,52,92)',
      'Greentext': 'rgb(120,153,34)',
      'Board Title': 'rgb(175,10,15)',
      'Timestamps': 'rgb(0,0,0)',
      'Inputs': 'rgb(0,0,0)',
      'Warnings': 'rgb(87,87,123)',
      'Shadow Color': 'rgba(0,0,0,.05)',
      'Custom CSS': "#qp div.post {\n  background-color:rgba(214,186,208,1);\n  box-shadow:5px 5px 5px rgba(128,128,128,0.5);\n}\n.reply.post {\n  border-color: transparent rgba(183,197,217,1) rgba(183,197,217,1) transparent;\n}"
    },
    'Zenburned': {
      'Author': 'lazy',
      'Author Tripcode': '!HONKYn7h1.',
      'Background Color': 'rgba(63,63,63,1)',
      'Dialog Background': 'rgba(87,87,87,1)',
      'Dialog Border': 'rgba(87,87,87,1)',
      'Thread Wrapper Background': 'rgba(0,0,0,0)',
      'Thread Wrapper Border': 'rgba(0,0,0,0)',
      'Reply Background': 'rgba(87,87,87,1)',
      'Reply Border': 'rgba(87,87,87,1)',
      'Highlighted Reply Background': 'rgba(38,38,38,1)',
      'Highlighted Reply Border': 'rgba(38,38,38,1)',
      'Backlinked Reply Outline': 'rgba(98,124,141,1)',
      'Checkbox Background': 'rgba(63,63,63,1)',
      'Checkbox Border': 'rgba(136,136,136,1)',
      'Input Background': 'rgba(87,87,87,1)',
      'Input Border': 'rgba(136,136,136,1)',
      'Hovered Input Background': 'rgba(38,38,38,1)',
      'Hovered Input Border': 'rgba(38,38,38,1)',
      'Focused Input Background': 'rgba(38,38,38,1)',
      'Focused Input Border': 'rgba(153,136,238,1)',
      'Buttons Background': 'rgba(49,60,54,1)',
      'Buttons Border': 'rgba(136,136,136,1)',
      'Navigation Background': 'rgba(63,63,63,0.9)',
      'Navigation Border': 'rgba(63,63,63,0.9)',
      'Links': 'rgb(239,220,188)',
      'Hovered Links': 'rgb(248,248,147)',
      'Navigation Links': 'rgb(220,220,204)',
      'Hovered Navigation Links': 'rgb(248,248,147)',
      'Subjects': 'rgb(170,170,170)',
      'Names': 'rgb(192,190,209)',
      'Sage': 'rgb(220,220,204)',
      'Tripcodes': 'rgb(140,208,211)',
      'Emails': 'rgb(239,220,188)',
      'Post Numbers': 'rgb(220,220,204)',
      'Text': 'rgb(220,220,204)',
      'Quotelinks': 'rgb(220,163,163)',
      'Backlinks': 'rgb(220,163,163)',
      'Greentext': 'rgb(127,159,127)',
      'Board Title': 'rgb(220,220,204)',
      'Timestamps': 'rgb(220,220,204)',
      'Inputs': 'rgb(220,220,204)',
      'Warnings': 'rgb(239,220,188)',
      'Shadow Color': 'rgba(0,0,0,.1)',
      'Custom CSS': ''
    },
    "ピンク": {
      "Author": "DrooidKun",
      "Author Tripcode": "!/Apk/MRkGM",
      "Background Color": "rgb(255,255,255)",
      "Dialog Background": "rgba(242,242,242,.98)",
      "Dialog Border": "rgb(240,240,240)",
      "Thread Wrapper Background": "rgba(0,0,0,0)",
      "Thread Wrapper Border": "rgba(0,0,0,0)",
      "Reply Background": "rgba(242,242,242,1.0)",
      "Reply Border": "rgb(240,240,240)",
      "Highlighted Reply Background": "rgba(238,238,238,1.0)",
      "Highlighted Reply Border": "rgb(191,122,180)",
      "Backlinked Reply Outline": "rgb(191,122,180)",
      "Checkbox Background": "rgba(240,240,240,1.0)",
      "Checkbox Border": "rgb(222,222,222)",
      "Input Background": "rgba(240,240,240,1.0)",
      "Input Border": "rgb(222,222,222)",
      "Hovered Input Background": "rgba(224,224,224,1.0)",
      "Hovered Input Border": "rgb(222,222,222)",
      "Focused Input Background": "rgba(224,224,224,1.0)",
      "Focused Input Border": "rgb(222,222,222)",
      "Buttons Background": "rgba(240,240,240,1.0)",
      "Buttons Border": "rgb(222,222,222)",
      "Navigation Background": "rgba(255,255,255,0.8)",
      "Navigation Border": "rgb(242,242,242)",
      "Quotelinks": "rgb(191,122,180)",
      "Links": "rgb(191,122,180)",
      "Hovered Links": "rgb(198,105,201)",
      "Navigation Links": "rgb(77,77,76)",
      "Hovered Navigation Links": "rgb(198,105,201)",
      "Subjects": "rgb(77,77,77)",
      "Names": "rgb(204,94,193)",
      "Sage": "rgb(200,40,41)",
      "Tripcodes": "rgb(198,105,201)",
      "Emails": "rgb(191,122,180)",
      "Post Numbers": "rgb(191,122,180)",
      "Text": "rgb(77,77,76)",
      "Backlinks": "rgb(191,122,180)",
      "Greentext": "rgb(113,140,0)",
      "Board Title": "rgb(77,77,76)",
      "Timestamps": "rgb(77,77,76)",
      "Inputs": "rgb(77,77,76)",
      "Warnings": "rgb(200,40,41)",
      "Shadow Color": "rgba(0,0,0,0.05)",
      "Custom CSS": ".rice {\n  box-shadow:rgba(255,255,255,.3) 0 1px;\n}\nnput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}\n.boardTitle {\n  color: #cc5ec1 !important;\n  text-shadow: 1px 1px 1px #772E28 !important;\n}\n.boardSubtitle,\n.boardBanner .boardSubtitle > a {\n  text-shadow: none !important;\n}"
    },
    "Yotsuba Purple": {
      "Author": "seaweed",
      "Author Tripcode": "!POMF.9waa",
      "Background Image": "linear-gradient(rgba(238,221,255,1.0), rgba(248,243,254,1) 200px, rgba(248,243,254,1))",
      "Background Color": "rgb(248,243,254)",
      "Dialog Background": "rgba(238,221,255,.98)",
      "Dialog Border": "rgb(202,183,217)",
      "Thread Wrapper Background": "rgba(0,0,0,0)",
      "Thread Wrapper Border": "rgba(0,0,0,0)",
      "Reply Background": "rgba(238,221,255,1.0)",
      "Reply Border": "rgb(202,183,217)",
      "Highlighted Reply Background": "rgba(234,217,251,1.0)",
      "Highlighted Reply Border": "rgb(150,37,148)",
      "Backlinked Reply Outline": "rgb(150,37,148)",
      "Checkbox Background": "rgba(255,255,255,1.0)",
      "Checkbox Border": "rgb(202,183,217)",
      "Input Background": "rgba(255,255,255,1.0)",
      "Input Border": "rgb(202,183,217)",
      "Hovered Input Background": "rgba(239,239,239,1.0)",
      "Hovered Input Border": "rgb(202,183,217)",
      "Focused Input Background": "rgba(239,239,239,1.0)",
      "Focused Input Border": "rgb(202,183,217)",
      "Buttons Background": "rgba(255,255,255,1.0)",
      "Buttons Border": "rgb(202,183,217)",
      "Navigation Background": "rgba(229, 219, 240,.9)",
      "Navigation Border": "rgb(238,221,255)",
      "Quotelinks": "rgb(150,37,148)",
      "Links": "rgb(150,37,148)",
      "Hovered Links": "rgb(178,44,170)",
      "Navigation Links": "rgb(0,0,0)",
      "Hovered Navigation Links": "rgb(178,44,170)",
      "Subjects": "rgb(15,12,93)",
      "Names": "rgb(89,17,119)",
      "Sage": "rgb(153,0,0)",
      "Tripcodes": "rgb(178,44,170)",
      "Emails": "rgb(150,37,148)",
      "Post Numbers": "rgb(150,37,148)",
      "Text": "rgb(0,0,0)",
      "Backlinks": "rgb(150,37,148)",
      "Greentext": "rgb(120,153,34)",
      "Board Title": "rgb(0,0,0)",
      "Timestamps": "rgb(0,0,0)",
      "Inputs": "rgb(0,0,0)",
      "Warnings": "rgb(153,0,0)",
      "Shadow Color": "rgba(0,0,0,.05)",
      "Custom CSS": ".rice {\n  box-shadow:rgba(255,253,255,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}\n.boardTitle {\n  color: #591177 !important;\n  text-shadow: 1px 1px 1px #222 !important;\n}\n.boardSubtitle,\n.boardBanner .boardSubtitle > a {\n  text-shadow: none !important;\n}\n.postNum a {\n  color: #000000 !important;\n}\n.reply.post {\n  border-color: transparent rgb(202,183,217) rgb(202,183,217) transparent;\n}"
    },
    "Vimyanized Dark": {
      "Author": "seaweed",
      "Author Tripcode": "!POMF.9waa",
      "Background Color": "rgb(9,13,15)",
      "Dialog Background": "rgba(13,17,20,.98)",
      "Dialog Border": "rgb(11,19,22)",
      "Thread Wrapper Background": "rgba(13,17,20,.5)",
      "Thread Wrapper Border": "rgba(11,19,22,.9)",
      "Reply Background": "rgba(13,17,20,.9)",
      "Reply Border": "rgb(11,19,22)",
      "Highlighted Reply Background": "rgba(9,13,16,.9)",
      "Highlighted Reply Border": "rgb(83,189,177)",
      "Backlinked Reply Outline": "rgb(83,189,177)",
      "Checkbox Background": "rgba(9,13,15,.9)",
      "Checkbox Border": "rgb(11,19,22)",
      "Input Background": "rgba(9,13,15,.9)",
      "Input Border": "rgb(11,19,22)",
      "Hovered Input Background": "rgba(0,0,0,.9)",
      "Hovered Input Border": "rgb(11,19,22)",
      "Focused Input Background": "rgba(0,0,0,.9)",
      "Focused Input Border": "rgb(11,19,22)",
      "Buttons Background": "rgba(9,13,15,.9)",
      "Buttons Border": "rgb(11,19,22)",
      "Navigation Background": "rgba(9,13,15,0.8)",
      "Navigation Border": "rgb(13,17,20)",
      "Quotelinks": "rgb(83,189,177)",
      "Links": "rgb(83,189,177)",
      "Hovered Links": "rgb(48,144,181)",
      "Navigation Links": "rgb(248,248,248)",
      "Hovered Navigation Links": "rgb(48,144,181)",
      "Subjects": "rgb(184,140,209)",
      "Names": "rgb(214,62,52)",
      "Sage": "rgb(79,79,79)",
      "Tripcodes": "rgb(212,182,60)",
      "Emails": "rgb(83,189,177)",
      "Post Numbers": "rgb(83,189,177)",
      "Text": "rgb(248,248,248)",
      "Backlinks": "rgb(83,189,177)",
      "Greentext": "rgb(150,200,59)",
      "Board Title": "rgb(248,248,248)",
      "Timestamps": "rgb(221,221,221)",
      "Inputs": "rgb(248,248,248)",
      "Warnings": "rgb(79,79,79)",
      "Shadow Color": "rgba(0,0,0,.1)",
      "Custom CSS": ".board .thread {\n  padding: 1px;\n}\n.rice {\n  box-shadow:rgba(45,49,52,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}"
    },
    "Tomorrow Night": {
      "Author": "Chris Kempson",
      "Author Tripcode": "!.pC/AHOKAg",
      "Background Color": "rgb(29,31,33)",
      "Dialog Background": "rgba(40,42,46,.98)",
      "Dialog Border": "rgb(55,59,65)",
      "Thread Wrapper Background": "rgba(40,42,46,.5)",
      "Thread Wrapper Border": "rgba(55,59,65,.9)",
      "Reply Background": "rgba(40,42,46,.9)",
      "Reply Border": "rgb(55,59,65)",
      "Highlighted Reply Background": "rgba(36,38,42,.9)",
      "Highlighted Reply Border": "rgb(129,162,190)",
      "Backlinked Reply Outline": "rgb(129,162,190)",
      "Checkbox Background": "rgba(40,42,46,.9)",
      "Checkbox Border": "rgb(29,31,33)",
      "Input Background": "rgba(40,42,46,.9)",
      "Input Border": "rgb(29,31,33)",
      "Hovered Input Background": "rgba(24,26,30,.9)",
      "Hovered Input Border": "rgb(29,31,33)",
      "Focused Input Background": "rgba(24,26,30,.9)",
      "Focused Input Border": "rgb(29,31,33)",
      "Buttons Background": "rgba(40,42,46,.9)",
      "Buttons Border": "rgb(29,31,33)",
      "Navigation Background": "rgba(29,31,33,0.8)",
      "Navigation Border": "rgb(40,42,46)",
      "Quotelinks": "rgb(129,162,190)",
      "Links": "rgb(129,162,190)",
      "Hovered Links": "rgb(204,102,102)",
      "Navigation Links": "rgb(197,200,198)",
      "Hovered Navigation Links": "rgb(204,102,102)",
      "Subjects": "rgb(178,148,187)",
      "Names": "rgb(129,162,190)",
      "Sage": "rgb(204,102,102)",
      "Tripcodes": "rgb(138,190,183)",
      "Emails": "rgb(129,162,190)",
      "Post Numbers": "rgb(129,162,190)",
      "Text": "rgb(197,200,198)",
      "Backlinks": "rgb(129,162,190)",
      "Greentext": "rgb(181,189,104)",
      "Board Title": "rgb(197,200,198)",
      "Timestamps": "rgb(197,200,198)",
      "Inputs": "rgb(197,200,198)",
      "Warnings": "rgb(204,102,102)",
      "Shadow Color": "rgba(0,0,0,.1)",
      "Custom CSS": ".board .thread {\n  padding: 1px;\n}\n.rice {\n  box-shadow:rgba(72,74,78,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}"
    },
    "Solarized Light": {
      "Author": "seaweed",
      "Author Tripcode": "!POMF.9waa",
      "Background Color": "rgb(240,240,240)",
      "Dialog Background": "rgba(253,246,227,.98)",
      "Dialog Border": "rgb(230,223,206)",
      "Thread Wrapper Background": "rgba(0,0,0,0)",
      "Thread Wrapper Border": "rgba(0,0,0,0)",
      "Reply Background": "rgba(253,246,227,1.0)",
      "Reply Border": "rgb(230,223,206)",
      "Highlighted Reply Background": "rgba(249,242,223,1.0)",
      "Highlighted Reply Border": "rgb(108,113,196)",
      "Backlinked Reply Outline": "rgb(108,113,196)",
      "Checkbox Background": "rgba(255,255,255,1.0)",
      "Checkbox Border": "rgb(204,204,204)",
      "Input Background": "rgba(255,255,255,1.0)",
      "Input Border": "rgb(204,204,204)",
      "Hovered Input Background": "rgba(239,239,239,1.0)",
      "Hovered Input Border": "rgb(204,204,204)",
      "Focused Input Background": "rgba(239,239,239,1.0)",
      "Focused Input Border": "rgb(204,204,204)",
      "Buttons Background": "rgba(255,255,255,1.0)",
      "Buttons Border": "rgb(204,204,204)",
      "Navigation Background": "rgba(240,240,240,0.8)",
      "Navigation Border": "rgb(253,246,227)",
      "Quotelinks": "rgb(108,113,196)",
      "Links": "rgb(108,113,196)",
      "Hovered Links": "rgb(211,54,130)",
      "Navigation Links": "rgb(101,123,131)",
      "Hovered Navigation Links": "rgb(211,54,130)",
      "Subjects": "rgb(181,137,0)",
      "Names": "rgb(101,123,131)",
      "Sage": "rgb(153,0,0)",
      "Tripcodes": "rgb(42,161,152)",
      "Emails": "rgb(108,113,196)",
      "Post Numbers": "rgb(108,113,196)",
      "Text": "rgb(101,123,131)",
      "Backlinks": "rgb(108,113,196)",
      "Greentext": "rgb(133,153,0)",
      "Board Title": "rgb(101,123,131)",
      "Timestamps": "rgb(101,123,131)",
      "Inputs": "rgb(101,123,131)",
      "Warnings": "rgb(153,0,0)",
      "Shadow Color": "rgba(0,0,0,.05)",
      "Custom CSS": ".rice {\n  box-shadow:rgba(255,255,255,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}\n.boardTitle {\n  color: #b58900 !important;\n  text-shadow: 1px 1px 1px #999 !important;\n}\n.boardSubtitle,\n.boardBanner .boardSubtitle > a {\n  text-shadow: none !important;\n}\n.postNum a {\n  color: #657b83 !important;\n}"
    },
    "Muted": {
      "Author": "seaweed",
      "Author Tripcode": "!POMF.9waa",
      "Background Color": "rgb(255,255,255)",
      "Dialog Background": "rgba(245,242,233,.98)",
      "Dialog Border": "rgb(204,204,204)",
      "Thread Wrapper Background": "rgba(245,242,233,.5)",
      "Thread Wrapper Border": "rgba(204,204,204,.9)",
      "Reply Background": "rgba(245,242,233,.9)",
      "Reply Border": "rgb(204,204,204)",
      "Highlighted Reply Background": "rgba(241,238,229,.9)",
      "Highlighted Reply Border": "rgb(188,49,42)",
      "Backlinked Reply Outline": "rgb(188,49,42)",
      "Checkbox Background": "rgba(255,255,255,.9)",
      "Checkbox Border": "rgb(204,204,204)",
      "Input Background": "rgba(255,255,255,.9)",
      "Input Border": "rgb(204,204,204)",
      "Hovered Input Background": "rgba(239,239,239,.9)",
      "Hovered Input Border": "rgb(204,204,204)",
      "Focused Input Background": "rgba(239,239,239,.9)",
      "Focused Input Border": "rgb(204,204,204)",
      "Buttons Background": "rgba(255,255,255,.9)",
      "Buttons Border": "rgb(204,204,204)",
      "Navigation Background": "rgba(255,255,255,0.8)",
      "Navigation Border": "rgb(245,242,233)",
      "Quotelinks": "rgb(188,49,42)",
      "Links": "rgb(188,49,42)",
      "Hovered Links": "rgb(142,34,32)",
      "Navigation Links": "rgb(57,55,53)",
      "Hovered Navigation Links": "rgb(142,34,32)",
      "Subjects": "rgb(17,17,17)",
      "Names": "rgb(44,100,160)",
      "Sage": "rgb(153,0,0)",
      "Tripcodes": "rgb(204,101,99)",
      "Emails": "rgb(188,49,42)",
      "Post Numbers": "rgb(188,49,42)",
      "Text": "rgb(57,55,53)",
      "Backlinks": "rgb(188,49,42)",
      "Greentext": "rgb(120,153,34)",
      "Board Title": "rgb(57,55,53)",
      "Timestamps": "rgb(51,51,51)",
      "Inputs": "rgb(57,55,53)",
      "Warnings": "rgb(153,0,0)",
      "Shadow Color": "rgba(0,0,0,.05)",
      "Custom CSS": ".board .thread {\n  padding: 1px;\n}\n.rice {\n  box-shadow:rgba(255,255,255,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}\n.boardTitle{\ncolor:#bc312a!important;\n  text-shadow:1px 1px 1px #772e28 !important;\n}\n.boardSubtitle,\n.boardBanner .boardSubtitle > a {\n  text-shadow:none!important;\n}\n.postNum a {\n  color:#111111!important;\n}\ndiv.reply a.quotelink{\n  color:#bc312a!important;\n}"
    },
    "Monokai": {
      "Author": "seaweed",
      "Author Tripcode": "!POMF.9waa",
      "Background Color": "rgb(32,33,28)",
      "Dialog Background": "rgba(39,40,34,.98)",
      "Dialog Border": "rgb(45,46,39)",
      "Thread Wrapper Background": "rgba(0,0,0,0)",
      "Thread Wrapper Border": "rgba(0,0,0,0)",
      "Reply Background": "rgba(39,40,34,1.0)",
      "Reply Border": "rgb(45,46,39)",
      "Highlighted Reply Background": "rgba(35,36,30,1.0)",
      "Highlighted Reply Border": "rgb(226,219,116)",
      "Backlinked Reply Outline": "rgb(226,219,116)",
      "Checkbox Background": "rgba(32,33,28,1.0)",
      "Checkbox Border": "rgb(23,23,19)",
      "Input Background": "rgba(32,33,28,1.0)",
      "Input Border": "rgb(23,23,19)",
      "Hovered Input Background": "rgba(16,17,12,1.0)",
      "Hovered Input Border": "rgb(23,23,19)",
      "Focused Input Background": "rgba(16,17,12,1.0)",
      "Focused Input Border": "rgb(23,23,19)",
      "Buttons Background": "rgba(32,33,28,1.0)",
      "Buttons Border": "rgb(23,23,19)",
      "Navigation Background": "rgba(32,33,28,0.8)",
      "Navigation Border": "rgb(39,40,34)",
      "Quotelinks": "rgb(226,219,116)",
      "Links": "rgb(226,219,116)",
      "Hovered Links": "rgb(174,129,255)",
      "Navigation Links": "rgb(248,248,242)",
      "Hovered Navigation Links": "rgb(174,129,255)",
      "Subjects": "rgb(174,129,255)",
      "Names": "rgb(90,192,204)",
      "Sage": "rgb(79,79,79)",
      "Tripcodes": "rgb(250,130,32)",
      "Emails": "rgb(226,219,116)",
      "Post Numbers": "rgb(226,219,116)",
      "Text": "rgb(248,248,242)",
      "Backlinks": "rgb(226,219,116)",
      "Greentext": "rgb(162,204,40)",
      "Board Title": "rgb(248,248,242)",
      "Timestamps": "rgb(248,248,242)",
      "Inputs": "rgb(248,248,242)",
      "Warnings": "rgb(79,79,79)",
      "Shadow Color": "rgba(0,0,0,.12)",
      "Custom CSS": ".rice {\n  box-shadow:rgba(71,72,66,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}"
    },
    "Dark Flat": {
      "Author": "Ahoka",
      "Author Tripcode": "!.pC/AHOKAg",
      "Background Image": "url(\"data:image/gif;base64,R0lGODlhAwADAIAAAB0dHRkZGSH5BADoAwAALAAAAAADAAMAAAIDDG5YADs=\")",
      "Background Attachment": "fixed",
      "Background Position": "top left",
      "Background Repeat": "repeat",
      "Background Color": "rgb(32,32,32)",
      "Dialog Background": "rgba(35,36,37,.98)",
      "Dialog Border": "rgb(41,42,43)",
      "Thread Wrapper Background": "rgba(35,36,37,.5)",
      "Thread Wrapper Border": "rgba(41,42,43,.9)",
      "Reply Background": "rgba(35,36,37,.9)",
      "Reply Border": "rgba(35,36,37,.9)",
      "Highlighted Reply Background": "rgba(31,32,33,.9)",
      "Highlighted Reply Border": "rgb(172,155,176)",
      "Backlinked Reply Outline": "rgb(172,155,176)",
      "Checkbox Background": "rgba(24,25,26,.9)",
      "Checkbox Border": "rgb(18,19,20)",
      "Input Background": "rgba(24,25,26,.9)",
      "Input Border": "rgb(18,19,20)",
      "Hovered Input Background": "rgba(8,9,10,.9)",
      "Hovered Input Border": "rgb(18,19,20)",
      "Focused Input Background": "rgba(8,9,10,.9)",
      "Focused Input Border": "rgb(18,19,20)",
      "Buttons Background": "rgba(24,25,26,.9)",
      "Buttons Border": "rgb(18,19,20)",
      "Navigation Background": "rgba(32,32,32,0.8)",
      "Navigation Border": "rgb(35,36,37)",
      "Quotelinks": "rgb(172,155,176)",
      "Links": "rgb(172,155,176)",
      "Hovered Links": "rgb(111,153,180)",
      "Navigation Links": "rgb(221,221,221)",
      "Hovered Navigation Links": "rgb(111,153,180)",
      "Subjects": "rgb(147,144,201)",
      "Names": "rgb(168,198,217)",
      "Sage": "rgb(201,144,144)",
      "Tripcodes": "rgb(212,192,149)",
      "Emails": "rgb(172,155,176)",
      "Post Numbers": "rgb(172,155,176)",
      "Text": "rgb(221,221,221)",
      "Backlinks": "rgb(172,155,176)",
      "Greentext": "rgb(179,196,94)",
      "Board Title": "rgb(221,221,221)",
      "Timestamps": "rgb(221,221,221)",
      "Inputs": "rgb(221,221,221)",
      "Warnings": "rgb(201,144,144)",
      "Shadow Color": "rgba(0,0,0,.1)",
      "Custom CSS": ".board .thread {\n  padding: 1px;\n}\n.rice {\n  box-shadow:rgba(67,68,69,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}"
    },
    "Blackboard": {
      "Author": "seaweed",
      "Author Tripcode": "!POMF.9waa",
      "Background Color": "rgb(10,13,28)",
      "Dialog Background": "rgba(12,16,33,.98)",
      "Dialog Border": "rgb(14,18,40)",
      "Thread Wrapper Background": "rgba(0,0,0,0)",
      "Thread Wrapper Border": "rgba(0,0,0,0)",
      "Reply Background": "rgba(12,16,33,1.0)",
      "Reply Border": "rgb(14,18,40)",
      "Highlighted Reply Background": "rgba(8,12,29,1.0)",
      "Highlighted Reply Border": "rgb(251,222,45)",
      "Backlinked Reply Outline": "rgb(251,222,45)",
      "Checkbox Background": "rgba(12,16,33,1.0)",
      "Checkbox Border": "rgb(8,11,22)",
      "Input Background": "rgba(12,16,33,1.0)",
      "Input Border": "rgb(8,11,22)",
      "Hovered Input Background": "rgba(0,0,17,1.0)",
      "Hovered Input Border": "rgb(8,11,22)",
      "Focused Input Background": "rgba(0,0,17,1.0)",
      "Focused Input Border": "rgb(8,11,22)",
      "Buttons Background": "rgba(12,16,33,1.0)",
      "Buttons Border": "rgb(8,11,22)",
      "Navigation Background": "rgba(10,13,28,0.8)",
      "Navigation Border": "rgb(12,16,33)",
      "Quotelinks": "rgb(251,222,45)",
      "Links": "rgb(251,222,45)",
      "Hovered Links": "rgb(75,101,204)",
      "Navigation Links": "rgb(248,248,248)",
      "Hovered Navigation Links": "rgb(75,101,204)",
      "Subjects": "rgb(255,100,0)",
      "Names": "rgb(141,166,206)",
      "Sage": "rgb(79,79,79)",
      "Tripcodes": "rgb(255,100,0)",
      "Emails": "rgb(251,222,45)",
      "Post Numbers": "rgb(251,222,45)",
      "Text": "rgb(248,248,248)",
      "Backlinks": "rgb(251,222,45)",
      "Greentext": "rgb(154,207,8)",
      "Board Title": "rgb(248,248,248)",
      "Timestamps": "rgb(221,221,221)",
      "Inputs": "rgb(248,248,248)",
      "Warnings": "rgb(79,79,79)",
      "Shadow Color": "rgba(0,0,0,.1)",
      "Custom CSS": ".rice {\n  box-shadow:rgba(44,48,65,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}\n.postInfo {\n  box-shadow: 0px 2px 3px #0A0A0A;\n}\n#qp .postInfo,\n.inline .postInfo {\n  box-shadow: none;\n}"
    },
    "4chan Rewired": {
      "Author": "",
      "Author Tripcode": "!K.WeEabo0o",
      "Background Color": "rgb(244,244,244)",
      "Dialog Background": "rgba(239,239,239,.98)",
      "Dialog Border": "rgb(212,212,212)",
      "Thread Wrapper Background": "rgba(0,0,0,0)",
      "Thread Wrapper Border": "rgba(0,0,0,0)",
      "Reply Background": "linear-gradient(rgba(244,244,244,0.9), rgba(239,239,239,0.9)), rgba(239,239,239,1)",
      "Reply Border": "rgb(212,212,212)",
      "Highlighted Reply Background": "linear-gradient(rgba(250,250,250,.9), rgba(230,230,230,0.9))",
      "Highlighted Reply Border": "rgb(191,127,63)",
      "Backlinked Reply Outline": "rgba(191,127,63,0.5)",
      "Checkbox Background": "rgba(228,228,228,.9)",
      "Checkbox Border": "rgb(204,204,204)",
      "Input Background": "rgba(244,244,244,0.9)",
      "Input Border": "rgb(204,204,204)",
      "Hovered Input Background": "rgba(212,212,212,.9)",
      "Hovered Input Border": "rgb(204,204,204)",
      "Focused Input Background": "rgba(212,212,212,.9)",
      "Focused Input Border": "rgb(204,204,204)",
      "Buttons Background": "rgba(244,244,244,0.9)",
      "Buttons Border": "rgb(204,204,204)",
      "Navigation Background": "rgba(244,244,244,0.8)",
      "Navigation Border": "rgb(239,239,239)",
      "Quotelinks": "rgb(191,127,63)",
      "Links": "rgb(191,127,63)",
      "Hovered Links": "rgb(191,127,63)",
      "Navigation Links": "rgba(0,0,0,.7)",
      "Hovered Navigation Links": "rgb(211,54,130)",
      "Subjects": "rgba(0,0,0,.7)",
      "Names": "rgba(0,0,0,.7)",
      "Sage": "rgb(204,102,102)",
      "Tripcodes": "rgb(191,127,63)",
      "Emails": "rgb(191,127,63)",
      "Post Numbers": "rgb(191,127,63)",
      "Text": "rgba(0,0,0,.7)",
      "Backlinks": "rgb(191,127,63)",
      "Greentext": "rgb(107,122,30)",
      "Board Title": "rgba(0,0,0,.7)",
      "Timestamps": "rgba(0,0,0,.7)",
      "Inputs": "rgba(0,0,0,.7)",
      "Warnings": "rgb(204,102,102)",
      "Shadow Color": "rgba(0,0,0,.07)",
      "Custom CSS": ".rice {\n  box-shadow:rgba(255,255,255,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\n.reply.post,\n.op.post {\n  background-color: transparent !important;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\na {\n  -moz-transition: text-shadow .2s;\n  -o-transition: text-shadow .2s;\n  -webkit-transition: text-shadow .2s;\n}\na:hover {\n  text-shadow: 0 0 3px rgba(232,118,0,.7);\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:\n    background .2s,\n    box-shadow .2s;\n}\n.subject:not(:empty)::after {\n  content: \" by\";\n  font-weight: normal;\n}"
    },
    "4chan Dark Upgrade": {
      "Author": "Ahoka",
      "Author Tripcode": "!.pC/AHOKAg",
      "Background Image": "url(\"http://i.minus.com/iNkJoDJkLU0co.png\")",
      "Background Attachment": "fixed",
      "Background Position": "top left",
      "Background Repeat": "repeat",
      "Background Color": "rgb(36,36,36)",
      "Dialog Background": "rgba(51,51,51,.98)",
      "Dialog Border": "rgb(58,58,58)",
      "Thread Wrapper Background": "rgba(51,51,51,.5)",
      "Thread Wrapper Border": "rgba(58,58,58,.9)",
      "Reply Background": "rgba(51,51,51,.9)",
      "Reply Border": "rgb(58,58,58)",
      "Highlighted Reply Background": "rgba(47,47,47,.9)",
      "Highlighted Reply Border": "rgb(221,221,221)",
      "Backlinked Reply Outline": "rgb(221,221,221)",
      "Checkbox Background": "rgba(47,47,47,.9)",
      "Checkbox Border": "rgb(15,15,15)",
      "Input Background": "rgba(47,47,47,.9)",
      "Input Border": "rgb(15,15,15)",
      "Hovered Input Background": "rgba(31,31,31,.9)",
      "Hovered Input Border": "rgb(15,15,15)",
      "Focused Input Background": "rgba(31,31,31,.9)",
      "Focused Input Border": "rgb(15,15,15)",
      "Buttons Background": "rgba(47,47,47,.9)",
      "Buttons Border": "rgb(15,15,15)",
      "Navigation Background": "rgba(36,36,36,0.8)",
      "Navigation Border": "rgb(51,51,51)",
      "Quotelinks": "rgb(221,221,221)",
      "Links": "rgb(221,221,221)",
      "Hovered Links": "rgb(238,238,238)",
      "Navigation Links": "rgb(255,255,255)",
      "Hovered Navigation Links": "rgb(238,238,238)",
      "Subjects": "rgb(153,153,153)",
      "Names": "rgb(255,255,255)",
      "Sage": "rgb(177,115,133)",
      "Tripcodes": "rgb(167,220,231)",
      "Emails": "rgb(221,221,221)",
      "Post Numbers": "rgb(221,221,221)",
      "Text": "rgb(255,255,255)",
      "Backlinks": "rgb(221,221,221)",
      "Greentext": "rgb(99,153,91)",
      "Board Title": "rgb(255,255,255)",
      "Timestamps": "rgb(170,170,170)",
      "Inputs": "rgb(255,255,255)",
      "Warnings": "rgb(177,115,133)",
      "Shadow Color": "rgba(0,0,0,0.2)",
      "Custom CSS": ".board .thread {\n  padding: 3px 4px;\n}\n.rice {\n  box-shadow:rgba(83,83,83,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}\n#delform {\n  background: rgba(22,22,22,.8) !important;\n  border: 0 !important;\n  padding: 1px !important;\n  box-shadow: rgba(0,0,0,.8) 0 0 10px;\n}\ndiv.reply.post {\n  background-image: url('data:image/gif;base64,R0lGODdhCQAJAIgAADMzMysrKywAAAAACQAJAAACDwxgeMrZF5Jckz1UXaYQFgA7');\n  border-bottom: #1f1f1f !important;\n}\n.board .thread:not(.stub) {\n  background: 0 !important\n}\na:not([href='javascript:;']){\n  text-shadow: #0f0f0f 0 1px;\n}"
    },
    "安心院なじみ ": {
      "Author": "Ahoka",
      "Author Tripcode": "!.pC/AHOKAg",
      "Background Image": "url(\"http://i.imgur.com/RewHm.png\")",
      "Background Attachment": "fixed",
      "Background Position": "bottom right",
      "Background Repeat": "no-repeat",
      "Background Color": "rgb(255,255,255)",
      "Dialog Background": "rgba(239,239,239,.98)",
      "Dialog Border": "rgb(214,214,214)",
      "Thread Wrapper Background": "rgba(239,239,239,.4)",
      "Thread Wrapper Border": "rgba(214,214,214,.9)",
      "Reply Background": "rgba(239,239,239,.9)",
      "Reply Border": "rgb(214,214,214)",
      "Highlighted Reply Background": "rgba(235,235,235,.9)",
      "Highlighted Reply Border": "rgb(191,128,64)",
      "Backlinked Reply Outline": "rgb(191,128,64)",
      "Checkbox Background": "rgba(204,204,204,.9)",
      "Checkbox Border": "rgb(187,187,187)",
      "Input Background": "rgba(204,204,204,.9)",
      "Input Border": "rgb(187,187,187)",
      "Hovered Input Background": "rgba(188,188,188,.9)",
      "Hovered Input Border": "rgb(187,187,187)",
      "Focused Input Background": "rgba(188,188,188,.9)",
      "Focused Input Border": "rgb(187,187,187)",
      "Buttons Background": "rgba(204,204,204,.9)",
      "Buttons Border": "rgb(187,187,187)",
      "Navigation Background": "rgba(255,255,255,0.8)",
      "Navigation Border": "rgb(239,239,239)",
      "Quotelinks": "rgb(191,128,64)",
      "Links": "rgb(191,128,64)",
      "Hovered Links": "rgb(191,128,64)",
      "Navigation Links": "rgb(77,77,76)",
      "Hovered Navigation Links": "rgb(191,128,64)",
      "Subjects": "rgb(77,77,77)",
      "Names": "rgb(43,128,194)",
      "Sage": "rgb(200,40,41)",
      "Tripcodes": "rgb(62,153,159)",
      "Emails": "rgb(191,128,64)",
      "Post Numbers": "rgb(191,128,64)",
      "Text": "rgb(77,77,76)",
      "Backlinks": "rgb(191,128,64)",
      "Greentext": "rgb(113,140,0)",
      "Board Title": "rgb(77,77,76)",
      "Timestamps": "rgb(77,77,76)",
      "Inputs": "rgb(77,77,76)",
      "Warnings": "rgb(200,40,41)",
      "Shadow Color": "rgba(0,0,0,.05)",
      "Custom CSS": ".board .thread {\n  padding: 1px;\n}\n.rice {\n  box-shadow:rgba(255,255,255,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow: inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow: inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition: background .2s,box-shadow .2s;\n}"
    },
    "violaceous": {
      "Author": "Anonymous",
      "Author Tripcode": "!MaSoOdDwDw",
      "Background Color": "rgb(18,19,20)",
      "Dialog Background": "rgba(27,27,27,.98)",
      "Dialog Border": "rgb(41,42,43)",
      "Thread Wrapper Background": "rgba(27,27,27,.5)",
      "Thread Wrapper Border": "rgba(41,42,43,.9)",
      "Reply Background": "rgba(27,27,27,.9)",
      "Reply Border": "rgba(27,27,27,.9)",
      "Highlighted Reply Background": "rgba(31,31,31,.9)",
      "Highlighted Reply Border": "rgb(42,127,160)",
      "Backlinked Reply Outline": "rgb(42,127,160)",
      "Checkbox Background": "rgba(24,25,26,.9)",
      "Checkbox Border": "rgb(18,19,20)",
      "Input Background": "rgba(24,25,26,.9)",
      "Input Border": "rgb(18,19,20)",
      "Hovered Input Background": "rgba(40,41,42,.9)",
      "Hovered Input Border": "rgb(18,19,20)",
      "Focused Input Background": "rgba(40,41,42,.9)",
      "Focused Input Border": "rgb(18,19,20)",
      "Buttons Background": "rgba(24,25,26,.9)",
      "Buttons Border": "rgb(18,19,20)",
      "Navigation Background": "rgba(18,19,20,0.8)",
      "Navigation Border": "rgb(27,27,27)",
      "Quotelinks": "rgb(42,127,160)",
      "Links": "rgb(42,127,160)",
      "Hovered Links": "rgb(48,144,181)",
      "Navigation Links": "rgb(221,221,221)",
      "Hovered Navigation Links": "rgb(48,144,181)",
      "Subjects": "rgb(6,152,154)",
      "Names": "rgb(164,151,176)",
      "Sage": "rgb(79,79,79)",
      "Tripcodes": "rgb(189,43,131)",
      "Emails": "rgb(42,127,160)",
      "Post Numbers": "rgb(42,127,160)",
      "Text": "rgb(221,221,221)",
      "Backlinks": "rgb(42,127,160)",
      "Greentext": "rgb(0,171,63)",
      "Board Title": "rgb(221,221,221)",
      "Timestamps": "rgb(221,221,221)",
      "Inputs": "rgb(221,221,221)",
      "Warnings": "rgb(79,79,79)",
      "Shadow Color": "rgba(0,0,0,.1)",
      "Custom CSS": ".board .thread {\n  padding: 1px;\n}\n.rice {\n  box-shadow:rgba(59,59,59,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}"
    },
    "Mesa": {
      "Author": "Tristan",
      "Author Tripcode": "!..NoTrip..",
      "Background Color": "#3c212a",
      "Thread Wrapper Background": "rgba(0,0,0,0)",
      "Thread Wrapper Border": "rgba(0,0,0,0)",
      "Dialog Background": "#3c212a",
      "Dialog Border": "#171717",
      "Reply Background": "#3c212a",
      "Reply Border": "#171717",
      "Highlighted Reply Background": "#3c212a",
      "Highlighted Reply Border": "#bfa977",
      "Backlinked Reply Outline": "#bfa977",
      "Input Background": "#3c212a",
      "Input Border": "#171717",
      "Checkbox Background": "#3c212a",
      "Checkbox Border": "#171717",
      "Buttons Background": "#3c212a",
      "Buttons Border": "#171717",
      "Focused Input Background": "#3c212a",
      "Focused Input Border": "#171717",
      "Hovered Input Background": "#3c212a",
      "Hovered Input Border": "#171717",
      "Navigation Background": "#3c212a",
      "Navigation Border": "#171717",
      "Quotelinks": "#bfa977",
      "Backlinks": "#bfa977",
      "Links": "#bfa977",
      "Hovered Links": "#aa4775",
      "Navigation Links": "#bfa977",
      "Hovered Navigation Links": "#aa4775",
      "Names": "#bfa977",
      "Tripcodes": "#aa6d89",
      "Emails": "#9c8aaa",
      "Subjects": "#bfa977",
      "Text": "#BFA977",
      "Inputs": "#bfa977",
      "Post Numbers": "#bfa977",
      "Greentext": "#99848b",
      "Sage": "rgb(150,150,150)",
      "Board Title": "#aa9d8d",
      "Timestamps": "#aa9d8d",
      "Warnings": "#aa8575",
      "Shadow Color": "rgba(0,0,0,.1)",
      "Custom CSS": "",
      "Background Image": "",
      "Background Attachment": "",
      "Background Position": "",
      "Background Repeat": ""
    },
    "White Rainbow": {
      "Author": "Shiro",
      "Author Tripcode": "!i.Neko0OEM",
      "Background Image": "url('http://subtlepatterns.com/patterns/paper_fibers.png')",
      "Background Attachment": "fixed",
      "Background Position": "top left",
      "Background Repeat": "repeat",
      "Background Color": "rgb(255,255,255)",
      "Dialog Background": "rgba(239,239,239,.98)",
      "Dialog Border": "rgb(214,214,214)",
      "Thread Wrapper Background": "rgba(239,239,239,.98)",
      "Thread Wrapper Border": "rgba(214,214,214,.4)",
      "Reply Background": "rgba(255,255,255,.90)",
      "Reply Border": "rgb(214,214,214)",
      "Highlighted Reply Background": "rgba(239,239,239,.90)",
      "Highlighted Reply Border": "#b84818",
      "Backlinked Reply Outline": "#b84818",
      "Checkbox Background": "rgba(239,239,239,.98)",
      "Checkbox Border": "rgb(187,187,187)",
      "Input Background": "#fffffff",
      "Input Border": "rgb(187,187,187)",
      "Hovered Input Background": "#f0f0f0",
      "Hovered Input Border": "rgb(187,187,187)",
      "Focused Input Background": "#f0f0f0",
      "Focused Input Border": "rgb(187,187,187)",
      "Buttons Background": "rgba(239,239,239,.98)",
      "Buttons Border": "rgb(187,187,187)",
      "Navigation Background": "rgba(255,255,255,0.8)",
      "Navigation Border": "rgb(239,239,239)",
      "Quotelinks": "#7a2634",
      "Links": "#7a2634",
      "Hovered Links": "#c24646",
      "Navigation Links": "#404d41",
      "Hovered Navigation Links": "#527054",
      "Subjects": "#5533ff",
      "Names": "#242ca3",
      "Sage": "#6910ad",
      "Tripcodes": "#0c76ab",
      "Emails": "#0c76ab",
      "Post Numbers": "#b86e2e",
      "Text": "#242423",
      "Backlinks": "#7a2634",
      "Greentext": "#10610a",
      "Board Title": "#000000",
      "Timestamps": "#00913f",
      "Inputs": "#242423",
      "Warnings": "rgb(200,40,41)",
      "Shadow Color": "#b0b0b0",
      "Custom CSS": ".board .thread {\n  padding: 1px;\n}\n.rice {\n  box-shadow:rgba(255,255,255,.3) 0 1px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#options input:not([type=checkbox]):hover {\n  box-shadow: inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#options input:focus {\n  box-shadow: inset rgba(200,200,200,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition: background .2s,box-shadow .2s;\n}"
    },
    "Genergray": {
      "Author": "Zixaphir",
      "Author Tripcode": "!M.........",
      "Background Image": "",
      "Background Attachment": "",
      "Background Position": "",
      "Background Repeat": "",
      "Background Color": "rgba(32,32,32,1)",
      "Thread Wrapper Background": "rgba(24,24,24,1)",
      "Thread Wrapper Border": "rgba(30,30,30,1)",
      "Dialog Background": "rgba(32,32,32,1)",
      "Dialog Border": "rgba(20,20,20,1)",
      "Reply Background": "rgba(32,32,32,1)",
      "Reply Border": "rgba(20,20,20,1)",
      "Highlighted Reply Background": "rgba(24,24,24,1)",
      "Highlighted Reply Border": "rgba(24,24,24,1)",
      "Backlinked Reply Outline": "rgba(98,124,141,1)",
      "Input Background": "rgba(32,32,32,1)",
      "Input Border": "rgba(28,28,28,1)",
      "Hovered Input Background": "rgba(24,24,24,1)",
      "Hovered Input Border": "rgba(24,24,24,1)",
      "Focused Input Background": "rgba(16,16,16,1)",
      "Focused Input Border": "rgba(28,28,28,1)",
      "Checkbox Background": "rgb(25,25,25)",
      "Checkbox Border": "rgb(20,20,20)",
      "Buttons Background": "rgba(20,20,20,1)",
      "Buttons Border": "rgb(16,16,16)",
      "Navigation Background": "rgba(16,16,16,0.9)",
      "Navigation Border": "rgba(16,16,16,0.9)",
      "Quotelinks": "rgb(71,140,161)",
      "Backlinks": "rgba(71,140,161, 0.8)",
      "Links": "rgb(141,141,160)",
      "Hovered Links": "rgb(141,190,255)",
      "Navigation Links": "rgb(51,145,175)",
      "Hovered Navigation Links": "rgb(141,190,255)",
      "Names": "rgb(150,150,150)",
      "Tripcodes": "rgb(255,255,255)",
      "Emails": "rgb(68,68,68)",
      "Subjects": "rgb(255,100,100)",
      "Text": "rgb(235,255,235)",
      "Inputs": "rgb(144,144,144)",
      "Post Numbers": "rgb(150,150,150)",
      "Greentext": "rgb(113,121,62)",
      "Sage": "rgb(68,68,68)",
      "Board Title": "rgb(194,194,194)",
      "Timestamps": "rgb(100,100,100)",
      "Warnings": "rgb(215,0,0)",
      "Shadow Color": "rgba(0,0,0,.1)",
      "Custom CSS": ".board .thread {\n  padding: 2px;\n  box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3) inset, rgba(70,70,70,.5) 1px 1px;\n}\n#header-bar,\ninput,\ntextarea,\n.field,\n.inline .op,\n.pagelist,\n.prettyprint,\n.post.reply,\n.rice,\n.selectrice {\n  box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2) inset, rgba(70,70,70,.3) 1px 1px;\n}\n#qr .selectrice {\n  box-shadow: none;\n}\n#header-bar {\n  padding: 1px 3px;\n}\n.dialog {\n  box-shadow: 0px 0px 4px rgba(0, 0, 0, .3) inset, 1px 1px 5px rgba(0,0,0,0.2);\n}\n.threadContainer {\n  border: none;\n  box-shadow: 0px 0px 3px rgba(0, 0, 0, .3) inset, rgba(70,70,70,.3) 1px 1px;\n  padding: 2px 0;\n  margin-left: 20px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow:inset rgba(0,0,0,.2) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition:background .2s,box-shadow .2s;\n}"
    },
    "Frost": {
      "Author": "Zixaphir",
      "Author Tripcode": "!M.........",
      "Background Image": "",
      "Background Attachment": "",
      "Background Position": "",
      "Background Repeat": "",
      "Background Color": "rgba(230,230,230,1)",
      "Thread Wrapper Background": "rgba(235,235,235,1)",
      "Thread Wrapper Border": "rgba(215,215,215,1)",
      "Dialog Background": "rgba(230,230,230,1)",
      "Dialog Border": "rgba(255,255,255,1)",
      "Reply Background": "rgba(230,230,230,1)",
      "Reply Border": "rgba(220,220,220,1)",
      "Highlighted Reply Background": "rgba(244,244,244,1)",
      "Highlighted Reply Border": "rgba(220,220,220,1)",
      "Backlinked Reply Outline": "rgba(98,124,141,1)",
      "Input Background": "rgba(244,244,244,1)",
      "Input Border": "rgba(220,220,220,1)",
      "Hovered Input Background": "rgba(220,220,220,1)",
      "Hovered Input Border": "rgba(200,200,200,1)",
      "Focused Input Background": "rgba(255,255,255,1)",
      "Focused Input Border": "rgba(200,200,200,1)",
      "Checkbox Background": "rgba(200,200,200,1)",
      "Checkbox Border": "rgba(190,190,190,1)",
      "Buttons Background": "rgba(255,255,255,1)",
      "Buttons Border": "rgba(220,220,220,1)",
      "Navigation Background": "rgba(244,244,244,1)",
      "Navigation Border": "rgba(230,230,230,0.9)",
      "Quotelinks": "rgb(61,110,121)",
      "Backlinks": "rgba(51,145,175, 0.9)",
      "Links": "rgb(62,62,160)",
      "Hovered Links": "rgb(101,0,150)",
      "Navigation Links": "rgb(51,145,175)",
      "Hovered Navigation Links": "rgb(141,190,255)",
      "Names": "rgb(100,100,100)",
      "Tripcodes": "rgb(0,125,0)",
      "Emails": "rgb(68,68,68)",
      "Subjects": "rgb(95,0,0)",
      "Text": "rgb(0,0,0)",
      "Inputs": "rgb(0,0,0)",
      "Post Numbers": "rgb(80,80,80)",
      "Greentext": "rgb(113,121,62)",
      "Sage": "rgb(68,68,68)",
      "Board Title": "rgb(0,0,0)",
      "Timestamps": "rgb(100,100,100)",
      "Warnings": "rgb(215,0,0)",
      "Shadow Color": "rgba(0,0,0,.1)",
      "Custom CSS": ".board .thread {\n  padding: 2px;\n  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1) inset, rgba(255,255,255,.5) 1px 1px;\n}\n#header-bar,\ninput,\ntextarea,\n.field,\n.inline .op,\n.pagelist,\n.prettyprint,\n.post.reply,\n.rice,\n.selectrice {\n  box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1) inset, rgba(255,255,255,.8) 1px 1px;\n}\n#qr .selectrice {\n  box-shadow: none;\n}\n#header-bar {\n  padding: 1px 3px;\n}\n.dialog {\n  box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1) inset, rgba(255,255,255,.5) 1px 1px;\n}\n.threadContainer {\n  border: none;\n  box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1) inset, rgba(255,255,255,.5) 1px 1px;\n  padding: 2px 0;\n  margin-left: 20px;\n}\ninput[type=password]:hover,\ninput[type=text]:not([disabled]):hover,\ninput#fs_search:hover,\ninput.field:hover,\n.webkit select:hover,\ntextarea:hover,\n#appchanx-settings input:not([type=checkbox]):hover {\n  box-shadow: inset rgba(0,0,0,.1) 0 1px 2px;\n}\ninput[type=password]:focus,\ninput[type=text]:focus,\ninput#fs_search:focus,\ninput.field:focus,\n.webkit select:focus,\ntextarea:focus,\n#appchanx-settings input:focus {\n  box-shadow: inset rgba(0,0,0,.1) 0 1px 2px;\n}\nbutton,\ninput,\ntextarea,\n.rice {\n  transition: background .2s,box-shadow .2s;\n}"
    },
    "Clone": {
      "Author": "Zixaphir",
      "Author Tripcode": "!M.........",
      "Background Image": "",
      "Background Attachment": "",
      "Background Position": "",
      "Background Repeat": "",
      "Background Color": "#1e1e1e",
      "Thread Wrapper Background": "rgba(0,0,0,0)",
      "Thread Wrapper Border": "#111111",
      "Dialog Background": "#222222",
      "Dialog Border": "#111111",
      "Reply Background": "#222222",
      "Reply Border": "#111111",
      "Highlighted Reply Background": "#141414",
      "Highlighted Reply Border": "#111111",
      "Backlinked Reply Outline": "#6d6d8c",
      "Input Background": "#222222",
      "Input Border": "#111111",
      "Hovered Input Background": "#111111",
      "Hovered Input Border": "#171717",
      "Focused Input Background": "#1e1e1e",
      "Focused Input Border": "#111111",
      "Checkbox Background": "#242424",
      "Checkbox Border": "#0f0f0f",
      "Buttons Background": "#171717",
      "Buttons Border": "#111111",
      "Navigation Background": "rgba(30,30,30,0.9)",
      "Navigation Border": "#111111",
      "Quotelinks": "#6d6d8c",
      "Backlinks": "#55555c",
      "Links": "#57577a",
      "Hovered Links": "#8787ad",
      "Navigation Links": "#bababa",
      "Hovered Navigation Links": "#676785",
      "Names": "#6e753c",
      "Tripcodes": "#94531c",
      "Emails": "#5e5e5e",
      "Subjects": "#ababab",
      "Text": "#8c8c8c",
      "Inputs": "#8c8c8c",
      "Post Numbers": "#6b6b6b",
      "Greentext": "#6e753c",
      "Sage": "#592110",
      "Board Title": "#8c8c8c",
      "Timestamps": "#7d7d7d",
      "Warnings": "#7b1126",
      "Shadow Color": "rgba(0,0,0,.1)",
      "Custom CSS": ".rice {\n  box-shadow: 1px 1px rgba(50,50,50,0.4), inset 1px 1px 2px rgba(0,0,0,0.3);\n}\n.reply.post {\n  margin: 0 !important;\n  border-radius: 0;\n}\n.board .replyContainer,\n#unread-line {\n  margin: -1px;\n}\n#qp {\n  border: none !important;\n}\n#unread-line {\n  padding: 1px;\n  border: 1px solid #111 !important;\n  background-color: #933;\n}"
    }
  };

  $ = function(selector, root) {
    if (root == null) {
      root = d.body;
    }
    return root.querySelector(selector);
  };

  $.extend = function(obj, prop) {
    var key, val;
    for (key in prop) {
      val = prop[key];
      if (prop.hasOwnProperty(key)) {
        obj[key] = val;
      }
    }
  };

  $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000)));

  $.id = function(id) {
    return d.getElementById(id);
  };

  $.ready = function(fc) {
    var cb;
    if (d.readyState !== 'loading') {
      $.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) {
        if (typeof val === 'object' && 'newName' in val) {
          fd.append(key, val, val.newName);
        } else {
          fd.append(key, val);
        }
      }
    }
    return fd;
  };

  $.ajax = (function() {
    var lastModified;
    lastModified = {};
    return function(url, options, extra) {
      var form, r, sync, type, upCallbacks, whenModified;
      if (extra == null) {
        extra = {};
      }
      type = extra.type, whenModified = extra.whenModified, upCallbacks = extra.upCallbacks, form = extra.form, sync = extra.sync;
      r = new XMLHttpRequest();
      type || (type = form && 'post' || 'get');
      r.open(type, url, !sync);
      if (whenModified) {
        if (url in lastModified) {
          r.setRequestHeader('If-Modified-Since', lastModified[url]);
        }
        $.on(r, 'load', function() {
          return lastModified[url] = r.getResponseHeader('Last-Modified');
        });
      }
      if (/\.json$/.test(url)) {
        r.responseType = 'json';
      }
      $.extend(r, options);
      $.extend(r.upload, upCallbacks);
      r.send(form);
      return r;
    };
  })();

  (function() {
    var reqs;
    reqs = {};
    $.cache = function(url, cb, options) {
      var err, req, rm;
      if (req = reqs[url]) {
        if (req.readyState === 4) {
          $.queueTask(function() {
            return cb.call(req, req.evt);
          });
        } else {
          req.callbacks.push(cb);
        }
        return req;
      }
      rm = function() {
        return delete reqs[url];
      };
      try {
        if (!(req = $.ajax(url, options))) {
          return;
        }
      } catch (_error) {
        err = _error;
        return;
      }
      $.on(req, 'load', 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);
        }
        this.evt = e;
        return delete this.callbacks;
      });
      $.on(req, 'abort error', rm);
      req.callbacks = [cb];
      return reqs[url] = req;
    };
    return $.cleanCache = function(testf) {
      var url;
      for (url in reqs) {
        if (testf(url)) {
          delete reqs[url];
        }
      }
    };
  })();

  $.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
    });
    $.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, 7, null);
  };

  $.addClass = function() {
    var className, classNames, el, _i, _len;
    el = arguments[0], classNames = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
    for (_i = 0, _len = classNames.length; _i < _len; _i++) {
      className = classNames[_i];
      el.classList.add(className);
    }
  };

  $.rmClass = function() {
    var className, classNames, el, _i, _len;
    el = arguments[0], classNames = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
    for (_i = 0, _len = classNames.length; _i < _len; _i++) {
      className = classNames[_i];
      el.classList.remove(className);
    }
  };

  $.toggleClass = function(el, className) {
    return el.classList.toggle(className);
  };

  $.hasClass = function(el, className) {
    return __indexOf.call(el.classList, className) >= 0;
  };

  $.rm = function(el) {
    return el.remove();
  };

  $.rmAll = function(root) {
    return root.textContent = null;
  };

  $.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);
    }
  };

  $.one = function(el, events, handler) {
    var cb;
    cb = function(e) {
      $.off(el, events, cb);
      return handler.call(this, e);
    };
    return $.on(el, events, cb);
  };

  $.event = function(event, detail, root) {
    if (root == null) {
      root = d;
    }
    if ((detail != null) && typeof cloneInto === 'function') {
      detail = cloneInto(detail, d.defaultView);
    }
    return root.dispatchEvent(new CustomEvent(event, {
      bubbles: true,
      detail: detail
    }));
  };

  $.open = GM_openInTab;

  $.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);
  };

  $.item = function(key, val) {
    var item;
    item = {};
    item[key] = val;
    return item;
  };

  $.syncing = {};

  $.oldValue = {};

  $.sync = function(key, cb) {
    key = g.NAMESPACE + key;
    $.syncing[key] = cb;
    return $.oldValue[key] = GM_getValue(key);
  };

  (function() {
    var onChange;
    onChange = function(key) {
      var cb, newValue;
      if (!(cb = $.syncing[key])) {
        return;
      }
      newValue = GM_getValue(key);
      if (newValue === $.oldValue[key]) {
        return;
      }
      if (newValue != null) {
        $.oldValue[key] = newValue;
        return cb(JSON.parse(newValue), key);
      } else {
        delete $.oldValue[key];
        return cb(void 0, key);
      }
    };
    $.on(window, 'storage', function(_arg) {
      var key;
      key = _arg.key;
      return onChange(key);
    });
    return $.forceSync = function(key) {
      return onChange(g.NAMESPACE + key);
    };
  })();

  $.desync = function(key) {
    return delete $.syncing[g.NAMESPACE + key];
  };

  $["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);
      }
    };
  })();

  $.clear = function(cb) {
    $["delete"](GM_listValues().map(function(key) {
      return key.replace(g.NAMESPACE, '');
    }));
    return typeof cb === "function" ? cb() : void 0;
  };

  $.remove = function(arr, value) {
    var i;
    i = arr.indexOf(value);
    if (i === -1) {
      return false;
    }
    arr.splice(i, 1);
    return true;
  };

  $$ = function(selector, root) {
    if (root == null) {
      root = d.body;
    }
    return __slice.call(root.querySelectorAll(selector));
  };

  Callbacks = (function() {
    function Callbacks(type) {
      this.type = type;
      this.keys = [];
    }

    Callbacks.prototype.push = function(_arg) {
      var cb, name;
      name = _arg.name, cb = _arg.cb;
      if (this[name]) {
        this.connect(name);
      } else {
        this.keys.push(name);
      }
      return this[name] = cb;
    };

    Callbacks.prototype.connect = function(name) {
      if (this[name].disconnected) {
        return delete this[name].disconnected;
      }
    };

    Callbacks.prototype.disconnect = function(name) {
      if (this[name]) {
        return this[name].disconnected = true;
      }
    };

    Callbacks.prototype.execute = function(nodes) {
      var err, errors, feature, name, node, _i, _j, _len, _len1, _ref;
      _ref = this.keys;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        name = _ref[_i];
        feature = this[name];
        for (_j = 0, _len1 = nodes.length; _j < _len1; _j++) {
          node = nodes[_j];
          if (!feature.disconnected) {
            try {
              feature.call(node);
            } catch (_error) {
              err = _error;
              if (!errors) {
                errors = [];
              }
              errors.push({
                message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''),
                error: err
              });
            }
          }
        }
      }
      if (errors) {
        return Main.handleErrors(errors);
      }
    };

    return Callbacks;

  })();

  Board = (function() {
    Board.prototype.toString = function() {
      return this.ID;
    };

    function Board(ID) {
      this.ID = ID;
      this.threads = new SimpleDict();
      this.posts = new SimpleDict();
      g.boards[this] = this;
    }

    return Board;

  })();

  Thread = (function() {
    Thread.callbacks = new Callbacks('Thread');

    Thread.prototype.toString = function() {
      return this.ID;
    };

    function Thread(ID, board) {
      this.ID = ID;
      this.board = board;
      this.fullID = "" + this.board + "." + this.ID;
      this.posts = new SimpleDict();
      this.isDead = false;
      this.isHidden = false;
      this.isOnTop = false;
      this.isPinned = false;
      this.isSticky = false;
      this.isClosed = false;
      this.isArchived = false;
      this.postLimit = false;
      this.fileLimit = false;
      this.ipCount = void 0;
      this.OP = null;
      this.catalogView = null;
      g.threads.push(this.fullID, board.threads.push(this, this));
    }

    Thread.prototype.setPage = function(pageNum) {
      var icon, info, quote, _ref;
      _ref = this.OP.nodes, info = _ref.info, quote = _ref.quote;
      if (!(icon = $('.page-num', info))) {
        icon = $.el('span', {
          className: 'page-num'
        });
        $.after(quote, [$.tn(' '), icon]);
      }
      icon.title = "This thread is on page " + pageNum + " in the original index.";
      icon.textContent = "[" + pageNum + "]";
      if (this.catalogView) {
        return this.catalogView.nodes.pageCount.textContent = pageNum;
      }
    };

    Thread.prototype.setCount = function(type, count, reachedLimit) {
      var el;
      if (!this.catalogView) {
        return;
      }
      el = this.catalogView.nodes["" + type + "Count"];
      el.textContent = count;
      return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning');
    };

    Thread.prototype.setStatus = function(type, status) {
      var name;
      name = "is" + type;
      if (this[name] === status) {
        return;
      }
      this[name] = status;
      if (!this.OP) {
        return;
      }
      this.setIcon('Sticky', this.isSticky);
      this.setIcon('Closed', this.isClosed && !this.isArchived);
      return this.setIcon('Archived', this.isArchived);
    };

    Thread.prototype.setIcon = function(type, status) {
      var icon, root, typeLC;
      typeLC = type.toLowerCase();
      icon = $("." + typeLC + "Icon", this.OP.nodes.info);
      if (!!icon === status) {
        return;
      }
      if (!status) {
        $.rm(icon.previousSibling);
        $.rm(icon);
        if (this.catalogView) {
          $.rm($("." + typeLC + "Icon", this.catalogView.nodes.icons));
        }
        return;
      }
      icon = $.el('img', {
        src: "" + Build.staticPath + typeLC + Build.gifIcon,
        alt: type,
        title: type,
        className: "" + typeLC + "Icon retina"
      });
      root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote;
      $.after(root, [$.tn(' '), icon]);
      if (!this.catalogView) {
        return;
      }
      return (type === 'Sticky' && this.isClosed ? $.prepend : $.add)(this.catalogView.nodes.icons, icon.cloneNode());
    };

    Thread.prototype.pin = function() {
      this.isPinned = true;
      if (this.catalogView) {
        return $.addClass(this.catalogView.nodes.root, 'pinned');
      }
    };

    Thread.prototype.unpin = function() {
      this.isPinned = false;
      if (this.catalogView) {
        return $.rmClass(this.catalogView.nodes.root, 'pinned');
      }
    };

    Thread.prototype.hide = function() {
      var button;
      if (this.isHidden) {
        return;
      }
      this.isHidden = true;
      if (!Conf['JSON Navigation']) {
        this.OP.nodes.root.parentElement.hidden = true;
      }
      if (button = $('.hide-post-button', this.OP.nodes.root)) {
        return $.replace(button, PostHiding.makeButton(false));
      }
    };

    Thread.prototype.show = function() {
      var button;
      if (!this.isHidden) {
        return;
      }
      this.isHidden = false;
      if (button = $('.show-post-button', this.OP.nodes.root)) {
        return $.replace(button, PostHiding.makeButton(true));
      }
    };

    Thread.prototype.kill = function() {
      return this.isDead = true;
    };

    Thread.prototype.collect = function() {
      this.posts.forEach(function(post) {
        return post.collect();
      });
      g.threads.rm(this.fullID);
      return this.board.threads.rm(this);
    };

    return Thread;

  })();

  CatalogThread = (function() {
    CatalogThread.callbacks = new Callbacks('Catalog Thread');

    CatalogThread.prototype.toString = function() {
      return this.ID;
    };

    function CatalogThread(root, thread) {
      this.thread = thread;
      this.ID = this.thread.ID;
      this.board = this.thread.board;
      this.nodes = {
        root: root,
        thumb: $('.thumb', root),
        icons: $('.catalog-icons', root),
        postCount: $('.post-count', root),
        fileCount: $('.file-count', root),
        pageCount: $('.page-count', root),
        comment: $('.comment', root)
      };
      this.thread.catalogView = this;
    }

    return CatalogThread;

  })();

  Post = (function() {
    Post.callbacks = new Callbacks('Post');

    Post.prototype.toString = function() {
      return this.ID;
    };

    function Post(root, thread, board, that) {
      var capcode, date, email, flag, info, name, post, subject, tripcode, uniqueID;
      this.thread = thread;
      this.board = board;
      if (that == null) {
        that = {};
      }
      this.ID = +root.id.slice(2);
      this.fullID = "" + this.board + "." + this.ID;
      if (that.isOriginalMarkup) {
        this.cleanup(root, post);
      }
      post = $('.post', root);
      info = $('.postInfo', post);
      root.dataset.fullID = this.fullID;
      this.nodes = {
        root: root,
        post: post,
        info: info,
        nameBlock: $('.nameBlock', info),
        quote: $('.postNum > a:nth-of-type(2)', info),
        comment: $('.postMessage', post),
        links: [],
        quotelinks: [],
        backlinks: info.getElementsByClassName('backlink')
      };
      if (!(this.isReply = $.hasClass(post, 'reply'))) {
        this.thread.OP = this;
        this.thread.isArchived = !!$('.archivedIcon', info);
        this.thread.isSticky = !!$('.stickyIcon', info);
        this.thread.isClosed = this.thread.isArchived || !!$('.closedIcon', info);
        if (this.thread.isArchived) {
          this.thread.kill();
        }
      }
      this.info = {};
      this.info.nameBlock = Conf['Anonymize'] ? 'Anonymous' : this.nodes.nameBlock.textContent.trim();
      if (subject = $('.subject', info)) {
        this.nodes.subject = subject;
        this.info.subject = subject.textContent;
      }
      if (name = $('.name', info)) {
        this.nodes.name = name;
        this.info.name = name.textContent;
      }
      if (email = $('.useremail', info)) {
        this.nodes.email = email;
        this.info.email = decodeURIComponent(email.href.slice(7));
      }
      if (tripcode = $('.postertrip', info)) {
        this.nodes.tripcode = tripcode;
        this.info.tripcode = tripcode.textContent;
      }
      if (uniqueID = $('.posteruid', info)) {
        this.nodes.uniqueID = uniqueID;
        this.info.uniqueID = uniqueID.firstElementChild.textContent;
      }
      if (capcode = $('.capcode.hand', info)) {
        this.nodes.capcode = capcode;
        this.info.capcode = capcode.textContent.replace('## ', '');
      }
      if (flag = $('.flag, .countryFlag', info)) {
        this.nodes.flag = flag;
        this.info.flag = flag.title;
      }
      if (date = $('.dateTime', info)) {
        this.nodes.date = date;
        this.info.date = new Date(date.dataset.utc * 1000);
      }
      this.parseComment();
      this.parseQuotes();
      this.parseFile(that);
      this.labels = [];
      this.highlights = [];
      this.isDead = false;
      this.isHidden = false;
      this.clones = [];
      g.posts.push(this.fullID, thread.posts.push(this, board.posts.push(this, this)));
      if (that.isArchived) {
        this.kill();
      }
    }

    Post.prototype.parseComment = function() {
      var bq, i, node, nodes, spoilers;
      this.nodes.comment.normalize();
      bq = this.nodes.comment.cloneNode(true);
      nodes = $$('.abbr, .exif, b, marquee', bq);
      i = 0;
      while (node = nodes[i++]) {
        $.rm(node);
      }
      this.info.comment = this.nodesToText(bq);
      spoilers = $$('s', bq);
      return this.info.commentSpoilered = (function() {
        var _i, _len;
        if (spoilers.length) {
          for (_i = 0, _len = spoilers.length; _i < _len; _i++) {
            node = spoilers[_i];
            $.replace(node, $.tn('[spoiler]'));
          }
          return this.nodesToText(bq);
        } else {
          return this.info.comment;
        }
      }).call(this);
    };

    Post.prototype.nodesToText = function(bq) {
      var i, node, nodes, text;
      text = "";
      nodes = $.X('.//br|.//text()', bq);
      i = 0;
      while (node = nodes.snapshotItem(i++)) {
        text += node.data || '\n';
      }
      return text.trim().replace(/\s+$/gm, '');
    };

    Post.prototype.parseQuotes = function() {
      var quotelink, _i, _len, _ref;
      this.quotes = [];
      _ref = $$(':not(pre) > .quotelink', this.nodes.comment);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        quotelink = _ref[_i];
        this.parseQuote(quotelink);
      }
    };

    Post.prototype.parseQuote = function(quotelink) {
      var fullID, match;
      if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/(?:res|thread)\/\d+(?:\/[^#]*)?#p(\d+)$/))) {
        return;
      }
      this.nodes.quotelinks.push(quotelink);
      if (this.isClone) {
        return;
      }
      fullID = "" + match[1] + "." + match[2];
      if (__indexOf.call(this.quotes, fullID) < 0) {
        return this.quotes.push(fullID);
      }
    };

    Post.prototype.parseFile = function(that) {
      var anchor, fileEl, fileText, nameNode, size, thumb, unit;
      if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) {
        return;
      }
      anchor = thumb.parentNode;
      fileText = fileEl.firstElementChild;
      this.file = {
        text: fileText,
        thumb: thumb,
        URL: anchor.href,
        size: thumb.alt.match(/[\d.]+\s\w+/)[0],
        MD5: thumb.dataset.md5,
        isSpoiler: $.hasClass(anchor, 'imgspoiler')
      };
      size = +this.file.size.match(/[\d.]+/)[0];
      unit = ['B', 'KB', 'MB', 'GB'].indexOf(this.file.size.match(/\w+$/)[0]);
      while (unit-- > 0) {
        size *= 1024;
      }
      this.file.sizeInBytes = size;
      this.file.thumbURL = "" + location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
      this.file.isImage = /(jpg|png|gif)$/i.test(this.file.URL);
      this.file.isVideo = /webm$/i.test(this.file.URL);
      nameNode = $('a', fileText);
      if (this.file.isImage || this.file.isVideo) {
        this.file.dimensions = nameNode.nextSibling.textContent.match(/\d+x\d+/)[0];
      }
      return this.file.name = fileText.title || nameNode.title || nameNode.textContent;
    };

    Post.prototype.cleanup = function(root) {
      var node, _i, _j, _len, _len1, _ref, _ref1;
      _ref = $$('.mobile', root);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        node = _ref[_i];
        $.rm(node);
      }
      _ref1 = $$('.desktop', root);
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        node = _ref1[_j];
        $.rmClass(node, 'desktop');
      }
    };

    Post.prototype.getNameBlock = function() {
      if (Conf['Anonymize']) {
        return 'Anonymous';
      } else {
        return $('.nameBlock', this.nodes.info).textContent.trim();
      }
    };

    Post.prototype.hide = function(label, makeStub, hideRecursively) {
      var quotelink, _i, _len, _ref;
      if (makeStub == null) {
        makeStub = Conf['Stubs'];
      }
      if (hideRecursively == null) {
        hideRecursively = Conf['Recursive Hiding'];
      }
      if (__indexOf.call(this.labels, label) < 0) {
        this.labels.push(label);
      }
      if (this.isHidden) {
        return;
      }
      this.isHidden = true;
      _ref = Get.allQuotelinksLinkingTo(this);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        quotelink = _ref[_i];
        $.addClass(quotelink, 'filtered');
      }
      if (hideRecursively) {
        label = "Recursively hidden for quoting No." + this;
        Recursive.apply('hide', this, label, makeStub, true);
        Recursive.add('hide', this, label, makeStub, true);
      }
      PostHiding.saveHiddenState(this, {
        thisPost: true,
        hideRecursively: hideRecursively,
        makeStub: makeStub
      });
      if (!this.isReply) {
        this.thread.hide();
        return;
      }
      if (!makeStub) {
        this.nodes.root.hidden = true;
        return;
      }
      this.nodes.post.hidden = true;
      this.nodes.post.previousElementSibling.hidden = true;
      this.nodes.stub = $.el('div', {
        className: 'stub'
      });
      $.add(this.nodes.stub, [PostHiding.makeButton(false), $.tn(" " + (this.getNameBlock()))]);
      if (Conf['Menu']) {
        $.add(this.nodes.stub, Menu.makeButton(this));
      }
      return $.prepend(this.nodes.root, this.nodes.stub);
    };

    Post.prototype.show = function(showRecursively) {
      var quotelink, _i, _len, _ref;
      if (showRecursively == null) {
        showRecursively = Conf['Recursive Hiding'];
      }
      if (!this.isHidden) {
        return;
      }
      this.isHidden = false;
      _ref = Get.allQuotelinksLinkingTo(this);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        quotelink = _ref[_i];
        $.rmClass(quotelink, 'filtered');
      }
      if (showRecursively) {
        Recursive.apply('show', this, true);
        Recursive.rm('hide', this);
      }
      PostHiding.saveHiddenState(this, {
        thisPost: true,
        hideRecursively: showRecursively,
        makeStub: !!this.nodes.stub
      });
      if (!this.isReply) {
        this.thread.show();
        return;
      }
      if (!this.nodes.stub) {
        this.nodes.root.hidden = false;
        return;
      }
      this.nodes.post.hidden = false;
      this.nodes.post.previousElementSibling.hidden = false;
      $.rm(this.nodes.stub);
      return delete this.nodes.stub;
    };

    Post.prototype.highlight = function(label, highlight, top) {
      this.labels.push(label);
      if (__indexOf.call(this.highlights, highlight) < 0) {
        this.highlights.push(highlight);
        $.addClass(this.nodes.root, highlight);
      }
      if (!this.isReply && top) {
        return this.thread.isOnTop = true;
      }
    };

    Post.prototype.kill = function(file) {
      var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
      if (file) {
        if (this.file.isDead) {
          return;
        }
        this.file.isDead = true;
        $.addClass(this.nodes.root, 'deleted-file');
      } else {
        if (this.isDead) {
          return;
        }
        this.isDead = true;
        $.addClass(this.nodes.root, 'deleted-post');
      }
      if (!(strong = $('strong.warning', this.nodes.info))) {
        strong = $.el('strong', {
          className: 'warning fa'
        });
        $.after($('input', this.nodes.info), strong);
      }
      strong.textContent = file ? '\uf070' : '\uf014';
      strong.title = "" + (file ? 'File' : 'Post') + " Deleted";
      if (this.isClone) {
        return;
      }
      _ref = this.clones;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        clone = _ref[_i];
        clone.kill(file);
      }
      if (file) {
        return;
      }
      _ref1 = Get.allQuotelinksLinkingTo(this);
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        quotelink = _ref1[_j];
        if (!(!$.hasClass(quotelink, 'deadlink'))) {
          continue;
        }
        $.addClass(quotelink, 'deadlink');
        QuoteMarkers.parseQuotelink(Get.postFromNode(quotelink), quotelink, true);
      }
    };

    Post.prototype.resurrect = function() {
      var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
      delete this.isDead;
      $.rmClass(this.nodes.root, 'deleted-post');
      strong = $('strong.warning', this.nodes.info);
      if (this.file && this.file.isDead) {
        strong.textContent = '[File deleted]';
      } else {
        $.rm(strong);
      }
      if (this.isClone) {
        return;
      }
      _ref = this.clones;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        clone = _ref[_i];
        clone.resurrect();
      }
      _ref1 = Get.allQuotelinksLinkingTo(this);
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        quotelink = _ref1[_j];
        if (!($.hasClass(quotelink, 'deadlink'))) {
          continue;
        }
        $.rmClass(quotelink, 'deadlink');
        QuoteMarkers.parseQuotelink(Get.postFromNode(quotelink), quotelink, true);
      }
    };

    Post.prototype.collect = function() {
      this.kill();
      g.posts.rm(this.fullID);
      this.thread.posts.rm(this);
      return this.board.posts.rm(this);
    };

    Post.prototype.addClone = function(context, contractThumb) {
      return new Clone(this, context, contractThumb);
    };

    Post.prototype.rmClone = function(index) {
      var clone, _i, _len, _ref;
      this.clones.splice(index, 1);
      _ref = this.clones.slice(index);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        clone = _ref[_i];
        clone.nodes.root.dataset.clone = index++;
      }
    };

    return Post;

  })();

  Clone = (function(_super) {
    __extends(Clone, _super);

    function Clone(origin, context, contractThumb) {
      var file, info, inline, inlined, key, nodes, post, root, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;
      this.origin = origin;
      this.context = context;
      _ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        key = _ref[_i];
        this[key] = origin[key];
      }
      nodes = origin.nodes;
      root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true);
      post = $('.post', root);
      info = $('.postInfo', post);
      this.nodes = {
        root: root,
        post: post,
        info: info,
        nameBlock: $('.nameBlock', info),
        quote: $('.postNum > a:nth-of-type(2)', info),
        comment: $('.postMessage', post),
        quotelinks: [],
        backlinks: info.getElementsByClassName('backlink')
      };
      _ref1 = $$('.inline', post);
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        inline = _ref1[_j];
        $.rm(inline);
      }
      _ref2 = $$('.inlined', post);
      for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
        inlined = _ref2[_k];
        $.rmClass(inlined, 'inlined');
      }
      root.hidden = post.hidden = false;
      $.rmClass(root, 'forwarded');
      $.rmClass(post, 'highlight');
      if (nodes.subject) {
        this.nodes.subject = $('.subject', info);
      }
      if (nodes.name) {
        this.nodes.name = $('.name', info);
      }
      if (nodes.email) {
        this.nodes.email = $('.useremail', info);
      }
      if (nodes.tripcode) {
        this.nodes.tripcode = $('.postertrip', info);
      }
      if (nodes.uniqueID) {
        this.nodes.uniqueID = $('.posteruid', info);
      }
      if (nodes.capcode) {
        this.nodes.capcode = $('.capcode.hand', info);
      }
      if (nodes.flag) {
        this.nodes.flag = $('.flag, .countryFlag', info);
      }
      if (nodes.date) {
        this.nodes.date = $('.dateTime', info);
      }
      this.parseQuotes();
      if (origin.file) {
        this.file = {};
        _ref3 = origin.file;
        for (key in _ref3) {
          val = _ref3[key];
          this.file[key] = val;
        }
        file = $('.file', post);
        this.file.text = file.firstElementChild;
        this.file.thumb = $('.fileThumb > [data-md5]', file);
        this.file.fullImage = $('.full-image', file);
        this.file.videoControls = $('.video-controls', this.file.text);
        if (contractThumb) {
          ImageExpand.contract(this);
        }
      }
      if (origin.isDead) {
        this.isDead = true;
      }
      this.isClone = true;
      root.dataset.clone = origin.clones.push(this) - 1;
    }

    Clone.prototype.cloneWithoutVideo = function(node) {
      var child, clone, _i, _len, _ref;
      if (node.tagName === 'VIDEO' && !node.dataset.md5) {
        return [];
      } else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) {
        clone = node.cloneNode(false);
        _ref = node.childNodes;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          child = _ref[_i];
          $.add(clone, this.cloneWithoutVideo(child));
        }
        return clone;
      } else {
        return node.cloneNode(true);
      }
    };

    return Clone;

  })(Post);

  DataBoard = (function() {
    DataBoard.keys = ['pinnedThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads'];

    function DataBoard(key, sync, dontClean) {
      var init;
      this.key = key;
      this.onSync = __bind(this.onSync, this);
      this.data = Conf[key];
      $.sync(key, this.onSync);
      if (!dontClean) {
        this.clean();
      }
      if (!sync) {
        return;
      }
      init = (function(_this) {
        return function() {
          $.off(d, '4chanXInitFinished', init);
          return _this.sync = sync;
        };
      })(this);
      $.on(d, '4chanXInitFinished', init);
    }

    DataBoard.prototype.save = function() {
      return $.set(this.key, this.data);
    };

    DataBoard.prototype["delete"] = function(_arg) {
      var boardID, postID, threadID, _ref;
      boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID;
      $.forceSync(this.key);
      if (postID) {
        if (!((_ref = this.data.boards[boardID]) != null ? _ref[threadID] : void 0)) {
          return;
        }
        delete this.data.boards[boardID][threadID][postID];
        this.deleteIfEmpty({
          boardID: boardID,
          threadID: threadID
        });
      } else if (threadID) {
        if (!this.data.boards[boardID]) {
          return;
        }
        delete this.data.boards[boardID][threadID];
        this.deleteIfEmpty({
          boardID: boardID
        });
      } else {
        delete this.data.boards[boardID];
      }
      return this.save();
    };

    DataBoard.prototype.deleteIfEmpty = function(_arg) {
      var boardID, threadID;
      boardID = _arg.boardID, threadID = _arg.threadID;
      $.forceSync(this.key);
      if (threadID) {
        if (!Object.keys(this.data.boards[boardID][threadID]).length) {
          delete this.data.boards[boardID][threadID];
          return this.deleteIfEmpty({
            boardID: boardID
          });
        }
      } else if (!Object.keys(this.data.boards[boardID]).length) {
        return delete this.data.boards[boardID];
      }
    };

    DataBoard.prototype.set = function(_arg) {
      var boardID, postID, threadID, val, _base, _base1, _base2;
      boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val;
      $.forceSync(this.key);
      if (postID !== void 0) {
        ((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val;
      } else if (threadID !== void 0) {
        ((_base2 = this.data.boards)[boardID] || (_base2[boardID] = {}))[threadID] = val;
      } else {
        this.data.boards[boardID] = val;
      }
      return this.save();
    };

    DataBoard.prototype.get = function(_arg) {
      var ID, board, boardID, defaultValue, postID, thread, threadID, val, _i, _len;
      boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, defaultValue = _arg.defaultValue;
      if (board = this.data.boards[boardID]) {
        if (!threadID) {
          if (postID) {
            for (thread = _i = 0, _len = board.length; _i < _len; thread = ++_i) {
              ID = board[thread];
              if (postID in thread) {
                val = thread[postID];
                break;
              }
            }
          } else {
            val = board;
          }
        } else if (thread = board[threadID]) {
          val = postID ? thread[postID] : thread;
        }
      }
      return val || defaultValue;
    };

    DataBoard.prototype.forceSync = function() {
      return $.forceSync(this.key);
    };

    DataBoard.prototype.clean = function() {
      var boardID, now, threadID, val, _ref;
      $.forceSync(this.key);
      _ref = this.data.boards;
      for (boardID in _ref) {
        val = _ref[boardID];
        this.deleteIfEmpty({
          boardID: boardID
        });
      }
      now = Date.now();
      if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) {
        this.data.lastChecked = now;
        for (boardID in this.data.boards) {
          for (threadID in this.data.boards[boardID]) {
            this.ajaxClean(boardID, threadID);
          }
        }
      }
      return this.save();
    };

    DataBoard.prototype.ajaxClean = function(boardID, threadID) {
      return $.ajax("//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json", {
        onloadend: (function(_this) {
          return function(e) {
            if (e.target.status === 404) {
              return _this["delete"]({
                boardID: boardID,
                threadID: threadID
              });
            }
          };
        })(this)
      }, {
        type: 'head'
      });
    };

    DataBoard.prototype.onSync = function(data) {
      data || (data = {
        boards: {}
      });
      $.extend(this.data, data);
      return typeof this.sync === "function" ? this.sync() : void 0;
    };

    DataBoard.prototype.disconnect = function() {
      $.desync(this.key);
      delete this.sync;
      return delete this.data;
    };

    return DataBoard;

  })();

  Notice = (function() {
    function Notice(type, content, timeout, onclose) {
      this.timeout = timeout;
      this.onclose = onclose;
      this.close = __bind(this.close, this);
      this.add = __bind(this.add, this);
      this.el = $.el('div', {
        innerHTML: "<a href=\"javascript:;\" class=\"close fa\" title=\"Close\"></a><div class=\"message\"></div>"
      });
      this.el.style.opacity = 0;
      this.setType(type);
      $.on(this.el.firstElementChild, 'click', this.close);
      if (typeof content === 'string') {
        content = $.tn(content);
      }
      $.add(this.el.lastElementChild, content);
      $.ready(this.add);
    }

    Notice.prototype.setType = function(type) {
      return this.el.className = "notification " + type;
    };

    Notice.prototype.add = function() {
      if (d.hidden) {
        $.on(d, 'visibilitychange', this.add);
        return;
      }
      $.off(d, 'visibilitychange', this.add);
      $.add(Header.noticesRoot, this.el);
      this.el.clientHeight;
      this.el.style.opacity = 1;
      if (this.timeout) {
        return setTimeout(this.close, this.timeout * $.SECOND);
      }
    };

    Notice.prototype.close = function() {
      $.off(d, 'visibilitychange', this.add);
      $.rm(this.el);
      return typeof this.onclose === "function" ? this.onclose() : void 0;
    };

    return Notice;

  })();

  RandomAccessList = (function() {
    function RandomAccessList(items) {
      var item, _i, _len;
      this.length = 0;
      if (items) {
        for (_i = 0, _len = items.length; _i < _len; _i++) {
          item = items[_i];
          this.push(item);
        }
      }
    }

    RandomAccessList.prototype.push = function(data) {
      var ID, item, last;
      ID = data.ID;
      ID || (ID = data.id);
      if (this[ID]) {
        return;
      }
      last = this.last;
      this[ID] = item = {
        prev: last,
        next: null,
        data: data,
        ID: ID
      };
      item.prev = last;
      this.last = last ? last.next = item : this.first = item;
      return this.length++;
    };

    RandomAccessList.prototype.before = function(root, item) {
      var prev;
      if (item.next === root || item === root) {
        return;
      }
      this.rmi(item);
      prev = root.prev;
      root.prev = item;
      item.next = root;
      item.prev = prev;
      if (prev) {
        return prev.next = item;
      } else {
        return this.first = item;
      }
    };

    RandomAccessList.prototype.after = function(root, item) {
      var next;
      if (item.prev === root) {
        return;
      }
      this.rmi(item);
      next = root.next;
      root.next = item;
      item.prev = root;
      item.next = next;
      if (next) {
        return next.prev = item;
      } else {
        return this.last = item;
      }
    };

    RandomAccessList.prototype.prepend = function(item) {
      var first;
      first = this.first;
      if (item === first || !this[item.ID]) {
        return;
      }
      this.rmi(item);
      item.next = first;
      if (first) {
        first.prev = item;
      } else {
        this.last = item;
      }
      this.first = item;
      return delete item.prev;
    };

    RandomAccessList.prototype.shift = function() {
      return this.rm(this.first.ID);
    };

    RandomAccessList.prototype.order = function() {
      var item, order;
      order = [item = this.first];
      while (item = item.next) {
        order.push(item);
      }
      return order;
    };

    RandomAccessList.prototype.rm = function(ID) {
      var item;
      item = this[ID];
      if (!item) {
        return;
      }
      delete this[ID];
      this.length--;
      this.rmi(item);
      delete item.next;
      return delete item.prev;
    };

    RandomAccessList.prototype.rmi = function(item) {
      var next, prev;
      prev = item.prev, next = item.next;
      if (prev) {
        prev.next = next;
      } else {
        this.first = next;
      }
      if (next) {
        return next.prev = prev;
      } else {
        return this.last = prev;
      }
    };

    return RandomAccessList;

  })();

  SimpleDict = (function() {
    function SimpleDict() {
      this.keys = [];
    }

    SimpleDict.prototype.push = function(key, data) {
      key = "" + key;
      if (!this[key]) {
        this.keys.push(key);
      }
      return this[key] = data;
    };

    SimpleDict.prototype.rm = function(key) {
      var i;
      key = "" + key;
      if ((i = this.keys.indexOf(key)) !== -1) {
        this.keys.splice(i, 1);
        return delete this[key];
      }
    };

    SimpleDict.prototype.first = function() {
      return this[this.keys[0]];
    };

    SimpleDict.prototype.forEach = function(fn) {
      var key, _i, _len, _ref;
      _ref = __slice.call(this.keys);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        key = _ref[_i];
        fn(this[key]);
      }
    };

    return SimpleDict;

  })();

  ShimSet = (function() {
    function ShimSet() {
      this.elements = {};
      this.size = 0;
    }

    ShimSet.prototype.has = function(value) {
      return value in this.elements;
    };

    ShimSet.prototype.add = function(value) {
      if (this.elements[value]) {
        return;
      }
      this.elements[value] = true;
      return this.size++;
    };

    ShimSet.prototype["delete"] = function(value) {
      if (!this.elements[value]) {
        return;
      }
      delete this.elements[value];
      return this.size--;
    };

    return ShimSet;

  })();

  if (!('Set' in window)) {
    window.Set = ShimSet;
  }

  Connection = (function() {
    function Connection(target, origin, cb) {
      this.target = target;
      this.origin = origin;
      this.cb = cb != null ? cb : {};
      this.onMessage = __bind(this.onMessage, this);
      this.send = __bind(this.send, this);
      $.on(window, 'message', this.onMessage);
    }

    Connection.prototype.targetWindow = function() {
      if (this.target instanceof window.HTMLIFrameElement) {
        return this.target.contentWindow;
      } else {
        return this.target;
      }
    };

    Connection.prototype.send = function(data) {
      return this.targetWindow().postMessage("" + g.NAMESPACE + (JSON.stringify(data)), this.origin);
    };

    Connection.prototype.onMessage = function(e) {
      var data, type, value, _base;
      if (!(e.source === this.targetWindow() && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) {
        return;
      }
      data = JSON.parse(e.data.slice(g.NAMESPACE.length));
      for (type in data) {
        value = data[type];
        if (typeof (_base = this.cb)[type] === "function") {
          _base[type](value);
        }
      }
    };

    return Connection;

  })();

  Captcha = (function() {
    function Captcha() {}

    Captcha.prototype.lifetime = 2 * $.MINUTE;

    Captcha.prototype.init = function() {
      if (d.cookie.indexOf('pass_enabled=1') >= 0) {
        return;
      }
      if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt'))) {
        return;
      }
      this.captchas = [];
      $.get('captchas', [], function(_arg) {
        var captchas;
        captchas = _arg.captchas;
        return QR.captcha.sync(captchas);
      });
      $.sync('captchas', this.sync.bind(this));
      return this.impInit();
    };

    Captcha.prototype.cb = {
      focus: function() {
        return QR.captcha.setup(false, true);
      },
      load: function() {},
      cache: function() {}
    };

    Captcha.prototype.needed = function() {
      var captchaCount, com, file, _ref;
      captchaCount = this.captchas.length;
      if (QR.req) {
        captchaCount++;
      }
      this.postsCount = QR.posts.length;
      if (this.postsCount === 1 && !Conf['Auto-load captcha']) {
        _ref = QR.posts[0], com = _ref.com, file = _ref.file;
        if (!com && !file) {
          this.postsCount = 0;
        }
      }
      return captchaCount < this.postsCount;
    };

    Captcha.prototype.onNewPost = function() {};

    Captcha.prototype.onPostChange = function() {};

    Captcha.prototype.preSetup = function() {
      var input;
      input = this.nodes.input;
      input.value = '';
      input.placeholder = 'Focus to load reCAPTCHA';
      this.count();
      return $.on(input, 'focus click', this.cb.focus);
    };

    Captcha.prototype.setup = function(focus, force) {
      if (!(this.isEnabled && (this.needed() || force))) {
        return;
      }
      return this.impSetup(focus, force);
    };

    Captcha.prototype.getOne = function() {
      var captcha;
      this.clear();
      if (captcha = this.captchas.shift()) {
        return this.handleCaptcha(captcha);
      } else {
        return this.handleNoCaptcha();
      }
    };

    Captcha.prototype.handleCaptcha = function(captcha) {
      this.count();
      $.set('captchas', this.captchas);
      return captcha;
    };

    Captcha.prototype.handleNoCaptcha = function() {};

    Captcha.prototype.sync = function(captchas) {
      if (captchas == null) {
        captchas = [];
      }
      this.captchas = captchas;
      this.count();
      return this.clear();
    };

    Captcha.prototype.clear = function() {
      var captcha, i, now, _i, _len, _ref;
      if (!this.captchas.length) {
        return false;
      }
      $.forceSync('captchas');
      now = Date.now();
      _ref = this.captchas;
      for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
        captcha = _ref[i];
        if (captcha.timeout > now) {
          break;
        }
      }
      if (!i) {
        return;
      }
      this.captchas = this.captchas.slice(i);
      this.count();
      $.set('captchas', this.captchas);
      return true;
    };

    Captcha.prototype.count = function() {
      var count, placeholder;
      count = this.captchas ? this.captchas.length : 0;
      placeholder = this.nodes.input.placeholder.replace(/\ \(.*\)$/, '');
      placeholder += (function() {
        switch (count) {
          case 0:
            if (placeholder === 'Verification') {
              return ' (Shift + Enter to cache)';
            } else {
              return '';
            }
            break;
          case 1:
            return ' (1 cached captcha)';
          default:
            return " (" + count + " cached captchas)";
        }
      })();
      this.nodes.input.placeholder = placeholder;
      return this.nodes.input.alt = count;
    };

    Captcha.prototype.keydown = function(e) {
      if (e.keyCode === 8 && !this.nodes.input.value) {
        this.cb.load();
      } else if (e.keyCode === 13 && e.shiftKey) {
        this.cb.cache();
      } else {
        return;
      }
      return e.preventDefault();
    };

    Captcha.prototype.buildV1Nodes = function() {
      var container, input;
      container = $.el('div', {
        className: 'captcha-img',
        title: 'Reload reCAPTCHA'
      });
      input = $.el('input', {
        className: 'captcha-input field',
        title: 'Verification',
        autocomplete: 'off',
        spellcheck: false
      });
      this.nodes = {
        container: container,
        input: input
      };
      $.on(input, 'keydown', this.keydown.bind(this));
      $.on(container, 'click', this.reload.bind(this));
      $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v1');
      return $.after(QR.nodes.com.parentNode, [container, input]);
    };

    return Captcha;

  })();

  Polyfill = {
    init: function() {
      this.notificationPermission();
      this.toBlob();
      return this.visibility();
    },
    notificationPermission: function() {
      if (!window.Notification || 'permission' in Notification || !window.webkitNotifications) {
        return;
      }
      return Object.defineProperty(Notification, 'permission', {
        get: function() {
          switch (webkitNotifications.checkPermission()) {
            case 0:
              return 'granted';
            case 1:
              return 'default';
            case 2:
              return 'denied';
          }
        }
      });
    },
    toBlob: function() {
      var _base;
      return (_base = HTMLCanvasElement.prototype).toBlob || (_base.toBlob = function(cb) {
        var data, i, l, ui8a, _i;
        data = atob(this.toDataURL().slice(22));
        l = data.length;
        ui8a = new Uint8Array(l);
        for (i = _i = 0; _i < l; i = _i += 1) {
          ui8a[i] = data.charCodeAt(i);
        }
        return cb(new Blob([ui8a], {
          type: 'image/png'
        }));
      });
    },
    visibility: function() {
      if ('visibilityState' in d) {
        return;
      }
      Object.defineProperties(HTMLDocument.prototype, {
        visibilityState: {
          get: function() {
            return this.webkitVisibilityState;
          }
        },
        hidden: {
          get: function() {
            return this.webkitHidden;
          }
        }
      });
      return $.on(d, 'webkitvisibilitychange', function() {
        return $.event('visibilitychange');
      });
    }
  };

  Header = {
    init: function() {
      var barFixedToggler, barPositionToggler, box, customNavToggler, editCustomNav, footer, headerToggler, menuButton, scrollHeaderToggler;
      this.menu = new UI.Menu('header');
      menuButton = $.el('a', {
        className: 'menu-button a-icon',
        id: 'main-menu'
      });
      box = UI.checkbox;
      barFixedToggler = box('Fixed Header', 'Fixed Header');
      headerToggler = box('Header auto-hide', 'Auto-hide header');
      scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll');
      barPositionToggler = box('Bottom Header', 'Bottom header');
      customNavToggler = box('Custom Board Navigation', 'Custom board navigation');
      editCustomNav = $.el('a', {
        textContent: 'Edit custom board navigation',
        href: 'javascript:;'
      });
      this.barFixedToggler = barFixedToggler.firstElementChild;
      this.scrollHeaderToggler = scrollHeaderToggler.firstElementChild;
      this.barPositionToggler = barPositionToggler.firstElementChild;
      this.headerToggler = headerToggler.firstElementChild;
      this.customNavToggler = customNavToggler.firstElementChild;
      $.on(menuButton, 'click', this.menuToggle);
      $.on(this.headerToggler, 'change', this.toggleBarVisibility);
      $.on(this.barFixedToggler, 'change', this.toggleBarFixed);
      $.on(this.barPositionToggler, 'change', this.toggleBarPosition);
      $.on(this.scrollHeaderToggler, 'change', this.setHideBarOnScroll);
      $.on(this.customNavToggler, 'change', this.toggleCustomNav);
      $.on(editCustomNav, 'click', this.editCustomNav);
      this.setBarFixed(Conf['Fixed Header']);
      this.setHideBarOnScroll(Conf['Header auto-hide on scroll']);
      this.setBarVisibility(Conf['Header auto-hide']);
      $.sync('Fixed Header', this.setBarFixed);
      $.sync('Header auto-hide on scroll', this.setHideBarOnScroll);
      $.sync('Bottom Header', this.setBarPosition);
      $.sync('Header auto-hide', this.setBarVisibility);
      this.addShortcut(menuButton);
      this.menu.addEntry({
        el: $.el('span', {
          textContent: 'Header'
        }),
        order: 107,
        subEntries: [
          {
            el: barFixedToggler
          }, {
            el: headerToggler
          }, {
            el: scrollHeaderToggler
          }, {
            el: barPositionToggler
          }, {
            el: customNavToggler
          }, {
            el: editCustomNav
          }
        ]
      });
      $.on(window, 'load hashchange', Header.hashScroll);
      $.on(d, 'CreateNotification', this.createNotification);
      this.enableDesktopNotifications();
      this.addShortcut(menuButton, true);
      $.asap((function() {
        return d.body;
      }), (function(_this) {
        return function() {
          if (!Main.isThisPageLegit()) {
            return;
          }
          $.asap((function() {
            return $.id('boardNavMobile') || d.readyState !== 'loading';
          }), _this.setBoardList);
          $.prepend(d.body, _this.bar);
          $.add(d.body, _this.hover);
          return _this.setBarPosition(Conf['Bottom Header']);
        };
      })(this));
      footer = null;
      return $.asap((function() {
        return footer = $.id('boardNavDesktopFoot');
      }), function() {
        var a, _i, _len, _ref;
        if (a = $("a[href*='/" + g.BOARD + "/']", footer)) {
          a.className = 'current';
        }
        if (Conf['JSON Navigation']) {
          _ref = $$('a', footer);
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            a = _ref[_i];
            $.on(a, 'click', Navigate.navigate);
          }
        }
      });
    },
    bar: $.el('div', {
      id: 'header-bar'
    }),
    noticesRoot: $.el('div', {
      id: 'notifications'
    }),
    stats: $.el('span', {
      id: 'a-stats'
    }),
    icons: $.el('span', {
      id: 'a-icons'
    }),
    hover: $.el('div', {
      id: 'hoverUI'
    }),
    toggle: $.el('div', {
      id: 'scroll-marker'
    }),
    initReady: function() {
      Header.setBoardList();
      return Header.addNav();
    },
    setBoardList: function() {
      var a, boardList, btn, chr, fourchannav, fullBoardList, node, nodes, shortcuts, _i, _j, _len, _len1, _ref, _ref1;
      fourchannav = $.id('boardNavDesktop');
      Header.boardList = boardList = $.el('span', {
        id: 'board-list'
      });
      $.extend(boardList, {
        innerHTML: "<span id=\"custom-board-list\"></span><span id=\"full-board-list\" hidden><span class=\"hide-board-list-container brackets-wrap\"><a href=\"javascript:;\" class=\"hide-board-list-button\">&nbsp;-&nbsp;</a></span></span>"
      });
      fullBoardList = $('#full-board-list', boardList);
      nodes = [];
      _ref = $('#boardNavDesktop > .boardList').childNodes;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        node = _ref[_i];
        switch (node.nodeName) {
          case '#text':
            _ref1 = node.nodeValue;
            for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
              chr = _ref1[_j];
              if (chr !== ' ') {
                nodes.push($.tn(chr));
              }
            }
            break;
          case 'A':
            a = node.cloneNode(true);
            if (Conf['JSON Navigation']) {
              $.on(a, 'click', Navigate.navigate);
            }
            if (a.pathname.split('/')[1] === g.BOARD.ID) {
              a.className = 'current';
            }
            nodes.push(a);
        }
      }
      $.add(fullBoardList, nodes);
      fullBoardList.normalize();
      btn = $('.hide-board-list-button', fullBoardList);
      $.on(btn, 'click', Header.toggleBoardList);
      shortcuts = $.el('span', {
        id: 'shortcuts'
      });
      $.add(shortcuts, [Header.stats, Header.icons]);
      $.prepend(d.body, shortcuts);
      $.add(boardList, fullBoardList);
      $.add(Header.bar, [Header.boardList, 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(boardnav) {
      var as, list, nodes, re, t;
      list = $('#custom-board-list', Header.boardList);
      $.rmAll(list);
      if (!boardnav) {
        return;
      }
      boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' ');
      as = $$('#full-board-list a[title]', Header.boardList);
      re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|(mode|sort|text|url):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
      nodes = (function() {
        var _i, _len, _ref, _results;
        _ref = boardnav.match(re);
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          t = _ref[_i];
          _results.push(Header.mapCustomNavigation(t, as));
        }
        return _results;
      })();
      $.add(list, nodes);
      return $.ready(function() {
        return CatalogLinks.set(Conf['Header catalog links']);
      });
    },
    mapCustomNavigation: function(t, as) {
      var a, b, boardID, href, m, text, type, url, _i, _len;
      if (/^[^\w@]/.test(t)) {
        return $.tn(t);
      }
      text = '';
      url = '';
      t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) {
        text = m1;
        url = m2;
        return '';
      });
      if (/^toggle-all/.test(t)) {
        a = $.el('a', {
          className: 'show-board-list-button',
          textContent: text || '+',
          href: 'javascript:;'
        });
        $.on(a, 'click', Header.toggleBoardList);
        return a;
      }
      if (/^external/.test(t)) {
        a = $.el('a', {
          href: url || 'javascript:;',
          textContent: text || '+',
          className: 'external'
        });
        if (a.hostname === 'boards.4chan.org' && a.pathname.split('/')[1] === g.BOARD.ID) {
          a.className += ' current';
        }
        return a;
      }
      boardID = t.split('-')[0];
      if (boardID === 'current') {
        boardID = g.BOARD.ID;
      }
      for (_i = 0, _len = as.length; _i < _len; _i++) {
        b = as[_i];
        if (!(b.textContent === boardID)) {
          continue;
        }
        a = b.cloneNode();
        break;
      }
      a || (a = $.el('a', {
        href: "/" + boardID + "/",
        title: text || boardID
      }));
      if (Conf['JSON Navigation']) {
        $.on(a, 'click', Navigate.navigate);
      }
      a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title : /-full/.test(t) ? "/" + boardID + "/ - " + a.title : text || boardID;
      if (/-archive/.test(t)) {
        if (href = Redirect.to('board', {
          boardID: boardID
        })) {
          a.href = href;
        } else {
          return a.firstChild;
        }
      }
      if (m = t.match(/-mode:"([^"]+)"/)) {
        type = m[1].toLowerCase();
        a.dataset.indexMode = (function() {
          switch (type) {
            case 'all threads':
              return 'all pages';
            case 'paged':
            case 'catalog':
              return type;
            default:
              return 'paged';
          }
        })();
      }
      if (m = t.match(/-sort:"([^"]+)"/)) {
        type = m[1].toLowerCase();
        a.dataset.indexSort = (function() {
          switch (type) {
            case 'bump order':
              return 'bump';
            case 'last reply':
              return 'lastreply';
            case 'creation date':
              return 'birth';
            case 'reply count':
              return 'replycount';
            case 'file count':
              return 'filecount';
            default:
              return 'bump';
          }
        })();
      }
      if (boardID === '@') {
        $.addClass(a, 'navSmall');
      }
      return a;
    },
    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;
    },
    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');
      if (hide) {
        $.addClass(Header.bar, 'autohide');
        return $.addClass(doc, 'autohide');
      } else {
        $.rmClass(Header.bar, 'autohide');
        return $.rmClass(doc, 'autohide');
      }
    },
    toggleBarVisibility: function() {
      var hide, message;
      hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
      Conf['Header auto-hide'] = hide;
      $.set('Header auto-hide', hide);
      Header.setBarVisibility(hide);
      Header.headerToggler = hide;
      message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.');
      return new Notice('info', message, 2);
    },
    setHideBarOnScroll: function(hide) {
      Header.scrollHeaderToggler.checked = hide;
      if (hide) {
        $.on(window, 'scroll', Header.hideBarOnScroll);
        return;
      }
      $.off(window, 'scroll', Header.hideBarOnScroll);
      $.rmClass(Header.bar, 'scroll');
      if (!Conf['Header auto-hide']) {
        return $.rmClass(Header.bar, 'autohide');
      }
    },
    toggleHideBarOnScroll: function(e) {
      var hide;
      hide = this.checked;
      $.cb.checked.call(this);
      return Header.setHideBarOnScroll(hide);
    },
    hideBarOnScroll: function() {
      var offsetY;
      offsetY = window.pageYOffset;
      if (offsetY > (Header.previousOffset || 0)) {
        $.addClass(Header.bar, 'autohide', 'scroll');
      } else {
        $.rmClass(Header.bar, 'autohide', 'scroll');
      }
      return Header.previousOffset = offsetY;
    },
    setBarPosition: function(bottom) {
      var args;
      Header.barPositionToggler.checked = bottom;
      $.event('CloseMenu');
      args = bottom ? ['bottom-header', 'top-header', 'bottom'] : ['top-header', 'bottom-header', 'top'];
      $.addClass(doc, args[0]);
      $.rmClass(doc, args[1]);
      Header.bar.parentNode.className = args[2];
      return $.before(Header.bar, Header.noticesRoot);
    },
    toggleBarPosition: function() {
      $.cb.checked.call(this);
      return Header.setBarPosition(this.checked);
    },
    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-container', full);
      return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], btn.hidden = _ref[2], _ref;
    },
    toggleCustomNav: function() {
      $.cb.checked.call(this);
      return Header.setCustomNav(this.checked);
    },
    editCustomNav: function() {
      var settings;
      Settings.open('Advanced');
      settings = $.id('fourchanx-settings');
      return $('[name=boardnav]', settings).focus();
    },
    hashScroll: function() {
      var hash, post;
      hash = this.location.hash.slice(1);
      if (!(/^p\d+$/.test(hash) && (post = $.id(hash)))) {
        return;
      }
      if ((Get.postFromNode(post)).isHidden) {
        return;
      }
      return Header.scrollTo(post);
    },
    scrollTo: function(root, down, needed) {
      var height, x;
      if (down) {
        x = Header.getBottomOf(root);
        if (Conf['Header auto-hide on scroll'] && Conf['Bottom header']) {
          height = Header.bar.getBoundingClientRect().height;
          if (x <= 0) {
            if (!Header.isHidden()) {
              x += height;
            }
          } else {
            if (Header.isHidden()) {
              x -= height;
            }
          }
        }
        if (!(needed && x >= 0)) {
          return window.scrollBy(0, -x);
        }
      } else {
        x = Header.getTopOf(root);
        if (Conf['Header auto-hide on scroll'] && !Conf['Bottom header']) {
          height = Header.bar.getBoundingClientRect().height;
          if (x >= 0) {
            if (!Header.isHidden()) {
              x += height;
            }
          } else {
            if (Header.isHidden()) {
              x -= height;
            }
          }
        }
        if (!(needed && x >= 0)) {
          return window.scrollBy(0, x);
        }
      }
    },
    scrollToIfNeeded: function(root, down) {
      return Header.scrollTo(root, down, true);
    },
    getTopOf: function(root) {
      var headRect, top;
      top = root.getBoundingClientRect().top;
      if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
        headRect = Header.toggle.getBoundingClientRect();
        top -= headRect.top + headRect.height - 10;
      }
      return top;
    },
    getBottomOf: function(root) {
      var bottom, clientHeight, headRect;
      clientHeight = doc.clientHeight;
      bottom = clientHeight - root.getBoundingClientRect().bottom;
      if (Conf['Bottom Header']) {
        headRect = Header.toggle.getBoundingClientRect();
        bottom -= clientHeight - headRect.bottom + headRect.height - 10;
      }
      return bottom;
    },
    isNodeVisible: function(node) {
      var height;
      if (d.hidden || !doc.contains(node)) {
        return false;
      }
      height = node.getBoundingClientRect().height;
      return Header.getTopOf(node) + height >= 0 && Header.getBottomOf(node) + height >= 0;
    },
    isHidden: function() {
      var top;
      top = Header.bar.getBoundingClientRect().top;
      if (Conf['Bottom header']) {
        return top === doc.clientHeight;
      } else {
        return top < 0;
      }
    },
    addShortcut: function(el, icon) {
      $.addClass(el, 'shortcut');
      return $.add(Header[icon ? 'icons' : 'stats'], el);
    },
    rmShortcut: function(el, icon) {
      return $.rm(icon ? el.parentElement : el);
    },
    menuToggle: function(e) {
      return Header.menu.toggle(e, this, g);
    },
    createNotification: function(e) {
      var content, lifetime, notice, type, _ref;
      _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime;
      return notice = new Notice(type, content, lifetime);
    },
    areNotificationsEnabled: false,
    enableDesktopNotifications: function() {
      var authorize, disable, el, notice, _ref;
      if (!(window.Notification && Conf['Desktop Notifications'])) {
        return;
      }
      switch (Notification.permission) {
        case 'granted':
          Header.areNotificationsEnabled = true;
          return;
        case 'denied':
          return;
      }
      el = $.el('span', {
        innerHTML: E(g.NAME) + " needs your permission to show desktop notifications. [<a href=\"" + E(g.FAQ) + "#why-is-4chan-x-asking-for-permission-to-show-desktop-notifications\" target=\"_blank\">FAQ</a>]<br><button>Authorize</button> or <button>Disable</button>"
      });
      _ref = $$('button', el), authorize = _ref[0], disable = _ref[1];
      $.on(authorize, 'click', function() {
        return Notification.requestPermission(function(status) {
          Header.areNotificationsEnabled = status === 'granted';
          if (status === 'default') {
            return;
          }
          return notice.close();
        });
      });
      $.on(disable, 'click', function() {
        $.set('Desktop Notifications', false);
        return notice.close();
      });
      return notice = new Notice('info', el);
    }
  };

  Index = {
    showHiddenThreads: false,
    init: function() {
      var anchorEntry, input, label, modeEntry, name, pinEntry, refNavEntry, repliesEntry, returnLink, select, sortEntry, targetEntry, threadNumEntry, threadsNumInput, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;
      if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
        return;
      }
      this.board = "" + g.BOARD;
      this.button = $.el('a', {
        className: 'index-refresh-shortcut fa',
        title: 'Refresh Index',
        href: 'javascript:;',
        textContent: "\uf021"
      });
      $.on(this.button, 'click', this.update);
      Header.addShortcut(this.button, 1);
      this.db = new DataBoard('pinnedThreads');
      Thread.callbacks.push({
        name: 'Thread Pinning',
        cb: this.threadNode
      });
      CatalogThread.callbacks.push({
        name: 'Catalog Features',
        cb: this.catalogNode
      });
      modeEntry = {
        el: $.el('span', {
          textContent: 'Index mode'
        }),
        subEntries: [
          {
            el: $.el('label', {
              innerHTML: '<input type=radio name="Index Mode" value="paged"> Paged'
            })
          }, {
            el: $.el('label', {
              innerHTML: '<input type=radio name="Index Mode" value="infinite"> Infinite scrolling'
            })
          }, {
            el: $.el('label', {
              innerHTML: '<input type=radio name="Index Mode" value="all pages"> All threads'
            })
          }
        ]
      };
      _ref1 = modeEntry.subEntries;
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        label = _ref1[_i];
        input = label.el.firstChild;
        input.checked = Conf['Index Mode'] === input.value;
        $.on(input, 'change', $.cb.value);
        $.on(input, 'change', this.cb.mode);
      }
      sortEntry = {
        el: $.el('span', {
          textContent: 'Sort by'
        })
      };
      threadNumEntry = {
        el: $.el('span', {
          textContent: 'Threads per page'
        }),
        subEntries: [
          {
            el: $.el('label', {
              innerHTML: '<input type=number min=0 name="Threads per Page">',
              title: 'Use 0 for default value'
            })
          }
        ]
      };
      threadsNumInput = threadNumEntry.subEntries[0].el.firstChild;
      threadsNumInput.value = Conf['Threads per Page'];
      $.on(threadsNumInput, 'change', $.cb.value);
      $.on(threadsNumInput, 'change', this.cb.threadsNum);
      targetEntry = {
        el: UI.checkbox('Open threads in a new tab', 'Open threads in a new tab')
      };
      repliesEntry = {
        el: UI.checkbox('Show Replies', 'Show replies')
      };
      pinEntry = {
        el: UI.checkbox('Pin Watched Threads', 'Pin watched threads')
      };
      anchorEntry = {
        el: UI.checkbox('Anchor Hidden Threads', 'Anchor hidden threads')
      };
      refNavEntry = {
        el: UI.checkbox('Refreshed Navigation', 'Refreshed navigation')
      };
      targetEntry.el.title = 'Catalog-only setting.';
      pinEntry.el.title = 'Move watched threads to the start of the index.';
      anchorEntry.el.title = 'Move hidden threads to the end of the index.';
      refNavEntry.el.title = 'Refresh index when navigating through pages.';
      _ref2 = [targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry];
      for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
        label = _ref2[_j];
        input = label.el.firstChild;
        name = input.name;
        input.checked = Conf[name];
        $.on(input, 'change', $.cb.checked);
        switch (name) {
          case 'Open threads in a new tab':
            $.on(input, 'change', this.cb.target);
            break;
          case 'Show Replies':
            $.on(input, 'change', this.cb.replies);
            break;
          case 'Pin Watched Threads':
          case 'Anchor Hidden Threads':
            $.on(input, 'change', this.cb.sort);
        }
      }
      Header.menu.addEntry({
        el: $.el('span', {
          textContent: 'Index Navigation'
        }),
        order: 98,
        subEntries: [threadNumEntry, targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry]
      });
      $.addClass(doc, 'index-loading');
      this.root = $.el('div', {
        className: 'board'
      });
      this.pagelist = $.el('div', {
        className: 'pagelist',
        hidden: true
      });
      $.extend(this.pagelist, {
        innerHTML: "<div class=\"prev\"><a>&lt;</a></div><div class=\"pages\"></div><div class=\"next\"><a>&gt;</a></div>"
      });
      this.navLinks = $.el('div', {
        className: 'navLinks'
      });
      $.extend(this.navLinks, {
        innerHTML: "<span id=\"index-menu\"><input type=\"search\" id=\"index-search\" class=\"field\" placeholder=\"Search\"><a id=\"index-search-clear\" class=\"fa\" href=\"javascript:;\">\uf05c</a>&nbsp;<time id=\"index-last-refresh\" title=\"Last index refresh\">...</time><span id=\"hidden-label\" hidden>&nbsp;&mdash; <span id=\"hidden-count\"></span> <span id=\"hidden-toggle\">[<a href=\"javascript:;\">Show</a>]</span></span><span style='flex: 1'></span><select id=\"index-mode\" name=\"Index Mode\"><option disabled>Index Mode</option><option value=\"paged\">Paged</option><option value=\"infinite\">Infinite Scrolling</option><option value=\"all pages\">All threads</option><option value=\"catalog\">Catalog</option></select><select id=\"index-sort\" name=\"Index Sort\"><option disabled>Index Sort</option><option value=\"bump\">Bump order</option><option value=\"lastreply\">Last reply</option><option value=\"birth\">Creation date</option><option value=\"replycount\">Reply count</option><option value=\"filecount\">File count</option></select><select id=\"index-size\" name=\"Index Size\"><option disabled>Image Size</option><option value=\"small\">Small</option><option value=\"large\">Large</option></select></span>"
      });
      this.timeEl = $('time#index-last-refresh', this.navLinks);
      this.searchInput = $('#index-search', this.navLinks);
      this.searchTest(true);
      this.hideLabel = $('#hidden-label', this.navLinks);
      this.selectMode = $('#index-mode', this.navLinks);
      this.selectSort = $('#index-sort', this.navLinks);
      this.selectSize = $('#index-size', this.navLinks);
      $.on(this.searchInput, 'input', this.onSearchInput);
      $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
      $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
      _ref3 = [this.selectMode, this.selectSort, this.selectSize];
      for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) {
        select = _ref3[_k];
        select.value = Conf[select.name];
        $.on(select, 'change', $.cb.value);
      }
      $.on(this.selectMode, 'change', this.cb.mode);
      $.on(this.selectSort, 'change', this.cb.sort);
      $.on(this.selectSize, 'change', this.cb.size);
      Rice.nodes(this.navLinks);
      this.currentPage = this.getCurrentPage();
      $.on(d, 'scroll', this.scroll);
      if (Conf['Update Stale Index']) {
        $.on(window, 'focus', this.updateIfNeeded);
      }
      $.on(this.pagelist, 'click', this.cb.pageNav);
      returnLink = $.el('a', {
        id: 'returnIcon',
        className: 'a-icon',
        href: '.././'
      });
      this.catalogLink = $.el('a', {
        id: 'catalogIcon',
        className: 'a-icon',
        href: "//boards.4chan.org/" + g.BOARD.ID + "/"
      });
      this.catalogLink.dataset.indexMode = 'catalog';
      $.on(returnLink, 'click', function(e) {
        if (g.VIEW === 'index') {
          Index.setIndexMode(Conf['Previous Index Mode']);
          e.preventDefault();
          return;
        }
        return Navigate.navigate.call(this, e);
      });
      $.on(this.catalogLink, 'click', Navigate.navigate);
      Header.addShortcut(this.catalogLink, true);
      Header.addShortcut(returnLink, true);
      if (g.VIEW === 'index') {
        this.update();
        this.cb.toggleCatalogMode();
      }
      $.asap((function() {
        return $('.board', doc) || d.readyState !== 'loading';
      }), function() {
        var board, navLink, _l, _len3, _ref4, _ref5;
        _ref4 = $$('.navLinks');
        for (_l = 0, _len3 = _ref4.length; _l < _len3; _l++) {
          navLink = _ref4[_l];
          $.rm(navLink);
        }
        if ((_ref5 = $.id('search-box')) != null) {
          _ref5.parentNode.remove();
        }
        $.after($.x('child::form/preceding-sibling::hr[1]'), Index.navLinks);
        if (g.VIEW !== 'index' || Index.root.parentElement) {
          return;
        }
        board = $('.board');
        $.replace(board, Index.root);
        $.event('PostsInserted');
        return d.implementation.createDocument(null, null, null).appendChild(board);
      });
      return $.asap((function() {
        return $('.pagelist', doc) || d.readyState !== 'loading';
      }), function() {
        var pagelist;
        if (pagelist = $('.pagelist')) {
          $.replace(pagelist, Index.pagelist);
        } else {
          $.after($.id('delform'), Index.pagelist);
        }
        return $.rmClass(doc, 'index-loading');
      });
    },
    scroll: function() {
      if (Index.req || Conf['Index Mode'] !== 'infinite' || (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight)) || g.VIEW === 'thread') {
        return;
      }
      Index.currentPage = Index.getCurrentPage() + 1;
      if (Index.currentPage >= Index.pagesNum) {
        return Index.endNotice();
      }
      return Index.buildIndex(true);
    },
    endNotice: (function() {
      var notify, reset;
      notify = false;
      reset = function() {
        return notify = false;
      };
      return function() {
        if (notify) {
          return;
        }
        notify = true;
        new Notice('info', "Last page reached.", 2);
        return setTimeout(reset, 3 * $.SECOND);
      };
    })(),
    menu: {
      init: function() {
        if (g.VIEW !== 'index' || !Conf['Menu'] || g.BOARD.ID === 'f') {
          return;
        }
        return Menu.menu.addEntry({
          el: $.el('a', {
            href: 'javascript:;'
          }),
          order: 19,
          open: function(_arg) {
            var thread;
            thread = _arg.thread;
            if (Conf['Index Mode'] !== 'catalog') {
              return false;
            }
            this.el.textContent = thread.isPinned ? 'Unpin thread' : 'Pin thread';
            if (this.cb) {
              $.off(this.el, 'click', this.cb);
            }
            this.cb = function() {
              $.event('CloseMenu');
              return Index.togglePin(thread);
            };
            return $.on(this.el, 'click', this.cb);
          }
        });
      }
    },
    threadNode: function() {
      if (g.VIEW !== 'index') {
        return;
      }
      if (!Index.db.get({
        boardID: this.board.ID,
        threadID: this.ID
      })) {
        return;
      }
      return this.pin();
    },
    catalogNode: function() {
      $.on(this.nodes.thumb, 'click', Index.onClick);
      if (Conf['Image Hover in Catalog']) {
        return;
      }
      return $.on(this.nodes.thumb, 'mouseover', Index.onOver);
    },
    onClick: function(e) {
      var thread;
      if (e.button !== 0) {
        return;
      }
      thread = g.threads[this.parentNode.dataset.fullID];
      if (e.shiftKey) {
        PostHiding.toggle(thread.OP);
      } else if (e.altKey) {
        Index.togglePin(thread);
      } else {
        return Navigate.navigate.call(this, e);
      }
      return e.preventDefault();
    },
    onOver: function(e) {
      var el, nodes;
      nodes = g.threads[this.parentNode.dataset.fullID].OP.nodes;
      el = $.el('div', {
        innerHTML: '<div class=post><div class=postInfo></div></div>',
        className: 'thread-info dialog',
        hidden: true
      });
      $.add(el.firstElementChild.firstElementChild, [$('.nameBlock', nodes.info).cloneNode(true), $.tn(' '), nodes.date.cloneNode(true)]);
      $.add(Header.hover, el);
      UI.hover({
        root: this,
        el: el,
        latestEvent: e,
        endEvents: 'mouseout',
        asapTest: function() {
          return true;
        },
        offsetX: 15,
        offsetY: -20
      });
      return setTimeout((function() {
        if (el.parentNode) {
          return el.hidden = false;
        }
      }), .25 * $.SECOND);
    },
    togglePin: function(thread) {
      var data;
      data = {
        boardID: thread.board.ID,
        threadID: thread.ID
      };
      if (thread.isPinned) {
        thread.unpin();
        Index.db["delete"](data);
      } else {
        thread.pin();
        data.val = true;
        Index.db.set(data);
      }
      Index.sort();
      return Index.buildIndex();
    },
    setIndexMode: function(mode) {
      Index.selectMode.value = mode;
      return $.event('change', null, Index.selectMode);
    },
    cycleSortType: function() {
      var i, option, type, types, _i, _len;
      types = (function() {
        var _i, _len, _ref, _results;
        _ref = Index.selectSort.options;
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          option = _ref[_i];
          if (!option.disabled) {
            _results.push(option);
          }
        }
        return _results;
      })();
      for (i = _i = 0, _len = types.length; _i < _len; i = ++_i) {
        type = types[i];
        if (type.selected) {
          break;
        }
      }
      types[(i + 1) % types.length].selected = true;
      return $.event('change', null, Index.selectSort);
    },
    catalogSwitch: function() {
      return $.get('JSON Navigation', true, function(items) {
        var hash;
        if (!items['JSON Navigation']) {
          return;
        }
        $.set('Index Mode', 'catalog');
        hash = window.location.hash;
        return window.location = './' + hash;
      });
    },
    searchTest: function(init) {
      var hash, match;
      if (!(hash = window.location.hash)) {
        return false;
      }
      if (!(match = hash.match(/s=([\w\s\n]+)/))) {
        return false;
      }
      this.searchInput.value = match[1];
      if (init) {
        $.on(d, '4chanXInitFinished', Index.onSearchInput);
      } else {
        Index.onSearchInput();
      }
      return true;
    },
    setupNavLinks: function() {
      var el, _i, _len, _ref;
      _ref = $$('.navLinks.desktop > a');
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        el = _ref[_i];
        if (/\/catalog$/.test(el.pathname)) {
          el.href = '.././';
        }
        $.on(el, 'click', function() {
          switch (this.textContent) {
            case 'Return':
              return $.set('Index Mode', Conf['Previous Index Mode']);
            case 'Catalog':
              return $.set('Index Mode', 'catalog');
          }
        });
      }
    },
    cb: {
      toggleCatalogMode: function() {
        if (Conf['Index Mode'] === 'catalog') {
          $.addClass(doc, 'catalog-mode');
        } else {
          $.rmClass(doc, 'catalog-mode');
        }
        return Index.cb.size();
      },
      toggleHiddenThreads: function() {
        $('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? 'Hide' : 'Show';
        Index.sort();
        if (Conf['Index Mode'] === 'paged' && Index.getCurrentPage() > 1) {
          return Index.pageNav(1);
        } else {
          return Index.buildIndex();
        }
      },
      mode: function(e) {
        var mode;
        Index.cb.toggleCatalogMode();
        Index.togglePagelist();
        if (e) {
          Index.buildIndex();
        }
        mode = Conf['Index Mode'];
        if (mode !== 'catalog' && mode !== Conf['Previous Index Mode']) {
          Conf['Previous Index Mode'] = mode;
          return $.set('Previous Index Mode', mode);
        }
      },
      sort: function(e) {
        Index.sort();
        if (e) {
          return Index.buildIndex();
        }
      },
      size: function(e) {
        if (Conf['Index Mode'] !== 'catalog') {
          $.rmClass(Index.root, 'catalog-small');
          $.rmClass(Index.root, 'catalog-large');
        } else if (Conf['Index Size'] === 'small') {
          $.addClass(Index.root, 'catalog-small');
          $.rmClass(Index.root, 'catalog-large');
        } else {
          $.addClass(Index.root, 'catalog-large');
          $.rmClass(Index.root, 'catalog-small');
        }
        if (e) {
          return Index.buildIndex();
        }
      },
      threadsNum: function() {
        if (Conf['Index Mode'] !== 'paged') {
          return;
        }
        return Index.buildIndex();
      },
      target: function() {
        return g.BOARD.threads.forEach(function(thread) {
          var thumb;
          if (!thread.catalogView) {
            return;
          }
          thumb = thread.catalogView.nodes.thumb;
          if (Conf['Open threads in a new tab']) {
            return thumb.target = '_blank';
          } else {
            return thumb.removeAttribute('target');
          }
        });
      },
      replies: function() {
        Index.buildThreads();
        Index.sort();
        return Index.buildIndex();
      },
      pageNav: function(e) {
        var a;
        if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
          return;
        }
        switch (e.target.nodeName) {
          case 'BUTTON':
            e.target.blur();
            a = e.target.parentNode;
            break;
          case 'A':
            a = e.target;
            break;
          default:
            return;
        }
        e.preventDefault();
        if (Index.cb.indexNav(a, true)) {
          return;
        }
        return Index.userPageNav(+a.pathname.split('/')[2] || 1);
      },
      headerNav: function(e) {
        var a, needChange, onSameIndex;
        a = e.target;
        if (e.button !== 0 || a.nodeName !== 'A' || a.hostname !== 'boards.4chan.org') {
          return;
        }
        onSameIndex = g.VIEW === 'index' && a.pathname.split('/')[1] === g.BOARD.ID;
        needChange = Index.cb.indexNav(a, onSameIndex);
        if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || !onSameIndex || g.BOARD.ID === 'f') {
          return;
        }
        e.preventDefault();
        if (!needChange) {
          return Index.update();
        }
      },
      indexNav: function(a, onSameIndex) {
        var indexMode, indexSort, needChange, _ref;
        _ref = a.dataset, indexMode = _ref.indexMode, indexSort = _ref.indexSort;
        if (indexMode && Conf['Index Mode'] !== indexMode) {
          $.set('Index Mode', indexMode);
          Conf['Index Mode'] = indexMode;
          if (onSameIndex) {
            Index.selectMode.value = indexMode;
            Index.cb.mode();
            needChange = true;
          }
        }
        if (indexSort && Conf['Index Sort'] !== indexSort) {
          $.set('Index Sort', indexSort);
          Conf['Index Sort'] = indexSort;
          if (onSameIndex) {
            Index.selectSort.value = indexSort;
            Index.cb.sort();
            needChange = true;
          }
        }
        if (needChange) {
          Index.buildIndex();
          Index.scrollToIndex();
        }
        return needChange;
      }
    },
    scrollToIndex: function() {
      return Header.scrollToIfNeeded(Index.navLinks);
    },
    getCurrentPage: function() {
      var _ref;
      if ((_ref = Conf['Index Mode']) === 'all pages' || _ref === 'catalog') {
        return 1;
      }
      if (Conf['Index Mode'] === 'infinite' && Index.currentPage) {
        return Index.currentPage;
      }
      return +window.location.pathname.split('/')[2] || 1;
    },
    userPageNav: function(pageNum) {
      Navigate.pushState(pageNum === 1 ? './' : pageNum);
      if (Conf['Refreshed Navigation'] && Conf['Index Mode'] !== 'all pages') {
        return Index.update(pageNum);
      } else {
        return Index.pageNav(pageNum);
      }
    },
    pageNav: function(pageNum) {
      if (Index.currentPage === pageNum && !Index.root.parentElement) {
        return;
      }
      Navigate.pushState(pageNum === 1 ? './' : pageNum);
      return Index.pageLoad(pageNum);
    },
    pageLoad: function(pageNum) {
      Index.currentPage = pageNum;
      if (Conf['Index Mode'] === 'all pages') {
        return;
      }
      Index.buildIndex();
      return Index.scrollToIndex();
    },
    getThreadsNumPerPage: function() {
      if (Conf['Threads per Page'] > 0) {
        return +Conf['Threads per Page'];
      } else {
        return Index.threadsNumPerPage;
      }
    },
    getPagesNum: function() {
      return Math.ceil(Index.sortedThreads.length / Index.getThreadsNumPerPage());
    },
    getMaxPageNum: function() {
      var max, min;
      min = 1;
      max = +Index.getPagesNum();
      if (min < max) {
        return max;
      } else {
        return min;
      }
    },
    togglePagelist: function() {
      return Index.pagelist.hidden = Conf['Index Mode'] !== 'paged';
    },
    buildPagelist: function() {
      var a, i, maxPageNum, nodes, pagesRoot, _i;
      pagesRoot = $('.pages', Index.pagelist);
      maxPageNum = Index.getMaxPageNum();
      if (pagesRoot.childElementCount !== maxPageNum) {
        nodes = [];
        for (i = _i = 1; _i <= maxPageNum; i = _i += 1) {
          a = $.el('a', {
            textContent: i,
            href: i === 1 ? './' : i
          });
          nodes.push($.tn('['), a, $.tn('] '));
        }
        $.rmAll(pagesRoot);
        $.add(pagesRoot, nodes);
      }
      return Index.togglePagelist();
    },
    setPage: function(pageNum) {
      var a, href, maxPageNum, next, pagesRoot, prev, strong;
      if (pageNum == null) {
        pageNum = Index.getCurrentPage();
      }
      Index.currentPage = pageNum;
      maxPageNum = Index.getMaxPageNum();
      pagesRoot = $('.pages', Index.pagelist);
      prev = pagesRoot.previousElementSibling.firstElementChild;
      href = Math.max(pageNum - 1, 1);
      prev.href = href === 1 ? './' : href;
      prev.firstChild.disabled = href === pageNum;
      next = pagesRoot.nextElementSibling.firstElementChild;
      href = Math.min(pageNum + 1, maxPageNum);
      next.href = href === 1 ? './' : href;
      next.firstChild.disabled = href === pageNum;
      if (strong = $('strong', pagesRoot)) {
        if (+strong.textContent === pageNum) {
          return;
        }
        $.replace(strong, strong.firstChild);
      } else {
        strong = $.el('strong');
      }
      if (!(a = pagesRoot.children[pageNum - 1])) {
        return;
      }
      $.before(a, strong);
      return $.add(strong, a);
    },
    updateHideLabel: function() {
      var hiddenCount, thread, threadID, _i, _len, _ref;
      hiddenCount = 0;
      _ref = g.BOARD.threads.keys;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        threadID = _ref[_i];
        thread = g.BOARD.threads[threadID];
        if (thread.isHidden && __indexOf.call(Index.liveThreadData.keys, threadID) >= 0) {
          hiddenCount++;
        }
      }
      if (!hiddenCount) {
        Index.hideLabel.hidden = true;
        if (Index.showHiddenThreads) {
          Index.cb.toggleHiddenThreads();
        }
        return;
      }
      Index.hideLabel.hidden = false;
      return $('#hidden-count', Index.hideLabel).textContent = hiddenCount === 1 ? '1 hidden thread' : "" + hiddenCount + " hidden threads";
    },
    updateIfNeeded: function() {
      var needed, timeEl;
      timeEl = Index.timeEl;
      needed = g.VIEW === 'index' && !Index.req && timeEl.dataset.utc && timeEl.dataset.utc < Date.now() - (10 * $.MINUTE);
      if (needed) {
        return Index.update();
      }
    },
    update: function(pageNum) {
      var board, now, onload, sortedThreads, _ref, _ref1;
      if (!navigator.onLine) {
        return;
      }
      if (g.VIEW === 'thread') {
        if (Conf['Thread Updater']) {
          ThreadUpdater.update();
        }
        return;
      }
      if (!(d.readyState === 'loading' || Index.root.parentElement)) {
        $.replace($('.board'), Index.root);
      }
      Index.currentPage = 1;
      if ((_ref = Index.req) != null) {
        _ref.abort();
      }
      if ((_ref1 = Index.notice) != null) {
        _ref1.close();
      }
      sortedThreads = Index.sortedThreads;
      if (sortedThreads) {
        board = sortedThreads[0].board.ID;
      }
      now = Date.now();
      $.ready(function() {
        return Index.nTimeout = setTimeout((function() {
          if (Index.req && !Index.notice) {
            return Index.notice = new Notice('info', 'Refreshing index...', 2);
          }
        }), 3 * $.SECOND - (Date.now() - now));
      });
      if (typeof pageNum !== 'number') {
        pageNum = '';
      }
      onload = function(e) {
        return Index.load(e, pageNum);
      };
      Index.req = $.ajax("//a.4cdn.org/" + g.BOARD.ID + "/catalog.json", {
        onabort: onload,
        onloadend: onload,
        onerror: onload
      }, {
        whenModified: board === g.BOARD.ID
      });
      return $.addClass(Index.button, 'fa-spin');
    },
    load: function(e, pageNum) {
      var err, nTimeout, notice, req, timeEl, _ref;
      $.rmClass(Index.button, 'fa-spin');
      req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
      if (nTimeout) {
        clearTimeout(nTimeout);
      }
      delete Index.nTimeout;
      delete Index.req;
      delete Index.notice;
      if (e.type === 'abort') {
        req.onloadend = null;
        notice.close();
        return;
      }
      if ((_ref = req.status) !== 200 && _ref !== 304) {
        err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
        if (notice) {
          notice.setType('warning');
          notice.el.lastElementChild.textContent = err;
          setTimeout(notice.close, $.SECOND);
        } else {
          new Notice('warning', err, 1);
        }
        return;
      }
      Navigate.title();
      try {
        pageNum || (pageNum = 1);
        if (req.status === 200) {
          Index.parse(req.response, pageNum);
        } else if (req.status === 304) {
          if (Index.currentPage === pageNum) {
            Index.buildIndex();
          } else {
            Index.pageNav(pageNum);
          }
        }
      } catch (_error) {
        err = _error;
        c.error("Index failure: " + err.message, err.stack);
        if (notice) {
          notice.setType('error');
          notice.el.lastElementChild.textContent = 'Index refresh failed.';
          setTimeout(notice.close, $.SECOND);
        } else {
          new Notice('error', 'Index refresh failed.', 1);
        }
        return;
      }
      timeEl = Index.timeEl;
      timeEl.dataset.utc = Date.parse(req.getResponseHeader('Last-Modified'));
      RelativeDates.update(timeEl);
      return Index.scrollToIndex();
    },
    parse: function(pages, pageNum) {
      $.cleanCache(function(url) {
        return /^\/\/a\.4cdn\.org\//.test(url);
      });
      Index.parseThreadList(pages);
      Index.buildThreads();
      Index.sort();
      if ((pageNum != null) && Index.currentPage !== pageNum) {
        Index.pageNav(pageNum);
        return;
      }
      return Index.buildIndex();
    },
    parseThreadList: function(pages) {
      var i, j, live, page, thread, threads;
      Index.threadsNumPerPage = pages[0].threads.length;
      live = new SimpleDict();
      i = 0;
      while (page = pages[i++]) {
        j = 0;
        threads = page.threads;
        while (thread = threads[j++]) {
          live.push(thread.no, thread);
        }
      }
      Index.liveThreadData = live;
      return g.BOARD.threads.forEach(function(thread) {
        var _ref;
        if (_ref = thread.ID, __indexOf.call(Index.liveThreadData.keys, _ref) < 0) {
          return thread.collect();
        }
      });
    },
    buildThreads: function() {
      var errors, posts, threads;
      threads = [];
      posts = [];
      errors = null;
      Index.liveThreadData.forEach(function(threadData) {
        var err, thread, threadRoot;
        threadRoot = Build.thread(g.BOARD, threadData);
        if (thread = g.BOARD.threads[threadData.no]) {
          thread.setPage(Math.floor(i / Index.threadsNumPerPage) + 1);
          thread.setCount('post', threadData.replies + 1, threadData.bumplimit);
          thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit);
          thread.setStatus('Sticky', !!threadData.sticky);
          thread.setStatus('Closed', !!threadData.closed);
        } else {
          thread = new Thread(threadData.no, g.BOARD);
          threads.push(thread);
        }
        thread.threadRoot = threadRoot;
        if (thread.ID in thread.posts) {
          return;
        }
        try {
          return posts.push(new Post($('.opContainer', threadRoot), thread, g.BOARD));
        } catch (_error) {
          err = _error;
          if (!errors) {
            errors = [];
          }
          return errors.push({
            message: "Parsing of Thread No." + thread + " failed. Thread will be skipped.",
            error: err
          });
        }
      });
      if (errors) {
        Main.handleErrors(errors);
      }
      Thread.callbacks.execute(threads);
      Post.callbacks.execute(posts);
      Index.updateHideLabel();
      return $.event('IndexRefresh');
    },
    buildReplies: function(thread) {
      var data, err, errors, lastReplies, node, nodes, post, posts, _i, _len;
      if (!Conf['Show Replies']) {
        return;
      }
      posts = [];
      if (!(lastReplies = Index.liveThreadData[thread.ID].last_replies)) {
        return;
      }
      nodes = [];
      for (_i = 0, _len = lastReplies.length; _i < _len; _i++) {
        data = lastReplies[_i];
        if (post = thread.posts[data.no]) {
          nodes.push(post.nodes.root);
          continue;
        }
        nodes.push(node = Build.postFromObject(data, thread.board.ID));
        try {
          posts.push(new Post(node, thread, thread.board));
        } catch (_error) {
          err = _error;
          if (!errors) {
            errors = [];
          }
          errors.push({
            message: "Parsing of Post No." + data.no + " failed. Post will be skipped.",
            error: err
          });
        }
      }
      $.add(thread.OP.nodes.root.parentElement, nodes);
      if (errors) {
        Main.handleErrors(errors);
      }
      return Post.callbacks.execute(posts);
    },
    buildCatalogViews: function() {
      var catalogThreads, i, nodes, root, size, thread;
      catalogThreads = [];
      nodes = [];
      i = 0;
      size = Conf['Index Size'] === 'small' ? 150 : 250;
      while (thread = Index.sortedThreads[i++]) {
        if (!thread.catalogView) {
          catalogThreads.push(new CatalogThread(Build.catalogThread(thread), thread));
        }
        root = thread.catalogView.nodes.root;
        Index.sizeSingleCatalogNode(root, size);
        nodes.push(root);
      }
      CatalogThread.callbacks.execute(catalogThreads);
      return nodes;
    },
    sizeSingleCatalogNode: function(node, size) {
      var height, ratio, thumb, width, _ref;
      thumb = node.firstElementChild.firstElementChild;
      _ref = thumb.dataset, width = _ref.width, height = _ref.height;
      if (!width) {
        return;
      }
      ratio = size / Math.max(width, height);
      thumb.style.width = width * ratio + 'px';
      return thumb.style.height = height * ratio + 'px';
    },
    sort: function() {
      var i, liveData, sortedThreadIDs, sortedThreads, thread, threadID;
      sortedThreads = [];
      sortedThreadIDs = [];
      liveData = [];
      Index.liveThreadData.forEach(function(data) {
        return liveData.push(data);
      });
      ({
        'bump': function() {
          return sortedThreadIDs = Index.liveThreadData.keys;
        },
        'lastreply': function() {
          var data, i;
          liveData.sort(function(a, b) {
            var _ref, _ref1;
            if ('last_replies' in a) {
              _ref = a.last_replies, a = _ref[_ref.length - 1];
            }
            if ('last_replies' in b) {
              _ref1 = b.last_replies, b = _ref1[_ref1.length - 1];
            }
            return b.no - a.no;
          });
          i = 0;
          while (data = liveData[i++]) {
            sortedThreadIDs.push(data.no);
          }
        },
        'birth': function() {
          return sortedThreadIDs = __slice.call(Index.liveThreadData.keys).sort(function(a, b) {
            return b - a;
          });
        },
        'replycount': function() {
          var data, i;
          liveData.sort(function(a, b) {
            return b.replies - a.replies;
          });
          i = 0;
          while (data = liveData[i++]) {
            sortedThreadIDs.push(data.no);
          }
        },
        'filecount': function() {
          var data, i;
          liveData = [];
          Index.liveThreadData.forEach(function(data) {
            return liveData.push(data);
          });
          liveData.sort(function(a, b) {
            return b.images - a.images;
          });
          i = 0;
          while (data = liveData[i++]) {
            sortedThreadIDs.push(data.no);
          }
        }
      })[Conf['Index Sort']]();
      i = 0;
      while (threadID = sortedThreadIDs[i++]) {
        sortedThreads.push(g.BOARD.threads[threadID]);
      }
      Index.sortedThreads = [];
      i = 0;
      while (thread = sortedThreads[i++]) {
        if (thread.isHidden === Index.showHiddenThreads) {
          Index.sortedThreads.push(thread);
        }
      }
      if (Index.isSearching) {
        Index.sortedThreads = Index.querySearch(Index.searchInput.value) || Index.sortedThreads;
      }
      Index.sortOnTop(function(thread) {
        return thread.isSticky;
      });
      Index.sortOnTop(function(thread) {
        return thread.isOnTop || Conf['Pin Watched Threads'] && ThreadWatcher.isWatched(thread);
      });
      if (Conf['Anchor Hidden Threads']) {
        return Index.sortOnTop(function(thread) {
          return !thread.isHidden;
        });
      }
    },
    sortOnTop: function(match) {
      var bottomThreads, i, offset, thread, topThreads, _i, _len, _ref;
      offset = 0;
      topThreads = [];
      bottomThreads = [];
      _ref = Index.sortedThreads;
      for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
        thread = _ref[i];
        (match(thread) ? topThreads : bottomThreads).push(thread);
      }
      return Index.sortedThreads = topThreads.concat(bottomThreads);
    },
    buildIndex: function(infinite) {
      var i, max, nodes, pageNum, sortedThreads, threadsPerPage;
      sortedThreads = Index.sortedThreads;
      nodes = [];
      switch (Conf['Index Mode']) {
        case 'paged':
        case 'infinite':
          pageNum = Index.getCurrentPage();
          threadsPerPage = Index.getThreadsNumPerPage();
          i = threadsPerPage * (pageNum - 1);
          max = i + threadsPerPage;
          nodes = Index.processThreads(sortedThreads, i, max);
          Index.buildPagelist();
          Index.setPage(pageNum);
          break;
        case 'catalog':
          nodes = Index.buildCatalogViews();
          break;
        default:
          nodes = Index.processThreads(sortedThreads, 0, sortedThreads.length);
      }
      if (!infinite) {
        $.rmAll(Index.root);
      }
      return $.add(Index.root, nodes);
    },
    processThreads: function(threads, i, max) {
      var nodes, thread;
      nodes = [];
      while (i < max && (thread = threads[i++])) {
        nodes.push(thread.OP.nodes.root.parentNode, $.el('hr'));
        Index.buildReplies(thread);
      }
      return nodes;
    },
    isSearching: false,
    clearSearch: function() {
      Index.searchInput.value = null;
      Index.onSearchInput();
      return Index.searchInput.focus();
    },
    onSearchInput: function() {
      var pageNum, _ref, _ref1;
      if (Index.isSearching = !!Index.searchInput.value.trim()) {
        if (!Index.searchInput.dataset.searching) {
          Index.searchInput.dataset.searching = 1;
          Index.pageBeforeSearch = Index.getCurrentPage();
          Index.setPage(pageNum = 1);
        } else {
          if (Conf['Index Mode'] !== 'infinite') {
            pageNum = Index.getCurrentPage();
          }
        }
      } else {
        if (!Index.searchInput.dataset.searching) {
          return;
        }
        pageNum = Index.pageBeforeSearch;
        delete Index.pageBeforeSearch;
        Index.searchInput.removeAttribute('data-searching');
      }
      Index.sort();
      if (((_ref = Conf['Index Mode']) === 'paged' || _ref === 'infinite') && ((_ref1 = Index.currentPage) !== pageNum && _ref1 !== Index.getMaxPageNum())) {
        return Index.pageNav(pageNum);
      } else {
        Index.buildIndex();
        return Index.setPage();
      }
    },
    querySearch: function(query) {
      var keywords;
      if (!(keywords = query.toLowerCase().match(/\S+/g))) {
        return;
      }
      return Index.search(keywords);
    },
    search: function(keywords) {
      var filtered, i, sortedThreads, thread;
      filtered = [];
      i = 0;
      sortedThreads = Index.sortedThreads;
      while (thread = sortedThreads[i++]) {
        if (Index.searchMatch(thread, keywords)) {
          filtered.push(thread);
        }
      }
      return Index.sortedThreads = filtered;
    },
    searchMatch: function(thread, keywords) {
      var file, info, key, keyword, text, _i, _j, _len, _len1, _ref, _ref1;
      _ref = thread.OP, info = _ref.info, file = _ref.file;
      text = [];
      _ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        key = _ref1[_i];
        if (key in info) {
          text.push(info[key]);
        }
      }
      if (file) {
        text.push(file.name);
      }
      text = text.join(' ').toLowerCase();
      for (_j = 0, _len1 = keywords.length; _j < _len1; _j++) {
        keyword = keywords[_j];
        if (-1 === text.indexOf(keyword)) {
          return false;
        }
      }
      return true;
    }
  };

  Build = {
    staticPath: '//s.4cdn.org/image/',
    gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif',
    spoilerRange: {},
    unescape: function(text) {
      if (text == null) {
        return text;
      }
      return text.replace(/<[^>]*>/g, '').replace(/&(amp|#039|quot|lt|gt);/g, function(c) {
        return {
          '&amp;': '&',
          '&#039;': "'",
          '&quot;': '"',
          '&lt;': '<',
          '&gt;': '>'
        }[c];
      });
    },
    shortFilename: function(filename) {
      var ext, threshold;
      threshold = 30;
      ext = filename.match(/\.?[^\.]*$/)[0];
      if (filename.length - ext.length > threshold) {
        return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
      } else {
        return filename;
      }
    },
    sameThread: function(boardID, threadID) {
      return g.VIEW === 'thread' && g.BOARD.ID === boardID && g.THREADID === +threadID;
    },
    postURL: function(boardID, threadID, postID) {
      if (Build.sameThread(boardID, threadID)) {
        return "#p" + postID;
      } else {
        return Build.path(boardID, threadID, postID);
      }
    },
    path: function(boardID, threadID, postID, fragment) {
      var path;
      path = "/" + boardID + "/thread/" + threadID;
      if ((g.SLUG != null) && threadID === g.THREADID) {
        path += "/" + g.SLUG;
      }
      if (postID) {
        path += "#" + (fragment || 'p') + postID;
      }
      return path;
    },
    postFromObject: function(data, boardID) {
      var o;
      o = {
        postID: data.no,
        threadID: data.resto || data.no,
        boardID: boardID,
        name: Build.unescape(data.name),
        capcode: data.capcode,
        tripcode: data.trip,
        uniqueID: data.id,
        email: Build.unescape(data.email),
        subject: Build.unescape(data.sub),
        flagCode: data.country,
        flagName: Build.unescape(data.country_name),
        date: data.now,
        dateUTC: data.time,
        comment: {
          innerHTML: data.com || ''
        },
        isSticky: !!data.sticky,
        isClosed: !!data.closed,
        isArchived: !!data.archived
      };
      if (data.filedeleted) {
        o.file = {
          isDeleted: true
        };
      } else if (data.ext) {
        o.file = {
          name: (Build.unescape(data.filename)) + data.ext,
          timestamp: "" + data.tim + data.ext,
          url: boardID === 'f' ? "//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.filename)) + data.ext : "//i.4cdn.org/" + boardID + "/" + data.tim + data.ext,
          height: data.h,
          width: data.w,
          MD5: data.md5,
          size: data.fsize,
          turl: "//i.4cdn.org/" + boardID + "/" + data.tim + "s.jpg",
          theight: data.tn_h,
          twidth: data.tn_w,
          isSpoiler: !!data.spoiler,
          isDeleted: false,
          tag: data.tag
        };
      }
      return Build.post(o);
    },
    post: function(o) {

      /*
      This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS).
      @license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
       */
      var boardID, capcode, capcodeClass, capcodeIcon, capcodeStart, comment, container, date, dateUTC, desktop2, email, emailField, emailProcessed, file, fileBlock, fileCont, fileDims, fileLink, fileSize, fileText, fileThumb, flag, flagCode, flagName, gifIcon, highlightPost, href, icons, isOP, match, message, name, nameBlock, nameClass, postID, postInfo, postLink, quote, quoteLink, replyLink, shortFilename, spoilerRange, staticPath, subject, subjectField, threadID, tripcode, tripcodeField, type, typeLC, uniqueID, userID, wholePost, _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, comment = o.comment, file = o.file;
      name || (name = '');
      subject || (subject = '');
      isOP = postID === threadID;
      staticPath = Build.staticPath, gifIcon = Build.gifIcon;

      /* Name Block */
      switch (capcode) {
        case 'admin':
        case 'admin_highlight':
          capcodeClass = ' capcodeAdmin';
          capcodeStart = {
            innerHTML: " <strong class=\"capcode hand id_admin\" title=\"Highlight posts by the Administrator\">## Admin</strong>"
          };
          capcodeIcon = {
            innerHTML: " <img src=\"" + E(staticPath) + "adminicon" + E(gifIcon) + "\" alt=\"Admin Icon\" title=\"This user is the 4chan Administrator.\" class=\"identityIcon retina\">"
          };
          break;
        case 'mod':
          capcodeClass = ' capcodeMod';
          capcodeStart = {
            innerHTML: " <strong class=\"capcode hand id_mod\" title=\"Highlight posts by Moderators\">## Mod</strong>"
          };
          capcodeIcon = {
            innerHTML: " <img src=\"" + E(staticPath) + "modicon" + E(gifIcon) + "\" alt=\"Mod Icon\" title=\"This user is a 4chan Moderator.\" class=\"identityIcon retina\">"
          };
          break;
        case 'developer':
          capcodeClass = ' capcodeDeveloper';
          capcodeStart = {
            innerHTML: " <strong class=\"capcode hand id_developer\" title=\"Highlight posts by Developers\">## Developer</strong>"
          };
          capcodeIcon = {
            innerHTML: " <img src=\"" + E(staticPath) + "developericon" + E(gifIcon) + "\" alt=\"Developer Icon\" title=\"This user is a 4chan Developer.\" class=\"identityIcon retina\">"
          };
          break;
        default:
          capcodeClass = '';
          capcodeStart = {
            innerHTML: ""
          };
          capcodeIcon = isOP && boardID === 'f' ? {
            innerHTML: ""
          } : {
            innerHTML: " "
          };
      }
      nameClass = capcode ? ' capcode' : '';
      tripcodeField = tripcode ? {
        innerHTML: " <span class=\"postertrip\">" + E(tripcode) + "</span>"
      } : {
        innerHTML: ""
      };
      emailField = {
        innerHTML: "<span class=\"name" + E(nameClass) + "\">" + E(name) + "</span>" + tripcodeField.innerHTML + capcodeStart.innerHTML
      };
      if (email) {
        emailProcessed = encodeURIComponent(email).replace(/%40/g, '@');
        emailField = {
          innerHTML: "<a href=\"mailto:" + E(emailProcessed) + "\" class=\"useremail\">" + emailField.innerHTML + "</a>"
        };
      }
      userID = !capcode && uniqueID ? {
        innerHTML: " <span class=\"posteruid id_" + E(uniqueID) + "\">(ID: <span class=\"hand\" title=\"Highlight posts by this ID\">" + E(uniqueID) + "</span>)</span>"
      } : {
        innerHTML: ""
      };
      flag = !flagCode ? {
        innerHTML: ""
      } : false ? {
        innerHTML: " <img src=\"" + E(staticPath) + "country/troll/" + E(flagCode.toLowerCase()) + ".gif\" alt=\"" + E(flagCode) + "\" title=\"" + E(flagName) + "\" class=\"countryFlag\">"
      } : {
        innerHTML: " <span title=\"" + E(flagName) + "\" class=\"flag flag-" + E(flagCode.toLowerCase()) + "\"></span>"
      };
      nameBlock = {
        innerHTML: "<span class=\"nameBlock" + E(capcodeClass) + "\">" + emailField.innerHTML + capcodeIcon.innerHTML + userID.innerHTML + flag.innerHTML + "</span> "
      };

      /* Post Info */
      subjectField = isOP || boardID === 'f' ? {
        innerHTML: "<span class=\"subject\">" + E(subject) + "</span> "
      } : {
        innerHTML: ""
      };
      desktop2 = isOP && boardID === 'f' ? '' : ' desktop';
      postLink = Build.postURL(boardID, threadID, postID);
      quoteLink = Build.sameThread(boardID, threadID) ? "javascript:quote('" + (+postID) + "');" : "/" + boardID + "/thread/" + threadID + "#q" + postID;
      icons = (function() {
        var _i, _len, _ref, _results;
        _ref = ['Sticky', 'Closed', 'Archived'];
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          type = _ref[_i];
          if (!(o["is" + type] && !(type === 'Closed' && o.isArchived))) {
            continue;
          }
          typeLC = type.toLowerCase();
          _results.push({
            innerHTML: " <img src=\"" + E(staticPath) + E(typeLC) + E(gifIcon) + "\" alt=\"" + E(type) + "\" title=\"" + E(type) + "\" class=\"" + E(typeLC) + "Icon retina\">"
          });
        }
        return _results;
      })();
      replyLink = isOP && g.VIEW === 'index' ? {
        innerHTML: " &nbsp; <span>[<a href=\"/" + E(boardID) + "/thread/" + E(threadID) + "\" class=\"replylink\">Reply</a>]</span>"
      } : {
        innerHTML: ""
      };
      postInfo = {
        innerHTML: "<div class=\"postInfo desktop\" id=\"pi" + E(postID) + "\"><input type=\"checkbox\" name=\"" + E(postID) + "\" value=\"delete\"> " + subjectField.innerHTML + nameBlock.innerHTML + "<span class=\"dateTime\" data-utc=\"" + E(dateUTC) + "\">" + E(date) + "</span> <span class=\"postNum" + E(desktop2) + "\"><a href=\"" + E(postLink) + "\" title=\"Link to this post\">No.</a><a href=\"" + E(quoteLink) + "\" title=\"Reply to this post\">" + E(postID) + "</a>" + icons.map(function(x) {
          return x.innerHTML;
        }).join('') + replyLink.innerHTML + "</span></div>"
      };

      /* File Info */
      fileCont = (file != null ? file.isDeleted : void 0) ? {
        innerHTML: "<span class=\"fileThumb\"><img src=\"" + E(staticPath) + "filedeleted-res" + E(gifIcon) + "\" alt=\"File deleted.\" class=\"fileDeletedRes retina\"></span>"
      } : file && boardID === 'f' ? {
        innerHTML: "<div class=\"fileInfo\"><span class=\"fileText\" id=\"fT" + E(postID) + "\">File: <a data-width=\"" + E(file.width) + "\" data-height=\"" + E(file.height) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(file.name) + "</a>-(" + E($.bytesToString(file.size)) + ", " + E(file.width) + "x" + E(file.height) + ", " + E(file.tag) + ")</span></div>"
      } : file ? (file.isSpoiler ? (shortFilename = 'Spoiler Image', (spoilerRange = Build.spoilerRange[boardID]) ? fileThumb = "//s.4cdn.org/image/spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png" : fileThumb = '//s.4cdn.org/image/spoiler.png', file.twidth = file.theight = 100) : (shortFilename = Build.shortFilename(file.name, !isOP), fileThumb = file.turl), fileSize = $.bytesToString(file.size), fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : "" + file.width + "x" + file.height, fileLink = file.isSpoiler || file.name === shortFilename ? {
        innerHTML: "<a href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
      } : {
        innerHTML: "<a title=\"" + E(file.name) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
      }, fileText = file.isSpoiler ? {
        innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\" title=\"" + E(file.name) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
      } : {
        innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
      }, {
        innerHTML: fileText.innerHTML + "<a class=\"fileThumb" + E(file.isSpoiler ? " imgspoiler" : "") + "\" href=\"" + E(file.url) + "\" target=\"_blank\"><img src=\"" + E(fileThumb) + "\" alt=\"" + E(fileSize) + "\" data-md5=\"" + E(file.MD5) + "\" style=\"height: " + E(file.theight) + "px; width: " + E(file.twidth) + "px;\"></a>"
      }) : void 0;
      fileBlock = file ? {
        innerHTML: "<div class=\"file\" id=\"f" + E(postID) + "\">" + fileCont.innerHTML + "</div>"
      } : {
        innerHTML: ""
      };

      /* Whole Post */
      highlightPost = capcode === 'admin_highlight' ? ' highlightPost' : '';
      message = {
        innerHTML: "<blockquote class=\"postMessage\" id=\"m" + E(postID) + "\">" + comment.innerHTML + "</blockquote>"
      };
      wholePost = isOP ? {
        innerHTML: "<div id=\"p" + E(postID) + "\" class=\"post op" + E(highlightPost) + "\">" + fileBlock.innerHTML + postInfo.innerHTML + message.innerHTML + "</div>"
      } : {
        innerHTML: "<div class=\"sideArrows\" id=\"sa" + E(postID) + "\">&gt;&gt;</div><div id=\"p" + E(postID) + "\" class=\"post reply" + E(highlightPost) + "\">" + postInfo.innerHTML + fileBlock.innerHTML + message.innerHTML + "</div>"
      };
      container = $.el('div', {
        className: "postContainer " + (isOP ? 'op' : 'reply') + "Container",
        id: "pc" + postID
      });
      $.extend(container, wholePost);
      _ref = $$('.quotelink', container);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        quote = _ref[_i];
        href = quote.getAttribute('href');
        if ((href[0] === '#') && !(Build.sameThread(boardID, threadID))) {
          quote.href = (Build.path(boardID, threadID)) + href;
        } else if ((match = href.match(/^\/([^\/]+)\/thread\/(\d+)/)) && (Build.sameThread(match[1], match[2]))) {
          quote.href = href.match(/(#[^#]*)?$/)[0] || '#';
        }
      }
      return container;
    },
    summary: function(boardID, threadID, posts, files) {
      var text;
      text = [];
      text.push("" + posts + " post" + (posts > 1 ? 's' : ''));
      if (files) {
        text.push("and " + files + " image repl" + (files > 1 ? 'ies' : 'y'));
      }
      text.push('omitted.');
      return $.el('a', {
        className: 'summary',
        textContent: text.join(' '),
        href: Build.path(boardID, threadID)
      });
    },
    thread: function(board, data, full) {
      var OP, root;
      Build.spoilerRange[board] = data.custom_spoiler;
      if ((OP = board.posts[data.no]) && (root = OP.nodes.root.parentNode)) {
        $.rmAll(root);
      } else {
        root = $.el('div', {
          className: 'thread',
          id: "t" + data.no
        });
      }
      $.add(root, Build[full ? 'fullThread' : 'excerptThread'](board, data, OP));
      return root;
    },
    excerptThread: function(board, data, OP) {
      var files, nodes, posts, _ref;
      nodes = [OP ? OP.nodes.root : Build.postFromObject(data, board.ID)];
      if (data.omitted_posts || !Conf['Show Replies'] && data.replies) {
        _ref = Conf['Show Replies'] ? [data.omitted_posts, data.omitted_images] : [data.replies, data.images], posts = _ref[0], files = _ref[1];
        nodes.push(Build.summary(board.ID, data.no, posts, files));
      }
      return nodes;
    },
    fullThread: function(board, data) {
      return Build.postFromObject(data, board.ID);
    },
    catalogThread: function(thread) {
      var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, pageCount, postCount, pp, quote, root, spoilerRange, src, staticPath, subject, thumb, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4;
      staticPath = Build.staticPath, gifIcon = Build.gifIcon;
      data = Index.liveThreadData[thread.ID];
      if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) {
        src = "" + staticPath + "spoiler";
        if (spoilerRange = Build.spoilerRange[thread.board]) {
          src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random());
        }
        src += '.png';
        imgClass = 'spoiler-file';
      } else if (data.filedeleted) {
        src = "" + staticPath + "filedeleted-res" + gifIcon;
        imgClass = 'deleted-file';
      } else if (thread.OP.file) {
        src = thread.OP.file.thumbURL;
      } else {
        src = "" + staticPath + "nofile.png";
        imgClass = 'no-file';
      }
      thumb = imgClass ? {
        innerHTML: "<img src=\"" + E(src) + "\" class=\"catalog-thumb " + E(imgClass) + "\">"
      } : {
        innerHTML: "<img src=\"" + E(src) + "\" class=\"catalog-thumb\" data-width=\"" + E(data.tn_w) + "\" data-height=\"" + E(data.tn_h) + "\">"
      };
      postCount = data.replies + 1;
      fileCount = data.images + !!data.ext;
      pageCount = Math.floor(Index.liveThreadData.keys.indexOf("" + thread.ID) / Index.threadsNumPerPage) + 1;
      subject = thread.OP.info.subject ? {
        innerHTML: "<div class=\"subject\">" + E(thread.OP.info.subject) + "</div>"
      } : {
        innerHTML: ""
      };
      comment = {
        innerHTML: data.com || ''
      };
      root = $.el('div', {
        className: 'catalog-thread'
      });
      $.extend(root, {
        innerHTML: "<a href=\"" + E(Build.path(thread.board.ID, thread.ID)) + "\" class=\"thumb\">" + thumb.innerHTML + "</a><div class=\"catalog-stats\" title=\"Post count / File count / Page count\"><span class=\"post-count\">" + E(postCount) + "</span> / <span class=\"file-count\">" + E(fileCount) + "</span> / <span class=\"page-count\">" + E(pageCount) + "</span><span class=\"catalog-icons\"></span></div>" + subject.innerHTML + "<div class=\"comment\">" + comment.innerHTML + "</div>"
      });
      root.dataset.fullID = thread.fullID;
      if (thread.isPinned) {
        $.addClass(root, 'pinned');
      }
      if (thread.OP.highlights) {
        $.addClass.apply($, [root].concat(__slice.call(thread.OP.highlights)));
      }
      _ref = $$('.quotelink', root.lastElementChild);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        quote = _ref[_i];
        href = quote.getAttribute('href');
        if (href[0] === '#') {
          quote.href = Build.path(thread.board, thread.ID + href);
        }
      }
      _ref1 = $$('.abbr, .exif', root.lastElementChild);
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        exif = _ref1[_j];
        $.rm(exif);
      }
      _ref2 = $$('.prettyprint', root.lastElementChild);
      for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
        pp = _ref2[_k];
        cc = $.el('span', {
          className: 'catalog-code'
        });
        $.add(cc, __slice.call(pp.childNodes));
        $.replace(pp, cc);
      }
      _ref3 = $$('br', root.lastElementChild);
      for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
        br = _ref3[_l];
        if (((_ref4 = br.previousSibling) != null ? _ref4.nodeName : void 0) === 'BR') {
          $.rm(br);
        }
      }
      if (thread.isSticky) {
        $.add($('.catalog-icons', root), $.el('img', {
          src: "" + staticPath + "sticky" + gifIcon,
          className: 'stickyIcon',
          title: 'Sticky'
        }));
      }
      if (thread.isClosed) {
        $.add($('.catalog-icons', root), $.el('img', {
          src: "" + staticPath + "closed" + gifIcon,
          className: 'closedIcon',
          title: 'Closed'
        }));
      }
      if (data.bumplimit) {
        $.addClass($('.post-count', root), 'warning');
      }
      if (data.imagelimit) {
        $.addClass($('.file-count', root), 'warning');
      }
      return root;
    }
  };

  Get = {
    threadExcerpt: function(thread) {
      var OP, excerpt, _ref;
      OP = thread.OP;
      excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' ') || OP.info.nameBlock;
      if (excerpt.length > 70) {
        excerpt = "" + excerpt.slice(0, 67) + "...";
      }
      return "/" + thread.board + "/ - " + excerpt;
    },
    threadFromRoot: function(root) {
      return g.threads[$('.opContainer', root).dataset.fullID];
    },
    threadFromNode: function(node) {
      return Get.threadFromRoot($.x('ancestor::div[@class="thread"]', node));
    },
    postFromRoot: function(root) {
      var index, post;
      post = g.posts[root.dataset.fullID];
      if (index = root.dataset.clone) {
        return post.clones[index];
      } else {
        return post;
      }
    },
    postFromNode: function(node) {
      return Get.postFromRoot($.x('ancestor::div[contains(@class,"postContainer")][1]', node));
    },
    contextFromNode: function(node) {
      return Get.postFromRoot($.x('ancestor::div[@class="thread"]/div', node));
    },
    postDataFromLink: function(link) {
      var boardID, path, postID, threadID, _ref;
      if (link.hostname === 'boards.4chan.org') {
        path = link.pathname.split('/');
        boardID = path[1];
        threadID = path[3];
        postID = link.hash.slice(2);
      } else {
        _ref = link.dataset, boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
        threadID || (threadID = 0);
      }
      return {
        boardID: boardID,
        threadID: +threadID,
        postID: +postID
      };
    },
    allQuotelinksLinkingTo: function(post) {
      var fullID, handleQuotes, posts, qPost, quote, quotelinks, _i, _len, _ref;
      quotelinks = [];
      posts = g.posts;
      fullID = post.fullID;
      handleQuotes = function(qPost, type) {
        var clone, _i, _len, _ref;
        quotelinks.push.apply(quotelinks, qPost.nodes[type]);
        _ref = qPost.clones;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          clone = _ref[_i];
          quotelinks.push.apply(quotelinks, clone.nodes[type]);
        }
      };
      posts.forEach(function(qPost) {
        if (__indexOf.call(qPost.quotes, fullID) >= 0) {
          return handleQuotes(qPost, 'quotelinks');
        }
      });
      if (Conf['Quote Backlinks']) {
        _ref = post.quotes;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          quote = _ref[_i];
          if (qPost = posts[quote]) {
            handleQuotes(qPost, 'backlinks');
          }
        }
      }
      return quotelinks.filter(function(quotelink) {
        var boardID, postID, _ref1;
        _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
        return boardID === post.board.ID && postID === post.ID;
      });
    },
    scriptData: function() {
      var script, _i, _len, _ref;
      _ref = $$('script:not([src])', d.head);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        script = _ref[_i];
        if (/\bcooldowns *=/.test(script.textContent)) {
          return script.textContent;
        }
      }
      return '';
    },
    postClone: function(boardID, threadID, postID, root, context) {
      var post;
      if (post = g.posts["" + boardID + "." + postID]) {
        Get.insert(post, root, context);
        return;
      }
      root.textContent = "Loading post No." + postID + "...";
      if (threadID) {
        return $.cache("//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json", function() {
          return Get.fetchedPost(this, boardID, threadID, postID, root, context);
        });
      } else {
        return Get.archivedPost(boardID, postID, root, context);
      }
    },
    insert: function(post, root, context) {
      var clone, nodes;
      if (!root.parentNode) {
        return;
      }
      clone = post.addClone(context, $.hasClass(root, 'dialog'));
      Clone.callbacks.execute([clone]);
      nodes = clone.nodes;
      $.rmAll(nodes.root);
      $.add(nodes.root, nodes.post);
      $.rmAll(root);
      $.add(root, nodes.root);
      return $.event('PostsInserted');
    },
    fetchedPost: function(req, boardID, threadID, postID, root, context) {
      var api, board, post, posts, status, thread, _i, _len;
      if (post = g.posts["" + boardID + "." + postID]) {
        Get.insert(post, root, context);
        return;
      }
      status = req.status;
      if (status !== 200 && status !== 304) {
        if (Get.archivedPost(boardID, postID, root, context)) {
          return;
        }
        $.addClass(root, 'warning');
        root.textContent = status === 404 ? "Thread No." + threadID + " 404'd." : "Error " + req.statusText + " (" + req.status + ").";
        return;
      }
      posts = req.response.posts;
      Build.spoilerRange[boardID] = posts[0].custom_spoiler;
      for (_i = 0, _len = posts.length; _i < _len; _i++) {
        post = posts[_i];
        if (post.no === postID) {
          break;
        }
      }
      if (post.no !== postID) {
        if (req.cached) {
          api = "//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json";
          $.cleanCache(function(url) {
            return url === api;
          });
          $.cache(api, function() {
            return Get.fetchedPost(this, boardID, threadID, postID, root, context);
          });
          return;
        }
        if (Get.archivedPost(boardID, postID, root, context)) {
          return;
        }
        $.addClass(root, 'warning');
        root.textContent = "Post No." + postID + " was not found.";
        return;
      }
      board = g.boards[boardID] || new Board(boardID);
      thread = g.threads["" + boardID + "." + threadID] || new Thread(threadID, board);
      post = new Post(Build.postFromObject(post, boardID), thread, board);
      post.isFetchedQuote = true;
      Post.callbacks.execute([post]);
      return Get.insert(post, root, context);
    },
    archivedPost: function(boardID, postID, root, context) {
      var url;
      if (!Conf['Resurrect Quotes']) {
        return false;
      }
      if (!(url = Redirect.to('post', {
        boardID: boardID,
        postID: postID
      }))) {
        return false;
      }
      if (/^https:\/\//.test(url) || location.protocol === 'http:') {
        $.cache(url, function() {
          return Get.parseArchivedPost(this.response, boardID, postID, root, context);
        }, {
          responseType: 'json',
          withCredentials: url.archive.withCredentials
        });
        return true;
      } else if (Conf['Exempt Archives from Encryption']) {
        CrossOrigin.json(url, function(response) {
          var key, media, _ref;
          media = response.media;
          if (media) {
            for (key in media) {
              if (/_link$/.test(key)) {
                if (!((media[key] != null) && (_ref = media[key].match(/^(http:\/\/[^\/]+\/)?/)[0], __indexOf.call(url.archive.imagehosts, _ref) >= 0))) {
                  delete media[key];
                }
              }
            }
          }
          return Get.parseArchivedPost(response, boardID, postID, root, context);
        });
        return true;
      }
      return false;
    },
    parseArchivedPost: function(data, boardID, postID, root, context) {
      var board, comment, greentext, i, j, o, post, text, text2, thread, threadID, _ref;
      if (post = g.posts["" + boardID + "." + postID]) {
        Get.insert(post, root, context);
        return;
      }
      if (data.error) {
        $.addClass(root, 'warning');
        root.textContent = data.error;
        return;
      }
      comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned)\])/);
      comment = (function() {
        var _i, _len, _results;
        _results = [];
        for (i = _i = 0, _len = comment.length; _i < _len; i = ++_i) {
          text = comment[i];
          if (i % 2 === 1) {
            _results.push(Get.archiveTags[text]);
          } else {
            greentext = text[0] === '>';
            text = text.replace(/(\[\/?[a-z]+):lit(\])/, '$1$2');
            text = (function() {
              var _j, _len1, _ref, _results1;
              _ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
              _results1 = [];
              for (j = _j = 0, _len1 = _ref.length; _j < _len1; j = ++_j) {
                text2 = _ref[j];
                if (j % 2 === 1) {
                  _results1.push({
                    innerHTML: "<span class=\"deadlink\">" + E(text2) + "</span>"
                  });
                } else {
                  _results1.push({
                    innerHTML: E(text2)
                  });
                }
              }
              return _results1;
            })();
            text = {
              innerHTML: text.map(function(x) {
                return x.innerHTML;
              }).join('')
            };
            if (greentext) {
              text = {
                innerHTML: "<span class=\"quote\">" + text.innerHTML + "</span>"
              };
            }
            _results.push(text);
          }
        }
        return _results;
      })();
      comment = {
        innerHTML: comment.map(function(x) {
          return x.innerHTML;
        }).join('')
      };
      threadID = +data.thread_num;
      o = {
        postID: postID,
        threadID: threadID,
        boardID: boardID,
        name: data.name,
        capcode: (function() {
          switch (data.capcode) {
            case 'M':
              return 'mod';
            case 'A':
              return 'admin';
            case 'D':
              return 'developer';
          }
        })(),
        tripcode: data.trip,
        uniqueID: data.poster_hash,
        email: data.email || '',
        subject: data.title,
        flagCode: data.poster_country,
        flagName: data.poster_country_name,
        date: data.fourchan_date,
        dateUTC: data.timestamp,
        comment: comment
      };
      if ((_ref = data.media) != null ? _ref.media_filename : void 0) {
        o.file = {
          name: data.media.media_filename,
          timestamp: data.media.media_orig,
          url: data.media.media_link || data.media.remote_media_link || ("//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.media[boardID === 'f' ? 'media_filename' : 'media_orig']))),
          height: data.media.media_h,
          width: data.media.media_w,
          MD5: data.media.media_hash,
          size: data.media.media_size,
          turl: data.media.thumb_link || ("//i.4cdn.org/" + boardID + "/" + data.media.preview_orig),
          theight: data.media.preview_h,
          twidth: data.media.preview_w,
          isSpoiler: data.media.spoiler === '1'
        };
        if (boardID === 'f') {
          o.file.tag = JSON.parse(data.media.exif).Tag;
        }
      }
      board = g.boards[boardID] || new Board(boardID);
      thread = g.threads["" + boardID + "." + threadID] || new Thread(threadID, board);
      post = new Post(Build.post(o), thread, board, {
        isArchived: true
      });
      if (post.file) {
        post.file.thumbURL = o.file.turl;
      }
      post.isFetchedQuote = true;
      Post.callbacks.execute([post]);
      return Get.insert(post, root, context);
    },
    archiveTags: {
      '\n': {
        innerHTML: "<br>"
      },
      '[b]': {
        innerHTML: "<b>"
      },
      '[/b]': {
        innerHTML: "</b>"
      },
      '[spoiler]': {
        innerHTML: "<s>"
      },
      '[/spoiler]': {
        innerHTML: "</s>"
      },
      '[code]': {
        innerHTML: "<pre class=\"prettyprint\">"
      },
      '[/code]': {
        innerHTML: "</pre>"
      },
      '[moot]': {
        innerHTML: "<div style=\"padding:5px;margin-left:.5em;border-color:#faa;border:2px dashed rgba(255,0,0,.1);border-radius:2px\">"
      },
      '[/moot]': {
        innerHTML: "</div>"
      },
      '[banned]': {
        innerHTML: "<strong style=\"color: red;\">"
      },
      '[/banned]': {
        innerHTML: "</strong>"
      }
    }
  };

  UI = (function() {
    var Menu, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove;
    dialog = function(id, position, properties) {
      var child, el, move, _i, _len, _ref;
      el = $.el('div', {
        className: 'dialog',
        id: id
      });
      $.extend(el, properties);
      el.style.cssText = position;
      $.get("" + id + ".position", position, function(item) {
        return el.style.cssText = item["" + id + ".position"];
      });
      move = $('.move', el);
      $.on(move, 'touchstart mousedown', dragstart);
      _ref = move.children;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        child = _ref[_i];
        if (!child.tagName) {
          continue;
        }
        $.on(child, 'touchstart mousedown', function(e) {
          return e.stopPropagation();
        });
      }
      return el;
    };
    Menu = (function() {
      var currentMenu, lastToggledButton;

      currentMenu = null;

      lastToggledButton = null;

      function Menu(type) {
        this.type = type;
        this.rmEntry = __bind(this.rmEntry, this);
        this.addEntry = __bind(this.addEntry, this);
        this.onFocus = __bind(this.onFocus, this);
        this.keybinds = __bind(this.keybinds, this);
        this.close = __bind(this.close, this);
        this.entries = [];
      }

      Menu.prototype.makeMenu = function() {
        var menu;
        menu = $.el('div', {
          className: 'dialog',
          id: 'menu',
          tabIndex: 0
        });
        $.on(menu, 'click', function(e) {
          return e.stopPropagation();
        });
        $.on(menu, 'keydown', this.keybinds);
        return menu;
      };

      Menu.prototype.toggle = function(e, button, data) {
        var previousButton;
        e.preventDefault();
        e.stopPropagation();
        if (currentMenu) {
          previousButton = lastToggledButton;
          this.close();
          if (previousButton === button) {
            return;
          }
        }
        if (!this.entries.length) {
          return;
        }
        return this.open(button, data);
      };

      Menu.prototype.open = function(button, data) {
        var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2;
        menu = this.makeMenu();
        currentMenu = menu;
        lastToggledButton = button;
        this.entries.sort(function(first, second) {
          return first.order - second.order;
        });
        _ref = this.entries;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          entry = _ref[_i];
          this.insertEntry(entry, menu, data);
        }
        $.addClass(lastToggledButton, 'active');
        $.one(d, 'click scroll CloseMenu', this.close);
        Rice.nodes(menu);
        $.add(Header.hover, menu);
        mRect = menu.getBoundingClientRect();
        bRect = button.getBoundingClientRect();
        bTop = window.scrollY + bRect.top;
        bLeft = window.scrollX + bRect.left;
        cHeight = doc.clientHeight;
        cWidth = doc.clientWidth;
        _ref1 = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom, null] : [null, cHeight - bRect.top], top = _ref1[0], bottom = _ref1[1];
        _ref2 = bRect.left + mRect.width < cWidth ? [bRect.left, null] : [null, cWidth - bRect.right], left = _ref2[0], right = _ref2[1];
        style = menu.style;
        style.top = "" + top + "px";
        style.right = "" + right + "px";
        style.bottom = "" + bottom + "px";
        style.left = "" + left + "px";
        if (right) {
          $.addClass(menu, 'left');
        }
        entry = $('.entry', menu);
        this.focus(entry);
        return menu.focus();
      };

      Menu.prototype.insertEntry = function(entry, parent, data) {
        var subEntry, submenu, _i, _len, _ref;
        if (typeof entry.open === 'function') {
          if (!entry.open(data)) {
            return;
          }
        }
        $.add(parent, entry.el);
        if (!entry.subEntries) {
          return;
        }
        if (submenu = $('.submenu', entry.el)) {
          $.rm(submenu);
        }
        submenu = $.el('div', {
          className: 'dialog submenu'
        });
        _ref = entry.subEntries;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          subEntry = _ref[_i];
          this.insertEntry(subEntry, submenu, data);
        }
        $.add(entry.el, submenu);
      };

      Menu.prototype.close = function() {
        $.rm(currentMenu);
        $.rmClass(lastToggledButton, 'active');
        currentMenu = null;
        return lastToggledButton = null;
      };

      Menu.prototype.findNextEntry = function(entry, direction) {
        var entries;
        entries = __slice.call(entry.parentNode.children);
        entries.sort(function(first, second) {
          return first.style.order - second.style.order;
        });
        return entries[entries.indexOf(entry) + direction];
      };

      Menu.prototype.keybinds = function(e) {
        var entry, next, nextPrev, subEntry, submenu;
        entry = $('.focused', currentMenu);
        while (subEntry = $('.focused', entry)) {
          entry = subEntry;
        }
        switch (e.keyCode) {
          case 27:
            lastToggledButton.focus();
            this.close();
            break;
          case 13:
          case 32:
            entry.click();
            break;
          case 38:
            if (next = this.findNextEntry(entry, -1)) {
              this.focus(next);
            }
            break;
          case 40:
            if (next = this.findNextEntry(entry, +1)) {
              this.focus(next);
            }
            break;
          case 39:
            if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) {
              while (nextPrev = this.findNextEntry(next, -1)) {
                next = nextPrev;
              }
              this.focus(next);
            }
            break;
          case 37:
            if (next = $.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) {
              this.focus(next);
            }
            break;
          default:
            return;
        }
        e.preventDefault();
        return e.stopPropagation();
      };

      Menu.prototype.onFocus = function(e) {
        e.stopPropagation();
        return this.focus(e.target);
      };

      Menu.prototype.focus = function(entry) {
        var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2;
        while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
          $.rmClass(focused, 'focused');
        }
        _ref = $$('.focused', entry);
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          focused = _ref[_i];
          $.rmClass(focused, 'focused');
        }
        $.addClass(entry, 'focused');
        if (!(submenu = $('.submenu', entry))) {
          return;
        }
        sRect = submenu.getBoundingClientRect();
        eRect = entry.getBoundingClientRect();
        cHeight = doc.clientHeight;
        cWidth = doc.clientWidth;
        _ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = _ref1[0], bottom = _ref1[1];
        _ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = _ref2[0], right = _ref2[1];
        style = submenu.style;
        style.top = top;
        style.bottom = bottom;
        style.left = left;
        return style.right = right;
      };

      Menu.prototype.addEntry = function(entry) {
        this.parseEntry(entry);
        return this.entries.push(entry);
      };

      Menu.prototype.rmEntry = function(entry) {
        var index;
        if (!((index = this.entries.indexOf(entry)) > -1)) {
          return;
        }
        return this.entries.splice(index, 1);
      };

      Menu.prototype.parseEntry = function(entry) {
        var el, subEntries, subEntry, _i, _len;
        el = entry.el, subEntries = entry.subEntries;
        $.addClass(el, 'entry');
        $.on(el, 'focus mouseover', this.onFocus);
        el.style.order = entry.order || 100;
        if (!subEntries) {
          return;
        }
        $.addClass(el, 'has-submenu');
        $.addClass(el, 'pfa');
        for (_i = 0, _len = subEntries.length; _i < _len; _i++) {
          subEntry = subEntries[_i];
          this.parseEntry(subEntry);
        }
      };

      return Menu;

    })();
    dragstart = function(e) {
      var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
      if (e.type === 'mousedown' && e.button !== 0) {
        return;
      }
      e.preventDefault();
      if (isTouching = e.type === 'touchstart') {
        e = e.changedTouches[e.changedTouches.length - 1];
      }
      el = $.x('ancestor::div[contains(@class,"dialog")][1]', this);
      rect = el.getBoundingClientRect();
      screenHeight = doc.clientHeight;
      screenWidth = doc.clientWidth;
      o = {
        id: el.id,
        style: el.style,
        dx: e.clientX - rect.left,
        dy: e.clientY - rect.top,
        height: screenHeight - rect.height,
        width: screenWidth - rect.width,
        screenHeight: screenHeight,
        screenWidth: screenWidth,
        isTouching: isTouching
      };
      _ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [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);
        o.up = touchend.bind(o);
        $.on(d, 'touchmove', o.move);
        return $.on(d, 'touchend touchcancel', o.up);
      } else {
        o.move = drag.bind(o);
        o.up = dragend.bind(o);
        $.on(d, 'mousemove', o.move);
        return $.on(d, 'mouseup', o.up);
      }
    };
    touchmove = function(e) {
      var touch, _i, _len, _ref;
      _ref = e.changedTouches;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        touch = _ref[_i];
        if (touch.identifier === this.identifier) {
          drag.call(this, touch);
          return;
        }
      }
    };
    drag = function(e) {
      var bottom, clientX, clientY, left, right, style, top;
      clientX = e.clientX, clientY = e.clientY;
      left = clientX - this.dx;
      left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%';
      top = clientY - this.dy;
      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 ? this.bottomBorder + 'px' : null;
      style = this.style;
      style.left = left;
      style.right = right;
      style.top = top;
      return style.bottom = bottom;
    };
    touchend = function(e) {
      var touch, _i, _len, _ref;
      _ref = e.changedTouches;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        touch = _ref[_i];
        if (touch.identifier === this.identifier) {
          dragend.call(this);
          return;
        }
      }
    };
    dragend = function() {
      if (this.isTouching) {
        $.off(d, 'touchmove', this.move);
        $.off(d, 'touchend touchcancel', this.up);
      } else {
        $.off(d, 'mousemove', this.move);
        $.off(d, 'mouseup', this.up);
      }
      return $.set("" + this.id + ".position", this.style.cssText);
    };
    hoverstart = function(_arg) {
      var asapTest, cb, el, endEvents, height, latestEvent, noRemove, o, offsetX, offsetY, root, _ref;
      root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, height = _arg.height, cb = _arg.cb, noRemove = _arg.noRemove, offsetX = _arg.offsetX, offsetY = _arg.offsetY;
      o = {
        root: root,
        el: el,
        style: el.style,
        isImage: (_ref = el.nodeName) === 'IMG' || _ref === 'VIDEO',
        cb: cb,
        endEvents: endEvents,
        latestEvent: latestEvent,
        clientHeight: doc.clientHeight,
        clientWidth: doc.clientWidth,
        noRemove: noRemove,
        offsetX: offsetX || 45,
        offsetY: offsetY || -120
      };
      o.hover = hover.bind(o);
      o.hoverend = hoverend.bind(o);
      $.asap(function() {
        return !el.parentNode || asapTest();
      }, function() {
        if (el.parentNode) {
          return o.hover(o.latestEvent);
        }
      });
      $.on(root, endEvents, o.hoverend);
      if ($.x('ancestor::div[contains(@class,"inline")][1]', root)) {
        $.on(d, 'keydown', o.hoverend);
      }
      $.on(root, 'mousemove', o.hover);
      o.workaround = function(e) {
        if (!root.contains(e.target)) {
          return o.hoverend(e);
        }
      };
      return $.on(doc, 'mousemove', o.workaround);
    };
    hover = function(e) {
      var clientX, clientY, height, left, right, style, threshold, top, _ref;
      this.latestEvent = e;
      height = this.height || this.el.offsetHeight;
      clientX = e.clientX, clientY = e.clientY;
      top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY + this.offsetY));
      threshold = this.clientWidth / 2;
      if (!this.isImage) {
        threshold = Math.max(threshold, this.clientWidth - 400);
      }
      _ref = clientX <= threshold ? [clientX + this.offsetX + 'px', null] : [null, this.clientWidth - clientX + this.offsetX + 'px'], left = _ref[0], right = _ref[1];
      style = this.style;
      style.top = top + 'px';
      style.left = left;
      return style.right = right;
    };
    hoverend = function(e) {
      if (e.type === 'keydown' && e.keyCode !== 13 || e.target.nodeName === "TEXTAREA") {
        return;
      }
      if (!this.noRemove) {
        $.rm(this.el);
      }
      $.off(this.root, this.endEvents, this.hoverend);
      $.off(d, 'keydown', this.hoverend);
      $.off(this.root, 'mousemove', this.hover);
      $.off(doc, 'mousemove', this.workaround);
      if (this.cb) {
        return this.cb.call(this);
      }
    };
    checkbox = function(name, text, checked) {
      var input, label;
      if (checked == null) {
        checked = Conf[name];
      }
      label = $.el('label');
      input = $.el('input', {
        type: 'checkbox',
        name: name,
        checked: checked
      });
      $.add(label, [input, $.tn(" " + text)]);
      return label;
    };
    return {
      dialog: dialog,
      Menu: Menu,
      hover: hoverstart,
      checkbox: checkbox
    };
  })();

  CrossOrigin = (function() {
    return {
      file: (function() {
        var makeBlob;
        makeBlob = function(urlBlob, contentType, contentDisposition, url) {
          var blob, match, mime, name, _ref, _ref1, _ref2;
          name = (_ref = url.match(/([^\/]+)\/*$/)) != null ? _ref[1] : void 0;
          mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream';
          match = (contentDisposition != null ? (_ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? _ref1[1] : void 0 : void 0) || (contentType != null ? (_ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? _ref2[1] : void 0 : void 0);
          if (match) {
            name = match.replace(/\\"/g, '"');
          }
          blob = new Blob([urlBlob], {
            type: mime
          });
          blob.name = name;
          return blob;
        };
        return function(url, cb) {
          return GM_xmlhttpRequest({
            method: "GET",
            url: url,
            overrideMimeType: "text/plain; charset=x-user-defined",
            onload: function(xhr) {
              var contentDisposition, contentType, data, i, r, _ref, _ref1;
              r = xhr.responseText;
              data = new Uint8Array(r.length);
              i = 0;
              while (i < r.length) {
                data[i] = r.charCodeAt(i);
                i++;
              }
              contentType = (_ref = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? _ref[1] : void 0;
              contentDisposition = (_ref1 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? _ref1[1] : void 0;
              return cb(makeBlob(data, contentType, contentDisposition, url));
            },
            onerror: function() {
              return cb(null);
            }
          });
        };
      })(),
      json: (function() {
        var callbacks, responses;
        callbacks = {};
        responses = {};
        return function(url, cb) {
          if (responses[url]) {
            cb(responses[url]);
            return;
          }
          if (callbacks[url]) {
            callbacks[url].push(cb);
            return;
          }
          callbacks[url] = [cb];
          return GM_xmlhttpRequest({
            method: "GET",
            url: url + '',
            onload: function(xhr) {
              var response, _i, _len, _ref;
              response = JSON.parse(xhr.responseText);
              _ref = callbacks[url];
              for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                cb = _ref[_i];
                cb(response);
              }
              delete callbacks[url];
              return responses[url] = response;
            },
            onerror: function() {
              return delete callbacks[url];
            },
            onabort: function() {
              return delete callbacks[url];
            }
          });
        };
      })()
    };
  })();

  Anonymize = {
    init: function() {
      var _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread' || _ref === 'archive') && Conf['Anonymize'])) {
        return;
      }
      if (g.VIEW === 'archive') {
        return this.archive();
      }
      return Post.callbacks.push({
        name: 'Anonymize',
        cb: this.node
      });
    },
    node: function() {
      var email, name, tripcode, _ref;
      if (this.info.capcode || this.isClone) {
        return;
      }
      _ref = this.nodes, name = _ref.name, tripcode = _ref.tripcode, email = _ref.email;
      if (this.info.name !== 'Anonymous') {
        name.textContent = 'Anonymous';
      }
      if (tripcode) {
        $.rm(tripcode);
        delete this.nodes.tripcode;
      }
      if (this.info.email) {
        $.replace(email, name);
        return delete this.nodes.email;
      }
    },
    archive: function() {
      return $.ready(function() {
        var name, trip, _i, _j, _len, _len1, _ref, _ref1;
        _ref = $$('.name');
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          name = _ref[_i];
          name.textContent = 'Anonymous';
        }
        _ref1 = $$('.postertrip');
        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
          trip = _ref1[_j];
          $.rm(trip);
        }
      });
    }
  };

  Filter = {
    filters: {},
    init: function() {
      var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Filter'])) {
        return;
      }
      if (!Conf['Filtered Backlinks']) {
        $.addClass(doc, 'hide-backlinks');
      }
      for (key in Config.filter) {
        this.filters[key] = [];
        _ref1 = Conf[key].split('\n');
        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
          line = _ref1[_i];
          if (line[0] === '#') {
            continue;
          }
          if (!(regexp = line.match(/\/(.+)\/(\w*)/))) {
            continue;
          }
          filter = line.replace(regexp[0], '');
          boards = ((_ref2 = filter.match(/boards:([^;]+)/)) != null ? _ref2[1].toLowerCase() : void 0) || 'global';
          if (boards !== 'global' && (_ref3 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref3) < 0)) {
            continue;
          }
          if (key === 'uniqueID' || key === 'MD5') {
            regexp = regexp[1];
          } else {
            try {
              regexp = RegExp(regexp[1], regexp[2]);
            } catch (_error) {
              err = _error;
              new Notice('warning', [$.tn(("Invalid " + key + " filter: ") + line, $.el('br')), $.tn(err.message)], 60);
              continue;
            }
          }
          op = ((_ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref4[1] : void 0) || 'yes';
          stub = (function() {
            var _ref5;
            switch ((_ref5 = filter.match(/stub:(yes|no)/)) != null ? _ref5[1] : void 0) {
              case 'yes':
                return true;
              case 'no':
                return false;
              default:
                return Conf['Stubs'];
            }
          })();
          if (hl = /highlight/.test(filter)) {
            hl = ((_ref5 = filter.match(/highlight:(\w+)/)) != null ? _ref5[1] : void 0) || 'filter-highlight';
            top = ((_ref6 = filter.match(/top:(yes|no)/)) != null ? _ref6[1] : void 0) || 'yes';
            top = top === 'yes';
          }
          this.filters[key].push(this.createFilter(regexp, op, stub, hl, top));
        }
        if (!this.filters[key].length) {
          delete this.filters[key];
        }
      }
      if (!Object.keys(this.filters).length) {
        return;
      }
      return Post.callbacks.push({
        name: 'Filter',
        cb: this.node
      });
    },
    createFilter: function(regexp, op, stub, hl, top) {
      var settings, test;
      test = typeof regexp === 'string' ? function(value) {
        return regexp === value;
      } : function(value) {
        return regexp.test(value);
      };
      settings = {
        hide: !hl,
        stub: stub,
        "class": hl,
        top: top
      };
      return function(value, isReply) {
        if (isReply && op === 'only' || !isReply && op === 'no') {
          return false;
        }
        if (!test(value)) {
          return false;
        }
        return settings;
      };
    },
    node: function() {
      var filter, key, result, value, _i, _len, _ref;
      if (this.isClone || this.isFetchedQuote) {
        return;
      }
      for (key in Filter.filters) {
        if (value = Filter[key](this)) {
          _ref = Filter.filters[key];
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            filter = _ref[_i];
            if (!(result = filter(value, this.isReply))) {
              continue;
            }
            if (result.hide) {
              if (!(this.isReply || g.VIEW === 'index')) {
                continue;
              }
              this.hide("Hidden by filtering the " + key + ": " + result.match, result.stub);
              return;
            }
            this.highlight("Highlighted by filtering the " + key + ": " + result.match, result["class"], result.top);
          }
        }
      }
    },
    name: function(post) {
      if ('name' in post.info) {
        return post.info.name;
      }
      return false;
    },
    uniqueID: function(post) {
      if ('uniqueID' in post.info) {
        return post.info.uniqueID;
      }
      return false;
    },
    tripcode: function(post) {
      if ('tripcode' in post.info) {
        return post.info.tripcode;
      }
      return false;
    },
    capcode: function(post) {
      if ('capcode' in post.info) {
        return post.info.capcode;
      }
      return false;
    },
    subject: function(post) {
      if ('subject' in post.info) {
        return post.info.subject || false;
      }
      return false;
    },
    comment: function(post) {
      if ('comment' in post.info) {
        return post.info.comment;
      }
      return false;
    },
    flag: function(post) {
      if ('flag' in post.info) {
        return post.info.flag;
      }
      return false;
    },
    filename: function(post) {
      if (post.file) {
        return post.file.name;
      }
      return false;
    },
    dimensions: function(post) {
      var file;
      file = post.file;
      if (file && (file.isImage || file.isVideo)) {
        return file.dimensions;
      }
      return false;
    },
    filesize: function(post) {
      if (post.file) {
        return post.file.size;
      }
      return false;
    },
    MD5: function(post) {
      if (post.file) {
        return post.file.MD5;
      }
      return false;
    },
    menu: {
      init: function() {
        var div, entry, type, _i, _len, _ref, _ref1;
        if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
          return;
        }
        div = $.el('div', {
          textContent: 'Filter'
        });
        entry = {
          el: div,
          order: 50,
          open: function(post) {
            Filter.menu.post = post;
            return true;
          },
          subEntries: []
        };
        _ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
          type = _ref1[_i];
          entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1]));
        }
        return Menu.menu.addEntry(entry);
      },
      createSubEntry: function(text, type) {
        var el;
        el = $.el('a', {
          href: 'javascript:;',
          textContent: text
        });
        el.dataset.type = type;
        $.on(el, 'click', Filter.menu.makeFilter);
        return {
          el: el,
          open: function(post) {
            var value;
            value = Filter[type](post);
            return value !== false;
          }
        };
      },
      makeFilter: function() {
        var re, type, value;
        type = this.dataset.type;
        value = Filter[type](Filter.menu.post);
        re = type === 'uniqueID' || type === 'MD5' ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
          if (c === '\n') {
            return '\\n';
          } else if (c === '\\') {
            return '\\\\';
          } else {
            return "\\" + c;
          }
        });
        re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
        return $.get(type, Conf[type], function(item) {
          var save, section, select, ta, tl;
          save = item[type];
          save = save ? "" + save + "\n" + re : re;
          $.set(type, save);
          Settings.open('Filter');
          section = $('.section-container');
          select = $('select[name=filter]', section);
          select.value = type;
          Settings.selectFilter.call(select);
          ta = $('textarea', section);
          tl = ta.textLength;
          ta.setSelectionRange(tl, tl);
          return ta.focus();
        });
      }
    }
  };

  PostHiding = {
    init: function() {
      this.db = new DataBoard('hiddenPosts');
      this.hideButton = $.el('a', {
        className: 'hide-post-button fa',
        href: 'javascript:;',
        textContent: '\uf147'
      });
      this.showButton = $.el('a', {
        className: 'show-post-button fa',
        href: 'javascript:;',
        textContent: '\uf196'
      });
      return Post.callbacks.push({
        name: 'Post Hiding',
        cb: this.node
      });
    },
    node: function() {
      var a, data, label;
      if (this.isClone || this.isFetchedQuote) {
        return;
      }
      if (g.VIEW === 'thread' && !this.isReply) {
        return;
      }
      if (data = PostHiding.db.get({
        boardID: this.board.ID,
        threadID: this.thread.ID,
        postID: this.ID
      })) {
        if (data.thisPost) {
          this.hide('Manually hidden', data.makeStub, data.hideRecursively);
        } else {
          label = "Recursively hidden for quoting No." + this;
          Recursive.apply('hide', this, label, data.makeStub, true);
          Recursive.add('hide', this, label, data.makeStub, true);
        }
      }
      if (!Conf['Post Hiding']) {
        return;
      }
      if (this.isReply) {
        a = PostHiding.makeButton(true);
        if (this.isHidden) {
          a.hidden = true;
        }
        return $.add($('.postInfo', this.nodes.post), a);
      } else {
        return $.add($('.postInfo', this.nodes.post), PostHiding.makeButton(!this.isHidden));
      }
    },
    makeButton: function(hide) {
      var a;
      a = (hide ? PostHiding.hideButton : PostHiding.showButton).cloneNode(true);
      $.on(a, 'click', PostHiding.onToggleClick);
      return a;
    },
    onToggleClick: function() {
      return PostHiding.toggle($.x('ancestor::div[contains(@class,"postContainer")][1]', this) ? Get.postFromNode(this) : Get.threadFromNode(this).OP);
    },
    toggle: function(post) {
      var root;
      if (post.isHidden) {
        post.show();
      } else {
        post.hide('Manually hidden');
      }
      if (post.isReply) {
        return;
      }
      Index.updateHideLabel();
      if (Conf['Index Mode'] === 'all pages' || !Conf['JSON Navigation']) {
        root = post.nodes.root.parentNode;
        $.rm(root.nextElementSibling);
        $.rm(root);
        return;
      }
      Index.sort();
      return Index.buildIndex();
    },
    saveHiddenState: function(post, val) {
      var data;
      data = {
        boardID: post.board.ID,
        threadID: post.thread.ID,
        postID: post.ID
      };
      if (post.isHidden || val && !val.thisPost) {
        data.val = val || {};
        return PostHiding.db.set(data);
      } else if (PostHiding.db.get(data)) {
        return PostHiding.db["delete"](data);
      }
    },
    menu: {
      init: function() {
        var apply, makeStub, replies, thisPost, _ref;
        if (!(Conf['Menu'] && Conf['Post Hiding Link'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) {
          return;
        }
        apply = {
          el: $.el('a', {
            textContent: 'Apply',
            href: 'javascript:;'
          }),
          open: function(post) {
            if (this.cb) {
              $.off(this.el, 'click', this.cb);
            }
            this.cb = function() {
              return PostHiding.menu.hide(post);
            };
            $.on(this.el, 'click', this.cb);
            return true;
          }
        };
        thisPost = {
          el: UI.checkbox('thisPost', 'This post', true)
        };
        replies = {
          el: UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding'])
        };
        makeStub = {
          el: UI.checkbox('makeStub', 'Make stub', Conf['Stubs'])
        };
        Menu.menu.addEntry({
          el: $.el('div', {
            textContent: 'Hide post',
            className: 'hide-post-link'
          }),
          order: 20,
          open: function(post) {
            return !(post.isHidden || !post.isReply || post.isClone);
          },
          subEntries: [apply, thisPost, replies, makeStub]
        });
        apply = {
          el: $.el('a', {
            textContent: 'Apply',
            href: 'javascript:;'
          }),
          open: function(post) {
            if (this.cb) {
              $.off(this.el, 'click', this.cb);
            }
            this.cb = function() {
              return PostHiding.menu.show(post);
            };
            $.on(this.el, 'click', this.cb);
            return true;
          }
        };
        thisPost = {
          el: UI.checkbox('thisPost', 'This post', false),
          open: function(post) {
            this.el.firstChild.checked = post.isHidden;
            return true;
          }
        };
        replies = {
          el: UI.checkbox('replies', 'Show replies', false),
          open: function(post) {
            var data;
            data = PostHiding.db.get({
              boardID: post.board.ID,
              threadID: post.thread.ID,
              postID: post.ID
            });
            this.el.firstChild.checked = 'hideRecursively' in data ? data.hideRecursively : Conf['Recursive Hiding'];
            return true;
          }
        };
        Menu.menu.addEntry({
          el: $.el('div', {
            textContent: 'Unhide post',
            className: 'show-post-link'
          }),
          order: 20,
          open: function(post) {
            if (!post.isHidden || !post.isReply || post.isClone) {
              return false;
            }
            if (!PostHiding.db.get({
              boardID: post.board.ID,
              threadID: post.thread.ID,
              postID: post.ID
            })) {
              return false;
            }
            return true;
          },
          subEntries: [apply, thisPost, replies]
        });
        return Menu.menu.addEntry({
          el: $.el('a', {
            href: 'javascript:;'
          }),
          order: 20,
          open: function(post) {
            if (g.VIEW !== 'index' || post.isReply) {
              return false;
            }
            this.el.textContent = post.isHidden ? 'Unhide thread' : 'Hide thread';
            if (this.cb) {
              $.off(this.el, 'click', this.cb);
            }
            this.cb = function() {
              $.event('CloseMenu');
              return PostHiding.toggle(post);
            };
            $.on(this.el, 'click', this.cb);
            return true;
          }
        });
      },
      hide: function(post) {
        var label, makeStub, parent, replies, thisPost;
        parent = this.parentNode;
        thisPost = $('input[name=thisPost]', parent).checked;
        replies = $('input[name=replies]', parent).checked;
        makeStub = $('input[name=makeStub]', parent).checked;
        label = 'Manually hidden';
        if (thisPost) {
          post.hide(label, makeStub, replies);
        } else if (replies) {
          Recursive.apply('hide', post, label, makeStub, true);
          Recursive.add('hide', post, label, makeStub, true);
        } else {
          return;
        }
        if (!thisPost) {
          PostHiding.saveHiddenState(post, {
            thisPost: false,
            hideRecursively: replies,
            makeStub: makeStub
          });
        }
        return $.event('CloseMenu');
      },
      show: function(post) {
        var parent, replies, thisPost;
        parent = this.parentNode;
        thisPost = $('input[name=thisPost]', parent).checked;
        replies = $('input[name=replies]', parent).checked;
        if (thisPost) {
          post.show(replies);
        } else if (replies) {
          Recursive.apply('show', post, true);
          Recursive.rm('hide', post, true);
        } else {
          return;
        }
        if (!thisPost) {
          PostHiding.saveHiddenState(post, {
            thisPost: false,
            hideRecursively: !replies,
            makeStub: !!post.nodes.stub
          });
        }
        return $.event('CloseMenu');
      }
    }
  };

  Recursive = {
    recursives: {},
    init: function() {
      var _ref;
      if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
        return;
      }
      return Post.callbacks.push({
        name: 'Recursive',
        cb: this.node
      });
    },
    node: function() {
      var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
      if (this.isClone || this.isFetchedQuote) {
        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];
            this[recursive].apply(this, 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)) {
          continue;
        }
        obj.recursives.splice(i, 1);
        obj.args.splice(i, 1);
      }
    },
    apply: function() {
      var args, fullID, post, recursive;
      recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
      fullID = post.fullID;
      return g.posts.forEach(function(post) {
        if (__indexOf.call(post.quotes, fullID) >= 0) {
          return post[recursive].apply(post, args);
        }
      });
    }
  };

  QuoteBacklink = {
    init: function() {
      if (!Conf['Quote Backlinks']) {
        return;
      }
      this.frag = $.nodes([
        $.tn(' '), $.el('a', {
          className: 'backlink'
        })
      ]);
      this.map = {};
      Post.callbacks.push({
        name: 'Quote Backlinking Part 1',
        cb: this.firstNode
      });
      return Post.callbacks.push({
        name: 'Quote Backlinking Part 2',
        cb: this.secondNode
      });
    },
    firstNode: function() {
      var addNodes, container, post, quoteID, _base, _i, _j, _len, _len1, _ref, _ref1;
      if (this.isClone) {
        return;
      }
      addNodes = function(post, that) {
        return $.add(post.nodes.backlinkContainer, QuoteBacklink.buildBacklink(post, that));
      };
      _ref = this.quotes;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        quoteID = _ref[_i];
        ((_base = QuoteBacklink.map)[quoteID] || (_base[quoteID] = [])).push(this.fullID);
        if (!(((post = g.posts[quoteID]) != null) && (container = post.nodes.backlinkContainer))) {
          continue;
        }
        addNodes(post, this);
        _ref1 = post.clones;
        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
          post = _ref1[_j];
          addNodes(post, this);
        }
      }
    },
    secondNode: function() {
      var backlink, container, map, post, quoteID, _i, _j, _len, _len1, _ref;
      if (!(this.isReply || Conf['OP Backlinks'])) {
        return;
      }
      if (this.isClone) {
        this.nodes.backlinkContainer = $('.backlink-container', this.nodes.info);
        _ref = this.nodes.backlinks;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          backlink = _ref[_i];
          QuoteMarkers.parseQuotelink(this, backlink, true, Conf['backlink'].replace(/%id/g, Get.postDataFromLink(backlink).postID));
        }
        return;
      }
      this.nodes.backlinkContainer = container = $.el('span', {
        className: 'backlink-container'
      });
      if (map = QuoteBacklink.map[this.fullID]) {
        for (_j = 0, _len1 = map.length; _j < _len1; _j++) {
          quoteID = map[_j];
          if (post = g.posts[quoteID]) {
            $.add(container, QuoteBacklink.buildBacklink(this, post));
          }
        }
      }
      return $.add(this.nodes.info, container);
    },
    buildBacklink: function(quoted, quoter) {
      var a, frag, hash, text;
      $.addClass(quoted.nodes.post, 'quoted');
      frag = QuoteBacklink.frag.cloneNode(true);
      a = frag.querySelector("a:last-of-type");
      a.href = Build.path(quoter.board.ID, quoter.thread.ID, quoter.ID);
      a.textContent = text = Conf['backlink'].replace(/%id/g, quoter.ID);
      if (quoter.isDead) {
        $.addClass(a, 'deadlink');
      }
      if (quoter.isHidden) {
        $.addClass(a, 'filtered');
      }
      QuoteMarkers.parseQuotelink(quoted, a, false, text);
      if (Conf['Quote Previewing']) {
        $.on(a, 'mouseover', QuotePreview.mouseover);
      }
      if (Conf['Quote Inlining']) {
        $.on(a, 'click', QuoteInline.toggle);
        if (Conf['Quote Hash Navigation']) {
          hash = QuoteInline.qiQuote(a, quoter.isHidden);
        }
      }
      if (Conf['JSON Navigation']) {
        if (hash) {
          Navigate.singleQuoteLink(hash);
        } else if (!Conf['Quote Inlining']) {
          Navigate.singleQuoteLink(a);
        }
      }
      return frag;
    }
  };

  QuoteInline = {
    init: function() {
      if (!Conf['Quote Inlining']) {
        return;
      }
      this.process = Conf['Quote Hash Navigation'] ? function(link, clone) {
        $.on(link, 'click', QuoteInline.toggle);
        if (clone) {
          return;
        }
        return QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
      } : function(link) {
        return $.on(link, 'click', QuoteInline.toggle);
      };
      if (Conf['Comment Expansion']) {
        ExpandComment.callbacks.push(this.node);
      }
      return Post.callbacks.push({
        name: 'Quote Inlining',
        cb: this.node
      });
    },
    node: function() {
      var isClone, link, process, _i, _j, _len, _len1, _ref, _ref1;
      process = QuoteInline.process;
      isClone = this.isClone;
      _ref = this.nodes.quotelinks;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        link = _ref[_i];
        process(link, isClone);
      }
      _ref1 = this.nodes.backlinks;
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        link = _ref1[_j];
        process(link, isClone);
      }
    },
    qiQuote: function(link, hidden) {
      var name;
      name = "hashlink";
      if (hidden) {
        name += " filtered";
      }
      return $.after(link, $.el('a', {
        className: name,
        textContent: '#',
        href: link.href
      }));
    },
    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.contextFromNode(this);
      if ($.hasClass(this, 'inlined')) {
        QuoteInline.rm(this, boardID, threadID, postID, context);
      } else {
        if ($.x("ancestor::div[@id='pc" + 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, qroot, root;
      isBacklink = $.hasClass(quotelink, 'backlink');
      inline = $.el('div', {
        id: "i" + postID,
        className: 'inline'
      });
      root = QuoteInline.findRoot(quotelink, isBacklink);
      $.after(root, inline);
      qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
      $.addClass(qroot, 'hasInline');
      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, qroot, root, _ref;
      isBacklink = $.hasClass(quotelink, 'backlink');
      root = QuoteInline.findRoot(quotelink, isBacklink);
      root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root);
      qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
      $.rm(root);
      if (!$('.inline', qroot)) {
        $.rmClass(qroot, 'hasInline');
      }
      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');
      }
    }
  };

  QuoteMarkers = {
    init: function() {
      if (Conf['Highlight Own Posts']) {
        $.addClass(doc, 'highlight-own');
      }
      if (Conf['Highlight Posts Quoting You']) {
        $.addClass(doc, 'highlight-you');
      }
      return Post.callbacks.push({
        name: 'Quote Markers',
        cb: this.node
      });
    },
    node: function() {
      var parseQuotelink, quotelink, _i, _len, _ref;
      parseQuotelink = QuoteMarkers.parseQuotelink;
      _ref = this.nodes.quotelinks;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        quotelink = _ref[_i];
        parseQuotelink(this, quotelink, !!this.isClone);
      }
    },
    parseQuotelink: function(post, quotelink, mayReset, customText) {
      var board, boardID, markers, postID, text, thread, threadID, _ref, _ref1;
      _ref = post.isClone ? post.context : post, board = _ref.board, thread = _ref.thread;
      markers = [];
      _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, threadID = _ref1.threadID, postID = _ref1.postID;
      if (QR.db.get({
        boardID: boardID,
        threadID: threadID,
        postID: postID
      })) {
        if (Conf['Mark Quotes of You']) {
          markers.push('You');
        }
        $.addClass(post.nodes.root, 'quotesYou');
        if (Conf['Double Beep']) {
          QuoteMarkers.beep = true;
        }
      }
      if (board.ID === boardID) {
        if (Conf['Mark OP Quotes'] && thread.ID === postID) {
          markers.push('OP');
        }
        if (Conf['Mark Cross-thread Quotes'] && (threadID && threadID !== thread.ID)) {
          markers.push('Cross-thread');
        }
      }
      if ($.hasClass(quotelink, 'deadlink')) {
        markers.push('Dead');
      }
      text = customText ? customText : boardID === post.board.ID ? ">>" + postID : ">>>/" + boardID + "/" + postID;
      if (markers.length) {
        return quotelink.textContent = "" + text + "\u00A0(" + (markers.join('|')) + ")";
      } else if (mayReset) {
        return quotelink.textContent = text;
      }
    },
    cb: {
      seek: function(type) {
        var post;
        if (Conf['Mark Quotes of You'] && (post = QuoteMarkers.cb.findPost(type))) {
          return QuoteMarkers.cb.scroll(post);
        }
      },
      findPost: function(type) {
        var i, index, len, post, posts;
        posts = $$('.quotesYou');
        if (!QuoteMarkers.lastRead) {
          if (!(post = QuoteMarkers.lastRead = posts[0])) {
            new Notice('warning', 'No posts are currently quoting you, loser.', 20);
            return;
          }
          if (!Get.postFromRoot(post).isHidden) {
            return post;
          }
        } else {
          post = QuoteMarkers.lastRead;
        }
        len = posts.length - 1;
        index = i = posts.indexOf(post);
        while (true) {
          if (index === (i = type === 'prev' ? i === 0 ? len : i - 1 : i === len ? 0 : i + 1)) {
            break;
          }
          post = posts[i];
          if (!Get.postFromRoot(post).isHidden) {
            return post;
          }
        }
      },
      scroll: function(post) {
        var highlight;
        if (highlight = $('.highlight')) {
          $.rmClass(highlight, 'highlight');
        }
        QuoteMarkers.lastRead = post;
        window.location.hash = "#" + post.id;
        Header.scrollTo(post);
        return $.addClass($('.post', post), 'highlight');
      }
    }
  };

  QuotePreview = {
    init: function() {
      var _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Quote Previewing'])) {
        return;
      }
      if (Conf['Comment Expansion']) {
        ExpandComment.callbacks.push(this.node);
      }
      return Post.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 boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1;
      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'
      });
      $.add(Header.hover, qp);
      Get.postClone(boardID, threadID, postID, qp, Get.contextFromNode(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');
        }
      }
    },
    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');
      }
    }
  };

  QuoteStrikeThrough = {
    init: function() {
      var _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && (Conf['Post Hiding'] || Conf['Post Hiding Link'] || Conf['Filter']))) {
        return;
      }
      return Post.callbacks.push({
        name: 'Strike-through Quotes',
        cb: this.node
      });
    },
    node: function() {
      var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
      if (this.isClone) {
        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');
        }
      }
    }
  };


  /*
    <3 aeosynth
   */

  QuoteThreading = {
    init: function() {
      if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
        return;
      }
      this.enabled = true;
      this.controls = $.el('span', {
        innerHTML: "<label><input id=\"threadingControl\" type=\"checkbox\" checked> Threading</label>"
      });
      this.threadNewLink = $.el('span', {
        className: 'brackets-wrap threadnewlink',
        hidden: true
      });
      $.extend(this.threadNewLink, {
        innerHTML: "<a href=\"javascript:;\">Thread New Posts</a>"
      });
      this.input = $('input', this.controls);
      $.on(this.input, 'change', this.cb.thread);
      $.on(this.threadNewLink.firstElementChild, 'click', this.cb.click);
      $.one(d, '4chanXInitFinished', this.cb.thread);
      Header.menu.addEntry(this.entry = {
        el: this.controls,
        order: 98
      });
      Thread.callbacks.push({
        name: 'Quote Threading',
        cb: this.setThread
      });
      return Post.callbacks.push({
        name: 'Quote Threading',
        cb: this.node
      });
    },
    parent: {},
    children: {},
    inserted: {},
    disconnect: function() {
      if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
        return;
      }
      Header.menu.rmEntry(this.entry);
      this.parent = {};
      this.children = {};
      this.inserted = {};
      $.off(this.input, 'change', this.cb.thread);
      $.off(d, '4chanXInitFinished', this.cb.thread);
      delete this.enabled;
      delete this.controls;
      delete this.entry;
      delete this.input;
      Thread.callbacks.disconnect('Quote Threading');
      return Post.callbacks.disconnect('Quote Threading');
    },
    setThread: function() {
      QuoteThreading.thread = this;
      return $.asap((function() {
        return !Conf['Thread Updater'] || $('.navLinksBot > .updatelink');
      }), function() {
        return $.add($('.navLinksBot'), [$.tn(' '), QuoteThreading.threadNewLink]);
      });
    },
    node: function() {
      var parent, parents, quote, thread;
      if (this.isFetchedQuote || this.isClone || !this.isReply) {
        return;
      }
      thread = QuoteThreading.thread;
      parents = (function() {
        var _i, _len, _ref, _results;
        _ref = this.quotes;
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          quote = _ref[_i];
          if ((parent = g.posts[quote]) && !parent.isFetchedQuote && parent.isReply && parent.ID <= this.ID) {
            _results.push(parent);
          }
        }
        return _results;
      }).call(this);
      if (parents.length === 1) {
        return QuoteThreading.parent[this.fullID] = parents[0];
      }
    },
    descendants: function(post) {
      var child, children, posts, _i, _len;
      posts = [post];
      if (children = QuoteThreading.children[post.fullID]) {
        for (_i = 0, _len = children.length; _i < _len; _i++) {
          child = children[_i];
          posts = posts.concat(QuoteThreading.descendants(child));
        }
      }
      return posts;
    },
    insert: function(post) {
      var child, children, descendants, i, next, nodes, order, parent, prev, prev2, threadContainer, x, _base, _i, _j, _len, _name;
      if (!(QuoteThreading.enabled && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) {
        return false;
      }
      descendants = QuoteThreading.descendants(post);
      if (!Unread.posts.has(parent.ID)) {
        if ((function() {
          var x, _i, _len;
          for (_i = 0, _len = descendants.length; _i < _len; _i++) {
            x = descendants[_i];
            if (Unread.posts.has(x.ID)) {
              return true;
            }
          }
        })()) {
          QuoteThreading.threadNewLink.hidden = false;
          return false;
        }
      }
      order = Unread.order;
      children = ((_base = QuoteThreading.children)[_name = parent.fullID] || (_base[_name] = []));
      threadContainer = parent.nodes.threadContainer || $.el('div', {
        className: 'threadContainer'
      });
      nodes = [post.nodes.root];
      if (post.nodes.threadContainer) {
        nodes.push(post.nodes.threadContainer);
      }
      i = children.length;
      while ((child = children[i]) && child.ID >= post.ID) {
        i--;
      }
      if (i !== children.length) {
        next = children[i];
        for (_i = 0, _len = descendants.length; _i < _len; _i++) {
          x = descendants[_i];
          order.before(order[next.ID], order[x.ID]);
        }
        children.splice(i, 0, post);
        $.before(next.nodes.root, nodes);
      } else {
        prev = parent;
        while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
          prev = prev2[prev2.length - 1];
        }
        for (_j = descendants.length - 1; _j >= 0; _j += -1) {
          x = descendants[_j];
          order.after(order[prev.ID], order[x.ID]);
        }
        children.push(post);
        $.add(threadContainer, nodes);
      }
      QuoteThreading.inserted[post.fullID] = true;
      if (!parent.nodes.threadContainer) {
        parent.nodes.threadContainer = threadContainer;
        $.addClass(parent.nodes.root, 'threadOP');
        $.after(parent.nodes.root, threadContainer);
      }
      return true;
    },
    rethread: function(enabled) {
      var nodes, posts, thread;
      if (enabled == null) {
        enabled = true;
      }
      thread = QuoteThreading.thread;
      posts = thread.posts;
      if (QuoteThreading.enabled = enabled) {
        posts.forEach(QuoteThreading.insert);
      } else {
        nodes = [];
        Unread.order = new RandomAccessList();
        QuoteThreading.inserted = {};
        posts.forEach(function(post) {
          if (post.isFetchedQuote) {
            return;
          }
          Unread.order.push(post);
          if (post.isReply) {
            nodes.push(post.nodes.root);
          }
          if (QuoteThreading.children[post.fullID]) {
            delete QuoteThreading.children[post.fullID];
            $.rmClass(post.nodes.root, 'threadOP');
            $.rm(post.nodes.threadContainer);
            return delete post.nodes.threadContainer;
          }
        });
        $.add(thread.OP.nodes.root.parentNode, nodes);
      }
      Unread.position = Unread.order.first;
      Unread.updatePosition();
      Unread.setLine(true);
      Unread.read();
      return Unread.update();
    },
    cb: {
      thread: function() {
        return QuoteThreading.rethread(QuoteThreading.input.checked);
      },
      click: function() {
        QuoteThreading.threadNewLink.hidden = true;
        return QuoteThreading.cb.thread();
      }
    }
  };

  Quotify = {
    init: function() {
      var _ref;
      if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Resurrect Quotes']) {
        return;
      }
      if (Conf['Comment Expansion']) {
        ExpandComment.callbacks.push(this.node);
      }
      return Post.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, fetchable, m, post, postID, quote, quoteID, redirect, _ref;
      if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
        Quotify.fixDeadlink(deadlink);
        return;
      }
      quote = deadlink.textContent;
      if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) {
        return;
      }
      if (postID[0] === '0') {
        Quotify.fixDeadlink(deadlink);
        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: Build.postURL(boardID, post.thread.ID, postID),
            className: 'quotelink',
            textContent: quote
          });
        } else {
          a = $.el('a', {
            href: Build.postURL(boardID, post.thread.ID, postID),
            className: 'quotelink deadlink',
            target: '_blank',
            textContent: "" + quote + "\u00A0(Dead)"
          });
          $.extend(a.dataset, {
            boardID: boardID,
            threadID: post.thread.ID,
            postID: postID
          });
        }
      } else {
        redirect = Redirect.to('thread', {
          boardID: boardID,
          threadID: 0,
          postID: postID
        });
        fetchable = Redirect.to('post', {
          boardID: boardID,
          postID: postID
        });
        if (redirect || fetchable) {
          a = $.el('a', {
            href: redirect || 'javascript:;',
            className: 'deadlink',
            target: '_blank',
            textContent: "" + quote + "\u00A0(Dead)"
          });
          if (fetchable) {
            $.addClass(a, 'quotelink');
            $.extend(a.dataset, {
              boardID: boardID,
              postID: postID
            });
          }
        }
      }
      if (__indexOf.call(this.quotes, quoteID) < 0) {
        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);
      }
    },
    fixDeadlink: function(deadlink) {
      var el, green;
      if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') {
        green = $.el('span', {
          className: 'quote'
        });
        $.before(deadlink, green);
        $.add(green, deadlink);
      }
      return $.replace(deadlink, __slice.call(deadlink.childNodes));
    }
  };

  Captcha.fixes = {
    imageKeys: '789456123uiojklm'.split('').concat(['Comma', 'Period']),
    css: '.rc-imageselect-target > div:focus {\n  outline: 2px solid #4a90e2;\n}\n.rc-imageselect-target td:focus {\n  box-shadow: inset 0 0 0 2px #4a90e2;\n  outline: none;\n}\n.rc-button-default:focus {\n  box-shadow: inset 0 0 0 2px #0063d6;\n}',
    cssNoscript: '.fbc-payload-imageselect {\n  position: relative;\n}\n.fbc-payload-imageselect > label {\n  position: absolute;\n  display: block;\n  height: 93.3px;\n  width: 93.3px;\n}\nlabel[data-row="0"] {top: 0px;}\nlabel[data-row="1"] {top: 93.3px;}\nlabel[data-row="2"] {top: 186.6px;}\nlabel[data-col="0"] {left: 0px;}\nlabel[data-col="1"] {left: 93.3px;}\nlabel[data-col="2"] {left: 186.6px;}',
    init: function() {
      switch (location.pathname.split('/')[3]) {
        case 'anchor':
          return this.initMain();
        case 'frame':
          return this.initPopup();
        case 'fallback':
          return this.initNoscript();
      }
    },
    initMain: function() {
      return $.onExists(d.body, '#recaptcha-anchor', true, function(checkbox) {
        var focus;
        focus = function() {
          if (d.hasFocus() && d.activeElement !== checkbox) {
            return checkbox.focus();
          }
        };
        focus();
        return $.on(window, 'focus', function() {
          return $.queueTask(focus);
        });
      });
    },
    initPopup: function() {
      $.addStyle(this.css);
      this.fixImages();
      new MutationObserver((function(_this) {
        return function() {
          return _this.fixImages();
        };
      })(this)).observe(d.body, {
        childList: true,
        subtree: true
      });
      return $.on(d, 'keydown', this.keybinds.bind(this));
    },
    initNoscript: function() {
      this.noscript = true;
      this.images = $$('.fbc-payload-imageselect > input');
      if (this.images.length !== 9) {
        return;
      }
      $.addStyle(this.cssNoscript);
      this.addLabels();
      $.on(d, 'keydown', this.keybinds.bind(this));
      return $.on($('.fbc-imageselect-challenge > form'), 'submit', this.checkForm.bind(this));
    },
    fixImages: function() {
      var img, _i, _len, _ref;
      this.images = $$('.rc-imageselect-target > div, .rc-imageselect-target td');
      _ref = this.images;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        img = _ref[_i];
        img.tabIndex = 0;
      }
      if (this.images.length === 9) {
        this.addTooltips(this.images);
      }
      return this.complaintLinks();
    },
    complaintLinks: function() {
      var errmsg, link, _i, _len, _ref;
      _ref = $$('.rc-imageselect-incorrect-response, .rc-imageselect-error-select-one, .rc-imageselect-error-select-more');
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        errmsg = _ref[_i];
        if (!$('a', errmsg)) {
          link = $.el('a', {
            href: 'https://www.4chan-x.net/captchas.html',
            target: '_blank',
            textContent: '[complain]'
          });
          $.add(errmsg, [$.tn(' '), link]);
        }
      }
    },
    addLabels: function() {
      var checkbox, i, imageSelect, label, labels;
      imageSelect = $('.fbc-payload-imageselect');
      labels = (function() {
        var _i, _len, _ref, _results;
        _ref = this.images;
        _results = [];
        for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
          checkbox = _ref[i];
          checkbox.id = "checkbox-" + i;
          label = $.el('label', {
            htmlFor: checkbox.id
          });
          label.dataset.row = Math.floor(i / 3);
          label.dataset.col = i % 3;
          _results.push(label);
        }
        return _results;
      }).call(this);
      $.add(imageSelect, labels);
      return this.addTooltips(labels);
    },
    addTooltips: function(nodes) {
      var i, node, _i, _len;
      for (i = _i = 0, _len = nodes.length; _i < _len; i = ++_i) {
        node = nodes[i];
        node.title = "" + this.imageKeys[i] + " or " + (this.imageKeys[i + 9][0].toUpperCase()) + this.imageKeys[i + 9].slice(1);
      }
    },
    checkForm: function(e) {
      var checkbox, n, _i, _len, _ref;
      n = 0;
      _ref = this.images;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        checkbox = _ref[_i];
        if (checkbox.checked) {
          n++;
        }
      }
      if (n === 0) {
        return e.preventDefault();
      }
    },
    keybinds: function(e) {
      var dx, i, key, last, n, reload, verify, w, x;
      if (!(this.images && doc.contains(this.images[0]))) {
        return;
      }
      n = this.images.length;
      w = Math.round(Math.sqrt(n));
      last = n + w - 1;
      reload = $('#recaptcha-reload-button, .fbc-button-reload');
      verify = $('#recaptcha-verify-button, .fbc-button-verify > input');
      x = this.images.indexOf(d.activeElement);
      if (x < 0) {
        x = d.activeElement === verify ? last : n;
      }
      key = Keybinds.keyCode(e);
      if (!this.noscript && key === 'Space' && x < n) {
        this.images[x].click();
      } else if (n === 9 && (i = this.imageKeys.indexOf(key)) >= 0) {
        this.images[i % 9].click();
        verify.focus();
      } else if (dx = {
        'Up': n,
        'Down': w,
        'Left': last,
        'Right': 1
      }[key]) {
        x = (x + dx) % (n + w);
        if ((n < x && x < last)) {
          x = dx === last ? n : last;
        }
        (this.images[x] || (x === n ? reload : void 0) || (x === last ? verify : void 0)).focus();
      } else {
        return;
      }
      e.preventDefault();
      return e.stopPropagation();
    }
  };


  /*
  Captcha.noscript = class extends Captcha
    constructor: ->
      @cb =
        focus: Captcha::cb.focus
        load:  (-> if @nodes.iframe then @reload() else @setup()).bind @
        cache: (-> @sendResponse()).bind @
  
    iframeURL: '//www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc'
    lifetime: 30 * $.MINUTE
    timers: {}
  
    impInit: ->
      @buildV1Nodes()
  
      $.addClass QR.nodes.el, 'noscript-captcha'
  
      @conn = new Connection null, "#{location.protocol}//www.google.com",
        challenge: @load.bind @
        token:     @save.bind @
        error:     @error.bind @
  
      @preSetup()
      @setup()
  
    initFrame: ->
      conn = new Connection window.parent, "#{location.protocol}//boards.4chan.org",
        response: (response) ->
          $.id('recaptcha_response_field').value = response
           * The form has a field named 'submit'
          HTMLFormElement.prototype.submit.call $('form')
      if location.hash is '#response'
        conn.send
          token: $('textarea')?.value
          error: $('.recaptcha_input_area')?.textContent.replace(/:$/, '')
      return unless img = $ 'img'
      $('form').action = '#response'
      cb = ->
        canvas = $.el 'canvas'
        canvas.width  = img.width
        canvas.height = img.height
        canvas.getContext('2d').drawImage(img, 0, 0)
        conn.send {challenge: canvas.toDataURL()}
      if img.complete
        cb()
      else
        $.on img, 'load', cb
  
    preSetup: ->
      {container, input} = @nodes
      container.hidden = true
      input.value = ''
      input.placeholder = 'Focus to load reCAPTCHA'
      @count()
      $.on input, 'focus click', @cb.focus
  
    impSetup: (focus, force) ->
      @create()
      @nodes.input.focus() if focus
  
    create: ->
      if !@nodes.iframe
        @nodes.iframe = $.el 'iframe',
          id: 'qr-captcha-iframe'
          src: @iframeURL
        $.add QR.nodes.el, @nodes.iframe
        @conn.target = @nodes.iframe
      else if !@occupied or force
        @nodes.iframe.src = @iframeURL
      @occupied = true
  
    postSetup: ->
      {container, input} = @nodes
      container.hidden = false
      input.placeholder = 'Verification'
      @count()
      $.off input, 'focus click', @cb.focus
  
      if QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight
        QR.nodes.el.style.top    = ''
        QR.nodes.el.style.bottom = '0px'
  
    destroy: ->
      return unless @isEnabled
      $.rm @nodes.img
      delete @nodes.img
      $.rm @nodes.iframe
      delete @nodes.iframe
      delete @occupied
      @preSetup()
  
     * handleCaptcha: -> super()
  
    handleNoCaptcha: ->
      if /\S/.test @nodes.input.value
        (cb) =>
          @submitCB = cb
          @sendResponse()
      else
        null
  
    sendResponse: ->
      response = @nodes.input.value
      if /\S/.test response
        @conn.send {response}
  
    save: (token) ->
      delete @occupied
      @nodes.input.value = ''
      captcha =
        challenge: token
        response:  'manual_challenge'
        timeout:   @timeout
      if @submitCB
        @submitCB captcha
        delete @submitCB
        if @needed() then @reload() else @destroy()
      else
        $.forceSync 'captchas'
        @captchas.push captcha
        @count()
        $.set 'captchas', @captchas
        @reload()
  
    load: (src) ->
      {container, input, img} = @nodes
      @occupied = true
      @timeout = Date.now() + @lifetime
      unless img
        img = @nodes.img = new Image()
        $.one img, 'load', @postSetup.bind @
        $.on img, 'load', -> @hidden = false
        $.add container, img
      img.src = src
      input.value = ''
      @clear()
      clearTimeout @timers.expire
      @timers.expire = setTimeout @expire.bind(@), @lifetime
  
    reload: ->
      @nodes.iframe.src = @iframeURL
      @occupied = true
      @nodes.img?.hidden = true
  
    count: ->
      super()
      clearTimeout @timers.clear
      if @captchas.length
        @timers.clear = setTimeout @clear.bind(@), @captchas[0].timeout - Date.now()
  
    error: (message) ->
      @occupied = true
      @nodes.input.value = ''
      if @submitCB
        @submitCB()
        delete @submitCB
      QR.error "Captcha Error: #{message}"
  
    expire: ->
      return unless @nodes.iframe
      if not d.hidden and (@needed() or d.activeElement is @nodes.input)
        @reload()
      else
        @destroy()
   */

  Captcha.v1 = (function(_super) {
    var blank;

    __extends(_Class, _super);

    function _Class() {
      this.cb = {
        focus: Captcha.prototype.cb.focus,
        load: this.reload.bind(this),
        cache: this.save.bind(this)
      };
    }

    blank = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='57'/>";

    _Class.prototype.impInit = function() {
      var img;
      this.buildV1Nodes();
      this.nodes.img = img = $.el('img');
      $.add(this.nodes.container, img);
      this.replace();
      this.preSetup();
      if (Conf['Auto-load captcha']) {
        this.setup();
      }
      new MutationObserver(this.postSetup).observe($('#g-recaptcha, #captchaContainerAlt'), {
        childList: true
      });
      return this.postSetup();
    };

    _Class.prototype.preSetup = function() {
      var container, img, _ref;
      _ref = this.nodes, container = _ref.container, img = _ref.img;
      container.hidden = true;
      img.src = this.blank;
      return _Class.__super__.preSetup.call(this);
    };

    _Class.prototype.impSetup = function(focus, force) {
      this.create();
      if (focus) {
        return this.nodes.input.focus();
      }
    };

    _Class.prototype.postSetup = function() {
      var challenge, container, input, setLifetime, _ref;
      if (!(challenge = $.id('recaptcha_challenge_field_holder'))) {
        return;
      }
      if (challenge === QR.captcha.nodes.challenge) {
        return;
      }
      setLifetime = function(e) {
        return QR.captcha.lifetime = e.detail;
      };
      $.on(window, 'captcha:timeout', setLifetime);
      $.globalEval('window.dispatchEvent(new CustomEvent("captcha:timeout", {detail: RecaptchaState.timeout}))');
      $.off(window, 'captcha:timeout', setLifetime);
      _ref = QR.captcha.nodes, container = _ref.container, input = _ref.input;
      container.removeAttribute('hidden');
      input.placeholder = 'Verification';
      QR.captcha.count();
      $.off(input, 'focus click', QR.captcha.cb.focus);
      QR.captcha.nodes.challenge = challenge;
      new MutationObserver(QR.captcha.load.bind(QR.captcha)).observe(challenge, {
        childList: true,
        subtree: true,
        attributes: true
      });
      QR.captcha.load();
      if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
        QR.nodes.el.style.top = null;
        return QR.nodes.el.style.bottom = '0px';
      }
    };

    _Class.prototype.replace = function() {
      var container, old;
      if (this.script) {
        return;
      }
      if (!(this.script = $('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', d.head))) {
        this.script = $.el('script', {
          src: '//www.google.com/recaptcha/api/js/recaptcha_ajax.js'
        });
        $.add(d.head, this.script);
      }
      if (old = $.id('g-recaptcha')) {
        container = $.el('div', {
          id: 'captchaContainerAlt'
        });
        return $.replace(old, container);
      }
    };

    _Class.prototype.handleNoCaptcha = function() {
      var challenge, response, timeout;
      challenge = this.nodes.img.alt;
      timeout = this.timeout;
      if (/\S/.test(response = this.nodes.input.value)) {
        this.destroy();
        return {
          challenge: challenge,
          response: response,
          timeout: timeout
        };
      } else {
        return null;
      }
    };

    _Class.prototype.create = function() {
      return $.globalEval('(function() {\n  var container = document.getElementById("captchaContainerAlt");\n  if (container.firstChild) return;\n  var options = {\n    theme: "clean",\n    tabindex: {"boards.4chan.org": 5, "sys.4chan.org": 3}[location.hostname]\n  };\n  if (window.Recaptcha) {\n    window.Recaptcha.create("6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", container, options);\n  } else {\n    var script = document.head.querySelector(\'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]\');\n    script.addEventListener(\'load\', function() {\n      window.Recaptcha.create("6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", container, options);\n    }, false);\n  }\n})();');
    };

    _Class.prototype.save = function() {
      var response;
      if (!/\S/.test(response = this.nodes.input.value)) {
        return;
      }
      this.nodes.input.value = '';
      this.captchas.push({
        challenge: this.nodes.img.alt,
        response: response,
        timeout: this.timeout
      });
      this.count();
      this.destroy();
      this.setup(false, true);
      return $.set('captchas', this.captchas);
    };

    _Class.prototype.load = function() {
      var challenge, challenge_image;
      if ($('#captchaContainerAlt[class~="recaptcha_is_showing_audio"]')) {
        this.nodes.img.src = this.blank;
        return;
      }
      if (!this.nodes.challenge.firstChild) {
        return;
      }
      if (!(challenge_image = $.id('recaptcha_challenge_image'))) {
        return;
      }
      this.timeout = Date.now() + this.lifetime * $.SECOND - $.MINUTE;
      challenge = this.nodes.challenge.firstChild.value;
      this.nodes.img.alt = challenge;
      this.nodes.img.src = challenge_image.src;
      this.nodes.input.value = '';
      return this.clear();
    };

    _Class.prototype.reload = function(focus) {
      $.globalEval('if (window.Recaptcha.type === "image") {\n  window.Recaptcha.reload();\n} else {\n  window.Recaptcha.switch_type("image");\n}\nwindow.Recaptcha.should_focus = false;');
      if (focus) {
        return this.nodes.input.focus();
      }
    };

    _Class.prototype.destroy = function() {
      if (!this.script) {
        return;
      }
      $.globalEval('window.Recaptcha.destroy();');
      if (this.nodes) {
        return this.preSetup();
      }
    };

    return _Class;

  })(Captcha);

  Captcha.v2 = (function(_super) {
    __extends(_Class, _super);

    function _Class() {}

    _Class.prototype.shouldFocus = false;

    _Class.prototype.timeouts = {};

    _Class.prototype.postsCount = 0;

    _Class.prototype.impInit = function() {
      var counter, root, save;
      root = $.el('div', {
        className: 'captcha-root'
      });
      $.extend(root, {
        innerHTML: "<div class=\"captcha-counter\"><a href=\"javascript:;\"></a></div>"
      });
      counter = $('.captcha-counter > a', root);
      this.nodes = {
        root: root,
        counter: counter
      };
      this.count();
      $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2');
      $.after(QR.nodes.com.parentNode, root);
      $.on(counter, 'click', this.toggle.bind(this));
      $.on(counter, 'keydown', (function(_this) {
        return function(e) {
          if (Keybinds.keyCode(e) !== 'Space') {
            return;
          }
          _this.toggle();
          e.preventDefault();
          return e.stopPropagation();
        };
      })(this));
      save = this.save.bind(this);
      return $.on(window, 'captcha:success', function() {
        return $.queueTask(function() {
          return save(false);
        });
      });
    };

    _Class.prototype.initFrame = function() {
      var conn, token, _ref;
      if (token = (_ref = $('.fbc-verification-token > textarea')) != null ? _ref.value : void 0) {
        conn = new Connection(window.parent, "" + location.protocol + "//boards.4chan.org");
        return conn.send({
          token: token
        });
      }
    };

    _Class.prototype.impSetup = function(focus, force) {
      var iframe;
      if (focus && !QR.inBubble()) {
        this.shouldFocus = true;
      }
      if (this.timeouts.destroy) {
        clearTimeout(this.timeouts.destroy);
        delete this.timeouts.destroy;
        return this.reload();
      }
      if (this.nodes.container) {
        if (this.shouldFocus && (iframe = $('iframe', this.nodes.container))) {
          iframe.focus();
          QR.focus();
          delete this.shouldFocus;
        }
        return;
      }
      this.nodes.container = $.el('div', {
        className: 'captcha-container'
      });
      $.prepend(this.nodes.root, this.nodes.container);
      new MutationObserver(this.postSetup.bind(this)).observe(this.nodes.container, {
        childList: true,
        subtree: true
      });
      return this.setupJS();
    };

    _Class.prototype.setupJS = function() {
      return $.globalEval("(function() {\n  function render() {\n    var container = document.querySelector(\"#qr .captcha-container\");\n    container.dataset.widgetID = window.grecaptcha.render(container, {\n      sitekey: '6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc',\n      theme: " + (Style.lightTheme ? "'light'" : "'dark'") + ",\n      callback: function(response) {\n        window.dispatchEvent(new CustomEvent(\"captcha:success\", {detail: response}));\n      }\n    });\n  }\n  if (window.grecaptcha) {\n    render();\n  } else {\n    var cbNative = window.onRecaptchaLoaded;\n    window.onRecaptchaLoaded = function() {\n      render();\n      cbNative();\n    }\n  }\n})();");
    };

    _Class.prototype.postSetup = function(mutations) {
      var iframe, mutation, node, textarea, _i, _j, _len, _len1, _ref;
      for (_i = 0, _len = mutations.length; _i < _len; _i++) {
        mutation = mutations[_i];
        _ref = mutation.addedNodes;
        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
          node = _ref[_j];
          if (iframe = $.x('./descendant-or-self::iframe', node)) {
            this.setupIFrame(iframe);
          }
          if (textarea = $.x('./descendant-or-self::textarea', node)) {
            this.setupTextArea(textarea);
          }
        }
      }
    };

    _Class.prototype.setupIFrame = function(iframe) {
      Captcha.replace.iframe(iframe);
      $.addClass(QR.nodes.el, 'captcha-open');
      if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
        QR.nodes.el.style.top = null;
        QR.nodes.el.style.bottom = '0px';
      }
      if (this.shouldFocus) {
        iframe.focus();
      }
      return this.shouldFocus = false;
    };

    _Class.prototype.setupTextArea = function(textarea) {
      return $.one(textarea, 'input', (function(_this) {
        return function() {
          return _this.save(true);
        };
      })(this));
    };

    _Class.prototype.onNewPost = function() {
      return this.setup();
    };

    _Class.prototype.onPostChange = function() {
      if (this.postsCount === 0) {
        this.setup();
      }
      if (QR.posts.length === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
        return this.postsCount = 0;
      }
    };

    _Class.prototype.toggle = function() {
      if (this.nodes.container && !this.timeouts.destroy) {
        return this.destroy();
      } else {
        return this.setup(true, true);
      }
    };

    _Class.prototype.destroy = function() {
      var garbage, ins, _i, _len, _ref;
      if (!this.isEnabled) {
        return;
      }
      delete this.timeouts.destroy;
      $.rmClass(QR.nodes.el, 'captcha-open');
      if (this.nodes.container) {
        $.rm(this.nodes.container);
      }
      delete this.nodes.container;
      _ref = $$('div > .gc-bubbleDefault');
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        garbage = _ref[_i];
        if ((ins = garbage.parentNode.nextSibling) && ins.nodeName === 'INS') {
          $.rm(ins);
        }
        $.rm(garbage.parentNode);
      }
    };

    _Class.prototype.save = function(pasted, token) {
      var focus, _base, _ref;
      $.forceSync('captchas');
      this.captchas.push({
        response: token || $('textarea', this.nodes.container).value,
        timeout: Date.now() + this.lifetime
      });
      $.set('captchas', this.captchas);
      this.count();
      focus = ((_ref = d.activeElement) != null ? _ref.nodeName : void 0) === 'IFRAME' && /https?:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src);
      if (this.needed()) {
        if (focus) {
          if (QR.cooldown.auto || Conf['Post on Captcha Completion']) {
            this.shouldFocus = true;
          } else {
            QR.nodes.status.focus();
          }
        }
        this.reload();
      } else {
        if (pasted) {
          this.destroy();
        } else {
          if ((_base = this.timeouts).destroy == null) {
            _base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
          }
        }
        if (focus) {
          QR.nodes.status.focus();
        }
      }
      if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) {
        return QR.submit();
      }
    };

    _Class.prototype.clear = function() {
      if (_Class.__super__.clear.call(this)) {
        return this.setup(d.activeElement === QR.nodes.status);
      }
    };

    _Class.prototype.count = function() {
      this.nodes.counter.textContent = "Captchas: " + this.captchas.length;
      clearTimeout(this.timeouts.clear);
      if (this.captchas.length) {
        return this.timeouts.clear = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
      }
    };

    _Class.prototype.reload = function() {
      return $.globalEval('(function() {\n  var container = document.querySelector("#qr .captcha-container");\n  window.grecaptcha.reset(container.dataset.widgetID);\n})();');
    };

    return _Class;

  })(Captcha);

  QR = {
    mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'],
    init: function() {
      var con, noscript, sc, version;
      this.db = new DataBoard('yourPosts');
      this.posts = [];
      if (g.VIEW === 'archive') {
        return;
      }
      $.globalEval('document.documentElement.classList.add("js-enabled");');
      version = Conf['Use Recaptcha v1'] ? (noscript = Conf['Force Noscript Captcha'] || !$.hasClass(doc, 'js-enabled'), noscript ? 'noscript' : 'v1') : 'v2';
      this.captcha = new Captcha[version]();
      $.on(d, '4chanXInitFinished', this.initReady);
      window.addEventListener('focus', this.focus, true);
      window.addEventListener('blur', this.focus, true);
      $.on(d, 'click', this.focus);
      Post.callbacks.push({
        name: 'Quick Reply',
        cb: this.node
      });
      if (!(Conf['Header Shortcut'] || Conf['Page Shortcut'])) {
        return;
      }
      sc = $.el('a', {
        className: "qr-shortcut fa " + (!Conf['Persistent QR'] ? 'disabled' : ''),
        textContent: '\uf075',
        title: 'Quick Reply',
        href: 'javascript:;'
      });
      $.on(sc, 'click', function() {
        if (!QR.nodes || QR.nodes.el.hidden) {
          $.event('CloseMenu');
          QR.open();
          QR.nodes.com.focus();
        } else {
          QR.close();
        }
        return $.toggleClass(this, 'disabled');
      });
      if (Conf['Header Shortcut']) {
        return Header.addShortcut(sc, true);
      }
      $.addClass(sc, 'on-page');
      $.rmClass(sc, 'fa');
      sc.textContent = g.VIEW === 'thread' ? 'Reply to Thread' : 'Start a Thread';
      con = $.el('div', {
        className: 'center'
      });
      $.add(con, sc);
      return $.asap((function() {
        return d.body;
      }), function() {
        return $.asap((function() {
          return $.id('postForm');
        }), function() {
          return $.before($.id('postForm'), con);
        });
      });
    },
    initReady: function() {
      $.off(d, '4chanXInitFinished', this.initReady);
      QR.postingIsEnabled = !!$.id('postForm');
      if (!QR.postingIsEnabled) {
        return;
      }
      $.on(d, 'paste', QR.paste);
      $.on(d, 'dragover', QR.dragOver);
      $.on(d, 'drop', QR.dropFile);
      $.on(d, 'dragstart dragend', QR.drag);
      $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
      $.on(d, 'ThreadUpdate', QR.statusCheck);
      if (!Conf['Persistent QR']) {
        return;
      }
      QR.open();
      if (Conf['Auto Hide QR']) {
        return QR.hide();
      }
    },
    statusCheck: function() {
      var thread;
      if (!QR.nodes) {
        return;
      }
      thread = QR.posts[0].thread;
      if (thread !== 'new' && g.threads["" + g.BOARD + "." + thread].isDead) {
        return QR.abort();
      } else {
        return QR.status();
      }
    },
    node: function() {
      if (QR.db.get({
        boardID: this.board.ID,
        threadID: this.thread.ID,
        postID: this.ID
      })) {
        $.addClass(this.nodes.root, 'your-post');
      }
      return $.on($('a[title="Reply to this post"]', this.nodes.info), 'click', QR.quote);
    },
    persist: function() {
      if (!QR.postingIsEnabled) {
        return;
      }
      QR.open();
      if (Conf['Auto Hide QR']) {
        return QR.hide();
      }
    },
    open: function() {
      var err;
      if (QR.nodes) {
        if (QR.nodes.el.hidden) {
          QR.captcha.setup();
        }
        QR.nodes.el.hidden = false;
        QR.unhide();
        return;
      }
      try {
        return QR.dialog();
      } catch (_error) {
        err = _error;
        delete QR.nodes;
        return Main.handleErrors({
          message: 'Quick Reply dialog creation crashed.',
          error: err
        });
      }
    },
    close: function() {
      var post, _i, _len, _ref;
      if (QR.req) {
        QR.abort();
        return;
      }
      QR.nodes.el.hidden = true;
      QR.cleanNotifications();
      d.activeElement.blur();
      $.rmClass(QR.nodes.el, 'dump');
      if (Conf['QR Shortcut']) {
        $.toggleClass($('.qr-shortcut'), 'disabled');
      }
      new QR.post(true);
      _ref = QR.posts.splice(0, QR.posts.length - 1);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        post = _ref[_i];
        post["delete"]();
      }
      QR.cooldown.auto = false;
      QR.status();
      return QR.captcha.destroy();
    },
    focus: function() {
      return $.queueTask(function() {
        if (!QR.inBubble()) {
          QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement);
          QR.nodes.el.classList.toggle('focus', QR.hasFocus);
        }
        if (QR.captcha.isEnabled && QR.captcha === Captcha.v2 && !QR.captcha.noscript) {
          if (QR.inCaptcha()) {
            QR.scrollY = window.scrollY;
            return $.on(d, 'scroll', QR.scrollLock);
          } else {
            return $.off(d, 'scroll', QR.scrollLock);
          }
        }
      });
    },
    inBubble: function() {
      var bubbles, _ref;
      bubbles = $$('.goog-bubble-content > iframe');
      return (_ref = d.activeElement, __indexOf.call(bubbles, _ref) >= 0) || bubbles.some(function(el) {
        return el.getBoundingClientRect().bottom > 0;
      });
    },
    scrollLock: function(e) {
      if (d.activeElement && QR.nodes.el.contains(d.activeElement) && d.activeElement.nodeName === 'IFRAME') {
        return window.scroll(window.scrollX, QR.scrollY);
      } else {
        return $.off(d, 'scroll', QR.scrollLock);
      }
    },
    hide: function() {
      d.activeElement.blur();
      $.addClass(QR.nodes.el, 'autohide');
      return QR.nodes.autohide.checked = true;
    },
    unhide: function() {
      $.rmClass(QR.nodes.el, 'autohide');
      return QR.nodes.autohide.checked = false;
    },
    toggleHide: function() {
      if (this.checked) {
        return QR.hide();
      } else {
        return QR.unhide();
      }
    },
    error: function(err) {
      var el;
      QR.open();
      if (typeof err === 'string') {
        el = $.tn(err);
      } else {
        el = err;
        el.removeAttribute('style');
      }
      if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
        QR.captcha.setup(true);
        QR.captcha.notify(el);
      } else {
        QR.notify(el);
      }
      if (d.hidden) {
        return alert(el.textContent);
      }
    },
    notify: function(el) {
      var notice, notif;
      notice = new Notice('warning', el);
      if (!(Header.areNotificationsEnabled && d.hidden)) {
        return QR.notifications.push(notice);
      } else {
        notif = new Notification(el.textContent, {
          body: el.textContent,
          icon: Favicon.logo
        });
        return notif.onclick = function() {
          return window.focus();
        };
      }
    },
    notifications: [],
    cleanNotifications: function() {
      var notification, _i, _len, _ref;
      _ref = QR.notifications;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        notification = _ref[_i];
        notification.close();
      }
      return QR.notifications = [];
    },
    status: function() {
      var disabled, status, thread, value, _ref;
      if (!QR.nodes) {
        return;
      }
      thread = QR.posts[0].thread;
      if (thread !== 'new' && ((_ref = g.threads["" + g.BOARD + "." + thread]) != null ? _ref.isDead : void 0)) {
        value = 'Dead';
        disabled = true;
        QR.cooldown.auto = false;
      }
      value = QR.req ? QR.req.progress : QR.cooldown.seconds || value;
      status = QR.nodes.status;
      status.value = !value ? 'Submit' : QR.cooldown.auto ? "Auto " + value : value;
      return status.disabled = disabled || false;
    },
    quote: function(e) {
      var ancestor, caretPos, com, frag, index, insideCode, node, post, range, sel, text, thread, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
      if (e != null) {
        e.preventDefault();
      }
      if (!QR.postingIsEnabled) {
        return;
      }
      sel = d.getSelection();
      post = Get.postFromNode(this);
      text = post.board.ID === g.BOARD.ID ? ">>" + post + "\n" : ">>>/" + post.board + "/" + post + "\n";
      if (sel.toString().trim() && post === Get.postFromNode(sel.anchorNode)) {
        range = sel.getRangeAt(0);
        frag = range.cloneContents();
        ancestor = range.commonAncestorContainer;
        if ($.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) {
          $.prepend(frag, $.tn('[spoiler]'));
          $.add(frag, $.tn('[/spoiler]'));
        }
        if (insideCode = $.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) {
          $.prepend(frag, $.tn('[code]'));
          $.add(frag, $.tn('[/code]'));
        }
        _ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          node = _ref[_i];
          $.replace(node, $.tn('\n'));
        }
        _ref1 = $$('br', frag);
        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
          node = _ref1[_j];
          if (node !== frag.lastChild) {
            $.replace(node, $.tn('\n>'));
          }
        }
        _ref2 = $$('s, .removed-spoiler', frag);
        for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
          node = _ref2[_k];
          $.replace(node, [$.tn('[spoiler]')].concat(__slice.call(node.childNodes), [$.tn('[/spoiler]')]));
        }
        _ref3 = $$('.prettyprint', frag);
        for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
          node = _ref3[_l];
          $.replace(node, [$.tn('[code]')].concat(__slice.call(node.childNodes), [$.tn('[/code]')]));
        }
        _ref4 = $$('.linkify[data-original]', frag);
        for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) {
          node = _ref4[_m];
          $.replace(node, $.tn(node.dataset.original));
        }
        _ref5 = $$('.embedder', frag);
        for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) {
          node = _ref5[_n];
          if (((_ref6 = node.previousSibling) != null ? _ref6.nodeValue : void 0) === ' ') {
            $.rm(node.previousSibling);
          }
          $.rm(node);
        }
        text += ">" + (frag.textContent.trim()) + "\n";
      }
      QR.open();
      if (QR.selected.isLocked) {
        index = QR.posts.indexOf(QR.selected);
        (QR.posts[index + 1] || new QR.post()).select();
        $.addClass(QR.nodes.el, 'dump');
        QR.cooldown.auto = true;
      }
      _ref7 = QR.nodes, com = _ref7.com, thread = _ref7.thread;
      if (!com.value) {
        thread.value = Get.threadFromNode(this);
      }
      thread.nextElementSibling.firstElementChild.textContent = thread.options[thread.selectedIndex].textContent;
      caretPos = com.selectionStart;
      com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
      range = caretPos + text.length;
      com.setSelectionRange(range, range);
      com.focus();
      QR.selected.save(com);
      QR.selected.save(thread);
      return $.rmClass($('.qr-shortcut'), 'disabled');
    },
    characterCount: function() {
      var count, counter;
      counter = QR.nodes.charCount;
      count = QR.nodes.com.textLength;
      counter.textContent = count;
      counter.hidden = count < 1000;
      return (count > 1500 ? $.addClass : $.rmClass)(counter, 'warning');
    },
    drag: function(e) {
      var toggle;
      toggle = e.type === 'dragstart' ? $.off : $.on;
      toggle(d, 'dragover', QR.dragOver);
      return toggle(d, 'drop', QR.dropFile);
    },
    dragOver: function(e) {
      e.preventDefault();
      return e.dataTransfer.dropEffect = 'copy';
    },
    dropFile: function(e) {
      if (!e.dataTransfer.files.length) {
        return;
      }
      e.preventDefault();
      QR.open();
      return QR.handleFiles(e.dataTransfer.files);
    },
    paste: function(e) {
      var blob, files, item, _i, _len, _ref;
      if (!e.clipboardData.items) {
        return;
      }
      files = [];
      _ref = e.clipboardData.items;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        item = _ref[_i];
        if (!(item.kind === 'file')) {
          continue;
        }
        blob = item.getAsFile();
        blob.name = 'file';
        if (blob.type) {
          blob.name += '.' + blob.type.split('/')[1];
        }
        files.push(blob);
      }
      if (!files.length) {
        return;
      }
      QR.open();
      QR.handleFiles(files);
      return $.addClass(QR.nodes.el, 'dump');
    },
    handleUrl: function() {
      var url;
      url = prompt('Enter a URL:');
      if (url === null) {
        return;
      }
      return CrossOrigin.file(url, function(blob) {
        if (blob) {
          return QR.handleFiles([blob]);
        } else {
          return QR.error("Can't load image.");
        }
      });
    },
    handleFiles: function(files) {
      var file, i, _i, _len;
      if (this !== QR) {
        files = __slice.call(this.files);
        this.value = null;
      }
      if (!files.length) {
        return;
      }
      QR.cleanNotifications();
      for (i = _i = 0, _len = files.length; _i < _len; i = ++_i) {
        file = files[i];
        QR.handleFile(file, i, files.length);
      }
      if (files.length !== 1) {
        return $.addClass(QR.nodes.el, 'dump');
      }
    },
    handleFile: function(file, index, nfiles) {
      var isSingle, max, post, _ref;
      isSingle = nfiles === 1;
      if (/^text\//.test(file.type)) {
        if (isSingle) {
          post = QR.selected;
        } else if (index !== 0 || (post = QR.posts[QR.posts.length - 1]).com) {
          post = new QR.post();
        }
        post.pasteText(file);
        return;
      }
      if (_ref = file.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
        QR.error("" + file.name + ": Unsupported file type.");
        return;
      }
      max = QR.nodes.fileInput.max;
      if (/^video\//.test(file.type)) {
        if (g.BOARD.ID === 'wsg' || g.BOARD.ID === 'gif') {
          max = Math.min(max, QR.max_size_video_alt);
        } else {
          max = Math.min(max, QR.max_size_video);
        }
      }
      if (file.size > max) {
        QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
        return;
      }
      if (isSingle) {
        post = QR.selected;
      } else if ((post = QR.posts[QR.posts.length - 1]).file) {
        post = new QR.post();
      }
      return post.setFile(file);
    },
    openFileInput: function(e) {
      var _ref;
      e.stopPropagation();
      if (e.shiftKey && e.type === 'click') {
        return QR.selected.rmFile();
      }
      if ((e.ctrlKey || e.metaKey) && e.type === 'click') {
        $.addClass(QR.nodes.filename, 'edit');
        QR.nodes.filename.focus();
      }
      if (e.target.nodeName === 'INPUT' || (e.keyCode && ((_ref = e.keyCode) !== 32 && _ref !== 13)) || e.ctrlKey) {
        return;
      }
      e.preventDefault();
      return QR.nodes.fileInput.click();
    },
    generatePostableThreadsList: function() {
      var list, options, thread, val, _i, _len, _ref;
      if (!QR.nodes) {
        return;
      }
      list = QR.nodes.thread;
      options = [list.firstElementChild];
      _ref = g.BOARD.threads.keys;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        thread = _ref[_i];
        options.push($.el('option', {
          value: thread,
          textContent: "No." + thread
        }));
      }
      val = list.value;
      $.rmAll(list);
      $.add(list, options);
      list.value = val;
      if (!list.value) {
        return;
      }
      list.value = g.VIEW === 'thread' ? g.THREADID : 'new';
      if ($.hasClass(list, 'riced')) {
        list.nextElementSibling.firstChild.textContent = list.options[list.selectedIndex].textContent;
      }
      return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
    },
    dialog: function() {
      var dialog, event, i, items, match_max, match_min, name, node, nodes, rules, save, setNode;
      QR.nodes = nodes = {
        el: dialog = UI.dialog('qr', 'top:0;right:0;', {
          innerHTML: "<div id=qrtab class=move><input type=checkbox id=autohide title=Auto-hide><div id=qr-thread-select><select data-name=thread title='Create a new thread / Reply'><option value=new>New thread</option></select></div><a href=javascript:; class='close fa' title=Close>\uf00d</a></div><form><div class=persona><input name=name  data-name=name  list=\"list-name\"  placeholder=Name    class=field size=1><input name=email data-name=email list=\"list-email\" placeholder=Options class=field size=1><input name=sub   data-name=sub   list=\"list-sub\"   placeholder=Subject class=field size=1> </div><div class=textarea><textarea data-name=com placeholder=Comment class=field></textarea><span id=char-count></span></div><div id=dump-list-container><div id=dump-list></div><a id=add-post href=javascript:; title=\"Add a post\">+</a></div><div id=file-n-submit><span id=qr-filename-container class=field tabindex=0><span id=qr-no-file>No selected file</span><input id=\"qr-filename\" data-name=\"filename\" spellcheck=\"false\"><span id=qr-extras-container><label id=qr-spoiler-label><input type=checkbox id=qr-file-spoiler title='Spoiler image'></label><span class=description>Spoiler</span><a id=url-button><i class=\"fa\">\uf0c1</i></a><span class=description>Post from URL</span><a id=dump-button title='Dump list'>+</a><span class=description>Dump</span><a id=qr-filerm href=javascript:; title='Remove file' class=fa>\uf00d</a><span class=description>Remove File</span></span></span><input type=submit></div><input type=file multiple></form><datalist id=\"list-name\"></datalist><datalist id=\"list-email\"></datalist><datalist id=\"list-sub\"></datalist>"
        })
      };
      setNode = function(name, query) {
        return nodes[name] = $(query, dialog);
      };
      setNode('move', '.move');
      setNode('autohide', '#autohide');
      setNode('thread', 'select');
      setNode('threadPar', '#qr-thread-select');
      setNode('close', '.close');
      setNode('form', 'form');
      setNode('dumpButton', '#dump-button');
      setNode('urlButton', '#url-button');
      setNode('name', '[data-name=name]');
      setNode('email', '[data-name=email]');
      setNode('sub', '[data-name=sub]');
      setNode('com', '[data-name=com]');
      setNode('dumpList', '#dump-list');
      setNode('addPost', '#add-post');
      setNode('charCount', '#char-count');
      setNode('fileSubmit', '#file-n-submit');
      setNode('filename', '#qr-filename');
      setNode('fileContainer', '#qr-filename-container');
      setNode('fileRM', '#qr-filerm');
      setNode('fileExtras', '#qr-extras-container');
      setNode('spoiler', '#qr-file-spoiler');
      setNode('spoilerPar', '#qr-spoiler-label');
      setNode('status', '[type=submit]');
      setNode('fileInput', '[type=file]');
      rules = $('ul.rules').textContent.trim();
      match_min = rules.match(/.+smaller than (\d+)x(\d+).+/);
      match_max = rules.match(/.+greater than (\d+)x(\d+).+/);
      QR.min_width = +(match_min != null ? match_min[1] : void 0) || 1;
      QR.min_height = +(match_min != null ? match_min[2] : void 0) || 1;
      QR.max_width = +(match_max != null ? match_max[1] : void 0) || 10000;
      QR.max_height = +(match_max != null ? match_max[2] : void 0) || 10000;
      nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value;
      QR.max_size_video = 3145728;
      QR.max_size_video_alt = 4194304;
      QR.max_width_video = QR.max_height_video = 2048;
      QR.max_duration_video = 120;
      QR.max_duration_video_alt = 300;
      if (Conf['Show New Thread Option in Threads']) {
        $.addClass(QR.nodes.el, 'show-new-thread-option');
      }
      if (Conf['Show Name and Subject']) {
        $.addClass(QR.nodes.name, 'force-show');
        $.addClass(QR.nodes.sub, 'force-show');
        QR.nodes.email.placeholder = 'E-mail';
      }
      QR.forcedAnon = !!$('form[name="post"] input[name="name"][type="hidden"]');
      if (QR.forcedAnon) {
        $.addClass(QR.nodes.el, 'forced-anon');
      }
      QR.spoiler = !!$('.postForm input[name=spoiler]');
      if (QR.spoiler) {
        $.addClass(QR.nodes.el, 'has-spoiler');
      } else {
        nodes.spoiler.parentElement.hidden = true;
      }
      if (Conf['Dump List Before Comment']) {
        $.after(nodes.name.parentElement, nodes.dumpList.parentElement);
        nodes.addPost.tabIndex = 35;
      }
      if (g.BOARD.ID === 'f' && g.VIEW !== 'thread') {
        nodes.flashTag = $.el('select', {
          name: 'filetag'
        });
        $.extend(nodes.flashTag, {
          innerHTML: "<option value=\"0\">Hentai</option><option value=\"6\">Porn</option><option value=\"1\">Japanese</option><option value=\"2\">Anime</option><option value=\"3\">Game</option><option value=\"5\">Loop</option><option value=\"4\" selected>Other</option>"
        });
        nodes.flashTag.dataset["default"] = '4';
        $.add(nodes.form, nodes.flashTag);
      }
      QR.flagsInput();
      $.on(nodes.filename.parentNode, 'click keydown', QR.openFileInput);
      $.on(nodes.autohide, 'change', QR.toggleHide);
      $.on(nodes.close, 'click', QR.close);
      $.on(nodes.dumpButton, 'click', function() {
        return nodes.el.classList.toggle('dump');
      });
      $.on(nodes.urlButton, 'click', QR.handleUrl);
      $.on(nodes.addPost, 'click', function() {
        return new QR.post(true);
      });
      $.on(nodes.form, 'submit', QR.submit);
      $.on(nodes.filename, 'blur', function() {
        return $.rmClass(this, 'edit');
      });
      $.on(nodes.fileRM, 'click', function() {
        return QR.selected.rmFile();
      });
      $.on(nodes.fileExtras, 'click', function(e) {
        return e.stopPropagation();
      });
      $.on(nodes.spoiler, 'change', function() {
        return QR.selected.nodes.spoiler.click();
      });
      $.on(nodes.fileInput, 'change', QR.handleFiles);
      items = ['spoilerPar', 'dumpButton', 'fileRM', 'urlButton'];
      i = 0;
      while (name = items[i++]) {
        $.on(nodes[name], 'mouseover', QR.mouseover);
      }
      items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag'];
      i = 0;
      save = function() {
        return QR.selected.save(this);
      };
      while (name = items[i++]) {
        if (!(node = nodes[name])) {
          continue;
        }
        event = node.nodeName === 'SELECT' ? 'change' : 'input';
        $.on(nodes[name], event, save);
      }
      $.on(nodes['name'], 'blur', QR.tripcodeHider);
      if (Conf['Remember QR Size']) {
        $.get('QR Size', '', function(item) {
          return nodes.com.style.cssText = item['QR Size'];
        });
        $.on(nodes.com, 'mouseup', function(e) {
          if (e.button !== 0) {
            return;
          }
          return $.set('QR Size', this.style.cssText);
        });
      }
      QR.generatePostableThreadsList();
      QR.persona.init();
      new QR.post(true);
      QR.status();
      QR.cooldown.init();
      QR.captcha.init();
      Rice.nodes(dialog);
      $.add(d.body, dialog);
      QR.captcha.setup();
      if (Conf['Auto Hide QR']) {
        nodes.autohide.click();
      }
      return $.event('QRDialogCreation', null, dialog);
    },
    tripcodeHider: function() {
      var check;
      check = /^.*##?.+/.test(this.value);
      if (check && !this.className.match("\\btripped\\b")) {
        return $.addClass(this, 'tripped');
      } else if (!check && this.className.match("\\btripped\\b")) {
        return $.rmClass(this, 'tripped');
      }
    },
    flags: function() {
      var flag, fn, select, _i, _len, _ref;
      select = $.el('select', {
        name: 'flag',
        className: 'flagSelector'
      });
      fn = function(val) {
        return $.add(select, $.el('option', {
          value: val[0],
          textContent: val[1]
        }));
      };
      _ref = [['0', 'None'], ['US', 'American'], ['KP', 'Best Korean'], ['BL', 'Black Nationalist'], ['CM', 'Communist'], ['CF', 'Confederate'], ['RE', 'Conservative'], ['EU', 'European'], ['GY', 'Gay'], ['PC', 'Hippie'], ['IL', 'Israeli'], ['DM', 'Liberal'], ['RP', 'Libertarian'], ['MF', 'Muslim'], ['NZ', 'Nazi'], ['OB', 'Obama'], ['PR', 'Pirate'], ['RB', 'Rebel'], ['TP', 'Tea Partier'], ['TX', 'Texan'], ['TR', 'Tree Hugger'], ['WP', 'White Supremacist']];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        flag = _ref[_i];
        fn(flag);
      }
      return select;
    },
    flagsInput: function() {
      var nodes;
      nodes = QR.nodes;
      if (!nodes) {
        return;
      }
      if (nodes.flag) {
        $.rm(nodes.flag);
        return delete nodes.flag;
      }
    },
    submit: function(e) {
      var captcha, cb, err, extra, filetag, formData, options, post, textOnly, thread, threadID;
      if (e != null) {
        e.preventDefault();
      }
      if (QR.req) {
        QR.abort();
        return;
      }
      if (QR.cooldown.seconds) {
        QR.cooldown.auto = !QR.cooldown.auto;
        QR.status();
        return;
      }
      post = QR.posts[0];
      post.forceSave();
      if (g.BOARD.ID === 'f' && g.VIEW !== 'thread') {
        filetag = QR.nodes.flashTag.value;
      }
      threadID = post.thread;
      thread = g.BOARD.threads[threadID];
      if (threadID === 'new') {
        threadID = null;
        if (g.BOARD.ID === 'vg' && !post.sub) {
          err = 'New threads require a subject.';
        } else if (!(post.file || (textOnly = !!$('input[name=textonly]', $.id('postForm'))))) {
          err = 'No file selected.';
        }
      } else if (g.BOARD.threads[threadID].isClosed) {
        err = 'You can\'t reply to this thread anymore.';
      } else if (!(post.com || post.file)) {
        err = 'No file selected.';
      } else if (post.file && thread.fileLimit) {
        err = 'Max limit of image replies has been reached.';
      }
      if (QR.captcha.isEnabled && !err) {
        captcha = QR.captcha.getOne();
        if (!captcha) {
          err = 'No valid captcha.';
        }
      }
      QR.cleanNotifications();
      if (err) {
        QR.cooldown.auto = false;
        QR.status();
        QR.error(err);
        return;
      }
      QR.cooldown.auto = QR.posts.length > 1;
      if (Conf['Auto Hide QR'] && !QR.cooldown.auto) {
        QR.hide();
      }
      if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) {
        d.activeElement.blur();
      }
      post.lock();
      formData = {
        resto: threadID,
        name: !QR.forcedAnon ? post.name : void 0,
        email: post.email,
        sub: !(QR.forcedAnon || threadID) ? post.sub : void 0,
        com: post.com,
        upfile: post.file,
        filetag: filetag,
        spoiler: post.spoiler,
        flag: post.flag,
        textonly: textOnly,
        mode: 'regist',
        pwd: QR.persona.pwd
      };
      options = {
        responseType: 'document',
        withCredentials: true,
        onload: QR.response,
        onerror: function() {
          delete QR.req;
          post.unlock();
          QR.cooldown.auto = false;
          QR.status();
          return QR.error($.el('span', {
            innerHTML: "appchan x encountered an error while posting. [<a href=\"//4chan.org/banned\" target=\"_blank\">Banned?</a>] [<a href=\"" + E(g.FAQ) + "#what-does-4chan-x-encountered-an-error-while-posting-please-try-again-mean\" target=\"_blank\">More info</a>]"
          }));
        }
      };
      extra = {
        form: $.formData(formData),
        upCallbacks: {
          onload: function() {
            QR.req.isUploadFinished = true;
            QR.req.uploadEndTime = Date.now();
            QR.req.progress = '...';
            return QR.status();
          },
          onprogress: function(e) {
            QR.req.progress = "" + (Math.round(e.loaded / e.total * 100)) + "%";
            return QR.status();
          }
        }
      };
      cb = function(response) {
        if (response != null) {
          if (response.challenge != null) {
            extra.form.append('recaptcha_challenge_field', response.challenge);
            extra.form.append('recaptcha_response_field', response.response);
          } else {
            extra.form.append('g-recaptcha-response', response.response);
          }
        }
        QR.req = $.ajax("https://sys.4chan.org/" + g.BOARD + "/post", options, extra);
        return QR.req.progress = '...';
      };
      if (typeof captcha === 'function') {
        QR.req = {
          progress: '...',
          abort: function() {
            return cb = null;
          }
        };
        captcha(function(response) {
          if (response) {
            return typeof cb === "function" ? cb(response) : void 0;
          } else {
            delete QR.req;
            post.unlock();
            QR.cooldown.auto = !!QR.captcha.captchas.length;
            return QR.status();
          }
        });
      } else {
        cb(captcha);
      }
      return QR.status();
    },
    response: function() {
      var URL, ban, board, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, req, resDoc, threadID, _, _ref, _ref1;
      req = QR.req;
      delete QR.req;
      post = QR.posts[0];
      post.unlock();
      resDoc = req.response;
      if (ban = $('.banType', resDoc)) {
        board = $('.board', resDoc).innerHTML;
        err = $.el('span', ban.textContent.toLowerCase() === 'banned' ? {
          innerHTML: "You are banned on " + $(".board", resDoc).innerHTML + "! ;_;<br>Click <a href=\"//www.4chan.org/banned\" target=\"_blank\">here</a> to see the reason."
        } : {
          innerHTML: "You were issued a warning on " + $(".board", resDoc).innerHTML + " as " + $(".nameBlock", resDoc).innerHTML + ".<br>Reason: " + $(".reason", resDoc).innerHTML
        });
      } else if (err = resDoc.getElementById('errmsg')) {
        if ((_ref = $('a', err)) != null) {
          _ref.target = '_blank';
        }
      } else if (resDoc.title !== 'Post successful!') {
        err = 'Connection error with sys.4chan.org.';
      } else if (req.status !== 200) {
        err = "Error " + req.statusText + " (" + req.status + ")";
      }
      if (err) {
        if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
          if (/mistyped/i.test(err.textContent)) {
            err = 'You seem to have mistyped the CAPTCHA.';
          } else if (/expired/i.test(err.textContent)) {
            err = 'This CAPTCHA is no longer valid because it has expired.';
          }
          QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : err === 'Connection error with sys.4chan.org.' ? true : false;
          QR.cooldown.addDelay(post, 2);
        } else if (err.textContent && (m = err.textContent.match(/wait\s+(\d+)\s+second/i)) && !/duplicate/i.test(err.textContent)) {
          QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : true;
          QR.cooldown.addDelay(post, +m[1]);
          QR.captcha.setup(d.activeElement === QR.nodes.status);
        } else {
          QR.cooldown.auto = false;
        }
        QR.status();
        QR.error(err);
        return;
      }
      h1 = $('h1', resDoc);
      QR.cleanNotifications();
      if (Conf['Posting Success Notifications']) {
        QR.notifications.push(new Notice('success', h1.textContent, 5));
      }
      QR.persona.set(post);
      _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
      postID = +postID;
      threadID = +threadID || postID;
      isReply = threadID !== postID;
      QR.db.set({
        boardID: g.BOARD.ID,
        threadID: threadID,
        postID: postID,
        val: true
      });
      ThreadUpdater.postID = postID;
      $.event('QRPostSuccessful', {
        boardID: g.BOARD.ID,
        threadID: threadID,
        postID: postID
      });
      $.event('QRPostSuccessful_', {
        boardID: g.BOARD.ID,
        threadID: threadID,
        postID: postID
      });
      postsCount = QR.posts.length - 1;
      QR.cooldown.auto = postsCount && isReply;
      if (QR.cooldown.auto && QR.captcha.isEnabled && (captchasCount = QR.captcha.captchas.length) < 3 && captchasCount < postsCount) {
        notif = new Notification('Quick reply warning', {
          body: "You are running low on cached captchas. Cache count: " + captchasCount + ".",
          icon: Favicon.logo
        });
        notif.onclick = function() {
          QR.open();
          window.focus();
          return QR.captcha.setup(true);
        };
        notif.onshow = function() {
          return setTimeout(function() {
            return notif.close();
          }, 7 * $.SECOND);
        };
      }
      if (!(Conf['Persistent QR'] || postsCount)) {
        QR.close();
      } else {
        post.rm();
        QR.captcha.setup(d.activeElement === QR.nodes.status);
      }
      QR.cooldown.add(req.uploadEndTime, threadID, postID);
      URL = threadID === postID ? window.location.origin + Build.path(g.BOARD.ID, threadID) : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? window.location.origin + Build.path(g.BOARD.ID, threadID, postID) : void 0;
      if (URL) {
        setTimeout(function() {
          if (Conf['Open Post in New Tab'] || postsCount) {
            return $.open(URL);
          } else {
            return window.location = URL;
          }
        }, 500);
      }
      return QR.status();
    },
    abort: function() {
      if (QR.req && !QR.req.isUploadFinished) {
        QR.req.abort();
        delete QR.req;
        QR.posts[0].unlock();
        QR.cooldown.auto = false;
        QR.notifications.push(new Notice('info', 'QR upload aborted.', 5));
      }
      return QR.status();
    },
    mouseover: function(e) {
      var mouseover;
      mouseover = $.el('div', {
        id: 'mouseover',
        className: 'dialog'
      });
      $.add(Header.hover, mouseover);
      mouseover.innerHTML = this.nextElementSibling.innerHTML;
      UI.hover({
        root: this,
        el: mouseover,
        latestEvent: e,
        endEvents: 'mouseout',
        asapTest: function() {
          return true;
        },
        offsetX: 15,
        offsetY: -5
      });
    }
  };

  QR.cooldown = {
    seconds: 0,
    init: function() {
      var delay, items, key, keys, m, scope, type, _ref, _results;
      if (!Conf['Cooldown']) {
        return;
      }
      QR.cooldown.delays = (m = Get.scriptData().match(/\bcooldowns *= *({[^}]+})/)) ? JSON.parse(m[1]) : {
        thread: 0,
        reply: 0,
        image: 0,
        reply_intra: 0,
        image_intra: 0
      };
      QR.cooldown.maxDelay = 0;
      _ref = QR.cooldown.delays;
      for (type in _ref) {
        delay = _ref[type];
        if (type !== 'thread') {
          QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay);
        }
      }
      QR.cooldown.delays['thread_global'] = 300;
      keys = QR.cooldown.keys = {
        local: "cooldown." + g.BOARD,
        global: 'cooldown.global'
      };
      items = {};
      for (scope in keys) {
        key = keys[scope];
        items[key] = {};
      }
      $.get(items, function(items) {
        for (scope in keys) {
          key = keys[scope];
          QR.cooldown[scope] = items[key];
        }
        return QR.cooldown.start();
      });
      _results = [];
      for (scope in keys) {
        key = keys[scope];
        _results.push($.sync(key, QR.cooldown.sync(scope)));
      }
      return _results;
    },
    start: function() {
      if (QR.cooldown.isCounting || Object.keys(QR.cooldown.local).length + Object.keys(QR.cooldown.global).length === 0) {
        return;
      }
      QR.cooldown.isCounting = true;
      return QR.cooldown.count();
    },
    sync: function(scope) {
      return function(cooldowns) {
        QR.cooldown[scope] = cooldowns || {};
        return QR.cooldown.start();
      };
    },
    add: function(start, threadID, postID) {
      var boardID;
      if (!Conf['Cooldown']) {
        return;
      }
      boardID = g.BOARD.ID;
      QR.cooldown.set('local', start, {
        threadID: threadID,
        postID: postID
      });
      if (threadID === postID) {
        QR.cooldown.set('global', start, {
          boardID: boardID,
          threadID: threadID,
          postID: postID
        });
      }
      return QR.cooldown.start();
    },
    addDelay: function(post, delay) {
      var cooldown;
      if (!Conf['Cooldown']) {
        return;
      }
      cooldown = QR.cooldown.categorize(post);
      cooldown.delay = delay;
      QR.cooldown.set('local', Date.now(), cooldown);
      return QR.cooldown.start();
    },
    "delete": function(post) {
      var cooldown, id, _ref;
      if (!(Conf['Cooldown'] && g.BOARD.ID === post.board.ID)) {
        return;
      }
      $.forceSync(QR.cooldown.keys.local);
      _ref = QR.cooldown.local;
      for (id in _ref) {
        cooldown = _ref[id];
        if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
          delete QR.cooldown.local[id];
        }
      }
      return QR.cooldown.save('local');
    },
    categorize: function(post) {
      if (post.thread === 'new') {
        return {
          type: 'thread'
        };
      } else {
        return {
          type: !!post.file ? 'image' : 'reply',
          threadID: +post.thread
        };
      }
    },
    set: function(scope, id, value) {
      $.forceSync(QR.cooldown.keys[scope]);
      QR.cooldown[scope][id] = value;
      return $.set(QR.cooldown.keys[scope], QR.cooldown[scope]);
    },
    save: function(scope) {
      if (Object.keys(QR.cooldown[scope]).length) {
        return $.set(QR.cooldown.keys[scope], QR.cooldown[scope]);
      } else {
        return $["delete"](QR.cooldown.keys[scope]);
      }
    },
    count: function() {
      var cooldown, elapsed, key, maxDelay, now, save, scope, seconds, start, suffix, threadID, type, update, _ref, _ref1, _ref2;
      now = Date.now();
      _ref = QR.cooldown.categorize(QR.posts[0]), type = _ref.type, threadID = _ref.threadID;
      seconds = 0;
      _ref1 = QR.cooldown.keys;
      for (scope in _ref1) {
        key = _ref1[scope];
        $.forceSync(key);
        save = false;
        _ref2 = QR.cooldown[scope];
        for (start in _ref2) {
          cooldown = _ref2[start];
          start = +start;
          elapsed = Math.floor((now - start) / $.SECOND);
          if (elapsed < 0) {
            delete QR.cooldown[scope][start];
            save = true;
            continue;
          }
          if (cooldown.delay != null) {
            if (cooldown.delay <= elapsed) {
              delete QR.cooldown[scope][start];
              save = true;
            } else if (cooldown.type === type && cooldown.threadID === threadID) {
              seconds = Math.max(seconds, cooldown.delay - elapsed);
            }
            continue;
          }
          maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread'];
          if (maxDelay <= elapsed) {
            delete QR.cooldown[scope][start];
            save = true;
            continue;
          }
          if ((type === 'thread') === (cooldown.threadID === cooldown.postID)) {
            suffix = scope === 'global' ? '_global' : type !== 'thread' && threadID === cooldown.threadID ? '_intra' : '';
            seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed);
          }
        }
        if (save) {
          QR.cooldown.save(scope);
        }
      }
      if (Object.keys(QR.cooldown.local).length + Object.keys(QR.cooldown.global).length) {
        clearTimeout(QR.cooldown.timeout);
        QR.cooldown.timeout = setTimeout(QR.cooldown.count, $.SECOND);
      } else {
        delete QR.cooldown.isCounting;
      }
      update = seconds !== QR.cooldown.seconds;
      QR.cooldown.seconds = seconds;
      if (update) {
        QR.status();
      }
      if (seconds === 0 && QR.cooldown.auto && !QR.req) {
        return QR.submit();
      }
    }
  };

  QR.persona = {
    pwd: '',
    always: {},
    init: function() {
      QR.persona.getPassword();
      return $.get('QR.personas', Conf['QR.personas'], function(_arg) {
        var arr, item, personas, type, types, _i, _len, _ref;
        personas = _arg['QR.personas'];
        types = {
          name: [],
          email: [],
          sub: []
        };
        _ref = personas.split('\n');
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          item = _ref[_i];
          QR.persona.parseItem(item.trim(), types);
        }
        for (type in types) {
          arr = types[type];
          QR.persona.loadPersonas(type, arr);
        }
      });
    },
    parseItem: function(item, types) {
      var boards, err, found, match, origthreadRegex, thread, threadRegex, threads, type, val, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4;
      if (item[0] === '#') {
        return;
      }
      if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) {
        return;
      }
      _ref = match, match = _ref[0], type = _ref[1], val = _ref[2];
      thread = g.threads["" + g.BOARD + "." + g.THREADID];
      item = item.replace(match, '');
      boards = ((_ref1 = item.match(/boards:([^;]+)/i)) != null ? _ref1[1].toLowerCase() : void 0) || 'global';
      if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) {
        return;
      }
      threads = ((_ref3 = item.match(/threads:([^;]+)/i)) != null ? _ref3[1] : void 0) || 'any';
      if (threads !== 'any' && g.VIEW === 'thread') {
        found = false;
        threadRegex = null;
        _ref4 = threads.split(',');
        for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
          origthreadRegex = _ref4[_i];
          if (origthreadRegex[0] === '/') {
            try {
              threadRegex = RegExp(origthreadRegex);
            } catch (_error) {
              err = _error;
              new Notice('warning', [$.tn("Invalid regular expression filter: " + origthreadRegex, $.el('br')), $.tn(err.message)], 60);
              continue;
            }
            if (threadRegex.test(thread.OP.info.subject)) {
              found = true;
              break;
            } else {

            }
          } else {
            if (__indexOf.call(thread.OP.info.subject, origthreadRegex) >= 0) {
              found = true;
              break;
            } else {

            }
          }
        }
        if (!found) {
          return;
        }
      }
      if (type === 'password') {
        QR.persona.pwd = val;
        return;
      }
      if (type === 'options') {
        type = 'email';
      }
      if (type === 'subject') {
        type = 'sub';
      }
      if (/always/i.test(item)) {
        QR.persona.always[type] = val;
      }
      if (__indexOf.call(types[type], val) < 0) {
        return types[type].push(val);
      }
    },
    loadPersonas: function(type, arr) {
      var list, val, _i, _len;
      list = $("#list-" + type, QR.nodes.el);
      for (_i = 0, _len = arr.length; _i < _len; _i++) {
        val = arr[_i];
        if (val) {
          $.add(list, $.el('option', {
            textContent: val
          }));
        }
      }
    },
    getPassword: function() {
      var input, m, _ref;
      if (!QR.persona.pwd) {
        QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : ((_ref = $.id('delPassword')) != null ? _ref.value : void 0) || '';
      }
      return QR.persona.pwd;
    },
    get: function(cb) {
      return $.get('QR.persona', {}, function(_arg) {
        var persona;
        persona = _arg['QR.persona'];
        return cb(persona);
      });
    },
    set: function(post) {
      return $.get('QR.persona', {}, function(_arg) {
        var persona;
        persona = _arg['QR.persona'];
        persona = {
          name: post.name,
          email: /^sage$/.test(post.email) ? persona.email : post.email,
          flag: post.flag
        };
        return $.set('QR.persona', persona);
      });
    }
  };

  QR.post = (function() {
    function _Class(select) {
      this.select = __bind(this.select, this);
      var el, event, prev, _i, _len, _ref;
      el = $.el('a', {
        className: 'qr-preview',
        draggable: true,
        href: 'javascript:;'
      });
      $.extend(el, {
        innerHTML: "<a class=\"remove fa\" title=\"Remove\"></a><label hidden><input type=\"checkbox\"> Spoiler</label><span></span>"
      });
      this.nodes = {
        el: el,
        rm: el.firstChild,
        label: $('label', el),
        spoiler: $('input', el),
        span: el.lastChild
      };
      $.on(el, 'click', this.select);
      $.on(this.nodes.rm, 'click', (function(_this) {
        return function(e) {
          e.stopPropagation();
          return _this.rm();
        };
      })(this));
      $.on(this.nodes.label, 'click', (function(_this) {
        return function(e) {
          return e.stopPropagation();
        };
      })(this));
      $.on(this.nodes.spoiler, 'change', (function(_this) {
        return function(e) {
          _this.spoiler = e.target.checked;
          if (_this === QR.selected) {
            return QR.nodes.spoiler.checked = _this.spoiler;
          }
        };
      })(this));
      $.add(QR.nodes.dumpList, el);
      _ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        event = _ref[_i];
        $.on(el, event.toLowerCase(), this[event]);
      }
      this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
      prev = QR.posts[QR.posts.length - 1];
      QR.posts.push(this);
      this.nodes.spoiler.checked = this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false;
      QR.persona.get((function(_this) {
        return function(persona) {
          _this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name;
          _this.email = 'email' in QR.persona.always ? QR.persona.always.email : prev && !/^sage$/.test(prev.email) ? prev.email : persona.email;
          _this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : '';
          if (QR.nodes.flag) {
            _this.flag = prev ? prev.flag : persona.flag;
          }
          if (QR.selected === _this) {
            return _this.load();
          }
        };
      })(this));
      if (select) {
        this.select();
      }
      this.unlock();
      $.queueTask(function() {
        return QR.captcha.onNewPost();
      });
    }

    _Class.prototype.rm = function() {
      var index;
      this["delete"]();
      index = QR.posts.indexOf(this);
      if (QR.posts.length === 1) {
        new QR.post(true);
        $.rmClass(QR.nodes.el, 'dump');
      } else if (this === QR.selected) {
        (QR.posts[index - 1] || QR.posts[index + 1]).select();
      }
      QR.posts.splice(index, 1);
      return QR.status();
    };

    _Class.prototype["delete"] = function() {
      $.rm(this.nodes.el);
      return URL.revokeObjectURL(this.URL);
    };

    _Class.prototype.lock = function(lock) {
      var name, node, _i, _len, _ref;
      if (lock == null) {
        lock = true;
      }
      this.isLocked = lock;
      if (this !== QR.selected) {
        return;
      }
      _ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler', 'flag'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        name = _ref[_i];
        if (node = QR.nodes[name]) {
          node.disabled = lock;
        }
      }
      this.nodes.rm.style.visibility = lock ? 'hidden' : '';
      (lock ? $.off : $.on)(QR.nodes.filename.previousElementSibling, 'click', QR.openFileInput);
      this.nodes.spoiler.disabled = lock;
      return this.nodes.el.draggable = !lock;
    };

    _Class.prototype.unlock = function() {
      return this.lock(false);
    };

    _Class.prototype.select = function() {
      var rectEl, rectList;
      if (QR.selected) {
        QR.selected.nodes.el.id = null;
        QR.selected.forceSave();
      }
      QR.selected = this;
      this.lock(this.isLocked);
      this.nodes.el.id = 'selected';
      rectEl = this.nodes.el.getBoundingClientRect();
      rectList = this.nodes.el.parentNode.getBoundingClientRect();
      this.nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2;
      return this.load();
    };

    _Class.prototype.load = function() {
      var name, node, _i, _len, _ref;
      _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        name = _ref[_i];
        if (!(node = QR.nodes[name])) {
          continue;
        }
        node.value = this[name] || node.dataset["default"] || null;
      }
      QR.tripcodeHider.call(QR.nodes['name']);
      (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
      this.showFileData();
      return QR.characterCount();
    };

    _Class.prototype.save = function(input) {
      var name, _ref;
      if (input.type === 'checkbox') {
        this.spoiler = input.checked;
        return;
      }
      name = input.dataset.name;
      this[name] = input.value || input.dataset["default"] || null;
      switch (name) {
        case 'thread':
          (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
          return QR.status();
        case 'com':
          this.nodes.span.textContent = this.com;
          QR.captcha.onPostChange();
          QR.characterCount();
          if (QR.cooldown.auto && this === QR.posts[0] && (0 < (_ref = QR.cooldown.seconds) && _ref <= 5)) {
            return QR.cooldown.auto = false;
          }
          break;
        case 'filename':
          if (!this.file) {
            return;
          }
          this.file.newName = this.filename.replace(/[/\\]/g, '-');
          if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) {
            this.file.newName += '.jpg';
          }
          return this.updateFilename();
      }
    };

    _Class.prototype.forceSave = function() {
      var name, node, _i, _len, _ref;
      if (this !== QR.selected) {
        return;
      }
      _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler', 'flag'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        name = _ref[_i];
        if (!(node = QR.nodes[name])) {
          continue;
        }
        this.save(node);
      }
    };

    _Class.prototype.setFile = function(file) {
      this.file = file;
      this.filename = file.name;
      this.filesize = $.bytesToString(file.size);
      if (QR.spoiler) {
        this.nodes.label.hidden = false;
      }
      QR.captcha.onPostChange();
      URL.revokeObjectURL(this.URL);
      if (this === QR.selected) {
        this.showFileData();
      } else {
        this.updateFilename();
      }
      if (!/^(image|video)\//.test(file.type)) {
        this.nodes.el.style.backgroundImage = null;
        return;
      }
      return this.setThumbnail();
    };

    _Class.prototype.setThumbnail = function() {
      var el, fileURL, isVideo;
      isVideo = /^video\//.test(this.file.type);
      el = $.el((isVideo ? 'video' : 'img'));
      $.on(el, (isVideo ? 'loadeddata' : 'load'), (function(_this) {
        return function() {
          var cv, error, errors, height, s, width, _i, _len;
          errors = _this.checkDimensions(el, isVideo);
          if (errors.length) {
            for (_i = 0, _len = errors.length; _i < _len; _i++) {
              error = errors[_i];
              QR.error(error);
            }
            _this.URL = fileURL;
            if ((QR.posts.length === 1) || (_this.com && _this.com.length)) {
              return _this.rmFile();
            } else {
              return _this.rm();
            }
          }
          s = 90 * 2 * window.devicePixelRatio;
          if (_this.file.type === 'image/gif') {
            s *= 3;
          }
          if (isVideo) {
            height = el.videoHeight;
            width = el.videoWidth;
          } else {
            height = el.height, width = el.width;
            if (height < s || width < s) {
              _this.URL = fileURL;
              _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")";
              return;
            }
          }
          if (height <= width) {
            width = s / height * width;
            height = s;
          } else {
            height = s / width * height;
            width = s;
          }
          cv = $.el('canvas');
          cv.height = el.height = height;
          cv.width = el.width = width;
          cv.getContext('2d').drawImage(el, 0, 0, width, height);
          URL.revokeObjectURL(fileURL);
          return cv.toBlob(function(blob) {
            _this.URL = URL.createObjectURL(blob);
            return _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")";
          });
        };
      })(this));
      fileURL = URL.createObjectURL(this.file);
      return el.src = fileURL;
    };

    _Class.prototype.checkDimensions = function(el, video) {
      var duration, err, height, max_height, max_width, videoHeight, videoWidth, width;
      err = [];
      if (video) {
        videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration;
        max_height = QR.max_height < QR.max_height_video ? QR.max_height : QR.max_height_video;
        max_width = QR.max_width < QR.max_width_video ? QR.max_width : QR.max_width_video;
        if (videoHeight > max_height || videoWidth > max_width) {
          err.push("" + this.file.name + ": Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
        }
        if (videoHeight < QR.min_height || videoWidth < QR.min_width) {
          err.push("" + this.file.name + ": Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
        }
        if (!isFinite(el.duration)) {
          err.push("" + file.name + ": Video lacks duration metadata (try remuxing)");
        }
        if (g.BOARD.ID === 'wsg' || g.BOARD.ID === 'gif') {
          if (duration > QR.max_duration_video_alt) {
            err.push("" + this.file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video_alt + "s)");
          }
        } else {
          if (duration > QR.max_duration_video) {
            err.push("" + this.file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
          }
        }
        if (el.mozHasAudio) {
          err.push("" + file.name + ": Audio not allowed");
        }
      } else {
        height = el.height, width = el.width;
        if (height > QR.max_height || width > QR.max_width) {
          err.push("" + this.file.name + ": Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
        }
        if (height < QR.min_height || width < QR.min_width) {
          err.push("" + this.file.name + ": Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
        }
      }
      return err;
    };

    _Class.prototype.rmFile = function() {
      if (this.isLocked) {
        return;
      }
      delete this.file;
      delete this.filename;
      delete this.filesize;
      this.nodes.el.title = null;
      QR.nodes.fileContainer.title = '';
      this.nodes.el.style.backgroundImage = null;
      if (QR.spoiler) {
        this.nodes.label.hidden = true;
      }
      this.showFileData();
      return URL.revokeObjectURL(this.URL);
    };

    _Class.prototype.updateFilename = function() {
      var long;
      long = "" + this.filename + " (" + this.filesize + ")\nCtrl/\u2318+click to edit filename. Shift+click to clear.";
      this.nodes.el.title = long;
      if (this !== QR.selected) {
        return;
      }
      return QR.nodes.fileContainer.title = long;
    };

    _Class.prototype.showFileData = function() {
      if (this.file) {
        this.updateFilename();
        QR.nodes.filename.value = this.filename;
        QR.nodes.spoiler.checked = this.spoiler;
        return $.addClass(QR.nodes.fileSubmit, 'has-file');
      } else {
        return $.rmClass(QR.nodes.fileSubmit, 'has-file');
      }
    };

    _Class.prototype.pasteText = function(file) {
      var reader;
      reader = new FileReader();
      reader.onload = (function(_this) {
        return function(e) {
          var text;
          text = e.target.result;
          if (_this.com) {
            _this.com += "\n" + text;
          } else {
            _this.com = text;
          }
          if (QR.selected === _this) {
            QR.nodes.com.value = _this.com;
          }
          return _this.nodes.span.textContent = _this.com;
        };
      })(this);
      return reader.readAsText(file);
    };

    _Class.prototype.dragStart = function(e) {
      e.dataTransfer.setDragImage(this, e.layerX, e.layerY);
      return $.addClass(this, 'drag');
    };

    _Class.prototype.dragEnd = function() {
      return $.rmClass(this, 'drag');
    };

    _Class.prototype.dragEnter = function() {
      return $.addClass(this, 'over');
    };

    _Class.prototype.dragLeave = function() {
      return $.rmClass(this, 'over');
    };

    _Class.prototype.dragOver = function(e) {
      e.preventDefault();
      return e.dataTransfer.dropEffect = 'move';
    };

    _Class.prototype.drop = function() {
      var el, index, newIndex, oldIndex, post;
      $.rmClass(this, 'over');
      if (!this.draggable) {
        return;
      }
      el = $('.drag', this.parentNode);
      index = function(el) {
        return __slice.call(el.parentNode.children).indexOf(el);
      };
      oldIndex = index(el);
      newIndex = index(this);
      (oldIndex < newIndex ? $.after : $.before)(this, el);
      post = QR.posts.splice(oldIndex, 1)[0];
      QR.posts.splice(newIndex, 0, post);
      return QR.status();
    };

    return _Class;

  })();

  FappeTyme = {
    init: function() {
      var el, lc, type, _i, _len, _ref, _ref1;
      if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
        return;
      }
      _ref1 = ["Fappe", "Werk"];
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        type = _ref1[_i];
        if (!Conf["" + type + " Tyme"]) {
          continue;
        }
        lc = type.toLowerCase();
        FappeTyme[lc] = el = $.el('a', {
          href: 'javascript:;',
          id: "" + lc + "Tyme",
          title: "" + type + " Tyme",
          className: 'a-icon'
        });
        if (type === 'Werk') {
          el.textContent = '\uf0b1';
          el.className = 'fa';
        }
        $.on(el, 'click', FappeTyme.cb.toggle.bind({
          name: "" + lc
        }));
        Header.addShortcut(el, true);
        FappeTyme.cb.set(lc);
      }
      return Post.callbacks.push({
        name: 'Fappe Tyme',
        cb: this.node
      });
    },
    node: function() {
      if (this.file) {
        return;
      }
      return $.addClass(this.nodes.root, "noFile");
    },
    cb: {
      set: function(type) {
        return $["" + (Conf[type] ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme");
      },
      toggle: function() {
        Conf[this.name] = !Conf[this.name];
        FappeTyme.cb.set(this.name);
        return $.cb.checked.call({
          name: this.name,
          checked: Conf[this.name]
        });
      }
    }
  };

  Gallery = {
    init: function() {
      var el, _ref;
      if (!(this.enabled = Conf['Gallery'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
        return;
      }
      this.delay = Conf['Slide Delay'];
      el = $.el('a', {
        href: 'javascript:;',
        id: 'appchan-gal',
        title: 'Gallery',
        className: 'fa',
        textContent: '\uf03e'
      });
      $.on(el, 'click', this.cb.toggle);
      Header.addShortcut(el, true);
      return Post.callbacks.push({
        name: 'Gallery',
        cb: this.node
      });
    },
    node: function() {
      if (!this.file) {
        return;
      }
      if (Gallery.nodes) {
        Gallery.generateThumb(this);
        Gallery.nodes.total.textContent = Gallery.images.length;
      }
      if (!Conf['Image Expansion']) {
        return $.on(this.file.thumb.parentNode, 'click', Gallery.cb.image);
      }
    },
    build: function(image) {
      var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, thumb, value, _i, _j, _len, _len1, _ref, _ref1, _ref2;
      if (Conf['Fullscreen Gallery']) {
        $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
          return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
        });
        if (typeof doc.mozRequestFullScreen === "function") {
          doc.mozRequestFullScreen();
        }
        if (typeof doc.webkitRequestFullScreen === "function") {
          doc.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
        }
      }
      Gallery.images = [];
      nodes = Gallery.nodes = {};
      Gallery.fullIDs = {};
      Gallery.slideshow = false;
      nodes.el = dialog = $.el('div', {
        id: 'a-gallery'
      });
      $.extend(dialog, {
        innerHTML: "<div class=\"gal-viewport\"><span class=\"gal-buttons\"><a href=\"javascript:;\" class=\"gal-start\" title=\"Start slideshow (S to toggle)\"><i class=\"fa\">\uf04b</i></a><a href=\"javascript:;\" class=\"gal-stop\"  title=\"Stop slideshow (S to toggle)\"><i class=\"fa\">\uf04d</i></a><a href=\"javascript:;\" class=\"menu-button\"><i class=\"fa\">\uf107</i></a><a href=\"javascript:;\" class=\"gal-close\"><i class=\"fa\">\uf00d</i></a></span><a class=\"gal-name\" target=\"_blank\"></a><span class=\"gal-count\"><span class=\"count\"></span> / <span class=\"total\"></span></span><div class=\"gal-prev\"></div><div class=\"gal-image\"><a href=\"javascript:;\"><img></a></div><div class=\"gal-next\"></div></div><div class=\"gal-thumbnails\"></div>"
      });
      _ref = {
        buttons: '.gal-buttons',
        frame: '.gal-image',
        name: '.gal-name',
        count: '.count',
        total: '.total',
        thumbs: '.gal-thumbnails',
        next: '.gal-image a',
        current: '.gal-image img'
      };
      for (key in _ref) {
        value = _ref[key];
        nodes[key] = $(value, dialog);
      }
      menuButton = $('.menu-button', dialog);
      nodes.menu = new UI.Menu('gallery');
      cb = Gallery.cb;
      $.on(nodes.frame, 'click', cb.blank);
      $.on(nodes.next, 'click', cb.click);
      $.on(nodes.name, 'click', ImageCommon.download);
      $.on($('.gal-prev', dialog), 'click', cb.prev);
      $.on($('.gal-next', dialog), 'click', cb.next);
      $.on($('.gal-start', dialog), 'click', cb.start);
      $.on($('.gal-stop', dialog), 'click', cb.stop);
      $.on($('.gal-close', dialog), 'click', cb.close);
      $.on(menuButton, 'click', function(e) {
        return nodes.menu.toggle(e, this, g);
      });
      _ref1 = Gallery.menu.createSubEntries();
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        entry = _ref1[_i];
        entry.order = 0;
        nodes.menu.addEntry(entry);
      }
      $.on(d, 'keydown', cb.keybinds);
      if (Conf['Keybinds']) {
        $.off(d, 'keydown', Keybinds.keydown);
      }
      _ref2 = $$('.post .file');
      for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
        file = _ref2[_j];
        post = Get.postFromNode(file);
        if (!post.file || post.file.isDead) {
          continue;
        }
        Gallery.generateThumb(post);
        if (!image && Gallery.fullIDs[post.fullID]) {
          candidate = post.file.thumb.parentNode;
          if (Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0) {
            image = candidate;
          }
        }
      }
      $.addClass(doc, 'gallery-open');
      $.add(d.body, dialog);
      nodes.thumbs.scrollTop = 0;
      nodes.current.parentElement.scrollTop = 0;
      if (image) {
        thumb = $("[href='" + image.href + "']", nodes.thumbs);
      }
      thumb || (thumb = Gallery.images[Gallery.images.length - 1]);
      if (thumb) {
        Gallery.open(thumb);
      }
      doc.style.overflow = 'hidden';
      return nodes.total.textContent = Gallery.images.length;
    },
    generateThumb: function(post) {
      var thumb, thumbImg, _ref, _ref1;
      if (post.isClone || post.isHidden && !(((_ref = post.file) != null ? _ref.isImage : void 0) || ((_ref1 = post.file) != null ? _ref1.isVideo : void 0) || Conf['PDF in Gallery'])) {
        return;
      }
      Gallery.fullIDs[post.fullID] = true;
      thumb = $.el('a', {
        className: 'gal-thumb',
        href: post.file.URL,
        target: '_blank',
        title: post.file.name
      });
      thumb.dataset.id = Gallery.images.length;
      thumb.dataset.post = post.fullID;
      thumbImg = post.file.thumb.cloneNode(false);
      thumbImg.style.cssText = '';
      $.add(thumb, thumbImg);
      $.on(thumb, 'click', Gallery.cb.open);
      Gallery.images.push(thumb);
      return $.add(Gallery.nodes.thumbs, thumb);
    },
    open: function(thumb) {
      var el, elType, file, name, newID, nodes, oldID, post, slideshow, _base, _ref;
      nodes = Gallery.nodes;
      name = nodes.name;
      oldID = +nodes.current.dataset.id;
      newID = +thumb.dataset.id;
      slideshow = Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0));
      if (el = $('.gal-highlight', nodes.thumbs)) {
        $.rmClass(el, 'gal-highlight');
      }
      $.addClass(thumb, 'gal-highlight');
      elType = /\.webm$/.test(thumb.href) ? 'video' : /\.pdf$/.test(thumb.href) ? 'iframe' : 'img';
      $[elType === 'iframe' ? 'addClass' : 'rmClass'](doc, 'gal-pdf');
      file = $.el(elType, {
        title: name.download = name.textContent = thumb.title
      });
      $.on(file, 'error', (function(_this) {
        return function() {
          return Gallery.error(file, thumb);
        };
      })(this));
      file.src = name.href = thumb.href;
      $.extend(file.dataset, thumb.dataset);
      if (!nodes.current.error) {
        if (typeof (_base = nodes.current).pause === "function") {
          _base.pause();
        }
      }
      $.replace(nodes.current, file);
      if (elType === 'video') {
        file.loop = true;
        if (Conf['Autoplay']) {
          file.play();
        }
        if (Conf['Show Controls']) {
          ImageCommon.addControls(file);
        }
      }
      nodes.count.textContent = +thumb.dataset.id + 1;
      nodes.current = file;
      nodes.frame.scrollTop = 0;
      nodes.next.focus();
      if (slideshow) {
        Gallery.setupTimer();
      } else {
        Gallery.cb.stop();
      }
      if (Conf['Scroll to Post'] && (post = (_ref = (post = g.posts[file.dataset.post])) != null ? _ref.nodes.root : void 0)) {
        Header.scrollTo(post);
      }
      return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
    },
    error: function(file, thumb) {
      var _ref;
      if (((_ref = file.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
        return new Notice('error', 'Corrupt or unplayable video', 30);
      }
      if (file.src.split('/')[2] !== 'i.4cdn.org') {
        return;
      }
      return ImageCommon.error(file, g.posts[file.dataset.post], null, function(URL) {
        if (!URL) {
          return;
        }
        thumb.href = URL;
        if (Gallery.nodes.current === file) {
          return file.src = URL;
        }
      });
    },
    cleanupTimer: function() {
      var current;
      clearTimeout(Gallery.timeoutID);
      current = Gallery.nodes.current;
      $.off(current, 'canplaythrough load', Gallery.startTimer);
      return $.off(current, 'ended', Gallery.cb.next);
    },
    startTimer: function() {
      return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * $.SECOND);
    },
    setupTimer: function() {
      var current, isVideo;
      Gallery.cleanupTimer();
      current = Gallery.nodes.current;
      isVideo = current.nodeName === 'VIDEO';
      if (isVideo) {
        current.play();
      }
      if ((isVideo ? current.readyState >= 4 : current.complete) || current.nodeName === 'IFRAME') {
        return Gallery.startTimer();
      } else {
        return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer);
      }
    },
    checkTimer: function() {
      var current;
      current = Gallery.nodes.current;
      if (current.nodeName === 'VIDEO' && !current.paused) {
        $.on(current, 'ended', Gallery.cb.next);
        return current.loop = false;
      } else {
        return Gallery.cb.next();
      }
    },
    cb: {
      keybinds: function(e) {
        var cb, key;
        if (!(key = Keybinds.keyCode(e))) {
          return;
        }
        cb = (function() {
          switch (key) {
            case Conf['Close']:
            case Conf['Open Gallery']:
              return Gallery.cb.close;
            case 'Right':
              return Gallery.cb.next;
            case 'Enter':
              return Gallery.cb.enterKey;
            case 'Left':
            case '':
              return Gallery.cb.prev;
            case Conf['Pause']:
              return Gallery.cb.pause;
            case Conf['Slideshow']:
              return Gallery.cb.toggleSlideshow;
          }
        })();
        if (!cb) {
          return;
        }
        e.stopPropagation();
        e.preventDefault();
        return cb();
      },
      open: function(e) {
        if (e) {
          e.preventDefault();
        }
        if (this) {
          return Gallery.open(this);
        }
      },
      image: function(e) {
        e.preventDefault();
        e.stopPropagation();
        return Gallery.build(this);
      },
      prev: function() {
        return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]);
      },
      next: function() {
        return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]);
      },
      enterKey: function() {
        if (Gallery.nodes.current.paused) {
          return Gallery.nodes.current.play();
        } else {
          return Gallery.cb.next();
        }
      },
      click: function() {
        return Gallery.cb[Gallery.nodes.current.controls ? 'stop' : 'enterKey']();
      },
      toggle: function() {
        return (Gallery.nodes ? Gallery.cb.close : Gallery.build)();
      },
      blank: function(e) {
        if (e.target === this) {
          return Gallery.cb.close();
        }
      },
      toggleSlideshow: function() {
        return Gallery.cb[Gallery.slideshow ? 'stop' : 'start']();
      },
      pause: function() {
        var current;
        Gallery.cb.stop();
        current = Gallery.nodes.current;
        if (current.nodeName === 'VIDEO') {
          return current[current.paused ? 'play' : 'pause']();
        }
      },
      start: function() {
        $.addClass(Gallery.nodes.buttons, 'gal-playing');
        Gallery.slideshow = true;
        return Gallery.setupTimer();
      },
      stop: function() {
        var current;
        if (!Gallery.slideshow) {
          return;
        }
        Gallery.cleanupTimer();
        current = Gallery.nodes.current;
        if (current.nodeName === 'VIDEO') {
          current.loop = true;
        }
        $.rmClass(Gallery.nodes.buttons, 'gal-playing');
        return Gallery.slideshow = false;
      },
      close: function() {
        var _base;
        if (typeof (_base = Gallery.nodes.current).pause === "function") {
          _base.pause();
        }
        $.rm(Gallery.nodes.el);
        $.rmClass(doc, 'gallery-open');
        if (Conf['Fullscreen Gallery']) {
          $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close);
          if (typeof d.mozCancelFullScreen === "function") {
            d.mozCancelFullScreen();
          }
          if (typeof d.webkitExitFullscreen === "function") {
            d.webkitExitFullscreen();
          }
        }
        delete Gallery.nodes;
        delete Gallery.fullIDs;
        doc.style.overflow = '';
        $.off(d, 'keydown', Gallery.cb.keybinds);
        if (Conf['Keybinds']) {
          $.on(d, 'keydown', Keybinds.keydown);
        }
        return clearTimeout(Gallery.timeoutID);
      },
      setFitness: function() {
        return (this.checked ? $.addClass : $.rmClass)(doc, "gal-" + (this.name.toLowerCase().replace(/\s+/g, '-')));
      },
      setDelay: function() {
        return Gallery.delay = +this.value;
      }
    },
    menu: {
      init: function() {
        var el;
        if (!Gallery.enabled) {
          return;
        }
        el = $.el('span', {
          textContent: 'Gallery',
          className: 'gallery-link'
        });
        return Header.menu.addEntry({
          el: el,
          order: 105,
          subEntries: Gallery.menu.createSubEntries()
        });
      },
      createSubEntry: function(name) {
        var input, label;
        label = $.el('label', {
          innerHTML: "<input type=checkbox name='" + name + "'> " + name
        });
        input = label.firstElementChild;
        if (name === 'Fit Width' || name === 'Fit Height' || name === 'Hide Thumbnails') {
          $.on(input, 'change', Gallery.cb.setFitness);
        }
        input.checked = Conf[name];
        $.event('change', null, input);
        $.on(input, 'change', $.cb.checked);
        return {
          el: label
        };
      },
      createSubEntries: function() {
        var delayInput, delayLabel, item, subEntries;
        subEntries = (function() {
          var _i, _len, _ref, _results;
          _ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Scroll to Post'];
          _results = [];
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            item = _ref[_i];
            _results.push(Gallery.menu.createSubEntry(item));
          }
          return _results;
        })();
        delayLabel = $.el('label', {
          innerHTML: "Slide Delay: <input type=\"number\" name=\"Slide Delay\" min=\"0\" step=\"any\" class=\"field\">"
        });
        delayInput = delayLabel.firstElementChild;
        delayInput.value = Gallery.delay;
        $.on(delayInput, 'change', Gallery.cb.setDelay);
        $.on(delayInput, 'change', $.cb.value);
        subEntries.push({
          el: delayLabel
        });
        return subEntries;
      }
    }
  };

  ImageCommon = {
    rewind: function(el) {
      if (el.nodeName === 'VIDEO') {
        if (el.readyState >= el.HAVE_METADATA) {
          return el.currentTime = 0;
        }
      } else if (/\.gif$/.test(el.src)) {
        return $.queueTask(function() {
          return el.src = el.src;
        });
      }
    },
    pushCache: function(el) {
      ImageCommon.cache = el;
      return $.on(el, 'error', ImageCommon.cacheError);
    },
    popCache: function() {
      var el;
      el = ImageCommon.cache;
      $.off(el, 'error', ImageCommon.cacheError);
      delete ImageCommon.cache;
      return el;
    },
    cacheError: function() {
      if (ImageCommon.cache === this) {
        return delete ImageCommon.cache;
      }
    },
    decodeError: function(file, post) {
      var message, _ref;
      if (((_ref = file.error) != null ? _ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
        return false;
      }
      if (!(message = $('.warning', post.file.thumb.parentNode))) {
        message = $.el('div', {
          className: 'warning'
        });
        $.after(post.file.thumb, message);
      }
      message.textContent = 'Error: Corrupt or unplayable video';
      return true;
    },
    error: function(file, post, delay, cb) {
      var URL, redirect, src, timeoutID;
      src = post.file.URL.split('/');
      URL = Redirect.to('file', {
        boardID: post.board.ID,
        filename: src[src.length - 1]
      });
      if (!(Conf['404 Redirect'] && URL && Redirect.securityCheck(URL))) {
        URL = null;
      }
      if ((post.isDead || post.file.isDead) && file.src.split('/')[2] === 'i.4cdn.org') {
        return cb(URL);
      }
      if (delay != null) {
        timeoutID = setTimeout((function() {
          return cb(URL);
        }), delay);
      }
      if (post.isDead || post.file.isDead) {
        return;
      }
      redirect = function() {
        if (file.src.split('/')[2] === 'i.4cdn.org') {
          if (delay != null) {
            clearTimeout(timeoutID);
          }
          return cb(URL);
        }
      };
      return $.ajax("//a.4cdn.org/" + post.board + "/thread/" + post.thread + ".json", {
        onload: function() {
          var postObj, _i, _len, _ref;
          if (this.status === 404) {
            post.kill();
          }
          if (this.status !== 200) {
            return redirect();
          }
          _ref = 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) {
            post.kill();
            return redirect();
          } else if (postObj.filedeleted) {
            post.kill(true);
            return redirect();
          } else {
            return URL = post.file.URL;
          }
        }
      });
    },
    addControls: function(video) {
      var handler;
      handler = function() {
        var t;
        $.off(video, 'mouseover', handler);
        t = new Date().getTime();
        return $.asap((function() {
          return (typeof chrome !== "undefined" && chrome !== null) || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000;
        }), function() {
          return video.controls = true;
        });
      };
      return $.on(video, 'mouseover', handler);
    },
    download: function(e) {
      if (this.protocol === 'blob:') {
        return true;
      }
      e.preventDefault();
      return CrossOrigin.file(this.href, (function(_this) {
        return function(blob) {
          if (blob) {
            _this.href = URL.createObjectURL(blob);
            return _this.click();
          } else {
            return new Notice('error', "Could not download " + _this.href, 30);
          }
        };
      })(this));
    }
  };

  ImageExpand = {
    init: function() {
      var _ref;
      if (!(this.enabled = Conf['Image Expansion'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
        return;
      }
      this.EAI = $.el('a', {
        id: 'img-controls',
        className: 'expand-all-shortcut a-icon',
        title: 'Expand All Images',
        href: 'javascript:;'
      });
      $.on(this.EAI, 'click', ImageExpand.cb.toggleAll);
      $.on(d, 'scroll visibilitychange', this.cb.playVideos);
      this.videoControls = $.el('span', {
        className: 'video-controls'
      });
      $.extend(this.videoControls, {
        innerHTML: " <a href=\"javascript:;\" title=\"You can also contract the video by dragging it to the left.\">contract</a>"
      });
      Header.addShortcut(this.EAI, true);
      return Post.callbacks.push({
        name: 'Image Expansion',
        cb: this.node
      });
    },
    node: function() {
      var _ref;
      if (!(this.file && (this.file.isImage || this.file.isVideo))) {
        return;
      }
      $.on(this.file.thumb.parentNode, 'click', ImageExpand.cb.toggle);
      if (this.isClone) {
        if (this.file.isExpanding) {
          ImageExpand.contract(this);
          return ImageExpand.expand(this);
        } else if (this.file.isExpanded && this.file.isVideo) {
          ImageExpand.setupVideoCB(this);
          return ImageExpand.setupVideo(this, !((_ref = this.origin.file.fullImage) != null ? _ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
        }
      } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) {
        return ImageExpand.expand(this);
      }
    },
    cb: {
      toggle: function(e) {
        var file, post;
        if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
          return;
        }
        post = Get.postFromNode(this);
        file = post.file;
        if (file.isExpanded && file.isVideo && file.fullImage.controls) {
          return;
        }
        e.preventDefault();
        return ImageExpand.toggle(post);
      },
      toggleAll: function() {
        var func, toggle;
        $.event('CloseMenu');
        toggle = function(post) {
          var file;
          file = post.file;
          if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
            return;
          }
          if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || !Conf['Expand videos'] && file.isVideo || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
            return;
          }
          return $.queueTask(func, post);
        };
        if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) {
          ImageExpand.EAI.className = 'contract-all-shortcut a-icon';
          ImageExpand.EAI.title = 'Contract All Images';
          func = ImageExpand.expand;
        } else {
          ImageExpand.EAI.className = 'expand-all-shortcut a-icon';
          ImageExpand.EAI.title = 'Expand All Images';
          func = ImageExpand.contract;
        }
        return g.posts.forEach(function(post) {
          var _i, _len, _ref;
          _ref = [post].concat(__slice.call(post.clones));
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            post = _ref[_i];
            toggle(post);
          }
        });
      },
      playVideos: function(e) {
        return g.posts.forEach(function(post) {
          var file, video, visible, _i, _len, _ref;
          _ref = [post].concat(__slice.call(post.clones));
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            post = _ref[_i];
            file = post.file;
            if (!(file && file.isVideo && file.isExpanded)) {
              continue;
            }
            video = file.fullImage;
            visible = Header.isNodeVisible(video);
            if (visible && file.wasPlaying) {
              delete file.wasPlaying;
              video.play();
            } else if (!visible && !video.paused) {
              file.wasPlaying = true;
              video.pause();
            }
          }
        });
      },
      setFitness: function() {
        return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\s+/g, '-'));
      }
    },
    toggle: function(post) {
      var next;
      if (!(post.file.isExpanding || post.file.isExpanded)) {
        post.file.scrollIntoView = Conf['Scroll into view'];
        ImageExpand.expand(post);
        return;
      }
      ImageExpand.contract(post);
      if (Conf['Advance on contract']) {
        next = post.nodes.root;
        while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
          if (!($('.stub', next) || next.offsetHeight === 0)) {
            break;
          }
        }
        if (next) {
          return Header.scrollTo(next);
        }
      }
    },
    contract: function(post) {
      var bottom, cb, el, eventName, file, oldHeight, scrollY, top, x, _i, _len, _ref, _ref1;
      file = post.file;
      if (el = file.fullImage) {
        top = Header.getTopOf(el);
        bottom = top + el.getBoundingClientRect().height;
        oldHeight = d.body.clientHeight;
        scrollY = window.scrollY;
      }
      $.rmClass(post.nodes.root, 'expanded-image');
      $.rmClass(file.thumb, 'expanding');
      if (file.videoControls) {
        $.rm(file.videoControls);
      }
      file.thumb.parentNode.href = file.URL;
      file.thumb.parentNode.target = '_blank';
      _ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        x = _ref[_i];
        delete file[x];
      }
      if (!el) {
        return;
      }
      if (doc.contains(el)) {
        if (bottom <= 0) {
          window.scroll(0, scrollY + d.body.clientHeight - oldHeight);
        } else {
          Header.scrollToIfNeeded(post.nodes.root);
        }
        if (window.scrollX > 0) {
          window.scroll(0, window.scrollY);
        }
      }
      $.off(el, 'error', ImageExpand.error);
      ImageCommon.pushCache(el);
      if (file.isVideo) {
        el.pause();
        _ref1 = ImageExpand.videoCB;
        for (eventName in _ref1) {
          cb = _ref1[eventName];
          $.off(el, eventName, cb);
        }
      }
      if (Conf['Restart when Opened']) {
        ImageCommon.rewind(file.thumb);
      }
      delete file.fullImage;
      return $.queueTask(function() {
        if (file.isExpanding || file.isExpanded) {
          return;
        }
        $.rmClass(el, 'full-image');
        if (el.id) {
          return;
        }
        return $.rm(el);
      });
    },
    expand: function(post, src) {
      var el, file, isVideo, thumb, _ref;
      file = post.file;
      thumb = file.thumb, isVideo = file.isVideo;
      if (post.isHidden || file.isExpanding || file.isExpanded) {
        return;
      }
      $.addClass(thumb, 'expanding');
      file.isExpanding = true;
      if (file.fullImage) {
        el = file.fullImage;
      } else if (((_ref = ImageCommon.cache) != null ? _ref.dataset.fullID : void 0) === post.fullID) {
        el = file.fullImage = ImageCommon.popCache();
        $.on(el, 'error', ImageExpand.error);
        if (Conf['Restart when Opened'] && el.id !== 'ihover') {
          ImageCommon.rewind(el);
        }
        el.removeAttribute('id');
      } else {
        el = file.fullImage = $.el((isVideo ? 'video' : 'img'));
        el.dataset.fullID = post.fullID;
        $.on(el, 'error', ImageExpand.error);
        el.src = src || file.URL;
      }
      el.className = 'full-image';
      $.after(thumb, el);
      if (isVideo) {
        if (Conf['Show Controls'] && !file.videoControls) {
          file.videoControls = ImageExpand.videoControls.cloneNode(true);
          $.add(file.text, file.videoControls);
        }
        thumb.parentNode.removeAttribute('href');
        thumb.parentNode.removeAttribute('target');
        el.loop = true;
        ImageExpand.setupVideoCB(post);
      }
      if (!isVideo) {
        return $.asap((function() {
          return el.naturalHeight;
        }), function() {
          return ImageExpand.completeExpand(post);
        });
      } else if (el.readyState >= el.HAVE_METADATA) {
        return ImageExpand.completeExpand(post);
      } else {
        return $.on(el, 'loadedmetadata', function() {
          return ImageExpand.completeExpand(post);
        });
      }
    },
    completeExpand: function(post) {
      var bottom, file, imageBottom, oldHeight, scrollY;
      file = post.file;
      if (!file.isExpanding) {
        return;
      }
      bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height;
      oldHeight = d.body.clientHeight;
      scrollY = window.scrollY;
      $.addClass(post.nodes.root, 'expanded-image');
      $.rmClass(file.thumb, 'expanding');
      file.isExpanded = true;
      delete file.isExpanding;
      if (doc.contains(post.nodes.root) && bottom <= 0) {
        window.scroll(window.scrollX, scrollY + d.body.clientHeight - oldHeight);
      }
      if (file.scrollIntoView) {
        delete file.scrollIntoView;
        imageBottom = Header.getBottomOf(file.fullImage) - 25;
        if (imageBottom < 0) {
          window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage)));
        }
      }
      if (file.isVideo) {
        return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']);
      }
    },
    setupVideo: function(post, playing, controls) {
      var fullImage;
      fullImage = post.file.fullImage;
      if (!playing) {
        fullImage.controls = controls;
        return;
      }
      fullImage.controls = false;
      $.asap((function() {
        return doc.contains(fullImage);
      }), function() {
        if (!d.hidden && Header.isNodeVisible(fullImage)) {
          return fullImage.play();
        } else {
          return post.file.wasPlaying = true;
        }
      });
      if (controls) {
        return ImageCommon.addControls(fullImage);
      }
    },
    videoCB: (function() {
      var mousedown;
      mousedown = false;
      return {
        mouseover: function() {
          return mousedown = false;
        },
        mousedown: function(e) {
          if (e.button === 0) {
            return mousedown = true;
          }
        },
        mouseup: function(e) {
          if (e.button === 0) {
            return mousedown = false;
          }
        },
        mouseout: function(e) {
          if (mousedown && e.clientX <= this.getBoundingClientRect().left) {
            return ImageExpand.toggle(Get.postFromNode(this));
          }
        },
        click: function(e) {
          if (this.paused && !this.controls) {
            this.play();
            return e.stopPropagation();
          }
        }
      };
    })(),
    setupVideoCB: function(post) {
      var cb, eventName, file, _ref;
      file = post.file;
      _ref = ImageExpand.videoCB;
      for (eventName in _ref) {
        cb = _ref[eventName];
        $.on(file.fullImage, eventName, cb);
      }
      if (file.videoControls) {
        return $.on(file.videoControls.firstElementChild, 'click', function() {
          return ImageExpand.toggle(post);
        });
      }
    },
    error: function() {
      var post;
      post = Get.postFromNode(this);
      $.rm(this);
      delete post.file.fullImage;
      if (!(post.file.isExpanding || post.file.isExpanded)) {
        return;
      }
      if (ImageCommon.decodeError(this, post)) {
        return ImageExpand.contract(post);
      }
      if (this.src.split('/')[2] !== 'i.4cdn.org') {
        return ImageExpand.contract(post);
      }
      return ImageCommon.error(this, post, 10 * $.SECOND, function(URL) {
        if (post.file.isExpanding || post.file.isExpanded) {
          ImageExpand.contract(post);
          if (URL) {
            return ImageExpand.expand(post, URL);
          }
        }
      });
    },
    menu: {
      init: function() {
        var conf, createSubEntry, el, name, subEntries, _ref;
        if (!ImageExpand.enabled) {
          return;
        }
        el = $.el('span', {
          textContent: 'Image Expansion',
          className: 'image-expansion-link'
        });
        createSubEntry = ImageExpand.menu.createSubEntry;
        subEntries = [];
        _ref = Config.imageExpansion;
        for (name in _ref) {
          conf = _ref[name];
          subEntries.push(createSubEntry(name, conf[1]));
        }
        return Header.menu.addEntry({
          el: el,
          order: 105,
          subEntries: subEntries
        });
      },
      createSubEntry: function(name, desc) {
        var input, label;
        label = UI.checkbox(name, name);
        label.title = desc;
        input = label.firstElementChild;
        if (name === 'Fit width' || name === 'Fit height') {
          $.on(input, 'change', ImageExpand.cb.setFitness);
        }
        $.event('change', null, input);
        $.on(input, 'change', $.cb.checked);
        return {
          el: label
        };
      }
    }
  };

  ImageHover = {
    init: function() {
      var _ref;
      if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
        return;
      }
      if (Conf['Image Hover']) {
        Post.callbacks.push({
          name: 'Image Hover',
          cb: this.node
        });
      }
      if (Conf['Image Hover in Catalog']) {
        return CatalogThread.callbacks.push({
          name: 'Image Hover',
          cb: this.catalogNode
        });
      }
    },
    node: function() {
      if (!(this.file && (this.file.isImage || this.file.isVideo))) {
        return;
      }
      return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover);
    },
    catalogNode: function() {
      var file;
      file = this.thread.OP.file;
      if (!(file && (file.isImage || file.isVideo))) {
        return;
      }
      return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover);
    },
    mouseover: function(e) {
      var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, post, right, scale, width, x, _ref, _ref1, _ref2;
      post = $.hasClass(this, 'thumb') ? g.posts[this.parentNode.dataset.fullID] : Get.postFromNode(this);
      file = post.file;
      isVideo = file.isVideo;
      if (file.isExpanding || file.isExpanded) {
        return;
      }
      error = ImageHover.error(post);
      if (((_ref = ImageCommon.cache) != null ? _ref.dataset.fullID : void 0) === post.fullID) {
        el = ImageCommon.popCache();
        $.on(el, 'error', error);
      } else {
        el = $.el((isVideo ? 'video' : 'img'));
        el.dataset.fullID = post.fullID;
        $.on(el, 'error', error);
        el.src = file.URL;
      }
      if (Conf['Restart when Opened']) {
        ImageCommon.rewind(el);
        ImageCommon.rewind(this);
      }
      el.id = 'ihover';
      $.add(Header.hover, el);
      if (isVideo) {
        el.loop = true;
        el.controls = false;
        if (Conf['Autoplay']) {
          el.play();
        }
      }
      _ref1 = (function() {
        var _i, _len, _ref1, _results;
        _ref1 = file.dimensions.split('x');
        _results = [];
        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
          x = _ref1[_i];
          _results.push(+x);
        }
        return _results;
      })(), width = _ref1[0], height = _ref1[1];
      _ref2 = this.getBoundingClientRect(), left = _ref2.left, right = _ref2.right;
      padding = 16;
      maxWidth = Math.max(left, doc.clientWidth - right);
      maxHeight = doc.clientHeight - 16;
      scale = Math.min(1, maxWidth / width, maxHeight / height);
      el.style.maxWidth = "" + (scale * width) + "px";
      el.style.maxHeight = "" + (scale * height) + "px";
      el.style.width = "" + width + "px";
      el.style.height = "" + height + "px";
      return UI.hover({
        root: this,
        el: el,
        latestEvent: e,
        endEvents: 'mouseout click',
        asapTest: function() {
          return true;
        },
        height: scale * height + padding,
        noRemove: true,
        cb: function() {
          $.off(el, 'error', error);
          ImageCommon.pushCache(el);
          if (isVideo) {
            el.pause();
          }
          $.rm(el);
          return el.removeAttribute('style');
        }
      });
    },
    error: function(post) {
      return function() {
        if (ImageCommon.decodeError(this, post)) {
          return;
        }
        return ImageCommon.error(this, post, 3 * $.SECOND, (function(_this) {
          return function(URL) {
            if (URL) {
              return _this.src = URL + (_this.src === URL ? '?' + Date.now() : '');
            } else {
              return $.rm(_this);
            }
          };
        })(this));
      };
    }
  };

  ImageLoader = {
    init: function() {
      var prefetch, _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
        return;
      }
      if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
        return;
      }
      Post.callbacks.push({
        name: 'Image Replace',
        cb: this.node
      });
      $.on(d, 'PostsInserted', function() {
        return g.posts.forEach(ImageLoader.prefetch);
      });
      if (Conf['Replace WEBM']) {
        $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
      }
      if (!Conf['Image Prefetching']) {
        return;
      }
      prefetch = $.el('label', {
        innerHTML: "<input type=\"checkbox\" name=\"prefetch\"> Prefetch Images"
      });
      this.el = prefetch.firstElementChild;
      $.on(this.el, 'change', this.toggle);
      return Header.menu.addEntry({
        el: prefetch,
        order: 104
      });
    },
    node: function() {
      if (this.isClone || !this.file) {
        return;
      }
      if (Conf['Replace WEBM'] && this.file.isVideo) {
        ImageLoader.replaceVideo(this);
      }
      return ImageLoader.prefetch(this);
    },
    replaceVideo: function(post) {
      var attr, file, thumb, video, _i, _len, _ref;
      file = post.file;
      thumb = file.thumb;
      video = $.el('video', {
        preload: 'none',
        loop: true,
        poster: thumb.src,
        textContent: thumb.alt,
        className: thumb.className
      });
      video.dataset.md5 = thumb.dataset.md5;
      _ref = ['height', 'width', 'maxHeight', 'maxWidth'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        attr = _ref[_i];
        video.style[attr] = thumb.style[attr];
      }
      video.src = file.URL;
      $.replace(thumb, video);
      file.thumb = video;
      return file.videoThumb = true;
    },
    prefetch: function(post) {
      var URL, clone, el, file, isImage, isVideo, item, match, pass, replace, thumb, type, _i, _j, _len, _len1, _ref, _ref1;
      file = post.file;
      if (!file) {
        return;
      }
      isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, URL = file.URL;
      if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) {
        return;
      }
      type = (match = URL.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
      replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src);
      if (!(replace || Conf['prefetch'])) {
        return;
      }
      pass = false;
      _ref = [post].concat(__slice.call(post.clones));
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        item = _ref[_i];
        if (doc.contains(item.nodes.root)) {
          pass = true;
          break;
        }
      }
      if (!pass) {
        return;
      }
      file.isPrefetched = true;
      if (file.videoThumb) {
        _ref1 = post.clones;
        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
          clone = _ref1[_j];
          clone.file.thumb.preload = 'auto';
        }
        thumb.preload = 'auto';
        if (typeof chrome === "undefined" || chrome === null) {
          $.on(thumb, 'loadeddata', function() {
            return this.removeAttribute('poster');
          });
        }
        return;
      }
      el = $.el(isImage ? 'img' : 'video');
      if (replace && isImage) {
        $.on(el, 'load', function() {
          var _k, _len2, _ref2;
          _ref2 = post.clones;
          for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
            clone = _ref2[_k];
            clone.file.thumb.src = URL;
          }
        });
        thumb.src = URL;
      }
      return el.src = URL;
    },
    toggle: function() {
      if (Conf['prefetch'] = this.checked) {
        g.BOARD.posts.forEach(ImageLoader.prefetch);
      }
    },
    playVideos: function() {
      var qpClone, _ref;
      qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
      return g.posts.forEach(function(post) {
        var thumb, _i, _len, _ref1, _ref2;
        _ref1 = [post].concat(__slice.call(post.clones));
        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
          post = _ref1[_i];
          if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) {
            continue;
          }
          thumb = post.file.thumb;
          if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) {
            thumb.play();
          } else {
            thumb.pause();
          }
        }
      });
    }
  };

  RevealSpoilers = {
    init: function() {
      var _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
        return;
      }
      return Post.callbacks.push({
        name: 'Reveal Spoiler Thumbnails',
        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');
      thumb.style.maxHeight = thumb.style.maxWidth = this.isReply ? '125px' : '250px';
      return thumb.src = this.file.thumbURL;
    }
  };

  Sauce = {
    init: function() {
      var err, link, links, _i, _len, _ref, _ref1;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Sauce'])) {
        return;
      }
      links = [];
      _ref1 = Conf['sauces'].split('\n');
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        link = _ref1[_i];
        try {
          if (link[0] !== '#') {
            links.push(link.trim());
          }
        } catch (_error) {
          err = _error;
        }
      }
      if (!links.length) {
        return;
      }
      this.links = links;
      this.link = $.el('a', {
        target: '_blank'
      });
      return Post.callbacks.push({
        name: 'Sauce',
        cb: this.node
      });
    },
    createSauceLink: function(link, post) {
      var a, ext, i, key, m, part, parts, _i, _len, _ref, _ref1, _ref2, _ref3;
      parts = {};
      _ref = link.split(/;(?=(?:text|boards|types):)/);
      for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
        part = _ref[i];
        if (i === 0) {
          parts['url'] = part;
        } else {
          m = part.match(/^(\w*):(.*)$/);
          parts[m[1]] = m[2];
        }
      }
      parts['text'] || (parts['text'] = ((_ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? _ref1[1] : void 0) || '?');
      for (key in parts) {
        parts[key] = parts[key].replace(/%(T?URL|MD5|board|name|%|semi)/g, function(parameter) {
          var type;
          type = {
            '%TURL': post.file.thumbURL,
            '%URL': post.file.URL,
            '%MD5': post.file.MD5,
            '%board': post.board.ID,
            '%name': post.file.name,
            '%%': '%',
            '%semi': ';'
          }[parameter];
          if (key === 'url' && parameter !== '%%' && parameter !== '%semi') {
            if (/^javascript:/i.test(parts['url'])) {
              type = JSON.stringify(type);
            }
            type = encodeURIComponent(type);
          }
          return type;
        });
      }
      ext = ((_ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? _ref2[1] : void 0) || '';
      if (!(!parts['boards'] || (_ref3 = post.board.ID, __indexOf.call(parts['boards'].split(','), _ref3) >= 0))) {
        return null;
      }
      if (!(!parts['types'] || __indexOf.call(parts['types'].split(','), ext) >= 0)) {
        return null;
      }
      a = Sauce.link.cloneNode(true);
      a.href = parts['url'];
      a.textContent = parts['text'];
      if (/^javascript:/i.test(parts['url'])) {
        a.removeAttribute('target');
      }
      return a;
    },
    node: function() {
      var link, node, 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];
        if (node = Sauce.createSauceLink(link, this)) {
          nodes.push($.tn('\u00A0'), node);
        }
      }
      return $.add(this.file.text, nodes);
    }
  };

  Embedding = {
    init: function() {
      var type, _i, _len, _ref;
      if (!(Conf['Embedding'] || Conf['Link Title'])) {
        return;
      }
      this.types = {};
      _ref = this.ordered_types;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        type = _ref[_i];
        this.types[type.key] = type;
      }
      if (Conf['Floating Embeds']) {
        this.dialog = UI.dialog('embedding', 'top: 50px; right: 0px;', {
          innerHTML: "<div><div class=\"move\"></div><a href=\"javascript:;\" class=\"jump\" title=\"Jump to post\"><i class=\"fa\">\uf061</i></a><a href=\"javascript:;\" class=\"close\" title=\"Close\"><i class=\"fa\">\uf00d</i></a></div><div id=\"media-embed\"><div></div></div>"
        });
        this.media = $('#media-embed', this.dialog);
        $.one(d, '4chanXInitFinished', this.ready);
      }
      if (Conf['Link Title']) {
        return $.on(d, '4chanXInitFinished PostsInserted', function() {
          var key, service, _ref1, _ref2;
          _ref1 = Embedding.types;
          for (key in _ref1) {
            service = _ref1[key];
            if ((_ref2 = service.title) != null ? _ref2.batchSize : void 0) {
              Embedding.flushTitles(service.title);
            }
          }
        });
      }
    },
    events: function(post) {
      var el, i, items;
      if (!Conf['Embedding']) {
        return;
      }
      i = 0;
      items = $$('.embedder', post.nodes.comment);
      while (el = items[i++]) {
        $.on(el, 'click', Embedding.cb.toggle);
        if ($.hasClass(el, 'embedded')) {
          Embedding.cb.toggle.call(el);
        }
      }
    },
    process: function(link, post) {
      var data;
      if (!(Conf['Embedding'] || Conf['Link Title'])) {
        return;
      }
      if ($.x('ancestor::pre', link)) {
        return;
      }
      if (data = Embedding.services(link)) {
        data.post = post;
        if (Conf['Embedding']) {
          Embedding.embed(data);
        }
        if (Conf['Link Title']) {
          return Embedding.title(data);
        }
      }
    },
    services: function(link) {
      var href, match, type, _i, _len, _ref;
      href = link.href;
      _ref = Embedding.ordered_types;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        type = _ref[_i];
        if (!(match = type.regExp.exec(href))) {
          continue;
        }
        if (type.dummy || type.httpOnly && location.protocol !== 'http:') {
          return;
        }
        return {
          key: type.key,
          uid: match[1],
          options: match[2],
          link: link
        };
      }
    },
    embed: function(data) {
      var embed, key, link, name, options, post, uid, value, _ref;
      key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
      embed = $.el('a', {
        className: 'embedder',
        rel: 'nofollow noreferrer',
        href: link.href,
        textContent: '(embed)'
      });
      _ref = {
        key: key,
        uid: uid,
        options: options
      };
      for (name in _ref) {
        value = _ref[name];
        embed.dataset[name] = value;
      }
      $.addClass(link, "" + embed.dataset.key);
      $.on(embed, 'click', Embedding.cb.toggle);
      $.after(link, [$.tn(' '), embed]);
      if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {
        return $.asap((function() {
          return doc.contains(embed);
        }), function() {
          return Embedding.cb.toggle.call(embed);
        });
      }
    },
    ready: function() {
      $.addClass(Embedding.dialog, 'empty');
      $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat);
      $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed);
      $.on($('.jump', Embedding.dialog), 'click', function() {
        if (doc.contains(Embedding.lastEmbed)) {
          return Header.scrollTo(Embedding.lastEmbed);
        }
      });
      return $.add(d.body, Embedding.dialog);
    },
    closeFloat: function() {
      delete Embedding.lastEmbed;
      $.addClass(Embedding.dialog, 'empty');
      return $.replace(Embedding.media.firstChild, $.el('div'));
    },
    dragEmbed: function() {
      var style;
      style = Embedding.media.style;
      if (Embedding.dragEmbed.mouseup) {
        $.off(d, 'mouseup', Embedding.dragEmbed);
        Embedding.dragEmbed.mouseup = false;
        style.visibility = '';
        return;
      }
      $.on(d, 'mouseup', Embedding.dragEmbed);
      Embedding.dragEmbed.mouseup = true;
      return style.visibility = 'hidden';
    },
    title: function(data) {
      var key, link, options, post, service, uid;
      key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
      if (!(service = Embedding.types[key].title)) {
        return;
      }
      if (service.batchSize) {
        (service.queue || (service.queue = [])).push(data);
        if (service.queue.length >= service.batchSize) {
          return Embedding.flushTitles(service);
        }
      } else {
        if (!$.cache(service.api(uid), (function() {
          return Embedding.cb.title(this, data);
        }), {
          responseType: 'json'
        })) {
          return $.extend(link, {
            innerHTML: "[" + E(key) + "] <span class=\"warning\">Title Link Blocked</span> (are you using NoScript?)</a>"
          });
        }
      }
    },
    flushTitles: function(service) {
      var cb, data, queue, _i, _len;
      queue = service.queue;
      if (!(queue != null ? queue.length : void 0)) {
        return;
      }
      service.queue = [];
      cb = function() {
        var data, _i, _len;
        for (_i = 0, _len = queue.length; _i < _len; _i++) {
          data = queue[_i];
          Embedding.cb.title(this, data);
        }
      };
      if (!$.cache(service.api((function() {
        var _i, _len, _results;
        _results = [];
        for (_i = 0, _len = queue.length; _i < _len; _i++) {
          data = queue[_i];
          _results.push(data.uid);
        }
        return _results;
      })()), cb, {
        responseType: 'json'
      })) {
        for (_i = 0, _len = queue.length; _i < _len; _i++) {
          data = queue[_i];
          $.extend(data.link, {
            innerHTML: "[" + E(data.key) + "] <span class=\"warning\">Title Link Blocked</span> (are you using NoScript?)</a>"
          });
        }
      }
    },
    cb: {
      toggle: function(e) {
        var div;
        if (e != null) {
          e.preventDefault();
        }
        if (Conf['Floating Embeds']) {
          if (!(div = Embedding.media.firstChild)) {
            return;
          }
          $.replace(div, Embedding.cb.embed(this));
          Embedding.lastEmbed = Get.postFromNode(this).nodes.root;
          $.rmClass(Embedding.dialog, 'empty');
          return;
        }
        if ($.hasClass(this, "embedded")) {
          $.rm(this.nextElementSibling);
          this.textContent = '(embed)';
        } else {
          $.after(this, Embedding.cb.embed(this));
          this.textContent = '(unembed)';
        }
        return $.toggleClass(this, 'embedded');
      },
      embed: function(a) {
        var container, el, type;
        container = $.el('div');
        $.add(container, el = (type = Embedding.types[a.dataset.key]).el(a));
        el.style.cssText = type.style != null ? type.style : "border:0;width:640px;height:390px";
        return container;
      },
      title: function(req, data) {
        var key, link, link2, options, post, post2, service, status, text, uid, _i, _j, _len, _len1, _ref, _ref1;
        key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
        status = req.status;
        service = Embedding.types[key].title;
        text = "[" + key + "] " + ((function() {
          switch (status) {
            case 200:
            case 304:
              return service.text(req.response, uid);
            case 404:
              return "Not Found";
            case 403:
              return "Forbidden or Private";
            default:
              return "" + status + "'d";
          }
        })());
        link.dataset.original = link.textContent;
        link.textContent = text;
        _ref = post.clones;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          post2 = _ref[_i];
          _ref1 = $$('a.linkify', post2.nodes.comment);
          for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
            link2 = _ref1[_j];
            if (!(link2.href === link.href)) {
              continue;
            }
            link2.dataset.original = link2.textContent;
            link2.textContent = text;
          }
        }
      }
    },
    ordered_types: [
      {
        key: 'audio',
        regExp: /\.(?:mp3|ogg|wav)(?:\?|$)/i,
        style: '',
        el: function(a) {
          return $.el('audio', {
            controls: true,
            preload: 'auto',
            src: a.href
          });
        }
      }, {
        key: 'gist',
        regExp: /^\w+:\/\/gist\.github\.com\/(?:[\w\-]+\/)?(\w+)/,
        el: function(a) {
          var content, el;
          el = $.el('iframe');
          el.setAttribute('sandbox', 'allow-scripts');
          content = {
            innerHTML: "<html><head><title>" + E(a.dataset.uid) + "</title></head><body><script src=\"https://gist.github.com/" + E(a.dataset.uid) + ".js\"></script></body></html>"
          };
          el.src = "data:text/html;charset=utf-8,<!doctype html>" + (encodeURIComponent(content.innerHTML));
          return el;
        },
        title: {
          api: function(uid) {
            return "https://api.github.com/gists/" + uid;
          },
          text: function(_arg) {
            var file, files;
            files = _arg.files;
            for (file in files) {
              if (files.hasOwnProperty(file)) {
                return file;
              }
            }
          }
        }
      }, {
        key: 'image',
        regExp: /\.(?:gif|png|jpg|jpeg|bmp)(?:\?|$)/i,
        style: '',
        el: function(a) {
          return $.el('div', {
            innerHTML: "<a target=\"_blank\" href=\"" + E(a.href) + "\"><img src=\"" + E(a.href) + "\" style=\"max-width: 80vw; max-height: 80vh;\"></a>"
          });
        }
      }, {
        key: 'InstallGentoo',
        regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,
        el: function(a) {
          return $.el('iframe', {
            src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid
          });
        }
      }, {
        key: 'Twitter',
        regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
        el: function(a) {
          return $.el('iframe', {
            src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
          });
        }
      }, {
        key: 'LiveLeak',
        regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*i=(\w+)/,
        httpOnly: true,
        el: function(a) {
          var el;
          el = $.el('iframe', {
            width: "640",
            height: "360",
            src: "http://www.liveleak.com/ll_embed?i=" + a.dataset.uid,
            frameborder: "0"
          });
          el.setAttribute("allowfullscreen", "true");
          return el;
        }
      }, {
        key: 'MediaCrush',
        regExp: /^\w+:\/\/(?:www\.)?mediacru\.sh\/([\w\-]+)/,
        style: '',
        el: function(a) {
          var el;
          el = $.el('div');
          $.queueTask(function() {
            return $.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
              var embed, ext, file, files, i, status, type, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
              if (!doc.contains(el)) {
                return;
              }
              status = this.status;
              if (status !== 200 && status !== 304) {
                return el.textContent = "ERROR " + status;
              }
              files = this.response.files;
              _ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
              for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                type = _ref[_i];
                for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
                  file = files[_j];
                  if (file.type === type) {
                    embed = file;
                    break;
                  }
                }
                if (embed) {
                  break;
                }
              }
              if (!embed) {
                return el.textContent = "ERROR: Not a valid filetype";
              }
              switch (embed.type) {
                case 'video/mp4':
                case 'video/webm':
                case 'video/ogv':
                  $.extend(el, {
                    innerHTML: "<video controls loop style=\"max-width: 80vw; max-height: 80vh;\"><source type=\"video/mp4\"><source type=\"video/webm\"></video>"
                  });
                  _ref1 = ['mp4', 'webm'];
                  for (i = _k = 0, _len2 = _ref1.length; _k < _len2; i = ++_k) {
                    ext = _ref1[i];
                    el.firstChild.children[i].src = "https://mediacru.sh/" + a.dataset.uid + "." + ext;
                  }
                  break;
                case 'image/svg+xml':
                case 'image/png':
                case 'image/gif':
                case 'image/jpeg':
                  $.extend(el, {
                    innerHTML: "<a target=\"_blank\" href=\"" + E(a.href) + "\"><img src=\"https://mediacru.sh/" + E(file.file) + "\" style=\"max-width: 80vw; max-height: 80vh;\"></a>"
                  });
                  break;
                case 'audio/mpeg':
                case 'audio/ogg':
                  $.extend(el, {
                    innerHTML: "<audio controls><source type=\"audio/ogg\" src=\"https://mediacru.sh/" + E(a.dataset.uid) + ".ogg\"></audio>"
                  });
                  break;
                default:
                  el.textContent = "ERROR: No valid filetype.";
              }
            });
          });
          return el;
        }
      }, {
        key: 'pastebin',
        regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
        httpOnly: true,
        el: function(a) {
          var div;
          return div = $.el('iframe', {
            src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid
          });
        }
      }, {
        key: 'gfycat',
        regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
        el: function(a) {
          var div;
          return div = $.el('iframe', {
            src: "//gfycat.com/iframe/" + a.dataset.uid
          });
        }
      }, {
        key: 'SoundCloud',
        regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/,
        style: 'border: 0; width: 500px; height: 400px;',
        el: function(a) {
          return $.el('iframe', {
            src: "https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(a.dataset.uid))
          });
        },
        title: {
          api: function(uid) {
            return "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(uid));
          },
          text: function(_) {
            return _.title;
          }
        }
      }, {
        key: 'StrawPoll',
        regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
        httpOnly: true,
        style: 'border: 0; width: 600px; height: 406px;',
        el: function(a) {
          return $.el('iframe', {
            src: "http://strawpoll.me/embed_1/" + a.dataset.uid
          });
        }
      }, {
        key: 'TwitchTV',
        regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/([^#\&\?]*)/,
        httpOnly: true,
        style: "border: none; width: 640px; height: 360px;",
        el: function(a) {
          var channel, id, idparam, obj, result, type, _;
          if (result = /(\w+)\/([bc])\/(\d+)/i.exec(a.dataset.uid)) {
            _ = result[0], channel = result[1], type = result[2], id = result[3];
            idparam = {
              'b': 'archive_id',
              'c': 'chapter_id'
            };
            obj = $.el('object', {
              data: 'http://www.twitch.tv/widgets/archive_embed_player.swf'
            });
            $.extend(obj, {
              innerHTML: "<param name=\"allowFullScreen\" value=\"true\"><param name=\"flashvars\">"
            });
            obj.children[1].value = "channel=" + channel + "&start_volume=25&auto_play=false&" + idparam[type] + "=" + id;
            return obj;
          } else {
            channel = (/(\w+)/.exec(a.dataset.uid))[0];
            obj = $.el('object', {
              data: "http://www.twitch.tv/widgets/live_embed_player.swf?channel=" + channel
            });
            $.extend(obj, {
              innerHTML: "<param name=\"allowFullScreen\" value=\"true\"><param name=\"flashvars\">"
            });
            obj.children[1].value = "hostname=www.twitch.tv&channel=" + channel + "&auto_play=true&start_volume=25";
            return obj;
          }
        }
      }, {
        key: 'Vocaroo',
        regExp: /^\w+:\/\/(?:www\.)?vocaroo\.com\/i\/(\w+)/,
        style: '',
        el: function(a) {
          return $.el('audio', {
            controls: true,
            preload: 'auto',
            src: "http://vocaroo.com/media_command.php?media=" + a.dataset.uid + "&command=download_ogg"
          });
        }
      }, {
        key: 'Vimeo',
        regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/,
        el: function(a) {
          return $.el('iframe', {
            src: "//player.vimeo.com/video/" + a.dataset.uid + "?wmode=opaque"
          });
        },
        title: {
          api: function(uid) {
            return "https://vimeo.com/api/oembed.json?url=http://vimeo.com/" + uid;
          },
          text: function(_) {
            return _.title;
          }
        }
      }, {
        key: 'Vine',
        regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/,
        style: 'border: none; width: 500px; height: 500px;',
        el: function(a) {
          return $.el('iframe', {
            src: "https://vine.co/v/" + a.dataset.uid + "/card"
          });
        }
      }, {
        key: 'YouTube',
        regExp: /^\w+:\/\/(?:youtu.be\/|[\w\.]*youtube[\w\.]*\/.*(?:v=|\/embed\/|\/v\/|\/videos\/))([\w\-]{11})[^#\&\?]?(.*)/,
        el: function(a) {
          var el, start;
          start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/);
          if (start) {
            start = start[1];
          }
          if (start && !/^\d+$/.test(start)) {
            start += ' 0h0m0s';
            start = 3600 * start.match(/(\d+)h/)[1] + 60 * start.match(/(\d+)m/)[1] + 1 * start.match(/(\d+)s/)[1];
          }
          el = $.el('iframe', {
            src: "//www.youtube.com/embed/" + a.dataset.uid + "?wmode=opaque" + (start ? '&start=' + start : '')
          });
          el.setAttribute("allowfullscreen", "true");
          return el;
        },
        title: {
          batchSize: 50,
          api: function(uids) {
            var ids, key;
            ids = encodeURIComponent(uids.join(','));
            key = 'AIzaSyCrvwsT3ub8sDl3S5APhok2eY-OzRcCK5U';
            return "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + ids + "&fields=items%28id%2Csnippet%28title%29%29&key=" + key;
          },
          text: function(data, uid) {
            var item, _i, _len, _ref;
            _ref = data.items;
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
              item = _ref[_i];
              if (item.id === uid) {
                return item.snippet.title;
              }
            }
            return 'Not Found';
          }
        }
      }, {
        key: 'Loopvid',
        regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/((?:pf|kd|lv|mc|gd|gh|db|nn)\/[\w\-]+(,[\w\-]+)*|fc\/\w+\/\d+)/,
        style: 'max-width: 80vw; max-height: 80vh;',
        el: function(a) {
          var base, el, host, name, names, type, types, url, _, _i, _j, _len, _len1, _ref, _ref1;
          el = $.el('video', {
            controls: true,
            preload: 'auto',
            loop: true
          });
          _ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = _ref[0], host = _ref[1], names = _ref[2];
          types = host === 'gd' || host === 'fc' ? [''] : ['.webm', '.mp4'];
          _ref1 = names.split(',');
          for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
            name = _ref1[_i];
            for (_j = 0, _len1 = types.length; _j < _len1; _j++) {
              type = types[_j];
              base = "" + name + type;
              url = (function() {
                switch (host) {
                  case 'pf':
                    return "http://a.pomf.se/" + base;
                  case 'kd':
                    return "http://kastden.org/loopvid/" + base;
                  case 'lv':
                    return "http://loopvid.mooo.com/videos/" + base;
                  case 'mc':
                    return "https://cdn.mediacru.sh/" + base;
                  case 'gd':
                    return "https://docs.google.com/uc?export=download&id=" + base;
                  case 'gh':
                    return "https://googledrive.com/host/" + base;
                  case 'db':
                    return "https://googledrive.com/host/" + base;
                  case 'fc':
                    return "//i.4cdn.org/" + base + ".webm";
                  case 'nn':
                    return "http://naenara.eu/loopvids/" + base;
                }
              })();
              $.add(el, $.el('source', {
                src: url
              }));
            }
          }
          return el;
        }
      }, {
        key: 'Clyp',
        regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w+)/,
        style: '',
        el: function(a) {
          return $.el('audio', {
            controls: true,
            preload: 'auto',
            src: "http://clyp.it/" + a.dataset.uid + ".ogg"
          });
        }
      }, {
        key: 'Loopvid-dummy',
        regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\//,
        dummy: true
      }, {
        key: 'MediaFire-dummy',
        regExp: /^\w+:\/\/(?:www\.)?mediafire.com\//,
        dummy: true
      }, {
        key: 'video',
        regExp: /\.(?:ogv|webm|mp4)(?:\?|$)/i,
        style: 'max-width: 80vw; max-height: 80vh;',
        el: function(a) {
          return $.el('video', {
            controls: true,
            preload: 'auto',
            src: a.href
          });
        }
      }
    ]
  };

  Linkify = {
    init: function() {
      var _ref;
      if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Linkify']) {
        return;
      }
      if (Conf['Comment Expansion']) {
        ExpandComment.callbacks.push(this.node);
      }
      Post.callbacks.push({
        name: 'Linkify',
        cb: this.node
      });
      CatalogThread.callbacks.push({
        name: 'Linkify',
        cb: this.catalogNode
      });
      return Embedding.init();
    },
    node: function() {
      var link, links, _i, _len;
      if (this.isClone) {
        return Embedding.events(this);
      }
      if (!Linkify.regString.test(this.info.comment)) {
        return;
      }
      links = Linkify.process(this.nodes.comment);
      for (_i = 0, _len = links.length; _i < _len; _i++) {
        link = links[_i];
        Embedding.process(link, this);
      }
    },
    catalogNode: function() {
      if (!Linkify.regString.test(this.thread.OP.info.comment)) {
        return;
      }
      return Linkify.process(this.nodes.comment);
    },
    process: function(node) {
      var data, end, endNode, i, index, length, links, result, saved, snapshot, space, test, word;
      test = /[^\s'"]+/g;
      space = /[\s'"]/;
      snapshot = $.X('.//br|.//text()', node);
      i = 0;
      links = [];
      while (node = snapshot.snapshotItem(i++)) {
        data = node.data;
        if (!data || node.parentElement.nodeName === "A") {
          continue;
        }
        while (result = test.exec(data)) {
          index = result.index;
          endNode = node;
          word = result[0];
          if ((length = index + word.length) === data.length) {
            test.lastIndex = 0;
            while ((saved = snapshot.snapshotItem(i++))) {
              if (saved.nodeName === 'BR') {
                break;
              }
              endNode = saved;
              data = saved.data;
              if (end = space.exec(data)) {
                word += data.slice(0, end.index);
                test.lastIndex = length = end.index;
                i--;
                break;
              } else {
                length = data.length;
                word += data;
              }
            }
          }
          if (Linkify.regString.test(word)) {
            links.push(Linkify.makeRange(node, endNode, index, length));
          }
          if (!(test.lastIndex && node === endNode)) {
            break;
          }
        }
      }
      i = links.length;
      while (i--) {
        links[i] = Linkify.makeLink(links[i]);
      }
      return links;
    },
    regString: /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/?])|([-a-z\d]+[.])+(aero|asia|biz|cat|com|coop|dance|info|int|jobs|mobi|moe|museum|name|net|org|post|pro|tel|travel|xxx|edu|gov|mil|[a-z]{2})([:\/]|(?![^\s'"]))|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i,
    makeRange: function(startNode, endNode, startOffset, endOffset) {
      var range;
      range = document.createRange();
      range.setStart(startNode, startOffset);
      range.setEnd(endNode, endOffset);
      return range;
    },
    makeLink: function(range) {
      var a, i, t, text;
      text = range.toString();
      i = text.search(Linkify.regString);
      if (i > 0) {
        text = text.slice(i);
        while (range.startOffset + i >= range.startContainer.data.length) {
          i--;
        }
        if (i) {
          range.setStart(range.startContainer, range.startOffset + i);
        }
      }
      i = 0;
      while (/[)\]}>.,]/.test(t = text.charAt(text.length - (1 + i)))) {
        if (!(/[.,]/.test(t) || (text.match(/[()\[\]{}<>]/g)).length % 2)) {
          break;
        }
        i++;
      }
      if (i) {
        text = text.slice(0, -i);
        while (range.endOffset - i < 0) {
          i--;
        }
        if (i) {
          range.setEnd(range.endContainer, range.endOffset - i);
        }
      }
      if (!/((mailto|magnet):|.+:\/\/)/.test(text)) {
        text = (/@/.test(text) ? 'mailto:' : 'http://') + text;
      }
      a = $.el('a', {
        className: 'linkify',
        rel: 'nofollow noreferrer',
        target: '_blank',
        href: text
      });
      $.add(a, range.extractContents());
      range.insertNode(a);
      return a;
    }
  };

  ArchiveLink = {
    init: function() {
      var div, entry, type, _i, _len, _ref, _ref1;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
        return;
      }
      div = $.el('div', {
        textContent: 'Archive'
      });
      entry = {
        el: div,
        order: 90,
        open: function(_arg) {
          var ID, board, thread;
          ID = _arg.ID, thread = _arg.thread, board = _arg.board;
          return !!Redirect.to('thread', {
            postID: ID,
            threadID: thread.ID,
            boardID: board.ID
          });
        },
        subEntries: []
      };
      _ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Unique ID', 'uniqueID'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        type = _ref1[_i];
        entry.subEntries.push(this.createSubEntry(type[0], type[1]));
      }
      return Menu.menu.addEntry(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('thread', {
          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('search', {
          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, _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && 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 Menu.menu.addEntry({
        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, post;
      post = DeleteLink.post;
      if (DeleteLink.cooldown.counting === post) {
        return;
      }
      $.off(this, 'click', DeleteLink["delete"]);
      fileOnly = $.hasClass(this, 'delete-file');
      this.textContent = "Deleting " + (fileOnly ? 'file' : 'post') + "...";
      form = {
        mode: 'usrdel',
        onlyimgdel: fileOnly,
        pwd: QR.persona.getPassword()
      };
      form[post.ID] = 'delete';
      link = this;
      return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), {
        responseType: 'document',
        withCredentials: true,
        onload: function() {
          return DeleteLink.load(link, post, fileOnly, this.response);
        },
        onerror: function() {
          return DeleteLink.error(link);
        }
      }, {
        form: $.formData(form)
      });
    },
    load: function(link, post, fileOnly, resDoc) {
      var msg, s;
      if (resDoc.title === '4chan - Banned') {
        s = 'Banned!';
      } else if (msg = resDoc.getElementById('errmsg')) {
        s = msg.textContent;
        $.on(link, 'click', DeleteLink["delete"]);
      } else {
        if (resDoc.title === 'Updating index...') {
          QR.cooldown["delete"](post);
          (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;
        if (!QR.db.get({
          boardID: post.board.ID,
          threadID: post.thread.ID,
          postID: post.ID
        })) {
          delete DeleteLink.cooldown.counting;
          return;
        }
        DeleteLink.cooldown.counting = post;
        length = 60;
        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, _ref;
      if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
        return;
      }
      if (Conf['Add Download Attribute to Filename']) {
        Post.callbacks.push({
          name: 'DownloadLink',
          cb: this.node
        });
      }
      if (!(Conf['Menu'] && Conf['Download Link'])) {
        return;
      }
      a = $.el('a', {
        className: 'download-link',
        textContent: 'Download file'
      });
      $.on(a, 'click', ImageCommon.download);
      return Menu.menu.addEntry({
        el: a,
        order: 100,
        open: function(_arg) {
          var file;
          file = _arg.file;
          if (!file) {
            return false;
          }
          a.href = file.URL;
          a.download = file.name;
          return true;
        }
      });
    },
    node: function() {
      var a;
      if (!this.file) {
        return;
      }
      a = $('.file-info a', this.file.text) || this.file.text.firstElementChild;
      return a.download = this.file.name;
    }
  };

  Labels = {
    init: function() {
      var _ref;
      if (!(Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) {
        return;
      }
      return Menu.menu.addEntry({
        el: $.el('div', {
          textContent: 'Labels'
        }),
        order: 60,
        open: function(post, addSubEntry) {
          var label, labels;
          labels = (post.origin || post).labels;
          if (!labels.length) {
            return false;
          }
          this.subEntries.length = 0;
          this.subEntries = (function() {
            var _i, _len, _results;
            _results = [];
            for (_i = 0, _len = labels.length; _i < _len; _i++) {
              label = labels[_i];
              _results.push({
                el: $.el('div', {
                  textContent: label
                })
              });
            }
            return _results;
          })();
          return true;
        },
        subEntries: []
      });
    }
  };

  Menu = {
    init: function() {
      var _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'])) {
        return;
      }
      this.button = $.el('a', {
        className: 'menu-button',
        href: 'javascript:;'
      });
      $.extend(this.button, {
        innerHTML: "<i class=\"fa\"></i>"
      });
      this.menu = new UI.Menu('post');
      Post.callbacks.push({
        name: 'Menu',
        cb: this.node
      });
      return CatalogThread.callbacks.push({
        name: 'Menu',
        cb: this.catalogNode
      });
    },
    node: function() {
      if (this.isClone) {
        Menu.makeButton(this, $('.menu-button', this.nodes.info));
        return;
      }
      return $.add(this.nodes.info, Menu.makeButton(this));
    },
    catalogNode: function() {
      return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP));
    },
    makeButton: function(post, button) {
      button || (button = Menu.button.cloneNode(true));
      $.on(button, 'click', function(e) {
        return Menu.menu.toggle(e, this, post);
      });
      return button;
    }
  };

  ReportLink = {
    init: function() {
      var a, _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
        return;
      }
      a = $.el('a', {
        className: 'report-link',
        href: 'javascript:;',
        textContent: 'Report this post'
      });
      $.on(a, 'click', ReportLink.report);
      return Menu.menu.addEntry({
        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=285";
      return window.open(url, id, set);
    }
  };

  Favicon = {
    init: function() {
      return $.asap((function() {
        return d.head && (Favicon.el = $('link[rel="shortcut icon"]', d.head));
      }), Favicon.initAsap);
    },
    initAsap: function() {
      var href;
      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 f, i, items, t;
      items = {
        ferongr: ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxUlEQVR42q1TOwrCQBB9s0FRtJI0WoqFtSLYegoP4gVSeJsUHsHSI3iFeIqRXXgwrhlXwYHHhLwPTB7B36abBCV+0pA4DUBQUNZYQptGtW3jtoKyxgoe0yrBCoyZfL/5ioQ3URZOXW9I341l3oo+NXEZiW4CEuIzvPECopED4OaZ3RNmeAm4u+a8Jr5f17VyVoL8fr8qcltzwlyyj2iqcgPOQ9ExkHAITgD75bYBe0A5S4H/P9htuWMF3QXoQpwaKeT+lnsC6JE5I6aq6fEAAAAASUVORK5CYII=', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///8AcH4AtswA2PJ55fKi6fIA1/FtpPADAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxElEQVQ4y2NgoBq4/vE/HJOsBiRQUIfA2AzBqQYqUfn00/9FLz+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AADCgANKAASOAATOwAZTAAwkQBAwQBV/wH////+Fmy4AAAAA3RSTlMAPse+s4iwAAAAM0lEQVQIW2NggAGuVasWgDBpDDAQUoSaob0Jao73lgVojOitUEazBZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC']
      }[Conf['favicon']];
      f = Favicon;
      t = 'data:image/png;base64,';
      i = 0;
      while (items[i]) {
        items[i] = t + items[i++];
      }
      f.unreadDead = items[0], f.unreadDeadY = items[1], f.unreadSFW = items[2], f.unreadSFWY = items[3], f.unreadNSFW = items[4], f.unreadNSFWY = items[5];
      return f.update();
    },
    update: function() {
      if (this.SFW) {
        this.unread = this.unreadSFW;
        return this.unreadY = this.unreadSFWY;
      } else {
        this.unread = this.unreadNSFW;
        return this.unreadY = this.unreadNSFWY;
      }
    },
    dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
    logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACABAMAAAAxEHz4AAAAElBMVEX///8EZgR8ulSk0oT///8EAgQ1A88mAAAAAXRSTlMAQObYZgAAAJtJREFUeF7t17ENgDAMBdGswAqswAqskP1XgUhG37JQQv25a1I4eR1CbopoS3295wIASD1SBZnecwEApO9RRurjPdLcAQDQY9UnBSDEBQAIRA3gfGkA9cfiAwDUHqCnHqDl/AGA0v8AAL4FgO0uAxUcc2cAQEtFjwQoLSMuAMBqsVwtpp4AwNDngPIGAPI5mVsCAELSuZybAQBEF/bX4X+FReD/AAAAAElFTkSuQmCC'
  };

  MarkNewIPs = {
    init: function() {
      if (g.VIEW !== 'thread' || !Conf['Mark New IPs']) {
        return;
      }
      return Thread.callbacks.push({
        name: 'Mark New IPs',
        cb: this.node
      });
    },
    node: function() {
      var x;
      MarkNewIPs.ipCount = this.ipCount;
      MarkNewIPs.postIDs = (function() {
        var _i, _len, _ref, _results;
        _ref = this.posts.keys;
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          x = _ref[_i];
          _results.push(+x);
        }
        return _results;
      }).call(this);
      return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
    },
    onUpdate: function(e) {
      var added, fullID, i, ipCount, newPosts, obj, postIDs, removed, x, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1;
      _ref = e.detail, ipCount = _ref.ipCount, newPosts = _ref.newPosts;
      postIDs = ThreadUpdater.postIDs;
      if (ipCount == null) {
        return;
      }
      if (newPosts.length) {
        obj = {};
        _ref1 = MarkNewIPs.postIDs;
        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
          x = _ref1[_i];
          obj[x] = true;
        }
        added = 0;
        for (_j = 0, _len1 = postIDs.length; _j < _len1; _j++) {
          x = postIDs[_j];
          if (!(x in obj)) {
            added++;
          }
        }
        removed = MarkNewIPs.postIDs.length + added - postIDs.length;
        switch (ipCount - MarkNewIPs.ipCount) {
          case added:
            i = MarkNewIPs.ipCount;
            for (_k = 0, _len2 = newPosts.length; _k < _len2; _k++) {
              fullID = newPosts[_k];
              MarkNewIPs.markNew(g.posts[fullID], ++i);
            }
            break;
          case -removed:
            for (_l = 0, _len3 = newPosts.length; _l < _len3; _l++) {
              fullID = newPosts[_l];
              MarkNewIPs.markOld(g.posts[fullID]);
            }
        }
      }
      MarkNewIPs.ipCount = ipCount;
      return MarkNewIPs.postIDs = postIDs;
    },
    markNew: function(post, ipCount) {
      var counter, suffix;
      suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
      counter = $.el('span', {
        className: 'ip-counter',
        textContent: "(" + ipCount + ")"
      });
      post.nodes.nameBlock.title = "This is the " + ipCount + suffix + " IP in the thread.";
      $.add(post.nodes.nameBlock, [$.tn(' '), counter]);
      return $.addClass(post.nodes.root, 'new-ip');
    },
    markOld: function(post) {
      post.nodes.nameBlock.title = 'Not the first post from this IP.';
      return $.addClass(post.nodes.root, 'old-ip');
    }
  };

  ThreadExcerpt = {
    init: function() {
      if (g.VIEW !== 'thread') {
        return;
      }
      return Thread.callbacks.push({
        name: 'Thread Excerpt',
        cb: this.node
      });
    },
    node: function() {
      return d.title = Get.threadExcerpt(this);
    },
    disconnect: function() {
      if (g.VIEW !== 'thread') {
        return;
      }
      return Thread.callbacks.disconnect('Thread Excerpt');
    }
  };

  ThreadStats = {
    init: function() {
      var html, sc, title;
      if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
        return;
      }
      html = ("[<span id=post-count>0</span> / <span id=file-count>0</span> " + (Conf['IP Count in Stats'] ? '/ <span id=ip-count>?</span>' : '') + " " + (Conf['Page Count in Stats'] ? '/ <span id=page-count>0</span>' : '') + "]").trim();
      title = ("Post Count / File Count " + (Conf['IP Count in Stats'] ? ' / IPs' : '') + " " + (g.BOARD.ID === 'f' ? ' / Purge Position' : Conf['Page Count in Stats'] ? ' / Page Count' : '')).trim();
      if (Conf['Updater and Stats in Header']) {
        this.dialog = sc = $.el('span', {
          innerHTML: html,
          id: 'thread-stats',
          title: title
        });
        Header.addShortcut(sc);
      } else {
        this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', {
          innerHTML: "<div class=move title='" + title + "'>" + html + "</div>"
        });
        $.addClass(doc, 'float');
        $.ready(function() {
          return $.add(d.body, sc);
        });
      }
      this.postCountEl = $('#post-count', sc);
      this.ipCountEl = $('#ip-count', sc);
      this.fileCountEl = $('#file-count', sc);
      this.pageCountEl = $('#page-count', sc);
      return Thread.callbacks.push({
        name: 'Thread Stats',
        cb: this.node
      });
    },
    node: function() {
      var fileCount, postCount;
      postCount = 0;
      fileCount = 0;
      this.posts.forEach(function(post) {
        postCount++;
        if (post.file) {
          fileCount++;
        }
        if (Conf["Page Count in Stats"]) {
          return ThreadStats.lastPost = post.info.date;
        }
      });
      ThreadStats.thread = this;
      ThreadStats.fetchPage();
      ThreadStats.update(postCount, fileCount, this.ipCount);
      return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate);
    },
    disconnect: function() {
      if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
        return;
      }
      if (Conf['Updater and Stats in Header']) {
        Header.rmShortcut(this.dialog);
      } else {
        $.rm(this.dialog);
      }
      clearTimeout(this.timeout);
      delete this.timeout;
      delete this.thread;
      delete this.postCountEl;
      delete this.fileCountEl;
      delete this.pageCountEl;
      delete this.dialog;
      Thread.callbacks.disconnect('Thread Stats');
      return $.off(d, 'ThreadUpdate', ThreadStats.onUpdate);
    },
    onUpdate: function(e) {
      var fileCount, ipCount, newPosts, postCount, _ref, _ref1;
      if (e.detail[404]) {
        return;
      }
      _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount, ipCount = _ref.ipCount, newPosts = _ref.newPosts;
      ThreadStats.update(postCount, fileCount, ipCount);
      if (!Conf["Page Count in Stats"]) {
        return;
      }
      if (newPosts.length) {
        ThreadStats.lastPost = g.posts[newPosts[newPosts.length - 1]].info.date;
      }
      if (ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((_ref1 = ThreadStats.pageCountEl) != null ? _ref1.textContent : void 0) !== '1') {
        return ThreadStats.fetchPage();
      }
    },
    update: function(postCount, fileCount, ipCount) {
      var fileCountEl, ipCountEl, postCountEl, thread;
      thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl, ipCountEl = ThreadStats.ipCountEl;
      postCountEl.textContent = postCount;
      fileCountEl.textContent = fileCount;
      if ((ipCount != null) && Conf["IP Count in Stats"]) {
        ipCountEl.textContent = ipCount;
      }
      (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning');
      return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning');
    },
    fetchPage: function() {
      if (!Conf["Page Count in Stats"]) {
        return;
      }
      clearTimeout(ThreadStats.timeout);
      if (ThreadStats.thread.isDead) {
        ThreadStats.pageCountEl.textContent = 'Dead';
        $.addClass(ThreadStats.pageCountEl, 'warning');
        return;
      }
      ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 2 * $.MINUTE);
      return $.ajax("//a.4cdn.org/" + ThreadStats.thread.board + "/threads.json", {
        onload: ThreadStats.onThreadsLoad
      }, {
        whenModified: true
      });
    },
    onThreadsLoad: function() {
      var page, purgePos, thread, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
      if (!(Conf["Page Count in Stats"] && this.status === 200)) {
        return;
      }
      _ref = this.response;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        page = _ref[_i];
        if (g.BOARD.ID === 'f') {
          purgePos = 1;
          _ref1 = page.threads;
          for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
            thread = _ref1[_j];
            if (thread.no < ThreadStats.thread.ID) {
              purgePos++;
            }
          }
          ThreadStats.pageCountEl.textContent = purgePos;
        } else {
          _ref2 = page.threads;
          for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
            thread = _ref2[_k];
            if (!(thread.no === ThreadStats.thread.ID)) {
              continue;
            }
            ThreadStats.pageCountEl.textContent = page.page;
            (page.page === this.response.length ? $.addClass : $.rmClass)(ThreadStats.pageCountEl, 'warning');
            ThreadStats.lastPageUpdate = new Date(thread.last_modified * $.SECOND);
            return;
          }
        }
      }
    }
  };

  ThreadUpdater = {
    init: function() {
      var box, checked, conf, el, input, name, sc, subEntries, _ref;
      if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
        return;
      }
      if (Conf['Updater and Stats in Header']) {
        this.dialog = sc = $.el('span', {
          id: 'updater'
        });
        $.extend(sc, {
          innerHTML: "[<span id=\"update-status\"></span><span id=\"update-timer\" title=\"Update now\"></span>]"
        });
        $.ready(function() {
          return Header.addShortcut(sc);
        });
      } else {
        this.dialog = sc = UI.dialog('updater', 'bottom: 0px; left: 0px;', {
          innerHTML: "<div class=\"move\"></div><span id=\"update-status\"></span><span id=\"update-timer\" title=\"Update now\"></span>"
        });
        $.ready(function() {
          $.addClass(doc, 'float');
          return $.add(d.body, sc);
        });
      }
      this.checkPostCount = 0;
      this.timer = $('#update-timer', sc);
      this.status = $('#update-status', sc);
      this.isUpdating = Conf['Auto Update'];
      $.on(this.timer, 'click', this.update);
      $.on(this.status, 'click', this.update);
      subEntries = [];
      box = UI.checkbox;
      _ref = Config.updater.checkbox;
      for (name in _ref) {
        conf = _ref[name];
        checked = Conf[name] ? 'checked' : '';
        el = box(name, name);
        input = el.firstElementChild;
        $.on(input, 'change', $.cb.checked);
        if (input.name === 'Scroll BG') {
          $.on(input, 'change', this.cb.scrollBG);
          this.cb.scrollBG();
        } else if (input.name === 'Auto Update') {
          $.on(input, 'change', this.cb.autoUpdate);
        }
        subEntries.push({
          el: el
        });
      }
      this.settings = $.el('span', {
        innerHTML: "<a href=\"javascript:;\">Interval</a>"
      });
      $.on(this.settings, 'click', this.intervalShortcut);
      subEntries.push({
        el: this.settings
      });
      Header.menu.addEntry(this.entry = {
        el: $.el('span', {
          textContent: 'Updater'
        }),
        order: 110,
        subEntries: subEntries
      });
      return Thread.callbacks.push({
        name: 'Thread Updater',
        cb: this.node
      });
    },
    disconnect: function() {
      var el, entry, input, name, _i, _j, _len, _len1, _ref, _ref1;
      if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
        return;
      }
      $.off(this.timer, 'click', this.update);
      $.off(this.status, 'click', this.update);
      if (this.timeoutID) {
        clearTimeout(this.timeoutID);
      }
      _ref = this.entry.subEntries;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        entry = _ref[_i];
        el = entry.el;
        input = el.firstElementChild;
        $.off(input, 'change', $.cb.checked);
        $.off(input, 'change', this.cb.scrollBG);
        $.off(input, 'change', this.cb.update);
      }
      $.off(this.settings, 'click', this.intervalShortcut);
      $.off(window, 'online offline', this.cb.online);
      $.off(d, 'QRPostSuccessful', this.cb.checkpost);
      $.off(d, 'visibilitychange', this.cb.visibility);
      this.set('timer', null);
      this.set('status', 'Offline');
      Header.menu.rmEntry(this.entry);
      if (Conf['Updater and Stats in Header']) {
        Header.rmShortcut(this.dialog);
      } else {
        $.rmClass(doc, 'float');
        $.rm(this.dialog);
      }
      _ref1 = ['checkPostCount', 'timer', 'status', 'isUpdating', 'entry', 'dialog', 'thread', 'root', 'lastPost', 'outdateCount', 'online', 'seconds', 'timeoutID'];
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        name = _ref1[_j];
        delete this[name];
      }
      return Thread.callbacks.disconnect('Thread Updater');
    },
    node: function() {
      ThreadUpdater.thread = this;
      ThreadUpdater.root = this.OP.nodes.root.parentNode;
      ThreadUpdater.lastPost = +this.posts.keys[this.posts.keys.length - 1];
      ThreadUpdater.outdateCount = 0;
      ThreadUpdater.cb.interval.call($.el('input', {
        value: Conf['Interval'],
        name: 'Interval'
      }));
      $.on(window, 'online offline', ThreadUpdater.cb.online);
      $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);
      $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
      if (ThreadUpdater.thread.isArchived) {
        ThreadUpdater.set('status', 'Archived', 'warning');
      } else {
        ThreadUpdater.cb.online();
      }
      return Rice.nodes(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.thread.isDead) {
          return;
        }
        if (ThreadUpdater.online = navigator.onLine) {
          ThreadUpdater.outdateCount = 0;
          ThreadUpdater.setInterval();
          ThreadUpdater.set('status', '', '');
          return;
        }
        ThreadUpdater.set('timer', '');
        ThreadUpdater.set('status', 'Offline', 'warning');
        return clearTimeout(ThreadUpdater.timeoutID);
      },
      post: function(e) {
        if (!(ThreadUpdater.isUpdating && e.detail.threadID === ThreadUpdater.thread.ID)) {
          return;
        }
        ThreadUpdater.outdateCount = 0;
        if (ThreadUpdater.seconds > 2) {
          return setTimeout(ThreadUpdater.update, 1000);
        }
      },
      checkpost: function(e) {
        if (!ThreadUpdater.checkPostCount) {
          if (e && e.detail.threadID !== ThreadUpdater.thread.ID) {
            return;
          }
          ThreadUpdater.seconds = 0;
          ThreadUpdater.outdateCount = 0;
          ThreadUpdater.set('timer', '...');
        }
        if (!(ThreadUpdater.thread.isDead || ThreadUpdater.foundPost || ThreadUpdater.checkPostCount >= 5)) {
          return setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND);
        }
        ThreadUpdater.setInterval();
        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.setInterval();
        }
      },
      scrollBG: function() {
        return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() {
          return true;
        } : function() {
          return !d.hidden;
        };
      },
      autoUpdate: function(e) {
        return ThreadUpdater.count(ThreadUpdater.isUpdating = this.checked);
      },
      interval: function(e) {
        var val;
        val = parseInt(this.value, 10);
        if (val < 1) {
          val = 1;
        }
        ThreadUpdater.interval = this.value = val;
        if (e) {
          return $.cb.value.call(this);
        }
      },
      load: function(e) {
        var req;
        req = ThreadUpdater.req;
        switch (req.status) {
          case 200:
            ThreadUpdater.parse(req.response.posts);
            if (ThreadUpdater.thread.isArchived) {
              ThreadUpdater.set('status', 'Archived', 'warning');
              ThreadUpdater.kill();
            } else {
              ThreadUpdater.setInterval();
            }
            break;
          case 404:
            $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/catalog.json", {
              onloadend: function() {
                var confirmed, page, thread, _i, _j, _len, _len1, _ref, _ref1;
                if (this.status === 200) {
                  confirmed = true;
                  _ref = this.response;
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                    page = _ref[_i];
                    _ref1 = page.threads;
                    for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
                      thread = _ref1[_j];
                      if (thread.no === ThreadUpdater.thread.ID) {
                        confirmed = false;
                        break;
                      }
                    }
                  }
                } else {
                  confirmed = false;
                }
                if (confirmed) {
                  ThreadUpdater.set('status', '404', 'warning');
                  return ThreadUpdater.kill();
                } else {
                  return ThreadUpdater.error(req);
                }
              }
            });
            break;
          default:
            ThreadUpdater.error(req);
        }
        if (ThreadUpdater.postID) {
          return ThreadUpdater.cb.checkpost();
        }
      }
    },
    kill: function() {
      ThreadUpdater.set('timer', '');
      clearTimeout(ThreadUpdater.timeoutID);
      ThreadUpdater.thread.kill();
      return $.event('ThreadUpdate', {
        404: true,
        threadID: ThreadUpdater.thread.fullID
      });
    },
    error: function(req) {
      var klass, text, _ref;
      ThreadUpdater.setInterval();
      _ref = req.status === 304 ? ['', ''] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1];
      return ThreadUpdater.set('status', text, klass);
    },
    setInterval: function() {
      var cur, i, j, limit;
      i = ThreadUpdater.interval + 1;
      if (Conf['Optional Increase']) {
        cur = ThreadUpdater.outdateCount || 1;
        limit = d.hidden ? 7 : 10;
        j = cur <= limit ? cur : limit;
        cur = (Math.floor(i * 0.1) || 1) * j * j;
        ThreadUpdater.seconds = cur > i ? cur <= 300 ? cur : 300 : i;
      } else {
        ThreadUpdater.seconds = i;
      }
      ThreadUpdater.set('timer', ThreadUpdater.seconds);
      return ThreadUpdater.count(true);
    },
    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;
      }
    },
    count: function(start) {
      clearTimeout(ThreadUpdater.timeoutID);
      if (start && ThreadUpdater.isUpdating && navigator.onLine) {
        return ThreadUpdater.timeout();
      }
    },
    timeout: function() {
      var n;
      ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
      if (!(n = --ThreadUpdater.seconds)) {
        ThreadUpdater.outdateCount++;
        return ThreadUpdater.update();
      } else if (n <= -60) {
        ThreadUpdater.set('status', 'Retrying', '');
        return ThreadUpdater.update();
      } else if (n > 0) {
        return ThreadUpdater.set('timer', n);
      }
    },
    update: function() {
      var url, _ref;
      if (!navigator.onLine) {
        return;
      }
      ThreadUpdater.count();
      if (Conf['Auto Update']) {
        ThreadUpdater.set('timer', '...');
      } else {
        ThreadUpdater.set('timer', 'Update');
      }
      if ((_ref = ThreadUpdater.req) != null) {
        _ref.abort();
      }
      url = "//a.4cdn.org/" + ThreadUpdater.thread.board + "/thread/" + ThreadUpdater.thread + ".json";
      return ThreadUpdater.req = $.ajax(url, {
        onabort: ThreadUpdater.cb.load,
        onloadend: ThreadUpdater.cb.load,
        ontimeout: ThreadUpdater.cb.load,
        timeout: $.MINUTE
      }, {
        whenModified: true
      });
    },
    updateThreadStatus: function(type, status) {
      var change, hasChanged;
      if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) {
        return;
      }
      ThreadUpdater.thread.setStatus(type, status);
      if (type === 'Closed' && ThreadUpdater.thread.isArchived) {
        return;
      }
      change = type === 'Sticky' ? status ? 'now a sticky' : 'not a sticky anymore' : status ? 'now closed' : 'not closed anymore';
      return new Notice('info', "The thread is " + change + ".", 30);
    },
    parse: function(postObjects) {
      var OP, count, files, index, node, num, post, postObject, posts, root, scroll, sendEvent, _i, _j, _len, _len1;
      OP = postObjects[0];
      Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
      ThreadUpdater.thread.setStatus('Archived', !!+OP.archived);
      ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
      ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
      ThreadUpdater.thread.postLimit = !!OP.bumplimit;
      ThreadUpdater.thread.fileLimit = !!OP.imagelimit;
      if (OP.unique_ips != null) {
        ThreadUpdater.thread.ipCount = OP.unique_ips;
      }
      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.ID);
        posts.push(new Post(node, ThreadUpdater.thread, ThreadUpdater.thread.board));
      }
      ThreadUpdater.thread.posts.forEach(function(post) {
        var ID;
        ID = +post.ID;
        if (!(post.info.date > Date.now() - 60 * $.SECOND)) {
          if (__indexOf.call(index, ID) < 0) {
            post.kill();
          } else if (post.isDead) {
            post.resurrect();
          } else if (post.file && !(post.file.isDead || __indexOf.call(files, ID) >= 0)) {
            post.kill(true);
          }
        }
        if (ThreadUpdater.postID && ThreadUpdater.postID === ID) {
          return ThreadUpdater.foundPost = true;
        }
      });
      sendEvent = function() {
        var ipCountEl, post;
        if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) {
          ipCountEl.textContent = OP.unique_ips;
          ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are');
          ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters');
        }
        ThreadUpdater.postIDs = index;
        return $.event('ThreadUpdate', {
          404: false,
          threadID: ThreadUpdater.thread.fullID,
          newPosts: (function() {
            var _j, _len1, _results;
            _results = [];
            for (_j = 0, _len1 = posts.length; _j < _len1; _j++) {
              post = posts[_j];
              _results.push(post.fullID);
            }
            return _results;
          })(),
          postCount: OP.replies + 1,
          fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead),
          ipCount: OP.unique_ips
        });
      };
      if (!count) {
        ThreadUpdater.set('status', '', '');
        ThreadUpdater.outdateCount++;
        sendEvent();
        return;
      }
      ThreadUpdater.set('status', "+" + count, 'new');
      ThreadUpdater.outdateCount = 0;
      ThreadUpdater.lastPost = posts[count - 1].ID;
      Post.callbacks.execute(posts);
      if ((Conf['Beep'] || Conf['Double Beep']) && d.hidden && Unread.posts && !Unread.posts.length) {
        if (!ThreadUpdater.audio) {
          ThreadUpdater.audio = $.el('audio', {
            src: ThreadUpdater.beep,
            onended: function() {
              if (QuoteMarkers.beep) {
                ThreadUpdater.audio.play();
                return QuoteMarkers.beep = false;
              }
            }
          });
        }
        if (QuoteMarkers.beep || Conf['Beep']) {
          ThreadUpdater.audio.play();
        }
      }
      if (QuoteMarkers.beep && !d.hidden) {
        QuoteMarkers.beep = false;
      }
      scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && Header.getBottomOf(ThreadUpdater.root) > -75;
      for (_j = 0, _len1 = posts.length; _j < _len1; _j++) {
        post = posts[_j];
        root = post.nodes.root;
        if (post.cb) {
          if (!post.cb()) {
            $.add(ThreadUpdater.root, root);
          }
        } else {
          $.add(ThreadUpdater.root, root);
        }
      }
      sendEvent();
      if (scroll) {
        if (Conf['Bottom Scroll']) {
          return window.scrollTo(0, d.body.clientHeight);
        } else {
          return Header.scrollTo(posts[0].nodes.root);
        }
      }
    }
  };

  ThreadWatcher = {
    init: function() {
      var el, _ref;
      if (!Conf['Thread Watcher']) {
        return;
      }
      this.db = new DataBoard('watchedThreads', this.refresh, true);
      this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', {
        innerHTML: "<div><span class=\"move\">Thread Watcher <a class=\"refresh fa\" title=\"Check threads\" href=\"javascript:;\">\uf021</a><span id=\"watcher-status\"></span></span><a class=\"menu-button\" href=\"javascript:;\"><i class=\"fa\">\uf107</i></a></div><div id=\"watched-threads\"></div>"
      });
      this.status = $('#watcher-status', this.dialog);
      this.list = this.dialog.lastElementChild;
      this.refreshButton = $('.refresh', this.dialog);
      this.unreaddb = Unread.db || new DataBoard('lastReadPosts');
      $.on(d, 'QRPostSuccessful', this.cb.post);
      if (g.VIEW === 'thread') {
        $.on(d, 'ThreadUpdate', this.cb.threadUpdate);
      }
      $.on(this.refreshButton, 'click', this.fetchAllStatus);
      $.on(d, '4chanXInitFinished', this.ready);
      switch (g.VIEW) {
        case 'index':
          $.on(d, 'IndexRefresh', this.cb.onIndexRefresh);
          break;
        case 'thread':
          $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh);
      }
      if (Conf['Slideout Watcher']) {
        ThreadWatcher.shortcut = el = $.el('div', {
          id: 'so-watcher',
          innerHTML: '<i class=a-icon></a>'
        });
      }
      ThreadWatcher.fetchAuto();
      if (Conf['JSON Navigation'] && Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f') {
        Menu.menu.addEntry({
          el: $.el('a', {
            href: 'javascript:;'
          }),
          order: 6,
          open: function(_arg) {
            var thread;
            thread = _arg.thread;
            if (!(Conf['Index Mode'] === 'catalog' && g.VIEW === 'index')) {
              return false;
            }
            this.el.textContent = ThreadWatcher.isWatched(thread) ? 'Unwatch thread' : 'Watch thread';
            if (this.cb) {
              $.off(this.el, 'click', this.cb);
            }
            this.cb = function() {
              $.event('CloseMenu');
              return ThreadWatcher.toggle(thread);
            };
            $.on(this.el, 'click', this.cb);
            return true;
          }
        });
      }
      Post.callbacks.push({
        name: 'Thread Watcher',
        cb: this.node
      });
      return CatalogThread.callbacks.push({
        name: 'Thread Watcher',
        cb: this.catalogNode
      });
    },
    isWatched: function(thread) {
      var _ref;
      return (_ref = ThreadWatcher.db) != null ? _ref.get({
        boardID: thread.board.ID,
        threadID: thread.ID
      }) : void 0;
    },
    node: function() {
      var toggler;
      if (this.isReply) {
        return;
      }
      if (this.isClone) {
        toggler = $('.watch-thread-link', this.nodes.post);
      } else {
        toggler = $.el('img', {
          className: 'watch-thread-link'
        });
        $.before($('input', this.nodes.post), toggler);
      }
      return $.on(toggler, 'click', ThreadWatcher.cb.toggle);
    },
    catalogNode: function() {
      if (ThreadWatcher.isWatched(this.thread)) {
        $.addClass(this.nodes.root, 'watched');
      }
      return $.on(this.nodes.thumb.parentNode, 'click', (function(_this) {
        return function(e) {
          if (!(e.button === 0 && e.altKey)) {
            return;
          }
          ThreadWatcher.toggle(_this.thread);
          return e.preventDefault();
        };
      })(this));
    },
    ready: function() {
      var el;
      $.off(d, '4chanXInitFinished', ThreadWatcher.ready);
      if (!Main.isThisPageLegit()) {
        return;
      }
      ThreadWatcher.refresh();
      if (Conf['Slideout Watcher']) {
        el = ThreadWatcher.shortcut;
        Header.addShortcut(el, true);
      } else {
        el = d.body;
      }
      $.add(el, ThreadWatcher.dialog);
      if (!Conf['Auto Watch']) {
        return;
      }
      return $.get('AutoWatch', 0, function(_arg) {
        var AutoWatch, thread;
        AutoWatch = _arg.AutoWatch;
        if (!(thread = g.BOARD.threads[AutoWatch])) {
          return;
        }
        ThreadWatcher.add(thread);
        return $["delete"]('AutoWatch');
      });
    },
    cb: {
      openAll: function() {
        var a, _i, _len, _ref;
        if ($.hasClass(this, 'disabled')) {
          return;
        }
        _ref = $$('a[title]', ThreadWatcher.list);
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          a = _ref[_i];
          $.open(a.href);
        }
        return $.event('CloseMenu');
      },
      pruneDeads: function() {
        var boardID, data, threadID, _i, _len, _ref, _ref1;
        if ($.hasClass(this, 'disabled')) {
          return;
        }
        _ref = ThreadWatcher.getAll();
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          _ref1 = _ref[_i], boardID = _ref1.boardID, threadID = _ref1.threadID, data = _ref1.data;
          if (!data.isDead) {
            continue;
          }
          delete ThreadWatcher.db.data.boards[boardID][threadID];
          ThreadWatcher.db.deleteIfEmpty({
            boardID: boardID
          });
        }
        ThreadWatcher.db.save();
        ThreadWatcher.refresh();
        return $.event('CloseMenu');
      },
      toggle: function() {
        var thread;
        thread = Get.postFromNode(this).thread;
        Index.followedThreadID = thread.ID;
        ThreadWatcher.toggle(thread);
        return delete Index.followedThreadID;
      },
      rm: function() {
        var boardID, threadID, _ref;
        _ref = this.parentNode.dataset.fullID.split('.'), boardID = _ref[0], threadID = _ref[1];
        return ThreadWatcher.rm(boardID, +threadID);
      },
      post: function(e) {
        var boardID, postID, threadID, _ref;
        _ref = e.detail, boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
        if (postID === threadID) {
          if (Conf['Auto Watch']) {
            return $.set('AutoWatch', threadID);
          }
        } else if (Conf['Auto Watch Reply']) {
          return ThreadWatcher.add(g.threads[boardID + '.' + threadID]);
        }
      },
      onIndexRefresh: function() {
        var boardID, data, db, threadID, _ref;
        db = ThreadWatcher.db;
        boardID = g.BOARD.ID;
        db.forceSync();
        _ref = db.data.boards[boardID];
        for (threadID in _ref) {
          data = _ref[threadID];
          if (!data.isDead && !(threadID in g.BOARD.threads)) {
            if (Conf['Auto Prune']) {
              ThreadWatcher.db["delete"]({
                boardID: boardID,
                threadID: threadID
              });
            } else {
              data.isDead = true;
              ThreadWatcher.db.set({
                boardID: boardID,
                threadID: threadID,
                val: data
              });
            }
          }
        }
        return ThreadWatcher.refresh();
      },
      onThreadRefresh: function(e) {
        var thread;
        thread = g.threads[e.detail.threadID];
        if (!(e.detail[404] && ThreadWatcher.db.get({
          boardID: thread.board.ID,
          threadID: thread.ID
        }))) {
          return;
        }
        return ThreadWatcher.add(thread);
      }
    },
    fetchCount: {
      fetched: 0,
      fetching: 0
    },
    fetchAuto: function() {
      var db, interval, now;
      clearTimeout(ThreadWatcher.timeout);
      if (!Conf['Auto Update Thread Watcher']) {
        return;
      }
      db = ThreadWatcher.db;
      interval = Conf['Show Unread Count'] ? 5 * $.MINUTE : 2 * $.HOUR;
      now = Date.now();
      if (now >= (db.data.lastChecked || 0) + interval) {
        db.data.lastChecked = now;
        ThreadWatcher.fetchAllStatus();
        db.save();
      }
      return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);
    },
    fetchAllStatus: function() {
      var thread, threads, _i, _len;
      ThreadWatcher.db.forceSync();
      ThreadWatcher.unreaddb.forceSync();
      QR.db.forceSync();
      if (!(threads = ThreadWatcher.getAll()).length) {
        return;
      }
      for (_i = 0, _len = threads.length; _i < _len; _i++) {
        thread = threads[_i];
        ThreadWatcher.fetchStatus(thread);
      }
    },
    fetchStatus: function(thread) {
      var boardID, data, fetchCount, threadID;
      boardID = thread.boardID, threadID = thread.threadID, data = thread.data;
      if (data.isDead && !Conf['Show Unread Count']) {
        return;
      }
      fetchCount = ThreadWatcher.fetchCount;
      if (fetchCount.fetching === 0) {
        ThreadWatcher.status.textContent = '...';
        $.addClass(ThreadWatcher.refreshButton, 'fa-spin');
      }
      fetchCount.fetching++;
      return $.ajax("//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json", {
        onloadend: function() {
          return ThreadWatcher.parseStatus.call(this, thread);
        }
      });
    },
    parseStatus: function(_arg) {
      var boardID, data, fetchCount, isDead, lastReadPost, match, postObj, quotingYou, regexp, status, threadID, unread, _i, _len, _ref;
      boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
      fetchCount = ThreadWatcher.fetchCount;
      fetchCount.fetched++;
      if (fetchCount.fetched === fetchCount.fetching) {
        fetchCount.fetched = 0;
        fetchCount.fetching = 0;
        status = '';
        $.rmClass(ThreadWatcher.refreshButton, 'fa-spin');
      } else {
        status = "" + (Math.round(fetchCount.fetched / fetchCount.fetching * 100)) + "%";
      }
      ThreadWatcher.status.textContent = status;
      if (this.status === 200 && this.response) {
        isDead = !!this.response.posts[0].archived;
        if (isDead && Conf['Auto Prune']) {
          ThreadWatcher.db["delete"]({
            boardID: boardID,
            threadID: threadID
          });
          ThreadWatcher.refresh();
          return;
        }
        lastReadPost = ThreadWatcher.unreaddb.get({
          boardID: boardID,
          threadID: threadID,
          defaultValue: 0
        });
        unread = quotingYou = 0;
        _ref = this.response.posts;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          postObj = _ref[_i];
          if (!(postObj.no > lastReadPost)) {
            continue;
          }
          if (QR.db.get({
            boardID: boardID,
            threadID: threadID,
            postID: postObj.no
          })) {
            continue;
          }
          unread++;
          if (!postObj.com) {
            continue;
          }
          regexp = /<a [^>]*\bhref="(?:\/([^\/]+)\/thread\/(\d+))?(?:#p(\d+))?"/g;
          while (match = regexp.exec(postObj.com)) {
            if (QR.db.get({
              boardID: match[1] || boardID,
              threadID: match[2] || threadID,
              postID: match[3] || match[2] || threadID
            })) {
              quotingYou++;
              continue;
            }
          }
        }
        if (isDead !== data.isDead || unread !== data.unread || quotingYou !== data.quotingYou) {
          data.isDead = isDead;
          data.unread = unread;
          data.quotingYou = quotingYou;
          ThreadWatcher.db.set({
            boardID: boardID,
            threadID: threadID,
            val: data
          });
          return ThreadWatcher.refresh();
        }
      } else if (this.status === 404) {
        if (Conf['Auto Prune']) {
          ThreadWatcher.db["delete"]({
            boardID: boardID,
            threadID: threadID
          });
        } else {
          data.isDead = true;
          delete data.unread;
          delete data.quotingYou;
          ThreadWatcher.db.set({
            boardID: boardID,
            threadID: threadID,
            val: data
          });
        }
        return ThreadWatcher.refresh();
      }
    },
    getAll: function() {
      var all, boardID, data, threadID, threads, _ref;
      all = [];
      _ref = ThreadWatcher.db.data.boards;
      for (boardID in _ref) {
        threads = _ref[boardID];
        if (Conf['Current Board'] && boardID !== g.BOARD.ID) {
          continue;
        }
        for (threadID in threads) {
          data = threads[threadID];
          all.push({
            boardID: boardID,
            threadID: threadID,
            data: data
          });
        }
      }
      return all;
    },
    makeLine: function(boardID, threadID, data) {
      var count, div, fullID, link, title, x;
      x = $.el('a', {
        className: 'fa',
        href: 'javascript:;',
        textContent: '\uf00d'
      });
      $.on(x, 'click', ThreadWatcher.cb.rm);
      link = $.el('a', {
        href: "/" + boardID + "/thread/" + threadID,
        title: data.excerpt,
        className: 'watcher-link'
      });
      if (Conf['Show Unread Count'] && (data.unread != null)) {
        count = $.el('span', {
          textContent: "(" + data.unread + ") ",
          className: 'watcher-unread'
        });
        $.prepend(link, count);
      }
      title = $.el('span', {
        textContent: data.excerpt,
        className: 'watcher-title'
      });
      $.add(link, title);
      div = $.el('div');
      fullID = "" + boardID + "." + threadID;
      div.dataset.fullID = fullID;
      if (g.VIEW === 'thread' && fullID === ("" + g.BOARD + "." + g.THREADID)) {
        $.addClass(div, 'current');
      }
      if (data.isDead) {
        $.addClass(div, 'dead-thread');
      }
      if (Conf['Show Unread Count']) {
        if (data.unread) {
          $.addClass(div, 'replies-unread');
        }
        if (data.quotingYou) {
          $.addClass(div, 'replies-quoting-you');
        }
      }
      $.add(div, [x, $.tn(' '), link]);
      return div;
    },
    refresh: function() {
      var boardID, data, list, nodes, refresher, threadID, _i, _j, _len, _len1, _ref, _ref1, _ref2;
      nodes = [];
      _ref = ThreadWatcher.getAll();
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        _ref1 = _ref[_i], boardID = _ref1.boardID, threadID = _ref1.threadID, data = _ref1.data;
        nodes.push(ThreadWatcher.makeLine(boardID, threadID, data));
      }
      list = ThreadWatcher.list;
      $.rmAll(list);
      $.add(list, nodes);
      g.threads.forEach(function(thread) {
        var helper, post, toggler, _j, _len1, _ref2;
        helper = ThreadWatcher.isWatched(thread) ? ['addClass', 'Unwatch'] : ['rmClass', 'Watch'];
        if (thread.OP) {
          _ref2 = [thread.OP].concat(__slice.call(thread.OP.clones));
          for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
            post = _ref2[_j];
            toggler = $('.watch-thread-link', post.nodes.post);
            $[helper[0]](toggler, 'watched');
            toggler.title = "" + helper[1] + " Thread";
          }
        }
        if (thread.catalogView) {
          return $[helper[0]](thread.catalogView.nodes.root, 'watched');
        }
      });
      if (Conf['Slideout Watcher']) {
        ThreadWatcher.refreshIcon();
      }
      _ref2 = ThreadWatcher.menu.refreshers;
      for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
        refresher = _ref2[_j];
        refresher();
      }
      if (Index.nodes && Conf['Pin Watched Threads']) {
        Index.sort();
        return Index.buildIndex();
      }
    },
    refreshIcon: function() {
      var className, _i, _len, _ref;
      _ref = ['replies-unread', 'replies-quoting-you'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        className = _ref[_i];
        ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog));
      }
    },
    update: function(boardID, threadID, newData) {
      var data, key, line, n, newLine, val, _ref;
      if (!(data = (_ref = ThreadWatcher.db) != null ? _ref.get({
        boardID: boardID,
        threadID: threadID
      }) : void 0)) {
        return;
      }
      if (newData.isDead && Conf['Auto Prune']) {
        ThreadWatcher.db["delete"]({
          boardID: boardID,
          threadID: threadID
        });
        ThreadWatcher.refresh();
        return;
      }
      n = 0;
      for (key in newData) {
        val = newData[key];
        if (data[key] !== val) {
          n++;
        }
      }
      if (!n) {
        return;
      }
      ThreadWatcher.db.forceSync();
      if (!(data = ThreadWatcher.db.get({
        boardID: boardID,
        threadID: threadID
      }))) {
        return;
      }
      $.extend(data, newData);
      ThreadWatcher.db.set({
        boardID: boardID,
        threadID: threadID,
        val: data
      });
      if (line = $("#watched-threads > [data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog)) {
        newLine = ThreadWatcher.makeLine(boardID, threadID, data);
        $.replace(line, newLine);
        if (Conf['Slideout Watcher']) {
          return ThreadWatcher.refreshIcon();
        }
      } else {
        return ThreadWatcher.refresh();
      }
    },
    toggle: function(thread) {
      var boardID, threadID;
      boardID = thread.board.ID;
      threadID = thread.ID;
      if (ThreadWatcher.db.get({
        boardID: boardID,
        threadID: threadID
      })) {
        return ThreadWatcher.rm(boardID, threadID);
      } else {
        return ThreadWatcher.add(thread);
      }
    },
    add: function(thread) {
      var boardID, data, threadID;
      data = {};
      boardID = thread.board.ID;
      threadID = thread.ID;
      if (thread.isDead) {
        if (Conf['Auto Prune'] && ThreadWatcher.db.get({
          boardID: boardID,
          threadID: threadID
        })) {
          ThreadWatcher.rm(boardID, threadID);
          return;
        }
        data.isDead = true;
      }
      data.excerpt = Get.threadExcerpt(thread);
      ThreadWatcher.db.set({
        boardID: boardID,
        threadID: threadID,
        val: data
      });
      ThreadWatcher.refresh();
      if (Conf['Show Unread Count']) {
        return ThreadWatcher.fetchStatus({
          boardID: boardID,
          threadID: threadID,
          data: data
        });
      }
    },
    rm: function(boardID, threadID) {
      ThreadWatcher.db["delete"]({
        boardID: boardID,
        threadID: threadID
      });
      return ThreadWatcher.refresh();
    },
    convert: function(oldFormat) {
      var boardID, data, newFormat, threadID, threads;
      newFormat = {};
      for (boardID in oldFormat) {
        threads = oldFormat[boardID];
        for (threadID in threads) {
          data = threads[threadID];
          (newFormat[boardID] || (newFormat[boardID] = {}))[threadID] = {
            excerpt: data.textContent
          };
        }
      }
      return newFormat;
    },
    menu: {
      refreshers: [],
      init: function() {
        var menu;
        if (!Conf['Thread Watcher']) {
          return;
        }
        menu = this.menu = new UI.Menu('thread watcher');
        $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) {
          return menu.toggle(e, this, ThreadWatcher);
        });
        this.addHeaderMenuEntry();
        return this.addMenuEntries();
      },
      addHeaderMenuEntry: function() {
        var entryEl;
        if (g.VIEW !== 'thread') {
          return;
        }
        entryEl = $.el('a', {
          href: 'javascript:;'
        });
        Header.menu.addEntry({
          el: entryEl,
          order: 60
        });
        $.on(entryEl, 'click', function() {
          return ThreadWatcher.toggle(g.threads["" + g.BOARD + "." + g.THREADID]);
        });
        return this.refreshers.push(function() {
          var addClass, rmClass, text, _ref;
          _ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = _ref[0], rmClass = _ref[1], text = _ref[2];
          $.addClass(entryEl, addClass);
          $.rmClass(entryEl, rmClass);
          return entryEl.textContent = text;
        });
      },
      addMenuEntries: function() {
        var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1;
        entries = [];
        entries.push({
          cb: ThreadWatcher.cb.openAll,
          entry: {
            el: $.el('a', {
              textContent: 'Open all threads'
            })
          },
          refresh: function() {
            return (ThreadWatcher.list.firstElementChild ? $.rmClass : $.addClass)(this.el, 'disabled');
          }
        });
        entries.push({
          cb: ThreadWatcher.cb.pruneDeads,
          entry: {
            el: $.el('a', {
              textContent: 'Prune dead threads'
            })
          },
          refresh: function() {
            return ($('.dead-thread', ThreadWatcher.list) ? $.rmClass : $.addClass)(this.el, 'disabled');
          }
        });
        subEntries = [];
        _ref = Config.threadWatcher;
        for (name in _ref) {
          conf = _ref[name];
          subEntries.push(this.createSubEntry(name, conf[1]));
        }
        entries.push({
          entry: {
            el: $.el('span', {
              textContent: 'Settings'
            }),
            subEntries: subEntries
          }
        });
        for (_i = 0, _len = entries.length; _i < _len; _i++) {
          _ref1 = entries[_i], entry = _ref1.entry, cb = _ref1.cb, refresh = _ref1.refresh;
          if (entry.el.nodeName === 'A') {
            entry.el.href = 'javascript:;';
          }
          if (cb) {
            $.on(entry.el, 'click', cb);
          }
          if (refresh) {
            this.refreshers.push(refresh.bind(entry));
          }
          this.menu.addEntry(entry);
        }
      },
      createSubEntry: function(name, desc) {
        var entry, input;
        entry = {
          type: 'thread watcher',
          el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
        };
        entry.el.title = desc;
        input = entry.el.firstElementChild;
        $.on(input, 'change', $.cb.checked);
        if (name === 'Current Board' || name === 'Show Unread Count') {
          $.on(input, 'change', ThreadWatcher.refresh);
        }
        if (name === 'Show Unread Count' || name === 'Auto Update Thread Watcher') {
          $.on(input, 'change', ThreadWatcher.fetchAuto);
        }
        return entry;
      }
    }
  };

  Unread = {
    init: function() {
      if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Scroll to Last Read Post'] || Conf['Thread Watcher'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) {
        return;
      }
      this.db = new DataBoard('lastReadPosts', this.sync);
      this.hr = $.el('hr', {
        id: 'unread-line'
      });
      this.posts = new Set();
      this.postsQuotingYou = new Set();
      this.order = new RandomAccessList();
      this.position = null;
      Thread.callbacks.push({
        name: 'Unread',
        cb: this.node
      });
      return Post.callbacks.push({
        name: 'Unread',
        cb: this.addPost
      });
    },
    disconnect: function() {
      var hr, name, _i, _len, _ref;
      if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Scroll to Last Read Post'] || Conf['Thread Watcher'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) {
        return;
      }
      Unread.db.disconnect();
      hr = Unread.hr;
      if (hr) {
        $.rm(hr);
      }
      _ref = ['db', 'hr', 'posts', 'postsQuotingYou', 'thread', 'title'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        name = _ref[_i];
        delete this[name];
      }
      this.lastReadPost = 0;
      $.off(d, 'ThreadUpdate', this.onUpdate);
      $.off(d, 'scroll visibilitychange', this.read);
      if (Conf['Unread Line']) {
        $.off(d, 'visibilitychange', this.setLine);
      }
      Thread.callbacks.disconnect('Unread');
      return Post.callbacks.disconnect('Unread');
    },
    node: function() {
      var ID, _i, _len, _ref;
      Unread.thread = this;
      Unread.title = d.title;
      Unread.lastReadPost = Unread.db.get({
        boardID: this.board.ID,
        threadID: this.ID,
        defaultValue: 0
      });
      Unread.readCount = 0;
      _ref = this.posts.keys;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        ID = _ref[_i];
        if (+ID <= Unread.lastReadPost) {
          Unread.readCount++;
        }
      }
      $.one(d, '4chanXInitFinished', Unread.ready);
      return $.on(d, 'ThreadUpdate', Unread.onUpdate);
    },
    ready: function() {
      Unread.setLine(true);
      Unread.read();
      Unread.update();
      if (Conf['Scroll to Last Read Post']) {
        if (d.hidden) {
          $.one(d, 'visibilitychange', Unread.scroll);
        }
        Unread.scroll();
      }
      $.on(d, 'scroll visibilitychange', Unread.read);
      if (Conf['Unread Line']) {
        return $.on(d, 'visibilitychange', Unread.setLine);
      }
    },
    positionPrev: function() {
      if (Unread.position) {
        return Unread.position.prev;
      } else {
        return Unread.order.last;
      }
    },
    scroll: function() {
      var hash, position, root;
      if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
        return;
      }
      position = Unread.positionPrev();
      while (position) {
        root = position.data.nodes.root;
        if (!root.getBoundingClientRect().height) {
          position = position.prev;
        } else {
          Header.scrollToIfNeeded(root, true);
          break;
        }
      }
    },
    sync: function() {
      var ID, i, lastReadPost, postIDs, _i, _ref, _ref1;
      if (Unread.lastReadPost == null) {
        return;
      }
      lastReadPost = Unread.db.get({
        boardID: Unread.thread.board.ID,
        threadID: Unread.thread.ID,
        defaultValue: 0
      });
      if (!(Unread.lastReadPost < lastReadPost)) {
        return;
      }
      Unread.lastReadPost = lastReadPost;
      postIDs = Unread.thread.posts.keys;
      for (i = _i = _ref = Unread.readCount, _ref1 = postIDs.length; _i < _ref1; i = _i += 1) {
        ID = +postIDs[i];
        if (!Unread.thread.posts[ID].isFetchedQuote) {
          if (ID > Unread.lastReadPost) {
            break;
          }
          Unread.posts["delete"](ID);
          Unread.postsQuotingYou["delete"](ID);
        }
        Unread.readCount++;
      }
      Unread.updatePosition();
      Unread.setLine();
      return Unread.update();
    },
    addPost: function() {
      if (this.isFetchedQuote || this.isClone) {
        return;
      }
      Unread.order.push(this);
      if (this.ID <= Unread.lastReadPost || this.isHidden || QR.db.get({
        boardID: this.board.ID,
        threadID: this.thread.ID,
        postID: this.ID
      })) {
        return;
      }
      Unread.posts.add(this.ID);
      Unread.addPostQuotingYou(this);
      return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
    },
    addPostQuotingYou: function(post) {
      var quotelink, _i, _len, _ref;
      _ref = post.nodes.quotelinks;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        quotelink = _ref[_i];
        if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
          continue;
        }
        Unread.postsQuotingYou.add(post.ID);
        Unread.openNotification(post);
        return;
      }
    },
    openNotification: function(post) {
      var notif;
      if (!Header.areNotificationsEnabled) {
        return;
      }
      notif = new Notification("" + post.info.nameBlock + " replied to you", {
        body: post.info[Conf['Remove Spoilers'] || Conf['Reveal Spoilers'] ? 'comment' : 'commentSpoilered'],
        icon: Favicon.logo
      });
      notif.onclick = function() {
        Header.scrollToIfNeeded(post.nodes.root, true);
        return window.focus();
      };
      return notif.onshow = function() {
        return setTimeout(function() {
          return notif.close();
        }, 7 * $.SECOND);
      };
    },
    onUpdate: function(e) {
      if (!e.detail[404]) {
        Unread.setLine();
        Unread.read();
      }
      return Unread.update();
    },
    readSinglePost: function(post) {
      var ID;
      ID = post.ID;
      if (!Unread.posts.has(ID)) {
        return;
      }
      Unread.posts["delete"](ID);
      Unread.postsQuotingYou["delete"](ID);
      Unread.updatePosition();
      Unread.saveLastReadPost();
      return Unread.update();
    },
    read: $.debounce(100, function(e) {
      var ID, count, data, height, root, _ref;
      if (d.hidden || !Unread.posts.size) {
        return;
      }
      height = doc.clientHeight;
      count = 0;
      while (Unread.position) {
        _ref = Unread.position, ID = _ref.ID, data = _ref.data;
        root = data.nodes.root;
        if (!(!root.getBoundingClientRect().height || Header.getBottomOf(root) > -1)) {
          break;
        }
        count++;
        Unread.posts["delete"](ID);
        Unread.postsQuotingYou["delete"](ID);
        if (Conf['Mark Quotes of You'] && QR.db.get({
          boardID: data.board.ID,
          threadID: data.thread.ID,
          postID: ID
        })) {
          QuoteMarkers.lastRead = root;
        }
        Unread.position = Unread.position.next;
      }
      if (!count) {
        return;
      }
      Unread.updatePosition();
      Unread.saveLastReadPost();
      if (e) {
        return Unread.update();
      }
    }),
    updatePosition: function() {
      while (Unread.position && !Unread.posts.has(Unread.position.ID)) {
        Unread.position = Unread.position.next;
      }
    },
    saveLastReadPost: $.debounce(2 * $.SECOND, function() {
      var ID, i, postIDs, _i, _ref, _ref1;
      postIDs = Unread.thread.posts.keys;
      for (i = _i = _ref = Unread.readCount, _ref1 = postIDs.length; _i < _ref1; i = _i += 1) {
        ID = +postIDs[i];
        if (!Unread.thread.posts[ID].isFetchedQuote) {
          if (Unread.posts.has(ID)) {
            break;
          }
          Unread.lastReadPost = ID;
        }
        Unread.readCount++;
      }
      if (Unread.thread.isDead && !Unread.thread.isArchived) {
        return;
      }
      Unread.db.forceSync();
      return Unread.db.set({
        boardID: Unread.thread.board.ID,
        threadID: Unread.thread.ID,
        val: Unread.lastReadPost
      });
    }),
    setLine: function(force) {
      if (!Conf['Unread Line']) {
        return;
      }
      if (d.hidden || (force === true)) {
        if (Unread.linePosition = Unread.positionPrev()) {
          $.after(Unread.linePosition.data.nodes.root, Unread.hr);
        } else {
          $.rm(Unread.hr);
        }
      }
      return Unread.hr.hidden = Unread.linePosition === Unread.order.last;
    },
    update: function() {
      var count, countQuotingYou, titleCount, titleDead, titleQuotingYou;
      count = Unread.posts.size;
      countQuotingYou = Unread.postsQuotingYou.size;
      if (Conf['Unread Count']) {
        titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : '';
        titleCount = count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '';
        titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title;
        d.title = "" + titleQuotingYou + titleCount + titleDead;
      }
      if (!(Unread.thread.isDead && !Unread.thread.isArchived)) {
        ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, {
          isDead: Unread.thread.isDead,
          unread: count,
          quotingYou: countQuotingYou
        });
      }
      if (!Conf['Unread Favicon']) {
        return;
      }
      Favicon.el.href = Unread.thread.isDead ? countQuotingYou ? Favicon.unreadDeadY : count ? Favicon.unreadDead : Favicon.dead : count ? countQuotingYou ? Favicon.unreadY : Favicon.unread : Favicon["default"];
      return $.add(d.head, Favicon.el);
    }
  };

  Redirect = {
    init: function() {
      var archive, archives, boardID, boards, data, files, id, name, o, record, software, type, withCredentials, _i, _j, _len, _len1, _ref, _ref1;
      o = {
        thread: {},
        post: {},
        file: {}
      };
      archives = {};
      _ref = Redirect.archives;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        data = _ref[_i];
        name = data.name, boards = data.boards, files = data.files, software = data.software, withCredentials = data.withCredentials;
        archives[name] = data;
        for (_j = 0, _len1 = boards.length; _j < _len1; _j++) {
          boardID = boards[_j];
          if (!(!withCredentials)) {
            continue;
          }
          if (!(boardID in o.thread)) {
            o.thread[boardID] = data;
          }
          if (!(boardID in o.post || software !== 'foolfuuka')) {
            o.post[boardID] = data;
          }
          if (!(boardID in o.file || __indexOf.call(files, boardID) < 0)) {
            o.file[boardID] = data;
          }
        }
      }
      _ref1 = Conf['selectedArchives'];
      for (boardID in _ref1) {
        record = _ref1[boardID];
        for (type in record) {
          id = record[type];
          if (!((archive = archives[id]))) {
            continue;
          }
          boards = type === 'file' ? archive.files : archive.boards;
          if (__indexOf.call(boards, boardID) < 0) {
            continue;
          }
          o[type][boardID] = archive;
        }
      }
      return Redirect.data = o;
    },
    archives: [{"uid":3,"name":"4plebs","domain":"archive.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["adv","f","hr","o","pol","s4s","sp","tg","trv","tv","x"],"files":["adv","f","hr","o","pol","s4s","sp","tg","trv","tv","x"]},{"uid":4,"name":"Nyafuu Archive","domain":"archive.nyafuu.org","http":true,"https":true,"software":"foolfuuka","boards":["c","e","w","wg"],"files":["c","e","w","wg"]},{"uid":5,"name":"Love is Over","domain":"archive.loveisover.me","http":true,"https":true,"software":"foolfuuka","boards":["c","d","e","i","lgbt","t","u"],"files":["c","d","e","i","lgbt","t","u"]},{"uid":8,"name":"Rebecca Black Tech","domain":"archive.rebeccablacktech.com","http":false,"https":true,"software":"fuuka","boards":["cgl","g","mu","qa","w"],"files":["cgl","g","mu","qa","w"]},{"uid":10,"name":"warosu","domain":"warosu.org","http":false,"https":true,"software":"fuuka","boards":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"],"files":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"]},{"uid":15,"name":"fgts","domain":"fgts.jp","http":true,"https":true,"software":"foolfuuka","boards":["asp","b","cm","h","hc","hm","n","p","qa","r","s","soc","toy","vp","y"],"files":["asp","b","cm","h","hc","hm","n","p","qa","r","s","soc","toy","vp","y"]},{"uid":23,"name":"Desustorage","domain":"desustorage.org","http":true,"https":true,"software":"foolfuuka","boards":["a","aco","an","c","co","d","fit","int","k","m","mlp","qa","r9k","tg","vr","wsg"],"files":["a","aco","an","c","co","d","fit","int","k","m","mlp","qa","r9k","tg","vr","wsg"]},{"uid":24,"name":"fireden.net","domain":"boards.fireden.net","http":false,"https":true,"software":"foolfuuka","boards":["cm","ic","vg","y"],"files":["cm","ic","vg","y"],"search":[]},{"uid":25,"name":"arch.b4k.co","domain":"arch.b4k.co","http":true,"https":true,"software":"foolfuuka","boards":["g","mlp","v"],"files":[],"search":[]},{"uid":26,"name":"poweredby.moe","domain":"archive.poweredby.moe","http":true,"https":true,"software":"foolfuuka","boards":["a","c","g","jp"],"files":["a","c","jp"],"search":[]}],
    to: function(dest, data) {
      var archive;
      archive = (dest === 'search' || dest === 'board' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
      if (!archive) {
        return '';
      }
      return Redirect[dest](archive, data);
    },
    protocol: function(archive) {
      var protocol;
      protocol = location.protocol;
      if (!archive[protocol.slice(0, -1)]) {
        protocol = protocol === 'https:' ? 'http:' : 'https:';
      }
      return "" + protocol + "//";
    },
    thread: function(archive, _arg) {
      var boardID, path, postID, threadID;
      boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID;
      path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID;
      if (archive.software === 'foolfuuka') {
        path += '/';
      }
      if (threadID && postID) {
        path += archive.software === 'foolfuuka' ? "#" + postID : "#p" + postID;
      }
      return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
    },
    post: function(archive, _arg) {
      var URL, boardID, postID, protocol;
      boardID = _arg.boardID, postID = _arg.postID;
      protocol = Redirect.protocol(archive);
      URL = new String("" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID);
      if (!Redirect.securityCheck(URL)) {
        return '';
      }
      URL.archive = archive;
      return URL;
    },
    file: function(archive, _arg) {
      var boardID, filename;
      boardID = _arg.boardID, filename = _arg.filename;
      return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
    },
    board: function(archive, _arg) {
      var boardID;
      boardID = _arg.boardID;
      return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/";
    },
    search: function(archive, _arg) {
      var boardID, path, type, value;
      boardID = _arg.boardID, type = _arg.type, value = _arg.value;
      type = type === 'name' ? 'username' : type === 'uniqueID' ? 'uid' : type === 'MD5' ? 'image' : type;
      value = encodeURIComponent(value);
      path = archive.software === 'foolfuuka' ? "" + boardID + "/search/" + type + "/" + value : "" + boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value;
      return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
    },
    securityCheck: function(URL) {
      return /^https:\/\//.test(URL) || location.protocol === 'http:' || Conf['Exempt Archives from Encryption'];
    },
    navigate: function(URL, alternative) {
      if (URL && (Redirect.securityCheck(URL) || confirm("Redirect to " + URL + "?\n\nYour connection will not be encrypted."))) {
        return location.replace(URL);
      } else if (alternative) {
        return location.replace(alternative);
      }
    }
  };

  PSAHiding = {
    init: function() {
      if (!Conf['Announcement Hiding']) {
        return;
      }
      $.addClass(doc, 'hide-announcement');
      return $.on(d, '4chanXInitFinished', this.setup);
    },
    setup: function() {
      var btn, entry, psa;
      $.off(d, '4chanXInitFinished', PSAHiding.setup);
      if (!(psa = $.id('globalMessage'))) {
        $.rmClass(doc, 'hide-announcement');
        return;
      }
      entry = {
        el: $.el('a', {
          textContent: 'Show announcement',
          className: 'show-announcement',
          href: 'javascript:;'
        }),
        order: 50,
        open: function() {
          return psa.hidden;
        }
      };
      Header.menu.addEntry(entry);
      $.on(entry.el, 'click', PSAHiding.toggle);
      PSAHiding.btn = btn = $.el('span', {
        title: 'Mark announcement as read and hide.',
        className: 'hide-announcement',
        href: 'javascript:;'
      });
      $.extend(btn, {
        innerHTML: "[<a href=\"javascript:;\">Dismiss</a>]"
      });
      $.on(btn, 'click', PSAHiding.toggle);
      $.get('hiddenPSA', 0, function(_arg) {
        var hiddenPSA;
        hiddenPSA = _arg.hiddenPSA;
        PSAHiding.sync(hiddenPSA);
        $.add(psa, btn);
        return $.rmClass(doc, 'hide-announcement');
      });
      return $.sync('hiddenPSA', PSAHiding.sync);
    },
    toggle: function(e) {
      var UTC;
      if ($.hasClass(this, 'hide-announcement')) {
        UTC = +$.id('globalMessage').dataset.utc;
        $.set('hiddenPSA', UTC);
      } else {
        $.event('CloseMenu');
        $["delete"]('hiddenPSA');
      }
      return PSAHiding.sync(UTC);
    },
    sync: function(UTC) {
      var hr, psa;
      psa = $.id('globalMessage');
      psa.hidden = PSAHiding.btn.hidden = UTC && UTC >= +psa.dataset.utc ? true : false;
      if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') {
        return hr.hidden = psa.hidden;
      }
    }
  };

  AntiAutoplay = {
    init: function() {
      var audio, _i, _len, _ref;
      if (!Conf['Disable Autoplaying Sounds']) {
        return;
      }
      $.addClass(doc, 'anti-autoplay');
      _ref = $$('audio[autoplay]', doc);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        audio = _ref[_i];
        this.stop(audio);
      }
      window.addEventListener('loadstart', ((function(_this) {
        return function(e) {
          return _this.stop(e.target);
        };
      })(this)), true);
      Post.callbacks.push({
        name: 'Disable Autoplaying Sounds',
        cb: this.node
      });
      CatalogThread.callbacks.push({
        name: 'Disable Autoplaying Sounds',
        cb: this.node
      });
      return $.ready((function(_this) {
        return function() {
          return _this.process(d.body);
        };
      })(this));
    },
    stop: function(audio) {
      if (!audio.autoplay) {
        return;
      }
      audio.pause();
      audio.autoplay = false;
      if (audio.controls) {
        return;
      }
      audio.controls = true;
      return $.addClass(audio, 'controls-added');
    },
    node: function() {
      return AntiAutoplay.process(this.nodes.root);
    },
    process: function(root) {
      var iframe, _i, _len, _ref, _results;
      _ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        iframe = _ref[_i];
        _results.push(iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''));
      }
      return _results;
    }
  };

  Banner = {
    banners: ["0.jpg","1.jpg","2.jpg","4.jpg","6.jpg","7.jpg","8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg","14.jpg","16.jpg","17.jpg","18.jpg","19.jpg","20.jpg","21.jpg","22.jpg","24.jpg","25.jpg","26.jpg","28.jpg","29.jpg","33.jpg","38.jpg","39.jpg","43.jpg","44.jpg","45.jpg","46.jpg","47.jpg","52.jpg","54.jpg","57.jpg","59.jpg","60.jpg","61.jpg","64.jpg","66.jpg","67.jpg","69.jpg","71.jpg","72.jpg","76.jpg","77.jpg","81.jpg","82.jpg","83.jpg","84.jpg","88.jpg","90.jpg","91.jpg","96.jpg","98.jpg","99.jpg","100.jpg","104.jpg","106.jpg","116.jpg","119.jpg","137.jpg","140.jpg","148.jpg","149.jpg","150.jpg","154.jpg","156.jpg","157.jpg","158.jpg","159.jpg","161.jpg","162.jpg","164.jpg","165.jpg","166.jpg","167.jpg","168.jpg","169.jpg","170.jpg","171.jpg","172.jpg","173.jpg","174.jpg","175.jpg","176.jpg","178.jpg","179.jpg","180.jpg","181.jpg","182.jpg","183.jpg","186.jpg","189.jpg","190.jpg","192.jpg","193.jpg","194.jpg","197.jpg","198.jpg","200.jpg","201.jpg","202.jpg","203.jpg","205.jpg","206.jpg","207.jpg","208.jpg","210.jpg","213.jpg","214.jpg","215.jpg","216.jpg","218.jpg","219.jpg","220.jpg","221.jpg","222.jpg","223.jpg","224.jpg","227.jpg","0.png","1.png","2.png","3.png","5.png","6.png","9.png","10.png","11.png","12.png","14.png","16.png","19.png","20.png","21.png","22.png","23.png","24.png","26.png","27.png","28.png","29.png","30.png","31.png","32.png","33.png","34.png","37.png","39.png","40.png","41.png","42.png","43.png","44.png","45.png","48.png","49.png","50.png","51.png","52.png","53.png","57.png","58.png","59.png","64.png","66.png","67.png","68.png","69.png","70.png","71.png","72.png","76.png","78.png","81.png","82.png","85.png","86.png","87.png","89.png","95.png","98.png","100.png","101.png","102.png","105.png","106.png","107.png","109.png","110.png","111.png","112.png","113.png","114.png","115.png","116.png","118.png","119.png","120.png","121.png","122.png","123.png","126.png","128.png","130.png","134.png","136.png","138.png","139.png","140.png","142.png","145.png","146.png","149.png","150.png","151.png","152.png","153.png","154.png","155.png","156.png","157.png","158.png","159.png","160.png","163.png","164.png","165.png","166.png","167.png","168.png","169.png","170.png","171.png","172.png","173.png","174.png","178.png","179.png","180.png","181.png","182.png","184.png","186.png","188.png","190.png","192.png","193.png","194.png","195.png","196.png","197.png","198.png","200.png","202.png","203.png","205.png","206.png","207.png","209.png","212.png","213.png","214.png","216.png","217.png","218.png","219.png","220.png","221.png","222.png","223.png","224.png","225.png","226.png","229.png","231.png","232.png","233.png","234.png","235.png","237.png","238.png","239.png","240.png","241.png","242.png","244.png","245.png","246.png","247.png","248.png","249.png","250.png","253.png","254.png","255.png","257.png","258.png","259.png","260.png","262.png","268.png","0.gif","1.gif","2.gif","3.gif","4.gif","5.gif","6.gif","7.gif","8.gif","9.gif","10.gif","12.gif","13.gif","14.gif","15.gif","16.gif","18.gif","19.gif","20.gif","21.gif","22.gif","23.gif","24.gif","28.gif","29.gif","30.gif","33.gif","34.gif","35.gif","36.gif","37.gif","39.gif","40.gif","42.gif","44.gif","45.gif","46.gif","48.gif","50.gif","52.gif","54.gif","55.gif","57.gif","58.gif","59.gif","60.gif","61.gif","62.gif","63.gif","64.gif","66.gif","67.gif","68.gif","69.gif","70.gif","72.gif","73.gif","75.gif","76.gif","77.gif","78.gif","80.gif","81.gif","82.gif","83.gif","86.gif","87.gif","88.gif","92.gif","93.gif","94.gif","95.gif","96.gif","97.gif","98.gif","99.gif","100.gif","101.gif","102.gif","103.gif","104.gif","105.gif","106.gif","108.gif","109.gif","110.gif","111.gif","112.gif","113.gif","115.gif","116.gif","117.gif","118.gif","119.gif","120.gif","122.gif","123.gif","124.gif","127.gif","129.gif","130.gif","131.gif","134.gif","135.gif","136.gif","138.gif","139.gif","141.gif","144.gif","146.gif","148.gif","149.gif","153.gif","154.gif","155.gif","157.gif","158.gif","159.gif","160.gif","161.gif","162.gif","164.gif","166.gif","167.gif","168.gif","169.gif","170.gif","171.gif","172.gif","173.gif","174.gif","175.gif","176.gif","177.gif","178.gif","181.gif","182.gif","183.gif","185.gif","186.gif","187.gif","188.gif","189.gif","190.gif","191.gif","192.gif","193.gif","195.gif","196.gif","197.gif","200.gif","201.gif","202.gif","203.gif","204.gif","205.gif","206.gif","207.gif","208.gif","209.gif","210.gif","211.gif","212.gif","213.gif","214.gif","215.gif","216.gif","217.gif","219.gif","220.gif","221.gif","222.gif","224.gif","225.gif","226.gif","227.gif","228.gif","230.gif","232.gif","233.gif","234.gif","235.gif","238.gif","240.gif","241.gif","243.gif","244.gif","245.gif","246.gif","247.gif","249.gif","250.gif","251.gif","253.gif"],
    init: function() {
      return $.asap((function() {
        return d.body;
      }), function() {
        return $.asap((function() {
          return $('hr');
        }), Banner.ready);
      });
    },
    ready: function() {
      var banner, child, children, i, img, nodes, title, _i, _len;
      banner = $(".boardBanner");
      title = $.el("div", {
        id: "boardTitle"
      });
      children = banner.children;
      nodes = [];
      if (g.BOARD.ID !== 'f' && g.VIEW === 'thread' && Conf['Remove Thread Excerpt']) {
        Banner.setTitle(children[1].textContent);
      }
      for (i = _i = 0, _len = children.length; _i < _len; i = ++_i) {
        child = children[i];
        if (i === 0) {
          $.rm(child);
          img = $.el('img', {
            alt: '4chan',
            title: 'Click to change'
          });
          $.on(img, 'click', Banner.cb.toggle);
          Banner.cb.toggle.call(img);
          $.prepend(banner, img);
          continue;
        }
        if (Conf['Custom Board Titles']) {
          Banner.custom(child).title = "Ctrl/\u2318+click to edit board " + (i === 2 ? 'sub' : '') + "title";
          child.spellcheck = false;
        }
        nodes.push(child);
      }
      $.add(title, nodes);
      $.after(banner, title);
    },
    setTitle: function(title) {
      if (Unread.title != null) {
        Unread.title = title;
        return Unread.update();
      } else {
        return d.title = title;
      }
    },
    cb: {
      toggle: function() {
        var banner, i, _ref;
        if (!((_ref = Banner.choices) != null ? _ref.length : void 0)) {
          Banner.choices = Banner.banners.slice();
        }
        i = Math.floor(Banner.choices.length * Math.random());
        banner = Banner.choices.splice(i, 1);
        return this.src = "//s.4cdn.org/image/title/" + banner;
      },
      click: function(e) {
        if (e.ctrlKey || e.metaKey) {
          this.contentEditable = true;
          return this.focus();
        }
      },
      keydown: function(e) {
        e.stopPropagation();
        if (!e.shiftKey && e.keyCode === 13) {
          return this.blur();
        }
      },
      focus: function() {
        var items, string, string2;
        string = "" + g.BOARD + "." + this.className;
        string2 = "" + string + ".orig";
        items = {
          title: this.textContent
        };
        items[string] = '';
        items[string2] = false;
        $.get(items, function(items) {
          if (!(items[string2] && items.title === items[string])) {
            return $.set(string2, items.title);
          }
        });
      },
      blur: function() {
        this.contentEditable = false;
        return $.set("" + g.BOARD + "." + this.className, this.textContent);
      }
    },
    custom: function(child) {
      var cachedTest, string;
      cachedTest = child.textContent;
      string = "" + g.BOARD + "." + child.className;
      $.on(child, 'click keydown focus blur', function(e) {
        return Banner.cb[e.type].apply(this, [e]);
      });
      $.get(string, cachedTest, function(item) {
        var string2, title;
        if (!(title = item[string])) {
          return;
        }
        if (Conf['Persistent Custom Board Titles']) {
          return child.textContent = title;
        }
        string2 = "" + string + ".orig";
        return $.get(string2, cachedTest, function(itemb) {
          if (cachedTest === itemb[string2]) {
            return child.textContent = title;
          } else {
            $.set(string, cachedTest);
            return $.set(string2, cachedTest);
          }
        });
      });
      return child;
    }
  };

  CatalogLinks = {
    init: function() {
      var el, input;
      if (!Conf['Catalog Links']) {
        return;
      }
      CatalogLinks.el = el = $.el('label', {
        id: 'toggleCatalog',
        href: 'javascript:;',
        innerHTML: "<input type=checkbox " + (Conf['Header catalog links'] ? 'checked' : '') + "> Catalog Links"
      });
      input = $('input', el);
      $.on(input, 'change', this.toggle);
      $.sync('Header catalog links', CatalogLinks.set);
      Header.menu.addEntry({
        el: el,
        order: 95
      });
      return $.asap((function() {
        return $.id('boardNavDesktopFoot');
      }), function() {
        return CatalogLinks.set(Conf['Header catalog links']);
      });
    },
    toggle: function() {
      $.event('CloseMenu');
      $.set('Header catalog links', this.checked);
      return CatalogLinks.set(this.checked);
    },
    set: function(useCatalog) {
      var a, board, generateURL, path, _i, _len, _ref, _ref1;
      path = useCatalog ? 'catalog' : '';
      generateURL = useCatalog && Conf['External Catalog'] ? CatalogLinks.external : CatalogLinks.internal;
      _ref = $$("#board-list a:not(.catalog), #boardNavDesktopFoot a");
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        a = _ref[_i];
        if (((_ref1 = a.hostname) !== 'boards.4chan.org' && _ref1 !== 'catalog.neet.tv' && _ref1 !== '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || $.hasClass(a, 'external')) {
          continue;
        }
        a.href = generateURL(board, path);
      }
      return CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
    },
    internal: function(board, path) {
      return "/" + board + "/" + path;
    },
    external: function(board) {
      if (board === 'a' || board === 'c' || board === 'g' || board === 'co' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'w' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'cgl' || board === 'ck' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'int' || board === 'jp' || board === 'mlp' || board === 'lit' || board === 'mu' || board === 'n' || board === 'po' || board === 'sci' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'x' || board === 'q') {
        return "http://catalog.neet.tv/" + board;
      } else {
        return "/" + board + "/catalog";
      }
    }
  };

  CustomCSS = {
    init: function() {
      if (!Conf['Custom CSS']) {
        return;
      }
      return this.addStyle();
    },
    addStyle: function() {
      return this.style = $.addStyle(Conf['usercss'], 'CustomCSS');
    },
    rmStyle: function() {
      if (this.style) {
        $.rm(this.style);
        return delete this.style;
      }
    },
    update: function() {
      if (!this.style) {
        return this.addStyle();
      }
      return this.style.textContent = Conf['usercss'];
    }
  };

  ExpandComment = {
    init: function() {
      if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Navigation']) {
        return;
      }
      if (g.BOARD.ID === 'g') {
        this.callbacks.push(Fourchan.code);
      }
      if (g.BOARD.ID === 'sci') {
        this.callbacks.push(Fourchan.math);
      }
      return Post.callbacks.push({
        name: 'Comment Expansion',
        cb: this.node
      });
    },
    node: function() {
      var a;
      if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
        return $.on(a, 'click', ExpandComment.cb);
      }
    },
    callbacks: [],
    cb: function(e) {
      e.preventDefault();
      return ExpandComment.expand(Get.postFromNode(this));
    },
    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("//a.4cdn.org" + (a.pathname.split('/').splice(0, 4).join('/')) + ".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 (status !== 200 && status !== 304) {
        a.textContent = "Error " + req.statusText + " (" + status + ")";
        return;
      }
      posts = 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;
        }
        if (href[0] === '#') {
          quote.href = "" + (a.pathname.split('/').splice(0, 4).join('/')) + href;
        } else {
          quote.href = "" + (a.pathname.split('/').splice(0, 3).join('/')) + "/" + 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 = {
    statuses: {},
    init: function() {
      if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
        return;
      }
      return $.on(d, (Conf['JSON Navigation'] ? 'IndexRefresh' : '4chanXInitFinished'), this.onIndexRefresh);
    },
    setButton: function(thread) {
      var a, summary;
      if (!(summary = $.x('following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
        return;
      }
      a = $.el('a', {
        textContent: ExpandThread.text.apply(ExpandThread, ['+'].concat(__slice.call(summary.textContent.match(/\d+/g)))),
        href: "res/" + thread.ID,
        className: 'summary'
      });
      $.on(a, 'click', ExpandThread.cbToggle);
      return $.replace(summary, a);
    },
    disconnect: function() {
      this.refresh();
      return $.off(d, 'IndexRefresh', this.onIndexRefresh);
    },
    refresh: function(disconnect) {
      var status, threadID, _ref, _ref1;
      if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
        return;
      }
      _ref = ExpandThread.statuses;
      for (threadID in _ref) {
        status = _ref[threadID];
        if ((_ref1 = status.req) != null) {
          _ref1.abort();
        }
        delete ExpandThread.statuses[threadID];
      }
    },
    onIndexRefresh: function() {
      ExpandThread.refresh();
      return g.BOARD.threads.forEach(function(thread) {
        return ExpandThread.setButton(thread);
      });
    },
    text: function(status, posts, files) {
      return ("" + status + " " + posts + " post" + (posts > 1 ? 's' : '')) + (+files ? " and " + files + " image repl" + (files > 1 ? 'ies' : 'y') : "") + (" " + (status === '-' ? 'shown' : 'omitted') + ".");
    },
    cbToggle: function(e) {
      if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
        return;
      }
      e.preventDefault();
      return ExpandThread.toggle(Get.threadFromNode(this));
    },
    toggle: function(thread) {
      var a, threadRoot;
      threadRoot = thread.OP.nodes.root.parentNode;
      if (!(a = $('.summary', threadRoot))) {
        return;
      }
      if (thread.ID in ExpandThread.statuses) {
        return ExpandThread.contract(thread, a, threadRoot);
      } else {
        return ExpandThread.expand(thread, a, threadRoot);
      }
    },
    expand: function(thread, a, threadRoot) {
      var status;
      ExpandThread.statuses[thread] = status = {};
      a.textContent = ExpandThread.text.apply(ExpandThread, ['...'].concat(__slice.call(a.textContent.match(/\d+/g))));
      return status.req = $.cache("//a.4cdn.org/" + thread.board + "/thread/" + thread + ".json", function() {
        delete status.req;
        return ExpandThread.parse(this, thread, a);
      });
    },
    contract: function(thread, a, threadRoot) {
      var filesCount, inlined, num, postsCount, replies, reply, status, _i, _len;
      status = ExpandThread.statuses[thread];
      delete ExpandThread.statuses[thread];
      if (status.req) {
        status.req.abort();
        if (a) {
          a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(__slice.call(a.textContent.match(/\d+/g))));
        }
        return;
      }
      replies = $$('.thread > .replyContainer', threadRoot);
      if (Conf['Show Replies']) {
        num = (function() {
          if (thread.isSticky) {
            return 1;
          } else {
            switch (g.BOARD.ID) {
              case 'b':
              case 'vg':
                return 3;
              case 't':
                return 1;
              default:
                return 5;
            }
          }
        })();
        replies = replies.slice(0, -num);
      }
      postsCount = 0;
      filesCount = 0;
      for (_i = 0, _len = replies.length; _i < _len; _i++) {
        reply = replies[_i];
        if (Conf['Quote Inlining']) {
          while (inlined = $('.inlined', reply)) {
            inlined.click();
          }
        }
        postsCount++;
        if ('file' in Get.postFromRoot(reply)) {
          filesCount++;
        }
        $.rm(reply);
      }
      return a.textContent = ExpandThread.text('+', postsCount, filesCount);
    },
    parse: function(req, thread, a) {
      var filesCount, post, postData, posts, postsCount, postsRoot, root, _i, _len, _ref, _ref1;
      if ((_ref = req.status) !== 200 && _ref !== 304) {
        a.textContent = "Error " + req.statusText + " (" + req.status + ")";
        return;
      }
      Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler;
      posts = [];
      postsRoot = [];
      filesCount = 0;
      _ref1 = req.response.posts;
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        postData = _ref1[_i];
        if (postData.no === thread.ID) {
          continue;
        }
        if (post = thread.posts[postData.no]) {
          if ('file' in post) {
            filesCount++;
          }
          postsRoot.push(post.nodes.root);
          continue;
        }
        root = Build.postFromObject(postData, thread.board.ID);
        post = new Post(root, thread, thread.board);
        if ('file' in post) {
          filesCount++;
        }
        posts.push(post);
        postsRoot.push(root);
      }
      Post.callbacks.execute(posts);
      $.after(a, postsRoot);
      postsCount = postsRoot.length;
      return a.textContent = ExpandThread.text('-', postsRoot.length, filesCount);
    }
  };

  FileInfo = {
    init: function() {
      if (!Conf['File Info Formatting']) {
        return;
      }
      return Post.callbacks.push({
        name: 'File Info Formatting',
        cb: this.node
      });
    },
    node: function() {
      if (!this.file || this.isClone) {
        return;
      }
      return this.file.text.innerHTML = "<span class=file-info>" + (FileInfo.format(Conf['fileInfo'], this)) + "</span>";
    },
    format: function(formatString, post) {
      return formatString.replace(/%([A-Za-z])/g, function(s, c) {
        if (c in FileInfo.formatters) {
          return FileInfo.formatters[c].call(post);
        } else {
          return s;
        }
      });
    },
    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 === '<' && '&lt;' || '&gt;';
      });
    },
    formatters: {
      t: function() {
        return this.file.URL.match(/\d+\..+$/)[0];
      },
      T: function() {
        return "<a href=" + this.file.URL + " target=_blank>" + (FileInfo.formatters.t.call(this)) + "</a>";
      },
      l: function() {
        return "<a href=" + this.file.URL + " target=_blank>" + (FileInfo.formatters.n.call(this)) + "</a>";
      },
      L: function() {
        return "<a href=" + this.file.URL + " target=_blank>" + (FileInfo.formatters.N.call(this)) + "</a>";
      },
      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 "<span class=fntrunc>" + (FileInfo.escape(shortname)) + "</span><span class=fnfull>" + (FileInfo.escape(fullname)) + "</span>";
        }
      },
      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() {
        return this.file.dimensions || 'PDF';
      }
    }
  };

  Flash = {
    init: function() {
      if (g.BOARD.ID === 'f') {
        return $.ready(Flash.initReady);
      }
    },
    initReady: function() {
      var nav, sauceLink, swfName;
      $.globalEval('SWFEmbed.init()');
      if (g.VIEW !== 'thread') {
        return;
      }
      swfName = $('.fileText > a');
      nav = $('.navLinks.desktop');
      swfName = swfName.href.replace(/^(.*?)\/f\//g, "");
      sauceLink = $.el('a', {
        textContent: 'Check Sauce on SWFCHAN',
        href: "http://eye.swfchan.com/search/?q=" + swfName,
        target: "_blank"
      });
      $.addClass(nav, 'swfSauce');
      $.rmClass(nav, 'navLinks');
      $.rmAll(nav);
      return $.add(nav, [$.tn('['), sauceLink, $.tn(']')]);
    }
  };

  Fourchan = {
    init: function() {
      var id, _ref;
      if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
        return;
      }
      id = g.BOARD.ID;
      if (id === 'g') {
        $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n  window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n    detail: prettyPrintOne(e.detail)\n  }));\n}, false);');
        Post.callbacks.push({
          name: 'Parse /g/ code',
          cb: this.code
        });
      }
      if (id === 'sci') {
        $.globalEval('window.addEventListener(\'jsmath\', function(e) {\n  if (!jsMath) return;\n  if (jsMath.loaded) {\n    // process one post\n    jsMath.ProcessBeforeShowing(e.target);\n  } else if (jsMath.Autoload && jsMath.Autoload.checked) {\n    // load jsMath and process whole document\n    jsMath.Autoload.Script.Push(\'ProcessBeforeShowing\', [null]);\n    jsMath.Autoload.LoadJsMath();\n  }\n}, false);');
        Post.callbacks.push({
          name: 'Parse /sci/ math',
          cb: this.math
        });
        CatalogThread.callbacks.push({
          name: 'Parse /sci/ math',
          cb: this.math
        });
      }
      return Main.ready(function() {
        return $.globalEval('(function() {\n  window.clickable_ids = false;\n  var nodes = document.querySelectorAll(\'.posteruid, .capcode\');\n  for (var i = 0; i < nodes.length; i++) {\n    nodes[i].removeEventListener("click", window.idClick, false);\n  }\n  window.removeEventListener("message", Report.onMessage, false);\n})();');
      });
    },
    code: function() {
      var apply, pre, _i, _len, _ref;
      if (this.isClone) {
        return;
      }
      apply = function(e) {
        pre.innerHTML = e.detail;
        return $.addClass(pre, 'prettyprinted');
      };
      $.on(window, 'prettyprint:cb', apply);
      _ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        pre = _ref[_i];
        $.event('prettyprint', pre.innerHTML, window);
      }
      $.off(window, 'prettyprint:cb', apply);
    },
    math: function() {
      if ((this.isClone && doc.contains(this.origin.nodes.root)) || !$('.math', this.nodes.comment)) {
        return;
      }
      return $.asap(((function(_this) {
        return function() {
          return doc.contains(_this.nodes.comment);
        };
      })(this)), (function(_this) {
        return function() {
          return $.event('jsmath', null, _this.nodes.comment);
        };
      })(this));
    }
  };

  IDColor = {
    init: function() {
      var _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Color User IDs'])) {
        return;
      }
      this.ids = {
        Heaven: [0, 0, 0, '#fff']
      };
      return Post.callbacks.push({
        name: 'Color User IDs',
        cb: this.node
      });
    },
    node: function() {
      var rgb, span, style, uid;
      if (this.isClone || !((uid = this.info.uniqueID) && (span = $('span.hand', this.nodes.uniqueID)))) {
        return;
      }
      rgb = IDColor.ids[uid] || IDColor.compute(uid);
      style = span.style;
      style.color = rgb[3];
      style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
      return $.addClass(span, 'painted');
    },
    compute: function(uid) {
      var hash, rgb;
      hash = IDColor.hash(uid);
      rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
      rgb.push((rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff');
      return this.ids[uid] = rgb;
    },
    hash: function(uid) {
      var i, msg;
      msg = 0;
      i = 0;
      while (i < 8) {
        msg = (msg << 5) - msg + uid.charCodeAt(i++);
      }
      return msg;
    }
  };

  IDHighlight = {
    init: function() {
      var _ref;
      if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
        return;
      }
      return Post.callbacks.push({
        name: 'Highlight by User ID',
        cb: this.node
      });
    },
    uniqueID: null,
    node: function() {
      if (this.nodes.uniqueID) {
        $.on(this.nodes.uniqueID, 'click', IDHighlight.click(this));
      }
      if (this.nodes.capcode) {
        $.on(this.nodes.capcode, 'click', IDHighlight.click(this));
      }
      if (!this.isClone) {
        return IDHighlight.set(this);
      }
    },
    set: function(post) {
      var match;
      match = (post.info.uniqueID || post.info.capcode) === IDHighlight.uniqueID;
      return $[match ? 'addClass' : 'rmClass'](post.nodes.post, 'highlight');
    },
    click: function(post) {
      return function() {
        var uniqueID;
        uniqueID = post.info.uniqueID || post.info.capcode;
        IDHighlight.uniqueID = IDHighlight.uniqueID === uniqueID ? null : uniqueID;
        return g.posts.forEach(IDHighlight.set);
      };
    }
  };

  Keybinds = {
    init: function() {
      var hotkey, init;
      if (!Conf['Keybinds']) {
        return;
      }
      for (hotkey in Conf.hotkeys) {
        $.sync(hotkey, Keybinds.sync);
      }
      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);
    },
    sync: function(key, hotkey) {
      return Conf[hotkey] = key;
    },
    keydown: function(e) {
      var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
      if (!(key = Keybinds.keyCode(e))) {
        return;
      }
      target = e.target;
      if (target.nodeName === 'EMBED') {
        return;
      }
      if ((_ref = target.nodeName) === 'INPUT' || _ref === 'TEXTAREA') {
        if (!/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key)) {
          return;
        }
      }
      if (!(((_ref1 = g.VIEW) !== 'index' && _ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
        threadRoot = Nav.getThread();
        if (op = $('.op', threadRoot)) {
          thread = Get.postFromNode(op).thread;
        }
      }
      switch (key) {
        case Conf['Toggle board list']:
          if (!Conf['Custom Board Navigation']) {
            return;
          }
          Header.toggleBoardList();
          break;
        case Conf['Toggle header']:
          Header.toggleBarVisibility();
          break;
        case Conf['Open empty QR']:
          Keybinds.qr();
          break;
        case Conf['Open QR']:
          if (!threadRoot) {
            return;
          }
          Keybinds.qr(threadRoot);
          break;
        case Conf['Open settings']:
          Settings.open();
          break;
        case Conf['Close']:
          if (Settings.dialog) {
            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.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) {
            if (Conf['Persistent QR']) {
              QR.hide();
            } else {
              QR.close();
            }
          } else if (Embedding.lastEmbed) {
            Embedding.closeFloat();
          } else {
            return;
          }
          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 && !QR.nodes.el.hidden)) {
            return;
          }
          Keybinds.sage();
          break;
        case Conf['Submit QR']:
          if (!(QR.nodes && !QR.nodes.el.hidden)) {
            return;
          }
          if (!QR.status()) {
            QR.submit();
          }
          break;
        case Conf['Post Without Name']:
          if (!(QR.nodes && !QR.status())) {
            return;
          }
          Keybinds.name();
          QR.submit();
          break;
        case Conf['Update']:
          switch (g.VIEW) {
            case 'thread':
              if (!Conf['Thread Updater']) {
                return;
              }
              ThreadUpdater.update();
              break;
            case 'index':
              if (!Conf['JSON Navigation']) {
                return;
              }
              Index.update();
              break;
            default:
              return;
          }
          break;
        case Conf['Watch']:
          if (!thread) {
            return;
          }
          ThreadWatcher.toggle(thread);
          break;
        case Conf['Expand image']:
          if (!(ImageExpand.enabled && threadRoot)) {
            return;
          }
          Keybinds.img(threadRoot);
          break;
        case Conf['Expand images']:
          if (!(ImageExpand.enabled && threadRoot)) {
            return;
          }
          Keybinds.img(threadRoot, true);
          break;
        case Conf['Open Gallery']:
          if (!Gallery.enabled) {
            return;
          }
          Gallery.cb.toggle();
          break;
        case Conf['fappeTyme']:
          if (!(Conf['Fappe Tyme'] && ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') && g.BOARD.ID !== 'f')) {
            return;
          }
          FappeTyme.cb.toggle.call({
            name: 'fappe'
          });
          break;
        case Conf['werkTyme']:
          if (!(Conf['Werk Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD.ID !== 'f')) {
            return;
          }
          FappeTyme.cb.toggle.call({
            name: 'werk'
          });
          break;
        case Conf['Front page']:
          if (Conf['JSON Navigation'] && g.VIEW === 'index') {
            Index.userPageNav(1);
          } else {
            window.location = "/" + g.BOARD + "/";
          }
          break;
        case Conf['Open front page']:
          $.open("/" + g.BOARD + "/");
          break;
        case Conf['Next page']:
          if (g.VIEW !== 'index') {
            return;
          }
          if (Conf['JSON Navigation']) {
            if ((_ref4 = Conf['Index Mode']) !== 'paged' && _ref4 !== 'infinite') {
              return;
            }
            $('.next button', Index.pagelist).click();
          } else {
            if (form = $('.next form')) {
              window.location = form.action;
            }
          }
          break;
        case Conf['Previous page']:
          if (g.VIEW !== 'index') {
            return;
          }
          if (Conf['JSON Navigation']) {
            if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
              return;
            }
            $('.prev button', Index.pagelist).click();
          } else {
            if (form = $('.prev form')) {
              window.location = form.action;
            }
          }
          break;
        case Conf['Search form']:
          if (g.VIEW !== 'index') {
            return;
          }
          searchInput = Conf['JSON Navigation'] ? Index.searchInput : $.id('search-box');
          Header.scrollToIfNeeded(searchInput);
          searchInput.focus();
          break;
        case Conf['Paged mode']:
          if (!(g.VIEW === 'index' && Conf['Index Mode'] !== 'paged')) {
            return;
          }
          Index.setIndexMode('paged');
          break;
        case Conf['All pages mode']:
          if (!(g.VIEW === 'index' && Conf['Index Mode'] !== 'all pages')) {
            return;
          }
          Index.setIndexMode('all pages');
          break;
        case Conf['Catalog mode']:
          if (!(g.VIEW === 'index' && Conf['Index Mode'] !== 'catalog')) {
            return;
          }
          Index.setIndexMode('catalog');
          break;
        case Conf['Cycle sort type']:
          if (g.VIEW !== 'index') {
            return;
          }
          Index.cycleSortType();
          break;
        case Conf['Open catalog']:
          if (Conf['External Catalog']) {
            window.location = CatalogLinks.external(g.BOARD.ID);
          } else {
            if (!Conf['JSON Navigation']) {
              return window.location = "/" + g.BOARD + "/catalog";
            }
            if (!(g.VIEW === 'index' && Conf['Index Mode'] !== 'catalog')) {
              return;
            }
            Index.setIndexMode('catalog');
          }
          break;
        case Conf['Next thread']:
          if (!(g.VIEW === 'index' && threadRoot)) {
            return;
          }
          Nav.scroll(+1);
          break;
        case Conf['Previous thread']:
          if (!(g.VIEW === 'index' && threadRoot)) {
            return;
          }
          Nav.scroll(-1);
          break;
        case Conf['Expand thread']:
          if (!(g.VIEW === 'index' && threadRoot)) {
            return;
          }
          ExpandThread.toggle(thread);
          break;
        case Conf['Open thread']:
          if (!(g.VIEW === 'index' && threadRoot)) {
            return;
          }
          Keybinds.open(thread);
          break;
        case Conf['Open thread tab']:
          if (!(g.VIEW === 'index' && threadRoot)) {
            return;
          }
          Keybinds.open(thread, true);
          break;
        case Conf['Next reply']:
          if (!threadRoot) {
            return;
          }
          Keybinds.hl(+1, threadRoot);
          break;
        case Conf['Previous reply']:
          if (!threadRoot) {
            return;
          }
          Keybinds.hl(-1, threadRoot);
          break;
        case Conf['Deselect reply']:
          if (!threadRoot) {
            return;
          }
          Keybinds.hl(0, threadRoot);
          break;
        case Conf['Hide']:
          if (!threadRoot) {
            return;
          }
          PostHiding.toggle(thread.OP);
          break;
        case Conf['Previous Post Quoting You']:
          if (!threadRoot) {
            return;
          }
          QuoteMarkers.cb.seek('preceding');
          break;
        case Conf['Next Post Quoting You']:
          if (!threadRoot) {
            return;
          }
          QuoteMarkers.cb.seek('following');
          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) {
      if (!QR.postingIsEnabled) {
        return;
      }
      QR.open();
      if (thread != null) {
        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, supported, value;
      supported = (function() {
        switch (tag) {
          case 'spoiler':
            return !!$('.postForm input[name=spoiler]');
          case 'code':
            return g.BOARD.ID === 'g';
          case 'math':
          case 'eqn':
            return g.BOARD.ID === 'sci';
        }
      })();
      if (!supported) {
        new Notice('warning', "[" + tag + "] tags are not supported on /" + g.BOARD + "/.", 20);
      }
      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);
    },
    name: function() {
      return QR.nodes.name.value = '';
    },
    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 = Build.path(thread.board.ID, thread.ID);
      if (tab) {
        return $.open(url);
      } else {
        return location.href = url;
      }
    },
    hl: function(delta, thread) {
      var axis, height, next, postEl, replies, reply, root, _i, _len;
      postEl = $('.reply.highlight', thread);
      if (!delta) {
        if (postEl) {
          $.rmClass(postEl, 'highlight');
        }
        return;
      }
      if (postEl) {
        height = postEl.getBoundingClientRect().height;
        if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
          root = postEl.parentNode;
          axis = delta === +1 ? 'following' : 'preceding';
          if (!(next = $.x("" + axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
            return;
          }
          Header.scrollToIfNeeded(next, delta === +1);
          this.focus(next);
          $.rmClass(postEl, 'highlight');
          return;
        }
        $.rmClass(postEl, 'highlight');
      }
      replies = $$('.reply', thread);
      if (delta === -1) {
        replies.reverse();
      }
      for (_i = 0, _len = replies.length; _i < _len; _i++) {
        reply = replies[_i];
        if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) {
          this.focus(reply);
          return;
        }
      }
    },
    focus: function(post) {
      return $.addClass(post, 'highlight');
    }
  };

  Nav = {
    init: function() {
      var next, prev;
      switch (g.VIEW) {
        case 'index':
          if (!Conf['Index Navigation']) {
            return;
          }
          break;
        case 'thread':
          if (!Conf['Reply Navigation']) {
            return;
          }
          break;
        default:
          return;
      }
      prev = $.el('a', {
        href: 'javascript:;',
        id: 'navPrev'
      });
      next = $.el('a', {
        href: 'javascript:;',
        id: 'navNext'
      });
      Header.addShortcut(prev, true);
      Header.addShortcut(next, true);
      $.on(prev, 'click', this.prev);
      return $.on(next, 'click', this.next);
    },
    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() {
      var thread, threadRoot, _i, _len, _ref;
      _ref = $$('.thread');
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        threadRoot = _ref[_i];
        thread = Get.threadFromRoot(threadRoot);
        if (thread.isHidden && !thread.stub) {
          continue;
        }
        if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) {
          return threadRoot;
        }
      }
      return $('.board');
    },
    scroll: function(delta) {
      var axis, extra, next, thread, top, _ref;
      if ((_ref = d.activeElement) != null) {
        _ref.blur();
      }
      thread = Nav.getThread();
      axis = delta === +1 ? 'following' : 'preceding';
      if (next = $.x("" + axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
        top = Header.getTopOf(thread);
        if (delta === +1 && top < 5 || delta === -1 && top > -5) {
          thread = next;
        }
      }
      extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom;
      if (extra > 0) {
        d.body.style.marginBottom = "" + extra + "px";
      }
      Header.scrollTo(thread);
      if (extra > 0 && !Nav.haveExtra) {
        Nav.haveExtra = true;
        return $.on(d, 'scroll', Nav.removeExtra);
      }
    },
    removeExtra: function() {
      var extra;
      extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;
      if (extra > 0) {
        return d.body.style.marginBottom = "" + extra + "px";
      } else {
        d.body.style.marginBottom = null;
        delete Nav.haveExtra;
        return $.off(d, 'scroll', Nav.removeExtra);
      }
    }
  };

  RelativeDates = {
    INTERVAL: $.MINUTE / 2,
    init: function() {
      var _ref;
      if (((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
        this.flush();
        $.on(d, 'visibilitychange ThreadUpdate', this.flush);
      }
      if (Conf['Relative Post Dates']) {
        return Post.callbacks.push({
          name: 'Relative Post Dates',
          cb: this.node
        });
      }
    },
    node: function() {
      var dateEl;
      dateEl = this.nodes.date;
      if (Conf['Relative Date Title']) {
        $.on(dateEl, 'mouseover', (function(_this) {
          return function() {
            return RelativeDates.hover(_this);
          };
        })(this));
        return;
      }
      if (this.isClone) {
        return;
      }
      dateEl.title = dateEl.textContent;
      return RelativeDates.update(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 * years) > 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 data, now, _i, _len, _ref;
      if (d.hidden) {
        return;
      }
      now = new Date();
      _ref = RelativeDates.stale;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        data = _ref[_i];
        RelativeDates.update(data, now);
      }
      RelativeDates.stale = [];
      clearTimeout(RelativeDates.timeout);
      return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL);
    },
    hover: function(post) {
      var date, diff, now;
      date = post.info.date;
      now = new Date();
      diff = now - date;
      return post.nodes.date.title = RelativeDates.relative(diff, now, date);
    },
    update: function(data, now) {
      var date, diff, isPost, relative, singlePost, _i, _len, _ref;
      isPost = data instanceof Post;
      date = isPost ? data.info.date : new Date(+data.dataset.utc);
      now || (now = new Date());
      diff = now - date;
      relative = RelativeDates.relative(diff, now, date);
      if (isPost) {
        _ref = [data].concat(data.clones);
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          singlePost = _ref[_i];
          singlePost.nodes.date.firstChild.textContent = relative;
        }
      } else {
        data.firstChild.textContent = relative;
      }
      return RelativeDates.setOwnTimeout(diff, data);
    },
    setOwnTimeout: function(diff, data) {
      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(RelativeDates.markStale, delay, data);
    },
    markStale: function(data) {
      if (__indexOf.call(RelativeDates.stale, data) >= 0) {
        return;
      }
      if (data instanceof Post && !g.posts[data.fullID]) {
        return;
      }
      return RelativeDates.stale.push(data);
    }
  };

  RemoveSpoilers = {
    init: function() {
      if (Conf['Reveal Spoilers']) {
        $.addClass(doc, 'reveal-spoilers');
      }
      if (!Conf['Remove Spoilers']) {
        return;
      }
      $.addClass(doc, 'remove-spoilers');
      Post.callbacks.push({
        name: 'Reveal Spoilers',
        cb: this.node
      });
      CatalogThread.callbacks.push({
        name: 'Reveal Spoilers',
        cb: this.node
      });
      if (g.VIEW === 'archive') {
        return $.ready(function() {
          return RemoveSpoilers.unspoiler($.id('arc-list'));
        });
      }
    },
    node: function(post) {
      return RemoveSpoilers.unspoiler(this.nodes.comment);
    },
    unspoiler: function(el) {
      var span, spoiler, spoilers, _i, _len;
      spoilers = $$('s', el);
      for (_i = 0, _len = spoilers.length; _i < _len; _i++) {
        spoiler = spoilers[_i];
        span = $.el('span', {
          className: 'removed-spoiler'
        });
        $.replace(spoiler, span);
        $.add(span, __slice.call(spoiler.childNodes));
      }
    }
  };

  Time = {
    init: function() {
      var _ref;
      if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Time Formatting'])) {
        return;
      }
      return Post.callbacks.push({
        name: 'Time Formatting',
        cb: this.node
      });
    },
    node: function() {
      if (this.isClone) {
        return;
      }
      return this.nodes.date.textContent = Time.format(Conf['time'], this.info.date);
    },
    format: function(formatString, date) {
      return formatString.replace(/%(.)/g, function(s, c) {
        if (c in Time.formatters) {
          return Time.formatters[c].call(date);
        } else {
          return s;
        }
      });
    },
    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().toString().slice(2);
      },
      Y: function() {
        return this.getFullYear();
      },
      '%': function() {
        return '%';
      }
    }
  };

  GlobalMessage = {
    init: function() {
      return $.asap((function() {
        return d.body;
      }), function() {
        return $.asap((function() {
          return $.id('delform');
        }), GlobalMessage.ready);
      });
    },
    ready: function() {
      var child, el, _i, _len, _ref;
      if (el = $("#globalMessage", d.body)) {
        _ref = el.children;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          child = _ref[_i];
          child.cssText = "";
        }
      }
    }
  };

  JSColor = {
    css: function() {
      return ".jscBox { width: 251px; height: 155px; } .jscBoxB, .jscPadB, .jscPadM, .jscSldB, .jscSldM, .jscBtn { position: absolute; clear: both; } .jscBoxB { left: 320px; bottom: 20px; z-index: 30; border: 1px solid; border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight; background: ThreeDFace; } .jscPad { width: 181px; height: 101px; background-image: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1)), linear-gradient(to right, rgb(255,0,0), rgb(255,255,0), rgb(0,255,0), rgb(0,255,255), rgb(0,0,255), rgb(255,0,255), rgb(255,0,0)); background-repeat: no-repeat; background-position: 0 0; } .jscPadB { left: 10px; top: 10px; border: 1px solid; border-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow; } .jscPadM { left: 0; top: 0; width: 200px; height: 121px; cursor: crosshair; background-image: url('data:image/gif;base64,R0lGODlhDwAPAKEBAAAAAP///////////yH5BAEKAAIALAAAAAAPAA8AAAIklB8Qx53b4otSUWcvyiz4/4AeQJbmKY4p1HHapBlwPL/uVRsFADs='); background-repeat: no-repeat; } .jscSld { width: 16px; height: 101px; background-image: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,1)); } .jscSldB { right: 10px; top: 10px; border: 1px solid; border-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow; } .jscSldM { right: 0; top: 0; width: 36px; height: 121px; cursor: pointer; background-image: url('data:image/gif;base64,R0lGODlhBwALAKECAAAAAP///6g8eKg8eCH5BAEKAAIALAAAAAAHAAsAAAITTIQYcLnsgGxvijrxqdQq6DRJAQA7'); background-repeat: no-repeat; } .jscBtn { right: 10px; bottom: 10px; padding: 0 15px; height: 18px; border: 1px solid; border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight; color: ButtonText; text-align: center; cursor: pointer; } .jscBtnS { line-height: 10px; }";
    },
    bind: function(el) {
      if (!el.color) {
        return el.color = new JSColor.color(el);
      }
    },
    fetchElement: function(mixed) {
      if (typeof mixed === "string") {
        return $.id(mixed);
      } else {
        return mixed;
      }
    },
    fireEvent: function(el, event) {
      if (!el) {
        return;
      }
      return $.event(event, null, el);
    },
    getRelMousePos: function(e) {
      var x, y;
      e || (e = window.event);
      x = 0;
      y = 0;
      if (typeof e.offsetX === 'number') {
        x = e.offsetX;
        y = e.offsetY;
      } else if (typeof e.layerX === 'number') {
        x = e.layerX;
        y = e.layerY;
      }
      return {
        x: x,
        y: y
      };
    },
    color: function(target) {
      var HSV_RGB, RGB_HSV, THIS, abortBlur, blurTarget, blurValue, drawPicker, holdPad, holdSld, isPickerOwner, leavePad, leaveSld, leaveStyle, leaveValue, redrawPad, redrawSld, removePicker, setPad, setSld, styleElement, valueElement;
      this.hsv = [0, 0, 1];
      this.rgb = [1, 1, 1];
      this.valueElement = this.styleElement = target;
      abortBlur = holdPad = holdSld = false;
      this.hidePicker = function() {
        if (isPickerOwner()) {
          return removePicker();
        }
      };
      this.showPicker = function() {
        if (!isPickerOwner()) {
          return drawPicker();
        }
      };
      this.importColor = function() {
        if (!valueElement) {
          return this.exportColor();
        } else {
          if (!this.fromString(valueElement.value, leaveValue)) {
            styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
            return this.exportColor(leaveValue | leaveStyle);
          }
        }
      };
      this.exportColor = function(flags) {
        var value;
        if (!(flags & leaveValue) && valueElement) {
          value = '#' + this.toString();
          valueElement.value = value;
          valueElement.previousSibling.value = value;
          editTheme[valueElement.previousSibling.name] = value;
          setTimeout(function() {
            return Style.setTheme(editTheme);
          });
        }
        if (!(flags & leaveStyle) && styleElement) {
          styleElement.style.backgroundColor = '#' + this.toString();
        }
        if (!(flags & leavePad) && isPickerOwner()) {
          redrawPad();
        }
        if (!(flags & leaveSld) && isPickerOwner()) {
          return redrawSld();
        }
      };
      this.fromHSV = function(h, s, v, flags) {
        this.hsv = [h = h ? $.minmax(h, 0.0, 6.0) : this.hsv[0], s = s ? $.minmax(s, 0.0, 1.0) : this.hsv[1], v = v ? $.minmax(v, 0.0, 1.0) : this.hsv[2]];
        this.rgb = HSV_RGB(h, s, v);
        return this.exportColor(flags);
      };
      this.fromRGB = function(r, g, b, flags) {
        var hsv;
        r = r != null ? $.minmax(r, 0.0, 1.0) : this.rgb[0];
        g = g != null ? $.minmax(g, 0.0, 1.0) : this.rgb[1];
        b = b != null ? $.minmax(b, 0.0, 1.0) : this.rgb[2];
        hsv = RGB_HSV(r, g, b);
        if (hsv[0] != null) {
          this.hsv[0] = $.minmax(hsv[0], 0.0, 6.0);
        }
        if (hsv[2] !== 0) {
          this.hsv[1] = hsv[1] == null ? null : $.minmax(hsv[1], 0.0, 1.0);
        }
        this.hsv[2] = hsv[2] == null ? null : $.minmax(hsv[2], 0.0, 1.0);
        this.rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]);
        return this.exportColor(flags);
      };
      this.fromString = function(number, flags) {
        var m, val;
        m = number.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
        if (!m) {
          return false;
        } else {
          if (m[1].length === 6) {
            this.fromRGB(parseInt(m[1].substr(0, 2), 16) / 255, parseInt(m[1].substr(2, 2), 16) / 255, parseInt(m[1].substr(4, 2), 16) / 255, flags);
          } else {
            this.fromRGB(parseInt((val = m[1].charAt(0)) + val, 16) / 255, parseInt((val = m[1].charAt(1)) + val, 16) / 255, parseInt((val = m[1].charAt(2)) + val, 16) / 255, flags);
          }
          return true;
        }
      };
      this.toString = function() {
        return (0x100 | Math.round(255 * this.rgb[0])).toString(16).substr(1) + (0x100 | Math.round(255 * this.rgb[1])).toString(16).substr(1) + (0x100 | Math.round(255 * this.rgb[2])).toString(16).substr(1);
      };
      RGB_HSV = function(r, g, b) {
        var h, m, n, v;
        n = (n = r < g ? r : g) < b ? n : b;
        v = (v = r > g ? r : g) > b ? v : b;
        m = v - n;
        if (m === 0) {
          return [null, 0, v];
        }
        h = r === n ? 3 + (b - g) / m : g === n ? 5 + (r - b) / m : 1 + (g - r) / m;
        return [h === 6 ? 0 : h, m / v, v];
      };
      HSV_RGB = function(h, s, v) {
        var f, i, m, n;
        if (h == null) {
          return [v, v, v];
        }
        i = Math.floor(h);
        f = i % 2 ? h - i : 1 - (h - i);
        m = v * (1 - s);
        n = v * (1 - s * f);
        switch (i) {
          case 6:
          case 0:
            return [v, n, m];
          case 1:
            return [n, v, m];
          case 2:
            return [m, v, n];
          case 3:
            return [m, n, v];
          case 4:
            return [n, m, v];
          case 5:
            return [v, m, n];
        }
      };
      removePicker = function() {
        delete JSColor.picker.owner;
        return $.rm(JSColor.picker.boxB);
      };
      drawPicker = function(x, y) {
        var box, boxB, btn, btnS, elements, item, p, pad, padB, padM, sld, sldB, sldM, _i, _len;
        if (!(p = JSColor.picker)) {
          elements = ['box', 'boxB', 'pad', 'padB', 'padM', 'sld', 'sldB', 'sldM', 'btn'];
          p = {};
          for (_i = 0, _len = elements.length; _i < _len; _i++) {
            item = elements[_i];
            p[item] = $.el('div', {
              className: "jsc" + (item.charAt(0).toUpperCase() + item.slice(1))
            });
          }
          p.btnS = $.el('span', {
            className: 'jscBtnS'
          });
          p.btnT = $.tn('Close');
          JSColor.picker = p;
          $.add(p.box, [p.sldB, p.sldM, p.padB, p.padM, p.btn]);
          $.add(p.sldB, p.sld);
          $.add(p.padB, p.pad);
          $.add(p.btnS, p.btnT);
          $.add(p.btn, p.btnS);
          $.add(p.boxB, p.box);
        }
        box = p.box, boxB = p.boxB, btn = p.btn, btnS = p.btnS, pad = p.pad, padB = p.padB, padM = p.padM, sld = p.sld, sldB = p.sldB, sldM = p.sldM;
        box.onmouseup = box.onmouseout = function() {
          return target.focus();
        };
        box.onmousedown = function() {
          return abortBlur = true;
        };
        box.onmousemove = function(e) {
          if (holdPad || holdSld) {
            holdPad && setPad(e);
            holdSld && setSld(e);
            if (d.selection) {
              return d.selection.empty();
            } else if (window.getSelection) {
              return window.getSelection().removeAllRanges();
            }
          }
        };
        padM.onmouseup = padM.onmouseout = function() {
          if (holdPad) {
            holdPad = false;
            return JSColor.fireEvent(valueElement, 'change');
          }
        };
        padM.onmousedown = function(e) {
          if (THIS.hsv[2] === 0) {
            THIS.fromHSV(null, null, 1.0);
          }
          holdPad = true;
          return setPad(e);
        };
        sldM.onmouseup = sldM.onmouseout = function() {
          if (holdSld) {
            holdSld = false;
            return JSColor.fireEvent(valueElement, 'change');
          }
        };
        sldM.onmousedown = function(e) {
          holdSld = true;
          return setSld(e);
        };
        btn.onmousedown = function() {
          return THIS.hidePicker();
        };
        redrawPad();
        redrawSld();
        JSColor.picker.owner = THIS;
        return $.add(ThemeTools.dialog, p.boxB);
      };
      redrawPad = function() {
        var rgb;
        JSColor.picker.padM.style.backgroundPosition = "" + (4 + Math.round((THIS.hsv[0] / 6) * 180)) + "px " + (4 + Math.round((1 - THIS.hsv[1]) * 100)) + "px";
        rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
        JSColor.picker.sld.style.backgroundColor = "rgb(" + (rgb[0] * 100) + "%, " + (rgb[1] * 100) + "%, " + (rgb[2] * 100) + "%)";
      };
      redrawSld = function() {
        return JSColor.picker.sldM.style.backgroundPosition = "0 " + (6 + Math.round((1 - THIS.hsv[2]) * 100)) + "px";
      };
      isPickerOwner = function() {
        return JSColor.picker && JSColor.picker.owner === THIS;
      };
      blurTarget = function() {
        if (valueElement === target) {
          return THIS.importColor();
        }
      };
      blurValue = function() {
        if (valueElement !== target) {
          return THIS.importColor();
        }
      };
      setPad = function(e) {
        var mpos, x, y;
        mpos = JSColor.getRelMousePos(e);
        x = mpos.x - 11;
        y = mpos.y - 11;
        return THIS.fromHSV(x * (1 / 30), 1 - y / 100, null, leaveSld);
      };
      setSld = function(e) {
        var mpos, y;
        mpos = JSColor.getRelMousePos(e);
        y = mpos.y - 9;
        return THIS.fromHSV(null, null, 1 - y / 100, leavePad);
      };
      THIS = this;
      valueElement = JSColor.fetchElement(this.valueElement);
      styleElement = JSColor.fetchElement(this.styleElement);
      leaveValue = 1 << 0;
      leaveStyle = 1 << 1;
      leavePad = 1 << 2;
      leaveSld = 1 << 3;
      $.on(target, 'focus', function() {
        return THIS.showPicker();
      });
      $.on(target, 'blur', function() {
        if (!abortBlur) {
          return window.setTimeout(function() {
            abortBlur || blurTarget();
            return abortBlur = false;
          });
        } else {
          return abortBlur = false;
        }
      });
      if (valueElement) {
        $.on(valueElement, 'keyup input', function() {
          return THIS.fromString(valueElement.value, leaveValue);
        });
        $.on(valueElement, 'blur', blurValue);
        valueElement.setAttribute('autocomplete', 'off');
      }
      if (styleElement) {
        styleElement.jscStyle = {
          backgroundColor: styleElement.style.backgroundColor
        };
      }
      return this.importColor();
    }
  };

  MascotTools = {
    init: function() {
      if (!Conf['Mascots'] || (g.VIEW === 'catalog' && Conf['Hide Mascots on Catalog'])) {
        return;
      }
      if (Conf['Click to Toggle']) {
        $.on(this.el, 'mousedown', MascotTools.click);
      }
      $.on(doc, 'QRDialogCreation', MascotTools.position);
      $.asap((function() {
        return d.body;
      }), (function(_this) {
        return function() {
          return $.add(d.body, _this.el);
        };
      })(this));
      return MascotTools.toggle();
    },
    el: $.el('div', {
      id: "mascot",
      innerHTML: "<img>"
    }),
    change: function(mascot) {
      var el, img;
      if (Conf['Mascot Position'] === 'default') {
        $.rmClass(doc, 'mascot-position-above-post-form');
        $.rmClass(doc, 'mascot-position-bottom');
        $.rmClass(doc, 'mascot-position-default');
        $.addClass(doc, mascot.position === 'bottom' ? 'mascot-position-bottom' : 'mascot-position-above-post-form');
      }
      $[mascot.silhouette || Conf['Silhouettize Mascots'] ? 'addClass' : 'rmClass'](doc, 'silhouettize-mascots');
      el = $.el('img');
      img = this.el.firstElementChild;
      if (mascot.image !== '') {
        $.on(el, 'error', MascotTools.error);
        el.src = mascot.image;
      }
      $.off(img, 'error', MascotTools.error);
      $.replace(img, el);
      return MascotTools.position(mascot);
    },
    error: function() {
      var ctx, el;
      if (!this.src) {
        return;
      }
      if (MascotTools.imageError) {
        this.src = MascotTools.imageError;
      }
      el = $.el('canvas', {
        width: 248,
        height: 100
      });
      ctx = el.getContext('2d');
      ctx.font = "40px " + Conf['Font'];
      ctx.fillStyle = (new Color((Themes[Conf[g.THEMESTRING]] || Themes[g.TYPE === 'sfw' ? 'Yotsuba B' : 'Yotsuba'])['Text'])).hex();
      ctx.textAlign = 'center';
      ctx.textBaseline = 'middle';
      ctx.fillText("Mascot 404", 124, 50);
      return el.toBlob((function(_this) {
        return function(blob) {
          return _this.src = MascotTools.imageError = URL.createObjectURL(blob);
        };
      })(this));
    },
    toggle: function() {
      var el, enabled, i, len, mascot, name, string;
      string = g.MASCOTSTRING;
      enabled = Conf[string];
      if (!(len = enabled.length)) {
        return MascotTools.change({
          image: ''
        });
      }
      Conf['mascot'] = name = enabled[i = Math.floor(Math.random() * len)];
      if (!(mascot = Mascots[name])) {
        enabled.splice(i, 1);
        if (el = this.el.firstElementChild) {
          $.replace(el, $.el('img'));
        }
        $.set(string, Conf[string] = enabled);
        return MascotTools.toggle();
      }
      return MascotTools.change(mascot);
    },
    categories: ['Custom', 'Anime', 'Ponies', 'Questionable', 'Silhouette', 'Western'],
    dialog: function(key) {
      var container, dialog, div, fileInput, fileRice, imageFn, input, item, layout, name, nameFn, option, optionHTML, saveCheck, saveVal, setting, updateMascot, value, _i, _len, _ref;
      Conf['editMode'] = 'mascot';
      if (Mascots[key]) {
        editMascot = JSON.parse(JSON.stringify(Mascots[key]));
      } else {
        editMascot = {};
      }
      editMascot.name = key || '';
      layout = {
        name: ["Mascot Name", "", "text"],
        image: ["Image", "", "text"],
        category: ["Category", MascotTools.categories[0], "select", MascotTools.categories],
        position: ["Position", "default", "select", ["default", "top", "bottom"]],
        height: ["Height", "auto", "text"],
        width: ["Width", "auto", "text"],
        vOffset: ["Vertical Offset", "0", "number"],
        hOffset: ["Horizontal Offset", "0", "number"],
        center: ["Center Mascot", false, "checkbox"],
        silhouette: ["Silhouette", false, "checkbox"]
      };
      dialog = $.el("div", {
        id: "mascotConf",
        className: "reply dialog",
        innerHTML: "<div id=mascotcontent><center>\nPROTIP: Shift-Click the Mascot Image field to upload your own images!\n<br><a href='https://github.com/zixaphir/appchan-x/issues/126#issuecomment-14365049'>This may have some caveats.</a></center></div><div id=save><a href='javascript:;'>Save Mascot</a></div><div id=close><a href='javascript:;'>Close</a></div>"
      });
      container = $("#mascotcontent", dialog);
      fileRice = function(e) {
        if (e.shiftKey) {
          return this.nextElementSibling.click();
        }
      };
      updateMascot = function() {
        return MascotTools.change(editMascot);
      };
      saveVal = function() {
        editMascot[this.name] = this.value;
        return updateMascot();
      };
      imageFn = function() {
        if (MascotTools.URL === this.value) {
          return MascotTools.change(editMascot);
        } else if (MascotTools.URL) {
          URL.revokeObjectURL(MascotTools.URL);
          delete MascotTools.URL;
        }
        return saveVal.call(this);
      };
      nameFn = function() {
        this.value = this.value.replace(/[^a-z-_0-9]/ig, "_");
        if ((this.value !== "") && !/^[a-z]/i.test(this.value)) {
          return alert("Mascot names must start with a letter.");
        }
        return saveVal.call(this);
      };
      saveCheck = function() {
        editMascot[this.name] = this.checked ? true : false;
        return updateMascot();
      };
      for (name in layout) {
        item = layout[name];
        value = editMascot[name] || (editMascot[name] = item[1]);
        switch (item[2]) {
          case "text":
            div = this.input(item, name);
            input = $('input', div);
            switch (name) {
              case 'image':
                $.on(input, 'blur', imageFn);
                fileInput = $.el('input', {
                  type: "file",
                  accept: "image/*",
                  title: "imagefile",
                  hidden: "hidden"
                });
                $.on(input, 'click', fileRice);
                $.on(fileInput, 'change', MascotTools.uploadImage);
                $.after(input, fileInput);
                break;
              case 'name':
                $.on(input, 'blur', nameFn);
                break;
              default:
                $.on(input, 'blur', saveVal);
            }
            break;
          case "number":
            div = this.input(item, name);
            $.on($('input', div), 'blur', saveVal);
            break;
          case "select":
            optionHTML = "<div class=optionlabel>" + item[0] + "</div><div class=option><select name='" + name + "' value='" + value + "'><br>";
            _ref = item[3];
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
              option = _ref[_i];
              optionHTML += "<option value=\"" + option + "\">" + option + "</option>";
            }
            optionHTML += "</select></div>";
            div = $.el('div', {
              className: "mascotvar",
              innerHTML: optionHTML
            });
            setting = $("select", div);
            setting.value = value;
            $.on($('select', div), 'change', saveVal);
            break;
          case "checkbox":
            div = $.el("div", {
              className: "mascotvar",
              innerHTML: "<label><input type=" + item[2] + " class=field name='" + name + "' " + (value ? 'checked' : void 0) + ">" + item[0] + "</label>"
            });
            $.on($('input', div), 'click', saveCheck);
        }
        $.add(container, div);
      }
      MascotTools.change(editMascot);
      $.on($('#save > a', dialog), 'click', function() {
        return MascotTools.save(editMascot);
      });
      $.on($('#close > a', dialog), 'click', MascotTools.close);
      Rice.nodes(dialog);
      return $.add(d.body, dialog);
    },
    input: function(item, name) {
      var value;
      value = editMascot[name];
      editMascot[name] = value;
      return $.el("div", {
        className: "mascotvar",
        innerHTML: "<div class=optionlabel>" + item[0] + "</div><div class=option><input type=" + item[2] + " class=field name='" + name + "' placeholder='" + item[0] + "' value='" + value + "'></div>"
      });
    },
    uploadImage: function() {
      var file, fileURL, img;
      if (!(this.files && (file = this.files[0]))) {
        return;
      }
      if (MascotTools.URL) {
        URL.revokeObjectURL(MascotTools.URL);
      }
      img = $.el('img');
      img.onload = (function(_this) {
        return function() {
          var cv, height, s, width;
          s = 400;
          width = img.width, height = img.height;
          if (width <= s) {
            MascotTools.setImage(fileURL);
            _this.previousElementSibling.value = fileURL;
            return;
          }
          cv = $.el('canvas', {
            height: height = s / width * height,
            width: width = s
          });
          cv.getContext('2d').drawImage(img, 0, 0, width, height);
          URL.revokeObjectURL(fileURL);
          return cv.toBlob(function(blob) {
            var fileURL;
            MascotTools.URL = fileURL = URL.createObjectURL(MascotTools.file = blob);
            MascotTools.setImage(fileURL);
            return _this.previousElementSibling.value = fileURL;
          });
        };
      })(this);
      MascotTools.URL = fileURL = URL.createObjectURL(MascotTools.file = file);
      return img.src = fileURL;
    },
    setImage: function(fileURL) {
      var reader;
      reader = new FileReader();
      reader.onload = function() {
        return editMascot.image = reader.result;
      };
      return reader.readAsDataURL(MascotTools.file);
    },
    save: function(mascot) {
      var image, name;
      name = mascot.name, image = mascot.image;
      if ((name == null) || name === "") {
        alert("Please name your mascot.");
        return;
      }
      if ((image == null) || image === "") {
        alert("Your mascot must contain an image.");
        return;
      }
      if (!mascot.category) {
        mascot.category = MascotTools.categories[0];
      }
      if (Mascots[name]) {
        if ($.remove(Conf["Deleted Mascots"], name)) {
          $.set("Deleted Mascots", Conf["Deleted Mascots"]);
        } else {
          if (confirm("A mascot named \"" + name + "\" already exists. Would you like to over-write?")) {
            delete Mascots[name];
          } else {
            return alert("Creation of \"" + name + "\" aborted.");
          }
        }
      }
      Mascots[name] = JSON.parse(JSON.stringify(mascot));
      delete Mascots[name].name;
      return $.get("userMascots", {}, function(_arg) {
        var type, userMascots, _i, _len, _ref;
        userMascots = _arg.userMascots;
        userMascots[name] = Mascots[name];
        $.set('userMascots', userMascots);
        Conf["mascot"] = name;
        _ref = ["Enabled Mascots", "Enabled Mascots sfw", "Enabled Mascots nsfw"];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          type = _ref[_i];
          if (__indexOf.call(Conf[type], name) < 0) {
            Conf[type].push(name);
            $.set(type, Conf[type]);
          }
        }
        return alert("Mascot \"" + name + "\" saved.");
      });
    },
    click: function(e) {
      if (e.button !== 0) {
        return;
      }
      e.preventDefault();
      return MascotTools.toggle();
    },
    close: function() {
      Conf['editMode'] = false;
      editMascot = {};
      $.rm($.id('mascotConf'));
      return Settings.open("Mascots");
    },
    importMascot: function() {
      var file, reader;
      file = this.files[0];
      reader = new FileReader();
      reader.onload = function(e) {
        var err, mascots;
        try {
          mascots = JSON.parse(e.target.result);
        } catch (_error) {
          err = _error;
          alert(err);
          return;
        }
        return $.get("userMascots", {}, function(_arg) {
          var userMascots;
          userMascots = _arg.userMascots;
          return MascotTools.load(mascots, userMascots);
        });
      };
      return reader.readAsText(file);
    },
    load: function(mascots, userMascots) {
      var ilen, imported, len, mascot, message, name, type, _i, _len, _ref;
      len = Conf["Deleted Mascots"].length;
      imported = [];
      if (name = mascots["Mascot"]) {
        MascotTools.parse(mascots, userMascots, imported);
      } else if (mascots.length) {
        for (_i = 0, _len = mascots.length; _i < _len; _i++) {
          mascot = mascots[_i];
          MascotTools.parse(mascot, userMascots, imported);
        }
      } else {
        return new Notice('warning', "Failed to import mascot. Is file a properly formatted JSON file?", 5);
      }
      _ref = name ? ["" + name + " successfully imported!", 'info'] : (ilen = imported.length) ? ["" + ilen + " mascots successfully imported!", 'info'] : ["Failed to import any mascots. ;__;", 'info'], message = _ref[0], type = _ref[1];
      $.set('userMascots', userMascots);
      if (len !== Conf["Deleted Mascots"].length) {
        $.set('Deleted Mascots', Conf['Deleted Mascots']);
      }
      new Notice(type, message, 10);
      return Settings.openSection.call({
        open: Settings.mascots,
        hyphenatedTitle: 'mascots'
      });
    },
    parse: function(mascot, userMascots, imported) {
      var image, message, name;
      if (!((name = mascot["Mascot"]) && (image = mascot.image))) {
        message = "Failed to import a mascot. File file has no " + (name ? 'image' : image ? 'name' : 'name nor image') + ".";
        return new Notice('warning', message, 5);
      }
      delete mascot["Mascot"];
      if (Mascots[name] && !$.remove(Conf["Deleted Mascots"], name)) {
        if (!confirm("The mascot " + name + " already exists? Would you like to overwrite it?")) {
          return;
        }
      }
      mascot.name = name;
      return imported.push(userMascots[name] = Mascots[name] = mascot);
    },
    position: function(mascot) {
      if (!Style.sheets.mascots) {
        return;
      }
      (mascot.image != null) || (mascot = Mascots[Conf['mascot']] || {});
      return Style.sheets.mascots.textContent = "#mascot img { height: " + (mascot.height && isNaN(parseFloat(mascot.height)) ? mascot.height : mascot.height ? parseInt(mascot.height, 10) + 'px' : 'auto') + "; width: " + (mascot.width && isNaN(parseFloat(mascot.width)) ? mascot.width : mascot.width ? parseInt(mascot.width, 10) + 'px' : 'auto') + "; } #mascot { margin: " + (mascot.vOffset || 0) + "px " + (mascot.hOffset || 0) + "px; } .sidebar-large #mascot { left: " + (mascot.center ? 25 : 0) + "px; right: " + (mascot.center ? 25 : 0) + "px; } .mascot-position-above-post-form.post-form-style-fixed #mascot { transform: translateY(-" + (QR.nodes ? QR.nodes.el.getBoundingClientRect().height : 0) + "px); }";
    }
  };

  Rice = {
    ul: $.el('ul', {
      id: "selectrice"
    }),
    init: function() {
      $.ready(this.initReady);
      return Post.callbacks.push({
        name: 'Rice Checkboxes',
        cb: this.node
      });
    },
    initReady: function() {
      Rice.nodes(d.body);
      return $.add(d.body, Rice.ul);
    },
    node: function() {
      return Rice.checkbox($('.postInfo input', this.nodes.post));
    },
    nodes: function(root) {
      var process;
      root || (root = d.body);
      process = Rice.process;
      process($$('[type=checkbox]:not(.riced)', root), 'checkbox');
      return process($$('select:not(.riced)', root), 'select');
    },
    process: function(items, type) {
      var fn, item, _i, _len;
      fn = Rice[type];
      for (_i = 0, _len = items.length; _i < _len; _i++) {
        item = items[_i];
        fn(item);
      }
    },
    cleanup: function() {
      $.off(d, 'click scroll blur resize', Rice.cleanup);
      $.rmAll(Rice.ul);
    },
    checkbox: function(input) {
      var div;
      if ($.hasClass(input, 'riced')) {
        return;
      }
      $.addClass(input, 'riced');
      div = $.el('div', {
        className: 'rice'
      });
      div.check = input;
      $.after(input, div);
      return $.on(div, 'click', Rice.cb.check);
    },
    select: function(select) {
      var div, _ref;
      div = $.el('div', {
        className: 'selectrice',
        innerHTML: "<div>" + (((_ref = select.options[select.selectedIndex || '0']) != null ? _ref.textContent : void 0) || '') + "</div>"
      });
      $.on(div, 'click', Rice.cb.select);
      $.on(div, 'keydown', Rice.cb.keybind);
      $.after(select, div);
      return $.addClass(select, 'riced');
    },
    cb: {
      check: function(e) {
        e.preventDefault();
        e.stopPropagation();
        return this.check.click();
      },
      option: function(e) {
        var container, select;
        e.stopPropagation();
        e.preventDefault();
        if (this.dataset.disabled) {
          return;
        }
        select = Rice.input;
        container = select.nextElementSibling;
        container.firstChild.textContent = this.textContent;
        select.value = this.dataset.value;
        $.event('change', null, select);
        return Rice.cleanup();
      },
      select: function(e) {
        var bottom, clientHeight, left, li, nodes, option, select, style, top, ul, width, _i, _len, _ref, _ref1;
        e.stopPropagation();
        e.preventDefault();
        ul = Rice.ul;
        if (ul.children.length > 0) {
          return Rice.cleanup();
        }
        _ref = this.getBoundingClientRect(), width = _ref.width, left = _ref.left, bottom = _ref.bottom, top = _ref.top;
        clientHeight = d.documentElement.clientHeight;
        style = ul.style;
        style.cssText = ("width: " + width + "px; left: " + left + "px;") + (clientHeight - bottom < 200 ? "bottom: " + (clientHeight - top) + "px" : "top: " + bottom + "px");
        Rice.input = select = this.previousElementSibling;
        nodes = [];
        _ref1 = select.options;
        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
          option = _ref1[_i];
          li = $.el('li', {
            textContent: option.textContent
          });
          li.dataset.value = option.value;
          if (option.disabled) {
            li.dataset.disabled = true;
          }
          $.on(li, 'click', Rice.cb.option);
          nodes.push(li);
        }
        $.add(ul, nodes);
        $.on(ul, 'click scroll blur', function(e) {
          return e.stopPropagation();
        });
        return $.on(d, 'click scroll blur resize', Rice.cleanup);
      }
    }
  };

  Style = {
    sheets: {},
    init: function() {
      var i, item, items, theme;
      Style.svgs = {};
      theme = Themes[Conf[g.THEMESTRING]] || Themes['Yotsuba B'];
      items = [['layout', Style.layout], ['theme', Style.theme(theme)], ['dynamic', Style.dynamic()], ['padding', ""], ['mascots', ""]];
      i = 0;
      while (item = items[i++]) {
        Style.sheets[item[0]] = $.addStyle(item[1], item[0]);
      }
      $.addStyle(JSColor.css(), 'jsColor');
      $.asap((function() {
        return d.body;
      }), this.asapInit);
      $.asap((function() {
        return Header.bar.parentElement;
      }), Style.padding);
      $.asap((function() {
        return $.id('boardNavDesktopFoot');
      }), this.readyInit);
      return $.on(window, "resize", Style.padding);
    },
    asapInit: function() {
      var cat, hyphenated, name, setting, title, _ref;
      $.addClass(doc, 'gecko');
      $.addClass(doc, 'fourchan-x');
      $.addClass(doc, 'appchan-x');
      $.addClass(doc, g.VIEW);
      Style.remStyle();
      _ref = Config.style;
      for (title in _ref) {
        cat = _ref[title];
        for (name in cat) {
          setting = cat[name];
          if (!Conf[name] || setting[2] === 'text' || (name === 'NSFW/SFW Themes' || name === 'NSFW/SFW Mascots')) {
            continue;
          }
          hyphenated = ("" + name + (setting[2] ? " " + Conf[name] : "")).toLowerCase().replace(/^4/, 'four').replace(/\s+/g, '-');
          $.addClass(doc, hyphenated);
        }
      }
    },
    readyInit: function() {
      var exLink;
      Style.iconPositions();
      if (exLink = $("#navtopright .exlinksOptionsLink", d.body)) {
        return $.on(exLink, "click", function() {
          return setTimeout(Rice.nodes, 100);
        });
      }
    },
    remStyle: function() {
      var item, _i, _j, _len, _len1, _ref, _ref1;
      _ref = ['[title="switch"]', '[href="//s.4cdn.org/css/yotsubluemobile.540.css"]', '#base-css', '#mobile-css'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        item = _ref[_i];
        if (item = $(item, d.head)) {
          item.disabled = true;
        }
      }
      if (g.VIEW === 'home') {
        $.asap((function() {
          return d.readyState === 'complete';
        }), function() {
          return $('#disclaimer-dialog .container-close').click();
        });
        _ref1 = $$('[rel="stylesheet"], style[type="text/css"]', d.head);
        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
          item = _ref1[_j];
          item.disabled = true;
        }
      }
    },
    generateFilter: function(id, values) {
      return "<svg xmlns='http://www.w3.org/2000/svg' height='0' color-interpolation-filters='sRGB'><filter id='" + id + "'><feColorMatrix " + values + " /></filter></svg>";
    },
    matrix: function() {
      var arg, color, colors, hex, i, rgb, val, _i, _len;
      colors = [];
      rgb = ['r', 'g', 'b'];
      for (_i = 0, _len = arguments.length; _i < _len; _i++) {
        arg = arguments[_i];
        hex = (new Color(arg)).raw;
        color = {};
        i = 0;
        while (val = rgb[i]) {
          color[val] = parseInt(hex.substr(2 * i++, 2), 16) / 255;
        }
        colors.push(color);
      }
      return colors;
    },
    filter: function(_arg) {
      var bg, fg;
      fg = _arg[0], bg = _arg[1];
      return "" + bg.r + " " + (-fg.r) + " 0 0 " + fg.r + " " + bg.g + " " + (-fg.g) + " 0 0 " + fg.g + " " + bg.b + " " + (-fg.b) + " 0 0 " + fg.b;
    },
    silhouette: function(_arg) {
      var fg;
      fg = _arg[0];
      return "0 0 0 0 " + fg.r + " 0 0 0 0 " + fg.g + " 0 0 0 0 " + fg.b;
    },
    layout: "/* Party Hat */ .party-hat { margin: -80px 0; pointer-events: none; } /* Cleanup */ #absbot, #boardNavDesktop, #delPassword, #delform > hr:last-of-type, #navbotright, #postForm, #search-label, #search-label-bottom, #styleSwitcher, #togglePostFormLink, .boardBanner > div, .next form, .next span, .postingMode, .prev form, .prev span, .riced, .sideArrows, .stylechanger, body > br, body > div[style^=\"text-align\"], body > hr { display: none; } /* Empties */ #qr .warning:empty, #qr-thread-select:empty { display: none; } /* File Name Trunctuate / /p/ exif */ .exif, .file-info:hover .fntrunc, .file-info:not(:hover) .fnfull { display: none; } /* Unnecessary */ #qp input, #qp .rice, .inline .rice, .mobile { display: none !important; } /* Hidden Content */ .forwarded, .hidden, .hidden_thread ~ div, .hidden_thread ~ a, .replyContainer .stub ~ div, .replyContainer .stub ~ a, .stub + div, .thread > .stub:first-child ~ .postContainer, .thread > .stub:first-child ~ .summary, [hidden] { display: none !important; } /* Hidden UI */ #navtopright, #svg_filters, .cataloglink { z-index: 7; position: fixed; top: 100%; left: 100%; } /* Hide last horizontal rule, keep clear functionality. */ .board > hr:last-of-type { visibility: hidden; } /* Fappe Tyme */ .fappeTyme .thread > .noFile, .fappeTyme .threadContainer > .noFile { display: none; } /* Werk Tyme */ .werkTyme .post .file { display: none; } /* Index Features */ #index-menu { display: flex; align-items: center } :root.thread #index-menu, :root.index-loading .navLinks, :root.index-loading .board, :root.index-loading .pagelist, :root.thread .pagelist { display: none; } :root:not(.catalog-mode) #index-size, :root:not(.catalog-mode) #index-size + .selectrice, .index:not(.catalog-mode) #returnIcon, .index.catalog-mode #catalogIcon { display: none; } #index-menu .selectrice { width: 110px; display: inline-block; } #index-search { padding-right: 1.5em; width: 100px; transition: color .25s, border-color .25s, width .25s; } #index-search:focus, #index-search[data-searching] { width: 200px; } #index-search-clear { margin-left: -1em; }  #index-search:not([data-searching]) + #index-search-clear { display: none; } .catalog-mode .board { text-align: center; } .catalog-thread { display: inline-flex; text-align: left; flex-direction: column; align-items: center; margin: 0 2px 5px; word-break: break-word; vertical-align: top; } .catalog-small .catalog-thread { width: 165px; max-height: 320px; } .catalog-large .catalog-thread { width: 270px; max-height: 410px; } .catalog-thread .thumb { flex-shrink: 0; -webkit-flex-shrink: 0; position: relative; } .catalog-thumb { border-radius: 2px; box-shadow: 0 0 5px rgba(0, 0, 0, .25); } .catalog-thumb.spoiler-file { width: 100px; height: 100px; } .catalog-thumb.deleted-file { width: 127px; height: 13px; padding: 20px 11px; } .catalog-thumb.no-file { width: 77px; height: 13px; padding: 20px 36px; } .catalog-icons > img { width: 1em; height: 1em; margin: 0; vertical-align: text-top; } .thumb:not(:hover):not(:focus) > .menu-button:not(.open):not(:focus) > i { display: none; } .thumb > .menu-button { position: absolute; top: 0; right: 0; } .thumb > .menu-button > i { width: 1em; height: 1em; padding: 1px; border-radius: 0 2px 0 2px; font-size: 14px; text-align: center;  line-height: normal;  } .catalog-stats { flex-shrink: 0; cursor: help !important; font-size: 10px; font-weight: 700; margin-top: 2px; } .catalog-thread > .subject { flex-shrink: 0; font-weight: 700; line-height: 1; text-align: center; } .catalog-thread > .comment { flex-shrink: 1; align-self: stretch; overflow: hidden; text-align: center; } .thread-info { position: fixed; padding: 2px; border-radius: 2px; box-shadow: 0 0 5px rgba(0, 0, 0, .25); z-index: 1; } .thread-info .post { margin: 0; } /* Defaults */ a { text-decoration: none; outline: none; } .underline-links a { text-decoration: underline; } body, html { min-height: 100%; box-sizing: border-box; } body { outline: none; min-height: 100%; } .editTheme { margin-left: 300px; } .sidebar-hide body { margin: 0 2px; } .sidebar-minimal body { margin: 0 20px; } .sidebar-normal body { margin: 0 252px } .sidebar-large body { margin: 0 303px; } .sidebar-location-right body { margin-left: 2px; } .sidebar-location-left body { margin-right: 2px; } body.unscroll { overflow: hidden; } .fourchan-ss-sidebar body::before { content: ''; position: fixed; top: 0; bottom: 0; box-sizing: border-box; display: block; z-index: 0; } .fourchan-ss-sidebar.sidebar-large body::before { width: 306px; } .fourchan-ss-sidebar.sidebar-normal body::before { width: 255px; } .fourchan-ss-sidebar.sidebar-minimal body::before { width: 23px; } .sidebar-location-right body::before { right: 0; } .sidebar-location-left body::before { left: 0; } .fourchan-ss-sidebar.sidebar-location-right body { padding-right: 2px; } .fourchan-ss-sidebar.sidebar-location-left body { padding-left: 2px; } hr { clear: both; border: 0; padding: 0; margin: 0 0 1px; } .hide-horizontal-rules hr { visibility: hidden; } th { text-align: left; } .center { text-align: center; } .ad-plea { text-align: center; font-size: .8em; } .dead-thread, .disabled { opacity: 0.4; } nav a, .pointer { cursor: pointer; } /* Symbols */ .menu-button i { vertical-align: middle; display: inline-block; margin: 2px 2px 3px; } .brackets-wrap::before { content: \" [\"; } .brackets-wrap::after { content: \"] \"; } /* Thread / Reply Nav */ #navPrev, #navNext { display: inline-block; border-right: 6px solid transparent; border-left: 6px solid transparent; opacity: 0.5; margin: 2px 1px; width: 0; height: 0; } #navPrev { border-bottom: 11px solid rgb(130,130,130); } #navNext { border-top: 11px solid rgb(130,130,130); } /* Header */ #header-bar { z-index: 6; border-width: 1px; padding: 1px 2px; border-style: solid; } .pagination-sticky-top .pagelist, .pagination-sticky-bottom .pagelist, #header-bar { left: 2px; right: 2px; } .navigation-alignment-center #header-bar { text-align: center; } .navigation-alignment-right #header-bar { text-align: right; } .sidebar-location-left.sidebar-large:not(.pagination-on-side):not(.fourchan-ss-navigation) .pagelist, .sidebar-location-left.sidebar-large #header-bar { left: 303px; } .sidebar-location-left.sidebar-normal:not(.pagination-on-side):not(.fourchan-ss-navigation) .pagelist, .sidebar-location-left.sidebar-normal #header-bar { left: 252px; } .sidebar-location-left.sidebar-minimal:not(.pagination-on-side):not(.fourchan-ss-navigation) .pagelist, .sidebar-location-left.sidebar-minimal:not(.fourchan-ss-navigation) #header-bar { left: 20px; } .sidebar-location-right.sidebar-large:not(.pagination-on-side):not(.fourchan-ss-navigation) .pagelist, .sidebar-location-right.sidebar-large #header-bar { right: 303px; } .sidebar-location-right.sidebar-normal:not(.pagination-on-side):not(.fourchan-ss-navigation) .pagelist, .sidebar-location-right.sidebar-normal #header-bar { right: 252px; } .sidebar-location-right.sidebar-minimal:not(.pagination-on-side):not(.fourchan-ss-navigation) .pagelist, .sidebar-location-right.sidebar-minimal:not(.fourchan-ss-navigation) #header-bar { right: 20px; } .fourchan-ss-navigation .pagelist, .fourchan-ss-navigation #header-bar { left: 0; right: 0; border-left: 0; border-right: 0; border-radius: 0 !important; } .hide-navigation-decorations #board-list { font-size: 0; color: transparent; } #full-board-list, .hide-navigation-decorations #board-list a { margin: 0 .1em; } .fixed #header-bar.autohide { z-index: 24; } .fixed #header-bar { position: fixed; } .top-header #header-bar { top: 0; border-top-width: 0; } .rounded-edges.top-header #header-bar { border-radius: 0 0 3px 3px; } .fixed.bottom-header #header-bar { bottom: 0; border-bottom-width: 0; } .rounded-edges.bottom-header #header-bar { border-radius: 3px 3px 0 0; } .hide #header-bar { position: fixed; top: 110%; bottom: auto; } /* Header Autohide */ .fixed #header-bar.autohide:not(:hover) { box-shadow: none; transition: all .8s .6s cubic-bezier(.55, .055, .675, .19); } .fixed.top-header #header-bar.autohide:not(:hover) { margin-bottom: -1em; transform: translateY(-100%); } .fixed.bottom-header #header-bar.autohide:not(:hover) { transform: translateY(100%); } #header-bar #scroll-marker { display: none; left: 0; right: 0; height: 10px; position: absolute; } #header-bar:not(.autohide) #scroll-marker { pointer-events: none; } .fixed #header-bar #scroll-marker { display: block; } .fixed.top-header header-bar #scroll-marker { top: 100%; } .fixed.bottom-header #header-bar #scroll-marker { bottom: 100%; } /* Notifications */ #notifications { z-index: 40; position: fixed; top: 0; text-align: center; right: 0; left: 0; height: 0; overflow: visible; transition: all .8s .6s cubic-bezier(.55, .055, .675, .19); } .fixed.top-header #header-bar #notifications { top: 2em; } .notification { font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); border-radius: 2px; margin: 1px auto; width: 500px; max-width: 100%; position: relative; transition: all .25s ease-in-out; } .notification.error { background-color: hsla(0, 100%, 38%, .9); } .notification.warning { background-color: hsla(36, 100%, 38%, .9); } .notification.info { background-color: hsla(200, 100%, 38%, .9); } .notification.success { background-color: hsla(104, 100%, 38%, .9); } .notification, .notification a { color: #fff !important; } .notification > .close { top: 0; padding: 2px; right: 4px; position: absolute; color: #fff; } .message { box-sizing: border-box; padding: 6px 20px; max-height: 200px; width: 100%; overflow: auto; } /* Shortcuts */ #shortcuts { position: fixed; display: flex; top: 0; padding: 1px; z-index: 16; flex-direction: row; max-height: 1.1em; overflow: visible; } .shortcut { margin: 0 1px; } .icon-orientation-vertical #a-icons .shortcut { margin: 0; } #a-icons, #a-stats { order: 0; display: flex; text-align: center; } #a-icons { order: 10; } #a-stats { padding: 1px 2px; } #shortcuts #a-stats { padding: 0 2px; } .sidebar-location-right #shortcuts { right: 0; } .sidebar-location-left #shortcuts { left: 0; } .icon-orientation-vertical #a-icons { flex-direction: column; height: 200px; } .icon-orientation-horizontal #a-stats, .icon-orientation-horizontal #a-icons, .sidebar-location-left #shortcuts { flex-direction: row-reverse; } .icon-orientation-horizontal.sidebar-location-left #a-stats, .icon-orientation-horizontal.sidebar-location-left #a-icons { flex-direction: row; } #thread-stats { order: 0; } #updater { order: 10; } #main-menu { order: 0; } #qr-shortcut { order: 10; } #img-controls { order: 20; } #appchan-gal { order: 25; } #fappeTyme { order: 30; } #werkTyme { order: 35; } #so-nav { order: 40; } #so-watcher { order: 50; } #so-psa { order: 60; } #navPrev { order: 70; } #navNext { order: 80; } #catalogIcon { order: 90; } #returnIcon { order: 100; } .icon-orientation-horizontal #so-psa #globalMessage, .icon-orientation-horizontal #so-watcher #thread-watcher, .icon-orientation-horizontal #so-nav #boardNavDesktopFoot { top: 15px !important; } .icon-orientation-vertical #so-psa, .icon-orientation-vertical #so-watcher, .icon-orientation-vertical #so-nav { position: relative; } .icon-orientation-vertical #so-psa #globalMessage, .icon-orientation-vertical #so-watcher #thread-watcher, .icon-orientation-vertical #so-nav #boardNavDesktopFoot { top: 0 !important; position: absolute !important; z-index: -1; } .sidebar-location-right.icon-orientation-vertical #so-psa #globalMessage, .sidebar-location-right.icon-orientation-vertical #so-watcher #thread-watcher, .sidebar-location-right.icon-orientation-vertical #so-nav #boardNavDesktopFoot { padding-right: 17px; } .sidebar-location-left.icon-orientation-vertical #so-psa #globalMessage, .sidebar-location-left.icon-orientation-vertical #so-watcher #thread-watcher, .sidebar-location-left.icon-orientation-vertical #so-nav #boardNavDesktopFoot { padding-left: 17px; } .a-icon, #shortcuts .fa { display: inline-block; width: 15px; height: 15px; content: \"\"; opacity: 0.5; cursor: pointer; align: flex-start; } .invisible-icons .a-icon, .invisible-icons #shortcuts .fa { opacity: 0; } #so-nav, #so-watcher, #so-psa { line-height: 0; } .shortcut > div { line-height: normal; } #main-menu { background-position: 0 0; } #returnIcon { background-position: 0 -15px; } #so-watcher .a-icon { background-position: 0 -30px; } #so-psa .a-icon { background-position: 0 -45px; } #so-nav .a-icon { background-position: 0 -60px; } #img-controls { background-position: 0 -90px; } #catalogIcon { background-position: 0 -120px; } #fappeTyme { background-position: 0 -135px; } #navPrev:hover, #navNext:hover, .a-icon:hover, #shortcuts .fa:hover { opacity: 1 !important; } /* Updater / Thread Stats */ .float #thread-stats, .float #updater { position: fixed; z-index: 25; } #update-status.new::after { content: ', '; } /* Pagination */ .pagelist { border-style: solid; border-width: 1px; z-index: 6; } .pagination-alignment-center .pagelist { text-align: center; } .pagination-alignment-right .pagelist { text-align: right; } .pagination-sticky-top .pagelist { position: fixed; top: 0; border-top-width: 0; } .pagination-sticky-bottom .pagelist { position: fixed; bottom: 0; border-bottom-width: 0; } .pagination-top .pagelist { position: static; border-top-width: 0; } .pagination-bottom .pagelist { position: static; } .pagination-top.rounded-edges .pagelist, .pagination-sticky-top.rounded-edges .pagelist { border-radius: 0 0 3px 3px; } .pagination-bottom.rounded-edges .pagelist, .pagination-sticky-bottom.rounded-edges .pagelist { border-radius: 3px 3px 0 0; } .thread .pagelist, .pagination-hide .pagelist { display: none; } .pagination-on-side .pagelist { position: fixed; padding: 0; top: auto; bottom: 0.5em; margin: 0; background: none transparent !important; border: 0 none !important; text-align: right; } .pagination-on-side.post-form-style-fixed.show-post-form-header .pagelist { bottom: 23.1em; } .pagination-on-side.post-form-style-fixed .pagelist { bottom: 21.6em; } .sidebar-location-left.pagination-on-side .pagelist { transform: rotate(-90deg); transform-origin: bottom left; } .sidebar-location-right.pagination-on-side .pagelist { transform: rotate(90deg); transform-origin: bottom right; } .sidebar-location-right.sidebar-large.pagination-on-side .pagelist { left: auto; right: 301px; } .sidebar-location-left.sidebar-large.pagination-on-side .pagelist { right: auto; left: 301px; } .sidebar-location-right.sidebar-normal.pagination-on-side .pagelist { left: auto; right: 246px; } .sidebar-location-left.sidebar-normal.pagination-on-side .pagelist { right: auto; left: 246px; } .sidebar-location-right.sidebar-minimal.pagination-on-side .pagelist { left: auto; right: 246px; } .sidebar-location-left.sidebar-minimal.pagination-on-side .pagelist { right: auto; left: 18px; } .hide-navigation-decorations .pagelist { font-size: 0; color: transparent; word-spacing: 0; } .pagelist input, .pagelist div { vertical-align: middle; } .hide-navigation-decorations .pages a { margin: 0 1px; } .next, .pages, .prev { display: inline-block; margin: 0 3px; } /* Icons */ .icons-4chan-ss .a-icon { background-image: url(\"data:image/png;base64,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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Txqfipl0tGR1DXvd0h251Ww/ZlaNQoaX3bqUS+IK6ZX4hysvuQinS+6n9638/6BbK4RLi6R11O8rPS4OnO66KHtw6yK96BWrg5QxDGcVzcoB8cYb/dE1zPO6C+pHxN0Ttw/JtJrx55+oV9Jq+ScF22IfBWDD+sHfTnBmKlpS99hPGSC4SBsi+dP3p0PjVBVedMdO3WoG57cAEbYVNkRHFROIzjYuGjoM7LOaEQKbtQjkuo5hCSMmezaNq3Gl6TE5J3ZLMu26SjpPJZo4h/9FJhT4JQJzjFXD7x54fBgzO9RvDH9Vl5vHIetcGHct1apLh/6gU3c2PYy5rrYh7a1NP29/H/G9xn/d+f7FNVcw9/H/9sf8ymXPnqdDd7Wx3OpzWRJuP8+iMTFe7wZq48Tce7QciNetUzku+pT/t4UHK/iIq2yPR/8y/315M/rWl1A/sM83phVh6+aeZY39OLNN4Y0P2GdHOWPAAAAAElFTkSuQmCC\"); } /* Banner & Board Title */ .boardBanner { line-height: 0; } .faded-4chan-banner .boardBanner { opacity: 0.5; transition: opacity 0.3s ease-in-out .5s; } .faded-4chan-banner .boardBanner:hover { opacity: 1; transition: opacity 0.3s ease-in; } /* From 4chan SS / OneeChan */  .fourchan-banner-reflection .boardBanner::after { background-image: -moz-element(#bannerCnt); bottom: -100%; content: ''; left: 0; mask: url(\"data:image/svg+xml,<svg version='1.1' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient gradientUnits='objectBoundingBox' id='gradient' x2='0' y2='1'><stop stop-offset='0'/><stop stop-color='white' offset='1'/></linearGradient><mask id='mask' maskUnits='objectBoundingBox' maskContentUnits='objectBoundingBox' x='0' y='0' width='100%' height='100%'> <rect fill='url(%23gradient)' width='1' height='1' /></mask></defs></svg>#mask\"); opacity: 0.3; position: absolute; right: 0; top: 100%; -moz-transform: scaleY(-1); z-index: -1; }  .fourchan-banner-at-sidebar-top .boardBanner, .fourchan-banner-at-sidebar-bottom .boardBanner, .fourchan-banner-at-sidebar-bottom .boardBanner { position: fixed; } .fourchan-banner-at-sidebar-top .boardBanner { top: 18px; } .fourchan-banner-at-sidebar-bottom .boardBanner { bottom: 270px; } .fourchan-banner-under-post-form .boardBanner { bottom: 130px; } .board-title-at-sidebar-top.sidebar-location-right #boardTitle, .board-title-at-sidebar-bottom.sidebar-location-right #boardTitle, .board-title-under-post-form.sidebar-location-right #boardTitle, .fourchan-banner-at-sidebar-top.sidebar-location-right .boardBanner, .fourchan-banner-at-sidebar-bottom.sidebar-location-right .boardBanner, .fourchan-banner-under-post-form.sidebar-location-right .boardBanner { right: 2px; } .board-title-at-sidebar-top.sidebar-location-left #boardTitle, .board-title-at-sidebar-bottom.sidebar-location-left #boardTitle, .board-title-under-post-form.sidebar-location-left #boardTitle, .fourchan-banner-at-sidebar-top.sidebar-location-left .boardBanner, .fourchan-banner-at-sidebar-bottom.sidebar-location-left .boardBanner, .fourchan-banner-under-post-form.sidebar-location-left .boardBanner { left: 2px; } .board-title-at-sidebar-top #boardTitle, .board-title-at-sidebar-bottom #boardTitle, .board-title-under-post-form #boardTitle, .fourchan-banner-at-sidebar-top .boardBanner img, .fourchan-banner-at-sidebar-bottom .boardBanner img, .fourchan-banner-under-post-form .boardBanner img { width: 248px; } .board-title-at-sidebar-top.sidebar-large #boardTitle, .board-title-at-sidebar-bottom.sidebar-large #boardTitle, .board-title-under-post-form.sidebar-large #boardTitle, .fourchan-banner-at-sidebar-top.sidebar-large .boardBanner img, .fourchan-banner-at-sidebar-bottom.sidebar-large .boardBanner img, .fourchan-banner-under-post-form.sidebar-large .boardBanner img { width: 299px; } .fourchan-banner-at-top .boardBanner { position: relative; display: table; margin: 12px auto; text-align: center; } :root:not(.board-subtitle) .boardSubtitle, .board-title-hide #boardTitle, .fourchan-banner-hide .boardBanner { display: none; } #boardTitle { text-align: center; z-index: 4; } .board-title-at-sidebar-top #boardTitle, .board-title-at-sidebar-bottom #boardTitle, .board-title-under-post-form #boardTitle { position: fixed; } .board-title-at-sidebar-top.fourchan-banner-at-sidebar-top.sidebar-large #boardTitle { top: 121px; } .board-title-at-sidebar-top.fourchan-banner-at-sidebar-top #boardTitle { top: 104px; } .board-title-at-sidebar-top #boardTitle { top: 40px; } .board-title-at-sidebar-bottom #boardTitle { bottom: 280px; } .board-title-under-post-form #boardTitle { bottom: 140px; } /* Hover UI */ .move { cursor: pointer; } #ihover { position: fixed; max-height: 94vh; max-width: 75vw; z-index: 22; } #qp { position: fixed; z-index: 22; } #qp .postMessage::after { clear: both; display: block; content: \"\"; } #qp .full-image { max-height: 300px; max-width: 500px; } #menu { position: fixed; outline: none; z-index: 27; } /* Embedding */ #embedding { z-index: 11; padding: 1px 4px 1px 4px; position: fixed; } #embedding.empty { display: none; } #embedding > div:first-child { display: flex; } #embedding .move { flex: 1; } #embedding .jump { margin: -1px 4px; text-decoration: none; } /* Image Expansion */ .fit-width .full-image { max-width: 100%; } .gecko.fit-width .full-image { width: 100%; } .fit-height .full-image { max-height: 95vh; } .images-overlap-post-form .full-image { position: relative; z-index: 21; } /* Delete Buttons */ .hide-delete-ui .deleteform, .hide-delete-ui .post:not(#exlinks-options) .rice { display: none; } .post-form-style-slideup .deleteform::before, .post-form-style-tabbed-slideup .deleteform::before, .post-form-style-slideup .deleteform:hover, .post-form-style-tabbed-slideup .deleteform:hover { bottom: 0px !important; } .post-form-style-slideup .deleteform, .post-form-style-tabbed-slideup .deleteform { bottom: -50px !important; } .post-form-style-slideup .deleteform::before, .post-form-style-tabbed-slideup .deleteform::before, .post-form-style-slideup .deleteform, .post-form-style-tabbed-slideup .deleteform { right: 255px !important; } .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: '\uf00d'; font-family: FontAwesome; font-weight: normal; font-style: normal; text-decoration: inherit; -webkit-font-smoothing: antialiased; font-size:14px !important; display: block; position: fixed; bottom: 0; right: 0; box-sizing: border-box; height: 1.6em; width: 1.4em; text-align: center; } .deleteform:hover::before { display: none; } .deleteform input { margin: 0 1px 0 0; } /* Slideout Navigation */ #boardNavDesktopFoot { position: fixed; text-align: center; font-size: 0; color: transparent; overflow-x: hidden; overflow-y: auto; box-sizing: border-box; width: 248px; } .sidebar-large #boardNavDesktopFoot { width: 299px; } .sidebar-location-right #boardNavDesktopFoot { right: 2px; } .sidebar-location-left #boardNavDesktopFoot { left: 2px; } #so-nav:hover #boardNavDesktopFoot { display: block; } #boardNavDesktopFoot { display: none; padding: 2px; } .slideout-navigation-hide #so-nav { display: none; } .slideout-navigation-compact #boardNavDesktopFoot { word-spacing: 1px; } .slideout-navigation-list #boardNavDesktopFoot a { display: block; } .slideout-navigation-list #boardNavDesktopFoot { max-height: 400px; } .slideout-navigation-list #boardNavDesktopFoot a::after { content: ' - ' attr(title); } .slideout-navigation-list #boardNavDesktopFoot a[href*='//boards.4chan.org/']::after, .slideout-navigation-list #boardNavDesktopFoot a[href*='//rs.4chan.org/']::after { content: '/ - ' attr(title); } .slideout-navigation-list #boardNavDesktopFoot a[href*='//boards.4chan.org/']::before, .slideout-navigation-list #boardNavDesktopFoot a[href*='//rs.4chan.org/']::before { content: '/'; } .slideout-navigation-hide #boardNavDesktopFoot { display: none; } /* Watcher */ #thread-watcher { position: fixed; z-index: 14; padding: 2px; } #thread-watcher { width: 200px; } #thread-watcher:not(:hover) { max-height: 200px; overflow: hidden; } .rounded-edges #thread-watcher { border-radius: 3px; } #watched-threads > div { max-height: 1.3em; overflow: hidden; } .slideout-watcher #thread-watcher { box-sizing: border-box; width: 248px; } .slideout-watcher.sidebar-large #boardNavDesktopFoot { width: 299px; } .slideout-watcher.sidebar-location-right #thread-watcher { left: auto !important; right: 2px !important; } .slideout-watcher.sidebar-location-left #thread-watcher { right: auto !important; left: 2px !important; } .slideout-watcher #thread-watcher .move { cursor: default; } .slideout-watcher.underline-links #thread-watcher .move { text-decoration: underline; } .slideout-watcher #thread-watcher > div { overflow: hidden; } .slideout-watcher #so-watcher:hover #thread-watcher { display: block; } .slideout-watcher #thread-watcher { display: none; overflow-y: auto; text-align: left; } .watch-thread-link { padding-top: 18px; width: 18px; height: 0px; display: inline-block; background-repeat: no-repeat; opacity: 0.2; position: relative; top: 1px; } .watch-thread-link.watched { opacity: 1; } /* Announcements */ #globalMessage { text-align: center; } .rounded-edges #globalMessage { border-radius: 3px; } .announcements-slideout #globalMessage { position: fixed; padding: 2px; width: 248px; } .announcements-slideout.sidebar-location-right #globalMessage { left: auto; right: 2px; } .announcements-slideout.sidebar-location-left #globalMessage { right: auto; left: 2px; } .announcements-slideout.sidebar-large #globalMessage { width: 299px; } .announcements-slideout #globalMessage h3 { margin: 0; } .announcements-slideout #globalMessage { box-sizing: border-box; display: none; } .announcements-slideout #so-psa:hover #globalMessage { display: block; } .announcements-hide #globalMessage { display: none !important; } /* Threads */ #threads, .rounded-edges .board > .thread { border-radius: 4px; } /* Thread Clearfix */ .thread > .threadContainer:last-of-type::after { display: block; content: ' '; clear: both; } /* Posts */ .expanding { opacity: .5; } .expanded-image > .post > .file > .fileThumb > img[data-md5], .expanded-image > .post > .file > .fileThumb > video[data-md5], .post > .file > .fileThumb > .full-image, .post > .file > .full-image { display: none; } .expanded-image > .post > .file > .fileThumb > .full-image, .expanded-image > .post > .file > .full-image { display: block; } .thread > .replyContainer:last-of-type .post { margin-bottom: 0; } .menu-button { position: relative; } .post .menu-button, .hide-post-button, .show-post-button span { float: right; } .post .menu-button, .hide-post-button { margin: 0 3px; opacity: 0; transition: opacity .3s ease-out 0s; } .post:hover .hide-post-button, .post:hover .menu-button, .inline .hide-post-button, .inline .menu-button { opacity: 1; } .posteruid .painted { padding: .1em .3em; border-radius: 1em; font-size: 80%; } .hand { cursor: pointer; } div.post div.postInfo { padding: 1px 3px; display: block !important; } .postInfo > span { vertical-align: bottom; } .bolds .subject, .bolds .name { font-weight: 600; } .italics .postertrip { font-style: italic; } .underline-links .replylink { text-decoration: underline; } .reply .fileText { padding: 0 3px; } .compact-file-text .fileText { font-size: .9em; } .fileThumb { float: left; margin: 3px 20px; outline: none; } .reply.post { box-sizing: border-box; display: inline-block; } .replyContainer { display: flex; } .fit-width-replies .reply.post { flex: 1 0; } .fit-width-replies .expanded-image .reply.post, .fit-width-replies .hasInline .reply.post { width: 100%; } .indent-replies #unread-line, .indent-replies .thread > .replyContainer, .indent-replies .threadContainer > .replyContainer { margin-left: 2em; } .rounded-edges .post { border-radius: 3px; } .spoiler, s { text-decoration: none; } /* OP */ .watch-thread-link { vertical-align: bottom; } .op-background .op.post { box-sizing: border-box; }  /* Force Reply Break */ .op-background .op.post .postMessage::after, .force-reply-break .op.post .postMessage::after { display: block; content: ' '; clear: both; } /* Summary */ .force-reply-break .summary { clear: both; } /* Inlined */ .inline { margin: 2px 8px 2px 2px; } .post .inline { margin: 2px; } .inline .replyContainer { display: inline-block; } /* Quotes */ .inlined { opacity: .5; } .underline-links .quotelink { text-decoration: underline; } .filtered, .quotelink.filtered { text-decoration: line-through !important; } .inline + .hashlink { display: none; } .hashlink::before { content: '\\00a0'; } /* Quote Threading */ .threadContainer { padding-left: 2em; border-left: 1px solid; } .indent-replies .threadContainer { margin-left: 2em; padding-left: 0; } .threadOP { clear: both; } /* Backlinks */ .underline-links .forwardlink, .underline-links .backlink { text-decoration: underline; } .backlink.dead { text-decoration: none; } .backlink-container .filtered { display: none; } .backlinks-position-lower-left .backlink-container, .backlinks-position-lower-right .backlink-container { max-width: 100%; padding: 0 5px; } .backlinks-position-lower-left .reply.quoted, .backlinks-position-lower-right .reply.quoted { position: relative; padding-bottom: 1.7em; } .backlinks-position-lower-left .inline .reply.quoted, .backlinks-position-lower-right .inline .reply.quoted, .backlinks-position-lower-right #qp .reply.quoted, .backlinks-position-lower-left #qp .reply.quoted { position: static; padding-bottom: 0; } .backlinks-position-lower-right .reply .backlink-container, .backlinks-position-lower-left .reply .backlink-container { position: absolute; bottom: 0; padding: 0 5px; } .backlinks-position-lower-left .reply .backlink-container { left: 0; } .backlinks-position-lower-right .reply .backlink-container { right: 0; } .backlinks-position-lower-right .backlink-container::before, .backlinks-position-lower-left .reply .backlink-container::before { content: 'REPLIES: '; } .backlink-container:empty { display: none; } .backlinks-position-lower-left #qp .backlink-container, .backlinks-position-lower-left .inline .backlink-container, .backlinks-position-lower-right .inline .backlink-container, .backlinks-position-lower-right #qp .backlink-container { position: static; max-width: 100%; } .backlinks-position-lower-left #qp .backlink-container::before, .backlinks-position-lower-left .inline .backlink-container::before, .backlinks-position-lower-right #qp .backlink-container::before, .backlinks-position-lower-right .inline .backlink-container::before { content: ''; } .backlinks-position-lower-right .inline .backlink-container { float: none; } /* Fixes text spoilers */ .remove-spoilers.reveal-spoilers .spoiler::before, .remove-spoilers.reveal-spoilers s::before { content: '[spoiler]'; } .remove-spoilers.reveal-spoilers .spoiler::after, .remove-spoilers.reveal-spoilers s::after { content: '[/spoiler]'; } :root:not(.remove-spoilers).reveal-spoilers .spoilers:not(:hover), :root:not(.remove-spoilers).reveal-spoilers s:not(:hover) { color: white !important; } :root:not(.remove-spoilers) .spoiler:not(:hover) *, :root:not(.remove-spoilers) s:not(:hover) * { color: rgb(0,0,0) !important; text-shadow: none !important; } :root:not(.remove-spoilers) spoiler:not(:hover), :root:not(.remove-spoilers) s:not(:hover) { background-color: rgb(0,0,0); color: rgb(0,0,0) !important; text-shadow: none !important; } /* Code */ .prettyprint { box-sizing: border-box; font-family: monospace; display: inline-block; margin: 0 auto .1em 0; vertical-align: middle; white-space: pre-wrap; border-radius: 2px; overflow-x: auto; padding: 3px; max-width: 100%; } /* Menu */ .entry { border-bottom: 1px solid rgba(0,0,0,.25); cursor: pointer; display: block; outline: none; padding: 3px 1em 3px 7px; position: relative; text-decoration: none; white-space: nowrap; } .entry:last-child { border-bottom: 0; } .has-submenu::after { content: \"\uf141\"; display: inline-block; margin: .3em; position: absolute; right: .2em; } .submenu { display: none; position: absolute; top: -1px; } .focused > .submenu { display: block; } /* Stubs */ .fit-width-replies .stub { display: block; text-align: right; clear: both; } /* Element Replacing: */ /* Checkboxes */ .rice { cursor: pointer; width: .7em; height: .7em; margin: 2px 3px; display: inline-block; vertical-align: bottom; } input[type=checkbox]:checked + .rice { position: relative; } input[type=checkbox]:checked + .rice::after { content: \"\"; display: block; width: 4px; height: 10px; border-width: 0 3px 3px 0; border-style: solid; transform: rotate(45deg); position: absolute; left: 2px; bottom: -1px; } .rounded-edges .rice { border-radius: 2px; } .circle-checkboxes .rice { border-radius: 6px; } input:checked + .rice { background-attachment: scroll; background-repeat: no-repeat; background-position: bottom right; } /* Selects */ .selectrice { position: relative; cursor: default; overflow: hidden; text-align: left; } #settings .selectrice { display: inline-block; } .selectrice::after { content: \"\"; border-right: .25em solid transparent; border-left: .25em solid transparent; position: absolute; right: .4em; top: .5em; } .selectrice::before { content: \"\"; height: 1.6em; position: absolute; right: 1.3em; top: 0; } /* Select Dropdown */ #selectrice { padding: 0; margin: 0; position: fixed; max-height: 120px; overflow-y: auto; overflow-x: hidden; z-index: 32; } #selectrice:empty { display: none; } /* Post Form Shortcut */ .qr-shortcut.on-page { font-size: 250%; } /* Post Form */ #qr { z-index: 20; position: fixed; background: none; border: none; padding: 1px; min-width: 248px; background: transparent; border: 1px solid transparent; } .sidebar-large #qr { min-width: 299px; } .rounded-edges #qr, .rounded-edges #qrtab { border-radius: 3px 3px 0 0; } .post-form-style-fixed #qr { top: auto !important; } .sidebar-location-left:not(.post-form-style-float) #qr { left: 0 !important; right: auto !important; } .sidebar-location-right:not(.post-form-style-float) #qr { right: 0 !important; left: auto !important; } :root:not(.post-form-style-float) #qr { bottom: 0 !important; } .fourchan-ss-navigation.fixed.bottom-header:not(.post-form-style-float):not(.post-form-style-slideup):not(.post-form-style-tabbed-slideup) #qr, .fourchan-ss-navigation.index.pagination-sticky-bottom:not(.post-form-style-float):not(.post-form-style-slideup):not(.post-form-style-tabbed-slideup) #qr { bottom: 1.5em !important; } .post-form-style-slideup #qr, .post-form-style-slideout #qr { top: auto !important; } .post-form-style-slideup #qr { transform: translateY(93%); } .post-form-style-slideout.sidebar-location-left #qr { transform: translateX(-93%); } .post-form-style-slideout.sidebar-location-right #qr { transform: translateX(93%); } .post-form-style-slideup #qr:hover, .post-form-style-slideup #qr.focus, .post-form-style-slideup #qr.dump { transform: translateY(0); } .post-form-style-slideout #qr:hover, .post-form-style-slideout #qr.focus, .post-form-style-slideout #qr.dump { transform: translate(0); } .post-form-style-tabbed-slideup #qr, .post-form-style-tabbed-slideout #qr { top: auto !important; } .post-form-style-tabbed-slideup #qr { transform: translateY(100%); } .post-form-style-tabbed-slideout.sidebar-location-left #qr { transform: translateX(-100%); } .post-form-style-tabbed-slideout.sidebar-location-right #qr { transform: translateX(100%); } .post-form-style-tabbed-slideup #qr:hover, .post-form-style-tabbed-slideup #qr.focus, .post-form-style-tabbed-slideup #qr.dump { transform: translateY(0); } .post-form-style-tabbed-slideout #qr:hover, .post-form-style-tabbed-slideout #qr.focus, .post-form-style-tabbed-slideout #qr.dump { transform: translateX(0); } .post-form-style-tabbed-slideup #qrtab, .post-form-style-tabbed-slideout #qrtab { position: absolute; top: 0; width: 120px; text-align: center; border-width: 1px 1px 0 1px; cursor: default; } .post-form-style-tabbed-slideup #qrtab { top: auto !important; bottom: 100% !important; right: 50%; transform: translateX(50%); } .post-form-style-tabbed-slideout.sidebar-location-left #qrtab { transform: rotate(90deg); transform-origin: bottom right; left: 100%; } .post-form-style-tabbed-slideout.sidebar-location-right #qrtab { transform: rotate(-90deg); transform-origin: bottom right; right: 100%; } .post-form-style-tabbed-slideup #qr:hover #qrtab, .post-form-style-tabbed-slideup #qr.focus #qrtab, .post-form-style-tabbed-slideup #qr.dump #qrtab, .post-form-style-tabbed-slideout #qr:hover #qrtab, .post-form-style-tabbed-slideout #qr.focus #qrtab, .post-form-style-tabbed-slideout #qr.dump #qrtab { opacity: 0 !important; } .post-form-style-slideup #qrtab input, .post-form-style-slideup #qrtab .rice, .post-form-style-tabbed-slideup #qrtab input, .post-form-style-tabbed-slideup #qrtab .close, .post-form-style-tabbed-slideup #qrtab .rice, .post-form-style-tabbed-slideup #qrtab span, .post-form-style-slideout #qrtab input, .post-form-style-slideout #qrtab .rice, .post-form-style-tabbed-slideout #qrtab input, .post-form-style-tabbed-slideout #qrtab .close, .post-form-style-tabbed-slideout #qrtab .rice, .post-form-style-tabbed-slideout #qrtab span { display: none; } .post-form-style-tabbed-slideup #qrtab .selectrice, .post-form-style-tabbed-slideout #qrtab .selectrice { text-align: center; } .transparent-post-form #qr { opacity: 0.2; transition: opacity .3s ease-in-out 1s; } .transparent-post-form #qr:hover, .transparent-post-form #qr.focus, .transparent-post-form #qr.dump { opacity: 1; transition: opacity .3s linear; } :root:not(.show-post-form-header):not(.post-form-style-float):not(.post-form-style-tabbed-slideout):not(.post-form-style-tabbed-slideup) #qrtab, .post-form-style-float .autohide:not(:hover):not(.focus) form, .show-post-form-header.post-form-style-fixed .autohide:not(:hover):not(.focus) form { display: none !important; } :root:not(.post-form-style-tabbed-slideout) #qrtab { margin-bottom: 1px; } #qr.autohide:not(:hover):not(.focus) #qrtab { margin-bottom: 0; } .post-form-slideout-transitions.post-form-style-slideup #qr, .post-form-slideout-transitions.post-form-style-tabbed-slideup #qr, .post-form-slideout-transitions.post-form-style-slideout #qr, .post-form-slideout-transitions.post-form-style-tabbed-slideout #qr { transition: transform .3s ease-in-out 1s; } .post-form-slideout-transitions.post-form-style-tabbed-slideup #qr.dump, .post-form-slideout-transitions.post-form-style-tabbed-slideup #qr:hover, .post-form-slideout-transitions.post-form-style-tabbed-slideup #qr.focus, .post-form-slideout-transitions.post-form-style-slideup #qr.dump, .post-form-slideout-transitions.post-form-style-slideup #qr:hover, .post-form-slideout-transitions.post-form-style-slideup #qr.focus, .post-form-slideout-transitions.post-form-style-tabbed-slideout #qr.dump, .post-form-slideout-transitions.post-form-style-tabbed-slideout #qr:hover, .post-form-slideout-transitions.post-form-style-tabbed-slideout #qr.focus, .post-form-slideout-transitions.post-form-style-slideout #qr.dump, .post-form-slideout-transitions.post-form-style-slideout #qr:hover, .post-form-slideout-transitions.post-form-style-slideout #qr.focus { transition: transform .3s linear; } .post-form-slideout-transitions #qrtab { transition: opacity .3s ease-in-out 1s; } .post-form-slideout-transitions #qr:hover #qrtab { transition: opacity .3s linear; } .post-form-slideout-transitions #qrtab { transition: opacity .3s ease-in-out 1s; } .post-form-slideout-transitions #qr:hover #qrtab { transition: opacity .3s linear; } #qr .close { float: right; padding: 0 3px; } #qr .warning { min-height: 1.6em; vertical-align: middle; padding: 0 1px; border-width: 1px; border-style: solid; } .persona { display: flex; flex-direction: column; align-items: stretch; } .compact-post-form-inputs .persona { flex-direction: row; } #qr textarea.field { height: 11.6em; min-height: 6em; } #qr.has-captcha textarea.field { height: 6em; } .compact-post-form-inputs .persona input.field { flex: 1 1; margin: 0 0 0 1px; } .compact-post-form-inputs .persona input:focus { flex: 3 1; } .compact-post-form-inputs .persona input.field:first-child { margin: 0; } .compact-post-form-inputs #qr textarea.field { height: 14.9em; min-height: 9em; } .compact-post-form-inputs #qr.has-captcha textarea.field { height: 9em; } .tripcode-hider .tripped:not(:hover):not(:focus) { color: transparent !important; } .textarea-resize-horizontal #qr textarea { resize: horizontal; } .textarea-resize-vertical #qr textarea { resize: vertical; } .textarea-resize-both #qr textarea { resize: both; } .textarea-resize-none #qr textarea { resize: none; } /* Noscript Recaptcha */ .captcha-img { margin: 1px 0px 0px; text-align: center; background-image: #fff; font-size: 0px; min-height: 59px; min-width: 302px; } .captcha-input{ width: 100%; margin: 1px 0 0; } .captcha-input.error:focus { border-color: rgb(255,0,0) !important; } /* Recaptcha v2 */ #qr .captcha-root { position: relative; } #qr .captcha-container > div > div { margin: auto; } #qr .captcha-counter { display: block; width: 100%; text-align: center; pointer-events: none; } #qr.captcha-open .captcha-counter { position: absolute; bottom: 3px; } #qr .captcha-counter > a { pointer-events: auto; } #qr:not(.captcha-open) .captcha-counter > a { display: block; width: 100%; } .captcha-input { width: 100%; margin: 1px 0 0; } .field, .selectrice, button, input:not([type=radio]) { box-sizing: border-box; height: 1.6em; margin: 1px 0 0; vertical-align: bottom; padding: 0 1px; outline: none; transition: color .25s, border-color .25s, flex .25s; } .selectrice { padding-right: 1.6em; } #qr textarea { min-width: 100%; } #file-n-submit { display: flex } #qr [type='submit'] { width: 60px; } [type='file'] { position: absolute; opacity: 0; z-index: -1; } /* Fake File Input */ #qr-filename, #qr-filerm, .has-file #qr-no-file { display: none; } #qr-no-file, .has-file #qr-filename { display: block; } #qr-filename { border: medium none; vertical-align: top; padding: 0; margin: 0; height: auto; background: transparent none; overflow: hidden; text-overflow: ellipsis; width: 88%; } #qr-filename:not(.edit) { pointer-events: none; } .has-file #qr-filerm { display: inline-block; } #qr-extras-container { position: absolute; right: 0; top: 0; z-index: 2; } #qr-extras-container > label, #qr-extras-container > a { cursor: pointer; margin-right: 3px; } #qr-filename-container { box-sizing: border-box; display: inline-block; position: relative; margin-right: 1px; flex: 1 1; overflow: hidden; padding: 2px 1px 0; } /* Thread Select */ #qr-thread-select, #qr-thread-select .selectrice div { display: inline; } #qr-thread-select .selectrice { cursor: pointer; display: inline-block; width: 120px; border: none; background: none transparent; padding: 0; margin: 0; height: auto; } #qr-thread-select .selectrice::before, #qr-thread-select .selectrice::after { display: none; } /* Dumping UI */ .dump #dump-list-container { display: block; } #dump-list-container { display: none; position: relative; overflow-y: hidden; margin-top: 1px; } #dump-list { overflow-x: auto; overflow-y: hidden; white-space: nowrap; width: 248px; max-width: 100%; min-width: 100%; } #dump-list:hover { overflow-x: auto; } .qr-preview { box-sizing: border-box; counter-increment: thumbnails; cursor: move; display: inline-block; height: 90px; width: 90px; padding: 2px; opacity: .5; overflow: hidden; position: relative; text-shadow: 0 1px 1px #000; transition: opacity .25s ease-in-out; vertical-align: top; } .qr-preview:hover, .qr-preview:focus { opacity: .9; } .qr-preview::before { content: counter(thumbnails); color: #fff; position: absolute; top: 3px; right: 3px; text-shadow: 0 0 3px #000, 0 0 8px #000; } .qr-preview#selected { opacity: 1; } .qr-preview.drag { box-shadow: 0 0 10px rgba(0,0,0,.5); } .qr-preview.over { border-color: #fff; } .qr-preview > span { color: #fff; } .remove { background: none; color: #e00; font-weight: 700; padding: 3px; } a:only-of-type > .remove { display: none; } .remove:hover::after { content: \" Remove\"; } .qr-preview > label { background: rgba(0,0,0,.5); color: #fff; right: 0; bottom: 0; left: 0; position: absolute; text-align: center; } .qr-preview > label > input { margin: 0; } #add-post { cursor: pointer; font-size: 2em; position: absolute; top: 50%; right: 10px; transform: translateY(-50%); } /* Ads */ .fade-ads .topad img, .fade-ads .middlead img, .fade-ads .bottomad img { opacity: 0.3; transition: opacity .3s linear; } .fade-ads .topad img:hover, .fade-ads .middlead img:hover, .fade-ads .bottomad img:hover { opacity: 1; } .hide-ads .bottomad + hr, .hide-ads .topad, .hide-ads .middlead, .hide-ads .bottomad, .hide-ads .ad-plea, .hide-ads .center { display: none !important; } .shrink-ads .topad a img, .shrink-ads .bottomad a img { width: 500px; height: auto; } /* Mascot Positions */ #mascot { display: none; position: fixed; z-index: -1; bottom: 0; left: 0; right: 0; line-height: 0; } .click-to-toggle #mascot { cursor: pointer; } .mascot-position-above-post-form.post-form-style-fixed:not(.post-form-decorations) #mascot img { margin-bottom: -2px; } .mascots #mascot { display: block; } .sidebar-location-right.mascot-location-sidebar #mascot, .sidebar-location-left.mascot-location-opposite #mascot { left: auto; } .sidebar-location-left.mascot-location-sidebar #mascot, .sidebar-location-right.mascot-location-opposite #mascot { right: auto; } .sidebar-location-left.mascot-location-sidebar #mascot img, .sidebar-location-right.mascot-location-opposite #mascot img { transform: scaleX(-1); } .fourchan-ss-navigation.bottom-header.fixed #mascot, .fourchan-ss-navigation.index.pagination-sticky-bottom #mascot { bottom: 1.5em } .mascots-overlap-posts #mascot { z-index: 3; } .mascot-position-middle #mascot { bottom: 50% !important; transform: translateY(50%); } .mascot-position-top #mascot { bottom: auto !important; top: 17px; } /* Options */ #overlay { position: fixed; z-index: 30; top: 0; right: 0; left: 0; bottom: 0; background: rgba(0,0,0,.5); } #appchanx-settings { width: auto; left: 0; right: 0; top: 15%; bottom: 15%; position: fixed; z-index: 31; padding: .3em; max-width: 70%; min-width: 800px; margin: auto; } .rounded-edges #appchanx-settings, .rounded-edges #appchanx-settings fieldset, .rounded-edges .mascots-container, .rounded-edges .section-container, .rounded-edges .sections-list > a { border-radius: 3px; } .description { display: none; } #appchanx-settings h3, .section-keybinds, .section-mascots, .section-script, .style { text-align: center; } .section-keybinds table, .section-script fieldset, .section-style fieldset { text-align: left; } .section-keybinds table { margin: auto; } #appchanx-settings fieldset { padding: 5px 0; vertical-align: top; border: 0; margin: 0 3px 6px; display: inline-block; } .single-column-mode #appchanx-settings fieldset { display: block; margin: 0 auto 6px; } #appchanx-settings .section-advanced fieldset { display: block; margin: 0 auto 6px; } .section-advanced .archive-cell { min-width: 200px; } .section-advanced .selectrice { display: inline-block; clear: both; } .section-container { overflow: auto; position: absolute; top: 1.7em; right: 5px; bottom: 5px; left: 5px; padding: 5px; } .sections-list { padding: 0 3px; float: left; } .sections-list > a { cursor: pointer; position: relative; padding: 0 4px; z-index: 1; height: 1.4em; display: inline-block; border-width: 1px 1px 0 1px; border-color: transparent; border-style: solid; } .sections-list > a.tab-selected { border-style: solid; } .credits { float: right; position: relative; z-index: 1; } #appchanx-settings h3 { margin: 0; } .section-script fieldset > div, .section-style 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-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) { background-color: rgba(0, 0, 0, 0.05); } article li { margin: 10px 0 10px 2em; } #appchanx-settings .option { width: 50%; display: inline-block; vertical-align: bottom; } .option input { width: 100%; } .optionlabel { padding-left: 18px; } .rice + .optionlabel { padding-left: 0; } .section-script fieldset, .styleoption { text-align: left; } .section-style fieldset { width: 370px; } .section-script fieldset { width: 200px; } #mascotcontent, #themecontent, .suboptions { overflow: auto; position: absolute; top: 0; right: 0; bottom: 1.7em; left: 0; } #mascotcontent, #themecontent { padding: 5px; } #themecontent { top: 1.8em; } .mAlign { height: 250px; vertical-align: bottom; display: table-cell; line-height: 0; } #save, .stylesettings { position: absolute; right: 10px; bottom: 0; } .section-style .suboptions { bottom: 0; } .section-container textarea { font-family: monospace; min-height: 150px; resize: vertical; width: 100%; } div[data-checked=\"false\"] > .suboption-list { display: none; } .suboption-list { position: relative; } .suboption-list::before { content: \"\"; display: inline-block; position: absolute; left: .7em; width: 0; height: 100%; border-left: 1px solid; } .suboption-list > div { position: relative; padding-left: 1.4em; } .suboption-list > div::before { content: \"\"; display: inline-block; position: absolute; left: .7em; width: .7em; height: .6em; border-left: 1px solid; border-bottom: 1px solid; } /* Hover Functionality */ #mouseover { z-index: 33; position: fixed; max-width: 70%; } #mouseover:empty { display: none; } /* Mascot Tab */ #mascot_hide { padding: 3px; position: absolute; top: 2px; right: 18px; } #mascot_hide .rice { float: left; } #mascot_hide > div { height: 0; text-align: right; overflow: hidden; } #mascot_hide:hover > div { height: auto; } #mascot_hide label { width: 100%; display: block; clear: both; text-decoration: none; } .mascots-container { padding: 0; text-align: center; } .mascot, .mascotcontainer { overflow: hidden; } .mascot { position: relative; border: none; margin: 5px; padding: 0; width: 200px; display: inline-block; background-color: transparent; } .mascotcontainer { height: 250px; border: 0; margin: 0; max-height: 250px; cursor: pointer; bottom: 0; border-width: 0 1px 1px; border-style: solid; border-color: transparent; overflow: hidden; } .mascot img { max-width: 200px; } .export-button, .mascotname, #mascot-options { box-sizing: border-box; padding: 0; width: 100%; } #mascot-options { opacity: 0; transition: opacity .3s linear; } .mascot:hover #mascot-options { opacity: 1; } #mascot-options { position: absolute; bottom: 0; right: 0; left: 0; } .export-button { position: absolute; bottom: 1.7em; right: 0; left: 0; text-align: center; } #mascot-options a { display: inline-block; width: 33%; } #upload { position: absolute; width: 100px; left: 50%; margin-left: -50px; text-align: center; bottom: 0; } #mascots_batch { position: absolute; left: 10px; bottom: 0; } /* Themes Tab */ #themes h1 { position: absolute; right: 300px; bottom: 10px; margin: 0; transition: all .2s ease-in-out; opacity: 0; } #themes .selectedtheme h1 { right: 11px; opacity: 1; } #addthemes { position: absolute; left: 10px; bottom: 0; } .theme { margin: 1em; } /* Theme Editor */ #themeConf { position: fixed; top: 0; bottom: 0; width: 296px; z-index: 10; } .sidebar-location-right #themeConf { right: 2px; left: auto; } .sidebar-location-right #themeConf { left: 2px; right: auto; } #themebar input { width: 30%; } .option .color { width: 10%; border-left: none !important; color: transparent !important; } .option .colorfield { width: 90%; } .themevar textarea { min-width: 100%; max-width: 100%; height: 20em; resize: vertical; } /* Mascot Editor */ #mascotConf { position: fixed; height: 17em; bottom: 0; left: 50%; width: 500px; margin-left: -250px; overflow: auto; z-index: 10; } #mascotConf .option, #mascotConf .optionlabel { box-sizing: border-box; width: 50%; display: inline-block; vertical-align: middle; } #mascotConf .option input { width: 100%; } #close { position: absolute; left: 10px; bottom: 0; } /* Gallery */ #a-gallery { position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 26; display: flex; flex-direction: row; background: rgba(0,0,0,0.7); } .gal-viewport { display: flex; align-items: stretch; flex-direction: row; flex: 1 1 auto; overflow: hidden; } .gal-thumbnails { flex: 0 0 150px; overflow-y: auto; display: flex; flex-direction: column; align-items: stretch; text-align: center; background: rgba(0,0,0,.5); border-left: 1px solid #222; } .gal-hide-thumbnails .gal-thumbnails { display: none; } .gal-thumb img { max-width: 125px; max-height: 125px; height: auto; width: auto; } .gal-thumb { flex: 0 0 auto; padding: 3px; line-height: 0; transition: background .2s linear; } .gal-highlight { background: rgba(0, 190, 255,.8); } .gal-prev { order: 0; border-right: 1px solid #222; } .gal-next { order: 2; border-left: 1px solid #222; } .gal-prev, .gal-next { flex: 0 0 20px; position: relative; cursor: pointer; opacity: 0.7; background-color: rgba(0, 0, 0, 0.3); } .gal-prev:hover, .gal-next:hover { opacity: 1; } .gal-prev::after, .gal-next::after { position: absolute; top: 48.6%; transform: translateY(-50%) display: inline-block; border-top: 11px solid transparent; border-bottom: 11px solid transparent; content: \"\"; } .gal-prev::after { border-right: 12px solid #fff; right: 5px; } .gal-next::after { border-left: 12px solid #fff; right: 3px; } .gal-image { order: 1; flex: 1 0 auto; display: flex; align-items: flex-start; justify-content: space-around; overflow: auto; /* Flex > Non-Flex child max-width and overflow fix (Firefox only?) */ width: 1%; } .gal-image a { margin: auto; line-height: 0; max-width: 100%; } .gal-fit-width .gal-image video, .gal-fit-width .gal-image img { max-width: 100%; } .gal-fit-height .gal-image video, .gal-fit-height .gal-image img { max-height: 95vh; max-height: calc(100vh - 25px); } .gal-buttons { font-size: 2em; margin-right: 10px; top: 5px; color: #fff; text-shadow: 0px 0px 1px #000; } .gal-buttons, .gal-name, .gal-count { position: fixed; right: 178px; } .hide-thumbnails .gal-buttons, .hide-thumbnails .gal-count, .hide-thumbnails .gal-name { right: 28px; } .gal-name { bottom: 5px; background: rgba(0,0,0,0.6) !important; border-radius: 3px; padding: 1px 5px 2px 5px; text-decoration: none !important; color: #fff !important; } .gal-name:hover, .gal-close:hover { color: rgb(95, 95, 101) !important; } .gal-count { bottom: 26px; background: rgba(0,0,0,0.6) !important; border-radius: 3px; padding: 1px 5px 2px 5px; color: #fff !important; } .gal-buttons.gal-playing > .gal-start, .gal-buttons:not(.gal-playing) > .gal-stop { display: none; } /* Catalog */ #content .navLinks, #info .navLinks, .btn-wrap { display: block; } .hide-navlinks body > .navLinks { display: none; } .navLinks > .btn-wrap:not(:first-of-type)::before { content: ' - '; } .button { cursor: pointer; } #content .btn-wrap, #info .btn-wrap { display: inline-block; } #post-preview, #quote-preview { position: absolute; z-index: 22; } .rounded-edges #post-preview { border-radius: 3px; } #settings, #threads, #info .navLinks, #content .navLinks { text-align: center; } #threads .thread { vertical-align: top; display: inline-block; word-wrap: break-word; overflow: hidden; margin: 1px; padding: 5px 0 3px; text-align: center; } .extended-small .thread, .small .thread { width: 165px; max-height: 320px; } .small .teaser, .large .teaser { display: none; } .extended-large .thread, .large .thread { width: 270px; max-height: 410px; } .extended-small .thumb, .small .thumb { max-width: 150px; max-height: 150px; } .panel { position: fixed; top: 50% !important; left: 50%; transform: translate(-50%, -50%); padding: 5px; } .icon::after { display: inline-block; float: right; width: 1em; cursor: pointer; } .helpIcon::after { content: '?'; } .closeIcon::after { content: '\uf00d'; font-family: FontAwesome; font-weight: normal; font-style: normal; text-decoration: inherit; -webkit-font-smoothing: antialiased; font-size:14px !important; } /* Front Page */ #logo { text-align: center; } #doc { box-sizing: border-box; margin: 10px auto; width: 1006px; padding: 2px; position: relative; } .rounded-edges #doc, .rounded-edges #doc div { border-radius: 3px; } #boards .boxcontent { vertical-align: top; text-align: center; } #filter-container, #options-container { top: 4px; right: 8px; position: absolute; } #filtermenu, #optionsmenu { top: 100% !important; left: auto !important; right: 0 !important; } #boards .column { box-sizing: border-box; display: inline-block; width: 180px; text-align: left; vertical-align: top; } .bd ul, .boxcontent ul { vertical-align: top; padding: 0; margin: 0; } .right-box .boxcontent ul { padding: 0 10px; } .yuimenuitem, .boxcontent ul > li { list-style-type: none; } .boxbar { position: relative; } #doc h3, .boxbar h2 { margin: 0; } #doc h3 { text-decoration: none !important; } .underline-links #doc h3 { text-decoration: underline !important; } #ft, .box-outer { margin: 2px 0 0; overflow: hidden; } #ft, .boxbar, .boxcontent { padding: 0 8px; } .yui-module { position: absolute; } .yuimenuitem::before { content: \" [ ] \"; font-family: monospace; } .yuimenuitem-checked::before { content: \" [x] \" } .yui-g { overflow: hidden; } .yui-u { display: inline-block; vertical-align: top; width: 499px; float: right; } .yui-u.first { float: left; } #recent-images .boxcontent { text-align: center; } #ft { text-align: center; } #ft ul { padding: 0; } #ft li { list-style-type: none; display: inline-block; width: 100px; } #preview-tooltip-nws, #preview-tooltip-ws, #ft .fill, .clear-bug, #disclaimer-dialog_c { display: none; } .masked #disclaimer-dialog_c { display: block; } #disclaimer-dialog { position: fixed; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); z-index: 999; } #disclaimer-dialog > div { padding: 2px; } /* ExLinks */ #exlinks-options-content { padding: 5px; } /* /f/ */ [action*='/f/'] .fileInfo { padding-left: 5px !important; } [action*='/f/'] .subject, .name-col { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-wrap: break-word; } div.swfSauce { margin-top: 5px !important; } .mobile.center { display:none!important; } table.flashListing { border-spacing: 1px !important; margin: 5px auto !important; } .flashListing td { padding: 2px !important; font-size: 9pt !important; text-align: center !important; margin: 0px !important; } #delform[action='https://sys.4chan.org/f/up.php'], #delform[action='https://sys.4chan.org/f/up.php'] .postblock { background: none !important; border: none !important; box-shadow: none !important; }" + ' ' + "/*! * Font Awesome 4.0.3 * the iconic font designed for Bootstrap * ------------------------------------------------------------------------------ * The full suite of pictographic icons, examples, and documentation can be * found at http://fontawesome.io. Stay up to date on Twitter at * http://twitter.com/fontawesome. * * License * ------------------------------------------------------------------------------ * - The Font Awesome font is licensed under SIL OFL 1.1 - * http://scripts.sil.org/OFL * - Font Awesome CSS, LESS, and SASS files are licensed under MIT License - * http://opensource.org/licenses/mit-license.html * - Font Awesome documentation licensed under CC BY 3.0 - * http://creativecommons.org/licenses/by/3.0/ * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: * \"Font Awesome by Dave Gandy - http://fontawesome.io\" * * Author - Dave Gandy * ------------------------------------------------------------------------------ * Email: dave@fontawesome.io * Twitter: http://twitter.com/davegandy * Work: Lead Product Designer @ Kyruus - http://kyruus.com */ @font-face{font-family: 'FontAwesome';src: url('data:application/font-woff;base64,d09GRgABAAAAAP+sAA4AAAABtiAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABRAAAABwAAAAcZ7MpnUdERUYAAAFgAAAAHwAAACACLQAET1MvMgAAAYAAAAA+AAAAYIsCekxjbWFwAAABwAAAAUcAAAKy1JOsXGdhc3AAAAMIAAAACAAAAAj//wADZ2x5ZgA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JhZw87Mdogs9KimlE4vvWHyojcWjXueOsh06U3b95Jqh1JHpVUZ0cxAC9n18TVQJrS8YtTJqXmWQ4qWV6nyrHHozv7KvJo/axyF+CQ9c51JP0th6jlmJ02BEU6RmabGtcXvT7tU1JzQ85eGdGP0HCCqOJkupWVLpLjhAh6YbtIP+WqbzSz/uDEnRFILezjRT08KU3Poh4NN/2hBqzoiz64MD89z9ZUik4Y114pqDn9qjnScYNYHnhsvTdBTnF6l0iaaGR8rR5VNTigOT1W5qXHDdzXe4KbJTYubcW7kz7bFlYVj5Gu1QjNtBrVrPGRQm0FtBrUZ1GZQu51S6mMSobFU5abGTT3abYcKD5rctLgZ54ZBlTFu+GuFQRUGVercNLhhRIURFUZUYtt2HIt7xlUZV2VclXFVxlUZV2VclXFV1lRjTTVG1BhRY0QtNm9RvOGiStzLFQytxSoXNeK+Gfe8eZ33qLPWOmuts9a6/MDQegzdiRU3WHGDt20wqMGgBoMaDGowqMGgBpvaZESTEU1GNBnRjE1dLL8xqNkif3flNwa1+EOLQS0GtfhDi9W0WE2ryYt1llhNixHjjBhnBPOizryoMy/qzIs686LOvKgzL+rjjGgzos0IJkW9zYh2/b9JDKDxAAAAAVP8s60AAA==') format('woff');font-weight:normal;font-style:normal;}.fa,.pfa::after,.pfa::before{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;speak:none;font-size:14px !important;}#shortcuts .fa {color:rgb(130,130,130) !important;}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}",
    dynamic: function() {
      var editSpace, sidebarLocation;
      sidebarLocation = Conf["Sidebar Location"] === "left" ? ["left", "right"] : ["right", "left"];
      if (Conf['editMode'] === "theme") {
        editSpace = {};
        editSpace[sidebarLocation[1]] = 300;
        editSpace[sidebarLocation[0]] = 0;
      } else {
        editSpace = {
          left: 0,
          right: 0
        };
      }
      return "#boardNavDesktopFoot a, #header-bar a, #header-bar .shortcut > span, .deleteform::before, .field, .hide-navigation-decorations .pages a, .notification, .selectrice, body, button, input, textarea { font-size: " + (parseInt(Conf["Font Size"], 10)) + "px; } #boardTitle, .boardTitle a { font-size: " + (parseInt(Conf["Font Size"], 10) + 10) + "px; } .boardSubtitle, .boardSubtitle a { font-size: " + (parseInt(Conf["Font Size"], 10) - 1) + "px; } body, button, input, textarea { font-family: " + Conf["Font"] + "; } body { padding: 0 " + (parseInt(Conf["Right Thread Padding"], 10) + editSpace["right"]) + "px 0 " + (parseInt(Conf["Left Thread Padding"], 10) + editSpace["left"]) + "px; } .board > .thread { margin: " + (parseInt(Conf["Top Thread Padding"], 10)) + "px 0 " + (parseInt(Conf["Bottom Thread Padding"], 10)) + "px 0; } .post, .summary { margin-bottom: " + Conf["Post Spacing"] + "px; } .thread > .threadContainer:last-of-type { margin-bottom: -" + Conf["Post Spacing"] + "px; } .thread > .replyContainer > .reply.post { border-width: " + (Conf['Post Spacing'] === "0" ? "1px 1px 0 1px" : '1px') + "; } #post-preview, .postMessage { margin: " + Conf['Vertical Post Padding'] + "px " + Conf['Horizontal Post Padding'] + "px; } :root:not(fourchan-ss-navigation):not(.pagination-on-side) .pagelist, :root:not(fourchan-ss-navigation) #header-bar { margin-left: " + (parseInt(Conf["Left Thread Padding"], 10) + editSpace["right"]) + "px; margin-right: " + (parseInt(Conf["Right Thread Padding"], 10) + editSpace["left"]) + "px; } #mascot { opacity: " + Conf['Mascot Opacity'] + "; }";
    },
    setTheme: function(theme) {
      return Style.sheets.theme.textContent = Style.theme(theme);
    },
    theme: function(theme) {
      var bLink, background, backgroundC, bgColor, i, replyRGB, replybg, svg, svgs, _i, _len;
      bgColor = new Color(backgroundC = theme["Background Color"]);
      replybg = new Color(theme["Reply Background"]);
      bLink = new Color(theme["Backlinks"]);
      replyRGB = "rgb(" + (replybg.shiftRGB(parseInt(Conf['Silhouette Contrast'], 10), true)) + ")";
      Style.lightTheme = bgColor.isLight();
      svgs = [['captcha-filter', "values='" + (Style.filter(Style.matrix(theme["Text"], theme["Input Background"]))) + " 0 0 0 1 0'"], ['mascot-filter', "values='" + (Style.silhouette(Style.matrix(replyRGB))) + " 0 0 0 1 0'"], ['grayscale', 'id="color" type="saturate" values="0"'], ['icons-filter', "values='-.6 0 0 0 1 0 -.6 0 0 1 0 0 -.6 0 1 0 0 0 1 0'"]];
      for (i = _i = 0, _len = svgs.length; _i < _len; i = ++_i) {
        svg = svgs[i];
        Style.svgs[svg[0].replace(/\-/, "")] = Style.generateFilter(svg[0], svg[1]);
      }
      return (".hide_thread_button span > span, .hide_reply_button span > span { background-color: " + theme["Links"] + "; } #mascot_hide label { border-bottom: 1px solid " + theme["Reply Border"] + "; } #content .thumb { box-shadow: 0 0 5px " + theme["Reply Border"] + "; } .export-button, .mascotname, #mascot-options { background: " + theme["Dialog Background"] + "; border: 1px solid " + theme["Buttons Border"] + "; } .highlight-you .opContainer.quotesYou, .highlight-own .opContainer.your-post, .opContainer.filter-highlight { box-shadow: inset 5px 0 " + theme["Backlinked Reply Outline"] + "; } .highlight-you .quotesYou > .reply, .highlight-own .your-post > .reply, .filter-highlight > .reply { box-shadow: -5px 0 " + theme["Backlinked Reply Outline"] + "; } hr { border-bottom: 1px solid " + theme["Reply Border"] + "; } hr#unread-line { border-bottom: 1px solid " + theme["Reply Background"] + "; visibility: visible; } .threadContainer { border-color: " + theme["Reply Border"] + " !important; } html { background: " + (backgroundC || '') + "; background-image: " + (theme["Background Image"] || '') + "; background-repeat: " + (theme["Background Repeat"] || '') + "; background-attachment: " + (theme["Background Attachment"] || '') + "; background-position: " + (theme["Background Position"] || '') + "; } .panel, .section-container, #exlinks-options-content, #themecontent { background: " + backgroundC + "; border: 1px solid " + theme["Reply Border"] + "; } .sections-list > a.tab-selected { background: " + backgroundC + "; border-color: " + theme["Reply Border"] + "; } img[src*=\"//boards.4chan.org/js/jsMath/fonts/\"], .captcha-filter .captcha-img, .captcha-filter .captcha-root iframe, .captcha-filter .pls-container { filter: url('data:image/svg+xml," + (Style.svgs.captchafilter.replace(/(\'|\")/g, '%22')) + "#captcha-filter'); } .silhouettize-mascots #mascot img, .silhouette img { filter: url('data:image/svg+xml," + (Style.svgs.mascotfilter.replace(/(\'|\")/g, '%22')) + "#mascot-filter'); } .grayscale-mascots #mascot { filter: url('data:image/svg+xml," + (Style.svgs.grayscale.replace(/(\'|\")/g, '%22')) + "#grayscale'); } #boardTitle { text-shadow: 1px 1px " + backgroundC + ", -1px -1px " + backgroundC + ", 1px -1px " + backgroundC + ", -1px 1px " + backgroundC + "; } .sidebar-glow #boardTitle { text-shadow: 1px 1px 1px " + backgroundC + ", -1px -1px 1px " + backgroundC + ", 1px -1px 1px " + backgroundC + ", -1px 1px 1px " + backgroundC + ", 0 2px 4px rgba(0,0,0,.6), 0 0 10px rgba(0,0,0,.6); } #exlinks-options, #appchanx-settings, #qrtab, input[type=\"submit\"], input[value=\"Report\"], span[style=\"left: 5px; position: absolute;\"] a { background: " + theme["Buttons Background"] + "; border: 1px solid " + theme["Buttons Border"] + "; } .enabled .mascotcontainer { background: " + theme["Buttons Background"] + "; border-color: " + theme["Buttons Border"] + "; } #dump, #qr-filename-container, #appchanx-settings input, .captcha-img, .dump #dump, .qr-preview, .selectrice, button, input, textarea { background: " + theme["Input Background"] + "; border: 1px solid " + theme["Input Border"] + "; } .has-file #qr-extras-container { background: " + theme["Input Background"] + "; } #dump:hover, #qr-filename-container:hover, .selectrice:hover, #selectrice li:hover, #selectrice li:nth-of-type(2n+1):hover, input:hover, textarea:hover { background: " + theme["Hovered Input Background"] + "; border-color: " + theme["Hovered Input Border"] + "; } .has-file #qr-filename-container:hover #qr-extras-container { background: " + theme["Hovered Input Background"] + "; } #dump:active, #dump:focus, #selectrice li:focus, .selectrice:focus, #qr-filename-container:active, #qr-filename-container:focus, input:focus, textarea:focus, textarea.field:focus { background: " + theme["Focused Input Background"] + "; border-color: " + theme["Focused Input Border"] + "; color: " + theme["Inputs"] + "; } .has-file #qr-filename-container:active #qr-extras-container, .has-file #qr-filename-container:focus #qr-extras-container { background: " + theme["Focused Input Background"] + "; } #disclaimer-dialog, #ft, #mouseover, #post-preview, #qp .post, #threads > .thread, #xupdater, .box-outer, .reply.post { border-width: 1px; border-style: solid; border-color: " + theme["Reply Border"] + "; background: " + theme["Reply Background"] + "; } .exblock.reply, .reply.post.highlight, .reply.post:target { background: " + theme["Highlighted Reply Background"] + "; border: 1px solid " + theme["Highlighted Reply Border"] + "; } #header-bar, .pagelist { background: " + theme["Navigation Background"] + "; border-color: " + theme["Navigation Border"] + "; } #doc, #threads, .board > .thread { background: " + theme["Thread Wrapper Background"] + "; border: 1px solid " + theme["Thread Wrapper Border"] + "; } #boardNavDesktopFoot, #mascot_hide, #menu, #selectrice, #themeConf, #thread-watcher, #thread-watcher:hover, .announcements-slideout #globalMessage, .dialog, .post-form-style-float #qr, .post-form-decorations #qr, .submenu { background: " + theme["Dialog Background"] + "; border: 1px solid " + theme["Dialog Border"] + "; } #qp.dialog { border: none; } .watch-thread-link { background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='" + (theme["Post Numbers"].replace('#', '%23')) + "' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\"); } .deleteform::before, .deleteform, #qr .warning { background: " + theme["Input Background"] + "; border-color: " + theme["Input Border"] + "; } .disabledwarning, .warning { color: " + theme["Warnings"] + "; } #charCount { color: " + (Style.lightTheme ? "rgba(0,0,0,0.7)" : "rgba(255,255,255,0.7)") + "; } .postNum a { color: " + theme["Post Numbers"] + "; } .subject { color: " + theme["Subjects"] + " !important; } .dateTime, .post-ago { color: " + theme["Timestamps"] + " !important; } #fs_status a, #header-bar .shortcut > span, #updater #update-status:not(.new)::after, #showQR, .abbr, .boxbar, .boxcontent, .deleteform::before, .pages strong, .pln, .reply, .reply.highlight, .summary, body, button, span[style=\"left: 5px; position: absolute;\"] a, input, textarea { color: " + theme["Text"] + "; } #exlinks-options-content > table, #appchanx-settings fieldset, #selectrice { border-bottom: 1px solid " + theme["Reply Border"] + "; box-shadow: inset " + theme["Shadow Color"] + " 0 0 5px; } .quote + .spoiler:hover, .quote { color: " + theme["Greentext"] + "; } .forwardlink { border-bottom: 1px dashed " + theme["Backlinks"] + "; } .container::before { color: " + theme["Timestamps"] + "; } .quote-shadows #menu, .quote-shadows #post-preview, .quote-shadows #qp .opContainer, .quote-shadows #qp .replyContainer, .quote-shadows .submenu { box-shadow: 5px 5px 5px " + theme['Shadow Color'] + "; } .rice { background: " + theme["Checkbox Background"] + "; border: 1px solid " + theme["Checkbox Border"] + "; } .selectrice::before { border-left: 1px solid " + theme["Input Border"] + "; } .selectrice::after { border-top: .45em solid " + theme["Inputs"] + "; } .bd { background: " + theme["Buttons Background"] + "; border: 1px solid " + theme["Buttons Border"] + "; } .pages a, #header-bar a { color: " + theme["Navigation Links"] + "; } input[type=checkbox]:checked + .rice::after { border-color: " + theme["Inputs"] + "; } #addReply, #dump, .button, .entry, .replylink, a { color: " + theme["Links"] + "; } .backlink { color: " + theme["Backlinks"] + "; } .backlink-icons .backlink { background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 30 30' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(" + (bLink.rgb()) + ")' d='M12.981,9.073V6.817l-12.106,6.99l12.106,6.99v-2.422c3.285-0.002,9.052,0.28,9.052,2.269c0,2.78-6.023,4.263-6.023,4.263v2.132c0,0,13.53,0.463,13.53-9.823C29.54,9.134,17.952,8.831,12.981,9.073z'/></svg>\"); font-size: 0px !important; padding: 12px 12px 1px 1px; opacity: 0.6; } .qiQuote, .quotelink { color: " + theme["Quotelinks"] + "; } #addReply:hover, #dump:hover, .entry:hover, .replylink:hover, .qiQuote:hover, .quotelink:hover, a .name:hover, a .postertrip:hover, a:hover { color: " + theme["Hovered Links"] + "; } #header-bar a:hover, #boardTitle a:hover { color: " + theme["Hovered Navigation Links"] + "; } #boardTitle { color: " + theme["Board Title"] + "; } .name, .post-author { color: " + theme["Names"] + " !important; } .post-tripcode, .postertrip, .trip { color: " + theme["Tripcodes"] + " !important; } a .postertrip, a .name { color: " + theme["Emails"] + "; } .post.reply.qphl, .post.op.qphl { border-color: " + theme["Backlinked Reply Outline"] + "; background: " + theme["Highlighted Reply Background"] + "; } .quote-shadows .inline .post { box-shadow: 5px 5px 5px " + theme['Shadow Color'] + "; } .placeholder, #qr input::placeholder, #qr textarea::placeholder { color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important; } #qr input:placeholder, #qr textarea:placeholder, .placeholder { color: " + (Style.lightTheme ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.2)") + " !important; } #appchanx-settings fieldset, .boxcontent dd, .selectrice ul { border-color: " + (Style.lightTheme ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)") + "; } #appchanx-settings li, #selectrice li:not(:first-of-type) { border-top: 1px solid " + (Style.lightTheme ? "rgba(0,0,0,0.05)" : "rgba(255,255,255,0.025)") + "; } .a-icon, #shortcuts .fa { " + (!Style.lightTheme ? "filter: url('data:image/svg+xml," + (Style.svgs.iconsfilter.replace(/(\'|\")/g, '%22')) + "#icons-filter');" : "") + " } .alternate-post-colors #threads > .thread:nth-of-type(2n+1), .alternate-post-colors .replyContainer:nth-of-type(2n+1) .post { background-image: linear-gradient(" + (replybg ? "rgba(" + (replybg.shiftRGB(-4, false)) + ",0.8), rgba(" + (replybg.shiftRGB(-4, false)) + ",0.8)" : 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)") + "); } .color-reply-headings .boxbar, .color-reply-headings .postInfo { background: " + (replybg ? "rgba(" + (replybg.shiftRGB(-12, false)) + ",0.8)" : "rgba(0,0,0,0.1)") + "; border-bottom: 1px solid " + theme["Reply Border"] + " } .color-file-info .file { background: " + (replybg ? "rgba(" + (replybg.shiftRGB(-8, false)) + ",0.8)" : "rgba(0,0,0,0.1)") + "; border-bottom: 1px solid " + theme["Reply Border"] + " border-top: 1px solid " + theme["Reply Border"] + " } .color-reply.headings.color-file-info { border-top: none; } .op-background .op.post { background: " + theme["Reply Background"] + "; border: 1px solid " + theme["Reply Border"] + "; } .op-background .op.post:target .op-background .op.post.highlight { background: " + theme["Highlighted Reply Background"] + "; border: 1px solid " + theme["Highlighted Reply Border"] + "; } .fourchan-banner-at-sidebar-top.icon-orientation-vertical body::after { background: " + backgroundC + "; } .fourchan-banner-at-sidebar-top.icon-orientation-vertical.fourchan-ss-sidebar body::after, .fourchan-banner-at-sidebar-top.fourchan-ss-sidebar body::before { background: rgba(" + ((background = new Color(theme["Reply Background"])) ? background.shiftRGB(-18) : void 0) + ", 0.8); } .fourchan-ss-sidebar.sidebar-location-right body::before { border-left: 2px solid " + backgroundC + "; box-shadow: inset 1px 0 0 " + theme["Reply Border"] + ", -1px 0 0 " + theme["Reply Border"] + "; } .fourchan-ss-sidebar.sidebar-location-left body::before { border-right: 2px solid " + backgroundC + "; box-shadow: 1px 0 0 " + theme["Reply Border"] + ", inset -1px 0 0 " + theme["Reply Border"] + "; } .sage-highlighting-text.sage-highlight-position-before a.useremail[href*=\"sage\"]:last-of-type::before, .sage-highlighting-text.sage-highlight-position-before a.useremail[href*=\"Sage\"]:last-of-type::before, .sage-highlighting-text.sage-highlight-position-before a.useremail[href*=\"SAGE\"]:last-of-type::before, .sage-highlighting-text.sage-highlight-position-after a.useremail[href*=\"sage\"]:last-of-type::after, .sage-highlighting-text.sage-highlight-position-after a.useremail[href*=\"Sage\"]:last-of-type::after, .sage-highlighting-text.sage-highlight-position-after a.useremail[href*=\"SAGE\"]:last-of-type::after { content: \" (sage) \"; color: " + theme["Sage"] + "; } .quote-shadows #qr { box-shadow: 5px 5px 5px " + theme['Shadow Color'] + "; } /* /f/ */ .postblock { color: " + theme["Text"] + "; font-weight: bold; font-size: 10pt; } tbody > tr:nth-of-type(2n+1){ background: " + theme["Reply Background"] + " !important; } table.flashListing .highlightPost::after { content: '●'; color: " + theme["Text"] + "; position: relative; left: 12px; margin-left: -10px; } .flashListing > tbody { background: url('/image/fade.png') repeat-x scroll center top " + backgroundC + " !important; padding-top: 200px; } " + (theme["Custom CSS"].replace(/\s+/g, ' ').trim())) + ' ' + ("" + (Style.lightTheme ? " .prettyprint { background-color: #e7e7e7 !important; border: 1px solid #dcdcdc !important; } .com { color: #dd0000 !important; } .str, .atv { color: #7fa61b !important; } .pun { color: #61663a !important; } .tag { color: #117743 !important; } .kwd { color: #5a6F9e !important; } .typ, .atn { color: #9474bd !important; } .lit { color: #368c72 !important; } " : " .prettyprint { background-color: rgba(0,0,0,.1) !important; border: 1px solid rgba(0,0,0,0.5) !important; } .tag { color: #96562c !important; } .pun { color: #5b6f2a !important; } .com { color: #a34443 !important; } .str, .atv { color: #8ba446 !important; } .kwd { color: #987d3e !important; } .typ, .atn { color: #897399 !important; } .lit { color: #558773 !important; } "));
    },
    iconPositions: function() {
      var el, psa, psaIcon, slideNav;
      slideNav = $.el('span', {
        id: 'so-nav'
      });
      $.extend(slideNav, {
        innerHTML: "<i class=\"a-icon\"></a>"
      });
      $.add(slideNav, $.id('boardNavDesktopFoot'));
      Header.addShortcut(slideNav, true);
      if (Conf['Announcements'] === 'slideout') {
        if ((psa = $.id('globalMessage')) && !psa.hidden) {
          psaIcon = $.el('i', {
            id: 'so-psa'
          });
          $.extend(psaIcon, {
            innerHTML: "<i class=\"a-icon\"></a>"
          });
          $.add(psaIcon, psa);
          Header.addShortcut(psaIcon, true);
        }
      }
      if (!Conf['JSON Navigation'] && g.VIEW === 'thread') {
        el = $('body > div.navLinks > a');
        el.textContent = '';
        el.id = 'returnIcon';
        el.className = 'a-icon';
        return Header.addShortcut(el, true);
      }
    },
    padding: function() {
      var navHeight, pageHeight, _ref;
      navHeight = Header.bar.offsetHeight;
      pageHeight = ((_ref = $('.pagelist', d.body)) != null ? _ref.offsetHeight : void 0) || 15;
      return Style.sheets.padding.textContent = ("body { padding-bottom: 15px; padding-top: 15px; } .fourchan-ss-navigation.fixed.top-header:not(.autohide) body::before { top: " + navHeight + "px; } .fourchan-ss-navigation.fixed.bottom-header:not(.autohide) body::before { bottom: " + navHeight + "px; } .top-header:not(.autohide) body { padding-top: " + (navHeight + 1) + "px; } .bottom-header:not(.autohide) body { padding-bottom: " + (navHeight + 15) + "px; }") + (pageHeight ? ' ' + (".fourchan-ss-navigation.index.pagination-sticky-top body::before, .fourchan-ss-navigation.index.pagination-top body::before { top: " + pageHeight + "px; } .fourchan-ss-navigation.index.pagination-sticky-bottom body::before, .fourchan-ss-navigation.index.pagination-bottom body::before { bottom: " + pageHeight + "px; } .index.pagination-sticky-top body, .index.pagination-top body { padding-top: " + (pageHeight + 1) + "px; } .index.pagination-sticky-bottom body, .index.pagination-bottom body { padding-bottom: " + (pageHeight + 15) + "px; }") : '');
    }
  };


  /*
    Color adapted from 4chan Style Script
   */

  ThemeTools = {
    init: function(key) {
      var colorInput, div, fileInput, header, input, item, layout, theme, themeContent, _i, _j, _len, _len1, _ref;
      Conf['editMode'] = "theme";
      theme = Themes[key];
      if (theme) {
        editTheme = JSON.parse(JSON.stringify(theme));
        editTheme["Theme"] = Conf['userThemes'][key] ? key : key += " [custom]";
      } else {
        editTheme = JSON.parse(JSON.stringify(Themes['Yotsuba B']));
        editTheme["Theme"] = "Untitled";
        editTheme["Author"] = "Author";
        editTheme["Author Tripcode"] = "Unknown";
      }
      layout = ["Background Image", "Background Attachment", "Background Position", "Background Repeat", "Background Color", "Thread Wrapper Background", "Thread Wrapper Border", "Dialog Background", "Dialog Border", "Reply Background", "Reply Border", "Highlighted Reply Background", "Highlighted Reply Border", "Backlinked Reply Outline", "Input Background", "Input Border", "Hovered Input Background", "Hovered Input Border", "Focused Input Background", "Focused Input Border", "Checkbox Background", "Checkbox Border", "Buttons Background", "Buttons Border", "Navigation Background", "Navigation Border", "Links", "Hovered Links", "Quotelinks", "Backlinks", "Navigation Links", "Hovered Navigation Links", "Names", "Tripcodes", "Emails", "Subjects", "Text", "Inputs", "Post Numbers", "Greentext", "Sage", "Board Title", "Timestamps", "Warnings", "Shadow Color"];
      ThemeTools.dialog = $.el("div", {
        id: "themeConf",
        className: "reply dialog",
        innerHTML: "<div id=themebar>\n</div>\n<hr>\n<div id=themecontent>\n</div>\n<div id=save>\n  <a href='javascript:;'>Save</a>\n</div>\n<div id=upload>\n  <a href='javascript:;'>Select Image</a>\n</div>\n<div id=close>\n  <a href='javascript:;'>Close</a>\n</div>"
      });
      header = $.el("div", {
        innerHTML: "<input class='field subject' name='Theme' placeholder='Theme' value='" + key + "'> by\n<input class='field name' name='Author' placeholder='Author' value='" + editTheme['Author'] + "'>\n<input class='field postertrip' name='Author Tripcode' placeholder='Author Tripcode' value='" + editTheme['Author Tripcode'] + "'>"
      });
      _ref = $$("input", header);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        input = _ref[_i];
        $.on(input, 'blur', function() {
          return editTheme[this.name] = this.value;
        });
      }
      $.add($('#themebar', ThemeTools.dialog), header);
      themeContent = $('#themecontent', ThemeTools.dialog);
      for (_j = 0, _len1 = layout.length; _j < _len1; _j++) {
        item = layout[_j];
        if (!editTheme[item]) {
          editTheme[item] = '';
        }
        div = $.el("div", {
          className: "themevar",
          innerHTML: "<div class=optionname>\n  <b>" + item + "</b>\n</div>\n<div class=option>\n<input name='" + item + "' placeholder='" + (item === "Background Image" ? "Shift+Click to upload image" : item) + "'>"
        });
        input = $('input', div);
        input.value = editTheme[item];
        switch (item) {
          case "Background Image":
            input.className = 'field';
            fileInput = $.el('input', {
              type: 'file',
              accept: "image/*",
              title: "BG Image",
              hidden: "hidden"
            });
            $.on(input, 'click', function(evt) {
              if (evt.shiftKey) {
                return this.nextElementSibling.click();
              }
            });
            $.on(fileInput, 'change', function(evt) {
              return ThemeTools.uploadImage(evt, this);
            });
            $.after(input, fileInput);
            break;
          case "Background Attachment":
          case "Background Position":
          case "Background Repeat":
            input.className = 'field';
            break;
          default:
            input.className = "colorfield";
            colorInput = $.el('input', {
              className: 'color',
              value: "#" + ((new Color(input.value)).hex())
            });
            JSColor.bind(colorInput);
            $.after(input, colorInput);
        }
        $.on(input, 'blur', ThemeTools.apply);
        $.add(themeContent, div);
      }
      if (!editTheme["Custom CSS"]) {
        editTheme["Custom CSS"] = "";
      }
      div = $.el("div", {
        className: "themevar",
        innerHTML: "<div class=optionname>\n  <b>Custom CSS</b>\n</div>\n<div class=option>\n  <textarea name='Custom CSS' placeholder='Custom CSS'>" + editTheme['Custom CSS'] + "\n</textarea>"
      });
      $.on($('textarea', div), 'blur', function() {
        editTheme["Custom CSS"] = this.value;
        return Style.sheets.theme.textContent = Style.theme(editTheme);
      });
      $.add(themeContent, div);
      $.on($('#save > a', ThemeTools.dialog), 'click', function() {
        return ThemeTools.save(editTheme);
      });
      $.on($('#close > a', ThemeTools.dialog), 'click', ThemeTools.close);
      $.add(d.body, ThemeTools.dialog);
      $.addClass(doc, 'editTheme');
      return Style.sheets.theme.textContent = Style.theme(editTheme);
    },
    apply: function() {
      var depth, i, len, toggle1, toggle2;
      depth = 0;
      toggle1 = false;
      toggle2 = false;
      len = this.value.length;
      if (len < 1000) {
        i = 0;
        while (i < len) {
          switch (this.value[i++]) {
            case '(':
              ++depth;
              break;
            case ')':
              --depth;
              break;
            case '"':
              toggle1 = !toggle1;
              break;
            case "'":
              toggle2 = !toggle2;
          }
        }
      }
      if ((depth !== 0) || toggle1 || toggle2) {
        return alert("Syntax error on " + this.name + ".");
      }
      if (this.className === "colorfield") {
        this.nextSibling.value = (new Color(this.value)).hex();
        this.nextSibling.color.importColor();
      }
      editTheme[this.name] = this.value;
      return Style.setTheme(editTheme);
    },
    uploadImage: function(evt, el) {
      var file, reader;
      file = evt.target.files[0];
      reader = new FileReader();
      reader.onload = function(evt) {
        var val;
        val = "url(\"" + evt.target.result + "\")";
        el.previousSibling.value = val;
        editTheme["Background Image"] = val;
        return Style.sheets.theme.textContent = Style.theme(editTheme);
      };
      return reader.readAsDataURL(file);
    },
    importtheme: function(evt) {
      var file, reader;
      file = evt.target.files[0];
      reader = new FileReader();
      reader.onload = function(e) {
        var bgColor, bgRPA, blinkColor, brderColor, err, imported, inputColor, inputbColor, jlinkColor, linkColor, linkHColor, mainColor, name, nameColor, quoteColor, sageColor, textColor, timeColor, titleColor, tripColor;
        try {
          imported = JSON.parse(e.target.result);
          if (!imported) {
            throw "Cannot parse file";
          }
        } catch (_error) {
          err = _error;
          alert(err);
          return;
        }
        name = imported.name || imported['Theme'];
        if (!name) {
          alert("Theme file is invalid.");
          return;
        }
        delete imported.name || imported['Theme'];
        if (Themes[name] && !Themes[name]["Deleted"]) {
          if (confirm('A theme with this name already exists. Would you like to over-write?')) {
            delete Themes[name];
          } else {
            return;
          }
        }
        if (imported.bgColor) {
          if (!imported.replyOp) {
            imported.replyOp = "0.9";
          }
          bgRPA = imported.bgRPA ? imported.bgRPA.split(' ') : ['no-repeat', 'bottom', 'left', 'fixed'];
          bgColor = new Color(imported.bgColor);
          mainColor = new Color(imported.mainColor);
          brderColor = new Color(imported.brderColor);
          inputColor = new Color(imported.inputColor);
          inputbColor = new Color(imported.inputbColor);
          blinkColor = new Color(imported.blinkColor);
          jlinkColor = new Color(imported.jlinkColor);
          linkColor = new Color(imported.linkColor);
          linkHColor = new Color(imported.linkHColor);
          nameColor = new Color(imported.nameColor);
          quoteColor = new Color(imported.quoteColor);
          sageColor = new Color(imported.sageColor);
          textColor = new Color(imported.textColor);
          titleColor = new Color(imported.titleColor);
          tripColor = new Color(imported.tripColor);
          timeColor = new Color(imported.timeColor || imported.textColor);
          Themes[name] = {
            'Author': "Anonymous",
            'Author Tripcode': "!POMF.9waa",
            'Background Image': "url('" + (imported.bgImg || '') + "')",
            'Background Attachment': "" + (bgRPA[3] || ''),
            'Background Position': "" + (bgRPA[1] || '') + " " + (bgRPA[2] || ''),
            'Background Repeat': "" + (bgRPA[0] || ''),
            'Background Color': "rgb(" + (bgColor.rgb()) + ")",
            'Dialog Background': "rgba(" + (mainColor.rgb()) + ",.98)",
            'Dialog Border': "rgb(" + (brderColor.rgb()) + ")",
            'Thread Wrapper Background': "rgba(0,0,0,0)",
            'Thread Wrapper Border': "rgba(0,0,0,0)",
            'Reply Background': "rgba(" + (mainColor.rgb()) + "," + imported.replyOp + ")",
            'Reply Border': "rgb(" + (brderColor.rgb()) + ")",
            'Highlighted Reply Background': "rgba(" + (mainColor.shiftRGB(4, true)) + "," + imported.replyOp + ")",
            'Highlighted Reply Border': "rgb(" + (linkColor.rgb()) + ")",
            'Backlinked Reply Outline': "rgb(" + (linkColor.rgb()) + ")",
            'Checkbox Background': "rgba(" + (inputColor.rgb()) + "," + imported.replyOp + ")",
            'Checkbox Border': "rgb(" + (inputbColor.rgb()) + ")",
            'Input Background': "rgba(" + (inputColor.rgb()) + "," + imported.replyOp + ")",
            'Input Border': "rgb(" + (inputbColor.rgb()) + ")",
            'Hovered Input Background': "rgba(" + (inputColor.hover()) + "," + imported.replyOp + ")",
            'Hovered Input Border': "rgb(" + (inputbColor.rgb()) + ")",
            'Focused Input Background': "rgba(" + (inputColor.hover()) + "," + imported.replyOp + ")",
            'Focused Input Border': "rgb(" + (inputbColor.rgb()) + ")",
            'Buttons Background': "rgba(" + (inputColor.rgb()) + "," + imported.replyOp + ")",
            'Buttons Border': "rgb(" + (inputbColor.rgb()) + ")",
            'Navigation Background': "rgba(" + (bgColor.rgb()) + ",0.8)",
            'Navigation Border': "rgb(" + (mainColor.rgb()) + ")",
            'Quotelinks': "rgb(" + (linkColor.rgb()) + ")",
            'Links': "rgb(" + (linkColor.rgb()) + ")",
            'Hovered Links': "rgb(" + (linkHColor.rgb()) + ")",
            'Navigation Links': "rgb(" + (textColor.rgb()) + ")",
            'Hovered Navigation Links': "rgb(" + (linkHColor.rgb()) + ")",
            'Subjects': "rgb(" + (titleColor.rgb()) + ")",
            'Names': "rgb(" + (nameColor.rgb()) + ")",
            'Sage': "rgb(" + (sageColor.rgb()) + ")",
            'Tripcodes': "rgb(" + (tripColor.rgb()) + ")",
            'Emails': "rgb(" + (linkColor.rgb()) + ")",
            'Post Numbers': "rgb(" + (linkColor.rgb()) + ")",
            'Text': "rgb(" + (textColor.rgb()) + ")",
            'Backlinks': "rgb(" + (linkColor.rgb()) + ")",
            'Greentext': "rgb(" + (quoteColor.rgb()) + ")",
            'Board Title': "rgb(" + (textColor.rgb()) + ")",
            'Timestamps': "rgb(" + (timeColor.rgb()) + ")",
            'Inputs': "rgb(" + (textColor.rgb()) + ")",
            'Warnings': "rgb(" + (sageColor.rgb()) + ")",
            'Shadow Color': "rbga(0,0,0,0.1)",
            'Custom CSS': ".board { padding: 1px 2px; } .rice { box-shadow:rgba(" + mainColor.shiftRGB(32) + ",.3) 0 1px; } input[type=password]:hover, input[type=text]:not([disabled]):hover, input#fs_search:hover, input.field:hover, textarea:hover, #options input:not([type=checkbox]):hover { box-shadow:inset rgba(0,0,0,.2) 0 1px 2px; } input[type=password]:focus, input[type=text]:focus, input#fs_search:focus, input.field:focus, textarea:focus, #options input:focus { box-shadow:inset rgba(0,0,0,.2) 0 1px 2px; } button, input, textarea, .rice { transition:background .2s,box-shadow .2s; }" + (" " + (imported.customCSS || ''))
          };
        } else {
          Themes[name] = imported;
        }
        return $.get("userThemes", {}, function(_arg) {
          var userThemes;
          userThemes = _arg.userThemes;
          userThemes[name] = Themes[name];
          $.set('userThemes', userThemes);
          alert("Theme \"" + name + "\" imported!");
          return Settings.openSection.call({
            open: Settings.themes,
            hyphenatedTitle: 'themes'
          });
        });
      };
      return reader.readAsText(file);
    },
    save: function(theme) {
      var name;
      name = theme["Theme"];
      if (Themes[name] && !Themes[name]["Deleted"]) {
        if (confirm("A theme with this name already exists. Would you like to over-write?")) {
          delete Themes[name];
        } else {
          return;
        }
      }
      Themes[name] = JSON.parse(JSON.stringify(theme));
      delete Themes[name]["Theme"];
      return $.get("userThemes", {}, function(_arg) {
        var userThemes;
        userThemes = _arg.userThemes;
        userThemes[name] = Themes[name];
        $.set('userThemes', userThemes);
        $.set('theme', Conf['theme'] = name);
        return alert("Theme \"" + name + "\" saved.");
      });
    },
    close: function() {
      Conf['editMode'] = false;
      Style.setTheme(Themes[Conf['theme']]);
      $.rm($.id('themeConf'));
      $.rmClass(doc, 'editTheme');
      return Settings.open('Themes');
    }
  };

  Color = (function() {
    var colorToHex, minmax, shortToLong;

    minmax = function(base) {
      if (base < 0) {
        return 0;
      } else if (base > 255) {
        return 255;
      } else {
        return base;
      }
    };

    shortToLong = function(hex) {
      var i, longHex;
      longHex = [];
      i = 0;
      while (i < 3) {
        longHex.push(hex.substr(i, 1));
        i = Math.floor(longHex.length / 2);
      }
      return longHex.join("");
    };

    colorToHex = function(color) {
      var digits, hex, len;
      if (color.substr(0, 1) === '#') {
        if (color.length !== 4) {
          return color.slice(1);
        } else {
          return shortToLong(color.substr(1, 3));
        }
      }
      len = color.length;
      if (len === 3 || len === 6) {
        if (/[0-9a-f]{3}/i.test(color)) {
          if (color.length === 6) {
            return color;
          } else {
            return shortToLong(color);
          }
        }
      }
      if (digits = color.match(/(.*?)rgba?\((\d+), ?(\d+), ?(\d+)(.*?)\)/)) {
        hex = ((parseInt(digits[2], 10) << 16) | (parseInt(digits[3], 10) << 8) | (parseInt(digits[4], 10))).toString(16);
        while (hex.length < 6) {
          hex = "0" + hex;
        }
        return hex;
      } else {
        return "000000";
      }
    };

    function Color(value) {
      this.raw = colorToHex(value);
    }

    Color.prototype.hex = function() {
      return "#" + this.raw;
    };

    Color.prototype.rgb = function() {
      return this.privateRGB().join(",");
    };

    Color.prototype.hover = function() {
      return this.shiftRGB(16, true);
    };

    Color.prototype.isLight = function() {
      var rgb;
      rgb = this.privateRGB();
      return (rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125;
    };

    Color.prototype.privateRGB = function() {
      var hex;
      hex = parseInt(this.raw, 16);
      return [(hex >> 16) & 0xFF, (hex >> 8) & 0xFF, hex & 0xFF];
    };

    Color.prototype.shiftRGB = function(shift, smart) {
      var color, rgb, _i, _len, _ref;
      if (smart) {
        shift = (this.isLight() ? -1 : 1) * Math.abs(shift);
      }
      rgb = [];
      _ref = this.privateRGB();
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        color = _ref[_i];
        rgb.push(minmax(color + shift));
      }
      return rgb.join(",");
    };

    return Color;

  })();

  Navigate = {
    path: window.location.pathname,
    init: function() {
      var _ref;
      if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
        return;
      }
      $.on(window, 'popstate', Navigate.popstate);
      $.ready(function() {
        Navigate.makeBreadCrumb(window.location, g.VIEW, g.BOARD.ID, g.THREADID);
        return $.add(Index.navLinks, Navigate.el);
      });
      this.title = function() {};
      this.el = $.el('span', {
        id: 'breadCrumb'
      });
      Thread.callbacks.push({
        name: 'Navigate',
        cb: this.thread
      });
      return Post.callbacks.push({
        name: 'Navigate',
        cb: this.post
      });
    },
    thread: function() {
      var replyLink;
      if (g.VIEW === 'thread') {
        return;
      }
      replyLink = $('a.replylink', this.OP.nodes.info);
      return $.on(replyLink, 'click', Navigate.navigate);
    },
    post: function() {
      var linktype;
      if (!(g.VIEW === 'thread' && this.thread.ID === g.THREADID)) {
        $.on($('a[title="Link to this post"]', this.nodes.info), 'click', Navigate.navigate);
      }
      if (!(linktype = Conf['Quote Inlining'] && Conf['Quote Hash Navigation'] ? '.hashlink' : !Conf['Quote Inlining'] ? '.quotelink' : false)) {
        return;
      }
      return Navigate.quoteLink($$(linktype, this.nodes.comment));
    },
    quoteLink: function(links) {
      var link, _i, _len;
      for (_i = 0, _len = links.length; _i < _len; _i++) {
        link = links[_i];
        Navigate.singleQuoteLink(link);
      }
    },
    singleQuoteLink: function(link) {
      var boardID, threadID, _ref;
      _ref = Get.postDataFromLink(link), boardID = _ref.boardID, threadID = _ref.threadID;
      if (g.VIEW === 'index' || boardID !== g.BOARD.ID || threadID !== g.THREADID) {
        return $.on(link, 'click', Navigate.navigate);
      }
    },
    clean: function() {
      g.threads.forEach(function(thread) {
        return thread.collect();
      });
      if (Conf['Quote Backlinks']) {
        QuoteBacklink.map = {};
      }
      return $.rmAll($('.board'));
    },
    features: [['Thread Excerpt', ThreadExcerpt], ['Unread Count', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Expansion', ExpandThread]],
    disconnect: function() {
      var err, errors, feature, name, _i, _len, _ref, _ref1;
      _ref = Navigate.features;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        _ref1 = _ref[_i], name = _ref1[0], feature = _ref1[1];
        try {
          feature.disconnect();
        } catch (_error) {
          err = _error;
          if (!errors) {
            errors = [];
          }
          errors.push({
            message: "Failed to disconnect feature " + name + ".",
            error: err
          });
        }
        if (errors) {
          Main.handleErrors(errors);
        }
      }
    },
    reconnect: function() {
      var err, errors, feature, name, _i, _len, _ref, _ref1;
      _ref = Navigate.features;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        _ref1 = _ref[_i], name = _ref1[0], feature = _ref1[1];
        try {
          feature.init();
        } catch (_error) {
          err = _error;
          if (!errors) {
            errors = [];
          }
          errors.push({
            message: "Failed to reconnect feature " + name + ".",
            error: err
          });
        }
      }
      if (errors) {
        Main.handleErrors(errors);
      }
    },
    updateContext: function(view) {
      if (view === 'thread') {
        g.THREADID = +window.location.pathname.split('/')[3];
      }
      ({
        index: function() {
          var _ref;
          if (g.VIEW === view) {
            return;
          }
          delete g.THREADID;
          if (Conf['Index Mode'] === 'catalog') {
            Index.cb.toggleCatalogMode();
          }
          return (_ref = QR.posts[0]) != null ? _ref.thread = 'new' : void 0;
        },
        thread: function() {
          var _ref, _ref1;
          if (((_ref = QR.posts[0]) != null ? _ref.thread : void 0) === g.THREADID) {
            return;
          }
          if (Conf['Index Mode'] === 'catalog') {
            $.rmClass(doc, 'catalog-mode');
          }
          return (_ref1 = QR.posts[0]) != null ? _ref1.thread = g.THREADID : void 0;
        }
      })[view]();
      if (view !== g.VIEW) {
        $.rmClass(doc, g.VIEW);
        $.addClass(doc, view);
        g.VIEW = view;
      }
      return $.asap((function() {
        return g.threads.keys.length;
      }), QR.status);
    },
    updateBoard: function(boardID) {
      var current, fullBoardList;
      fullBoardList = $('#full-board-list', Header.boardList);
      if (current = $('.current', fullBoardList)) {
        $.rmClass(current, 'current');
      }
      if (current = $("a[href*='/" + boardID + "/']", fullBoardList)) {
        $.addClass(current, 'current');
      }
      Header.generateBoardList(Conf['boardnav'].replace(/(\r\n|\n|\r)/g, ' '));
      Index.catalogLink.href = "//boards.4chan.org/" + boardID + "/";
      QR.flagsInput();
      return $.cache('//a.4cdn.org/boards.json', function() {
        var aboard, board, err, _i, _len, _ref;
        try {
          if (this.status !== 200) {
            return;
          }
          _ref = this.response.boards;
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            aboard = _ref[_i];
            if (!(aboard.board === boardID)) {
              continue;
            }
            board = aboard;
            break;
          }
        } catch (_error) {
          err = _error;
          Main.handleErrors([
            {
              message: "Navigation failed to update board name.",
              error: err
            }
          ]);
        }
        if (!board) {
          return;
        }
        Navigate.updateTitle(board);
        return Navigate.updateSFW(!!board.ws_board);
      });
    },
    updateSFW: function(sfw) {
      var theme;
      Favicon.el.href = Favicon["default"] = "//s.4cdn.org/image/favicon" + (sfw ? '-ws' : '') + ".ico";
      $.add(d.head, Favicon.el);
      if (Favicon.SFW === sfw) {
        return;
      }
      Favicon.SFW = sfw;
      Favicon.update();
      g.TYPE = sfw ? 'sfw' : 'nsfw';
      if (Conf["NSFW/SFW Mascots"]) {
        Main.setMascotString();
        MascotTools.toggle();
      }
      if (Conf["NSFW/SFW Themes"]) {
        Main.setThemeString();
        theme = Themes[Conf[g.THEMESTRING] || (sfw ? 'Yotsuba B' : 'Yotsuba')];
        return Style.setTheme(theme);
      }
    },
    updateTitle: function(_arg) {
      var board, subtitle, title;
      board = _arg.board, title = _arg.title;
      if (subtitle = $('.boardSubtitle')) {
        $.rm(subtitle);
      }
      return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title;
    },
    setMode: function(a) {
      var indexMode, indexSort, result, _ref;
      _ref = a.dataset, indexMode = _ref.indexMode, indexSort = _ref.indexSort;
      result = false;
      if (indexMode && Conf['Index Mode'] !== indexMode) {
        $.set('Index Mode', Conf['Index Mode'] = Index.selectMode.value = indexMode);
        Index.cb.mode();
        result = true;
      }
      if (indexSort && Conf['Index Sort'] !== indexSort) {
        $.set('Index Sort', Conf['Index Sort'] = Index.selectSort.value = indexSort);
        Index.cb.sort();
        result = true;
      }
      return result;
    },
    navigate: function(e) {
      var boardID, load, pageNum, path, threadID, view, _, _ref;
      if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org') {
        return;
      }
      if (e) {
        if (e.shiftKey || e.ctrlKey || (e.type === 'click' && e.button !== 0)) {
          if (e.button !== 2) {
            Navigate.setMode(this);
          }
          return;
        }
      }
      if (Navigate.isNavigating) {
        return e != null ? e.preventDefault() : void 0;
      }
      Navigate.isNavigating = true;
      setTimeout((function() {
        return delete Navigate.isNavigating;
      }), 100);
      if (this.pathname === Navigate.path) {
        if (g.VIEW === 'thread') {
          ThreadUpdater.update();
        } else {
          if (!Index.searchTest()) {
            if (Navigate.setMode(this)) {
              Index.buildIndex();
            } else {
              Index.update();
            }
          }
        }
        if (e != null) {
          e.preventDefault();
        }
        return;
      }
      $.addClass(Index.button, 'fa-spin');
      _ref = this.pathname.split('/'), _ = _ref[0], boardID = _ref[1], view = _ref[2], threadID = _ref[3];
      if ('f' === boardID || 'f' === g.BOARD.ID) {
        return;
      }
      if (e != null) {
        e.preventDefault();
      }
      if (Index.isSearching) {
        Index.clearSearch();
      }
      Navigate.title = function() {};
      delete Index.pageNum;
      $.rmAll(Header.hover);
      if (threadID) {
        view = 'thread';
      } else {
        pageNum = +view || 1;
        view = 'index';
      }
      path = this.pathname;
      if (this.hash && view === 'thread') {
        path += this.hash;
      }
      Navigate.makeBreadCrumb(this.href, view, boardID, threadID);
      if (this.id === 'popState') {
        Navigate.path = window.location;
      } else {
        Navigate.pushState(path);
      }
      Navigate.setMode(this);
      if (!(view === 'index' && 'index' === g.VIEW && boardID === g.BOARD.ID)) {
        Navigate.disconnect();
        Navigate.updateContext(view);
        Navigate.clean();
        Navigate.reconnect();
        if (view === 'index') {
          $.event('4chanXInitFinished');
        }
      }
      if (boardID === g.BOARD.ID) {
        Navigate.title = function() {
          if (view === 'index') {
            return d.title = $('.boardTitle').textContent;
          }
        };
      } else {
        g.BOARD = new Board(boardID);
        Navigate.title = function() {
          return Navigate.updateBoard(boardID);
        };
      }
      Navigate.updateSFW(Favicon.SFW);
      if (view === 'index') {
        return Index.update(pageNum);
      }
      load = Navigate.load;
      Navigate.req = $.ajax("//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json", {
        onabort: load,
        onloadend: load
      });
      return setTimeout((function() {
        if (Navigate.req && !Navigate.notice) {
          return Navigate.notice = new Notice('info', 'Loading thread...');
        }
      }), 3 * $.SECOND);
    },
    load: function(e) {
      var err, notice, req;
      $.rmClass(Index.button, 'fa-spin');
      req = Navigate.req, notice = Navigate.notice;
      if (notice != null) {
        notice.close();
      }
      delete Navigate.req;
      delete Navigate.notice;
      if (e.type === 'abort' || req.status !== 200) {
        req.onloadend = null;
        new Notice('warning', "Failed to load thread." + (req.status ? " " + req.status : ''));
        return;
      }
      Navigate.title();
      try {
        return Navigate.parse(req.response.posts);
      } catch (_error) {
        err = _error;
        return Main.handleErrors({
          message: "Navigate Failure.",
          error: err
        });
      }
    },
    makeBreadCrumb: function(href, view, boardID, threadID) {
      var breadCrumb, el;
      breadCrumb = $.el('span', {
        className: 'crumb',
        innerHTML: "<a href=" + href + ">/" + boardID + "/ - " + (view.charAt(0).toUpperCase()) + (view.slice(1)) + (threadID ? " No." + threadID : '') + "</a> &gt; "
      });
      $.on(breadCrumb.firstElementChild, 'click', Navigate.navigate);
      el = Navigate.el;
      $.add(el, breadCrumb);
      if (el.children.length > 5) {
        return $.rm(el.firstChild);
      }
    },
    parse: function(data) {
      var board, errors, i, makePost, obj, post, posts, thread, threadRoot;
      posts = [];
      errors = null;
      board = g.BOARD;
      threadRoot = Build.thread(board, data[0], true);
      thread = new Thread(data[0].no, board);
      makePost = function(postNode) {
        var err;
        try {
          return posts.push(new Post(postNode, thread, board));
        } catch (_error) {
          err = _error;
          if (!errors) {
            errors = [];
          }
          return errors.push({
            message: "Parsing of Post No." + postNode.ID + " failed. Post will be skipped.",
            error: err
          });
        }
      };
      makePost($('.opContainer', threadRoot));
      i = 0;
      while (obj = data[++i]) {
        post = Build.postFromObject(obj, board);
        makePost(post);
        $.add(threadRoot, post);
      }
      Thread.callbacks.execute([thread]);
      Post.callbacks.execute(posts);
      if (Conf['Quote Threading'] && !Conf['Unread Count']) {
        QuoteThreading.force();
      }
      board = $('.board');
      $.rmAll(board);
      $.add(board, [threadRoot, $.el('hr')]);
      QR.generatePostableThreadsList();
      if (errors) {
        Main.handleErrors(errors);
      }
      $.event('4chanXInitFinished');
      return Header.hashScroll.call(window);
    },
    pushState: function(path) {
      history.pushState(null, '', path);
      return Navigate.path = window.location.pathname;
    },
    popstate: function() {
      var a;
      a = $.el('a', {
        href: window.location,
        id: 'popState'
      });
      return Navigate.navigate.call(a);
    }
  };

  Settings = {
    init: function() {
      var add, check, el, settings;
      el = $.el('a', {
        className: 'settings-link',
        title: 'appchan x Settings',
        href: 'javascript:;',
        textContent: 'Settings'
      });
      $.on(el, 'click', this.open);
      Header.menu.addEntry({
        el: el,
        order: 1
      });
      add = this.addSection;
      add('Style', this.style);
      add('Themes', this.themes);
      add('Mascots', this.mascots);
      add('Script', this.main);
      add('Filter', this.filter);
      add('Sauce', this.sauce);
      add('Advanced', this.advanced);
      add('Keybinds', this.keybinds);
      $.on(d, 'AddSettingsSection', Settings.addSection);
      $.on(d, 'OpenSettings', function(e) {
        return Settings.open(e.detail);
      });
      settings = JSON.parse(localStorage.getItem('4chan-settings')) || {};
      if (!settings.disableAll) {
        settings.disableAll = true;
        check = true;
      }
      if (settings.keyBinds) {
        settings.keyBinds = false;
        check = true;
      }
      if (check) {
        return localStorage.setItem('4chan-settings', JSON.stringify(settings));
      }
    },
    open: function(openSection) {
      var dialog, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
      if (Conf['editMode'] === "theme") {
        if (confirm("Opening the options dialog will close and discard any theme changes made with the theme editor.")) {
          ThemeTools.close();
        }
        return;
      }
      if (Conf['editMode'] === "mascot") {
        if (confirm("Opening the options dialog will close and discard any mascot changes made with the mascot editor.")) {
          MascotTools.close();
        }
        return;
      }
      if (Settings.overlay) {
        return;
      }
      $.event('CloseMenu');
      Settings.dialog = dialog = $.el('div', {
        id: 'appchanx-settings',
        "class": 'dialog'
      });
      $.extend(dialog, {
        innerHTML: "<nav><div class=sections-list></div><span class='imp-exp-result warning'></span><div class=credits><a class=export>Export</a>&nbsp|&nbsp<a class=import>Import</a>&nbsp|&nbsp<a class=reset>Reset Settings</a>&nbsp|&nbsp<input type=file hidden><a href='http://zixaphir.github.com/appchan-x/' target=_blank>appchan x</a>&nbsp|&nbsp<a href='https://github.com/zixaphir/appchan-x/blob/master/CHANGELOG.md' target=_blank>" + g.VERSION + "</a>&nbsp|&nbsp<a href='https://github.com/zixaphir/appchan-x/blob/master/README.md#reporting-bugs-and-suggestions' target=_blank>Issues</a>&nbsp|&nbsp<a href=javascript:; class='close fa' title=Close>\uf00d</a></div></nav><hr><div class=section-container><section></section></div>"
      });
      Settings.overlay = overlay = $.el('div', {
        id: 'overlay'
      });
      $.on($('.export', dialog), 'click', Settings["export"]);
      $.on($('.import', dialog), 'click', Settings["import"]);
      $.on($('.reset', dialog), 'click', Settings.reset);
      $.on($('input', dialog), 'change', Settings.onImport);
      links = [];
      _ref = Settings.sections;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        section = _ref[_i];
        link = $.el('a', {
          className: "tab-" + section.hyphenatedTitle,
          textContent: section.title,
          href: 'javascript:;'
        });
        $.on(link, 'click', Settings.openSection.bind(section));
        links.push(link);
        if (section.title === openSection) {
          sectionToOpen = link;
        }
      }
      $.add($('.sections-list', dialog), links);
      if (openSection !== 'none') {
        (sectionToOpen ? sectionToOpen : links[0]).click();
      }
      $.on($('.close', dialog), 'click', Settings.close);
      $.on(overlay, 'click', Settings.close);
      $.add(d.body, [overlay, dialog]);
      return $.event('OpenSettings', null, dialog);
    },
    close: function() {
      var _ref;
      if (!Settings.dialog) {
        return;
      }
      if ((_ref = d.activeElement) != null) {
        _ref.blur();
      }
      $.rm(Settings.overlay);
      $.rm(Settings.dialog);
      delete Settings.overlay;
      return delete Settings.dialog;
    },
    sections: [],
    addSection: function(title, open) {
      var hyphenatedTitle, _ref;
      if (typeof title !== 'string') {
        _ref = title.detail, title = _ref.title, open = _ref.open;
      }
      hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-');
      return Settings.sections.push({
        title: title,
        hyphenatedTitle: hyphenatedTitle,
        open: open
      });
    },
    openSection: function(mode) {
      var section, selected;
      if (selected = $('.tab-selected', Settings.dialog)) {
        $.rmClass(selected, 'tab-selected');
      }
      $.addClass($(".tab-" + this.hyphenatedTitle, Settings.dialog), 'tab-selected');
      section = $('section', Settings.dialog);
      $.rmAll(section);
      section.className = "section-" + this.hyphenatedTitle;
      this.open(section, mode);
      section.scrollTop = 0;
      return $.event('OpenSettings', null, section);
    },
    main: function(section) {
      var arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, _ref;
      items = {};
      inputs = {};
      _ref = Config.main;
      for (key in _ref) {
        obj = _ref[key];
        fs = $.el('fieldset', {
          innerHTML: "<legend>" + E(key) + "</legend>"
        });
        containers = [fs];
        for (key in obj) {
          arr = obj[key];
          description = arr[1];
          div = $.el('div');
          $.add(div, [
            UI.checkbox(key, key), $.el('span', {
              className: 'description',
              textContent: description
            })
          ]);
          input = $('input', div);
          $.on($('label', div), 'mouseover', Settings.mouseover);
          $.on(input, 'change', function() {
            this.parentNode.parentNode.dataset.checked = this.checked;
            return $.cb.checked.call(this);
          });
          items[key] = Conf[key];
          inputs[key] = input;
          level = arr[2] || 0;
          if (containers.length <= level) {
            container = $.el('div', {
              className: 'suboption-list'
            });
            $.add(containers[containers.length - 1].lastElementChild, container);
            containers[level] = container;
          } else if (containers.length > level + 1) {
            containers.splice(level + 1, containers.length - (level + 1));
          }
          $.add(containers[level], div);
        }
        Rice.nodes(fs);
        $.add(section, fs);
      }
      $.get(items, function(items) {
        var val;
        for (key in items) {
          val = items[key];
          inputs[key].checked = val;
          inputs[key].parentNode.parentNode.dataset.checked = val;
        }
      });
      div = $.el('div', {
        innerHTML: "<button></button><span class=\"description\">: Clear manually-hidden threads and posts on all boards. Reload the page to apply."
      });
      button = $('button', div);
      $.get('hiddenPosts', {}, function(_arg) {
        var ID, board, hiddenNum, hiddenPosts, thread, _ref1;
        hiddenPosts = _arg.hiddenPosts;
        hiddenNum = 0;
        _ref1 = hiddenPosts.boards;
        for (ID in _ref1) {
          board = _ref1[ID];
          for (ID in board) {
            thread = board[ID];
            hiddenNum += Object.keys(thread).length;
          }
        }
        return button.textContent = "Hidden: " + hiddenNum;
      });
      $.on(button, 'click', function() {
        this.textContent = 'Hidden: 0';
        return $["delete"]('hiddenPosts');
      });
      return $.after($('input[name="Recursive Hiding"]', section).parentNode.parentNode, div);
    },
    "export": function() {
      return $.get(Conf, function(Conf) {
        delete Conf['archives'];
        return Settings.downloadExport('Settings', {
          version: g.VERSION,
          date: Date.now(),
          Conf: Conf
        });
      });
    },
    downloadExport: function(title, data) {
      var a;
      a = $.el('a', {
        download: "appchan x v" + g.VERSION + " " + title + "." + data.date + ".json",
        href: "data:application/json;base64," + (btoa(unescape(encodeURIComponent(JSON.stringify(data, null, 2)))))
      });
      $.add(d.body, a);
      a.click();
      return $.rm(a);
    },
    "import": function() {
      return $('input[type=file]', this.parentNode).click();
    },
    onImport: function() {
      var file, reader;
      if (!(file = this.files[0])) {
        return;
      }
      if (!confirm('Your current settings will be entirely overwritten, are you sure?')) {
        new Notice('info', "Import aborted.", 1);
        return;
      }
      reader = new FileReader();
      reader.onload = function(e) {
        var err;
        try {
          Settings.loadSettings(JSON.parse(e.target.result));
          if (confirm('Import successful. Reload now?')) {
            return window.location.reload();
          }
        } catch (_error) {
          err = _error;
          alert('Import failed due to an error.');
          return c.error(err.stack);
        }
      };
      return reader.readAsText(file);
    },
    loadSettings: function(data) {
      if (data.Conf['WatchedThreads']) {
        data.Conf['watchedThreads'] = {
          boards: ThreadWatcher.convert(data.Conf['WatchedThreads'])
        };
        delete data.Conf['WatchedThreads'];
      }
      return $.clear(function() {
        return $.set(data.Conf);
      });
    },
    reset: function() {
      if (confirm('Your current settings will be entirely wiped, are you sure?')) {
        return $.clear(function() {
          if (confirm('Reset successful. Reload now?')) {
            return window.location.reload();
          }
        });
      }
    },
    filter: function(section) {
      var select;
      $.extend(section, {
        innerHTML: "<select name=filter><option value=guide>Guide</option><option value=name>Name</option><option value=uniqueID>Unique ID</option><option value=tripcode>Tripcode</option><option value=capcode>Capcode</option><option value=email>E-mail</option><option value=subject>Subject</option><option value=comment>Comment</option><option value=flag>Flag</option><option value=filename>Filename</option><option value=dimensions>Image dimensions</option><option value=filesize>Filesize</option><option value=MD5>Image MD5</option></select><div></div>"
      });
      select = $('select', section);
      $.on(select, 'change', Settings.selectFilter);
      return Settings.selectFilter.call(select);
    },
    selectFilter: function() {
      var div, name, ta;
      div = this.nextElementSibling;
      if ((name = this.value) !== 'guide') {
        $.rmAll(div);
        ta = $.el('textarea', {
          name: name,
          className: 'field',
          spellcheck: false
        });
        $.get(name, Conf[name], function(item) {
          return ta.value = item[name];
        });
        $.on(ta, 'change', $.cb.value);
        $.add(div, ta);
        return;
      }
      $.extend(div, {
        innerHTML: "<div class=warning " + (Conf['Filter'] ? 'hidden' : '') + "><code>Filter</code> is disabled.</div><p>Use <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\">regular expressions</a>, one per line.<br>Lines starting with a <code>#</code> will be ignored.<br>For example, <code>/weeaboo/i</code> will filter posts containing the string `<code>weeaboo</code>`, case-insensitive.<br>MD5 filtering uses exact string matching, not regular expressions.</p><ul>You can use these settings with each regular expression, separate them with semicolons:<li>Per boards, separate them with commas. It is global if not specified.<br>For example: <code>boards:a,jp;</code>.</li><li>Filter OPs only along with their threads (`only`), replies only (`no`), or both (`yes`, this is default).<br>For example: <code>op:only;</code>, <code>op:no;</code> or <code>op:yes;</code>.</li><li>Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).<br>For example: <code>stub:yes;</code> or <code>stub:no;</code>.</li><li>Highlight instead of hiding. You can specify a class name to use with a userstyle.<br>For example: <code>highlight;</code> or <code>highlight:wallpaper;</code>.</li><li>Highlighted OPs will have their threads put on top of the board index by default.<br>For example: <code>top:yes;</code> or <code>top:no;</code>.</li></ul>"
      });
      return $('.warning', div).hidden = Conf['Filter'];
    },
    sauce: function(section) {
      var ta;
      $.extend(section, {
        innerHTML: "<div class=warning " + (Conf['Sauce'] ? 'hidden' : '') + "><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%name</code>: Original file name.</li><li><code>%board</code>: Current board.</li></ul><textarea name=sauces class=field spellcheck=false></textarea>"
      });
      ta = $('textarea', section);
      $.get('sauces', Conf['sauces'], function(item) {
        return ta.value = item['sauces'];
      });
      return $.on(ta, 'change', $.cb.value);
    },
    advanced: function(section) {
      var archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, name, o, row, rows, software, ta, table, warning, withCredentials, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _len6, _m, _n, _o, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
      $.extend(section, {
        innerHTML: "<fieldset><legend>Archiver</legend><div class=\"warning\" data-feature='404 Redirect'><code>404 Redirect</code> is disabled.</div><div><select id='archive-board-select'></select></div><table id='archive-table'><thead><th>Thread redirection</th><th>Post fetching</th><th>File redirection</th></thead><tbody></tbody></table><span class=note>Disabled selections indicate that only one archive is available for that board and redirection type.</span></fieldset><fieldset><legend>Custom Board Navigation</legend><div><textarea name=boardnav class=field spellcheck=false></textarea></div><span class=note>New lines will be converted into spaces.</span><br><br><div class=note>In the following examples for /g/, <code>g</code> can be changed to a different board ID (<code>a</code>, <code>b</code>, etc...), the current board (<code>current</code>), or the Twitter link (<code>@</code>).</div><div>Board link: <code>g</code></div><div>Archive link: <code>g-archive</code></div><div>Internal archive link: <code>g-expired</code></div><div>Title link: <code>g-title</code></div><div>Board link (Replace with title when on that board): <code>g-replace</code></div><div>Full text link: <code>g-full</code></div><div>Custom text link: <code>g-text:\"Install Gentoo\"</code></div><div>Index-only link: <code>g-index</code></div><div>Catalog-only link: <code>g-catalog</code></div><div>External link: <code>external-text:\"Google\",\"http://www.google.com\"</code></div><div>Index mode: <code>g-mode:\"type\"</code> where type is <code>paged</code>, <code>all threads</code> or <code>catalog</code></div><div>Index sort: <code>g-sort:\"type\"</code> where type is <code>bump order</code>, <code>last reply</code>, <code>creation date</code>, <code>reply count</code> or <code>file count</code></div<div>Combinations are possible: <code>g-index-text:\"Technology Index\"</code></div><div>Full board list toggle: <code>toggle-all</code></div><br><div class=note><code>[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]</code><br>will give you<br><code>[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]</code><br>if you are on /g/.</div></fieldset><fieldset><legend>Time Formatting <span class=warning data-feature='Time Formatting'>is disabled.</span></legend><div><input name=time class=field spellcheck=false>: <span class=time-preview></span></div><div>Supported <a href=//en.wikipedia.org/wiki/Date_%28Unix%29#Formatting>format specifiers</a>:</div><div>Day: <code>%a</code>, <code>%A</code>, <code>%d</code>, <code>%e</code></div><div>Month: <code>%m</code>, <code>%b</code>, <code>%B</code></div><div>Year: <code>%y</code>, <code>%Y</code></div><div>Hour: <code>%k</code>, <code>%H</code>, <code>%l</code>, <code>%I</code>, <code>%p</code>, <code>%P</code></div><div>Minute: <code>%M</code></div><div>Second: <code>%S</code></div></fieldset><fieldset><legend>Quote Backlinks formatting <span class=warning data-feature='Quote Backlinks'>is disabled.</span></legend><div><input name=backlink class=field spellcheck=false>: <span class=backlink-preview></span></div></fieldset><fieldset><legend>File Info Formatting <span class=warning data-feature='File Info Formatting'>is disabled.</span></legend><div><input name=fileInfo class=field spellcheck=false>: <span class='file-info file-info-preview'></span></div><div>Link: <code>%l</code> (truncated), <code>%L</code> (untruncated), <code>%T</code> (Unix timestamp)</div><div>Original file name: <code>%n</code> (truncated), <code>%N</code> (untruncated), <code>%t</code> (Unix timestamp)</div><div>Spoiler indicator: <code>%p</code></div><div>Size: <code>%B</code> (Bytes), <code>%K</code> (KB), <code>%M</code> (MB), <code>%s</code> (4chan default)</div><div>Resolution: <code>%r</code> (Displays 'PDF' for PDF files)</div></fieldset><fieldset><legend>Quick Reply Personas</legend><textarea class=\"personafield field\" name=\"QR.personas\" spellcheck=\"false\"></textarea><p>One item per line.<br>Items will be added in the relevant input's auto-completion list.<br>Password items will always be used, since there is no password input.<br>Lines starting with a <code>#</code> will be ignored.</p><ul>You can use these settings with each item, separate them with semicolons:<li>Possible fields are: <code>name</code>, <code>options</code> (or equivalently <code>email</code>), <code>subject</code> and <code>password</code>.</li><li>Wrap values of fields with quotes, like this: <code>options:\"sage\"</code>.</li><li>Force values as defaults with the <code>always</code> keyword, for example: <code>options:\"sage\";always</code>.</li><li>Possible match fields:<dl><dt><code>threads:/regex/,string,...</code></dt><dd>Match on thread subject.  Accepts a list of regular expressions or strings, only one has to match to activate the persona (think OR logic). Great for matching /vg/ generals.</dd><dt><code>boards:a,b,...</code></dt><dd>Make your persona board-specific.  Matches board IDs <em>without</em> slashes, and only one has to match to activate the persona.</dd></dl></li></ul></fieldset><fieldset><legend>Unread Favicon <span class=warning data-feature='Unread Favicon'>is disabled.</span></legend><select name=favicon><option value=ferongr>ferongr</option><option value=xat->xat-</option><option value=4chanJS>4chanJS</option><option value=Mayhem>Mayhem</option><option value=Original>Original</option><option value=Metro>Metro</option></select><span id=favicon-preview><img src=\"data:image/gif;base64,R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAIOhI%2Bpy%2B0Po5y02ouzPgUAOw%3D%3D\"><img src=\"data:image/gif;base64,R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAIOhI%2Bpy%2B0Po5y02ouzPgUAOw%3D%3D\"><img src=\"data:image/gif;base64,R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAIOhI%2Bpy%2B0Po5y02ouzPgUAOw%3D%3D\"><img src=\"data:image/gif;base64,R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAIOhI%2Bpy%2B0Po5y02ouzPgUAOw%3D%3D\"></span></fieldset><fieldset><legend>Thread Updater <span class=warning data-feature='Thread Updater'>is disabled.</span></legend><div>Interval: <input type=\"number\" name=\"Interval\" class=\"field\" min=\"1\"> seconds</div></fieldset><fieldset><legend><label><input type=checkbox name='Custom CSS'> Custom CSS</label></legend><button id=apply-css>Apply CSS</button><textarea name=usercss class=field spellcheck=false></textarea></fieldset>"
      });
      _ref = $$('.warning', section);
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        warning = _ref[_i];
        warning.hidden = Conf[warning.dataset.feature];
      }
      items = {};
      inputs = {};
      _ref1 = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss'];
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        name = _ref1[_j];
        input = $("[name='" + name + "']", section);
        items[name] = Conf[name];
        inputs[name] = input;
        if (name === 'usercss') {
          $.on(input, 'change', $.cb.value);
        } else if (name === 'favicon') {
          $.on(input, 'change', $.cb.value);
          $.on(input, 'change', Settings[name]);
        } else {
          $.on(input, 'input', $.cb.value);
          $.on(input, 'input', Settings[name]);
        }
      }
      ta = $('.personafield', section);
      $.get('QR.personas', Conf['QR.personas'], function(item) {
        return ta.value = item['QR.personas'];
      });
      $.on(ta, 'change', $.cb.value);
      $.get(items, function(items) {
        var key, val;
        for (key in items) {
          val = items[key];
          input = inputs[key];
          input.value = val;
          if (key === 'usercss') {
            continue;
          }
          Settings[key].call(input);
        }
        return Rice.nodes(section);
      });
      interval = $('input[name="Interval"]', section);
      customCSS = $('input[name="Custom CSS"]', section);
      interval.value = Conf['Interval'];
      customCSS.checked = Conf['Custom CSS'];
      inputs['usercss'].disabled = !Conf['Custom CSS'];
      $.on(interval, 'change', ThreadUpdater.cb.interval);
      $.on(customCSS, 'change', Settings.togglecss);
      $.on($('#apply-css', section), 'click', Settings.usercss);
      archBoards = {};
      _ref2 = Redirect.archives;
      for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
        _ref3 = _ref2[_k], name = _ref3.name, boards = _ref3.boards, files = _ref3.files, software = _ref3.software, withCredentials = _ref3.withCredentials;
        for (_l = 0, _len3 = boards.length; _l < _len3; _l++) {
          boardID = boards[_l];
          o = archBoards[boardID] || (archBoards[boardID] = {
            thread: [[], []],
            post: [[], []],
            file: [[], []]
          });
          i = +(!!withCredentials);
          o.thread[i].push(name);
          if (software === 'foolfuuka') {
            o.post[i].push(name);
          }
          if (__indexOf.call(files, boardID) >= 0) {
            o.file[i].push(name);
          }
        }
      }
      for (boardID in archBoards) {
        o = archBoards[boardID];
        _ref4 = ['thread', 'post', 'file'];
        for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) {
          item = _ref4[_m];
          if (o[item][0].length === 0 && o[item][1].length !== 0) {
            o[item][0].push('disabled');
          }
          o[item] = o[item][0].concat(o[item][1]);
        }
      }
      rows = [];
      boardOptions = [];
      _ref5 = Object.keys(archBoards).sort();
      for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) {
        boardID = _ref5[_n];
        row = $.el('tr', {
          className: "board-" + boardID
        });
        row.hidden = boardID !== g.BOARD.ID;
        boardOptions.push($.el('option', {
          textContent: "/" + boardID + "/",
          value: "board-" + boardID,
          selected: boardID === g.BOARD.ID
        }));
        o = archBoards[boardID];
        _ref6 = ['thread', 'post', 'file'];
        for (_o = 0, _len6 = _ref6.length; _o < _len6; _o++) {
          item = _ref6[_o];
          $.add(row, Settings.addArchiveCell(boardID, o, item));
        }
        rows.push(row);
      }
      rows[0].hidden = !g.BOARD.ID in archBoards;
      $.add($('tbody', section), rows);
      boardSelect = $('#archive-board-select', section);
      $.add(boardSelect, boardOptions);
      table = $.id('archive-table');
      $.on(boardSelect, 'change', function() {
        $('tbody > :not([hidden])', table).hidden = true;
        return $("tbody > ." + this.value, table).hidden = false;
      });
      $.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
        var data, option, selectedArchives, type;
        selectedArchives = _arg.selectedArchives;
        for (boardID in selectedArchives) {
          data = selectedArchives[boardID];
          for (type in data) {
            name = data[type];
            if (option = $("select[data-boardid='" + boardID + "'][data-type='" + type + "'] > option[value='" + name + "']", section)) {
              option.selected = true;
            }
          }
        }
      });
    },
    addArchiveCell: function(boardID, data, type) {
      var archive, i, length, options, select, td;
      length = data[type].length;
      td = $.el('td', {
        className: 'archive-cell'
      });
      if (!length) {
        td.textContent = '--';
        return td;
      }
      options = [];
      i = 0;
      while (i < length) {
        archive = data[type][i++];
        options.push($.el('option', {
          textContent: archive,
          value: archive
        }));
      }
      $.extend(td, {
        innerHTML: "<select></select>"
      });
      select = td.firstElementChild;
      if (!(select.disabled = length === 1)) {
        select.setAttribute('data-boardid', boardID);
        select.setAttribute('data-type', type);
        $.on(select, 'change', Settings.saveSelectedArchive);
      }
      $.add(select, options);
      return td;
    },
    saveSelectedArchive: function() {
      return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) {
        return function(_arg) {
          var selectedArchives, _name;
          selectedArchives = _arg.selectedArchives;
          (selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value;
          return $.set('selectedArchives', selectedArchives);
        };
      })(this));
    },
    boardnav: function() {
      return Header.generateBoardList(this.value);
    },
    time: function() {
      return this.nextElementSibling.textContent = Time.format(this.value, new Date());
    },
    backlink: function() {
      return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) {
        return {
          '%id': '123456789',
          '%%': '%'
        }[x];
      });
    },
    fileInfo: function() {
      var data;
      data = {
        isReply: true,
        file: {
          URL: '//i.4cdn.org/g/1334437723720.jpg',
          name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg',
          size: '276 KB',
          sizeInBytes: 276 * 1024,
          dimensions: '1280x720',
          isImage: true,
          isSpoiler: true
        }
      };
      return FileInfo.format(this.value, data, this.nextElementSibling);
    },
    favicon: function() {
      var img;
      Favicon["switch"]();
      if (g.VIEW === 'thread' && Conf['Unread Favicon']) {
        Unread.update();
      }
      img = ($.id('favicon-preview')).children;
      img[0].src = Favicon["default"];
      img[1].src = Favicon.unreadSFW;
      img[2].src = Favicon.unreadNSFW;
      return img[3].src = Favicon.unreadDead;
    },
    togglecss: function() {
      if ($('textarea[name=usercss]', $.x('ancestor::fieldset[1]', this)).disabled = !this.checked) {
        CustomCSS.rmStyle();
      } else {
        CustomCSS.addStyle();
      }
      return $.cb.checked.call(this);
    },
    usercss: function() {
      return CustomCSS.update();
    },
    keybinds: function(section) {
      var arr, input, inputs, items, key, tbody, tr, _ref;
      $.extend(section, {
        innerHTML: "<div class=warning " + (Conf['Keybinds'] ? 'hidden' : '') + "><code>Keybinds</code> are disabled.</div><div>Allowed keys: <kbd>a-z</kbd>, <kbd>0-9</kbd>, <kbd>Ctrl</kbd>, <kbd>Shift</kbd>, <kbd>Alt</kbd>, <kbd>Meta</kbd>, <kbd>Enter</kbd>, <kbd>Esc</kbd>, <kbd>Up</kbd>, <kbd>Down</kbd>, <kbd>Right</kbd>, <kbd>Left</kbd>.</div><div>Press <kbd>Backspace</kbd> to disable a keybind.</div><table><tbody><tr><th>Actions</th><th>Keybinds</th></tr></tbody></table>"
      });
      $('.warning', section).hidden = Conf['Keybinds'];
      tbody = $('tbody', section);
      items = {};
      inputs = {};
      _ref = Config.hotkeys;
      for (key in _ref) {
        arr = _ref[key];
        tr = $.el('tr', {
          innerHTML: "<td>" + E(arr[1]) + "</td><td><input class=\"field\"></td>"
        });
        input = $('input', tr);
        input.name = key;
        input.spellcheck = false;
        items[key] = Conf[key];
        inputs[key] = input;
        $.on(input, 'keydown', Settings.keybind);
        Rice.nodes(tr);
        $.add(tbody, tr);
      }
      return $.get(items, function(items) {
        var val;
        for (key in items) {
          val = items[key];
          inputs[key].value = val;
        }
      });
    },
    keybind: function(e) {
      var key;
      if (e.keyCode === 9) {
        return;
      }
      e.preventDefault();
      e.stopPropagation();
      if ((key = Keybinds.keyCode(e)) == null) {
        return;
      }
      this.value = key;
      return $.cb.value.call(this);
    },
    style: function(section) {
      var arr, box, check, description, div, fs, html, input, inputs, items, key, mouseover, name, nodes, obj, span, type, value, _i, _len, _ref;
      nodes = $.frag();
      items = {};
      inputs = {};
      box = UI.checkbox;
      mouseover = Settings.mouseover;
      _ref = Config.style;
      for (key in _ref) {
        obj = _ref[key];
        fs = $.el('fieldset', {
          innerHTML: "<legend>" + key + "</legend>"
        });
        for (key in obj) {
          arr = obj[key];
          value = arr[0], description = arr[1], type = arr[2];
          div = $.el('div', {
            className: 'styleoption'
          });
          if (type) {
            if (type === 'text') {
              $.extend(div, {
                innerHTML: "<div class=\"option\"><span class=\"optionlabel\">" + E(key) + "</span></div><div class=\"description\">" + E(description) + "</div><div class=\"option\"><input name=\"" + E(key) + "\" style=\"width: 100%\"></div>"
              });
              input = $("input", div);
            } else {
              html = "<div class=option><span class=optionlabel>" + key + "</span></div><div class=description>" + description + "</div><div class=option><select name='" + key + "'>";
              for (_i = 0, _len = type.length; _i < _len; _i++) {
                name = type[_i];
                html += "<option value='" + name + "'>" + name + "</option>";
              }
              html += "</select></div>";
              div.innerHTML = html;
              input = $("select", div);
            }
          } else {
            span = $.el('span', {
              "class": 'description',
              textContent: description
            });
            span.style.display = 'none';
            $.add(div, [check = box(key, key), span]);
            check.className = 'option';
            input = $('input', div);
          }
          items[key] = Conf[key];
          inputs[key] = input;
          $.on($('.option', div), 'mouseover', mouseover);
          $.add(fs, div);
        }
        $.add(nodes, fs);
      }
      return $.get(items, function(items) {
        var cb, val;
        cb = Settings.cb.style;
        for (key in items) {
          val = items[key];
          input = inputs[key];
          if (input.type === 'checkbox') {
            input.checked = val;
            $.on(input, 'change', cb.checked);
          } else if (input.nodeName === 'SELECT') {
            input.value = val;
            $.on(input, 'change', cb.select);
          } else {
            input.value = val;
            $.on(input, 'change', cb.value);
          }
        }
        Rice.nodes(nodes);
        return $.add(section, nodes);
      });
    },
    themes: function(section, mode) {
      var a, cb, div, keys, mouseout, mouseover, name, parentdiv, suboptions, theme, _i, _j, _k, _len, _len1, _len2, _ref;
      if (typeof mode !== 'string') {
        mode = 'default';
      }
      parentdiv = $.el('div', {
        id: "themeContainer"
      });
      suboptions = $.el('div', {
        className: "suboptions",
        id: "themes"
      });
      keys = Object.keys(Themes);
      keys.sort();
      cb = Settings.cb.theme;
      mouseover = function() {
        return this.style.color = "" + this.dataset.hover;
      };
      mouseout = function() {
        return this.style.color = "" + this.dataset.color;
      };
      if (mode === "default") {
        for (_i = 0, _len = keys.length; _i < _len; _i++) {
          name = keys[_i];
          theme = Themes[name];
          if (theme["Deleted"]) {
            continue;
          }
          div = $.el('div', {
            className: "theme " + (name === Conf[g.THEMESTRING] ? 'selectedtheme' : ''),
            id: name
          });
          $.extend(div, {
            innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% ; box-shadow: none ; background:" + theme['Reply Background'] + ";border:1px solid " + theme['Reply Border'] + ";color:" + theme['Text'] + "'><div><div style='cursor: pointer; width: 9px; height: 9px; margin: 2px 3px; display: inline-block; vertical-align: bottom; background: " + theme['Checkbox Background'] + "; border: 1px solid " + theme['Checkbox Border'] + ";'></div><span style='color:" + theme['Subjects'] + "; font-weight: 600 '>" + name + "</span><span style='color:" + theme['Names'] + "; font-weight: 600 '>" + theme['Author'] + "</span><span style='color:" + theme['Sage'] + "'>(SAGE)</span><span style='color:" + theme['Tripcodes'] + "'>" + theme['Author Tripcode'] + "</span><time style='color:" + theme['Timestamps'] + "'>20XX.01.01 12:00</time><a data-color='" + theme['Post Numbers'] + "' data-hover='" + theme['Hovered Links'] + "'>No.27583594</a><a data-color='" + theme['Backlinks'] + "' data-hover='" + theme['Hovered Links'] + "' name='" + name + "' class=edit>&gt;&gt;edit</a><a data-color='" + theme['Backlinks'] + "' data-hover='" + theme['Hovered Links'] + "' name='" + name + "' class=export>&gt;&gt;export</a><a data-color='" + theme['Backlinks'] + "' data-hover='" + theme['Hovered Links'] + "' name='" + name + "' class=delete>&gt;&gt;delete</a></div><blockquote style='margin: 0; padding: 12px 40px 12px 38px'><a data-color='" + theme['Quotelinks'] + "' data-hover='" + theme['Hovered Links'] + "'  style='text-shadow: none;'>&gt;&gt;27582902</a><br>Post content is right here.</blockquote><h1 style='color: " + theme['Text'] + "'>Selected</h1></div>"
          });
          div.style.backgroundColor = theme['Background Color'];
          _ref = $$('a[data-color]', div);
          for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
            a = _ref[_j];
            a.style.color = "" + a.dataset.color;
            $.on(a, 'mouseover', mouseover);
            $.on(a, 'mouseout', mouseout);
          }
          $.on($('a.edit', div), 'click', cb.edit);
          $.on($('a.export', div), 'click', cb["export"]);
          $.on($('a.delete', div), 'click', cb["delete"]);
          $.on(div, 'click', cb.select);
          $.add(suboptions, div);
        }
        div = $.el('div', {
          id: 'addthemes'
        });
        $.extend(div, {
          innerHTML: "<a id=newtheme href='javascript:;'>New Theme</a>/<a id=import href='javascript:;' title='From Appchan X, Oneechan, or 4chan SS'>Import Theme</a><input id=importbutton type=file hidden>/<a id=tUndelete href='javascript:;'>Undelete Theme</a>"
        });
        $.on($("#newtheme", div), 'click', function() {
          ThemeTools.init("untitled");
          return Settings.close();
        });
        $.on($("#import", div), 'click', function() {
          return this.nextElementSibling.click();
        });
        $.on($("#importbutton", div), 'change', ThemeTools.importtheme);
        $.on($('#tUndelete', div), 'click', function() {
          var themes;
          $.rm($.id("themeContainer"));
          themes = {
            open: Settings.themes,
            hyphenatedTitle: 'themes'
          };
          return Settings.openSection.apply(themes, ['undelete']);
        });
      } else {
        for (_k = 0, _len2 = keys.length; _k < _len2; _k++) {
          name = keys[_k];
          theme = Themes[name];
          if (!theme["Deleted"]) {
            continue;
          }
          div = $.el('div', {
            id: name,
            className: theme
          });
          $.extend(div, {
            innerHTML: "<div style='cursor: pointer; position: relative; margin-bottom: 2px; width: 100% ; box-shadow: none ; background:" + theme['Reply Background'] + ";border:1px solid " + theme['Reply Border'] + ";color:" + theme['Text'] + "'><div style='padding: 3px 0px 0px 8px;'><span style='color:" + theme['Subjects'] + "; font-weight: 600 '>" + name + "</span><span style='color:" + theme['Names'] + "; font-weight: 600 '>" + theme['Author'] + "</span><span style='color:" + theme['Sage'] + "'>(SAGE)</span><span style='color:" + theme['Tripcodes'] + "'>" + theme['Author Tripcode'] + "</span><time style='color:" + theme['Timestamps'] + "'>20XX.01.01 12:00</time><a data-color='" + theme['Post Numbers'] + "' data-hover='" + theme['Hovered Links'] + "'>No.27583594</a></div><blockquote style='margin: 0; padding: 12px 40px 12px 38px'><a data-color='" + theme['Quotelinks'] + "' data-hover='" + theme['Hovered Links'] + "'  style='text-shadow: none;'>&gt;&gt;27582902</a><br>I forgive you for using VLC to open me. ;__;</blockquote></div>"
          });
          $.on(div, 'click', cb.restore);
          $.add(suboptions, div);
        }
        div = $.el('div', {
          id: 'addthemes',
          innerHTML: "<a href='javascript:;'>Return</a>"
        });
        $.on($('a', div), 'click', function() {
          var themes;
          themes = {
            open: Settings.themes,
            hyphenatedTitle: 'themes'
          };
          $.rm($.id("themeContainer"));
          return Settings.openSection.call(themes);
        });
      }
      $.add(parentdiv, suboptions);
      $.add(parentdiv, div);
      return $.add(section, parentdiv);
    },
    mouseover: function(e) {
      var mouseover;
      mouseover = $.el('div', {
        id: 'mouseover',
        className: 'dialog'
      });
      $.add(Header.hover, mouseover);
      mouseover.innerHTML = this.nextElementSibling.innerHTML;
      UI.hover({
        root: this,
        el: mouseover,
        latestEvent: e,
        endEvents: 'mouseout',
        asapTest: function() {
          return true;
        },
        offsetX: 15,
        offsetY: -5
      });
    },
    mascots: function(section, mode) {
      var addoptions, batchmascots, categories, cb, container, div, keys, mascot, mascotEl, mascotHide, mascotoptions, menu, name, node, option, suboptions, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1;
      categories = {};
      cb = Settings.cb.mascot;
      if (typeof mode !== 'string') {
        mode = 'default';
      }
      suboptions = $.el("div", {
        className: "suboptions"
      });
      mascotHide = $.el("div", {
        id: "mascot_hide",
        className: "reply"
      });
      $.extend(mascotHide, {
        innerHTML: "Hide Categories <span class=\"drop-marker\"></span><div></div>"
      });
      keys = Object.keys(Mascots);
      keys.sort();
      if (mode === 'default') {
        mascotoptions = $.el('div', {
          id: 'mascot-options'
        });
        $.extend(mascotoptions, {
          innerHTML: "<a class=\"edit\" href=\"javascript:;\">Edit</a><a class=\"delete\" href=\"javascript:;\">Delete</a><a class=\"export\" href=\"javascript:;\">Export</a>"
        });
        $.on($('.edit', mascotoptions), 'click', cb.edit);
        $.on($('.delete', mascotoptions), 'click', cb["delete"]);
        $.on($('.export', mascotoptions), 'click', cb["export"]);
        addoptions = function() {
          if (mascotoptions.parentElement === this) {
            return;
          }
          return $.add(this, mascotoptions);
        };
        _ref = MascotTools.categories;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          name = _ref[_i];
          menu = $('div', mascotHide);
          categories[name] = div = $.el("div", {
            id: name,
            className: "mascots-container",
            hidden: __indexOf.call(Conf["Hidden Categories"], name) >= 0
          });
          $.extend(categories[name], {
            innerHTML: "<h3 class=\"mascotHeader\">" + E(name) + "</h3>"
          });
          option = UI.checkbox(name, name, (__indexOf.call(Conf["Hidden Categories"], name) >= 0));
          $.on($('input', option), 'change', cb.category);
          $.add(suboptions, div);
          $.add(menu, option);
        }
        for (_j = 0, _len1 = keys.length; _j < _len1; _j++) {
          name = keys[_j];
          if (__indexOf.call(Conf["Deleted Mascots"], name) >= 0) {
            continue;
          }
          mascot = Mascots[name];
          mascotEl = $.el('div', {
            id: name,
            className: __indexOf.call(Conf[g.MASCOTSTRING], name) >= 0 ? 'mascot enabled' : 'mascot'
          });
          $.extend(mascotEl, {
            innerHTML: "<div class='mascotname'>" + (name.replace(/_/g, ' ')) + "</div><div class='mascotcontainer " + (mascot.silhouette ? 'silhouette' : '') + "'><div class='mAlign " + mascot.category + "'><img class='mascotimg' src='" + mascot.image + "'></div></div>"
          });
          $.on(mascotEl, 'click', cb.select);
          $.on(mascotEl, 'mouseover', addoptions);
          $.add(categories[mascot.category] || categories[MascotTools.categories[0]], mascotEl);
        }
        batchmascots = $.el('div', {
          id: "mascots_batch"
        });
        $.extend(batchmascots, {
          innerHTML: "<a href=\"javascript:;\" id=clear>Clear All</a>/<a href=\"javascript:;\" id=selectAll>Select All</a>/<a href=\"javascript:;\" id=createNew>Add Mascot</a>/<a href=\"javascript:;\" id=importMascot>Import Mascot</a><input id=importMascotButton type=file hidden>/<a href=\"javascript:;\" id=undelete>Undelete Mascots</a>/<a href=\"http://appchan.booru.org/\" target=_blank>Get More Mascots!</a>"
        });
        $.on($('#clear', batchmascots), 'click', function() {
          var enabledMascots, _k, _len2;
          enabledMascots = JSON.parse(JSON.stringify(Conf[g.MASCOTSTRING]));
          for (_k = 0, _len2 = enabledMascots.length; _k < _len2; _k++) {
            name = enabledMascots[_k];
            $.rmClass($.id(name), 'enabled');
          }
          return $.set(g.MASCOTSTRING, Conf[g.MASCOTSTRING] = []);
        });
        $.on($('#selectAll', batchmascots), 'click', function() {
          var _ref1;
          for (name in Mascots) {
            mascot = Mascots[name];
            if (!((_ref1 = mascot.category, __indexOf.call(Conf["Hidden Categories"], _ref1) >= 0) || __indexOf.call(Conf[g.MASCOTSTRING], name) >= 0 || __indexOf.call(Conf["Deleted Mascots"], name) >= 0)) {
              $.addClass($.id(name), 'enabled');
              Conf[g.MASCOTSTRING].push(name);
            }
          }
          return $.set(g.MASCOTSTRING, Conf[g.MASCOTSTRING]);
        });
        $.on($('#createNew', batchmascots), 'click', function() {
          MascotTools.dialog();
          return Settings.close();
        });
        $.on($("#importMascot", batchmascots), 'click', function() {
          return this.nextElementSibling.click();
        });
        $.on($("#importMascotButton", batchmascots), 'change', MascotTools.importMascot);
        $.on($('#undelete', batchmascots), 'click', function() {
          var mascots;
          if (!(Conf["Deleted Mascots"].length > 0)) {
            alert("No mascots have been deleted.");
            return;
          }
          mascots = {
            open: Settings.mascots,
            hyphenatedTitle: 'mascots'
          };
          return Settings.openSection.apply(mascots, ['restore']);
        });
      } else {
        container = $.el("div", {
          className: "mascots"
        });
        for (_k = 0, _len2 = keys.length; _k < _len2; _k++) {
          name = keys[_k];
          if (!(__indexOf.call(Conf["Deleted Mascots"], name) >= 0)) {
            continue;
          }
          mascot = Mascots[name];
          mascotEl = $.el('div', {
            className: 'mascot',
            id: name
          });
          $.extend(mascotEl, {
            innerHTML: "<div class='mascotname'>" + (name.replace(/_/g, ' ')) + "</div><div class='mascotcontainer " + (mascot.silhouette ? 'silhouette' : '') + "'><div class='mAlign " + mascot.category + "'><img class='mascotimg' src='" + mascot.image + "'></div></div>"
          });
          $.on(mascotEl, 'click', cb.restore);
          $.add(container, mascotEl);
        }
        $.add(suboptions, container);
        batchmascots = $.el('div', {
          id: "mascots_batch"
        });
        $.extend(batchmascots, {
          innerHTML: "<a href=\"javascript:;\" id=\"return\">Return</a>"
        });
        $.on($('#return', batchmascots), 'click', function() {
          var mascots;
          mascots = {
            open: Settings.mascots,
            hyphenatedTitle: 'mascots'
          };
          return Settings.openSection.apply(mascots);
        });
      }
      _ref1 = [suboptions, batchmascots, mascotHide];
      for (_l = 0, _len3 = _ref1.length; _l < _len3; _l++) {
        node = _ref1[_l];
        Rice.nodes(node);
      }
      return $.add(section, [suboptions, batchmascots, mascotHide]);
    },
    cb: {
      style: {
        checked: function() {
          var hyphenated, _ref;
          $.cb.checked.call(this);
          if ((_ref = this.name) === 'NSFW/SFW Themes' || _ref === 'NSFW/SFW Mascots') {
            return;
          }
          hyphenated = this.name.toLowerCase().replace(/^4/, 'four').replace(/\s+/g, '-');
          return (this.checked ? $.addClass : $.rmClass)(doc, hyphenated);
        },
        value: function() {
          $.cb.value.call(this);
          return Style.sheets.dynamic.textContent = Style.dynamic();
        },
        select: function() {
          var hyphenated, option, _i, _len, _ref;
          $.cb.value.call(this);
          _ref = this.options;
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            option = _ref[_i];
            hyphenated = ("" + this.name + " " + option.value).toLowerCase().replace(/^4/, 'four').replace(/\s+/g, '-');
            (option.value === this.value ? $.addClass : $.rmClass)(doc, hyphenated);
          }
        }
      },
      mascot: {
        category: function() {
          var cb, i, name, setting, type, _i, _len, _ref;
          if ($.id(this.name).hidden = this.checked) {
            Conf["Hidden Categories"].push(this.name);
            _ref = ["Enabled Mascots", "Enabled Mascots sfw", "Enabled Mascots nsfw"];
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
              type = _ref[_i];
              setting = Conf[type];
              i = setting.length;
              while (i--) {
                name = setting[i];
                if (Mascots[name].category !== this.name) {
                  continue;
                }
                setting.splice(i, 1);
                if (type !== g.MASCOTSTRING) {
                  continue;
                }
                $.rmClass($.id(name), 'enabled');
                if (Conf['mascot'] === name) {
                  cb = MascotTools.toggle;
                }
              }
              $.set(type, setting);
            }
          } else {
            $.remove(Conf["Hidden Categories"], this.name);
          }
          $.set("Hidden Categories", Conf["Hidden Categories"]);
          if (cb) {
            return cb();
          }
        },
        edit: function(e) {
          e.stopPropagation();
          MascotTools.dialog(this.parentElement.parentElement.id);
          return Settings.close();
        },
        "delete": function(e) {
          var name, type, _i, _len, _ref;
          e.stopPropagation();
          name = this.parentElement.parentElement.id;
          if (confirm("Are you sure you want to delete \"" + name + "\"?")) {
            if (Conf['mascot'] === name) {
              MascotTools.toggle();
            }
            _ref = ["Enabled Mascots", "Enabled Mascots sfw", "Enabled Mascots nsfw"];
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
              type = _ref[_i];
              $.remove(Conf[type], name);
              $.set(type, Conf[type]);
            }
            Conf["Deleted Mascots"].push(name);
            $.set("Deleted Mascots", Conf["Deleted Mascots"]);
            return $.rm($.id(name));
          }
        },
        "export": function(e) {
          var a, data, name;
          e.stopPropagation();
          name = this.parentElement.parentElement.id;
          data = Mascots[name];
          data['Mascot'] = name;
          a = $.el('a', {
            className: 'export-button',
            textContent: 'Save me!',
            download: "" + name + "-" + (Date.now()) + ".json",
            href: "data:application/json;base64," + (btoa(unescape(encodeURIComponent(JSON.stringify(data, null, 2))))),
            target: '_blank'
          });
          $.on(a, 'click', function(e) {
            return e.stopPropagation();
          });
          return $.add(this.parentElement.parentElement, a);
        },
        restore: function() {
          if (confirm("Are you sure you want to restore \"" + this.id + "\"?")) {
            $.remove(Conf["Deleted Mascots"], this.id);
            $.set("Deleted Mascots", Conf["Deleted Mascots"]);
            return $.rm(this);
          }
        },
        select: function() {
          var string;
          string = g.MASCOTSTRING;
          if ($.remove(Conf[string], this.id)) {
            if (Conf['mascot'] === this.id) {
              MascotTools.toggle();
            }
          } else {
            Conf['mascot'] = this.id;
            Conf[string].push(this.id);
            MascotTools.change(Mascots[this.id]);
          }
          $.toggleClass(this, 'enabled');
          $.set(string, Conf[string]);
          return $.set(string, Conf[string]);
        }
      },
      theme: {
        select: function() {
          var current;
          if (current = $.id(Conf[g.THEMESTRING])) {
            $.rmClass(current, 'selectedtheme');
          }
          $.set(g.THEMESTRING, Conf[g.THEMESTRING] = this.id);
          $.addClass(this, 'selectedtheme');
          return Style.setTheme(Themes[this.id]);
        },
        edit: function(e) {
          e.preventDefault();
          e.stopPropagation();
          ThemeTools.init(this.name);
          return Settings.close();
        },
        "export": function(e) {
          var a, data;
          e.preventDefault();
          e.stopPropagation();
          data = Themes[this.name];
          data['Theme'] = this.name;
          a = $.el('a', {
            textContent: '>>Save me!',
            download: "" + this.name + "-" + (Date.now()) + ".json",
            href: "data:application/json;base64," + (btoa(unescape(encodeURIComponent(JSON.stringify(data, null, 2))))),
            target: '_blank'
          });
          $.on(a, 'click', function(e) {
            return e.stopPropagation();
          });
          return $.replace(this, a);
        },
        "delete": function(e) {
          var container, settheme;
          e.preventDefault();
          e.stopPropagation();
          container = $.id(this.name);
          if (!(container.previousSibling || container.nextSibling)) {
            alert("Cannot delete theme (No other themes available).");
            return;
          }
          if (confirm("Are you sure you want to delete \"" + this.name + "\"?")) {
            if (this.name === Conf[g.THEMESTRING]) {
              if (settheme = container.previousSibling || container.nextSibling) {
                Conf[g.THEMESTRING] = settheme.id;
                $.addClass(settheme, 'selectedtheme');
                $.set(g.THEMESTRING, Conf[g.THEMESTRING]);
              }
            }
            Themes[this.name]["Deleted"] = true;
            return $.get("userThemes", {}, (function(_this) {
              return function(_arg) {
                var userThemes;
                userThemes = _arg.userThemes;
                userThemes[_this.name] = Themes[_this.name];
                $.set('userThemes', userThemes);
                return $.rm(container);
              };
            })(this));
          }
        },
        restore: function() {
          if (confirm("Are you sure you want to restore \"" + this.id + "\"?")) {
            Themes[this.id]["Deleted"] = false;
            return $.get("userThemes", {}, (function(_this) {
              return function(_arg) {
                var userThemes;
                userThemes = _arg.userThemes;
                userThemes[_this.id] = Themes[_this.id];
                $.set('userThemes', userThemes);
                return $.rm(_this);
              };
            })(this));
          }
        }
      }
    }
  };

  Main = {
    init: function() {
      var db, flatten, pathname, _i, _len, _ref, _ref1;
      if (location.hostname === 'www.google.com') {
        return $.ready(function() {
          return Captcha.noscript.initFrame();
        });
      }
      g.threads = new SimpleDict();
      g.posts = new SimpleDict();
      pathname = location.pathname.split('/');
      g.BOARD = new Board(pathname[1]);
      if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
        return;
      }
      g.VIEW = (function() {
        switch (pathname[2]) {
          case 'res':
          case 'thread':
            return 'thread';
          case 'catalog':
            return 'catalog';
          case 'archive':
            return 'archive';
          default:
            return 'index';
        }
      })();
      if (g.VIEW === 'catalog') {
        return Index.catalogSwitch();
      }
      if (g.VIEW === 'thread') {
        g.THREADID = +pathname[3];
        if (pathname[4] != null) {
          g.SLUG = pathname[4];
        }
        if (pathname[2] !== 'thread') {
          pathname[2] = 'thread';
          history.replaceState(null, '', pathname.slice(0, 4).join('/') + location.hash);
        }
      }
      flatten = function(parent, obj) {
        var key, val;
        if (obj instanceof Array) {
          Conf[parent] = obj[0];
        } else if (typeof obj === 'object') {
          for (key in obj) {
            val = obj[key];
            flatten(key, val);
          }
        } else {
          Conf[parent] = obj;
        }
      };
      flatten(null, Config);
      _ref1 = DataBoard.keys;
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        db = _ref1[_i];
        Conf[db] = {
          boards: {}
        };
      }
      $.extend(Conf, {
        'Enabled Mascots': [],
        'Enabled Mascots sfw': [],
        'Enabled Mascots nsfw': [],
        'Deleted Mascots': [],
        'Hidden Categories': ["Custom", "Questionable"],
        'userThemes': {},
        'userMascots': {},
        'selectedArchives': {},
        'CachedTitles': {}
      });
      return $.get(Conf, function(items) {
        $.extend(Conf, items);
        return $.asap((function() {
          return Favicon.el = $('link[rel="shortcut icon"]', d.head);
        }), Main.initFeatures);
      });
    },
    initFeatures: function() {
      var err, feature, href, name, pathname, _i, _len, _ref, _ref1, _ref2;
      Favicon.el.type = 'image/x-icon';
      href = Favicon.el.href;
      Favicon.SFW = /ws\.ico$/.test(href);
      Favicon["default"] = href;
      g.TYPE = Favicon.SFW ? 'sfw' : 'nsfw';
      $.extend(Themes, Conf["userThemes"]);
      $.extend(Mascots, Conf["userMascots"]);
      if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
        return Style.init();
      }
      Main.setThemeString();
      Main.setMascotString();
      switch (location.hostname) {
        case 'a.4cdn.org':
          return;
        case '4chan.org':
        case 'www.4chan.org':
          g.TYPE = 'sfw';
          g.VIEW = 'home';
          Main.setThemeString();
          Style.init();
          return;
        case 'sys.4chan.org':
          g.VIEW = 'report';
          Style.init();
          Report.init();
          return;
        case 'i.4cdn.org':
          $.ready(function() {
            var URL, pathname, video, _ref1;
            if (Conf['404 Redirect'] && ((_ref1 = d.title) === '4chan - Temporarily Offline' || _ref1 === '4chan - 404 Not Found')) {
              Redirect.init();
              pathname = location.pathname.split('/');
              URL = Redirect.to('file', {
                boardID: g.BOARD.ID,
                filename: pathname[pathname.length - 1]
              });
              if (URL) {
                return location.replace(URL);
              }
            } else if (Conf['Loop in New Tab'] && (video = $('video'))) {
              video.loop = true;
              video.controls = false;
              video.play();
              return ImageCommon.addControls(video);
            }
          });
          return;
      }
      if (Conf['Normalize URL'] && g.VIEW === 'thread') {
        pathname = location.pathname.split('/');
        if (pathname[2] !== 'thread' || pathname.length > 4) {
          pathname[2] = 'thread';
          history.replaceState(null, '', pathname.slice(0, 4).join('/') + location.hash);
        }
      }
      _ref1 = Main.features;
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        _ref2 = _ref1[_i], name = _ref2[0], feature = _ref2[1];
        try {
          feature.init();
        } catch (_error) {
          err = _error;
          Main.handleErrors({
            message: "\"" + name + "\" initialization crashed.",
            error: err
          });
        }
      }
      return $.ready(Main.initReady);
    },
    initReady: function() {
      var GMver, err, href, i, passLink, styleSelector, v, _i, _len, _ref, _ref1;
      if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
        if (Conf['404 Redirect'] && g.VIEW === 'thread') {
          href = Redirect.to('thread', {
            boardID: g.BOARD.ID,
            threadID: g.THREADID,
            postID: +location.hash.match(/\d+/)
          });
          location.replace(href || ("/" + g.BOARD + "/"));
        }
        return;
      }
      if (styleSelector = $.id('styleSelector')) {
        passLink = $.el('a', {
          textContent: '4chan Pass',
          href: 'javascript:;'
        });
        $.on(passLink, 'click', function() {
          return window.open('//sys.4chan.org/auth', 'This will steal your data.', 'left=0,top=0,width=500,height=255,toolbar=0,resizable=0');
        });
        $.before(styleSelector.previousSibling, [$.tn('['), passLink, $.tn(']\u00A0\u00A0')]);
        $('link[href*="mobile"]', d.head).disabled = true;
      }
      if (!Conf['JSON Navigation'] || g.VIEW === 'thread') {
        Main.initThread();
      }
      $.add(d.head, $.el('link', {
        href: "//s.4cdn.org/css/flags.556.css",
        rel: "stylesheet"
      }));
      $.event('4chanXInitFinished');
      if (Conf['Show Support Message']) {
        GMver = GM_info.version.split('.');
        _ref1 = "1.14".split('.');
        for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) {
          v = _ref1[i];
          if (v === GMver[i]) {
            continue;
          }
          (v < GMver[i]) || new Notice('warning', "Your version of Greasemonkey is outdated (v" + GM_info.version + " instead of v1.14 minimum) and appchan x may not operate correctly.", 30);
          break;
        }
      }
      try {
        return localStorage.getItem('4chan-settings');
      } catch (_error) {
        err = _error;
        return new Notice('warning', 'Cookies need to be enabled on 4chan for appchan x to operate properly.', 30);
      }
    },
    initThread: function() {
      var board, err, errors, m, postRoot, posts, scriptData, thread, threadRoot, threads, _i, _j, _len, _len1, _ref, _ref1;
      if (board = $('.board')) {
        threads = [];
        posts = [];
        _ref = $$('.board > .thread', board);
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          threadRoot = _ref[_i];
          thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
          threads.push(thread);
          _ref1 = $$('.thread > .postContainer', threadRoot);
          for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
            postRoot = _ref1[_j];
            try {
              posts.push(new Post(postRoot, thread, g.BOARD));
            } catch (_error) {
              err = _error;
              if (!errors) {
                errors = [];
              }
              errors.push({
                message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.",
                error: err
              });
            }
          }
        }
        if (errors) {
          Main.handleErrors(errors);
        }
        if (g.VIEW === 'thread') {
          scriptData = Get.scriptData();
          threads[0].postLimit = /\bbumplimit *= *1\b/.test(scriptData);
          threads[0].fileLimit = /\bimagelimit *= *1\b/.test(scriptData);
          threads[0].ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : void 0;
        }
        Thread.callbacks.execute(threads);
        Post.callbacks.execute(posts);
      }
      return $.get('previousversion', null, function(_arg) {
        var changelog, el, previousversion;
        previousversion = _arg.previousversion;
        if (previousversion === g.VERSION) {
          return;
        }
        if (previousversion) {
          changelog = 'https://github.com/zixaphir/appchan-x/blob/master/CHANGELOG.md';
          el = $.el('span', {
            innerHTML: "appchan x has been updated to <a href='" + changelog + "' target=_blank>version " + g.VERSION + "</a>."
          });
          new Notice('info', el, 15);
        } else {
          Settings.open();
        }
        return $.set('previousversion', g.VERSION);
      });
    },
    handleErrors: function(errors) {
      var div, error, logs, _i, _len;
      if (!(errors instanceof Array)) {
        error = errors;
      } else if (errors.length === 1) {
        error = errors[0];
      }
      if (error) {
        new Notice('error', Main.parseError(error), 15);
        return;
      }
      div = $.el('div', {
        innerHTML: E(errors.length) + " errors occurred. [<a href=\"javascript:;\">show</a>]"
      });
      $.on(div.lastElementChild, 'click', function() {
        var _ref;
        return _ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = _ref[0], logs.hidden = _ref[1], _ref;
      });
      logs = $.el('div', {
        hidden: true
      });
      for (_i = 0, _len = errors.length; _i < _len; _i++) {
        error = errors[_i];
        $.add(logs, Main.parseError(error));
      }
      return new Notice('error', [div, logs], 30);
    },
    parseError: function(data) {
      var error, message;
      c.error(data.message, data.error.message, data.error.stack);
      message = $.el('div', {
        textContent: data.message
      });
      error = $.el('div', {
        textContent: "" + (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
      });
      return [message, error];
    },
    isThisPageLegit: function() {
      var _ref;
      if (!('thisPageIsLegit' in Main)) {
        Main.thisPageIsLegit = location.hostname === 'boards.4chan.org' && !$('link[href*="favicon-status.ico"]', d.head) && ((_ref = d.title) !== '4chan - Temporarily Offline' && _ref !== '4chan - Error' && _ref !== '504 Gateway Time-out');
      }
      return Main.thisPageIsLegit;
    },
    ready: function(cb) {
      return $.ready(function() {
        if (Main.isThisPageLegit()) {
          return cb();
        }
      });
    },
    setMascotString: function() {
      var type;
      type = "Enabled Mascots";
      if (Conf["NSFW/SFW Mascots"]) {
        type += " " + g.TYPE;
      }
      return g.MASCOTSTRING = type;
    },
    setThemeString: function() {
      var type;
      type = "theme";
      if (Conf["NSFW/SFW Themes"]) {
        type += "_" + g.TYPE;
      }
      return g.THEMESTRING = type;
    },
    features: [['Style', Style], ['Mascots', MascotTools], ['Rice', Rice], ['Announcements', GlobalMessage], ['Polyfill', Polyfill], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Labels list', Labels], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Quote Markers', QuoteMarkers], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Download Link', DownloadLink], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Navigate', Navigate], ['Flash Features', Flash]]
  };

  Main.init();

}).call(this);