Skip to content

Instantly share code, notes, and snippets.

@zixaphir
Created September 13, 2012 22:30
Show Gist options
  • Save zixaphir/3718193 to your computer and use it in GitHub Desktop.
Save zixaphir/3718193 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name AppChan x
// @version 0.8beta
// @namespace zixaphir
// @description Adds various features and stylings.
// @copyright 4chan x - 2009-2011 James Campos <james.r.campos@gmail.com>
// @copyright 4chan x - 2012 Nicolas Stepien <stepien.nicolas@gmail.com>
// @copyright Appchan x - 2012 Zixaphir <zixaphirmoxphar@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/*
// @include https://boards.4chan.org/*
// @include http://images.4chan.org/*
// @include https://images.4chan.org/*
// @include http://sys.4chan.org/*
// @include https://sys.4chan.org/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_openInTab
// @run-at document-start
// @updateURL https://github.com/zixaphir/appchan-x/raw/stable/appchan_x.user.js
// @downloadURL https://github.com/zixaphir/appchan-x/raw/stable/appchan_x.user.js
// @icon data:image/gif;base64,R0lGODlhEAAQAKECAAAAAGbMM////////yH5BAEKAAIALAAAAAAQABAAAAIxlI+pq+D9DAgUoFkPDlbs7lGiI2bSVnKglnJMOL6omczxVZK3dH/41AG6Lh7i6qUoAAA7
// ==/UserScript==
/* LICENSE
*
* 4chan x Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>
* http://aeosynth.github.com/4chan-x/
* 4chan x Copyright (c) 2012 Nicolas Stepien <stepien.nicolas@gmail.com>
* http://mayhemydg.github.com/4chan-x/
* Appchan X Copyright (c) 2012 Zixaphir <zixaphirmodnar@gmail.com>
* http://zixaphir.github.com/appchan-x/
* OneeChan Copyright (c) 2012 Jordan Bates
* http://seaweedchan.github.com/oneechan/
* 4chan SS Copyright (c) 2012 Ahodesuka
* http://ahodesuka.github.com/4chan-Style-Script/
*
* 4chan X
* Appchan X
*
* 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.
*
* HACKING
*
* Appchan X is written in CoffeeScript[1], and developed on GitHub[2].
*
* [1]: http://coffeescript.org/
* [2]: https://github.com/zixaphir/appchan-x
*
* CONTRIBUTORS
*
* blaise - mentoring and support
* aeosynth - original author of 4chan x
* mayhemydg - a current maintainer of 4chan x
* noface - a current maintainer of 4chan x
* that4chanwolf - former maintainer of 4chan x
* desuwa - Firefox filename upload fix
* seaweed - bottom padding for image hover
* e000 - cooldown sanity check
* ahodesuka - scroll back when unexpanding images, file info formatting
* Shou - pentadactyl fixes
* ferongr - favicons
* xat - favicons
* Ongpot - sfw favicon
* thisisanon - nsfw + 404 favicons
* Anonymous - empty favicon
* Seiba - chrome quick reply focusing
* herpaderpderp - recaptcha fixes
* WakiMiko - recaptcha tab order http://userscripts.org/scripts/show/82657
* btmcsweeney - allow users to specify text for sauce links
*
* All the people who've taken the time to write bug reports.
*
* Thank you.
*/
(function() {
var $, $$, Anonymize, ArchiveLink, AutoGif, Build, Conf, Config, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, Favicon, FileInfo, Filter, Get, ImageExpand, ImageHover, Keybinds, Main, Markdown, Mascots, Menu, Nav, Options, PngFix, Prefetch, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteThreading, Quotify, Redirect, ReplyHiding, ReportLink, RevealSpoilers, Sauce, StrikethroughQuotes, Style, ThemeOptions, Themes, ThreadHiding, ThreadStats, Time, TitlePost, UI, Unread, Updater, Watcher, console, d, editMascot, editMode, editTheme, enabledmascots, g, userMascots, userThemes;
Config = {
main: {
Enhancing: {
'Disable inline 4chan addon': [true, 'Avoid conflicts between 4chan X and 4chan\'s inline extension. <span class=disabledwarning><code>Style</code> is enabled. This option will be enabled regardless of this setting\'s value.</span>'],
'404 Redirect': [true, 'Redirect dead threads and images'],
'Keybinds': [true, 'Binds actions to keys'],
'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'],
'File Info Formatting': [true, 'Reformats the file information'],
'Comment Expansion': [true, 'Expand too long comments'],
'Thread Expansion': [true, 'View all replies'],
'Index Navigation': [true, 'Navigate to previous / next thread'],
'Rollover': [true, 'Index navigation will fallback to page navigation.'],
'Reply Navigation': [false, 'Navigate to top / bottom of thread'],
'Style': [true, 'Custom theming and styling options.'],
'Check for Updates': [false, 'Check for updated versions of Appchan X']
},
Filtering: {
'Anonymize': [false, 'Make everybody anonymous'],
'Filter': [true, 'Self-moderation placebo'],
'Recursive Filtering': [true, 'Filter replies of filtered posts, recursively'],
'Reply Hiding': [true, 'Hide single replies'],
'Thread Hiding': [true, 'Hide entire threads'],
'Show Stubs': [true, 'Of hidden threads / replies']
},
Imaging: {
'Image Auto-Gif': [false, 'Animate gif thumbnails'],
'Png Thumbnail Fix': [false, 'Fixes transparent png thumbnails'],
'Image Expansion': [true, 'Expand images'],
'Image Hover': [false, 'Show full image on mouseover'],
'Sauce': [true, 'Add sauce to images'],
'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail'],
'Expand From Current': [false, 'Expand images from current position to thread end.'],
'Prefetch': [false, 'Prefetch images.']
},
Menu: {
'Menu': [true, 'Add a drop-down menu in posts.'],
'Report Link': [true, 'Add a report link to the menu.'],
'Delete Link': [true, 'Add post and image deletion links to the menu.'],
'Download Link': [true, 'Add a download with original filename link to the menu. Chrome-only currently.'],
'Archive Link': [true, 'Add an archive link to the menu.']
},
Monitoring: {
'Thread Updater': [true, 'Update threads. Has more options in its own dialog.'],
'Unread Count': [true, 'Show unread post count in tab title'],
'Unread Favicon': [true, 'Show a different favicon when there are unread posts'],
'Post in Title': [true, 'Show the op\'s post in the tab title'],
'Thread Stats': [true, 'Display reply and image count'],
'Thread Watcher': [true, 'Bookmark threads'],
'Auto Watch': [true, 'Automatically watch threads that you start'],
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
},
Posting: {
'Quick Reply': [true, 'Reply without leaving the page. <span class=disabledwarning><code>Style</code> is enabled. This option will be enabled regardless of this setting\'s value.</span>'],
'Cooldown': [true, 'Prevent "flood detected" errors.'],
'Persistent QR': [true, 'The Quick reply won\'t disappear after posting. <span class=disabledwarning><code>Style</code> is enabled. This option will be enabled regardless of this setting\'s value.</span>'],
'Auto Hide QR': [false, 'Automatically hide the quick reply when posting. <span class=disabledwarning><code>Style</code> is enabled. This option will be disabled regardless of this setting\'s value.</span>'],
'Open Reply in New Tab': [false, 'Open replies in a new tab that are made from the main board.'],
'Remember QR size': [false, 'Remember the size of the Quick reply (Firefox only).'],
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'],
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
'Hide Original Post Form': [true, 'Replace the normal post form with a shortcut to open the QR. <span class=disabledwarning><code>Style</code> is enabled. This option will be disabled regardless of this setting\'s value.</span>'],
'Sage on /jp/': [true, 'Uses sage by default on /jp/'],
'Markdown': [false, 'Code, italic, bold, italic bold, double struck - `, *, **, ***, ||, respectively. _ can be used instead of *. <span class=warning><code>Markdown</code> is currently blocked server-side, and using it will simply remove markdowned elements from your post.</style>']
},
Quoting: {
'Quote Backlinks': [true, 'Add quote backlinks'],
'OP Backlinks': [false, 'Add backlinks to the OP'],
'Quote Highlighting': [true, 'Highlight the previewed post'],
'Quote Inline': [true, 'Show quoted post inline on quote click'],
'Quote Preview': [true, 'Show quote content on hover'],
'Resurrect Quotes': [true, 'Linkify dead quotes to archives'],
'Indicate OP quote': [true, 'Add \'(OP)\' to OP quotes'],
'Indicate Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes'],
'Forward Hiding': [true, 'Hide original posts of inlined backlinks'],
'Quote Threading': [false, 'Thread conversations']
}
},
filter: {
name: ['# Filter any namefags:', '#/^(?!Anonymous$)/'].join('\n'),
uniqueid: ['# Filter a specific ID:', '#/Txhvk1Tl/'].join('\n'),
tripcode: ['# Filter any tripfags', '#/^!/'].join('\n'),
mod: ['# Set a custom class for mods:', '#/Mod$/;highlight:mod;op:yes', '# Set a custom class for moot:', '#/Admin$/;highlight:moot;op:yes'].join('\n'),
email: ['# Filter any e-mails that are not `sage` on /a/ and /jp/:', '#/^(?!sage$)/;boards:a,jp'].join('\n'),
subject: ['# Filter Generals on /v/:', '#/general/i;boards:v;op:only'].join('\n'),
comment: ['# Filter Stallman copypasta on /g/:', '#/what you\'re refer+ing to as linux/i;boards:g'].join('\n'),
country: [''].join('\n'),
filename: [''].join('\n'),
dimensions: ['# Highlight potential wallpapers:', '#/1920x1080/;op:yes;highlight;top:no;boards:w,wg'].join('\n'),
filesize: [''].join('\n'),
md5: [''].join('\n')
},
sauces: ['http://iqdb.org/?url=$1', 'http://www.google.com/searchbyimage?image_url=$1', '#http://tineye.com/search?url=$1', '#http://saucenao.com/search.php?db=999&url=$1', '#http://3d.iqdb.org/?url=$1', '#http://regex.info/exif.cgi?imgurl=$2', '# uploaders:', '#http://imgur.com/upload?url=$2;text:Upload to imgur', '#http://omploader.org/upload?url1=$2;text:Upload to omploader', '# "View Same" in archives:', '#http://archive.foolz.us/_/search/image/$3/;text:View same on foolz', '#http://archive.foolz.us/$4/search/image/$3/;text:View same on foolz /$4/', '#https://archive.installgentoo.net/$4/image/$3;text:View same on installgentoo /$4/'].join('\n'),
time: '%m/%d/%y(%a)%H:%M',
backlink: '>>%id',
fileInfo: '%l (%p%s, %r)',
favicon: 'ferongr',
hotkeys: {
openQR: ['i', 'Open QR with post number inserted'],
openEmptyQR: ['I', 'Open QR without post number inserted'],
openOptions: ['ctrl+o', 'Open Options'],
close: ['Esc', 'Close Options or QR'],
spoiler: ['ctrl+s', 'Quick spoiler tags'],
code: ['alt+c', 'Quick code tags'],
sageru: ['alt+n', 'Sage keybind'],
submit: ['alt+s', 'Submit post'],
watch: ['w', 'Watch thread'],
update: ['u', 'Update now'],
unreadCountTo0: ['z', 'Mark thread as read'],
threading: ['t', 'Toggle threading'],
expandImage: ['m', 'Expand selected image'],
expandAllImages: ['M', 'Expand all images'],
zero: ['0', 'Jump to page 0'],
nextPage: ['L', 'Jump to the next page'],
previousPage: ['H', 'Jump to the previous page'],
nextThread: ['n', 'See next thread'],
previousThread: ['p', 'See previous thread'],
expandThread: ['e', 'Expand thread'],
openThreadTab: ['o', 'Open thread in new tab'],
openThread: ['O', 'Open thread in current tab'],
nextReply: ['J', 'Select next reply'],
previousReply: ['K', 'Select previous reply'],
hide: ['x', 'Hide thread']
},
updater: {
checkbox: {
'Scrolling': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'],
'Scroll BG': [false, 'Scroll background tabs'],
'Verbose': [true, 'Show countdown timer, new post count'],
'Auto Update': [true, 'Automatically fetch new posts']
},
'Interval': 30
},
style: {
Dialogs: {
'Announcements': ['slideout', 'The style of announcements and the ability to hide them.', ['4chan default', 'slideout', 'hide']],
'Post Form Style': ['tabbed slideout', 'How the post form will sit on the page.', ['fixed', 'slideout', 'tabbed slideout', 'transparent fade']],
'Slideout Navigation': ['compact', 'How the slideout navigation will be displayed.', ['compact', 'list', 'hide']],
'Slideout Watcher': [true, 'Adds an icon you can hover over to show the watcher, as opposed to having the watcher always visible.'],
'Updater Position': ['top', 'The position of 4chan thread updater', ['top', 'bottom']]
},
Navigation: {
'Boards Navigation': ['sticky top', 'The position of 4chan board navigation', ['sticky top', 'sticky bottom', 'top', 'hide']],
'Pagination': ['sticky bottom', 'The position of 4chan page navigation', ['sticky top', 'sticky bottom', 'top', 'bottom', 'on side', 'hide']]
},
Rice: {
'Block Ads': [false, 'Block advertisements. It\'s probably better to use AdBlock for this.'],
'Checkboxes': ['show', 'Alter checkboxes.', ['show', 'make checkboxes circular', 'hide', 'do not style checkboxes']],
'Captcha Opacity': ['1.00', 'Transparency of the 4chan Captcha', ['1.00', '.75', '.50', '.25']],
'Emoji Position': ['left', 'Position of emoji icons, like sega and neko.', ['left', 'right', 'hide emoji']],
'Filtered Backlinks': [true, 'Mark backlinks to filtered posts.'],
'Font': ['Calibri', 'The font used by all elements of 4chan.', 'text'],
'Font Size': [12, 'The font size of posts and various UI. This does not change all font sizes.', [10, 11, 12, 13, 14]],
'Mascots': [false, 'Add a pretty picture of your waifu to the sidebar.'],
'Mascots Overlap Posts': [true, 'Mascots overlap threads and posts.'],
'Rounded Edges': [true, 'Round the edges of various 4chan elements.'],
'Sage Highlighting': ['image', 'Icons or text to highlight saged posts.', ['text', 'image', 'none']],
'Underline Links': [true, 'Put lines under hyperlinks.']
},
Layout: {
'4chan Banner': ['in sidebar', 'The positioning of 4chan\'s image banner.', ['in sidebar', 'at top', 'hide']],
'Board Logo': ['in sidebar', 'The positioning of the board\'s logo and subtitle.', ['in sidebar', 'at top', 'hide']],
'Compact Post Form Inputs': [true, 'Use compact inputs on the post form.'],
'Expand Post Form Textarea': [true, 'Expands the post form text area when in use.'],
'Fit Width Replies': [true, 'Replies fit the entire width of the page.'],
'Page Margin': ['fully centered', 'Additional layout options, allowing you to center the page or use additional page margins. Disabling the sidebar will cause this option to affect both sides of the page, essentially centering the page content with all options.', ['none', 'small', 'medium', 'large', 'fully centered']],
'Reply Spacing': ['small', 'The amount of space between replies.', ['none', 'small', 'medium', 'large']],
'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.', ['normal', 'large', 'hide']]
}
},
theme: 'Yotsuba B',
styleenabled: '0',
navigation: {}
};
Conf = {};
userThemes = {};
editTheme = {};
userMascots = {};
editMascot = {};
editMode = false;
enabledmascots = {};
d = document;
g = {};
Emoji = [['Neko', 'BMAAAARCAMAAAAIRmf1AAACoFBMVEUAAABnUFZoUVddU1T6+PvFwLzn4eFXVlT/+vZpZGCgm5dKU1Cfnpz//flbWljr5uLp5OCalpNZWFb//f3r6+n28ff9+PRaVVH59Pr//vr38vj57/Dp7eyjn5zq8O5aVVJbYV9nVFhjUFRiWFlZVlFgZGOboJzm5uZhamfz9/bt8fDw6+drb26bl5j/8/lkX1z06uldWFS5r61UT0tfWlbDwr3Ew76moqNRTU7Mx8P75OpeY19pWl1XW1qzr6x5eHaLiojv7+1UT0xIU0uzqadVS0nV0MxkZGT5+PPk497///ra29Xq5eFtY2H28e2hnJignJlUUE1dXV2vrqxkY2FkYF/m3d5vZmfDuruhl5aZlJHx8O75+PZWVVP29vT/9fTj3trv6ubh5eRdXFqTkpBOTUtqZmX88/RMQ0T78vPEvr7HwcHDwsDq6ef///3Gx8H++fXEv7tZWVedmZZXXVudnJp0c3FZU1f79fnb1dlXUVVjXWFrZmy8t7359/qLj455e3q4s69vamZjX1zy4+avpaReWFz/+f1NR0vu6Ozp4+f48/lnYmi8ur3Iw7/69fHz7+xbV1SZmJZVUk1ZV1zq5ez++f/c196uqbDn4uj9+P7z7vRVVVXt6ORiXl/OycXHw8CPi4ihoJ5aWF3/+v/k3+axrLOsp67LzMZYU1m2sq9dWF5WUU1WUk/Au7eYlJGqpqObmphYVV749f7p5Or38fPu6OpiXFz38fH79vLz7urv6+hhYF5cWWKal6D//f/Z09Xg29exraqbl5RqaW6kpKTq5uPv7Of/+PDj29D//vP18Ozs5+OloJymoZ1ZVVJZWVlkYF2hnpmblIyspJmVjYKQi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O48AQp0AP5UAQpoARJwAQ58ARaAAQZgAQ54AQ50AQpgARaIARqMARaMARaIAR6QARaIARaEASakARKEAR6MASqsARKEASKcAR6MARqYAR6UATbEATa8ARqUARKAAR6oARqMASKgATK8AR6QATbIATbAASq0AR6cASKgASqwAR6UASKcATa8ASqoASqwAS6wASKoAS60ATbHn4CTpAAAAhHRSTlMAAQIFBQUGCQoLDxAREhMUFBUYGhobHB0eHh8gIiIjJCQkJCYoLC0xMTE0NDo6Oz1BQUNHSUxOVFVVVldaWl5iY2RkZWZoamtsb3FycnR1ent9f4KDhIiJioyNkJGYm5+foqOkpqamqKmqrKytsLKzs7e4uLy8v8TFxcXGx8rO0NXY2eZc4XYcAAAA00lEQVR4XkWN1VoCUQAG/3NWtwh7CTsQJOyk7BaDxuxA6bbrxf32gt25m7kZqDRYxziooDV7+1AalMUavQh2AsEZoWvzigLun+T17/c8QiJZ7qu2QKiNmyZthdcR1/as353jIeU1GxMHo5XHdqPFeX8IaDMdHPYN6dRN7LR4qQewdTa35HWkyh+fbxERAMjwlAWJv3CPSKDQ+H7XvHdkV4Pua3Gtm4sPKIF/WV8dop4VKBw/NU33B3x1JbTt+XwhkJQoqRfWvHOy28uqH8JIdomR/R+s9yR3Cso77AAAAABJRU5ErkJggg=='], ['Ubuntu', 'BAAAAAQCAMAAAAoLQ9TAAABKVBMVEX////ojFzplGf1zbnqnHLvs5P10b3yuZv1xKrytZXvtJXys5LysI32waT0n3HxiVHwg0jxhk31kFn0h0zxf0P0hUrveTv2iU3yfkD1hEfyejv5eDLybSX0aR7zZxvyayH6ZxnxZBj4YhH7XAb5WALlUQLeTwHgUAHeTgHfTwD65NzdTQDdTQHdTgD31MfcTgLcTADcTQD////xt5/31Mf54dfmfE/dUAbeVQ/jcUDcTgHeWBnnflHohFvpjGbqkGztnX342Mz53dLgXiP65d399PHdUgrtoYLyu6Xzvaf76eLfXB/rkm/fWhvupojwrpTeVhTgYSfgYynzwa30xbL1ybnngFT31snngljhZS3539XhZz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Idm4TQ6Cq4RmYB02CwZAlB2ByBkHEVYhYcEmEreNZl4F+/C8F0+0vE2x1IL3qDsDgZhKg5Bt7ULAgHa+HVzlt4v7MHMQyHpM8LrlQzuNdaIfJCub+R0Z5DfNrAxsJAEHJbhXhue5nQJmS3t2D73S6suVK5XBKiYQMs4B3xSEbZ83xTc3ljq5eMmNts5/3d82/8jicQDc0Cbo8BjiVyQsez4rYkeNRzfqfadUYgEJBRFCVRKBQS0tTUSM7BxaauUelyenwunnZ+SnhXDkKG0EGgb+5g4p5dpa5TFEkk1bmfQSu8/TfTXs+Z8UbptgAAAABJRU5ErkJggg==']];
Themes = {
'AppChan': {
'Author': 'Zixaphir',
'Author Tripcode': '!..NoTrip..',
'Background Image': '',
'Background Attachment': '',
'Background Position': '',
'Background Repeat': '',
'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)',
'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)',
'Checkbox Checked Background': 'rgba(17,17,17,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': 'rbg(102,136,170)',
'Shadow Color': 'rgba(44,44,44,0.4)',
'Dark Theme': '1',
'Custom CSS': ''
},
'BakaBT': {
'Author': 'seaweed-chan',
'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)',
'Checkbox Checked Background': 'rgba(188,192,212,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': 'rbg(133,76,158)',
'Shadow Color': 'rgba(128,128,128,0.5)',
'Dark Theme': '0',
'Custom CSS': '#delform{ box-shadow: 0px 10px 10px 2px rgba(128,128,128,0.5); border-radius: 3px;padding:10px;}#options.reply.dialog,#options .dialog{background-color:#FFF;color:#000;border:2px solid #CCC;border-radius:6px;}#options ul{border-bottom:1px solid #DBD8D2;border-radius: 0px;}#options ul:last-of-type{border:none;}#qp div.post{background-color:rgba(255,255,255,0.9);border:1px solid #D1A2FF;color:#000;}'
},
'Blackberry Jam': {
'Author': 'seaweed-chan',
'Author Tripcode': '!POMF.9waa',
'Background Image': '',
'Background Attachment': '',
'Background Position': '',
'Background Repeat': '',
'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)',
'Checkbox Checked Background': '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': 'rbg(103,204,232)',
'Shadow Color': 'rgba(29,31,33,1)',
'Dark Theme': '1',
'Custom CSS': 'div.reply {box-shadow: inset 0px 1px 2px 1px #111;}#qr {box-shadow: none;}#qr textarea, #qr input[name="name"], #qr input[name="email"], #qr input[name="sub"], #qr input[title="Verification"] {box-shadow: inset 0px 1px 2px 0px #111;}#qp div.post {background-color: rgba(29,29,33,1); border: 1px solid rgba(95,137,172,0.4);}input:checked .rice { background: url("http://i.imgur.com/CAewG.png"); }'
},
'Midnight Caek': {
'Author': 'Zixaphir',
'Author Tripcode': '!M.........',
'Background Image': '',
'Background Attachment': '',
'Background Position': '',
'Background Repeat': '',
'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)',
'Checkbox Checked Background': '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(66,66,71)',
'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': 'rbg(87,87,123)',
'Shadow Color': 'rgba(16,16,16,0.4)',
'Dark Theme': '1',
'Custom CSS': ''
},
'Minimalistic Mayhem': {
'Author': 'Mayhem',
'Author Tripcode': '!MayhemYDG.',
'Background Image': 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAAXNSR0IArs4c6QAAACdJREFUCNdNxzEBADAMwzCnOMwfWYDs2JNPCgCoH9m0zQa4jXob4AGJFwxchPNwQAAAAABJRU5ErkJggg==")',
'Background Attachment': '',
'Background Position': '',
'Background Repeat': '',
'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)',
'Checkbox Checked Background': 'rgba(57,57,57,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': 'rbg(87,87,123)',
'Shadow Color': 'rgba(16,16,16,0.4)',
'Dark Theme': '1',
'Custom CSS': '.nameBlock>.useremail>postertrip{color: rgb(137,115,153);}a.backlink:hover{color: rgb(198,23,230);}.reply:target,.reply.highlight:target{background:rgb(37,38,42);}[alt="sticky"]+a{color: rgb(242,141,0);}[alt="closed"]+a{color: rgb(178,171,130);}input:checked .rice{border-color:rgb(21,21,21)}}input[type="submit"], input[type="button"], button {background: linear-gradient(#393939, #292929);border: 1px solid #191919;color: #AAA;text-shadow: 0 1px 1px #191919;}input[type="checkbox"], input[type="radio"] {background-color: #393939;border: 1px solid #191919;}input[type="checkbox"]:checked, input[type="radio"]:checked {background: linear-gradient(#595959, #393939);border: 1px solid #151515;} #delform { padding: 7px; }.subject:hover,div.post:hover .subject{color: #3F8DBF !important;}.postertrip:hover,div.post:hover .postertrip{color:#CC7212 !important;}.name:hover, div.post:hover .name { color: #0AAEE7 !important;}.name,.subject,.postertrip {-webkit-transition:color .3s ease-in-out;-moz-transition:color .3s ease-in-out;}'
},
'ObsidianChan': {
'Author': 'seaweed-chan',
'Author Tripcode': '!POMF.9waa',
'Background Image': 'url("http://i.imgur.com/sbi8u.png")',
'Background Attachment': 'fixed',
'Background Position': '',
'Background Repeat': '',
'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)',
'Checkbox Checked Background': 'rgba(255,0,127,1)',
'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(253,254,255)',
'Text': 'rgb(253,254,255)',
'Quotelinks': 'rgb(212,212,212)',
'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': 'rbg(0,255,255)',
'Shadow Color': 'rgba(44,44,44,0.4)',
'Dark Theme': '1',
'Custom CSS': '#qp div.post{background-color:rgba(0,0,0,0.8);border-radius:4px;border: 1px solid #333;}#qr {background-color: rgba(0,0,0,0.7);border: 1px solid #333;}'
},
'PaisleyChan': {
'Author': 'Ubuntufriend',
'Author Tripcode': '!TRip.C0d3',
'Background Image': 'url(http://i.imgur.com/DRaZf.jpg)',
'Background Attachment': 'fixed',
'Background Position': '',
'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)',
'Checkbox Checked Background': 'rgba(34,34,34,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': 'rbg(187,187,187)',
'Shadow Color': 'rgba(20,20,20,0.9)',
'Dark Theme': '1',
'Custom CSS': '#options{background-color: rgba(16,16,16,1) !important;}#delform blockquote {border-radius:3px;color:#bbb;background:#343838;padding:8px;box-shadow:0px 0px 20px rgba(25,25,25,0.6);border:1px solid #343838;border-bottom:2px solid #444848;border-radius:0px 6px 6px 6px;padding-top:15px;}.name {font-weight:800;}.nameBlock > .useremail > .name:hover,.nameBlock> .useremail> .postertrip:hover {color:#00dffc;}a.forwardlink {color:#608cae;font-weight:800;}div.reply,.reply.highlight{padding:0;}#qp div.post{border:1px solid rgba(128,172,206,0.5) !important;background-color:rgba(24,24,24,0.9) !important;}.name,.postertrip {text-shadow:0px 0px 6px rgba(20,20,20,0.9);font-weight:bold;background:#343838;border:1px solid #343838;border-radius:5px 5px 0px 0px;padding:4px 6px;padding-top:2px;}#delform,#delform blockquote {margin:0 10px 15px 0 !important;padding:0px;}a{-moz-transition:all 0.5s ease;-webkit-transition:all 0.5s ease;-o-transition:all 0.5s ease;}a.pointer{font-weight:bold;font-weight:normal;color:#777;padding-right:5px;}#delform .opContainer,#delform .replyContainer {opacity:0.45;-moz-transition:all 0.5s ease;-webkit-transition:all 0.5s ease;-o-transition:all 0.5s ease;}#delform .opContainer:hover,#delform .replyContainer:hover{opacity:1;}.reply,.reply.highlight{background:transparent;border:0px;padding:0px;padding-bottom:0px;border-radius:6px;}#delform blockquote{padding:5px;background:#343838;margin-top:0px;min-height:20px;padding-top:10px;clear:none;}#delform .file + blockquote{margin-top:-16px !important;padding-left:150px !important;}a.backlink{border:1px solid #343838;border-radius:5px 5px 0px 0px;background:#343838;padding:2px 4px 2px;text-decoration:none;}a.forwardlink{color:#608CAE;text-shadow:0 0 6px rgba(96,140,174,0.8);}.subject{font-weight: bold;letter-spacing: 3px;background: transparent;}div.reply,div.reply.highlight {background-color: rgba(0,0,0,0) !important;border: none !important;}#qp div.post .name,#qp div.post a.backlink,#qp div.post blockquote {background:none !important;border:none !important;box-shadow:none !important;border-radius:0px; !important}'
},
'Photon': {
'Author': 'seaweed-chan',
'Author Tripcode': '!POMF.9waa',
'Background Image': '',
'Background Attachment': '',
'Background Position': '',
'Background Repeat': '',
'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)',
'Checkbox Checked Background': 'rgba(188,192,212)',
'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': 'rbg(51,51,51)',
'Shadow Color': 'rgba(128,128,128,0.5)',
'Dark Theme': '0',
'Custom CSS': '.fileText{color: rgb(102,102,102);}#qp div.post{background-color:rgba(21,21,21,0.8);color:#FFF;border:1px solid rgba(0,0,0,1);}#qp div.post .subject,#qp div.post .name,#qp div.post .container a,#qp div.post .postNum a{color:#FFF;}#qp div.post .postertrip{color:#999;}#qp div.post .fileText{color:#999;}span.quote > a.quotelink{color: #ff6600;}'
},
'RedUX': {
'Author': 'Zixaphir',
'Author Tripcode': '!VGsTHECURE',
'Background Image': 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAACEAQMAAABrihHkAAAABlBMVEX///8AAABVwtN+AAAAAnRSTlMASuCaZbYAAAA+SURBVHhe7c2xCQAgDAXRKywsHcFRdDNxchtBkhHk4Lp88ui7hhaztBCkyYZ7fFHzI/Jk/GRpaWlpaWlpaR3scHNQSY3kigAAAABJRU5ErkJggg=="), radial-gradient(rgb(190,0,0), rgb(15,0,0))',
'Background Attachment': 'scroll, fixed',
'Background Position': 'center, center',
'Background Repeat': 'repeat, no-repeat',
'Background Color': 'rgba(0,0,0,0,1)',
'Thread Wrapper Background': 'linear-gradient(rgb(220,210,210), rgb(240,240,240) 400px, rgb(240,240,240))',
'Thread Wrapper Border': 'rgba(0,0,0,0)',
'Dialog Background': 'rgba(238,242,255,1)',
'Dialog Border': 'rgba(238,242,255,1)',
'Reply Background': 'rgba(240,240,240,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': 'rgba(255,255,255,1)',
'Input Border': 'rgba(255,255,255,1)',
'Hovered Input Background': 'rgba(214,186,208,1)',
'Hovered Input Border': 'rgba(214,186,208,1)',
'Focused Input Background': 'rgba(255,255,255,1)',
'Focused Input Border': 'rgba(153,136,238,1)',
'Checkbox Background': 'rgba(238,242,255,1)',
'Checkbox Checked Background': 'rgba(188,192,212,1)',
'Checkbox Border': 'rgba(153,51,51,1)',
'Buttons Background': 'rgba(255,255,255,1)',
'Buttons Border': 'rgba(255,255,255,1)',
'Navigation Background': 'rgba(0,0,0,0.7)',
'Navigation Border': 'rgba(0,0,0,0.7)',
'Quotelinks': 'rgb(153,51,51)',
'Backlinks': 'rgb(153,51,51)',
'Links': 'rgb(87,87,123)',
'Hovered Links': 'rgb(221,0,0)',
'Navigation Links': 'rgb(238,187,204)',
'Hovered Navigation Links': 'rgb(255,119,119)',
'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(120,153,34)',
'Sage': 'rgb(87,87,123)',
'Board Title': 'rgb(238,187,204)',
'Timestamps': 'rgb(0,0,0)',
'Warnings': 'rbg(87,87,123)',
'Shadow Color': 'rgba(60,60,60,0.6)',
'Dark Theme': '1',
'Custom CSS': '.replyContainer > .reply {background-color: transparent; border: 0; border-bottom: 1px #ccc solid;} #qp div.post { background-color: rgba(0,0,0,0.7); border-color: rgba(0,0,0,0.7); } #qp div.post, #qp .postNum a { color: #fcd; } #qp .nameBlock > .useremail > .name, #qp .nameBlock > .useremail > .postertrip, #qp .name, #qp .postertrip, #qp .trip { color: #ffaac0; } #qp a { color: #aaaac8; } .boardBanner a, #qp a.backlink, #qp span.quote > a.quotelink { color: rgb(255,255,255); } #updater:not(:hover), #updater:not(:hover) #count:not(.new)::after, #stats { color: rgb(123,123,123); } .boardBanner {color: rgb(238,187,204)} .boardTitle { text-shadow: 1px 1px 1px #222; } #delform { padding: 1px 15px 2px 15px; box-shadow: 0 20px 15px 20px rgba(0,0,0,0.7); border-radius: 4px; }'
},
'Solarized': {
'Author': 'ubuntufriend',
'Author Tripcode': '!TRip.C0d',
'Background Image': '',
'Background Attachment': '',
'Background Position': '',
'Background Repeat': '',
'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)',
'Checkbox Checked Background': 'rgba(17,17,17,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': 'rbg(108,113,196)',
'Shadow Color': 'rgba(0,0,0,0.4)',
'Dark Theme': '1',
'Custom CSS': '#qp div.post{background-color:rgba(7,54,66,0.9);border:1px solid rgba(79,95,143,0.9);}'
},
'Yotsuba': {
'Author': 'moot',
'Author Tripcode': '!Ep8pui8Vw2',
'Background Image': 'linear-gradient(rgb(254,214,175), rgb(255,255,238) 200px, rgb(255,255,238))',
'Background Attachment': '',
'Background Position': '',
'Background Repeat': '',
'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)',
'Checkbox Checked Background': 'rgba(255,255,238,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': 'rbg(128,0,0)',
'Shadow Color': 'rgba(119,46,40,1)',
'Dark Theme': '0',
'Custom CSS': '#qp div.post{background-color:rgba(240,192,176,1);box-shadow:5px 5px 5px rgba(128,128,128,0.5);}'
},
'Yotsuba B': {
'Author': 'moot',
'Author Tripcode': '!Ep8pui8Vw2',
'Background Image': 'linear-gradient(rgb(209,213,238), rgb(238,242,255) 200px, rgb(255,255,238))',
'Background Attachment': '',
'Background Position': '',
'Background Repeat': '',
'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)',
'Checkbox Background': 'rgba(238,242,255,1)',
'Checkbox Border': 'rgba(183,197,217,1)',
'Checkbox Checked Background': 'rgba(188,192,212,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': 'rbg(87,87,123)',
'Shadow Color': 'rgba(128,128,128,0.5)',
'Dark Theme': '0',
'Custom CSS': '#qp div.post{background-color:rgba(214,186,208,1);box-shadow:5px 5px 5px rgba(128,128,128,0.5);}'
},
'Zenburned': {
'Author': 'lazy',
'Author Tripcode': '!HONKYn7h1.',
'Background Image': '',
'Background Attachment': '',
'Background Position': '',
'Background Repeat': '',
'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)',
'Checkbox Checked Background': 'rgba(17,17,17,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': 'rbg(239,220,188)',
'Shadow Color': 'rgba(63,63,63,0.4)',
'Dark Theme': '1',
'Custom CSS': ''
}
};
Mascots = {
'Akiyama_Mio': {
category: 'SFW',
image: 'http://i.imgur.com/MdE9K.png',
big: true
},
'Akiyama_Mio_2': {
category: 'SFW',
image: 'http://i.imgur.com/pBuG2.png',
big: true
},
'Akiyama_Mio_3': {
category: 'SFW',
image: 'http://i.imgur.com/s3ffU.png'
},
'Akiyama_Mio_sitting': {
category: 'SFW',
image: 'http://i.imgur.com/0x4Rr.png'
},
'Anime_Girl_in_Bondage': {
category: 'NSFW',
image: 'http://i.imgur.com/B3h3c.png'
},
'Anime_Girl_in_Bondage_2': {
category: 'NSFW',
image: 'http://i.imgur.com/1TUjP.png',
big: true
},
'Applejack': {
category: 'MLP',
image: 'http://i.imgur.com/1ufSL.png'
},
'Asuka_Langley_Soryu': {
category: 'SFW',
image: 'http://i.imgur.com/Wj7s7.png'
},
'Asuka_Langley_Soryu_2': {
category: 'SFW',
image: 'http://i.imgur.com/FMbEx.png'
},
'Asuka_Langley_Soryu_3': {
category: 'SFW',
image: 'http://i.imgur.com/qunYm.png'
},
'Asuka_Langley_Soryu_4': {
category: 'SFW',
image: 'http://i.imgur.com/MvYCD.png'
},
'Asuka_Langley_Soryu_5': {
category: 'NSFW',
image: 'http://i.imgur.com/1rDfl.png'
},
'Ayanami_Rei': {
category: 'SFW',
image: 'http://i.imgur.com/Ye6OS.png'
},
'Ayase_Yue': {
category: 'NSFW',
image: 'http://i.imgur.com/i2MT8.png',
big: true
},
'Ayase': {
category: 'SFW',
image: 'http://i.imgur.com/4Ehza.png'
},
'Ayase_2': {
category: 'SFW',
image: 'http://i.imgur.com/48nYb.png'
},
'BLACK_ROCK_SHOOTER': {
category: 'SFW',
image: 'http://i.imgur.com/VidKo.png'
},
'Blue_Rose': {
category: 'SFW',
image: 'http://i.imgur.com/q5RwP.png'
},
'Brioche_d_Arquien': {
category: 'SFW',
image: 'http://i.imgur.com/rxTsB.png'
},
'CC': {
category: 'SFW',
image: 'http://i.imgur.com/Ir1v3.png'
},
'CC2': {
category: 'NSFW',
image: 'http://i.imgur.com/AU1H8.png'
},
'Chie': {
category: 'SFW',
image: 'http://i.imgur.com/E3ge5.png'
},
'Cirno': {
category: 'NSFW',
image: 'http://i.imgur.com/q735W.png'
},
'Cirno_2': {
category: 'SFW',
image: 'http://i.imgur.com/dLrCn.png'
},
'Dawn_Hikari': {
category: 'SFW',
image: 'http://i.imgur.com/lxLdH.png'
},
'Doppleganger': {
category: 'SFW',
image: 'http://i.imgur.com/w3GwS.png',
bottom: '0',
big: true
},
'Dragonkid': {
category: 'SFW',
image: 'http://i.imgur.com/tEoVT.png'
},
'Dragonkid_2': {
category: 'SFW',
image: 'http://i.imgur.com/3tIpW.png'
},
'Eclair': {
category: 'SFW',
image: 'http://i.imgur.com/DEh76.png'
},
'Erio_Touwa': {
category: 'NSFW',
image: 'http://i.imgur.com/zhPlM.png',
big: true
},
'Evangeline_AK_McDowell': {
category: 'SFW',
image: 'http://i.imgur.com/cRhjg.png'
},
'Fluttershy': {
category: 'MLP',
image: 'http://i.imgur.com/x88ZT.png'
},
'Fluttershy_2': {
category: 'MLP',
image: 'http://i.imgur.com/hokhQ.png'
},
'Fluttershy_Cutiemark': {
category: 'MLP',
image: 'http://i.imgur.com/vBqiB.png'
},
'Fujiwara_no_Mokou': {
category: 'SFW',
image: 'http://i.imgur.com/NaKmF.png',
big: true
},
'Furudo_Erika': {
category: 'SFW',
image: 'http://i.imgur.com/zLsPY.png'
},
'Gally': {
category: 'SFW',
image: 'http://i.imgur.com/PJSjp.png',
bottom: '0'
},
'Gasai_Yuno': {
category: 'SFW',
image: 'http://i.imgur.com/iG1F2.png',
big: true
},
'Gasai_Yuno_2': {
category: 'NSFW',
image: 'http://i.imgur.com/XI0DZ.png'
},
'George_Costanza': {
category: 'SFW',
image: 'http://i.imgur.com/Nnsrf.png'
},
'Golden_Darkness': {
category: 'NSFW',
image: 'http://i.imgur.com/lYGo4.png',
bottom: '0',
big: true
},
'Hanako': {
category: 'SFW',
image: 'http://i.imgur.com/G3iN7.png'
},
'Hasekura_Youko': {
category: 'SFW',
image: 'http://i.imgur.com/qTQqY.png'
},
'Hatsune_Miku': {
category: 'NSFW',
image: 'http://i.imgur.com/lKQHW.png'
},
'Hatsune_Miku_2': {
category: 'NSFW',
image: 'http://i.imgur.com/ULksz.png'
},
'Hatsune_Miku_3': {
category: 'SFW',
image: 'http://i.imgur.com/H1pgZ.png',
bottom: '0'
},
'Hatsune_Miku_4': {
category: 'SFW',
image: 'http://i.imgur.com/vE3FJ.png'
},
'Hatsune_Miku_5': {
category: 'SFW',
image: 'http://i.imgur.com/yCB6B.png',
big: true
},
'Hatsune_Miku_6': {
category: 'SFW',
image: 'http://i.imgur.com/DKGQb.png'
},
'Hatsune_Miku_7': {
category: 'NSFW',
image: 'http://i.imgur.com/vc7rU.png'
},
'Hirasawa_Yui': {
category: 'SFW',
image: 'http://i.imgur.com/sL1Uo.png'
},
'Homura_Akemi': {
category: 'SFW',
image: 'http://i.imgur.com/b9KmB.png',
big: true
},
'Horo': {
category: 'NSFW',
image: 'http://i.imgur.com/6f8wd.png',
bottom: '0'
},
'Horo_2': {
category: 'NSFW',
image: 'http://i.imgur.com/KJLui.png'
},
'Horo_3': {
category: 'Silhouette',
image: 'http://i.imgur.com/HMpug.png'
},
'Horo_4': {
category: 'Silhouette',
image: 'http://i.imgur.com/PKfl4.png'
},
'Horo_5': {
category: 'Silhouette',
image: 'http://i.imgur.com/BjV3U.png'
},
'Horo_6': {
category: 'Silhouette',
image: 'http://i.imgur.com/8fcrD.png'
},
'Ika_Musume': {
category: 'SFW',
image: 'http://i.imgur.com/rKT7L.png'
},
'Ika_Musume_2': {
category: 'SFW',
image: 'http://i.imgur.com/uUhGG.png'
},
'Ika_Musume_3': {
category: 'NSFW',
image: 'http://i.imgur.com/PeckP.png'
},
'Inori': {
category: 'SFW',
image: 'http://i.imgur.com/u4zuy.png',
big: true
},
'Iwakura_Lain': {
category: 'SFW',
image: 'http://i.imgur.com/AfjG9.png'
},
'Iwakura_Lain_2': {
category: 'SFW',
image: 'http://i.imgur.com/hIBLa.png'
},
'KOn_Girls': {
category: 'SFW',
image: 'http://i.imgur.com/Sc1Pa.png'
},
'Kagamine_Rin': {
category: 'SFW',
image: 'http://i.imgur.com/fXXd2.png'
},
'Kagari_Izuriha': {
category: 'SFW',
image: 'http://i.imgur.com/coMey.png',
big: true
},
'Kaname_Madoka': {
category: 'SFW',
image: 'http://i.imgur.com/4PHsl.png'
},
'Karina': {
category: 'SFW',
image: 'http://i.imgur.com/5oPTS.png'
},
'Kigurumi_Harokitei': {
category: 'SFW',
image: 'http://i.imgur.com/4JV1K.png'
},
'Kinomoto_Sakura': {
category: 'SFW',
image: 'http://i.imgur.com/Ve0hl.png'
},
'Kinomoto_Sakura_2': {
category: 'NSFW',
image: 'http://i.imgur.com/Rdk9s.png'
},
'Kirino_Kosaka_and_Ruri_Goko': {
category: 'NSFW',
image: 'http://i.imgur.com/MGaLr.png'
},
'Koiwai_Yotsuba': {
category: 'SFW',
image: 'http://i.imgur.com/1MyDM.png'
},
'Koko': {
category: 'SFW',
image: 'http://i.imgur.com/QMDHh.png'
},
'Kotobuki_Tsumugi': {
category: 'SFW',
image: 'http://i.imgur.com/fzhbH.png'
},
'Kurisu_Makise': {
category: 'SFW',
image: 'http://i.imgur.com/HKnLt.png',
big: true
},
'Kyouko_Sakura': {
category: 'SFW',
image: 'http://i.imgur.com/78HS9.png'
},
'Kyubee': {
category: 'SFW',
image: 'http://i.imgur.com/PW5gt.png',
big: true
},
'Kyubee_2': {
category: 'SFW',
image: 'http://i.imgur.com/fuTo9.png'
},
'Leonmitchelli': {
category: 'SFW',
image: 'http://i.imgur.com/KkOsZ.png'
},
'Li_Syaoran': {
category: 'SFW',
image: 'http://i.imgur.com/GySuy.png',
big: true
},
'Link': {
category: 'SFW',
image: 'http://i.imgur.com/OyTWU.png'
},
'Lizardgirl': {
category: 'SFW',
image: 'http://i.imgur.com/R8zzn.png',
bottom: '0',
big: true
},
'Luka': {
category: 'SFW',
image: 'http://i.imgur.com/WUIMw.png',
bottom: '0',
big: true
},
'Madotsuki': {
category: 'SFW',
image: 'http://i.imgur.com/J1i26.png',
bottom: '0',
big: true
},
'Makoto': {
category: 'SFW',
image: 'http://i.imgur.com/H2Nmv.png'
},
'Mantis': {
category: 'SFW',
image: 'http://i.imgur.com/kQs3e.png',
big: true
},
'Megurine_Luka': {
category: 'SFW',
image: 'http://i.imgur.com/BxybK.png'
},
'Mei_Sunohara': {
category: 'SFW',
image: 'http://i.imgur.com/zZ5pE.png'
},
'Millefiori': {
category: 'SFW',
image: 'http://i.imgur.com/Ygq8D.png'
},
'Millefiori_2': {
category: 'SFW',
image: 'http://i.imgur.com/00gF5.png'
},
'Millefiori_3': {
category: 'SFW',
image: 'http://i.imgur.com/bl7RT.png'
},
'Misaki_Mei': {
category: 'SFW',
image: 'http://i.imgur.com/zVKmv.png'
},
'Mizunashi_Akari': {
category: 'SFW',
image: 'http://i.imgur.com/LF8wU.png'
},
'Motoko': {
category: 'SFW',
image: 'http://i.imgur.com/FZD2l.png'
},
'Nagato_Yuki': {
category: 'SFW',
image: 'http://i.imgur.com/ucnzg.png'
},
'Nagato_Yuki_2': {
category: 'SFW',
image: 'http://i.imgur.com/J2eZi.png'
},
'Nagato_Yuki_3': {
category: 'SFW',
image: 'http://i.imgur.com/sUSvI.png'
},
'Nagato_Yuki_4': {
category: 'SFW',
image: 'http://i.imgur.com/atnqf.png'
},
'Nagato_Yuki_5': {
category: 'NSFW',
image: 'http://i.imgur.com/2BUww.png',
bottom: '0'
},
'Nagato_Yuki_6': {
category: 'Silhouette',
image: 'http://i.imgur.com/uR35P.png'
},
'Nagato_Yuki_7': {
category: 'Silhouette',
image: 'http://i.imgur.com/aGFCl.png'
},
'Nagato_Yuki_8': {
category: 'Silhouette',
image: 'http://i.imgur.com/L9ZAT.png'
},
'Nagato_Yuki_9': {
category: 'Silhouette',
image: 'http://i.imgur.com/MwoI9.png'
},
'Nakano_Azusa': {
category: 'SFW',
image: 'http://i.imgur.com/6c3p3.png',
big: true
},
'Nichijou': {
category: 'SFW',
image: 'http://i.imgur.com/w5oaQ.png',
big: true
},
'Noir_VinoCacao': {
category: 'SFW',
image: 'http://i.imgur.com/VNbnm.png'
},
'Pinkie_Pie': {
category: 'MLP',
image: 'http://i.imgur.com/rY3w4.png'
},
'Pinkie_Pie_2': {
category: 'MLP',
image: 'http://i.imgur.com/zy6rO.png'
},
'Oshino_Shinobu': {
category: 'SFW',
image: 'http://i.imgur.com/UMq6v.png',
big: true
},
'Oshino_Shinobu_2': {
category: 'SFW',
image: 'http://i.imgur.com/ObCSS.png',
bottom: '0',
big: true
},
'Patchouli_Knowledge': {
category: 'SFW',
image: 'http://i.imgur.com/QoKJb.png'
},
'Patchouli_Knowledge_2': {
category: 'SFW',
image: 'http://i.imgur.com/dK9Pn.png'
},
'Pink_Doggy': {
category: 'SFW',
image: 'http://i.imgur.com/zv5BS.png'
},
'Pink_Hair': {
category: 'SFW',
image: 'http://i.imgur.com/1r1Vx.png'
},
'Pixie': {
category: 'NSFW',
image: 'http://i.imgur.com/KPGKl.png'
},
'Railgun': {
category: 'NSFW',
image: 'http://i.imgur.com/AEjIx.png'
},
'Railgun_2': {
category: 'SFW',
image: 'http://i.imgur.com/KD6s7.png'
},
'Railgun_3': {
category: 'SFW',
image: 'http://i.imgur.com/7wJEW.png',
big: true
},
'Railgun_4': {
category: 'SFW',
image: 'http://i.imgur.com/xM4rx.png'
},
'Rainbow_Dash': {
category: 'MLP',
image: 'http://i.imgur.com/Zf3eQ.png'
},
'Rarity': {
category: 'MLP',
image: 'http://i.imgur.com/Mbhf7.png'
},
'Revi': {
category: 'SFW',
image: 'http://i.imgur.com/Cn4nK.png',
bottom: '0'
},
'Ruri_Gokou': {
category: 'SFW',
image: 'http://i.imgur.com/Ht6dr.png',
bottom: '0'
},
'Ryuu': {
category: 'SFW',
image: 'http://i.imgur.com/LFUs2.png',
bottom: '0',
big: true
},
'Saber': {
category: 'NSFW',
image: 'http://i.imgur.com/6AIbD.png',
bottom: '0'
},
'Sakurazaki_Setsuna': {
category: 'NSFW',
image: 'http://i.imgur.com/QLChr.png',
big: true
},
'Samus_Aran': {
category: 'SFW',
image: 'http://i.imgur.com/34viJ.png'
},
'Seraphim': {
category: 'SFW',
image: 'http://i.imgur.com/PA7pJ.png'
},
'Shana': {
category: 'SFW',
image: 'http://i.imgur.com/JNS1z.png'
},
'Shana_2': {
category: 'SFW',
image: 'http://i.imgur.com/K1mLx.png'
},
'Shiki': {
category: 'SFW',
image: 'http://i.imgur.com/FKDcd.png',
big: true
},
'Shinji_and_Girls': {
category: 'SFW',
image: 'http://i.imgur.com/k5Dsb.png'
},
'Shinonome_Hakase': {
category: 'SFW',
image: 'http://i.imgur.com/TBHI6.png'
},
'Shirakiin_Ririchiyo': {
category: 'SFW',
image: 'http://i.imgur.com/cXsO6.png',
bottom: '0'
},
'Shirohibe': {
category: 'SFW',
image: 'http://i.imgur.com/mfNR3.png',
bottom: '0',
big: true
},
'Suruga_Kanbaru': {
category: 'SFW',
image: 'http://i.imgur.com/rgcAA.png'
},
'Suzumiya_Haruhi': {
category: 'SFW',
image: 'http://i.imgur.com/iVl5d.png'
},
'Suzumiya_Haruhi_2': {
category: 'SFW',
image: 'http://i.imgur.com/rW9Q6.png'
},
'Tardis': {
category: 'SFW',
image: 'http://goput.it/vig.png'
},
'Three_Wet_Girls': {
category: 'NSFW',
image: 'http://i.imgur.com/AbU8b.png'
},
'Tifa': {
category: 'NSFW',
image: 'http://i.imgur.com/SEKOZ.png'
},
'Tomozo_Kaoru': {
category: 'SFW',
image: 'http://i.imgur.com/awpTb.png'
},
'Twilight_Sparkle': {
category: 'MLP',
image: 'http://i.imgur.com/r5q9h.png'
},
'Udine': {
category: 'SFW',
image: 'http://i.imgur.com/2QkXW.png',
bottom: '0',
big: true
},
'Wanwan': {
category: 'NSFW',
image: 'http://i.imgur.com/CcyTm.png',
bottom: '0'
},
'White_Curious': {
category: 'SFW',
image: 'http://i.imgur.com/2FQfj.png'
},
'Yin': {
category: 'SFW',
image: 'http://i.imgur.com/haBSN.png',
big: true
},
'Yin_2': {
category: 'SFW',
image: 'http://i.imgur.com/3zj9M.png'
},
'Yuzuki_Yukari': {
category: 'SFW',
image: 'http://i.imgur.com/c8Lal.png'
},
'Yoko_Littner': {
category: 'SFW',
image: 'http://i.imgur.com/3goQm.png',
bottom: '0',
big: true
},
'Yoko_Littner_2': {
category: 'SFW',
image: 'http://i.imgur.com/Pj9i5.png',
bottom: '0'
},
'Yoko_Littner_3': {
category: 'SFW',
image: 'http://i.imgur.com/0S2WK.png',
bottom: '0'
},
'Yukkikaze': {
category: 'SFW',
image: 'http://i.imgur.com/EkUXJ.png'
},
'Yukkihaze_2': {
category: 'SFW',
image: 'http://i.imgur.com/oIKZb.png'
}
};
UI = {
dialog: function(id, position, html) {
var el, _ref;
el = d.createElement('div');
el.className = 'reply dialog';
el.innerHTML = html;
el.id = id;
el.style.cssText = localStorage.getItem("" + Main.namespace + id + ".position") || position;
if ((_ref = el.querySelector('.move')) != null) {
_ref.addEventListener('mousedown', UI.dragstart, false);
}
return el;
},
dragstart: function(e) {
var el, rect;
e.preventDefault();
UI.el = el = this.parentNode;
d.addEventListener('mousemove', UI.drag, false);
d.addEventListener('mouseup', UI.dragend, false);
rect = el.getBoundingClientRect();
UI.dx = e.clientX - rect.left;
UI.dy = e.clientY - rect.top;
UI.width = d.documentElement.clientWidth - rect.width;
return UI.height = d.documentElement.clientHeight - rect.height;
},
drag: function(e) {
var left, style, top;
left = e.clientX - UI.dx;
top = e.clientY - UI.dy;
left = left < 10 ? '0px' : UI.width - left < 10 ? null : left + 'px';
top = top < 10 ? '0px' : UI.height - top < 10 ? null : top + 'px';
style = UI.el.style;
style.left = left;
style.top = top;
style.right = left === null ? '0px' : null;
return style.bottom = top === null ? '0px' : null;
},
dragend: function() {
localStorage.setItem("" + Main.namespace + UI.el.id + ".position", UI.el.style.cssText);
d.removeEventListener('mousemove', UI.drag, false);
d.removeEventListener('mouseup', UI.dragend, false);
return delete UI.el;
},
hover: function(e) {
var clientHeight, clientWidth, clientX, clientY, height, style, top, _ref;
clientX = e.clientX, clientY = e.clientY;
style = UI.el.style;
_ref = d.documentElement, clientHeight = _ref.clientHeight, clientWidth = _ref.clientWidth;
height = UI.el.offsetHeight;
top = clientY - 120;
style.top = clientHeight <= height || top <= 0 ? '0px' : top + height >= clientHeight ? clientHeight - height + 'px' : top + 'px';
if (clientX <= clientWidth - 400) {
style.left = clientX + 45 + 'px';
return style.right = null;
} else {
style.left = null;
return style.right = clientWidth - clientX + 45 + 'px';
}
},
hoverend: function() {
$.rm(UI.el);
return delete UI.el;
}
};
/*
loosely follows the jquery api:
http://api.jquery.com/
not chainable
*/
$ = function(selector, root) {
if (root == null) {
root = d.body;
}
return root.querySelector(selector);
};
$.extend = function(object, properties) {
var key, val;
for (key in properties) {
val = properties[key];
object[key] = val;
}
};
$.extend($, {
NBSP: '\u00A0',
SECOND: 1000,
MINUTE: 1000 * 60,
HOUR: 1000 * 60 * 60,
DAY: 1000 * 60 * 60 * 24,
log: !console ? console = unsafeWindow.console : console,
engine: /WebKit|Presto|Gecko/.exec(navigator.userAgent)[0].toLowerCase(),
ready: function(fc) {
var cb;
if (/interactive|complete/.test(d.readyState)) {
return setTimeout(fc);
}
cb = function() {
$.off(d, 'DOMContentLoaded', cb);
return fc();
};
return $.on(d, 'DOMContentLoaded', cb);
},
sync: function(key, cb) {
return $.on(window, 'storage', function(e) {
if (e.key === ("" + Main.namespace + key)) {
return cb(JSON.parse(e.newValue));
}
});
},
id: function(id) {
return d.getElementById(id);
},
formData: function(arg) {
var fd, key, val;
if (arg instanceof HTMLFormElement) {
fd = new FormData(arg);
} else {
fd = new FormData();
for (key in arg) {
val = arg[key];
if (val) {
fd.append(key, val);
}
}
}
return fd;
},
ajax: function(url, callbacks, opts) {
var form, headers, key, r, type, upCallbacks, val;
if (opts == null) {
opts = {};
}
type = opts.type, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form;
r = new XMLHttpRequest();
r.overrideMimeType('text/html');
type || (type = form && 'post' || 'get');
r.open(type, url, true);
for (key in headers) {
val = headers[key];
r.setRequestHeader(key, val);
}
$.extend(r, callbacks);
$.extend(r.upload, upCallbacks);
r.send(form);
return r;
},
cache: function(url, cb) {
var req;
if (req = $.cache.requests[url]) {
if (req.readyState === 4) {
return cb.call(req);
} else {
return req.callbacks.push(cb);
}
} else {
req = $.ajax(url, {
onload: function() {
var _i, _len, _ref, _results;
_ref = this.callbacks;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
cb = _ref[_i];
_results.push(cb.call(this));
}
return _results;
},
onabort: function() {
return delete $.cache.requests[url];
},
onerror: function() {
return delete $.cache.requests[url];
}
});
req.callbacks = [cb];
return $.cache.requests[url] = req;
}
},
cb: {
checked: function() {
$.set(this.name, this.checked);
return Conf[this.name] = this.checked;
},
value: function() {
$.set(this.name, this.value.trim());
return Conf[this.name] = this.value;
}
},
addStyle: function(css, identifier) {
var style;
style = $.el('style', {
textContent: css,
id: identifier
});
$.add(d.head, style);
return style;
},
x: function(path, root) {
if (root == null) {
root = d.body;
}
return d.evaluate(path, root, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
},
X: function(path, root) {
if (root == null) {
root = d.body;
}
return d.evaluate(path, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
},
addClass: function(el, className) {
return el.classList.add(className);
},
rmClass: function(el, className) {
return el.classList.remove(className);
},
rm: function(el) {
return el.parentNode.removeChild(el);
},
tn: function(s) {
return d.createTextNode(s);
},
nodes: function(nodes) {
var frag, node, _i, _len;
if (!(nodes instanceof Array)) {
return nodes;
}
frag = d.createDocumentFragment();
for (_i = 0, _len = nodes.length; _i < _len; _i++) {
node = nodes[_i];
frag.appendChild(node);
}
return frag;
},
add: function(parent, children) {
return parent.appendChild($.nodes(children));
},
prepend: function(parent, children) {
return parent.insertBefore($.nodes(children), parent.firstChild);
},
after: function(root, el) {
return root.parentNode.insertBefore($.nodes(el), root.nextSibling);
},
before: function(root, el) {
return root.parentNode.insertBefore($.nodes(el), root);
},
replace: function(root, el) {
return root.parentNode.replaceChild($.nodes(el), root);
},
el: function(tag, properties) {
var el;
el = d.createElement(tag);
if (properties) {
$.extend(el, properties);
}
return el;
},
on: function(el, events, handler) {
var event, _i, _len, _ref;
_ref = events.split(' ');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
event = _ref[_i];
el.addEventListener(event, handler, false);
}
},
off: function(el, events, handler) {
var event, _i, _len, _ref;
_ref = events.split(' ');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
event = _ref[_i];
el.removeEventListener(event, handler, false);
}
},
event: function(el, e) {
return el.dispatchEvent(e);
},
globalEval: function(code) {
var script;
script = $.el('script', {
textContent: "(" + code + ")()"
});
$.add(d.head, script);
return $.rm(script);
},
shortenFilename: function(filename, isOP) {
var threshold;
threshold = 30 + 10 * isOP;
if (filename.replace(/\.\w+$/, '').length > threshold) {
return "" + filename.slice(0, threshold - 5) + "(...)" + (filename.match(/\.\w+$/));
} else {
return filename;
}
},
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];
},
RandomAccessList: (function() {
function _Class() {
this.first = null;
this.last = null;
this.length = 0;
}
_Class.prototype.push = function(id, el) {
var item, last;
last = this.last;
this[id] = item = {
prev: last,
next: null,
el: el,
id: id
};
this.last = item;
if (last) {
last.next = item;
} else {
this.first = item;
}
return this.length++;
};
_Class.prototype.shift = function() {
return this.rm(this.first.id);
};
_Class.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;
return next.prev = item;
};
_Class.prototype.rm = function(id) {
var item;
item = this[id];
if (!item) {
return;
}
delete this[id];
this.length--;
return this.rmi(item);
};
_Class.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 _Class;
})()
});
$.cache.requests = {};
$.extend($, typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null ? {
"delete": function(name) {
name = Main.namespace + name;
return GM_deleteValue(name);
},
get: function(name, defaultValue) {
var value;
name = Main.namespace + name;
if (value = GM_getValue(name)) {
return JSON.parse(value);
} else {
return defaultValue;
}
},
set: function(name, value) {
name = Main.namespace + name;
localStorage.setItem(name, JSON.stringify(value));
return GM_setValue(name, JSON.stringify(value));
},
open: function(url) {
return GM_openInTab(location.protocol + url, true);
}
} : {
"delete": function(name) {
return localStorage.removeItem(Main.namespace + name);
},
get: function(name, defaultValue) {
var value;
if (value = localStorage.getItem(Main.namespace + name)) {
return JSON.parse(value);
} else {
return defaultValue;
}
},
set: function(name, value) {
return localStorage.setItem(Main.namespace + name, JSON.stringify(value));
},
open: function(url) {
return window.open(location.protocol + url, '_blank');
}
});
$$ = function(selector, root) {
if (root == null) {
root = d.body;
}
return Array.prototype.slice.call(root.querySelectorAll(selector));
};
Options = {
init: function() {
var a, settings, _i, _len, _ref, _results;
if (!$.get('firstrun')) {
$.set('firstrun', true);
if (!Favicon.el) {
Favicon.init();
}
Options.dialog();
}
_ref = ['navtopright', 'navbotright'];
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
settings = _ref[_i];
a = $.el('a', {
href: 'javascript:;',
className: 'settingsWindowLink',
textContent: 'AppChan X Settings'
});
$.on(a, 'click', function() {
Options.dialog();
if (Conf['Style']) {
return Style.allrice();
}
});
_results.push($.prepend($.id(settings), [$.tn('['), a, $.tn('] ')]));
}
return _results;
},
dialog: function() {
var arr, back, batchmascots, category, checked, description, dialog, div, favicon, fileInfo, filter, hiddenNum, hiddenThreads, input, key, li, liHTML, mascot, name, obj, optionname, optionvalue, overlay, parentdiv, sauce, selectoption, styleSetting, theme, themename, time, tr, ul, _i, _len, _ref, _ref1, _ref2, _ref3;
dialog = $.el('div', {
id: 'options',
className: 'reply dialog',
innerHTML: '<div id=optionsbar>\
<div id=credits>\
<label for=apply>Apply</label>\
| <a target=_blank href=http://zixaphir.github.com/appchan-x/>AppChan X</a>\
| <a target=_blank href=https://raw.github.com/zixaphir/appchan-x/master/changelog>' + Main.version + '</a>\
| <a target=_blank href=http://zixaphir.github.com/appchan-x/#bug-report>Issues</a>\
</div>\
<div>\
<label for=main_tab>Main</label>\
| <label for=filter_tab>Filter</label>\
| <label for=sauces_tab>Sauce</label>\
| <label for=rice_tab>Rice</label>\
| <label for=keybinds_tab>Keybinds</label>\
| <label for=style_tab>Style</label>\
| <label for=theme_tab>Themes</label>\
| <label for=mascot_tab>Mascots</label>\
</div>\
</div>\
<hr>\
<div id=content>\
<input type=radio name=tab hidden id=main_tab checked>\
<div></div>\
<input type=radio name=tab hidden id=sauces_tab>\
<div>\
<div class=warning><code>Sauce</code> is disabled.</div>\
Lines starting with a <code>#</code> will be ignored.<br>\
You can specify a certain display text by appending <code>;text:[text]</code> to the url.\
<ul>These parameters will be replaced by their corresponding values:\
<li>$1: Thumbnail url.</li>\
<li>$2: Full image url.</li>\
<li>$3: MD5 hash.</li>\
<li>$4: Current board.</li>\
</ul>\
<textarea name=sauces id=sauces class=field></textarea>\
</div>\
<input type=radio name=tab hidden id=filter_tab>\
<div>\
<div class=warning><code>Filter</code> is disabled.</div>\
<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=mod>Admin/Mod</option>\
<option value=email>E-mail</option>\
<option value=subject>Subject</option>\
<option value=comment>Comment</option>\
<option value=country>Country</option>\
<option value=filename>Filename</option>\
<option value=dimensions>Image dimensions</option>\
<option value=filesize>Filesize</option>\
<option value=md5>Image MD5 (uses exact string matching, not regular expressions)</option>\
</select>\
</div>\
<input type=radio name=tab hidden id=rice_tab>\
<div>\
<div class=warning><code>Quote Backlinks</code> are disabled.</div>\
<ul>\
Backlink formatting\
<li><input name=backlink class=field> : <span id=backlinkPreview></span></li>\
</ul>\
<div class=warning><code>Time Formatting</code> is disabled.</div>\
<ul>\
Time formatting\
<li><input name=time class=field> : <span id=timePreview></span></li>\
<li>Supported <a href=http://en.wikipedia.org/wiki/Date_%28Unix%29#Formatting>format specifiers</a>:</li>\
<li>Day: %a, %A, %d, %e</li>\
<li>Month: %m, %b, %B</li>\
<li>Year: %y</li>\
<li>Hour: %k, %H, %l (lowercase L), %I (uppercase i), %p, %P</li>\
<li>Minutes: %M</li>\
<li>Seconds: %S</li>\
</ul>\
<div class=warning><code>File Info Formatting</code> is disabled.</div>\
<ul>\
File Info Formatting\
<li><input name=fileInfo class=field> : <span id=fileInfoPreview class=fileText></span></li>\
<li>Link (with original file name): %l (lowercase L, truncated), %L (untruncated)</li>\
<li>Original file name: %n (Truncated), %N (Untruncated)</li>\
<li>Spoiler indicator: %p</li>\
<li>Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)</li>\
<li>Resolution: %r (Displays PDF on /po/, for PDFs)</li>\
</ul>\
<div class=warning><code>Unread Favicon</code> is disabled.</div>\
Unread favicons<br>\
<select name=favicon>\
<option value=ferongr>ferongr</option>\
<option value=xat->xat-</option>\
<option value=Mayhem>Mayhem</option>\
<option value=Original>Original</option>\
</select>\
<span></span>\
</div>\
<input type=radio name=tab hidden id=keybinds_tab>\
<div>\
<div class=warning><code>Keybinds</code> are disabled.</div>\
<div>Allowed keys: Ctrl, Alt, Meta, a-z, A-Z, 0-9, Up, Down, Right, Left.</div>\
<table><tbody>\
<tr><th>Actions</th><th>Keybinds</th></tr>\
</tbody></table>\
</div>\
<input type=radio name=tab hidden id=style_tab>\
<div>\
<div class=warning><code>Style</code> is currently disabled. Please enable it in the Main tab to use styling options.</div>\
</div>\
<input type=radio name=tab hidden id=theme_tab>\
<div>\
<div class=warning><code>Style</code> is currently disabled. Please enable it in the Main tab to use theming options.</div></div>\
<input type=radio name=tab hidden id=mascot_tab>\
<div>\
<div class=warning><code>Style</code> is currently disabled. Please enable it in the Main tab to use mascot options.</div>\
</div>\
<input type=radio name=tab hidden onClick="javascript:location.reload(true)" id=apply>\
<div>Reloading page with new settings.</div>\
</div>'
});
_ref = Config.main;
for (key in _ref) {
obj = _ref[key];
ul = $.el('ul', {
textContent: key
});
for (key in obj) {
arr = obj[key];
checked = $.get(key, Conf[key]) ? 'checked' : '';
description = arr[1];
li = $.el('li', {
innerHTML: "<label><input type=checkbox name=\"" + key + "\" " + checked + "><span class=\"optionlabel\">" + key + "</span></label><span class=description>: " + description + "</span>"
});
$.on($('input', li), 'click', $.cb.checked);
$.add(ul, li);
}
$.add($('#main_tab + div', dialog), ul);
}
hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length;
li = $.el('li', {
innerHTML: "<button>hidden: " + hiddenNum + "</button> <span class=description>: Forget all hidden posts. Useful if you accidentally hide a post and have \"Show Stubs\" disabled."
});
$.on($('button', li), 'click', Options.clearHidden);
$.add($('ul:nth-child(2)', dialog), li);
filter = $('select[name=filter]', dialog);
$.on(filter, 'change', Options.filter);
sauce = $('#sauces', dialog);
sauce.value = $.get(sauce.name, Conf[sauce.name]);
$.on(sauce, 'change', $.cb.value);
(back = $('[name=backlink]', dialog)).value = $.get('backlink', Conf['backlink']);
(time = $('[name=time]', dialog)).value = $.get('time', Conf['time']);
(fileInfo = $('[name=fileInfo]', dialog)).value = $.get('fileInfo', Conf['fileInfo']);
$.on(back, 'input', $.cb.value);
$.on(back, 'input', Options.backlink);
$.on(time, 'input', $.cb.value);
$.on(time, 'input', Options.time);
$.on(fileInfo, 'input', $.cb.value);
$.on(fileInfo, 'input', Options.fileInfo);
favicon = $('select[name=favicon]', dialog);
favicon.value = $.get('favicon', Conf['favicon']);
$.on(favicon, 'change', $.cb.value);
$.on(favicon, 'change', Options.favicon);
_ref1 = Config.hotkeys;
for (key in _ref1) {
arr = _ref1[key];
tr = $.el('tr', {
innerHTML: "<td>" + arr[1] + "</td><td><input name=" + key + " class=field></td>"
});
input = $('input', tr);
input.value = $.get(key, Conf[key]);
$.on(input, 'keydown', Options.keybind);
$.add($('#keybinds_tab + div tbody', dialog), tr);
}
div = $.el('div', {
className: "suboptions"
});
_ref2 = Config.style;
for (category in _ref2) {
obj = _ref2[category];
ul = $.el('ul', {
textContent: category
});
for (optionname in obj) {
arr = obj[optionname];
description = arr[1];
if (arr[2] === 'text') {
li = $.el('li', {
innerHTML: "<label><span class=\"optionlabel\">" + optionname + "</span></label><span class=description>: " + description + "</span><input name=\"" + optionname + "\" style=\"width: 100%\"><br>"
});
styleSetting = $("input[name='" + optionname + "']", li);
styleSetting.value = $.get(optionname, Conf[optionname]);
$.on(styleSetting, 'change', $.cb.value);
$.on(styleSetting, 'change', Options.style);
} else if (arr[2]) {
liHTML = "<label><span class=\"optionlabel\">" + optionname + "</span></label><span class=description>: " + description + "</span><select name=\"" + optionname + "\"><br>";
_ref3 = arr[2];
for (optionvalue = _i = 0, _len = _ref3.length; _i < _len; optionvalue = ++_i) {
selectoption = _ref3[optionvalue];
liHTML = liHTML + ("<option value=\"" + selectoption + "\">" + selectoption + "</option>");
}
liHTML = liHTML + "</select>";
li = $.el('li', {
innerHTML: liHTML
});
styleSetting = $("select[name='" + optionname + "']", li);
styleSetting.value = $.get(optionname, Conf[optionname]);
$.on(styleSetting, 'change', $.cb.value);
$.on(styleSetting, 'change', Options.style);
} else {
checked = $.get(optionname, Conf[optionname]) ? 'checked' : '';
li = $.el('li', {
innerHTML: "<label><input type=checkbox name=\"" + optionname + "\" " + checked + "><span class=\"optionlabel\">" + optionname + "<span></label><span class=description>: " + description + "</span>"
});
$.on($('input', li), 'click', $.cb.checked);
}
$.add(ul, li);
}
$.add(div, ul);
}
$.add($('#style_tab + div', dialog), div);
Options.applyStyle(dialog, 'style_tab');
parentdiv = $.el('div', {
className: "suboptions"
});
for (themename in userThemes) {
theme = userThemes[themename];
if (!theme["Deleted"]) {
div = $.el('div', {
className: themename === Conf['theme'] ? 'selectedtheme replyContainer' : 'replyContainer',
id: themename,
innerHTML: "<div class='reply' style='position: relative; cursor: pointer; width: 100%; box-shadow: none !important; background-color:" + theme['Reply Background'] + "!important;border:1px solid " + theme['Reply Border'] + "!important;color:" + theme['Text'] + "!important'> <div class='rice' style='width: 12px;height: 12px;margin: 0 3px;vertical-align: middle;display: inline-block;background-color:" + theme['Checkbox Background'] + ";border: 1px solid " + theme['Checkbox Border'] + ";'></div> <span style='color:" + theme['Subjects'] + "!important; font-weight: 700 !important'> " + themename + "</span> <span style='color:" + theme['Names'] + "!important; font-weight: 700 !important'> " + theme['Author'] + "</span> <span style='color:" + theme['Sage'] + "!important'> (SAGE)</span> <span style='color:" + theme['Tripcodes'] + "!important'> " + theme['Author Tripcode'] + "</span> <time style='color:" + theme['Timestamps'] + "'> 20XX.01.01 12:00 </time> <a onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important&quot;)' style='color:" + theme['Post Numbers'] + "!important' href='javascript:;'>No.22772469</a> <a class=edit name='edit' onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important&quot;)' style='color:" + theme['Post Numbers'] + "!important' href='javascript:;'> [ edit theme ]</a> <a class=delete name='delete' onmouseout='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Post Numbers'] + "!important&quot;)' onmouseover='this.setAttribute(&quot;style&quot;,&quot;color:" + theme['Hovered Links'] + "!important&quot;)' style='color:" + theme['Post Numbers'] + "!important' href='javascript:;'> [ delete theme ]</a> <br> <blockquote>Post content is right here.</blockquote><h1 style='color: " + theme['Text'] + "'>Selected</h1></div>"
});
$.on(div, 'click', function() {
var currentTheme;
if (currentTheme = $.id(Conf['theme'])) {
$.rmClass(currentTheme, 'selectedtheme');
}
$.set('theme', this.id);
Conf['theme'] = this.id;
return $.addClass(this, 'selectedtheme');
});
$.on($('a.edit', div), 'click', function() {
ThemeOptions.init(this.name);
return Options.close();
});
$.on($('a.delete', div), 'click', function() {
var container, settheme;
container = this.parentElement.parentElement;
if (!(container.previousSibling || container.nextSibling)) {
alert("Cannot delete theme (No other themes available).");
return;
}
if (container.id === Conf['theme']) {
if (settheme = container.previousSibling) {
$.addClass(settheme, 'selectedtheme');
$.set('theme', settheme.id);
Conf['theme'] = settheme.id;
} else if (settheme = container.nextSibling) {
$.addClass(settheme, 'selectedtheme');
$.set('theme', settheme.id);
Conf['theme'] = settheme.id;
}
}
console.log(Conf['theme']);
userThemes[container.id]["Deleted"] = true;
$.set('userThemes', userThemes);
return $.rm(container);
});
$.add(parentdiv, div);
}
}
$.add($('#theme_tab + div', dialog), parentdiv);
Options.applyStyle(dialog, 'theme_tab');
parentdiv = $.el('div', {
className: "suboptions"
});
ul = $.el('ul', {
className: 'mascots'
});
for (name in Mascots) {
mascot = Mascots[name];
description = name;
li = $.el('li', {
innerHTML: "<div id='" + name + "' class='" + mascot.category + "' style='background-image: url(" + mascot.image + ");'></div>",
className: 'mascot'
});
div = $('div', li);
if (enabledmascots[name] === true) {
$.addClass(div, 'enabled');
}
$.on(div, 'click', function() {
if (enabledmascots[this.id] === true) {
$.rmClass(this, 'enabled');
$.set(this.id, false);
return enabledmascots[this.id] = false;
} else {
$.addClass(this, 'enabled');
$.set(this.id, true);
return enabledmascots[this.id] = true;
}
});
$.add(ul, li);
$.add(parentdiv, ul);
}
$.add($('#mascot_tab + div', dialog), parentdiv);
batchmascots = $.el('div', {
id: "mascots_batch",
innerHTML: "<a href=\"javascript:;\" id=\"clear\">Clear All</a> / <a href=\"javascript:;\" id=\"selectAll\">Select All</a>"
});
$.on($('#clear', batchmascots), 'click', function() {
var mascotname, _results;
_results = [];
for (mascotname in enabledmascots) {
mascot = enabledmascots[mascotname];
if (enabledmascots[mascotname] === true) {
$.rmClass($('#' + mascotname, this.parentElement.parentElement), 'enabled');
$.set(mascotname, false);
_results.push(enabledmascots[mascotname] = false);
} else {
_results.push(void 0);
}
}
return _results;
});
$.on($('#selectAll', batchmascots), 'click', function() {
var mascotname, _results;
_results = [];
for (mascotname in enabledmascots) {
mascot = enabledmascots[mascotname];
if (enabledmascots[mascotname] === false) {
$.addClass($('#' + mascotname, this.parentElement.parentElement), 'enabled');
$.set(mascotname, true);
_results.push(enabledmascots[mascotname] = true);
} else {
_results.push(void 0);
}
}
return _results;
});
$.add($('#mascot_tab + div', dialog), batchmascots);
Options.applyStyle(dialog, 'mascot_tab');
Options.indicators(dialog);
overlay = $.el('div', {
id: 'overlay'
});
$.on(overlay, 'click', Options.close);
$.add(d.body, overlay);
dialog.style.visibility = 'hidden';
$.add(d.body, dialog);
dialog.style.visibility = 'visible';
Options.filter.call(filter);
Options.backlink.call(back);
Options.time.call(time);
Options.fileInfo.call(fileInfo);
return Options.favicon.call(favicon);
},
indicators: function(dialog) {
var indicator, indicators, key, _i, _j, _len, _len1, _ref, _ref1, _results;
indicators = {};
_ref = $$('.warning', dialog);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
indicator = _ref[_i];
key = indicator.firstChild.textContent;
indicator.hidden = $.get(key, Conf[key]);
indicators[key] = indicator;
$.on($("[name='" + key + "']", dialog), 'click', function() {
return indicators[this.name].hidden = this.checked;
});
}
_ref1 = $$('.disabledwarning', dialog);
_results = [];
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
indicator = _ref1[_j];
key = indicator.firstChild.textContent;
indicator.hidden = !$.get(key, Conf[key]);
indicators[key] = indicator;
_results.push($.on($("[name='" + key + "']", dialog), 'click', function() {
return Options.indicators(dialog);
}));
}
return _results;
},
close: function() {
$.rm($('#options', d.body));
return $.rm($('#overlay', d.body));
},
clearHidden: function() {
$["delete"]("hiddenReplies/" + g.BOARD + "/");
$["delete"]("hiddenThreads/" + g.BOARD + "/");
this.textContent = "hidden: 0";
return g.hiddenReplies = {};
},
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);
},
filter: function() {
var el, name, ta;
el = this.nextSibling;
if ((name = this.value) !== 'guide') {
ta = $.el('textarea', {
name: name,
className: 'field',
value: $.get(name, Conf[name])
});
$.on(ta, 'change', $.cb.value);
$.replace(el, ta);
return;
}
if (el) {
$.rm(el);
}
return $.after(this, $.el('article', {
innerHTML: '<p>Use <a href=https://developer.mozilla.org/en/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.</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`, this is default), or both (`yes`).<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 board pages by default.<br>\
For example: <code>top:yes;</code> or <code>top:no;</code>.\
</li>\
</ul>'
}));
},
time: function() {
Time.foo();
Time.date = new Date();
return $.id('timePreview').textContent = Time.funk(Time);
},
backlink: function() {
return $.id('backlinkPreview').textContent = Conf['backlink'].replace(/%id/, '123456789');
},
fileInfo: function() {
FileInfo.data = {
link: 'javascript:;',
spoiler: true,
size: '276',
unit: 'KB',
resolution: '1280x720',
fullname: 'd9bb2efc98dd0df141a94399ff5880b7.jpg',
shortname: 'd9bb2efc98dd0df141a94399ff5880(...).jpg'
};
FileInfo.setFormats();
return $.id('fileInfoPreview').innerHTML = FileInfo.funk(FileInfo);
},
favicon: function() {
Favicon["switch"]();
Unread.update(true);
return this.nextElementSibling.innerHTML = "<img src=" + Favicon.unreadSFW + "> <img src=" + Favicon.unreadNSFW + "> <img src=" + Favicon.unreadDead + ">";
},
applyStyle: function(dialog, tab) {
var save;
if (Conf['styleenabled'] === '1') {
save = $.el('div', {
innerHTML: '<a href="javascript:;">Save Style Settings</a>',
className: 'stylesettings'
});
$.on($('a', save), 'click', function() {
return Style.addStyle();
});
return $.add($('#' + tab + ' + div', dialog), save);
}
}
};
Markdown = {
format: function(text) {
var pattern, tag, tag_patterns;
tag_patterns = {
bi: /(\*\*\*|___)(?=\S)([^\r\n]*?\S)\1/g,
b: /(\*\*|__)(?=\S)([^\r\n]*?\S)\1/g,
i: /(\*|_)(?=\S)([^\r\n]*?\S)\1/g,
code: /(`)(?=\S)([^\r\n]*?\S)\1/g,
ds: /(\|\||__)(?=\S)([^\r\n]*?\S)\1/g
};
if (text !== null) {
for (tag in tag_patterns) {
pattern = tag_patterns[tag];
text = text.replace(pattern, Markdown.unicode_convert);
}
return text;
}
},
unicode_convert: function(str, tag, inner) {
var c, charcode, charcodes, codepoints, codes, fmt, i, unicode_text;
if (tag === "_" || tag === "*") {
fmt = "i";
} else if (tag === "__" || tag === "**") {
fmt = "b";
} else if (tag === "***" || tag === "___") {
fmt = "bi";
} else if (tag === "||") {
fmt = "ds";
} else {
if (tag === "`" || tag === "```") {
fmt = "code";
}
}
codepoints = {
b: [0x1D7CE, 0x1D400, 0x1D41A],
i: [0x1D7F6, 0x1D434, 0x1D44E],
bi: [0x1D7CE, 0x1D468, 0x1D482],
code: [0x1D7F6, 0x1D670, 0x1D68A],
ds: [0x1D7D8, 0x1D538, 0x1D552]
};
charcodes = (function() {
var _i, _len, _results;
_results = [];
for (i = _i = 0, _len = inner.length; _i < _len; i = ++_i) {
c = inner[i];
_results.push(inner.charCodeAt(i));
}
return _results;
})();
codes = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = charcodes.length; _i < _len; _i++) {
charcode = charcodes[_i];
if (charcode >= 48 && charcode <= 57) {
_results.push(charcode - 48 + codepoints[fmt][0]);
} else if (charcode >= 65 && charcode <= 90) {
_results.push(charcode - 65 + codepoints[fmt][1]);
} else if (charcode >= 97 && charcode <= 122) {
if (charcode === 104 && tag === "i") {
_results.push(0x210E);
} else {
_results.push(charcode - 97 + codepoints[fmt][2]);
}
} else {
_results.push(charcode);
}
}
return _results;
})();
unicode_text = codes.map(Markdown.ucs2_encode).join("");
if (tag === "code") {
unicode_text = unicode_text.replace(/\x20/g, "\xA0");
}
return unicode_text;
},
ucs2_encode: function(value) {
/*
From Punycode.js: https://github.com/bestiejs/punycode.js
Copyright Mathias Bynens <http://mathiasbynens.be/>
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.
*/
var output;
output = "";
if (value > 0xFFFF) {
value -= 0x10000;
output += String.fromCharCode(value >>> 10 & 0x3FF | 0xD800);
value = 0xDC00 | value & 0x3FF;
}
output += String.fromCharCode(value);
return output;
}
};
Filter = {
filters: {},
init: function() {
var boards, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4;
for (key in Config.filter) {
this.filters[key] = [];
_ref = Conf[key].split('\n');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
filter = _ref[_i];
if (filter[0] === '#') {
continue;
}
if (!(regexp = filter.match(/\/(.+)\/(\w*)/))) {
continue;
}
filter = filter.replace(regexp[0], '');
boards = ((_ref1 = filter.match(/boards:([^;]+)/)) != null ? _ref1[1].toLowerCase() : void 0) || 'global';
if (boards !== 'global' && boards.split(',').indexOf(g.BOARD) === -1) {
continue;
}
if (key === 'md5') {
regexp = regexp[1];
} else {
try {
regexp = RegExp(regexp[1], regexp[2]);
} catch (err) {
alert(err.message);
continue;
}
}
op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'no';
stub = (function() {
var _ref3;
switch ((_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0) {
case 'yes':
return true;
case 'no':
return false;
default:
return Conf['Show Stubs'];
}
})();
if (hl = /highlight/.test(filter)) {
hl = ((_ref3 = filter.match(/highlight:(\w+)/)) != null ? _ref3[1] : void 0) || 'filter_highlight';
top = ((_ref4 = filter.match(/top:(yes|no)/)) != null ? _ref4[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 Main.callbacks.push(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, isOP) {
if (isOP && op === 'no' || !isOP && op === 'only') {
return false;
}
if (!test(value)) {
return false;
}
return settings;
};
},
node: function(post) {
var filter, isOP, key, result, root, value, _i, _len, _ref;
if (post.isInlined) {
return;
}
isOP = post.ID === post.threadID;
root = post.root;
for (key in Filter.filters) {
value = Filter[key](post);
if (value === false) {
continue;
}
_ref = Filter.filters[key];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
filter = _ref[_i];
if (!(result = filter(value, isOP))) {
continue;
}
if (result.hide) {
if (isOP) {
if (!g.REPLY) {
ThreadHiding.hide(root.parentNode, result.stub);
} else {
continue;
}
} else {
ReplyHiding.hide(post.root, result.stub);
}
return;
}
$.addClass(root, result["class"]);
}
}
},
name: function(post) {
return $('.name', post.el).textContent;
},
uniqueid: function(post) {
var uid;
if (uid = $('.posteruid', post.el)) {
return uid.textContent.slice(5, -1);
}
return false;
},
tripcode: function(post) {
var trip;
if (trip = $('.postertrip', post.el)) {
return trip.textContent;
}
return false;
},
mod: function(post) {
var mod;
if (mod = $('.capcode', post.el)) {
return mod.textContent;
}
return false;
},
email: function(post) {
var mail;
if (mail = $('.useremail', post.el)) {
return decodeURIComponent(mail.href.slice(7));
}
return false;
},
subject: function(post) {
var subject;
if (subject = $('.postInfo .subject', post.el)) {
return subject.textContent;
}
return false;
},
comment: function(post) {
var data, i, nodes, text, _i, _ref;
text = [];
nodes = d.evaluate('.//br|.//text()', post.blockquote, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (i = _i = 0, _ref = nodes.snapshotLength; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
text.push((data = nodes.snapshotItem(i).data) ? data : '\n');
}
return text.join('');
},
country: function(post) {
var flag;
if (flag = $('.countryFlag', post.el)) {
return flag.title;
}
return false;
},
filename: function(post) {
var file, fileInfo;
fileInfo = post.fileInfo;
if (fileInfo) {
if (file = $('.fileText > span', fileInfo)) {
return file.title;
} else {
return fileInfo.firstElementChild.dataset.filename;
}
}
return false;
},
dimensions: function(post) {
var fileInfo, match;
fileInfo = post.fileInfo;
if (fileInfo && (match = fileInfo.textContent.match(/\d+x\d+/))) {
return match[0];
}
return false;
},
filesize: function(post) {
var img;
img = post.img;
if (img) {
return img.alt.replace('Spoiler Image, ', '');
}
return false;
},
md5: function(post) {
var img;
img = post.img;
if (img) {
return img.dataset.md5;
}
return false;
},
menuInit: function() {
var div, entry, type, _i, _len, _ref;
div = $.el('div', {
textContent: 'Filter'
});
entry = {
el: div,
open: function() {
return true;
},
children: []
};
_ref = [['Name', 'name'], ['Unique ID', 'uniqueid'], ['Tripcode', 'tripcode'], ['Admin/Mod', 'mod'], ['E-mail', 'email'], ['Subject', 'subject'], ['Comment', 'comment'], ['Country', 'country'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'md5']];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
type = _ref[_i];
entry.children.push(Filter.createSubEntry(type[0], type[1]));
}
return Menu.addEntry(entry);
},
createSubEntry: function(text, type) {
var el, onclick, open;
el = $.el('a', {
href: 'javascript:;',
textContent: text
});
onclick = null;
open = function(post) {
var value;
value = Filter[type](post);
if (value === false) {
return false;
}
$.off(el, 'click', onclick);
onclick = function() {
var re, save, select, ta, tl;
re = type === 'md5' ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
if (c === '\n') {
return '\\n';
} else if (c === '\\') {
return '\\\\';
} else {
return "\\" + c;
}
});
re = type === 'md5' ? "/" + value + "/" : "/^" + re + "$/";
if (/\bop\b/.test(post["class"])) {
re += ';op:yes';
}
save = (save = $.get(type, '')) ? "" + save + "\n" + re : re;
$.set(type, save);
Options.dialog();
select = $('select[name=filter]', $.id('options'));
select.value = type;
$.event(select, new Event('change'));
$.id('filter_tab').checked = true;
ta = select.nextElementSibling;
tl = ta.textLength;
ta.setSelectionRange(tl, tl);
return ta.focus();
};
$.on(el, 'click', onclick);
return true;
};
return {
el: el,
open: open
};
}
};
StrikethroughQuotes = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var el, quote, show_stub, _i, _len, _ref;
if (post.isInlined) {
return;
}
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if ((el = $.id(quote.hash.slice(1))) && el.hidden) {
$.addClass(quote, 'filtered');
if (Conf['Recursive Filtering']) {
show_stub = !!$.x('preceding-sibling::div[contains(@class,"stub")]', el);
ReplyHiding.hide(post.root, show_stub);
}
}
}
}
};
ExpandComment = {
init: function() {
var a, _i, _len, _ref;
_ref = $$('.abbr');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
a = _ref[_i];
$.on(a.firstElementChild, 'click', ExpandComment.expand);
}
},
expand: function(e) {
var a, replyID, threadID, _, _ref;
e.preventDefault();
_ref = this.href.match(/(\d+)#p(\d+)/), _ = _ref[0], threadID = _ref[1], replyID = _ref[2];
this.textContent = "Loading No." + replyID + "...";
a = this;
return $.cache("//api.4chan.org" + this.pathname + ".json", function() {
return ExpandComment.parse(this, a, threadID, replyID);
});
},
parse: function(req, a, threadID, replyID) {
var bq, clone, href, post, posts, quote, quotes, spoilerRange, _i, _j, _len, _len1;
if (req.status !== 200) {
a.textContent = "" + req.status + " " + req.statusText;
return;
}
posts = JSON.parse(req.response).posts;
if (spoilerRange = posts[0].custom_spoiler) {
Build.spoilerRange[g.BOARD] = spoilerRange;
}
replyID = +replyID;
for (_i = 0, _len = posts.length; _i < _len; _i++) {
post = posts[_i];
if (post.no === replyID) {
break;
}
}
if (post.no !== replyID) {
a.textContent = 'No.#{replyID} not found.';
return;
}
bq = $.id("m" + replyID);
clone = bq.cloneNode(false);
clone.innerHTML = post.com;
quotes = clone.getElementsByClassName('quotelink');
for (_j = 0, _len1 = quotes.length; _j < _len1; _j++) {
quote = quotes[_j];
href = quote.getAttribute('href');
if (href[0] === '/') {
continue;
}
quote.href = "res/" + href;
}
post = {
blockquote: clone,
threadID: threadID,
quotes: quotes,
backlinks: []
};
if (Conf['Resurrect Quotes']) {
Quotify.node(post);
}
if (Conf['Quote Preview']) {
QuotePreview.node(post);
}
if (Conf['Quote Inline']) {
QuoteInline.node(post);
}
if (Conf['Indicate OP quote']) {
QuoteOP.node(post);
}
if (Conf['Indicate Cross-thread Quotes']) {
QuoteCT.node(post);
}
$.replace(bq, clone);
return Main.prettify(clone);
}
};
ExpandThread = {
init: function() {
var a, span, _i, _len, _ref, _results;
_ref = $$('.summary');
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
span = _ref[_i];
a = $.el('a', {
textContent: "+ " + span.textContent,
className: 'summary desktop',
href: 'javascript:;'
});
$.on(a, 'click', function() {
return ExpandThread.toggle(this.parentNode);
});
_results.push($.replace(span, a));
}
return _results;
},
toggle: function(thread) {
var a, num, replies, reply, url, _i, _len;
url = "//api.4chan.org/" + g.BOARD + "/res/" + thread.id.slice(1) + ".json";
a = $('.summary', thread);
switch (a.textContent[0]) {
case '+':
a.textContent = a.textContent.replace('+', '× Loading...');
$.cache(url, function() {
return ExpandThread.parse(this, thread, a);
});
break;
case 'X':
a.textContent = a.textContent.replace('× Loading...', '+');
$.cache.requests[url].abort();
break;
case '-':
a.textContent = a.textContent.replace('-', '+');
num = (function() {
switch (g.BOARD) {
case 'b':
case 'vg':
case 'q':
return 3;
case 't':
return 1;
default:
return 5;
}
})();
replies = $$('.replyContainer', thread);
replies.splice(replies.length - num, num);
for (_i = 0, _len = replies.length; _i < _len; _i++) {
reply = replies[_i];
$.rm(reply);
}
}
},
parse: function(req, thread, a) {
var backlink, id, link, nodes, post, posts, replies, reply, spoilerRange, threadID, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
if (req.status !== 200) {
a.textContent = "" + req.status + " " + req.statusText;
$.off(a, 'click', ExpandThread.cb.toggle);
return;
}
a.textContent = a.textContent.replace('× Loading...', '-');
posts = JSON.parse(req.response).posts;
if (spoilerRange = posts[0].custom_spoiler) {
Build.spoilerRange[g.BOARD] = spoilerRange;
}
replies = posts.slice(1);
threadID = thread.id.slice(1);
nodes = [];
for (_i = 0, _len = replies.length; _i < _len; _i++) {
reply = replies[_i];
post = Build.postFromObject(reply, g.BOARD);
id = reply.no;
link = $('a[title="Highlight this post"]', post);
link.href = "res/" + threadID + "#p" + id;
link.nextSibling.href = "res/" + threadID + "#q" + id;
nodes.push(post);
}
_ref = $$('.summary ~ .replyContainer', a.parentNode);
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
post = _ref[_j];
$.rm(post);
}
_ref1 = $$('.backlink', a.previousElementSibling);
for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
backlink = _ref1[_k];
if (!$.id(backlink.hash.slice(1))) {
$.rm(backlink);
}
}
return $.after(a, nodes);
}
};
ThreadHiding = {
init: function() {
var a, hiddenThreads, thread, _i, _len, _ref;
hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
_ref = $$('.thread');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
thread = _ref[_i];
a = $.el('a', {
className: 'hide_thread_button',
innerHTML: '<span>[ - ]</span>',
href: 'javascript:;'
});
$.on(a, 'click', ThreadHiding.cb);
$.prepend(thread, a);
if (thread.id.slice(1) in hiddenThreads) {
ThreadHiding.hide(thread);
}
}
},
cb: function() {
return ThreadHiding.toggle($.x('ancestor::div[parent::div[@class="board"]]', this));
},
toggle: function(thread) {
var hiddenThreads, id;
hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
id = thread.id.slice(1);
if (thread.hidden || /\bhidden_thread\b/.test(thread.firstChild.className)) {
ThreadHiding.show(thread);
delete hiddenThreads[id];
} else {
ThreadHiding.hide(thread);
hiddenThreads[id] = Date.now();
}
return $.set("hiddenThreads/" + g.BOARD + "/", hiddenThreads);
},
hide: function(thread, show_stub) {
var a, menuButton, num, opInfo, span, stub, text;
if (show_stub == null) {
show_stub = Conf['Show Stubs'];
}
if (!show_stub) {
thread.hidden = true;
thread.nextElementSibling.hidden = true;
return;
}
if (/\bhidden_thread\b/.test(thread.firstChild.className)) {
return;
}
num = 0;
if (span = $('.summary', thread)) {
num = Number(span.textContent.match(/\d+/));
}
num += $$('.opContainer ~ .replyContainer', thread).length;
text = num === 1 ? '1 reply' : "" + num + " replies";
opInfo = $('.desktop > .nameBlock', thread).textContent;
stub = $.el('div', {
className: 'hide_thread_button hidden_thread',
innerHTML: '<a href="javascript:;"><span>[ + ]</span> </a>'
});
a = stub.firstChild;
$.on(a, 'click', ThreadHiding.cb);
$.add(a, $.tn("" + opInfo + " (" + text + ")"));
if (Conf['Menu']) {
menuButton = Menu.a.cloneNode(true);
$.on(menuButton, 'click', Menu.toggle);
$.add(stub, [$.tn(' '), menuButton]);
}
return $.prepend(thread, stub);
},
show: function(thread) {
var stub;
if (stub = $('.hidden_thread', thread)) {
$.rm(stub);
}
thread.hidden = false;
return thread.nextElementSibling.hidden = false;
}
};
ReplyHiding = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var side;
if (post.isInlined || post.ID === post.threadID) {
return;
}
side = $('.sideArrows', post.root);
$.addClass(side, 'hide_reply_button');
side.innerHTML = '<a href="javascript:;"><span>[ - ]</span></a>';
$.on(side.firstChild, 'click', ReplyHiding.toggle);
if (post.ID in g.hiddenReplies) {
return ReplyHiding.hide(post.root);
}
},
toggle: function() {
var button, id, quote, quotes, root, _i, _j, _len, _len1;
button = this.parentNode;
root = button.parentNode;
id = root.id.slice(2);
quotes = $$(".quotelink[href$='#p" + id + "'], .backlink[href$='#p" + id + "']");
if (/\bstub\b/.test(button.className)) {
ReplyHiding.show(root);
for (_i = 0, _len = quotes.length; _i < _len; _i++) {
quote = quotes[_i];
$.rmClass(quote, 'filtered');
}
delete g.hiddenReplies[id];
} else {
ReplyHiding.hide(root);
for (_j = 0, _len1 = quotes.length; _j < _len1; _j++) {
quote = quotes[_j];
$.addClass(quote, 'filtered');
}
g.hiddenReplies[id] = Date.now();
}
return $.set("hiddenReplies/" + g.BOARD + "/", g.hiddenReplies);
},
hide: function(root, show_stub) {
var a, el, menuButton, side, stub;
if (show_stub == null) {
show_stub = Conf['Show Stubs'];
}
side = $('.sideArrows', root);
if (side.hidden) {
return;
}
side.hidden = true;
el = side.nextElementSibling;
el.hidden = true;
$.addClass(root, 'hidden');
if (!show_stub) {
return;
}
stub = $.el('div', {
className: 'hide_reply_button stub',
innerHTML: '<a href="javascript:;"><span>[ + ]</span> </a>'
});
a = stub.firstChild;
$.on(a, 'click', ReplyHiding.toggle);
$.add(a, $.tn($('.desktop > .nameBlock', el).textContent));
if (Conf['Menu']) {
menuButton = Menu.a.cloneNode(true);
$.on(menuButton, 'click', Menu.toggle);
$.add(stub, [$.tn(' '), menuButton]);
}
return $.prepend(root, stub);
},
show: function(root) {
var stub;
if (stub = $('.stub', root)) {
$.rm(stub);
}
$('.sideArrows', root).hidden = false;
$('.post', root).hidden = false;
return $.rmClass(root, 'hidden');
}
};
Menu = {
entries: [],
init: function() {
this.a = $.el('a', {
className: 'menu_button',
href: 'javascript:;',
innerHTML: '[<span></span>]'
});
this.el = $.el('div', {
className: 'reply dialog',
id: 'menu',
tabIndex: 0
});
$.on(this.el, 'click', function(e) {
return e.stopPropagation();
});
$.on(this.el, 'keydown', this.keybinds);
$.on(d, 'AddMenuEntry', function(e) {
return Menu.addEntry(e.detail);
});
return Main.callbacks.push(this.node);
},
node: function(post) {
var a;
if (post.isInlined && !post.isCrosspost) {
a = $('.menu_button', post.el);
} else {
a = Menu.a.cloneNode(true);
$.add($('.postInfo', post.el), [$.tn('\u00A0'), a]);
}
return $.on(a, 'click', Menu.toggle);
},
toggle: function(e) {
var lastOpener, post;
e.preventDefault();
e.stopPropagation();
if (Menu.el.parentNode) {
lastOpener = Menu.lastOpener;
Menu.close();
if (lastOpener === this) {
return;
}
}
Menu.lastOpener = this;
post = /\bhidden_thread\b/.test(this.parentNode.className) ? $.x('ancestor::div[parent::div[@class="board"]]/child::div[contains(@class,"opContainer")]', this) : $.x('ancestor::div[contains(@class,"postContainer")][1]', this);
return Menu.open(this, Main.preParse(post));
},
open: function(button, post) {
var bLeft, bRect, bTop, el, entry, funk, mRect, _i, _len, _ref;
el = Menu.el;
el.setAttribute('data-id', post.ID);
el.setAttribute('data-rootid', post.root.id);
funk = function(entry, parent) {
var child, children, subMenu, _i, _len;
children = entry.children;
if (!entry.open(post)) {
return;
}
$.add(parent, entry.el);
if (!children) {
return;
}
if (subMenu = $('.subMenu', entry.el)) {
$.rm(subMenu);
}
subMenu = $.el('div', {
className: 'reply dialog subMenu'
});
$.add(entry.el, subMenu);
for (_i = 0, _len = children.length; _i < _len; _i++) {
child = children[_i];
funk(child, subMenu);
}
};
_ref = Menu.entries;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
entry = _ref[_i];
funk(entry, el);
}
Menu.focus($('.entry', Menu.el));
$.on(d, 'click', Menu.close);
$.add(d.body, el);
mRect = el.getBoundingClientRect();
bRect = button.getBoundingClientRect();
bTop = d.documentElement.scrollTop + d.body.scrollTop + bRect.top;
bLeft = d.documentElement.scrollLeft + d.body.scrollLeft + bRect.left;
el.style.top = bRect.top + bRect.height + mRect.height < d.documentElement.clientHeight ? bTop + bRect.height + 2 + 'px' : bTop - mRect.height - 2 + 'px';
el.style.left = bRect.left + mRect.width < d.documentElement.clientWidth ? bLeft + 'px' : bLeft + bRect.width - mRect.width + 'px';
return el.focus();
},
close: function() {
var el, focused, _i, _len, _ref;
el = Menu.el;
$.rm(el);
_ref = $$('.focused.entry', el);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
focused = _ref[_i];
$.rmClass(focused, 'focused');
}
el.innerHTML = null;
el.removeAttribute('style');
delete Menu.lastOpener;
delete Menu.focusedEntry;
return $.off(d, 'click', Menu.close);
},
keybinds: function(e) {
var el, next, subMenu;
el = Menu.focusedEntry;
switch (Keybinds.keyCode(e) || e.keyCode) {
case 'Esc':
Menu.lastOpener.focus();
Menu.close();
break;
case 13:
case 32:
el.click();
break;
case 'Up':
if (next = el.previousElementSibling) {
Menu.focus(next);
}
break;
case 'Down':
if (next = el.nextElementSibling) {
Menu.focus(next);
}
break;
case 'Right':
if ((subMenu = $('.subMenu', el)) && (next = subMenu.firstElementChild)) {
Menu.focus(next);
}
break;
case 'Left':
if (next = $.x('parent::*[contains(@class,"subMenu")]/parent::*', el)) {
Menu.focus(next);
}
break;
default:
return;
}
e.preventDefault();
return e.stopPropagation();
},
focus: function(el) {
var focused, _i, _len, _ref;
if (focused = $.x('parent::*/child::*[contains(@class,"focused")]', el)) {
$.rmClass(focused, 'focused');
}
_ref = $$('.focused', el);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
focused = _ref[_i];
$.rmClass(focused, 'focused');
}
Menu.focusedEntry = el;
return $.addClass(el, 'focused');
},
addEntry: function(entry) {
var funk;
funk = function(entry) {
var child, children, el, _i, _len;
el = entry.el, children = entry.children;
$.addClass(el, 'entry');
$.on(el, 'focus mouseover', function(e) {
e.stopPropagation();
return Menu.focus(this);
});
if (!children) {
return;
}
$.addClass(el, 'hasSubMenu');
for (_i = 0, _len = children.length; _i < _len; _i++) {
child = children[_i];
funk(child);
}
};
funk(entry);
return Menu.entries.push(entry);
}
};
Keybinds = {
init: function() {
var node, _i, _len, _ref;
_ref = $$('[accesskey]');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
node = _ref[_i];
node.removeAttribute('accesskey');
}
return $.on(d, 'keydown', Keybinds.keydown);
},
keydown: function(e) {
var key, link, o, target, thread;
if (!(key = Keybinds.keyCode(e))) {
return;
}
target = e.target;
if (/TEXTAREA|INPUT/.test(target.nodeName)) {
if (!((key === 'Esc') || (/\+/.test(key)))) {
return;
}
}
thread = Nav.getThread();
switch (key) {
case Conf.openQR:
Keybinds.qr(thread, true);
break;
case Conf.openEmptyQR:
Keybinds.qr(thread);
break;
case Conf.openOptions:
if (!$.id('overlay')) {
Options.dialog();
}
break;
case Conf.close:
if (o = $.id('overlay')) {
Options.close.call(o);
} else if (QR.el) {
QR.close();
}
break;
case Conf.submit:
if (QR.el && !QR.status()) {
QR.submit();
}
break;
case Conf.spoiler:
if (target.nodeName !== 'TEXTAREA') {
return;
}
Keybinds.tags('spoiler', target);
break;
case Conf.code:
if (target.nodeName !== 'TEXTAREA') {
return;
}
Keybinds.tags('code', target);
break;
case Conf.sageru:
$("[name=email]", QR.el).value = "sage";
QR.selected.email = "sage";
break;
case Conf.watch:
Watcher.toggle(thread);
break;
case Conf.update:
Updater.updateReset();
break;
case Conf.unreadCountTo0:
Unread.replies = new $.RandomAccessList;
Unread.update(true);
break;
case Conf.threading:
QuoteThreading["public"].toggle();
break;
case Conf.expandImage:
Keybinds.img(thread);
break;
case Conf.expandAllImages:
Keybinds.img(thread, true);
break;
case Conf.zero:
window.location = "/" + g.BOARD + "/0#delform";
break;
case Conf.nextPage:
if (link = $('link[rel=next]', d.head)) {
window.location = link.href + '#delform';
}
break;
case Conf.previousPage:
if (link = $('link[rel=prev]', d.head)) {
window.location = link.href + '#delform';
}
break;
case Conf.nextThread:
if (g.REPLY) {
return;
}
Nav.scroll(+1);
break;
case Conf.previousThread:
if (g.REPLY) {
return;
}
Nav.scroll(-1);
break;
case Conf.expandThread:
ExpandThread.toggle(thread);
break;
case Conf.openThread:
Keybinds.open(thread);
break;
case Conf.openThreadTab:
Keybinds.open(thread, true);
break;
case Conf.nextReply:
Keybinds.hl(+1, thread);
break;
case Conf.previousReply:
Keybinds.hl(-1, thread);
break;
case Conf.hide:
if (/\bthread\b/.test(thread.className)) {
ThreadHiding.toggle(thread);
}
break;
default:
return;
}
return e.preventDefault();
},
keyCode: function(e) {
var c, kc, key;
key = (function() {
switch (kc = e.keyCode) {
case 8:
return '';
case 27:
return 'Esc';
case 37:
return 'Left';
case 38:
return 'Up';
case 39:
return 'Right';
case 40:
return 'Down';
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
case 65:
case 66:
case 67:
case 68:
case 69:
case 70:
case 71:
case 72:
case 73:
case 74:
case 75:
case 76:
case 77:
case 78:
case 79:
case 80:
case 81:
case 82:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 89:
case 90:
c = String.fromCharCode(kc);
if (e.shiftKey) {
return c;
} else {
return c.toLowerCase();
}
break;
default:
return null;
}
})();
if (key) {
if (e.altKey) {
key = 'alt+' + key;
}
if (e.ctrlKey) {
key = 'ctrl+' + key;
}
if (e.metaKey) {
key = 'meta+' + key;
}
}
return key;
},
tags: function(tag, ta) {
var range, selEnd, selStart, value;
value = ta.value;
selStart = ta.selectionStart;
selEnd = ta.selectionEnd;
ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd);
range = ("[" + tag + "]").length + selEnd;
ta.setSelectionRange(range, range);
return $.event(ta, new Event('input'));
},
img: function(thread, all) {
var thumb;
if (all) {
return $.id('imageExpand').click();
} else {
thumb = $('img[data-md5]', $('.post.highlight', thread) || thread);
return ImageExpand.toggle(thumb.parentNode);
}
},
qr: function(thread, quote) {
if (quote) {
QR.quote.call($('a[title="Quote this post"]', $('.post.highlight', thread) || thread));
} else {
QR.open();
}
return $('textarea', QR.el).focus();
},
open: function(thread, tab) {
var id, url;
id = thread.id.slice(1);
url = "//boards.4chan.org/" + g.BOARD + "/res/" + id;
if (tab) {
return $.open(url);
} else {
return location.href = url;
}
},
hl: function(delta, thread) {
var axis, next, post, rect, replies, reply, _i, _len;
if (post = $('.reply.highlight', thread)) {
$.rmClass(post, 'highlight');
rect = post.getBoundingClientRect();
if (rect.bottom >= 0 && rect.top <= d.documentElement.clientHeight) {
axis = delta === +1 ? 'following' : 'preceding';
next = $.x(axis + '::div[contains(@class,"post reply")][1]', post);
if (!next) {
return;
}
if (!(g.REPLY || $.x('ancestor::div[parent::div[@class="board"]]', next) === thread)) {
return;
}
rect = next.getBoundingClientRect();
if (rect.top < 0 || rect.bottom > d.documentElement.clientHeight) {
next.scrollIntoView(delta === -1);
}
this.focus(next);
return;
}
}
replies = $$('.reply', thread);
if (delta === -1) {
replies.reverse();
}
for (_i = 0, _len = replies.length; _i < _len; _i++) {
reply = replies[_i];
rect = reply.getBoundingClientRect();
if (delta === +1 && rect.top >= 0 || delta === -1 && rect.bottom <= d.documentElement.clientHeight) {
this.focus(reply);
return;
}
}
},
focus: function(post) {
$.addClass(post, 'highlight');
return post.focus();
}
};
Nav = {
init: function() {
var next, prev, span;
span = $.el('span', {
id: 'navlinks'
});
prev = $.el('a', {
textContent: '▲',
href: 'javascript:;'
});
next = $.el('a', {
textContent: '▼',
href: 'javascript:;'
});
$.on(prev, 'click', this.prev);
$.on(next, 'click', this.next);
$.add(span, [prev, $.tn(' '), next]);
return $.add(d.body, span);
},
prev: function() {
if (g.REPLY) {
return window.scrollTo(0, 0);
} else {
return Nav.scroll(-1);
}
},
next: function() {
if (g.REPLY) {
return window.scrollTo(0, d.body.scrollHeight);
} else {
return Nav.scroll(+1);
}
},
getThread: function(full) {
var bottom, i, rect, thread, _i, _len, _ref;
Nav.threads = $$('.thread:not(.hidden)');
_ref = Nav.threads;
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
thread = _ref[i];
rect = thread.getBoundingClientRect();
bottom = rect.bottom;
if (bottom > 0) {
if (full) {
return [thread, i, rect];
}
return thread;
}
}
return $('.board');
},
scroll: function(delta) {
var i, link, rect, thread, top, _ref, _ref1;
_ref = Nav.getThread(true), thread = _ref[0], i = _ref[1], rect = _ref[2];
top = rect.top;
if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) {
i += delta;
}
if (Conf['Rollover']) {
if (i === -1) {
if (link = $('link[rel=prev]', d.head)) {
window.location = link.href + '#delform';
} else {
window.location = "/" + g.BOARD + "/0#delform";
}
return;
}
if ((delta === +1) && ((i === Nav.threads.length) || (innerHeight + pageYOffset === d.body.scrollHeight))) {
if (link = $('link[rel=next]', d.head)) {
window.location = link.href + '#delform';
return;
}
}
}
top = (_ref1 = Nav.threads[i]) != null ? _ref1.getBoundingClientRect().top : void 0;
return window.scrollBy(0, top);
}
};
Updater = {
init: function() {
var checkbox, checked, dialog, html, input, name, title, _i, _len, _ref;
html = '<div class=move><span id=count></span> <span id=timer></span></div>';
checkbox = Config.updater.checkbox;
for (name in checkbox) {
title = checkbox[name][1];
checked = Conf[name] ? 'checked' : '';
html += "<div><label title='" + title + "'>" + name + "<input name='" + name + "' type=checkbox " + checked + "></label></div>";
}
checked = Conf['Auto Update'] ? 'checked' : '';
html += " <div><label title='Controls whether *this* thread automatically updates or not'>Auto Update This<input name='Auto Update This' type=checkbox " + checked + "></label></div> <div><label>Interval (s)<input type=number name=Interval class=field min=5></label></div> <div><input value='Update Now' type=button name='Update Now'></div>";
dialog = UI.dialog('updater', 'bottom: 0; right: 0;', html);
this.count = $('#count', dialog);
this.timer = $('#timer', dialog);
this.thread = $.id("t" + g.THREAD_ID);
this.unsuccessfulFetchCount = 0;
this.lastModified = '0';
_ref = $$('input', dialog);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
input = _ref[_i];
if (input.type === 'checkbox') {
$.on(input, 'click', $.cb.checked);
}
switch (input.name) {
case 'Scroll BG':
$.on(input, 'click', this.cb.scrollBG);
this.cb.scrollBG.call(input);
break;
case 'Verbose':
$.on(input, 'click', this.cb.verbose);
this.cb.verbose.call(input);
break;
case 'Auto Update This':
$.on(input, 'click', this.cb.autoUpdate);
this.cb.autoUpdate.call(input);
break;
case 'Interval':
input.value = Conf['Interval'];
$.on(input, 'change', this.cb.interval);
this.cb.interval.call(input);
break;
case 'Update Now':
$.on(input, 'click', this.update);
}
}
$.add(d.body, dialog);
$.on(d, 'QRPostSuccessful', this.cb.post);
return $.on(d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', this.cb.visibility);
},
cb: {
post: function() {
if (!Conf['Auto Update This']) {
return;
}
Updater.unsuccessfulFetchCount = 0;
return setTimeout(Updater.update, 500);
},
visibility: function() {
var state;
state = d.visibilityState || d.oVisibilityState || d.mozVisibilityState || d.webkitVisibilityState;
if (state !== 'visible') {
return;
}
Updater.unsuccessfulFetchCount = 0;
if (Updater.timer.textContent < -Conf['Interval']) {
return Updater.set('timer', -Updater.getInterval());
}
},
interval: function() {
var val;
val = parseInt(this.value, 10);
this.value = val > 0 ? val : 30;
$.cb.value.call(this);
return Updater.set('timer', -Updater.getInterval());
},
verbose: function() {
if (Conf['Verbose']) {
Updater.set('count', '+0');
return Updater.timer.hidden = false;
} else {
Updater.set('count', 'Thread Updater');
Updater.count.className = '';
return Updater.timer.hidden = true;
}
},
autoUpdate: function() {
if (Conf['Auto Update This'] = this.checked) {
return Updater.timeoutID = setTimeout(Updater.timeout, 1000);
} else {
return clearTimeout(Updater.timeoutID);
}
},
scrollBG: function() {
return Updater.scrollBG = this.checked ? function() {
return true;
} : function() {
return !(d.hidden || d.oHidden || d.mozHidden || d.webkitHidden);
};
},
load: function() {
switch (this.status) {
case 404:
Updater.set('timer', '');
Updater.set('count', 404);
Updater.count.className = 'warning';
clearTimeout(Updater.timeoutID);
g.dead = true;
if (Conf['Unread Count']) {
Unread.title = Unread.title.match(/^.+-/)[0] + ' 404';
} else {
d.title = d.title.match(/^.+-/)[0] + ' 404';
}
Unread.update(true);
QR.abort();
break;
case 0:
case 304:
/*
Status Code 304: Not modified
By sending the `If-Modified-Since` header we get a proper status code, and no response.
This saves bandwidth for both the user and the servers and avoid unnecessary computation.
*/
Updater.unsuccessfulFetchCount++;
Updater.set('timer', -Updater.getInterval());
if (Conf['Verbose']) {
Updater.set('count', '+0');
Updater.count.className = null;
}
break;
case 200:
Updater.lastModified = this.getResponseHeader('Last-Modified');
Updater.cb.update(JSON.parse(this.response).posts);
Updater.set('timer', -Updater.getInterval());
break;
default:
Updater.unsuccessfulFetchCount++;
Updater.set('timer', -Updater.getInterval());
if (Conf['Verbose']) {
Updater.set('count', this.statusText);
Updater.count.className = 'warning';
}
}
return delete Updater.request;
},
update: function(posts) {
var count, id, lastPost, nodes, post, scroll, spoilerRange, _i, _len, _ref;
if (spoilerRange = posts[0].custom_spoiler) {
Build.spoilerRange[g.BOARD] = spoilerRange;
}
lastPost = Updater.thread.lastElementChild;
id = +lastPost.id.slice(2);
nodes = [];
_ref = posts.reverse();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
post = _ref[_i];
if (post.no <= id) {
break;
}
nodes.push(Build.postFromObject(post, g.BOARD));
}
count = nodes.length;
if (Conf['Verbose']) {
Updater.set('count', "+" + count);
Updater.count.className = count ? 'new' : null;
}
if (count) {
Updater.unsuccessfulFetchCount = 0;
} else {
Updater.unsuccessfulFetchCount++;
return;
}
scroll = Conf['Scrolling'] && Updater.scrollBG() && lastPost.getBoundingClientRect().bottom - d.documentElement.clientHeight < 25;
$.add(Updater.thread, nodes.reverse());
if (scroll) {
return nodes[0].scrollIntoView();
}
}
},
set: function(name, text) {
var el, node;
el = Updater[name];
if (node = el.firstChild) {
return node.data = text;
} else {
return el.textContent = text;
}
},
getInterval: function() {
var i;
return i = +Conf['Interval'];
},
timeout: function() {
var n;
Updater.timeoutID = setTimeout(Updater.timeout, 1000);
n = 1 + Number(Updater.timer.firstChild.data);
if (n === 0) {
return Updater.update();
} else if (n >= Updater.getInterval()) {
Updater.unsuccessfulFetchCount++;
Updater.set('count', 'Retry');
Updater.count.className = null;
return Updater.update();
} else {
return Updater.set('timer', n);
}
},
update: function() {
var request, url;
Updater.set('timer', 0);
request = Updater.request;
if (request) {
request.onloadend = null;
request.abort();
}
url = "//api.4chan.org/" + g.BOARD + "/res/" + g.THREAD_ID + ".json";
return Updater.request = $.ajax(url, {
onloadend: Updater.cb.load
}, {
headers: {
'If-Modified-Since': Updater.lastModified
}
});
}
};
Watcher = {
init: function() {
var favicon, html, input, _i, _len, _ref;
html = '<div class=move>Thread Watcher</div>';
this.dialog = UI.dialog('watcher', 'top: 50px; left: 0px;', html);
$.add(d.body, this.dialog);
_ref = $$('.op input');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
input = _ref[_i];
favicon = $.el('img', {
className: 'favicon'
});
$.on(favicon, 'click', this.cb.toggle);
$.before(input, favicon);
}
if (g.THREAD_ID === $.get('autoWatch', 0)) {
this.watch(g.THREAD_ID);
$["delete"]('autoWatch');
} else {
this.refresh();
}
$.on(d, 'QRPostSuccessful', this.cb.post);
return $.sync('watched', this.refresh);
},
refresh: function(watched) {
var board, div, favicon, id, link, nodes, props, watchedBoard, x, _i, _j, _len, _len1, _ref, _ref1, _ref2;
watched || (watched = $.get('watched', {}));
nodes = [];
for (board in watched) {
_ref = watched[board];
for (id in _ref) {
props = _ref[id];
x = $.el('a', {
textContent: '×',
href: 'javascript:;'
});
$.on(x, 'click', Watcher.cb.x);
link = $.el('a', props);
link.title = link.textContent;
div = $.el('div');
$.add(div, [x, $.tn(' '), link]);
nodes.push(div);
}
}
_ref1 = $$('div:not(.move)', Watcher.dialog);
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
div = _ref1[_i];
$.rm(div);
}
$.add(Watcher.dialog, nodes);
watchedBoard = watched[g.BOARD] || {};
_ref2 = $$('.favicon');
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
favicon = _ref2[_j];
id = favicon.nextSibling.name;
if (id in watchedBoard) {
favicon.src = Favicon["default"];
} else {
favicon.src = Favicon.empty;
}
}
},
cb: {
toggle: function() {
return Watcher.toggle(this.parentNode);
},
x: function() {
var thread;
thread = this.nextElementSibling.pathname.split('/');
return Watcher.unwatch(thread[3], thread[1]);
},
post: function(e) {
var postID, threadID, _ref;
_ref = e.detail, postID = _ref.postID, threadID = _ref.threadID;
if (threadID === '0') {
if (Conf['Auto Watch']) {
return $.set('autoWatch', postID);
}
} else if (Conf['Auto Watch Reply']) {
return Watcher.watch(threadID);
}
}
},
toggle: function(thread) {
var id;
id = $('.favicon + input', thread).name;
return Watcher.watch(id) || Watcher.unwatch(id, g.BOARD);
},
unwatch: function(id, board) {
var watched;
watched = $.get('watched', {});
delete watched[board][id];
$.set('watched', watched);
return Watcher.refresh();
},
watch: function(id) {
var thread, watched, _name;
thread = $.id("t" + id);
if ($('.favicon', thread).src === Favicon["default"]) {
return false;
}
watched = $.get('watched', {});
watched[_name = g.BOARD] || (watched[_name] = {});
watched[g.BOARD][id] = {
href: "/" + g.BOARD + "/res/" + id,
textContent: Get.title(thread)
};
$.set('watched', watched);
Watcher.refresh();
return true;
}
};
Anonymize = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var name, parent, trip;
if (post.isInlined && !post.isCrosspost) {
return;
}
name = $('.postInfo .name', post.el);
name.textContent = 'Anonymous';
if ((trip = name.nextElementSibling) && trip.className === 'postertrip') {
$.rm(trip);
}
if ((parent = name.parentNode).className === 'useremail' && !/^mailto:sage$/i.test(parent.href)) {
return $.replace(parent, name);
}
}
};
Sauce = {
init: function() {
var link, _i, _len, _ref;
if (g.BOARD === 'f') {
return;
}
this.links = [];
_ref = Conf['sauces'].split('\n');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];
if (link[0] === '#') {
continue;
}
this.links.push(this.createSauceLink(link.trim()));
}
if (!this.links.length) {
return;
}
return Main.callbacks.push(this.node);
},
createSauceLink: function(link) {
var domain, el, href, m;
link = link.replace(/(\$\d)/g, function(parameter) {
switch (parameter) {
case '$1':
return "' + (isArchived ? img.firstChild.src : 'http://thumbs.4chan.org' + img.pathname.replace(/src(\\/\\d+).+$/, 'thumb$1s.jpg')) + '";
case '$2':
return "' + img.href + '";
case '$3':
return "' + encodeURIComponent(img.firstChild.dataset.md5) + '";
case '$4':
return g.BOARD;
default:
return parameter;
}
});
domain = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
href = link.replace(/;text:.+$/, '');
href = Function('img', 'isArchived', "return '" + href + "'");
el = $.el('a', {
target: '_blank',
textContent: domain
});
return function(img, isArchived) {
var a;
a = el.cloneNode(true);
a.href = href(img, isArchived);
return a;
};
},
node: function(post) {
var img, link, nodes, _i, _len, _ref;
img = post.img;
if (post.isInlined && !post.isCrosspost || !img) {
return;
}
img = img.parentNode;
nodes = [];
_ref = Sauce.links;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];
nodes.push($.tn($.NBSP), link(img, post.isArchived));
}
return $.add(post.fileInfo, nodes);
}
};
RevealSpoilers = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var img, s;
img = post.img;
if (!(img && /^Spoiler/.test(img.alt)) || post.isInlined && !post.isCrosspost || post.isArchived) {
return;
}
img.removeAttribute('style');
s = img.style;
s.maxHeight = s.maxWidth = /\bop\b/.test(post["class"]) ? '250px' : '125px';
return img.src = "//thumbs.4chan.org" + (img.parentNode.pathname.replace(/src(\/\d+).+$/, 'thumb$1s.jpg'));
}
};
Time = {
init: function() {
Time.foo();
return Main.callbacks.push(this.node);
},
node: function(post) {
var node;
if (post.isInlined && !post.isCrosspost) {
return;
}
node = $('.postInfo > .dateTime', post.el);
Time.date = new Date(node.dataset.utc * 1000);
return node.textContent = Time.funk(Time);
},
foo: function() {
var code;
code = Conf['time'].replace(/%([A-Za-z])/g, function(s, c) {
if (c in Time.formatters) {
return "' + Time.formatters." + c + "() + '";
} else {
return s;
}
});
return Time.funk = Function('Time', "return '" + code + "'");
},
day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
zeroPad: function(n) {
if (n < 10) {
return '0' + n;
} else {
return n;
}
},
formatters: {
a: function() {
return Time.day[Time.date.getDay()].slice(0, 3);
},
A: function() {
return Time.day[Time.date.getDay()];
},
b: function() {
return Time.month[Time.date.getMonth()].slice(0, 3);
},
B: function() {
return Time.month[Time.date.getMonth()];
},
d: function() {
return Time.zeroPad(Time.date.getDate());
},
e: function() {
return Time.date.getDate();
},
H: function() {
return Time.zeroPad(Time.date.getHours());
},
I: function() {
return Time.zeroPad(Time.date.getHours() % 12 || 12);
},
k: function() {
return Time.date.getHours();
},
l: function() {
return Time.date.getHours() % 12 || 12;
},
m: function() {
return Time.zeroPad(Time.date.getMonth() + 1);
},
M: function() {
return Time.zeroPad(Time.date.getMinutes());
},
p: function() {
if (Time.date.getHours() < 12) {
return 'AM';
} else {
return 'PM';
}
},
P: function() {
if (Time.date.getHours() < 12) {
return 'am';
} else {
return 'pm';
}
},
S: function() {
return Time.zeroPad(Time.date.getSeconds());
},
y: function() {
return Time.date.getFullYear() - 2000;
}
}
};
FileInfo = {
init: function() {
if (g.BOARD === 'f') {
return;
}
this.setFormats();
return Main.callbacks.push(this.node);
},
node: function(post) {
var alt, filename, node, _ref;
if (post.isInlined && !post.isCrosspost || !post.fileInfo) {
return;
}
node = post.fileInfo.firstElementChild;
alt = post.img.alt;
filename = ((_ref = $('span', node)) != null ? _ref.title : void 0) || node.title;
FileInfo.data = {
link: post.img.parentNode.href,
spoiler: /^Spoiler/.test(alt),
size: alt.match(/\d+\.?\d*/)[0],
unit: alt.match(/\w+$/)[0],
resolution: node.textContent.match(/\d+x\d+|PDF/)[0],
fullname: filename,
shortname: Build.shortFilename(filename, post.ID === post.threadID)
};
node.setAttribute('data-filename', filename);
return node.innerHTML = FileInfo.funk(FileInfo);
},
setFormats: function() {
var code;
code = Conf['fileInfo'].replace(/%([BKlLMnNprs])/g, function(s, c) {
if (c in FileInfo.formatters) {
return "' + f.formatters." + c + "() + '";
} else {
return s;
}
});
return this.funk = Function('f', "return '" + code + "'");
},
convertUnit: function(unitT) {
var i, size, unitF, units;
size = this.data.size;
unitF = this.data.unit;
if (unitF !== unitT) {
units = ['B', 'KB', 'MB'];
i = units.indexOf(unitF) - units.indexOf(unitT);
if (unitT === 'B') {
unitT = 'Bytes';
}
if (i > 0) {
while (i-- > 0) {
size *= 1024;
}
} else if (i < 0) {
while (i++ < 0) {
size /= 1024;
}
}
if (size < 1 && size.toString().length > size.toFixed(2).length) {
size = size.toFixed(2);
}
}
return "" + size + " " + unitT;
},
formatters: {
l: function() {
return "<a href=" + FileInfo.data.link + " target=_blank>" + (this.n()) + "</a>";
},
L: function() {
return "<a href=" + FileInfo.data.link + " target=_blank>" + (this.N()) + "</a>";
},
n: function() {
if (FileInfo.data.fullname === FileInfo.data.shortname) {
return FileInfo.data.fullname;
} else {
return "<span class=fntrunc>" + FileInfo.data.shortname + "</span><span class=fnfull>" + FileInfo.data.fullname + "</span>";
}
},
N: function() {
return FileInfo.data.fullname;
},
p: function() {
if (FileInfo.data.spoiler) {
return 'Spoiler, ';
} else {
return '';
}
},
s: function() {
return "" + FileInfo.data.size + " " + FileInfo.data.unit;
},
B: function() {
return FileInfo.convertUnit('B');
},
K: function() {
return FileInfo.convertUnit('KB');
},
M: function() {
return FileInfo.convertUnit('MB');
},
r: function() {
return FileInfo.data.resolution;
}
}
};
Get = {
post: function(board, threadID, postID, root, cb) {
var post, url;
if (board === g.BOARD && (post = $.id("pc" + postID))) {
$.add(root, Get.cleanPost(post.cloneNode(true)));
return;
}
root.textContent = "Loading post No." + postID + "...";
if (threadID) {
return $.cache("//api.4chan.org/" + board + "/res/" + threadID + ".json", function() {
return Get.parsePost(this, board, threadID, postID, root, cb);
});
} else if (url = Redirect.post(board, postID)) {
return $.cache(url, function() {
return Get.parseArchivedPost(this, board, postID, root, cb);
});
}
},
parsePost: function(req, board, threadID, postID, root, cb) {
var post, posts, spoilerRange, status, url, _i, _len;
status = req.status;
if (status !== 200) {
if (url = Redirect.post(board, postID)) {
$.cache(url, function() {
return Get.parseArchivedPost(this, board, postID, root, cb);
});
} else {
$.addClass(root, 'warning');
root.textContent = status === 404 ? "Thread No." + threadID + " 404'd." : "Error " + req.status + ": " + req.statusText + ".";
}
return;
}
posts = JSON.parse(req.response).posts;
if (spoilerRange = posts[0].custom_spoiler) {
Build.spoilerRange[board] = spoilerRange;
}
postID = +postID;
for (_i = 0, _len = posts.length; _i < _len; _i++) {
post = posts[_i];
if (post.no === postID) {
break;
}
if (post.no > postID) {
if (url = Redirect.post(board, postID)) {
$.cache(url, function() {
return Get.parseArchivedPost(this, board, postID, root, cb);
});
} else {
$.addClass(root, 'warning');
root.textContent = "Post No." + postID + " was not found.";
}
return;
}
}
$.replace(root.firstChild, Get.cleanPost(Build.postFromObject(post, board)));
if (cb) {
return cb();
}
},
parseArchivedPost: function(req, board, postID, root, cb) {
var bq, comment, data, o;
data = JSON.parse(req.response);
if (data.error) {
$.addClass(root, 'warning');
root.textContent = data.error;
return;
}
bq = $.el('blockquote', {
textContent: data.comment
});
bq.innerHTML = bq.innerHTML.replace(/\n|\[\/?b\]|\[\/?spoiler\]|\[\/?code\]|\[\/?moot\]|\[\/?banned\]/g, function(text) {
switch (text) {
case '\n':
return '<br>';
case '[b]':
return '<b>';
case '[/b]':
return '</b>';
case '[spoiler]':
return '<span class=spoiler>';
case '[/spoiler]':
return '</span>';
case '[code]':
return '<pre class=prettyprint>';
case '[/code]':
return '</pre>';
case '[moot]':
return '<div style="padding:5px;margin-left:.5em;border-color:#faa;border:2px dashed rgba(255,0,0,.1);border-radius:2px">';
case '[/moot]':
return '</div>';
case '[banned]':
return '<b style="color: red;">';
case '[/banned]':
return '</b>';
}
});
comment = bq.innerHTML.replace(/(^|>)(&gt;[^<$]+)(<|$)/g, '$1<span class=quote>$2</span>$3');
o = {
postID: postID,
threadID: data.thread_num,
board: board,
name: data.name_processed,
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 ? encodeURIComponent(data.email.replace(/&quot;/g, '"')) : '',
subject: data.title_processed,
flagCode: data.poster_country,
flagName: data.poster_country_name_processed,
date: data.fourchan_date,
dateUTC: data.timestamp,
comment: comment
};
if (data.media.media_filename) {
o.file = {
name: data.media.media_filename_processed,
timestamp: data.media.media_orig,
url: data.media.media_link || data.media.remote_media_link,
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 || ("//thumbs.4chan.org/" + board + "/thumb/" + data.media.preview_orig),
theight: data.media.preview_h,
twidth: data.media.preview_w,
isSpoiler: data.media.spoiler === '1'
};
}
$.replace(root.firstChild, Get.cleanPost(Build.post(o, true)));
if (cb) {
return cb();
}
},
cleanPost: function(root) {
var child, el, els, inline, inlined, now, post, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2;
post = $('.post', root);
_ref = Array.prototype.slice.call(root.childNodes);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
child = _ref[_i];
if (child !== post) {
$.rm(child);
}
}
_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');
}
now = Date.now();
els = $$('[id]', root);
els.push(root);
for (_l = 0, _len3 = els.length; _l < _len3; _l++) {
el = els[_l];
el.id = "" + now + "_" + el.id;
}
$.rmClass(root, 'forwarded');
$.rmClass(root, 'qphl');
$.rmClass(post, 'highlight');
$.rmClass(post, 'qphl');
root.hidden = post.hidden = false;
return root;
},
title: function(thread) {
var el, op, span;
op = $('.op', thread);
el = $('.postInfo .subject', op);
if (!el.textContent) {
el = $('blockquote', op);
if (!el.textContent) {
el = $('.nameBlock', op);
}
}
span = $.el('span', {
innerHTML: el.innerHTML.replace(/<br>/g, ' ')
});
return "/" + g.BOARD + "/ - " + (span.textContent.trim());
}
};
Build = {
spoilerRange: {},
shortFilename: function(filename, isOP) {
var threshold;
threshold = isOP ? 40 : 30;
if (filename.length - 4 > threshold) {
return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3);
} else {
return filename;
}
},
postFromObject: function(data, board) {
var o;
o = {
postID: data.no,
threadID: data.resto || data.no,
board: board,
name: data.name,
capcode: data.capcode,
tripcode: data.trip,
uniqueID: data.id,
email: data.email ? encodeURIComponent(data.email.replace(/&quot;/g, '"')) : '',
subject: data.sub,
flagCode: data.country,
flagName: data.country_name,
date: data.now,
dateUTC: data.time,
comment: data.com,
isSticky: !!data.sticky,
isClosed: !!data.closed
};
if (data.ext || data.filedeleted) {
o.file = {
name: data.filename + data.ext,
timestamp: "" + data.tim + data.ext,
url: "//images.4chan.org/" + board + "/src/" + data.tim + data.ext,
height: data.h,
width: data.w,
MD5: data.md5,
size: data.fsize,
turl: "//thumbs.4chan.org/" + board + "/thumb/" + data.tim + "s.jpg",
theight: data.tn_h,
twidth: data.tn_w,
isSpoiler: !!data.spoiler,
isDeleted: !!data.filedeleted
};
}
return Build.post(o);
},
post: function(o, isArchived) {
/*
This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS).
@license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
*/
var a, board, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref;
postID = o.postID, threadID = o.threadID, board = o.board, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file;
isOP = postID === threadID;
staticPath = '//static.4chan.org';
if (email) {
emailStart = '<a href="mailto:' + email + '" class="useremail">';
emailEnd = '</a>';
} else {
emailStart = '';
emailEnd = '';
}
subject = subject ? "<span class=subject>" + subject + "</span>" : '';
userID = !capcode && uniqueID ? (" <span class='posteruid id_" + uniqueID + "'>(ID: ") + ("<span class=hand title='Highlight posts by this ID'>" + uniqueID + "</span>)</span> ") : '';
switch (capcode) {
case 'admin':
case 'admin_highlight':
capcodeClass = " capcodeAdmin";
capcodeStart = " <strong class='capcode hand id_admin'" + "title='Highlight posts by the Administrator'>## Admin</strong>";
capcode = (" <img src='" + staticPath + "/image/adminicon.gif' ") + "alt='This user is the 4chan Administrator.' " + "title='This user is the 4chan Administrator.' class=identityIcon>";
break;
case 'mod':
capcodeClass = " capcodeMod";
capcodeStart = " <strong class='capcode hand id_mod' " + "title='Highlight posts by Moderators'>## Mod</strong>";
capcode = (" <img src='" + staticPath + "/image/modicon.gif' ") + "alt='This user is a 4chan Moderator.' " + "title='This user is a 4chan Moderator.' class=identityIcon>";
break;
case 'developer':
capcodeClass = " capcodeDeveloper";
capcodeStart = " <strong class='capcode hand id_developer' " + "title='Highlight posts by Developers'>## Developer</strong>";
capcode = (" <img src='" + staticPath + "/image/developericon.gif' ") + "alt='This user is a 4chan Developer.' " + "title='This user is a 4chan Developer.' class=identityIcon>";
break;
default:
capcodeClass = '';
capcodeStart = '';
capcode = '';
}
flag = flagCode ? (" <img src='" + staticPath + "/image/country/" + (board === 'pol' ? 'troll/' : '')) + flagCode.toLowerCase() + (".gif' alt=" + flagCode + " title='" + flagName + "' class=countryFlag>") : '';
if (file != null ? file.isDeleted : void 0) {
fileHTML = isOP ? ("<div class=file id=f" + postID + "><div class=fileInfo></div><span class=fileThumb>") + ("<img src='" + staticPath + "/image/filedeleted.gif' alt='File deleted.'>") + "</span></div>" : ("<div id=f" + postID + " class=file><span class=fileThumb>") + ("<img src='" + staticPath + "/image/filedeleted-res.gif' alt='File deleted.'>") + "</span></div>";
} else if (file) {
ext = file.name.slice(-3);
if (!file.twidth && !file.theight && ext === 'gif') {
file.twidth = file.width;
file.theight = file.height;
}
fileSize = $.bytesToString(file.size);
fileThumb = file.turl;
if (file.isSpoiler) {
fileSize = "Spoiler Image, " + fileSize;
if (!isArchived) {
fileThumb = '//static.4chan.org/image/spoiler';
if (spoilerRange = Build.spoilerRange[board]) {
fileThumb += ("-" + board) + Math.floor(1 + spoilerRange * Math.random());
}
fileThumb += '.png';
file.twidth = file.theight = 100;
}
}
imgSrc = ("<a class='fileThumb" + (file.isSpoiler ? ' imgspoiler' : '') + "' href='" + file.url + "' target=_blank>") + ("<img src='" + fileThumb + "' alt='" + fileSize + "' data-md5=" + file.MD5 + " style='width:" + file.twidth + "px;height:" + file.theight + "px'></a>");
a = $.el('a', {
innerHTML: file.name
});
filename = a.textContent.replace(/%22/g, '"');
a.textContent = Build.shortFilename(filename);
shortFilename = a.innerHTML;
a.textContent = filename;
filename = a.innerHTML.replace(/'/g, '&apos;');
fileDims = ext === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height;
fileInfo = ("<span class=fileText id=fT" + postID + (file.isSpoiler ? " title='" + filename + "'" : '') + ">File: <a href='" + file.url + "' target=_blank>" + file.timestamp + "</a>") + ("-(" + fileSize + ", " + fileDims + (file.isSpoiler ? '' : ", <span title='" + filename + "'>" + shortFilename + "</span>")) + ")</span>";
fileHTML = "<div id=f" + postID + " class=file><div class=fileInfo>" + fileInfo + "</div>" + imgSrc + "</div>";
} else {
fileHTML = '';
}
tripcode = tripcode ? " <span class=postertrip>" + tripcode + "</span>" : '';
sticky = isSticky ? ' <img src=//static.4chan.org/image/sticky.gif alt=Sticky title=Sticky style="height:16px;width:16px">' : '';
closed = isClosed ? ' <img src=//static.4chan.org/image/closed.gif alt=Closed title=Closed style="height:16px;width:16px">' : '';
container = $.el('div', {
id: "pc" + postID,
className: "postContainer " + (isOP ? 'op' : 'reply') + "Container",
innerHTML: (isOP ? '' : "<div class=sideArrows id=sa" + postID + ">&gt;&gt;</div>") + ("<div id=p" + postID + " class='post " + (isOP ? 'op' : 'reply') + (capcode === 'admin_highlight' ? ' highlightPost' : '') + "'>") + ("<div class='postInfoM mobile' id=pim" + postID + ">") + ("<span class='nameBlock" + capcodeClass + "'>") + ("<span class=name>" + (name || '') + "</span>") + tripcode + capcodeStart + capcode + userID + flag + sticky + closed + ("<br>" + subject) + ("</span><span class='dateTime postNum' data-utc=" + dateUTC + ">" + date) + '<br><em>' + ("<a href=" + ("/" + board + "/res/" + threadID + "#p" + postID) + ">No.</a>") + ("<a href='" + (g.REPLY && g.THREAD_ID === threadID ? "javascript:quote(" + postID + ")" : "/" + board + "/res/" + threadID + "#q" + postID) + "'>" + postID + "</a>") + '</em></span>' + '</div>' + (isOP ? fileHTML : '') + ("<div class='postInfo desktop' id=pi" + postID + ">") + ("<input type=checkbox name=" + postID + " value=delete> ") + ("" + subject + " ") + ("<span class='nameBlock" + capcodeClass + "'>") + emailStart + ("<span class=name>" + (name || '') + "</span>") + tripcode + capcodeStart + emailEnd + capcode + userID + flag + sticky + closed + ' </span> ' + ("<span class=dateTime data-utc=" + dateUTC + ">" + date + "</span> ") + "<span class='postNum desktop'>" + ("<a href=" + ("/" + board + "/res/" + threadID + "#p" + postID) + " title='Highlight this post'>No.</a>") + ("<a href='" + (g.REPLY && g.THREAD_ID === threadID ? "javascript:quote(" + postID + ")" : "/" + board + "/res/" + threadID + "#q" + postID) + "' title='Quote this post'>" + postID + "</a>") + '</span>' + '</div>' + (isOP ? '' : fileHTML) + ("<blockquote class=postMessage id=m" + postID + ">" + (comment || '') + "</blockquote> ") + '</div>'
});
_ref = $$('.quotelink', container);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
href = quote.getAttribute('href');
if (href[0] === '/') {
continue;
}
quote.href = "/" + board + "/res/" + href;
}
return container;
}
};
TitlePost = {
init: function() {
return d.title = Get.title();
}
};
QuoteBacklink = {
init: function() {
var format;
format = Conf['backlink'].replace(/%id/g, "' + id + '");
this.funk = Function('id', "return '" + format + "'");
return Main.callbacks.push(this.node);
},
node: function(post) {
var a, container, el, link, qid, quote, quotes, _i, _len, _ref;
if (post.isInlined) {
return;
}
quotes = {};
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (quote.parentNode.getAttribute('style') === 'font-size: smaller;') {
break;
}
if (qid = quote.hash.slice(2)) {
quotes[qid] = true;
}
}
a = $.el('a', {
href: "/" + g.BOARD + "/res/" + post.threadID + "#p" + post.ID,
className: post.el.hidden ? 'filtered backlink' : 'backlink',
textContent: QuoteBacklink.funk(post.ID)
});
for (qid in quotes) {
if (!(el = $.id("pi" + qid)) || !Conf['OP Backlinks'] && /\bop\b/.test(el.parentNode.className)) {
continue;
}
link = a.cloneNode(true);
if (Conf['Quote Preview']) {
$.on(link, 'mouseover', QuotePreview.mouseover);
}
if (Conf['Quote Inline']) {
$.on(link, 'click', QuoteInline.toggle);
}
if (!(container = $.id("blc" + qid))) {
container = $.el('span', {
className: 'container',
id: "blc" + qid
});
$.add(el, container);
}
$.add(container, [$.tn(' '), link]);
}
}
};
QuoteInline = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var quote, _i, _j, _len, _len1, _ref, _ref1;
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (!(quote.hash || /\bdeadlink\b/.test(quote.className))) {
continue;
}
$.on(quote, 'click', QuoteInline.toggle);
}
_ref1 = post.backlinks;
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
quote = _ref1[_j];
$.on(quote, 'click', QuoteInline.toggle);
}
},
toggle: function(e) {
var id;
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
e.preventDefault();
id = this.dataset.id || this.hash.slice(2);
if (/\binlined\b/.test(this.className)) {
QuoteInline.rm(this, id);
} else {
if ($.x("ancestor::div[contains(@id,'p" + id + "')]", this)) {
return;
}
QuoteInline.add(this, id);
}
return this.classList.toggle('inlined');
},
add: function(q, id) {
var board, el, inline, isBacklink, path, postID, root, threadID;
if (q.host === 'boards.4chan.org') {
path = q.pathname.split('/');
board = path[1];
threadID = path[3];
postID = id;
} else {
board = q.dataset.board;
threadID = 0;
postID = q.dataset.id;
}
el = board === g.BOARD ? $.id("p" + postID) : false;
inline = $.el('div', {
id: "i" + postID,
className: el ? 'inline' : 'inline crosspost'
});
root = (isBacklink = /\bbacklink\b/.test(q.className)) ? q.parentNode : $.x('ancestor-or-self::*[parent::blockquote][1]', q);
$.after(root, inline);
Get.post(board, threadID, postID, inline);
if (!el) {
return;
}
if (isBacklink && Conf['Forward Hiding']) {
$.addClass(el.parentNode, 'forwarded');
++el.dataset.forwarded || (el.dataset.forwarded = 1);
}
if (Unread.replies && postID in Unread.replies) {
Unread.replies.rm(postID);
return Unread.update(true);
}
},
rm: function(q, id) {
var div, inlined, _i, _len, _ref;
div = $.x("following::div[@id='i" + id + "']", q);
$.rm(div);
if (!Conf['Forward Hiding']) {
return;
}
_ref = $$('.backlink.inlined', div);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
inlined = _ref[_i];
div = $.id(inlined.hash.slice(1));
if (!--div.dataset.forwarded) {
$.rmClass(div.parentNode, 'forwarded');
}
}
if (/\bbacklink\b/.test(q.className)) {
div = $.id("p" + id);
if (!--div.dataset.forwarded) {
return $.rmClass(div.parentNode, 'forwarded');
}
}
}
};
QuotePreview = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var quote, _i, _j, _len, _len1, _ref, _ref1;
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (quote.hash || /\bdeadlink\b/.test(quote.className)) {
$.on(quote, 'mouseover', QuotePreview.mouseover);
}
}
_ref1 = post.backlinks;
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
quote = _ref1[_j];
$.on(quote, 'mouseover', QuotePreview.mouseover);
}
},
mouseover: function(e) {
var board, el, path, postID, qp, quote, quoterID, threadID, _i, _len, _ref;
if (/\binlined\b/.test(this.className)) {
return;
}
if (qp = $.id('qp')) {
if (qp === UI.el) {
delete UI.el;
}
$.rm(qp);
}
if (UI.el) {
return;
}
if (this.host === 'boards.4chan.org') {
path = this.pathname.split('/');
board = path[1];
threadID = path[3];
postID = this.hash.slice(2);
} else {
board = this.dataset.board;
threadID = 0;
postID = this.dataset.id;
}
qp = UI.el = $.el('div', {
id: 'qp',
className: 'reply dialog'
});
UI.hover(e);
$.add(d.body, qp);
if (board === g.BOARD) {
el = $.id("p" + postID);
}
Get.post(board, threadID, postID, qp, function() {
var bq, img, post;
bq = $('blockquote', qp);
Main.prettify(bq);
post = {
el: qp,
blockquote: bq,
isArchived: /\barchivedPost\b/.test(qp.className)
};
if (img = $('img[data-md5]', qp)) {
post.fileInfo = img.parentNode.previousElementSibling;
post.img = img;
}
if (Conf['Reveal Spoilers']) {
RevealSpoilers.node(post);
}
if (Conf['Image Auto-Gif']) {
AutoGif.node(post);
}
if (Conf['Time Formatting']) {
Time.node(post);
}
if (Conf['File Info Formatting']) {
FileInfo.node(post);
}
if (Conf['Resurrect Quotes']) {
return Quotify.node(post);
}
});
$.on(this, 'mousemove', UI.hover);
$.on(this, 'mouseout click', QuotePreview.mouseout);
if (!el) {
return;
}
if (Conf['Quote Highlighting']) {
if (/\bop\b/.test(el.className)) {
$.addClass(el.parentNode, 'qphl');
} else {
$.addClass(el, 'qphl');
}
}
quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0];
_ref = $$('.quotelink, .backlink', qp);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (quote.hash.slice(2) === quoterID) {
$.addClass(quote, 'forwardlink');
}
}
},
mouseout: function(e) {
var el;
UI.hoverend();
if (el = $.id(this.hash.slice(1))) {
$.rmClass(el, 'qphl');
$.rmClass(el.parentNode, 'qphl');
}
$.off(this, 'mousemove', UI.hover);
return $.off(this, 'mouseout click', QuotePreview.mouseout);
}
};
QuoteOP = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var quote, _i, _len, _ref;
if (post.isInlined && !post.isCrosspost) {
return;
}
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (quote.hash.slice(2) === post.threadID) {
$.add(quote, $.tn($.NBSP + '(OP)'));
}
}
}
};
QuoteCT = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var path, quote, _i, _len, _ref;
if (post.isInlined && !post.isCrosspost) {
return;
}
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (!quote.hash) {
continue;
}
path = quote.pathname.split('/');
if (path[1] === g.BOARD && path[3] !== post.threadID) {
$.add(quote, $.tn($.NBSP + '(Cross-thread)'));
}
}
}
};
Quotify = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var a, board, data, i, id, index, m, node, nodes, quote, quotes, snapshot, text, _i, _j, _len, _ref;
if (post.isInlined && !post.isCrosspost) {
return;
}
snapshot = $.X('.//text()[not(parent::a)][not(ancestor::pre)]', post.blockquote);
for (i = _i = 0, _ref = snapshot.snapshotLength; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
node = snapshot.snapshotItem(i);
data = node.data;
if (!(quotes = data.match(/>>(>\/[a-z\d]+\/)?\d+/g))) {
continue;
}
nodes = [];
for (_j = 0, _len = quotes.length; _j < _len; _j++) {
quote = quotes[_j];
index = data.indexOf(quote);
if (text = data.slice(0, index)) {
nodes.push($.tn(text));
}
id = quote.match(/\d+$/)[0];
board = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : $('a[title="Highlight this post"]', post.el).pathname.split('/')[1];
nodes.push(a = $.el('a', {
textContent: "" + quote + $.NBSP + "(Dead)"
}));
if (board === g.BOARD && $.id("p" + id)) {
a.href = "#p" + id;
a.className = 'quotelink';
} else {
a.href = Redirect.thread(board, 0, id);
a.className = 'deadlink';
a.target = '_blank';
if (Redirect.post(board, id)) {
$.addClass(a, 'quotelink');
a.setAttribute('data-board', board);
a.setAttribute('data-id', id);
}
}
data = data.slice(index + quote.length);
}
if (data) {
nodes.push($.tn(data));
}
$.replace(node, nodes);
}
}
};
QuoteThreading = {
init: function() {
var controls, form, input;
if (!(Conf['Unread Count'] || Conf['Unread Favicon'])) {
return;
}
Main.callbacks.push(this.node);
this.enabled = true;
controls = $.el('span', {
innerHTML: '<label>Threading<input id=threadingControl type=checkbox checked></label>'
});
input = $('input', controls);
$.on(input, 'change', QuoteThreading.toggle);
form = $('#delform');
return $.prepend(form, controls);
},
node: function(post) {
var ID, keys, pEl, pid, preply, qid, qreply, qroot, quote, quotes, replies, reply, threadContainer, uniq, _i, _len;
if (post.isInlined || !QuoteThreading.enabled) {
return;
}
quotes = post.quotes, ID = post.ID;
replies = Unread.replies;
if (!(reply = replies[ID])) {
return;
}
uniq = {};
for (_i = 0, _len = quotes.length; _i < _len; _i++) {
quote = quotes[_i];
qid = quote.hash.slice(2);
if (!(qid < ID)) {
continue;
}
if (qid in replies) {
uniq[qid] = true;
}
}
keys = Object.keys(uniq);
if (keys.length !== 1) {
return;
}
qid = keys[0];
qreply = replies[qid];
qroot = qreply.el.parentNode;
threadContainer = qroot.nextSibling;
if ((threadContainer != null ? threadContainer.className : void 0) !== 'threadContainer') {
threadContainer = $.el('div', {
className: 'threadContainer'
});
$.after(qroot, threadContainer);
}
$.add(threadContainer, reply.el.parentNode);
pEl = $.x('preceding::div[contains(@class,"post reply")][1]/parent::div', reply.el.parentNode);
pid = pEl.id.slice(2);
preply = replies[pid];
return replies.after(preply, reply);
},
toggle: function() {
var container, containers, node, nodes, replies, reply, thread, _i, _j, _k, _len, _len1, _len2;
Main.disconnect();
Unread.replies = new $.RandomAccessList;
thread = $('.thread');
replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread);
QuoteThreading.enabled = this.checked;
if (this.checked) {
nodes = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = replies.length; _i < _len; _i++) {
reply = replies[_i];
_results.push(Main.preParse(reply));
}
return _results;
})();
for (_i = 0, _len = nodes.length; _i < _len; _i++) {
node = nodes[_i];
Unread.node(node);
}
Unread.scroll();
for (_j = 0, _len1 = nodes.length; _j < _len1; _j++) {
node = nodes[_j];
QuoteThreading.node(node);
}
} else {
replies.sort(function(a, b) {
var aID, bID;
aID = Number(a.id.slice(2));
bID = Number(b.id.slice(2));
return aID - bID;
});
$.add(thread, replies);
containers = $$('.threadContainer', thread);
for (_k = 0, _len2 = containers.length; _k < _len2; _k++) {
container = containers[_k];
$.rm(container);
}
Unread.update(true);
}
return Main.observe();
},
"public": {
toggle: function() {
var control;
control = $.id('threadingControl');
control.checked = !control.checked;
return QuoteThreading.toggle.call(control);
}
}
};
DeleteLink = {
init: function() {
var aImage, aPost, children, div;
div = $.el('div', {
className: 'delete_link',
textContent: 'Delete'
});
aPost = $.el('a', {
className: 'delete_post',
href: 'javascript:;'
});
aImage = $.el('a', {
className: 'delete_image',
href: 'javascript:;'
});
children = [];
children.push({
el: aPost,
open: function() {
aPost.textContent = 'Post';
$.on(aPost, 'click', DeleteLink["delete"]);
return true;
}
});
children.push({
el: aImage,
open: function(post) {
if (!post.img) {
return false;
}
aImage.textContent = 'Image';
$.on(aImage, 'click', DeleteLink["delete"]);
return true;
}
});
Menu.addEntry({
el: div,
open: function(post) {
var node, seconds;
if (post.isArchived) {
return false;
}
node = div.firstChild;
if (seconds = DeleteLink.cooldown[post.ID]) {
node.textContent = "Delete (" + seconds + ")";
DeleteLink.cooldown.el = node;
} else {
node.textContent = 'Delete';
delete DeleteLink.cooldown.el;
}
return true;
},
children: children
});
return $.on(d, 'QRPostSuccessful', this.cooldown.start);
},
"delete": function() {
var board, form, id, m, menu, pwd, self;
menu = $.id('menu');
id = menu.dataset.id;
if (DeleteLink.cooldown[id]) {
return;
}
$.off(this, 'click', DeleteLink["delete"]);
this.textContent = 'Deleting...';
pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $.id('delPassword').value;
board = $('a[title="Highlight this post"]', $.id(menu.dataset.rootid)).pathname.split('/')[1];
self = this;
form = {
mode: 'usrdel',
onlyimgdel: /\bdelete_image\b/.test(this.className),
pwd: pwd
};
form[id] = 'delete';
return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + board + "/"), {
onload: function() {
return DeleteLink.load(self, this.response);
},
onerror: function() {
return DeleteLink.error(self);
}
}, {
form: $.formData(form)
});
},
load: function(self, html) {
var doc, msg, s;
doc = d.implementation.createHTMLDocument('');
doc.documentElement.innerHTML = html;
if (doc.title === '4chan - Banned') {
s = 'Banned!';
} else if (msg = doc.getElementById('errmsg')) {
s = msg.textContent;
$.on(self, 'click', DeleteLink["delete"]);
} else {
s = 'Deleted';
}
return self.textContent = s;
},
error: function(self) {
self.textContent = 'Connection error, please retry.';
return $.on(self, 'click', DeleteLink["delete"]);
},
cooldown: {
start: function(e) {
return DeleteLink.cooldown.count(e.detail.postID, 30);
},
count: function(postID, seconds) {
var el;
if (!((0 <= seconds && seconds <= 30))) {
return;
}
setTimeout(DeleteLink.cooldown.count, 1000, postID, seconds - 1);
el = DeleteLink.cooldown.el;
if (seconds === 0) {
if (el != null) {
el.textContent = 'Delete';
}
delete DeleteLink.cooldown[postID];
delete DeleteLink.cooldown.el;
return;
}
if (el != null) {
el.textContent = "Delete (" + seconds + ")";
}
return DeleteLink.cooldown[postID] = seconds;
}
}
};
ReportLink = {
init: function() {
var a;
a = $.el('a', {
className: 'report_link',
href: 'javascript:;',
textContent: 'Report this post'
});
$.on(a, 'click', this.report);
return Menu.addEntry({
el: a,
open: function(post) {
return post.isArchived === false;
}
});
},
report: function() {
var a, id, set, url;
a = $('a[title="Highlight this post"]', $.id(this.parentNode.dataset.rootid));
url = "//sys.4chan.org/" + (a.pathname.split('/')[1]) + "/imgboard.php?mode=report&no=" + this.parentNode.dataset.id;
id = Date.now();
set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200";
return window.open(url, id, set);
}
};
DownloadLink = {
init: function() {
var a;
if ($.el('a').download === void 0) {
return;
}
a = $.el('a', {
className: 'download_link',
textContent: 'Download file'
});
return Menu.addEntry({
el: a,
open: function(post) {
var fileText;
if (!post.img) {
return false;
}
a.href = post.img.parentNode.href;
fileText = post.fileInfo.firstElementChild;
a.download = Conf['File Info Formatting'] ? fileText.dataset.filename : $('span', fileText).title;
return true;
}
});
}
};
ArchiveLink = {
init: function() {
var a;
a = $.el('a', {
className: 'archive_link',
target: '_blank',
textContent: 'Archived post'
});
return Menu.addEntry({
el: a,
open: function(post) {
var href, path;
path = $('a[title="Highlight this post"]', post.el).pathname.split('/');
if ((href = Redirect.thread(path[1], path[3], post.ID)) === ("//boards.4chan.org/" + path[1] + "/")) {
return false;
}
a.href = href;
return true;
}
});
}
};
ThreadStats = {
init: function() {
var dialog;
dialog = UI.dialog('stats', 'bottom: 0; left: 0;', '<div class=move><span id=postcount>0</span> / <span id=imagecount>0</span></div>');
dialog.className = 'dialog';
$.add(d.body, dialog);
this.posts = this.images = 0;
this.imgLimit = (function() {
switch (g.BOARD) {
case 'a':
case 'b':
case 'v':
case 'co':
case 'mlp':
return 251;
case 'vg':
return 376;
default:
return 151;
}
})();
return Main.callbacks.push(this.node);
},
node: function(post) {
var imgcount;
if (post.isInlined) {
return;
}
$.id('postcount').textContent = ++ThreadStats.posts;
if (!post.img) {
return;
}
imgcount = $.id('imagecount');
imgcount.textContent = ++ThreadStats.images;
if (ThreadStats.images > ThreadStats.imgLimit) {
return $.addClass(imgcount, 'warning');
}
}
};
Unread = {
init: function() {
this.replies = new $.RandomAccessList;
this.title = d.title;
$.on(d, 'QRPostSuccessful', this.post);
this.update();
$.on(window, 'scroll', Unread.scroll);
return Main.callbacks.push(this.node);
},
foresee: [],
post: function(e) {
return Unread.foresee.push(e.detail.postID);
},
node: function(post) {
var el, index, replies;
el = post.el;
if ((index = Unread.foresee.indexOf(post.ID)) !== -1) {
Unread.foresee.splice(index, 1);
return;
}
if (el.hidden || /\bop\b/.test(post["class"]) || post.isInlined) {
return;
}
replies = Unread.replies;
replies.push(post.ID, el);
return Unread.update(replies.length === 1);
},
scroll: function() {
var bottom, first, height, replies, update;
height = d.documentElement.clientHeight;
replies = Unread.replies;
first = replies.first;
update = false;
while (first) {
bottom = first.el.getBoundingClientRect().bottom;
if (bottom > height) {
break;
}
update = true;
replies.shift();
first = replies.first;
}
if (!update) {
return;
}
return Unread.update(replies.length === 0);
},
setTitle: function(count) {
return d.title = "(" + count + ") " + Unread.title;
},
update: function(updateFavicon) {
var count;
if (!g.REPLY) {
return;
}
count = this.replies.length;
if (Conf['Unread Count']) {
this.setTitle(count);
}
if (!(Conf['Unread Favicon'] && updateFavicon)) {
return;
}
if ($.engine === 'presto') {
$.rm(Favicon.el);
}
Favicon.el.href = g.dead ? count ? Favicon.unreadDead : Favicon.dead : count ? Favicon.unread : Favicon["default"];
if (g.dead) {
$.addClass(Favicon.el, 'dead');
} else {
$.rmClass(Favicon.el, 'dead');
}
if (count) {
$.addClass(Favicon.el, 'unread');
} else {
$.rmClass(Favicon.el, 'unread');
}
if ($.engine !== 'webkit') {
return $.add(d.head, Favicon.el);
}
}
};
Favicon = {
init: function() {
var href;
this.el = $('link[rel="shortcut icon"]', d.head);
this.el.type = 'image/x-icon';
href = this.el.href;
this.SFW = /ws.ico$/.test(href);
this["default"] = href;
return this["switch"]();
},
"switch": function() {
switch (Conf['favicon']) {
case 'ferongr':
this.unreadDead = 'data:image/gif;base64,R0lGODlhEAAQAOMHAOgLAnMFAL8AAOgLAukMA/+AgP+rq////////////////////////////////////yH5BAEKAAcALAAAAAAQABAAAARZ8MhJ6xwDWIBv+AM1fEEIBIVRlNKYrtpIECuGzuwpCLg974EYiXUYkUItjGbC6VQ4omXFiKROA6qSy0A8nAo9GS3YCswIWnOvLAi0be23Z1QtdSUaqXcviQAAOw==';
this.unreadSFW = 'data:image/gif;base64,R0lGODlhEAAQAOMHAADX8QBwfgC2zADX8QDY8nnl8qLp8v///////////////////////////////////yH5BAEKAAcALAAAAAAQABAAAARZ8MhJ6xwDWIBv+AM1fEEIBIVRlNKYrtpIECuGzuwpCLg974EYiXUYkUItjGbC6VQ4omXFiKROA6qSy0A8nAo9GS3YCswIWnOvLAi0be23Z1QtdSUaqXcviQAAOw==';
this.unreadNSFW = 'data:image/gif;base64,R0lGODlhEAAQAOMHAFT+ACh5AEncAFT+AFX/Acz/su7/5v///////////////////////////////////yH5BAEKAAcALAAAAAAQABAAAARZ8MhJ6xwDWIBv+AM1fEEIBIVRlNKYrtpIECuGzuwpCLg974EYiXUYkUItjGbC6VQ4omXFiKROA6qSy0A8nAo9GS3YCswIWnOvLAi0be23Z1QtdSUaqXcviQAAOw==';
break;
case 'xat-':
this.unreadDead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA2ElEQVQ4y61TQQrCMBDMQ8WDIEV6LbT2A4og2Hq0veo7fIAH04dY9N4xmyYlpGmI2MCQTWYy3Wy2DAD7B2wWAzWgcTgVeZKlZRxHNYFi2jM18oBh0IcKtC6ixf22WT4IFLs0owxswXu9egm0Ls6bwfCFfNsJYJKfqoEkd3vgUgFVLWObtzNgVKyruC+ljSzr5OEnBzjvjcQecaQhbZgBb4CmGQw+PoMkTUtdbd8VSEPakcGxPOcsoIgUKy0LecY29BmdBrqRfjIwZ93KLs5loHvBnL3cLH/jF+C/+z5dgUysAAAAAElFTkSuQmCC';
this.unreadSFW = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA30lEQVQ4y2P4//8/AyWYgSoGQMF/GJ7Y11VVUVoyKTM9ey4Ig9ggMWQ1YA1IBvzXm34YjkH8mPyJB+Nqlp8FYRAbmxoMF6ArSNrw6T0Qf8Amh9cFMEWVR/7/A+L/uORxhgEIt5/+/3/2lf//5wAxiI0uj+4CBlBgxVUvOwtydgXQZpDmi2/+/7/0GmIQSAwkB1IDUkuUAZeABlx+g2zAZ9wGlAOjChba+LwAUgNSi2HA5Am9VciBhSsQQWyoWgZiovEDsdGI1QBYQiLJAGQalpSxyWEzAJYWkGm8clTJjQCZ1hkoVG0CygAAAABJRU5ErkJggg==';
this.unreadNSFW = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA4ElEQVQ4y2P4//8/AyWYgSoGQMF/GJ7YNbGqrKRiUnp21lwQBrFBYshqwBqQDPifdsYYjkH8mInxB+OWx58FYRAbmxoMF6ArKPmU9B6IP2CTw+sCmKKe/5X/gPg/LnmcYQDCs/63/1/9fzYQzwGz0eXRXcAACqy4ZfFnQc7u+V/xD6T55v+LQHwJbBBIDCQHUgNSS5QBt4Cab/2/jDDgMx4DykrKJ8FCG58XQGpAajEMmNw7uQo5sHAFIogNVctATDR+IDYasRoAS0gkGYBMw5IyNjlsBsDSAjKNV44quREAx58Mr9vt5wQAAAAASUVORK5CYII=';
break;
case 'Mayhem':
this.unreadDead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABIUlEQVQ4jZ2ScWuDMBDFgw4pIkU0WsoQkWAYIkXZH4N9/+/V3dmfXSrKYIFHwt17j8vdGWNMIkgFuaDgzgQnwRs4EQs5KdolUQtagRN0givEDBTEOjgtGs0Zq8F7cKqqusVxrMQLaDUWcjBSrXkn8gs51tpJSWLk9b3HUa0aNIL5gPBR1/V4kJvR7lTwl8GmAm1Gf9+c3S+89qBHa8502AsmSrtBaEBPbIbj0ah2madlNAPEccdgJDfAtWifBjqWKShRBT6KoiH8QlEUn/qt0CCjnNdmPUwmFWzj9Oe6LpKuZXcwqq88z78Pch3aZU3dPwwc2sWlfZKCW5tWluV8kGvXClLm6dYN4/aUqfCbnEOzNDGhGZbNargvxCzvMGfRJD8UaDVvgkzo6QAAAABJRU5ErkJggg==';
this.unreadSFW = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABCElEQVQ4jZ2S4crCMAxF+0OGDJEPKYrIGKOsiJSx/fJRfSAfTJNyKqXfiuDg0C25N2RJjTGmEVrhTzhw7oStsIEtsVzT4o2Jo9ALThiEM8IdHIgNaHo8mjNWg6/ske8bohPo+63QOLzmooHp8fyAICBSQkVz0QKdsFQEV6WSW/D+7+BbgbIDHcb4Kp61XyjyI16zZ8JemGltQtDBSGxB4/GoN+7TpkkjDCsFArm0IYv3U0BbnYtf8BCy+JytsE0X6VyuKhPPK/GAJ14kvZZDZVV3pZIb8MZr6n4o4PDGKn0S5SdDmyq5PnXQsk+Xbhinp03FFzmHJw6xYRiWm9VxnohZ3vOcxdO8ARmXRvbWdtzQAAAAAElFTkSuQmCC';
this.unreadNSFW = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABCklEQVQ4jZ2S0WrDMAxF/TBCCKWMYhZKCSGYmFJMSNjD/mhf239qJXNcjBdTWODgRLpXKJKNMaYROuFTOHEehFb4gJZYrunwxsSXMApOmIQzwgOciE1oRjyaM1aDj+yR7xuiHvT9VmgcXnPRwO/9+wWCgEgJFc1FCwzCVhFclUpuw/u3g3cFyg50GPOjePZ+ocjPeM2RCXthpbUFwQAzsQ2Nx6PeuE+bJo0w7BQI5NKGLN5XAW11LX7BQ8jia7bCLl2kc7mqTLzuxAOeeJH0Wk6VVf0oldyEN15T948CDm+sMiZRfjK0pZIbUwcd+3TphnF62lR8kXN44hAbhmG5WQNnT8zynucsnuYJhFpBfkMzqD4AAAAASUVORK5CYII=';
break;
case 'Original':
this.unreadDead = 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAMALAAAAAAQABAAAAI/nI95wsqygIRxDgGCBhTrwF3Zxowg5H1cSopS6FrGQ82PU1951ckRmYKJVCXizLRC9kAnT0aIiR6lCFT1cigAADs=';
this.unreadSFW = 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAC6Xw////////yH5BAEKAAMALAAAAAAQABAAAAI/nI95wsqygIRxDgGCBhTrwF3Zxowg5H1cSopS6FrGQ82PU1951ckRmYKJVCXizLRC9kAnT0aIiR6lCFT1cigAADs=';
this.unreadNSFW = 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAGbMM////////yH5BAEKAAMALAAAAAAQABAAAAI/nI95wsqygIRxDgGCBhTrwF3Zxowg5H1cSopS6FrGQ82PU1951ckRmYKJVCXizLRC9kAnT0aIiR6lCFT1cigAADs=';
}
return this.unread = this.SFW ? this.unreadSFW : this.unreadNSFW;
},
empty: 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='
};
Redirect = {
image: function(board, filename) {
switch (board) {
case 'a':
case 'm':
case 'q':
case 'sp':
case 'tg':
case 'vg':
case 'wsg':
return "//archive.foolz.us/" + board + "/full_image/" + filename;
case 'u':
return "//nsfw.foolz.us/" + board + "/full_image/" + filename;
case 'ck':
case 'lit':
return "//fuuka.warosu.org/" + board + "/full_image/" + filename;
case 'cgl':
case 'g':
case 'w':
return "//archive.rebeccablacktech.com/" + board + "/full_image/" + filename;
case 'an':
case 'k':
case 'toy':
case 'x':
return "http://archive.heinessen.com/" + board + "/full_image/" + filename;
}
},
post: function(board, postID) {
switch (board) {
case 'a':
case 'co':
case 'jp':
case 'm':
case 'q':
case 'sp':
case 'tg':
case 'tv':
case 'v':
case 'vg':
case 'wsg':
case 'dev':
case 'foolz':
return "//archive.foolz.us/_/api/chan/post/?board=" + board + "&num=" + postID;
case 'u':
case 'kuku':
return "//nsfw.foolz.us/_/api/chan/post/?board=" + board + "&num=" + postID;
}
},
thread: function(board, threadID, postID) {
var path, url;
if (postID) {
postID = postID.match(/\d+/)[0];
}
path = threadID ? "" + board + "/thread/" + threadID : "" + board + "/post/" + postID;
switch (board) {
case 'a':
case 'co':
case 'm':
case 'q':
case 'sp':
case 'tg':
case 'tv':
case 'v':
case 'vg':
case 'wsg':
case 'dev':
case 'foolz':
url = "//archive.foolz.us/" + path + "/";
if (threadID && postID) {
url += "#" + postID;
}
break;
case 'u':
case 'kuku':
url = "//nsfw.foolz.us/" + path + "/";
if (threadID && postID) {
url += "#" + postID;
}
break;
case 'ck':
case 'jp':
case 'lit':
url = "//fuuka.warosu.org/" + path;
if (threadID && postID) {
url += "#p" + postID;
}
break;
case 'diy':
case 'g':
case 'sci':
url = "//archive.installgentoo.net/" + path;
if (threadID && postID) {
url += "#p" + postID;
}
break;
case 'cgl':
case 'mu':
case 'soc':
case 'w':
url = "//archive.rebeccablacktech.com/" + path;
if (threadID && postID) {
url += "#p" + postID;
}
break;
case 'an':
case 'fit':
case 'k':
case 'mlp':
case 'r9k':
case 'toy':
case 'x':
url = "http://archive.heinessen.com/" + path;
if (threadID && postID) {
url += "#p" + postID;
}
break;
case 'e':
url = "https://www.cliché.net/4chan/cgi-board.pl/" + path;
if (threadID && postID) {
url += "#p" + postID;
}
break;
default:
if (threadID) {
url = "//boards.4chan.org/" + board + "/";
}
}
return url || null;
}
};
ImageHover = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
if (!post.img) {
return;
}
return $.on(post.img, 'mouseover', ImageHover.mouseover);
},
mouseover: function() {
var el;
if (el = $.id('ihover')) {
if (el === UI.el) {
delete UI.el;
}
$.rm(el);
}
if (UI.el) {
return;
}
el = UI.el = $.el('img', {
id: 'ihover',
src: this.parentNode.href
});
$.add(d.body, el);
$.on(el, 'load', ImageHover.load);
$.on(el, 'error', ImageHover.error);
$.on(this, 'mousemove', UI.hover);
return $.on(this, 'mouseout', ImageHover.mouseout);
},
load: function() {
var style;
if (!this.parentNode) {
return;
}
style = this.style;
return UI.hover({
clientX: -45 + parseInt(style.left),
clientY: 120 + parseInt(style.top)
});
},
error: function() {
var src, timeoutID, url,
_this = this;
src = this.src.split('/');
if (!(src[2] === 'images.4chan.org' && (url = Redirect.image(src[3], src[5])))) {
if (g.dead) {
return;
}
url = "//images.4chan.org/" + src[3] + "/src/" + src[5];
}
if ($.engine !== 'webkit' && url.split('/')[2] === 'images.4chan.org') {
return;
}
timeoutID = setTimeout((function() {
return _this.src = url;
}), 3000);
if ($.engine !== 'webkit' || url.split('/')[2] !== 'images.4chan.org') {
return;
}
return $.ajax(url, {
onreadystatechange: (function() {
if (this.status === 404) {
return clearTimeout(timeoutID);
}
})
}, {
type: 'head'
});
},
mouseout: function() {
UI.hoverend();
$.off(this, 'mousemove', UI.hover);
return $.off(this, 'mouseout', ImageHover.mouseout);
}
};
AutoGif = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var gif, img, src;
img = post.img;
if (post.el.hidden || !img) {
return;
}
src = img.parentNode.href;
if (/gif$/.test(src) && !/spoiler/.test(img.src)) {
gif = $.el('img');
$.on(gif, 'load', function() {
return img.src = src;
});
return gif.src = src;
}
}
};
Prefetch = {
init: function() {
return this.dialog();
},
dialog: function() {
var controls, first, input;
controls = $.el('label', {
id: 'prefetch',
innerHTML: "Prefetch Images<input type=checkbox id=prefetch>"
});
input = $('input', controls);
$.on(input, 'change', Prefetch.change);
first = $.id('delform').firstElementChild;
if (first.id === 'imgControls') {
return $.after(first, controls);
} else {
return $.before(first, controls);
}
},
change: function() {
var img, thumb, _i, _len, _ref;
$.off(this, 'change', Prefetch.change);
_ref = $$('a.fileThumb');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
thumb = _ref[_i];
img = $.el('img', {
src: thumb.href
});
}
return Main.callbacks.push(Prefetch.node);
},
node: function(post) {
var img;
img = post.img;
if (!img) {
return;
}
return $.el('img', {
src: img.parentNode.href
});
}
};
PngFix = {
init: function() {
return Main.callbacks.push(this.node);
},
node: function(post) {
var img, png, src;
img = post.img;
if (post.el.hidden || !img) {
return;
}
src = img.parentNode.href;
if (/png$/.test(src) && !/spoiler/.test(img.src)) {
png = $.el('img');
$.on(png, 'load', function() {
return img.src = src;
});
return png.src = src;
}
}
};
ImageExpand = {
init: function() {
Main.callbacks.push(this.node);
return this.dialog();
},
node: function(post) {
var a, sp;
if (!post.img) {
return;
}
sp = FileInfo.data.spoiler;
a = post.img.parentNode;
$.on(a, 'click', ImageExpand.cb.toggle);
if (ImageExpand.on && !post.el.hidden && sp !== true) {
return ImageExpand.expand(post.img);
}
},
cb: {
toggle: function(e) {
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
e.preventDefault();
return ImageExpand.toggle(this);
},
all: function() {
var i, thumb, thumbs, _i, _j, _k, _len, _len1, _len2, _ref;
ImageExpand.on = this.checked;
if (ImageExpand.on) {
thumbs = $$('img[data-md5]');
if (Conf['Expand From Current']) {
for (i = _i = 0, _len = thumbs.length; _i < _len; i = ++_i) {
thumb = thumbs[i];
if (thumb.getBoundingClientRect().top > 0) {
break;
}
}
thumbs = thumbs.slice(i);
}
for (_j = 0, _len1 = thumbs.length; _j < _len1; _j++) {
thumb = thumbs[_j];
ImageExpand.expand(thumb);
}
} else {
_ref = $$('img[data-md5][hidden]');
for (_k = 0, _len2 = _ref.length; _k < _len2; _k++) {
thumb = _ref[_k];
ImageExpand.contract(thumb);
}
}
},
typeChange: function() {
var klass;
switch (this.value) {
case 'full':
klass = '';
break;
case 'fit width':
klass = 'fitwidth';
break;
case 'fit height':
klass = 'fitheight';
break;
case 'fit screen':
klass = 'fitwidth fitheight';
}
$.id('delform').className = klass;
if (/\bfitheight\b/.test(klass)) {
$.on(window, 'resize', ImageExpand.resize);
if (!ImageExpand.style) {
ImageExpand.style = $.addStyle('');
}
return ImageExpand.resize();
} else if (ImageExpand.style) {
return $.off(window, 'resize', ImageExpand.resize);
}
}
},
toggle: function(a) {
var rect, thumb;
thumb = a.firstChild;
if (thumb.hidden) {
rect = a.getBoundingClientRect();
if ($.engine === 'webkit') {
if (rect.top < 0) {
d.body.scrollTop += rect.top - 42;
}
if (rect.left < 0) {
d.body.scrollLeft += rect.left;
}
} else {
if (rect.top < 0) {
d.documentElement.scrollTop += rect.top - 42;
}
if (rect.left < 0) {
d.documentElement.scrollLeft += rect.left;
}
}
return ImageExpand.contract(thumb);
} else {
return ImageExpand.expand(thumb);
}
},
contract: function(thumb) {
thumb.hidden = false;
thumb.nextSibling.hidden = true;
return $.rmClass(thumb.parentNode.parentNode.parentNode.parentNode, 'image_expanded');
},
expand: function(thumb, url) {
var a, img;
if ($.x('ancestor-or-self::*[@hidden]', thumb)) {
return;
}
thumb.hidden = true;
$.addClass(thumb.parentNode.parentNode.parentNode.parentNode, 'image_expanded');
if (img = thumb.nextSibling) {
img.hidden = false;
return;
}
a = thumb.parentNode;
img = $.el('img', {
src: url || a.href
});
$.on(img, 'error', ImageExpand.error);
return $.add(a, img);
},
error: function() {
var src, thumb, timeoutID, url;
thumb = this.previousSibling;
ImageExpand.contract(thumb);
$.rm(this);
src = this.src.split('/');
if (!(src[2] === 'images.4chan.org' && (url = Redirect.image(src[3], src[5])))) {
if (g.dead) {
return;
}
url = "//images.4chan.org/" + src[3] + "/src/" + src[5];
}
if ($.engine !== 'webkit' && url.split('/')[2] === 'images.4chan.org') {
return;
}
timeoutID = setTimeout(ImageExpand.expand, 10000, thumb, url);
if ($.engine !== 'webkit' || url.split('/')[2] !== 'images.4chan.org') {
return;
}
return $.ajax(url, {
onreadystatechange: (function() {
if (this.status === 404) {
return clearTimeout(timeoutID);
}
})
}, {
type: 'head'
});
},
dialog: function() {
var controls, imageType, select;
controls = $.el('span', {
id: 'imgControls',
innerHTML: "<select id=imageType name=imageType><option value=full>Full</option><option value='fit width'>Fit Width</option><option value='fit height'>Fit Height</option value='fit screen'><option value='fit screen'>Fit Screen</option></select><label>Expand Images<input type=checkbox id=imageExpand></label>"
});
imageType = $.get('imageType', 'full');
select = $('select', controls);
select.value = imageType;
ImageExpand.cb.typeChange.call(select);
$.on(select, 'change', $.cb.value);
$.on(select, 'change', ImageExpand.cb.typeChange);
$.on($('input', controls), 'click', ImageExpand.cb.all);
return $.prepend($.id('delform'), controls);
},
resize: function() {
return ImageExpand.style.textContent = ".fitheight img[data-md5] + img {max-height:" + d.documentElement.clientHeight + "px;}";
}
};
QR = {
init: function() {
var link;
if (!$.id('postForm')) {
return;
}
Main.callbacks.push(this.node);
if (Conf['Hide Original Post Form'] || Conf['Style']) {
if (!Conf['Style']) {
link = $.el('h1', {
innerHTML: "<a href=javascript:;>" + (g.REPLY ? 'Reply to Thread' : 'Start a Thread') + "</a>"
});
$.on(link.firstChild, 'click', function() {
QR.open();
if (!g.REPLY) {
$('select', QR.el).value = 'new';
}
return $('textarea', QR.el).focus();
});
$.before($.id('postForm'), link);
}
}
if (Conf['Persistent QR'] || Conf['Style']) {
QR.dialog();
if (Conf['Auto Hide QR'] && !Conf['Style']) {
QR.hide();
}
}
$.on(d, 'dragover', QR.dragOver);
$.on(d, 'drop', QR.dropFile);
return $.on(d, 'dragstart dragend', QR.drag);
},
node: function(post) {
return $.on($('a[title="Quote this post"]', post.el), 'click', QR.quote);
},
open: function() {
if (QR.el) {
if (!Conf['Style']) {
QR.el.hidden = false;
return QR.unhide();
}
} else {
return QR.dialog();
}
},
close: function() {
var i, spoiler, _i, _len, _ref;
QR.el.hidden = true;
QR.abort();
d.activeElement.blur();
$.rmClass(QR.el, 'dump');
_ref = QR.replies;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
i = _ref[_i];
QR.replies[0].rm();
}
QR.cooldown.auto = false;
QR.status();
QR.resetFileInput();
if (!Conf['Remember Spoiler'] && (spoiler = $.id('spoiler')).checked) {
spoiler.click();
}
return QR.cleanError();
},
hide: function() {
d.activeElement.blur();
$.addClass(QR.el, 'autohide');
return $.id('autohide').checked = true;
},
unhide: function() {
$.rmClass(QR.el, 'autohide');
return $.id('autohide').checked = false;
},
toggleHide: function() {
return this.checked && QR.hide() || QR.unhide();
},
error: function(err) {
var el;
el = $('.warning', QR.el);
if (typeof err === 'string') {
el.textContent = err;
} else {
el.innerHTML = null;
$.add(el, err);
}
QR.open();
if (/captcha|verification/i.test(el.textContent)) {
$('[autocomplete]', QR.el).focus();
}
if (d.hidden || d.oHidden || d.mozHidden || d.webkitHidden) {
return alert(el.textContent);
}
},
cleanError: function() {
return $('.warning', QR.el).textContent = null;
},
status: function(data) {
var disabled, input, value;
if (data == null) {
data = {};
}
if (!QR.el) {
return;
}
if (g.dead) {
value = 404;
disabled = true;
QR.cooldown.auto = false;
}
value = QR.cooldown.seconds || data.progress || value;
input = QR.status.input;
input.value = QR.cooldown.auto && Conf['Cooldown'] ? value ? "Auto " + value : 'Auto' : value || 'Submit';
return input.disabled = disabled || false;
},
cooldown: {
init: function() {
if (!Conf['Cooldown']) {
return;
}
QR.cooldown.start($.get("/" + g.BOARD + "/cooldown", 0));
return $.sync("/" + g.BOARD + "/cooldown", QR.cooldown.start);
},
start: function(timeout) {
var seconds;
seconds = Math.floor((timeout - Date.now()) / 1000);
return QR.cooldown.count(seconds);
},
set: function(seconds) {
if (!Conf['Cooldown']) {
return;
}
QR.cooldown.count(seconds);
return $.set("/" + g.BOARD + "/cooldown", Date.now() + seconds * $.SECOND);
},
count: function(seconds) {
if (!((0 <= seconds && seconds <= 60))) {
return;
}
setTimeout(QR.cooldown.count, 1000, seconds - 1);
QR.cooldown.seconds = seconds;
if (seconds === 0) {
$["delete"]("/" + g.BOARD + "/cooldown");
if (QR.cooldown.auto) {
QR.submit();
}
}
return QR.status();
}
},
quote: function(e) {
var caretPos, id, range, s, sel, ta, text, _ref;
if (e != null) {
e.preventDefault();
}
QR.open();
if (!g.REPLY) {
$('select', QR.el).value = $.x('ancestor::div[parent::div[@class="board"]]', this).id.slice(1);
}
id = this.previousSibling.hash.slice(2);
text = ">>" + id + "\n";
sel = window.getSelection();
if ((s = sel.toString().trim()) && id === ((_ref = $.x('ancestor-or-self::blockquote', sel.anchorNode)) != null ? _ref.id.match(/\d+$/)[0] : void 0)) {
if ($.engine === 'presto') {
s = d.getSelection();
}
s = s.replace(/\n/g, '\n>');
text += ">" + s + "\n";
}
ta = $('textarea', QR.el);
caretPos = ta.selectionStart;
ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd);
ta.focus();
range = caretPos + text.length;
if ($.engine === 'presto') {
range += text.match(/\n/g).length;
}
ta.setSelectionRange(range, range);
return $.event(ta, new Event('input'));
},
characterCount: function() {
var count, counter;
counter = QR.charaCounter;
count = this.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();
QR.fileInput.call(e.dataTransfer);
return $.addClass(QR.el, 'dump');
},
fileInput: function() {
var file, _i, _len, _ref;
QR.cleanError();
if (this.files.length === 1) {
file = this.files[0];
if (file.size > this.max) {
QR.error('File too large.');
QR.resetFileInput();
} else if (-1 === QR.mimeTypes.indexOf(file.type)) {
QR.error('Unsupported file type.');
QR.resetFileInput();
} else {
QR.selected.setFile(file);
}
return;
}
_ref = this.files;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
file = _ref[_i];
if (file.size > this.max) {
QR.error("File " + file.name + " is too large.");
break;
} else if (-1 === QR.mimeTypes.indexOf(file.type)) {
QR.error("" + file.name + ": Unsupported file type.");
break;
}
if (!QR.replies[QR.replies.length - 1].file) {
QR.replies[QR.replies.length - 1].setFile(file);
} else {
new QR.reply().setFile(file);
}
}
$.addClass(QR.el, 'dump');
return QR.resetFileInput();
},
resetFileInput: function() {
var clone, input, riceFile;
input = $('[type=file]', QR.el);
input.value = null;
if (Conf['Style']) {
riceFile = $('#file', QR.el);
riceFile.textContent = null;
}
if ($.engine !== 'presto') {
return;
}
clone = $.el('input', {
type: 'file',
accept: input.accept,
max: input.max,
multiple: input.multiple,
size: input.size,
title: input.title
});
$.on(clone, 'change', QR.fileInput);
$.on(clone, 'click', function(e) {
if (e.shiftKey) {
return QR.selected.rmFile() || e.preventDefault();
}
});
return $.replace(input, clone);
},
replies: [],
reply: (function() {
function _Class() {
var persona, prev,
_this = this;
prev = QR.replies[QR.replies.length - 1];
persona = $.get('QR.persona', {});
this.name = prev ? prev.name : persona.name || null;
this.email = prev && !/^sage$/.test(prev.email) ? prev.email : Conf['Sage on /jp/'] && g.BOARD === 'jp' ? 'sage' : persona.email || null;
this.sub = prev && Conf['Remember Subject'] ? prev.sub : Conf['Remember Subject'] ? persona.sub : null;
this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false;
this.com = null;
this.el = $.el('a', {
className: 'thumbnail',
draggable: true,
href: 'javascript:;',
innerHTML: '<a class=remove>X</a><label hidden><input type=checkbox> Spoiler</label><span></span>'
});
$('input', this.el).checked = this.spoiler;
$.on(this.el, 'click', function() {
return _this.select();
});
$.on($('.remove', this.el), 'click', function(e) {
e.stopPropagation();
return _this.rm();
});
$.on($('label', this.el), 'click', function(e) {
return e.stopPropagation();
});
$.on($('input', this.el), 'change', function(e) {
_this.spoiler = e.target.checked;
if (_this.el.id === 'selected') {
return $.id('spoiler').checked = _this.spoiler;
}
});
$.before($('#addReply', QR.el), this.el);
$.on(this.el, 'dragstart', this.dragStart);
$.on(this.el, 'dragenter', this.dragEnter);
$.on(this.el, 'dragleave', this.dragLeave);
$.on(this.el, 'dragover', this.dragOver);
$.on(this.el, 'dragend', this.dragEnd);
$.on(this.el, 'drop', this.drop);
QR.replies.push(this);
}
_Class.prototype.setFile = function(file) {
var fileUrl, img, url,
_this = this;
this.file = file;
this.el.title = "" + file.name + " (" + ($.bytesToString(file.size)) + ")";
if (QR.spoiler) {
$('label', this.el).hidden = false;
}
if (!/^image/.test(file.type)) {
this.el.style.backgroundImage = null;
return;
}
url = window.URL || window.webkitURL;
if (typeof url.revokeObjectURL === "function") {
url.revokeObjectURL(this.url);
}
fileUrl = url.createObjectURL(file);
img = $.el('img');
$.on(img, 'load', function() {
var c, data, i, l, s, ui8a, _i;
s = 90 * 3;
if (img.height < s || img.width < s) {
_this.url = fileUrl;
_this.el.style.backgroundImage = "url(" + _this.url + ")";
return;
}
if (img.height <= img.width) {
img.width = s / img.height * img.width;
img.height = s;
} else {
img.height = s / img.width * img.height;
img.width = s;
}
c = $.el('canvas');
c.height = img.height;
c.width = img.width;
c.getContext('2d').drawImage(img, 0, 0, img.width, img.height);
data = atob(c.toDataURL().split(',')[1]);
l = data.length;
ui8a = new Uint8Array(l);
for (i = _i = 0; 0 <= l ? _i < l : _i > l; i = 0 <= l ? ++_i : --_i) {
ui8a[i] = data.charCodeAt(i);
}
_this.url = url.createObjectURL(new Blob([ui8a], {
type: 'image/png'
}));
_this.el.style.backgroundImage = "url(" + _this.url + ")";
return typeof url.revokeObjectURL === "function" ? url.revokeObjectURL(fileUrl) : void 0;
});
return img.src = fileUrl;
};
_Class.prototype.rmFile = function() {
var _base;
QR.resetFileInput();
delete this.file;
this.el.title = null;
this.el.style.backgroundImage = null;
if (QR.spoiler) {
$('label', this.el).hidden = true;
}
return typeof (_base = window.URL || window.webkitURL).revokeObjectURL === "function" ? _base.revokeObjectURL(this.url) : void 0;
};
_Class.prototype.select = function() {
var data, rectEl, rectList, _i, _len, _ref, _ref1;
if ((_ref = QR.selected) != null) {
_ref.el.id = null;
}
QR.selected = this;
this.el.id = 'selected';
rectEl = this.el.getBoundingClientRect();
rectList = this.el.parentNode.getBoundingClientRect();
this.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2;
_ref1 = ['name', 'email', 'sub', 'com'];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
data = _ref1[_i];
$("[name=" + data + "]", QR.el).value = this[data];
}
QR.characterCount.call($('textarea', QR.el));
return $('#spoiler', QR.el).checked = this.spoiler;
};
_Class.prototype.dragStart = function() {
return $.addClass(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, reply;
el = $('.drag', this.parentNode);
index = function(el) {
return Array.prototype.slice.call(el.parentNode.children).indexOf(el);
};
oldIndex = index(el);
newIndex = index(this);
if (oldIndex < newIndex) {
$.after(this, el);
} else {
$.before(this, el);
}
reply = QR.replies.splice(oldIndex, 1)[0];
return QR.replies.splice(newIndex, 0, reply);
};
_Class.prototype.dragEnd = function() {
var el;
$.rmClass(this, 'drag');
if (el = $('.over', this.parentNode)) {
return $.rmClass(el, 'over');
}
};
_Class.prototype.rm = function() {
var index, _base;
QR.resetFileInput();
$.rm(this.el);
index = QR.replies.indexOf(this);
if (QR.replies.length === 1) {
new QR.reply().select();
} else if (this.el.id === 'selected') {
(QR.replies[index - 1] || QR.replies[index + 1]).select();
}
QR.replies.splice(index, 1);
if (typeof (_base = window.URL || window.webkitURL).revokeObjectURL === "function") {
_base.revokeObjectURL(this.url);
}
return delete this;
};
return _Class;
})(),
captcha: {
init: function() {
var _this = this;
if (!(QR.captchaIsEnabled = !!$.id('captchaFormPart'))) {
return;
}
if ($.id('recaptcha_challenge_field_holder')) {
return this.ready();
} else {
this.onready = function() {
return _this.ready();
};
return $.on($.id('recaptcha_widget_div'), 'DOMNodeInserted', this.onready);
}
},
ready: function() {
var _this = this;
if (this.challenge = $.id('recaptcha_challenge_field_holder')) {
$.off($.id('recaptcha_widget_div'), 'DOMNodeInserted', this.onready);
delete this.onready;
} else {
return;
}
$.after($('.textarea', QR.el), $.el('div', {
className: 'captchaimg',
title: 'Reload',
innerHTML: '<img>'
}));
$.after($('.captchaimg', QR.el), $.el('div', {
className: 'captchainput',
innerHTML: '<input title=Verification class=field autocomplete=off size=1>'
}));
this.img = $('.captchaimg > img', QR.el);
this.input = $('.captchainput > input', QR.el);
$.on(this.img.parentNode, 'click', this.reload);
$.on(this.input, 'keydown', this.keydown);
$.on(this.challenge, 'DOMNodeInserted', function() {
return _this.load();
});
$.sync('captchas', function(arr) {
return _this.count(arr.length);
});
this.count($.get('captchas', []).length);
return this.reload();
},
save: function() {
var captcha, captchas, response;
if (!(response = this.input.value)) {
return;
}
captchas = $.get('captchas', []);
while ((captcha = captchas[0]) && captcha.time < Date.now()) {
captchas.shift();
}
captchas.push({
challenge: this.challenge.firstChild.value,
response: response,
time: this.timeout
});
$.set('captchas', captchas);
this.count(captchas.length);
return this.reload();
},
load: function() {
var challenge;
this.timeout = Date.now() + 4 * $.MINUTE;
challenge = this.challenge.firstChild.value;
this.img.alt = challenge;
this.img.src = "//www.google.com/recaptcha/api/image?c=" + challenge;
return this.input.value = null;
},
count: function(count) {
this.input.placeholder = (function() {
switch (count) {
case 0:
return 'Verification (Shift + Enter to cache)';
case 1:
return 'Verification (1 cached captcha)';
default:
return "Verification (" + count + " cached captchas)";
}
})();
return this.input.alt = count;
},
reload: function(focus) {
window.location = 'javascript:Recaptcha.reload("t")';
if (focus) {
return QR.captcha.input.focus();
}
},
keydown: function(e) {
var c;
c = QR.captcha;
if (e.keyCode === 8 && !c.input.value) {
c.reload();
} else if (e.keyCode === 13 && e.shiftKey) {
c.save();
} else {
return;
}
return e.preventDefault();
}
},
dialog: function() {
var fileInput, id, mimeTypes, name, qrFile, riceFile, spoiler, ta, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
if (!Conf['Style']) {
QR.el = UI.dialog('qr', 'top:0;right:0;', '\
<div class=move>\
Quick Reply <input type=checkbox id=autohide title=Auto-hide>\
<span> <a class=close title=Close>×</a></span>\
</div>\
<form>\
<div><input id=dump type=button title="Dump list" value=+ class=field><input name=name title=Name placeholder=Name class=field size=1><input name=email title=E-mail placeholder=E-mail class=field size=1><input name=sub title=Subject placeholder=Subject class=field size=1></div>\
<div id=replies><div><a id=addReply href=javascript:; title="Add a reply">+</a></div></div>\
<div class=textarea><textarea name=com title=Comment placeholder=Comment class=field></textarea><span id=charCount></span></div>\
<div><input type=file title="Shift+Click to remove the selected file." multiple size=16><input type=submit></div>\
<label id=spoilerLabel><input type=checkbox id=spoiler> Spoiler Image</label>\
<div class=warning></div>\
</form>');
} else {
QR.el = UI.dialog('qr', '', '\
<form>\
<div><input id=dump type=button title="Dump list" value=+ class=field><input name=name title=Name placeholder=Name class=field size=1><input name=email title=E-mail placeholder=E-mail class=field size=1><input name=sub title=Subject placeholder=Subject class=field size=1></div>\
<div id=replies><div><a id=addReply href=javascript:; title="Add a reply">+</a></div></div>\
<div class=textarea><textarea name=com title=Comment placeholder=Comment class=field></textarea><span id=charCount></span></div>\
<div><input type=file title="Shift+Click to remove the selected file." multiple size=16><div id=browse>Browse...</div><div id=file></div></div>\
<div id=submit><input type=submit></div>\
<div id=threadselect></div>\
<label id=spoilerLabel><input type=checkbox id=spoiler> Spoiler Image</label>\
<div class=warning></div>\
</form>');
qrFile = $("[type=file]", QR.el);
riceFile = $("#file", QR.el);
$.on(riceFile, 'click', function() {
return qrFile.click();
});
$.on($("#browse", QR.el), 'click', function() {
return qrFile.click();
});
$.on(qrFile, 'change', function() {
return riceFile.textContent = qrFile.value;
});
}
if (Conf['Remember QR size'] && $.engine === 'gecko') {
$.on(ta = $('textarea', QR.el), 'mouseup', function() {
return $.set('QR.size', this.style.cssText);
});
ta.style.cssText = $.get('QR.size', '');
}
mimeTypes = $('ul.rules').firstElementChild.textContent.trim().match(/: (.+)/)[1].toLowerCase().replace(/\w+/g, function(type) {
switch (type) {
case 'jpg':
return 'image/jpeg';
case 'pdf':
return 'application/pdf';
case 'swf':
return 'application/x-shockwave-flash';
default:
return "image/" + type;
}
});
QR.mimeTypes = mimeTypes.split(', ');
QR.mimeTypes.push('');
fileInput = $('input[type=file]', QR.el);
fileInput.max = $('input[name=MAX_FILE_SIZE]').value;
if ($.engine !== 'presto') {
fileInput.accept = mimeTypes;
}
QR.spoiler = !!$('input[name=spoiler]');
spoiler = $('#spoilerLabel', QR.el);
spoiler.hidden = !QR.spoiler;
QR.charaCounter = $('#charCount', QR.el);
ta = $('textarea', QR.el);
if (!g.REPLY) {
threads = '<option value=new>New thread</option>';
_ref = $$('.thread');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
thread = _ref[_i];
id = thread.id.slice(1);
threads += "<option value=" + id + ">Thread " + id + "</option>";
}
if (!Conf["Style"]) {
$.prepend($('.move > span', QR.el), $.el('select', {
innerHTML: threads,
title: 'Create a new thread / Reply to a thread'
}));
} else {
$.prepend($('#threadselect', QR.el), $.el('select', {
innerHTML: threads,
title: 'Create a new thread / Reply to a thread'
}));
}
$.on($('select', QR.el), 'mousedown', function(e) {
return e.stopPropagation();
});
}
if (!Conf['Style']) {
$.on($('#autohide', QR.el), 'change', QR.toggleHide);
$.on($('.close', QR.el), 'click', QR.close);
}
$.on($('#dump', QR.el), 'click', function() {
return QR.el.classList.toggle('dump');
});
$.on($('#addReply', QR.el), 'click', function() {
return new QR.reply().select();
});
$.on($('form', QR.el), 'submit', QR.submit);
$.on(ta, 'input', function() {
return QR.selected.el.lastChild.textContent = this.value;
});
$.on(ta, 'input', QR.characterCount);
$.on(fileInput, 'change', QR.fileInput);
$.on(fileInput, 'click', function(e) {
if (e.shiftKey) {
return QR.selected.rmFile() || e.preventDefault();
}
});
$.on(spoiler.firstChild, 'change', function() {
return $('input', QR.selected.el).click();
});
$.on($('.warning', QR.el), 'click', QR.cleanError);
new QR.reply().select();
_ref1 = ['name', 'email', 'sub', 'com'];
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
name = _ref1[_j];
if (Conf['Style']) {
$.on($("[name=" + name + "]", QR.el), 'focus', function() {
return QR.el.classList.add('focus');
});
$.on($("[name=" + name + "]", QR.el), 'blur', function() {
return QR.el.classList.remove('focus');
});
}
$.on($("[name=" + name + "]", QR.el), 'input', function() {
var _ref2;
QR.selected[this.name] = this.value;
if (QR.cooldown.auto && QR.selected === QR.replies[0] && (0 < (_ref2 = QR.cooldown.seconds) && _ref2 < 6)) {
return QR.cooldown.auto = false;
}
});
}
QR.status.input = $('input[type=submit]', QR.el);
QR.status();
QR.cooldown.init();
QR.captcha.init();
if (Conf['Style']) {
$.on($(".captchainput .field", QR.el), 'focus', function() {
return QR.el.classList.add('focus');
});
$.on($(".captchainput .field", QR.el), 'blur', function() {
return QR.el.classList.remove('focus');
});
}
$.add(d.body, QR.el);
return $.event(QR.el, new CustomEvent('QRDialogCreation', {
bubbles: true
}));
},
submit: function(e) {
var callbacks, captcha, captchas, challenge, err, m, opts, post, reply, response, textOnly, threadID, _ref;
if (e != null) {
e.preventDefault();
}
if (QR.cooldown.seconds) {
QR.cooldown.auto = !QR.cooldown.auto;
QR.status();
return;
}
QR.abort();
reply = QR.replies[0];
threadID = g.THREAD_ID || $('select', QR.el).value;
if (threadID === 'new') {
if (((_ref = g.BOARD) === 'vg' || _ref === 'q') && !reply.sub) {
err = 'New threads require a subject.';
} else if (!(reply.file || (textOnly = !!$('input[name=textonly]', $.id('postForm'))))) {
err = 'No file selected.';
}
} else {
if (!(reply.com || reply.file)) {
err = 'No file selected.';
}
}
if (QR.captchaIsEnabled && !err) {
captchas = $.get('captchas', []);
while ((captcha = captchas[0]) && captcha.time < Date.now()) {
captchas.shift();
}
if (captcha = captchas.shift()) {
challenge = captcha.challenge;
response = captcha.response;
} else {
challenge = QR.captcha.img.alt;
if (response = QR.captcha.input.value) {
QR.captcha.reload();
}
}
$.set('captchas', captchas);
QR.captcha.count(captchas.length);
if (!response) {
err = 'No valid captcha.';
} else {
response = response.trim();
if (!/\s/.test(response)) {
response = "" + response + " " + response;
}
}
}
if (err) {
QR.cooldown.auto = false;
QR.status();
QR.error(err);
return;
}
QR.cleanError();
QR.cooldown.auto = QR.replies.length > 1;
if (Conf['Auto Hide QR'] && !QR.cooldown.auto && !Conf['Style']) {
QR.hide();
}
if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) {
d.activeElement.blur();
}
QR.status({
progress: '...'
});
post = {
resto: threadID,
name: reply.name,
email: reply.email,
sub: reply.sub,
com: Conf['Markdown'] ? Markdown.format(reply.com) : reply.com,
upfile: reply.file,
spoiler: reply.spoiler,
textonly: textOnly,
mode: 'regist',
pwd: (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value,
recaptcha_challenge_field: challenge,
recaptcha_response_field: response
};
callbacks = {
onload: function() {
return QR.response(this.response);
},
onerror: function() {
QR.status();
return QR.error($.el('a', {
href: '//www.4chan.org/banned',
target: '_blank',
textContent: 'Connection error, or you are banned.'
}));
}
};
opts = {
form: $.formData(post),
upCallbacks: {
onload: function() {
return QR.status({
progress: '...'
});
},
onprogress: function(e) {
return QR.status({
progress: "" + (Math.round(e.loaded / e.total * 100)) + "%"
});
}
}
};
return QR.ajax = $.ajax($.id('postForm').parentNode.action, callbacks, opts);
},
response: function(html) {
var bs, doc, err, msg, persona, postID, reply, threadID, _, _ref, _ref1;
doc = d.implementation.createHTMLDocument('');
doc.documentElement.innerHTML = html;
if (doc.title === '4chan - Banned') {
bs = $$('b', doc);
err = $.el('span', {
innerHTML: /^You were issued a warning/.test($('.boxcontent', doc).textContent.trim()) ? "You were issued a warning on " + bs[0].innerHTML + " as " + bs[3].innerHTML + ".<br>Warning reason: " + bs[1].innerHTML : "You are banned! ;_;<br>Please click <a href=//www.4chan.org/banned target=_blank>HERE</a> to see the reason."
});
} else if (err = doc.getElementById('errmsg')) {
if ((_ref = $('a', err)) != null) {
_ref.target = '_blank';
}
} else if (!(msg = $('b', doc))) {
err = 'Connection error with sys.4chan.org.';
}
if (err) {
if (/captcha|verification/i.test(err) || err === 'Connection error with sys.4chan.org.') {
QR.cooldown.auto = !!$.get('captchas', []).length;
QR.cooldown.set(2);
} else {
QR.cooldown.auto = false;
}
QR.status();
QR.error(err);
return;
}
reply = QR.replies[0];
persona = $.get('QR.persona', {});
persona = {
name: reply.name,
email: /^sage$/.test(reply.email) ? persona.email : reply.email,
sub: Conf['Remember Subject'] ? reply.sub : null
};
$.set('QR.persona', persona);
_ref1 = msg.lastChild.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
$.event(QR.el, new CustomEvent('QRPostSuccessful', {
bubbles: true,
detail: {
threadID: threadID,
postID: postID
}
}));
if (threadID === '0') {
location.pathname = "/" + g.BOARD + "/res/" + postID;
} else {
QR.cooldown.auto = QR.replies.length > 1;
QR.cooldown.set(g.BOARD === 'q' || /sage/i.test(reply.email) ? 60 : 30);
if (Conf['Open Reply in New Tab'] && !g.REPLY && !QR.cooldown.auto) {
$.open("//boards.4chan.org/" + g.BOARD + "/res/" + threadID + "#p" + postID);
}
}
if (Conf['Persistent QR'] || QR.cooldown.auto || Conf['Style']) {
reply.rm();
} else {
QR.close();
}
QR.status();
return QR.resetFileInput();
},
abort: function() {
var _ref;
if ((_ref = QR.ajax) != null) {
_ref.abort();
}
delete QR.ajax;
return QR.status();
}
};
ThemeOptions = {
init: function(key) {
editMode = true;
Style.addStyle(userThemes[key]);
return this.dialog(key);
},
dialog: function(key) {
var dialog, div, header, input, item, layout, _i, _j, _len, _len1, _ref;
editTheme = userThemes[key];
editTheme["Theme"] = key;
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", "Checkbox Background", "Checkbox Border", "Checkbox Checked Background", "Buttons Background", "Buttons Border", "Focused Input Background", "Focused Input Border", "Hovered Input Background", "Hovered Input Border", "Navigation Background", "Navigation Border", "Quotelinks", "Backlinks", "Links", "Hovered Links", "Navigation Links", "Hovered Navigation Links", "Names", "Tripcodes", "Emails", "Subjects", "Text", "Inputs", "Post Numbers", "Greentext", "Sage", "Board Title", "Timestamps", "Warnings", "Shadow Color", "Dark Theme", "Custom CSS"];
dialog = $.el("div", {
id: "themeConf",
className: "reply dialog",
innerHTML: "<div id=themebar></div><hr><div id=themecontent></div><div id=save> <a href='javascript:;'>Save Theme</a></div><div id=cancel> <a href='javascript:;'>Cancel</a></div>"
});
header = $.el("div", {
innerHTML: "<input class=field name='Theme' placeholder='Theme' value='" + key + "'> by <input class=field name='Author' placeholder='Author' value='" + editTheme['Author'] + "'> <input class=field 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", dialog), header);
for (_j = 0, _len1 = layout.length; _j < _len1; _j++) {
item = layout[_j];
div = $.el("div", {
className: "themevar",
innerHTML: "<div class=optionname>" + item + "</div><div class=option><input class=field name='" + item + "' placeholder='" + item + "' value='" + editTheme[item] + "'>"
});
try {
$.on($('input', div), 'blur', function() {
editTheme[this.name] = this.value;
return Style.addStyle(editTheme);
});
} catch (err) {
console.log(err);
}
$.add($("#themecontent", dialog), div);
}
$.on($('#save > a', dialog), 'click', function() {
return ThemeOptions.save(editTheme);
});
$.on($('#cancel > a', dialog), 'click', ThemeOptions.close);
return $.add(d.body, dialog);
},
save: function(theme) {
var name;
name = theme["Theme"];
delete theme["Theme"];
if (userThemes[name]) {
if (confirm("A theme with this name already exists. Would you like to over-write?")) {
delete userThemes[name];
} else {
return;
}
}
userThemes[name] = theme;
$.set('userThemes', userThemes);
$.set("Style", name);
Conf["Style"] = name;
alert("Theme \"" + name + "\" saved.");
return this.close;
},
close: function() {
Conf['Edit Mode'] = false;
$.rm($("#themeConf", d.body));
return Style.addStyle(Conf["Style"]);
}
};
Style = {
init: function() {
return this.addStyle();
},
emoji: function(position, direction) {
var css, image, item, name, _i, _len;
css = '';
for (_i = 0, _len = Emoji.length; _i < _len; _i++) {
item = Emoji[_i];
name = item[0];
image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA' + item[1];
css = css + '\
a.useremail[href*="' + name + '"]:last-of-type::' + position + ',\
a.useremail[href*="' + name.toLowerCase() + '"]:last-of-type::' + position + ',\
a.useremail[href*="' + name.toUpperCase() + '"]:last-of-type::' + position + ' {\
content: url("' + image + '") " ";\
margin-' + direction + ': 4px !important;\
}\
';
}
return css;
},
rice: function(checkbox) {
var div;
$.addClass(checkbox, 'riced');
div = $.el('div', {
className: 'rice'
});
$.after(checkbox, div);
if (div.parentElement.tagName.toLowerCase() !== 'label') {
return $.on(div, 'click', function() {
return checkbox.click();
});
}
},
noderice: function(post) {
var checkbox;
if (checkbox = $('[type=checkbox]:not(.riced)', post.root)) {
return Style.rice(checkbox);
}
},
allrice: function() {
var checkbox, checkboxes, _i, _len, _results;
checkboxes = $$('[type=checkbox]:not(.riced)', d.body);
_results = [];
for (_i = 0, _len = checkboxes.length; _i < _len; _i++) {
checkbox = checkboxes[_i];
_results.push(Style.rice(checkbox));
}
return _results;
},
agent: function() {
switch ($.engine) {
case 'gecko':
return '-moz-';
case 'webkit':
return '-webkit-';
case 'presto':
return '-o-';
}
},
addStyle: function(theme) {
var existingStyle;
$.off(d, 'DOMNodeInserted', Style.addStyle);
if (d.head) {
if (!theme || !theme.Author) {
theme = userThemes[Conf['theme']];
}
if (existingStyle = $.id('appchan')) {
$.rm(existingStyle);
}
return $.addStyle(Style.css(theme), 'appchan');
} else {
return $.on(d, 'DOMNodeInserted', Style.addStyle);
}
},
remStyle: function() {
var current, headNode, headNodes, index, node, _i, _len, _results;
$.off(d, 'DOMNodeInserted', this.remStyle);
if (d.head && d.head.childNodes.length > 10) {
headNodes = d.head.childNodes;
headNode = headNodes.length - 1;
_results = [];
for (index = _i = 0, _len = headNodes.length; _i < _len; index = ++_i) {
node = headNodes[index];
current = headNodes[headNode - index];
if (current.nodeType === 1) {
if ((current.rel === 'stylesheet' || current.rel === 'alternate stylesheet' || current.tagName.toLowerCase() === 'style') && current.id !== 'appchan') {
_results.push($.rm(current));
} else {
_results.push(void 0);
}
} else {
_results.push(void 0);
}
}
return _results;
} else {
return $.on(d, 'DOMNodeInserted', this.remStyle);
}
},
css: function(theme) {
var agent, css, div, logoOffset, mascot, mascotnames, mascotposition, name, pagemargin, sidebarOffsetH, sidebarOffsetW;
agent = Style.agent();
css = '\
/* dialog styling */\
.dialog.reply {\
display: block;\
border: 1px solid rgba(0,0,0,.25);\
padding: 0;\
}\
.move {\
cursor: move;\
}\
label,\
.favicon {\
cursor: pointer;\
}\
a[href="javascript:;"] {\
text-decoration: none;\
}\
.warning,\
.disabledwarning {\
color: red;\
}\
.hide_thread_button:not(.hidden_thread) {\
float: left;\
}\
.thread > .hidden_thread ~ *,\
[hidden],\
#content > [name=tab]:not(:checked) + div,\
#updater:not(:hover) > :not(.move),\
.autohide:not(:hover) > form,\
#qp input,\
.forwarded,\
#qp .rice {\
display: none !important;\
}\
.menu_button {\
display: inline-block;\
}\
.menu_button > span {\
border-top: .5em solid;\
border-right: .3em solid transparent;\
border-left: .3em solid transparent;\
display: inline-block;\
margin: 2px;\
vertical-align: middle;\
}\
#menu {\
position: absolute;\
outline: none;\
}\
.entry {\
border-bottom: 1px solid rgba(0,0,0,.25);\
cursor: pointer;\
display: block;\
outline: none;\
padding: 3px 7px;\
position: relative;\
text-decoration: none;\
white-space: nowrap;\
}\
.entry:last-child {\
border: none;\
}\
.focused.entry {\
background: rgba(255,255,255,.33);\
}\
.entry.hasSubMenu {\
padding-right: 1.5em;\
}\
.hasSubMenu::after {\
content: "";\
border-left: .5em solid;\
border-top: .3em solid transparent;\
border-bottom: .3em solid transparent;\
display: inline-block;\
margin: .3em;\
position: absolute;\
right: 3px;\
}\
.hasSubMenu:not(.focused) > .subMenu {\
display: none;\
}\
.subMenu {\
position: absolute;\
left: 100%;\
top: 0;\
margin-top: -1px;\
}\
h1,\
.boardBanner {\
text-align: center;\
}\
#qr > .move {\
min-width: 300px;\
overflow: hidden;\
box-sizing: border-box;\
' + agent + 'box-sizing: border-box;\
padding: 0 2px;\
}\
#qr > .move > span {\
float: right;\
}\
#autohide,\
.close,\
#qr select,\
#dump,\
.remove,\
.captchaimg,\
#qr div.warning {\
cursor: pointer;\
}\
#qr select,\
#qr > form {\
margin: 0;\
}\
#dump {\
background: ' + agent + 'linear-gradient(#EEE, #CCC);\
width: 10%;\
}\
.gecko #dump {\
padding: 1px 0 2px;\
}\
#dump:hover,\
#dump:focus {\
background: ' + agent + 'linear-gradient(#FFF, #DDD);\
}\
#dump:active,\
.dump #dump:not(:hover):not(:focus) {\
background: ' + agent + 'linear-gradient(#CCC, #DDD);\
}\
#qr:not(.dump) #replies,\
.dump > form > label {\
display: none;\
}\
#replies {\
display: block;\
height: 100px;\
position: relative;\
' + agent + 'user-select: none;\
user-select: none;\
}\
#replies > div {\
counter-reset: thumbnails;\
top: 0; right: 0; bottom: 0; left: 0;\
margin: 0; padding: 0;\
overflow: hidden;\
position: absolute;\
white-space: pre;\
}\
#replies > div:hover {\
bottom: -10px;\
overflow-x: auto;\
z-index: 1;\
}\
.thumbnail {\
background-color: rgba(0,0,0,.2) !important;\
background-position: 50% 20% !important;\
background-size: cover !important;\
border: 1px solid #666;\
box-sizing: border-box;\
' + agent + 'box-sizing: border-box;\
cursor: move;\
display: inline-block;\
height: 90px; width: 90px;\
margin: 5px; padding: 2px;\
opacity: .5;\
outline: none;\
overflow: hidden;\
position: relative;\
text-shadow: 0 1px 1px #000;\
' + agent + 'transition: opacity .25s ease-in-out;\
vertical-align: top;\
}\
.thumbnail:hover,\
.thumbnail:focus {\
opacity: .9;\
}\
.thumbnail#selected {\
opacity: 1;\
}\
.thumbnail::before {\
counter-increment: thumbnails;\
content: counter(thumbnails);\
color: #FFF;\
font-weight: 700;\
padding: 3px;\
position: absolute;\
top: 0;\
right: 0;\
text-shadow: 0 0 3px #000, 0 0 8px #000;\
}\
.thumbnail.drag {\
box-shadow: 0 0 10px rgba(0,0,0,.5);\
}\
.thumbnail.over {\
border-color: #FFF;\
}\
.thumbnail > span {\
color: #FFF;\
}\
.remove {\
background: none;\
color: #E00;\
font-weight: 700;\
padding: 3px;\
}\
.remove:hover::after {\
content: " Remove";\
}\
.thumbnail > label {\
background: rgba(0,0,0,.5);\
color: #FFF;\
right: 0; bottom: 0; left: 0;\
position: absolute;\
text-align: center;\
}\
.thumbnail > label > input {\
margin: 0;\
}\
#addReply {\
color: #333;\
font-size: 3.5em;\
line-height: 100px;\
}\
#addReply:hover,\
#addReply:focus {\
color: #000;\
}\
.field {\
border: 1px solid #CCC;\
box-sizing: border-box;\
' + agent + 'box-sizing: border-box;\
color: #333;\
font: 13px sans-serif;\
margin: 0;\
padding: 2px 4px 3px;\
' + agent + 'transition: color .25s, border .25s;\
}\
.field:-moz-placeholder,\
.field:hover:-moz-placeholder {\
color: #AAA;\
}\
.field:hover,\
.field:focus {\
border-color: #999;\
color: #000;\
outline: none;\
}\
#qr > form > div:first-child > .field:not(#dump) {\
width: 30%;\
}\
#qr textarea.field {\
display: -webkit-box;\
min-height: 120px;\
min-width: 100%;\
}\
#charCount {\
color: #000;\
background: hsla(0, 0%, 100%, .5);\
position: absolute;\
top: 100%;\
right: 0;\
}\
#charCount.warning {\
color: red;\
}\
.captchainput > .field {\
min-width: 100%;\
}\
.captchaimg {\
text-align: center;\
}\
.captchaimg > img {\
display: block;\
height: 57px;\
width: 300px;\
}\
#qr [type=file] {\
margin: 1px 0;\
width: 70%;\
}\
#qr [type=submit] {\
margin: 1px 0;\
padding: 1px; /* not Gecko */\
width: 30%;\
}\
.gecko #qr [type=submit] {\
padding: 0 1px; /* Gecko does not respect box-sizing: border-box */\
}\
.fileText:hover .fntrunc,\
.fileText:not(:hover) .fnfull {\
display: none;\
}\
.fitwidth img[data-md5] + img {\
max-width: 100%;\
}\
.gecko .fitwidth img[data-md5] + img,\
.presto .fitwidth img[data-md5] + img {\
width: 100%;\
}\
#qr,\
#qp,\
#updater,\
#stats,\
#ihover,\
#overlay,\
#navlinks {\
position: fixed;\
}\
#ihover {\
max-height: 97%;\
max-width: 75%;\
padding-bottom: 18px;\
}\
#navlinks {\
font-size: 16px;\
top: 25px;\
right: 5px;\
}\
#overlay {\
top: 0;\
right: 0;\
width: 100%;\
height: 100%;\
background: rgba(0,0,0,.5);\
z-index: 1;\
}\
#options {\
z-index: 2;\
position: fixed;\
display: inline-block;\
padding: 5px;\
text-align: left;\
vertical-align: middle;\
left: 5%;\
right: 5%;\
top: 10%;\
bottom: 10%;\
}\
#options #style_tab + div select {\
width: 100%;\
}\
#theme_tab + div > div > div:not(.selectedtheme) h1 {\
color: transparent !important;\
}\
#theme_tab + div > div > div.selectedtheme h1 {\
right: 11px;\
}\
#theme_tab + div > div h1 {\
position: absolute;\
right: 300px;\
bottom: 10px;\
margin: 0;\
' + agent + 'transition: all .2s ease-in-out;\
}\
#theme_tab + div > div {\
margin-bottom: 3px;\
}\
#credits {\
float: right;\
}\
#options ul {\
padding: 0;\
}\
#options ul li {\
overflow: auto;\
padding: 0 5px 0 7px;\
}\
#options input:checked + .optionlabel,\
#options input:checked + .rice + .optionlabel {\
font-weight: 800;\
}\
#options input,\
#options .rice {\
float: right;\
clear: left;\
}\
#options article li {\
margin: 10px 0 10px 2em;\
}\
#options code {\
background: hsla(0, 0%, 100%, .5);\
color: #000;\
padding: 0 1px;\
}\
#options label {\
text-decoration: underline;\
}\
#options .mascots {\
text-align: center;\
padding: 0;\
}\
#options .mascot {\
display: inline;\
padding: 0;\
}\
#options .mascot div {\
border: 2px solid rgba(0,0,0,0);\
width: 200px;\
height: 250px;\
display: inline-block;\
margin: 5px;\
cursor: pointer;\
background-position: top center;\
background-repeat: no-repeat;\
background-size: 200px auto;\
}\
#options .mascot div.enabled {\
border: 2px solid rgba(0,0,0,0.5);\
background-color: rgba(255,255,255,0.1);\
}\
#content {\
overflow: auto;\
position: absolute;\
top: 2.5em;\
right: 5px;\
bottom: 5px;\
left: 5px;\
}\
.suboptions,\
#themecontent {\
overflow: auto;\
position: absolute;\
right: 0;\
bottom: 1.5em;\
left: 0;\
}\
.suboptions {\
top: 0;\
}\
#themecontent {\
top: 1.5em;\
}\
#save,\
.stylesettings {\
position: absolute;\
right: 10px;\
bottom: 0;\
}\
#cancel,\
#mascots_batch {\
position: absolute;\
left: 10px;\
bottom: 0;\
}\
#content textarea {\
font-family: monospace;\
min-height: 350px;\
resize: vertical;\
width: 100%;\
}\
#updater {\
text-align: right;\
}\
#updater:not(:hover) {\
border: none;\
background: transparent;\
}\
#updater input[type=number] {\
width: 4em;\
}\
.new {\
background: lime;\
}\
#watcher {\
padding-bottom: 5px;\
position: absolute;\
overflow: hidden;\
white-space: nowrap;\
}\
#watcher:not(:hover) {\
max-height: 220px;\
}\
#watcher > div {\
max-width: 200px;\
overflow: hidden;\
padding-left: 5px;\
padding-right: 5px;\
text-overflow: ellipsis;\
}\
#watcher > .move {\
padding-top: 5px;\
text-decoration: underline;\
}\
#qp {\
padding: 2px 2px 5px;\
}\
#qp .post {\
border: none;\
margin: 0;\
padding: 0;\
}\
#qp img {\
max-height: 300px;\
max-width: 500px;\
}\
.qphl {\
outline: 2px solid rgba(216,94,49,.7);\
}\
.quotelink.deadlink {\
text-decoration: underline !important;\
}\
.deadlink:not(.quotelink) {\
text-decoration: none !important;\
}\
.image_expanded {\
clear: both !important;\
}\
.inlined {\
opacity: .5;\
}\
.inline {\
background-color: rgba(255,255,255,0.15);\
border: 1px solid rgba(128,128,128,0.5);\
display: table;\
margin: 2px;\
padding: 2px;\
}\
.inline .post {\
background: none;\
border: none;\
margin: 0;\
padding: 0;\
}\
div.opContainer {\
display: block !important;\
}\
.opContainer.filter_highlight {\
box-shadow: inset 5px 0 rgba(255,0,0,0.5);\
}\
.filter_highlight > .reply {\
box-shadow: -5px 0 rgba(255,0,0,0.5);\
}\
.filtered,\
.quotelink.filtered {\
text-decoration: underline;\
text-decoration: line-through !important;\
}\
.quotelink.forwardlink,\
.backlink.forwardlink {\
text-decoration: none;\
border-bottom: 1px dashed;\
}\
.threadContainer {\
margin-left: 20px;\
border-left: 1px solid black;\
}\
.stub ~ * {\
display: none !important;\
}\
';
if ((Conf['Quick Reply'] && Conf['Hide Original Post Form']) || Conf['Style']) {
css += '#postForm {\
display: none;\
}';
}
if (Conf['Recursive Filtering']) {
css += '.hidden + .threadContainer {\
display: none;\
}';
}
if (Conf['Style']) {
Main.callbacks.push(this.noderice);
$.ready(this.allrice);
Conf['styleenabled'] = '1';
this.remStyle();
if (Conf['Sidebar'] === 'large') {
sidebarOffsetW = 51;
sidebarOffsetH = 17;
} else {
sidebarOffsetW = 0;
sidebarOffsetH = 0;
}
css += '\
::' + agent + 'selection {\
background: ' + theme["Text"] + ';\
color: ' + theme["Background Color"] + ';\
}\
body {\
padding: 16px 0 16px;\
}\
@media only screen and (max-width: 1100px) {\
body {\
padding-top: 32px;\
}\
}\
@media only screen and (max-width:689px) {\
body {\
padding-top: 47px;\
}\
}\
@media only screen and (max-width:553px) {\
body {\
padding-top: 62px;\
}\
}\
html,\
body {\
min-height: 100%;\
}\
html,\
body,\
input,\
select,\
textarea,\
.boardTitle {\
font-family: "' + Conf["Font"] + '";\
}\
#qr img,\
.captcha img {\
opacity: ' + Conf["Captcha Opacity"] + ';\
}\
#qp div.post .postertrip,\
#qp div.post .subject,\
.capcode,\
.container::before,\
.dateTime,\
.file,\
.fileInfo,\
.fileText,\
.fileText span:not([class])::after,\
.name,\
.postNum,\
.postertrip,\
.rules,\
.subject,\
.subjectm\
.summary,\
a,\
blockquote,\
div.post > blockquote .chanlinkify.YTLT-link.YTLT-text,\
div.reply,\
fieldset,\
textarea,\
time + span {\
font-size: ' + Conf["Font Size"] + 'px;\
}\
.globalMessage {\
bottom: auto;\
padding: 10px 5px 10px 5px;\
position: fixed;\
left: auto;\
right: 2px;\
top: -1000px;\
}\
.globalMessage b {\
font-weight: 100;\
}\
/* Cleanup */\
#absbot,\
#autohide,\
#ft li.fill,\
#imgControls label:first-of-type input,\
#imgControls .rice,\
#logo,\
#postPassword + span,\
#settingsBox[style*="display: none;"],\
.autoPagerS,\
.board > hr:last-of-type,\
.closed,\
.deleteform br,\
.entry:not(.focused) > .subMenu,\
.error:empty,\
.hidden_thread > .summary,\
.inline .report_button,\
.inline input,\
.mobile,\
.navLinksBot,\
.next,\
.postingMode,\
.prev,\
.qrHeader,\
.replyContainer > .hide_reply_button.stub ~ .reply,\
.replymode,\
.rules,\
.sideArrows:not(.hide_reply_button),\
.stylechanger,\
.warnicon,\
.warning:empty,\
.yui-menu-shadow,\
body > .postingMode ~ #delform hr,\
body > br,\
body > hr,\
div.reply[hidden],\
html body > span[style="left: 5px; position: absolute;"]:nth-of-type(0),\
table[style="text-align:center;width:100%;height:300px;"] {\
display: none !important;\
}\
div.post > blockquote .prettyprint span {\
font-family: monospace;\
}\
div.post div.file .fileThumb {\
float: left;\
margin: 3px 20px 0;\
}\
a {\
outline: 0;\
}\
#boardNavDesktop,\
#boardNavDesktop a,\
#boardNavDesktopFoot a,\
#count,\
#imageType,\
#imageType option\
#imgControls,\
#navtopright a[href="javascript:;"],\
#postcount,\
#stats,\
#timer,\
#updater,\
.pages a,\
.pages strong,\
body:not([class]) a[href="javascript:;"],\
input,\
label {\
font-size: 12px;\
text-decoration: none;\
}\
.filtered {\
text-decoration: line-through;\
}\
/* YouTube Link Title */\
div.post > blockquote .chanlinkify.YTLT-link.YTLT-na {\
text-decoration: line-through;\
}\
div.post > blockquote .chanlinkify.YTLT-link.YTLT-text {\
font-style: normal;\
}\
/* Z-INDEXES */\
#options.reply.dialog,\
#themeConf {\
z-index: 999 !important;\
}\
#qp {\
z-index: 102 !important;\
}\
#autoPagerBorderPaging,\
#boardNavDesktop,\
#boardNavDesktopFoot:hover,\
#ihover,\
#menu.reply.dialog,\
#navlinks,\
#overlay,\
#updater:hover,\
.exPopup,\
html .subMenu {\
z-index: 101 !important;\
}\
.fileThumb {\
z-index: 100 !important;\
}\
div.navLinks > a:first-of-type::after,\
.deleteform {\
z-index: 99 !important;\
}\
#qr,\
body > form #imgControls {\
z-index: 98 !important;\
}\
.fileText ~ a > img + img {\
z-index: 96 !important;\
}\
#boardNavMobile,\
#imageType,\
#imgControls label:first-of-type,\
#imgControls label:first-of-type::after,\
#stats,\
#updater {\
z-index: 10 !important;\
}\
#settingsBox {\
z-index: 9 !important;\
}\
.deleteform:hover input[type="checkbox"],\
.deleteform:hover .rice {\
z-index: 7 !important;\
}\
#boardNavDesktopFoot::after,\
#navtopright,\
.deleteform::before,\
.qrMessage,\
#navtopright .settingsWindowLink::after {\
z-index: 6 !important;\
}\
#stats,\
#watcher,\
#watcher::before,\
.menu_button,\
.postInfo input,\
.postInfo .rice,\
.sideArrows {\
z-index: 4 !important;\
}\
.boardBanner,\
.globalMessage::before,\
.replyhider a {\
z-index: 1 !important;\
}\
div.reply,\
div.reply.highlight {\
z-index: 0 !important;\
' + agent + 'box-sizing: border-box;\
}\
/* ICON POSITIONS */\
/* 4chan X Options / 4chan Options */\
#navtopright .settingsWindowLink::after {\
position: fixed;\
left: auto;\
right: 17px;\
opacity: 0.3;\
}\
#navtopright .settingsWindowLink:hover::after {\
opacity: 1;\
right: 16px;\
}\
/* 4sight */\
body > a[style="cursor: pointer; float: right;"]::after {\
font-size: 12px;\
position: fixed;\
right: 0px;\
opacity: 0.3;\
}\
body > a[style="cursor: pointer; float: right;"]:hover::after {\
opacity: 1;\
}\
/* Back */\
div.navLinks > a:first-of-type::after {\
position: fixed;\
right: ' + (230 + sidebarOffsetW) + 'px;\
cursor: pointer;\
' + agent + 'transform: scale(.8);\
opacity: 0.4;\
bottom: 1px;\
top: auto;\
}\
div.navLinks > a:first-of-type:hover::after {\
opacity: 1;\
}\
/* Delete Form */\
.deleteform::before {\
visibility: visible;\
position: fixed;\
right: ' + (210 + sidebarOffsetW) + 'px;\
' + agent + 'transform: scale(.9);\
opacity: 0.4;\
top: auto;\
bottom: 2px;\
}\
.deleteform:hover::before {\
opacity: 1;\
cursor: pointer;\
bottom: -30px;\
visibility: hidden;\
}\
/* Expand Images */\
#imgControls label:first-of-type::after {\
opacity: 0.2;\
position: relative;\
top: 4px;\
}\
#imgControls label:hover:first-of-type::after {\
opacity: 1;\
}\
/* Global Message */\
.globalMessage::before {\
height: 9px;\
position: fixed;\
right: 70px;\
min-width: 30px;\
max-width: 30px;\
padding-bottom: 5px;\
opacity: 0.4;\
}\
.globalMessage:hover::before {\
cursor: pointer;\
opacity: 1;\
}\
/* Slideout Navigation */\
#boardNavDesktopFoot::after {\
border: none;\
position: fixed;\
right: 37px;\
opacity: 0.4;\
}\
#boardNavDesktopFoot:hover::after {\
opacity: 1;\
cursor: pointer;\
}\
/* Watcher */\
#watcher::before {\
height: 9px;\
font-size: 12px;\
position: fixed;\
right: 42px;\
min-width: 30px;\
max-width: 30px;\
opacity: 0.4;\
}\
#watcher:hover::before {\
opacity: 1;\
cursor: pointer;\
}\
/* END OF ICON POSITIONS */\
.pageJump {\
position: fixed;\
top: -1000px;\
pointer-events: all;\
}\
.extButton img {\
margin-top: -4px;\
}\
#boardNavMobile select {\
font-size: 11px;\
pointer-events: all;\
}\
.qrMessage {\
position: fixed;\
right: 3px;\
bottom: 250px;\
font-size: 11px;\
font-weight: 100;\
background: none;\
border: none;\
width: ' + (248 + sidebarOffsetW) + 'px;\
}\
.boardTitle {\
font-size: 30px;\
font-weight: 400;\
}\
.boardSubtitle {\
font-size: 13px;\
}\
hr {\
padding: 0;\
height: 0;\
width: 100%;\
clear: both;\
border: none;\
}\
/* Front Page */\
.bd,\
.bd ul,\
img,\
.pages,\
#qr,\
div[id^="qr"],\
table.reply[style^="clear: both"],\
.boxcontent > hr,\
h3 {\
border: none;\
}\
.boxcontent input {\
height: 18px;\
vertical-align: bottom;\
margin-right: 1px;\
}\
a.yuimenuitemlabel {\
padding: 0 20px;\
}\
/* Navigation */\
#boardNavDesktop, /* Top Navigation */\
.pages /* Bottom Navigation */ {\
text-align: center;\
font-size: 0;\
color: transparent;\
width: auto;\
}\
#boardNavDesktop{\
width: auto;\
padding-right: 0px;\
margin-right: 0px;\
padding-top: 1px;\
padding-bottom: 3px;\
}\
#boardNavDesktopFoot {\
visibility: visible;\
position: fixed;\
top: -1000px;\
right: 2px !important;\
bottom: auto;\
width: ' + (226 + sidebarOffsetW) + 'px;\
color: transparent;\
font-size: 0;\
padding: 3px 10px 35px 10px;\
border-width: 1px;\
text-align: center;\
word-spacing: -3px;\
}\
.fileThumb {\
position: relative;\
}\
#boardNavDesktop a,\
.pages a,\
.pages strong {\
display: inline-block;\
font-size: 12px;\
border: none;\
text-align: center;\
margin: 0 1px 0 2px;\
}\
.pages {\
word-spacing: 10px;\
}\
/* moots announcements */\
.globalMessage {\
font-size: 12px;\
text-align: center;\
font-weight: 200;\
}\
.pages strong,\
a,\
.new {\
' + agent + 'transition: background-color .1s linear;\
}\
/* Post Form */\
/* Override OS-specific UI */\
#ft li,\
#ft ul,\
#options input:not([type="radio"]),\
#updater input:not([type="radio"]),\
.box-outer,\
.boxbar,\
.top-box,\
h2,\
input:not([type="radio"]),\
input[type="submit"],\
textarea {\
' + agent + 'appearance: none;\
}\
input[type=checkbox] {\
' + agent + 'appearance: checkbox !important;\
}\
/* Formatting for all postarea elements */\
#browse,\
#file,\
input,\
input.field,\
input[type="submit"],\
textarea {\
border-width: 1px !important;\
border-style: solid !important;\
padding: 1px !important;\
height: 20px !important;\
}\
#browse,\
#file,\
#qr input[type="submit"],\
#qr textarea,\
#qr .field {\
margin: 1px 0 0;\
vertical-align: bottom;\
}\
/* Width and height of all postarea elements (excluding some captcha elements) */\
textarea.field,\
#qr .field[type="password"],\
.ys_playerContainer audio,\
#qr input[title="Verification"],\
#qr > form > div {\
width: ' + (248 + sidebarOffsetW) + 'px;\
}\
/* Buttons */\
#browse,\
input[type="submit"], /* Any lingering buttons */\
input[value="Report"] {\
height: 20px;\
padding: 0;\
font-size: 12px;\
}\
#qr input[type="submit"] {\
width: 100%;\
float: left;\
clear: both;\
}\
#qr input[type="file"] {\
position: absolute;\
opacity: 0;\
z-index: -1;\
}\
#file {\
width: ' + (177 + sidebarOffsetW) + 'px;\
}\
#browse {\
text-align: center;\
width: 70px;\
margin: 1px 1px 0 0;\
}\
#browse,\
#file {\
cursor: pointer;\
' + agent + 'box-sizing: border-box;\
box-sizing: border-box;\
display: inline-block;\
}\
/* Image Hover and Image Expansion */\
#ihover {\
max-width:85%;\
max-height:85%;\
}\
#qp {\
min-width: 500px;\
}\
.fileText ~ a > img + img {\
position: relative;\
top: 0px;\
}\
#imageType {\
border: none;\
width: 90px;\
position: relative;\
bottom: 1px;\
background: none;\
}\
/* #qr dimensions */\
#qr {\
height: auto;\
}\
.top-box .menubutton,\
.boardTitle {\
background-image: none;\
}\
#delform > div:not(.thread) input,\
.deleteform input[type="checkbox"],\
.rice {\
vertical-align: middle;\
}\
#qr label input,\
.boxcontent input,\
.boxcontent textarea {\
' + agent + 'appearance: none;\
border: 0;\
}\
input[type=checkbox],\
.reply input[type=checkbox],\
#options input[type=checkbox] {\
' + agent + 'appearance: none;\
width: 12px !important;\
height: 12px !important;\
cursor: pointer;\
}\
.postingMode ~ #delform .opContainer input {\
position: relative;\
bottom: 2px;\
}\
/* Posts */\
body > .postingMode ~ #delform br[clear="left"],\
#delform center {\
position: fixed;\
bottom: -500px;\
}\
.deleteform {\
border-spacing: 0 1px;\
}\
#delform .fileText + br + a[target="_blank"] img,\
#qp div.post .fileText + br + a[target="_blank"] img {\
border: 0;\
float: left;\
margin: 5px 20px 15px;\
}\
#delform .fileText + br + a[target="_blank"] img + img {\
margin: 0 0 25px;\
}\
.fileText {\
margin-top: 17px;\
}\
.fileText span:not([class])::after {\
font-size: 13px;\
}\
#updater:hover {\
border: 0;\
}\
/* Fixes text spoilers */\
.spoiler:not(:hover),\
.spoiler:not(:hover) .quote,\
.spoiler:not(:hover) a {\
color: rgb(0,0,0);\
background-color: rgb(0,0,0);\
text-shadow: none !important;\
}\
/* Remove default "inherit" background declaration */\
.span.subject,\
.subject,\
.name,\
.postertrip {\
background: transparent;\
}\
.name {\
font-weight: 700;\
}\
/* Addons and such */\
body > div[style="width: 100%;"] {\
margin-top: 34px;\
}\
#copyright,\
#boardNavDesktop a,\
#qr td,\
#qr tr[height="73"]:nth-of-type(2),\
.menubutton a,\
.pages td,\
td[style="padding-left: 7px;"],\
div[id^="qr"] tr[height="73"]:nth-of-type(2) {\
padding: 0;\
}\
#navtopright {\
position: fixed;\
right: 60px;\
top: -100px;\
bottom: auto;\
font-size: 0;\
color: transparent;\
}\
/* Expand Images div */\
#imgControls input {\
width: 10px;\
height: 10px;\
margin: 4px 1px;\
vertical-align: top;\
}\
#imgControls label {\
font-size: 0;\
color: transparent;\
}\
#imgControls label:first-of-type {\
position: fixed;\
right: ' + (232 + sidebarOffsetW) + 'px;\
top: 0px;\
bottom: auto;\
}\
#imageType {\
position: fixed;\
right: ' + (140 + sidebarOffsetW) + 'px;\
top: 1px;\
bottom: auto;\
}\
#imgControls label:nth-of-type(2)::after {\
font-size: 12px;\
content: "Preload?";\
}\
#imgControls select {\
float: right;\
}\
#imgControls select > option {\
font-size: 80%;\
}\
/* End of Expand Images div */\
/* Reply Previews */\
#qp div.post /* 4chan x Quote Preview */ {\
max-width: 70%;\
visibility: visible;\
}\
#qp div.op {\
display: table;\
}\
#qp div.post {\
padding: 2px 6px;\
}\
#qp div.post img {\
max-width: 300px;\
height: auto;\
}\
.deleteform {\
position: fixed;\
top: -1000px;\
}\
.deleteform {\
position: fixed;\
top: -1000px;\
right: 2px;\
bottom: auto;\
width: ' + (248 + sidebarOffsetW) + 'px;\
margin: 0px;\
padding: 0px;\
font-size: 0px;\
height: 18px;\
}\
.deleteform:hover {\
position: fixed;\
right: 3px;\
}\
.deleteform input[value="Delete"],\
.deleteform input[value="Report"] {\
float: left;\
}\
.deleteform {\
width: ' + (246 + sidebarOffsetW) + 'px;\
}\
.deleteform:hover input[type="checkbox"],\
.deleteform:hover .rice {\
position: fixed;\
right: ' + (130 + sidebarOffsetW) + 'px;\
}\
.deleteform:hover::after {\
visibility: visible;\
position: fixed;\
right: ' + (50 + sidebarOffsetW) + 'px;\
font-size: 12px;\
content: "File Only";\
width: 50px;\
}\
div.navLinks {\
font-size: 0;\
visibility: hidden;\
}\
div.navLinks > a {\
position: fixed;\
top: auto;\
right: -192px;\
bottom: -1000px;\
visibility: visible;\
}\
/* File Clearer support */\
.clearbutton {\
position: fixed;\
bottom: 45px;\
right: 55px;\
}\
/* AutoPager */\
#autoPagerBorderPaging {\
position: fixed !important;\
right: 300px !important;\
bottom: 0px;\
}\
/* Appchan x options */\
#options ul {\
margin: 0;\
}\
#options ul {\
margin-bottom: 5px;\
padding-bottom: 7px;\
}\
#options ul:first-of-type {\
padding-top: 5px;\
}\
/* End of Appchan x options */\
#stats,\
#navlinks {\
top: 0 !important;\
left: auto !important;\
bottom: auto !important;\
width: 96px;\
text-align: right;\
padding: 0;\
border: 0;\
border-radius: 0;\
}\
#stats {\
right: 45px !important;\
font-size: 12px;\
position: fixed;\
cursor: default;\
}\
#navlinks {\
right: 105px !important;\
}\
#updater {\
right: 2px !important;\
top: ' + (Conf["Updater Position"] === "top" ? "0" : "auto") + ' !important;\
bottom: ' + (Conf["Updater Position"] === "bottom" ? "0" : "auto") + ' !important;\
left: auto !important;\
width: 58px !important;\
border: 0;\
font-size: 12px;\
overflow: hidden;\
padding-bottom: 2px;\
}\
#updater {\
background: none;\
}\
#count.new {\
background-color: transparent;\
}\
#updater:hover {\
width: 150px !important;\
right: 2px !important;\
}\
#updater #count:not(.new) {\
font-size: 0;\
color: transparent;\
}\
#updater #count:not(.new)::after {\
font-size: 12px;\
content: "+0";\
}\
.opContainer .favicon {\
position: relative;\
top: 2px;\
}\
#watcher {\
padding-left: 0px;\
}\
#watcher {\
padding: 1px 0;\
border-radius: 0;\
}\
#updater .move,\
#options .move,\
#stats .move {\
cursor: default !important;\
}\
/* 4sight */\
body > a[style="cursor: pointer; float: right;"] {\
position: fixed;\
top:-119px;\
right: 60px;\
font-size: 0px;\
}\
body > a[style="cursor: pointer; float: right;"] ~ div[style^="width: 100%;"] {\
display: block;\
position: fixed;\
top: 17px;\
bottom: 17px;\
left: 4px;\
right: ' + (252 + sidebarOffsetW) + 'px;\
width: auto;\
margin: 0;\
}\
body > a[style="cursor: pointer; float: right;"] ~ div[style^="width: 100%;"] > table {\
height: 100%;\
vertical-align: top;\
}\
body > a[style="cursor: pointer; float: right;"] ~ div[style^="width: 100%;"]{\
height: 95%;\
margin-top: 5px;\
margin-bottom: 5px;\
}\
#fs_status {\
width: auto;\
height: 100%;\
background: none;\
padding: 10px;\
overflow: scroll;\
}\
[alt="sticky"] + a::before {\
content: "Sticky | ";\
}\
[alt="closed"] + a::before {\
content: "Closed | ";\
}\
[alt="closed"] + a {\
text-decoration: line-through;\
}\
/* Youtube Link Title */\
.chanlinkify.YTLT-link.YTLT-text {\
font-family: monospace;\
font-size: 11px;\
}\
.fileText+br+a[target="_blank"]:hover {\
background: none;\
}\
.inline,\
#qp {\
background-color: transparent;\
border: none;\
}\
input[type="submit"]:hover {\
cursor: pointer;\
}\
/* 4chan Sounds */\
.ys_playerContainer.reply {\
position: fixed;\
bottom: 252px;\
margin: 0;\
right: 3px;\
padding-right: 0;\
padding-left: 0;\
padding-top: 0;\
}\
#qr input:focus:' + agent + 'placeholder,\
#qr textarea:focus:' + agent + 'placeholder {\
color: transparent;\
}\
img[md5] {\
image-rendering: optimizeSpeed;\
}\
input,\
textarea {\
text-rendering: geometricPrecision;\
}\
#boardNavDesktop .current {\
font-weight: bold;\
font-size: 13px;\
}\
#postPassword {\
position: relative;\
bottom: 3px;\
}\
.postContainer.inline {\
border: none;\
background: none;\
padding-bottom: 2px;\
}\
div.pagelist {\
background: none;\
border: none;\
}\
a.forwardlink {\
border: none;\
}\
.deleteform {\
border-bottom: 2px solid transparent;\
}\
.exif td {\
color: #999;\
}\
.callToAction.callToAction-big {\
font-size: 18px;\
color: rgb(255,255,255);\
}\
body > table[cellpadding="30"] h1,\
body > table[cellpadding="30"] h3 {\
position: static;\
}\
.focused.entry {\
background-color: transparent;\
}\
#menu.reply.dialog,\
html .subMenu {\
padding: 0px;\
}\
#qr #charCount {\
background: none;\
position: absolute;\
right: 2px;\
top: auto;\
bottom: 110px;\
color: ' + (theme["Dark Theme"] === "1" ? "rgba(255,255,255,0.7)" : "rgba(0,0,0,0.7)") + ';\
font-size: 10px;\
height: 20px;\
text-align: right;\
vertical-align: middle;\
padding-top: 2px;\
}\
#qr #charCount.warning {\
color: rgb(255,0,0);\
position: absolute;\
top: auto;\
right: 2px;\
bottom: 110px;\
height: 20px;\
max-height: 20px;\
border: none;\
background: none;\
}\
textarea {\
resize: none;\
}\
/* Position and Dimensions of the #qr */\
#qr {\
overflow: visible;\
position: fixed;\
top: auto !important;\
bottom: 20px !important;\
width: ' + (248 + sidebarOffsetW) + 'px;\
margin: 0;\
padding: 0;\
z-index: 5;\
background-color: transparent !important;\
}\
/* Width and height of all #qr elements (excluding some captcha elements) */\
#qr textarea {\
min-height: 0 !important;\
}\
body > .postingMode ~ #delform .reply a > img[src^="//images"] {\
position: relative;\
z-index: 96;\
}\
#qr img {\
height: 47px;\
width: ' + (248 + sidebarOffsetW) + 'px;\
}\
#dump {\
background: none;\
border: none;\
width: 20px;\
height: 17px;\
margin: 0;\
font-size: 14px;\
vertical-align: middle;\
outline: none;\
}\
#dump:hover {\
background: none;\
}\
#qr select {\
position: absolute;\
bottom: -18px;\
right: 65px;\
background: none;\
border: none;\
font-size: 12px;\
width: 128px;\
}\
#qr > form > label {\
font-size: 0px;\
color: transparent;\
}\
#qr > form > label::after {\
content: "Spoiler?";\
font-size: 12px;\
}\
.dump > form > label {\
display: block;\
visibility: hidden;\
}\
#spoilerLabel {\
position: absolute;\
bottom: -20px;\
right: 20px;\
}\
#spoilerLabel input {\
position: relative;\
top: 1px;\
left: 2px;\
}\
#qr .warning {\
position: absolute;\
bottom: -18px;\
right: 1px;\
height: 20px;\
text-align: right;\
vertical-align: middle;\
padding-top: 2px;\
max-height: 16px;\
}\
.deleteform:hover {\
top: auto;\
bottom: 0px;\
}\
.deleteform:hover input[type="checkbox"],\
.deleteform:hover .rice,\
.deleteform:hover::after {\
top: auto;\
bottom: 2px;\
}\
.deleteform:hover input[name="pwd"] {\
top: auto;\
bottom: 0px;\
}\
input[title="Verification"],\
.captchaimg img {\
margin-top: 1px;\
}\
#qr textarea.field,\
#qr div {\
min-width: 0;\
}\
html body span[style="left: 5px; position: absolute;"] a {\
height: 14px;\
padding-top: 3px;\
width: 56px;\
}\
#qr textarea.field {\
height: 88px !important;\
}\
.textarea {\
height: 89px;\
}\
hr {\
position: relative;\
top: 2px;\
}\
#updater input,\
#options input,\
#qr,\
table.reply[style^="clear: both"] {\
border: none;\
}\
#delform > div:not(.thread) select,\
.pages input[type="submit"] {\
margin: 0;\
height: 17px;\
}\
.prettyprint {\
white-space: pre-wrap;\
border-radius: 2px;\
font-size: 11px;\
}\
#themeConf {\
position: fixed;\
left: 2px;\
width: 248px;\
top: 0;\
bottom: 0;\
right: auto;\
}\
body {\
background: ' + theme["Background Color"] + ';\
background-image: ' + theme["Background Image"] + ';\
background-repeat: ' + theme["Background Repeat"] + ';\
background-attachment: ' + theme["Background Attachment"] + ';\
background-position: ' + theme["Background Position"] + ';\
}\
#content,\
#themecontent {\
background: ' + theme["Background Color"] + ';\
border: 1px solid ' + theme["Reply Border"] + ';\
padding: 5px;\
}\
.suboptions {\
padding: 5px;\
}\
.boardTitle {\
text-shadow:\
1px 1px 0 ' + theme["Background Color"] + ',\
-1px 1px 0 ' + theme["Background Color"] + ',\
1px -1px 0 ' + theme["Background Color"] + ',\
-1px -1px 0 ' + theme["Background Color"] + ',\
0px 0px 10px ' + theme["Text"] + ';\
}\
#browse,\
#ft li,\
#ft ul,\
#options .dialog,\
#qr::before,\
#watcher,\
#updater:hover,\
.box-outer,\
.boxbar,\
.deleteform input[value=Delete],\
.top-box,\
.yuimenuitem-selected,\
html body span[style="left: 5px; position: absolute;"] a,\
input[type="submit"],\
#options.reply.dialog,\
.deleteform input[value=Delete],\
input[value="Report"],\
#qr.autohide .move {\
background: ' + theme["Buttons Background"] + ';\
border: 1px solid ' + theme["Buttons Border"] + ';\
}\
#file,\
#dump,\
#options input,\
input,\
input.field,\
select,\
textarea,\
textarea.field {\
background: ' + theme["Input Background"] + ';\
border: 1px solid ' + theme["Input Border"] + ';\
color: ' + theme["Inputs"] + ';\
' + agent + 'transition: all .2s linear;\
}\
#browse:hover,\
#file:hover,\
div.navLinks > a:first-of-type:hover,\
.deleteform input:hover,\
input:hover,\
input.field:hover,\
input[type="submit"]:hover,\
select:hover,\
textarea:hover,\
textarea.field:hover {\
background: ' + theme["Hovered Input Background"] + ';\
border-color: ' + theme["Hovered Input Border"] + ';\
color: ' + theme["Inputs"] + ';\
' + agent + 'transition: all .2s linear;\
}\
input:focus,\
input.field:focus,\
input[type="submit"]:focus,\
select:focus,\
textarea:focus,\
textarea.field:focus {\
background: ' + theme["Focused Input Background"] + ';\
border-color: ' + theme["Focused Input Border"] + ';\
color: ' + theme["Inputs"] + ';\
}\
#qp div.post,\
div.reply {\
background: ' + theme["Reply Background"] + ';\
border: 1px solid ' + theme["Reply Border"] + ';\
}\
.reply.highlight {\
background: ' + theme["Highlighted Reply Background"] + ';\
border: 1px solid ' + theme["Highlighted Reply Border"] + ';\
}\
#boardNavDesktop,\
.pages {\
background: ' + theme["Navigation Background"] + ';\
border: 1px solid ' + theme["Navigation Border"] + ';\
}\
#delform {\
background: ' + theme["Thread Wrapper Background"] + ';\
border: 1px solid ' + theme["Thread Wrapper Border"] + ';\
}\
#boardNavDesktopFoot,\
#themeConf,\
#watcher,\
#watcher:hover,\
.deleteform,\
div.subMenu,\
#menu {\
background: ' + theme["Dialog Background"] + ';\
border: 1px solid ' + theme["Dialog Border"] + ';\
}\
.inline div.reply {\
/* Inline Quotes */\
background-color: ' + (theme["Dark Theme"] === "1" ? "rgba(255,255,255,0.03)" : "rgba(0,0,0,0.03)") + ';\
border: 1px solid ' + theme["Reply Border"] + ';\
box-shadow: 5px 5px 5px ' + theme["Shadow Color"] + ';\
}\
[id^="q"] .warning {\
background: ' + theme["Input Background"] + ';\
border: 1px solid ' + theme["Input Border"] + ';\
}\
.warning {\
color: ' + theme["Warnings"] + ';\
}\
a,\
#dump,\
.entry,\
div.post > blockquote a[href^="//"],\
.sideArrows a,\
div.postContainer span.postNum > .replylink {\
color: ' + theme["Links"] + ';\
}\
.postNum a {\
color: ' + theme["Post Numbers"] + ';\
}\
.subject {\
color: ' + theme["Subjects"] + ';\
font-weight: 600;\
}\
#updater:not(:hover),\
#updater:not(:hover) #count:not(.new)::after,\
.summary,\
body > form,\
body,\
html body span[style="left: 5px; position: absolute;"] a,\
input,\
.deleteform::after,\
textarea,\
.abbr,\
.boxbar,\
.boxcontent,\
.pages strong,\
.reply,\
.reply.highlight,\
#boardNavDesktop .title,\
#imgControls label::after,\
#boardNavDesktop::after,\
#updater #count:not(.new)::after,\
#qr > form > label::after,\
#qr.autohide .move,\
span.pln {\
color: ' + theme["Text"] + ';\
}\
#options ul {\
border-bottom: 1px solid ' + theme["Reply Border"] + ';\
}\
.quote {\
color: ' + theme["Greentext"] + ';\
}\
a.backlink {\
color: ' + theme["Backlinks"] + ';\
font-weight: 800;\
}\
span.quote > a.quotelink,\
a.quotelink {\
color: ' + theme["Quotelinks"] + ';\
}\
div.subMenu,\
#menu,\
#qp div.post {\
box-shadow: 5px 5px 5px ' + theme["Shadow Color"] + ';\
}\
.rice {\
cursor: pointer;\
width: 10px;\
height: 10px;\
margin: 3px;\
display: inline-block;\
background: ' + theme["Checkbox Background"] + ';\
border: 1px solid ' + theme["Checkbox Border"] + ';\
}\
#qr label input,\
#updater input,\
.bd {\
background: ' + theme["Buttons Background"] + ';\
border: 1px solid ' + theme["Buttons Border"] + ';\
}\
.pages a,\
#boardNavDesktop a {\
color: ' + theme["Navigation Links"] + ';\
}\
input[type=checkbox]:checked + .rice {\
background: ' + theme["Checkbox Checked Background"] + ';\
background-image: url(' + (theme["Dark Theme"] === "1" ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEX///////9VfPVsAAAAAXRSTlMAQObYZgAAACJJREFUeF4FwLEJACAMBMATh3WN31jLFCEIsWLHicvQFM8HVtkHPQ48rNIAAAAASUVORK5CYII=" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJBAMAAAASvxsjAAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACHRSTlMAMN9AIL8Qn+Bdi9cAAAA4SURBVHheFcSxDQAgCATANzoAcQKNjSWxcgFncQ2gcmzhikOgKLe4CgonIxxZA9g6yX8dvrF/1fuGOAZL4rd0JQAAAABJRU5ErkJggg==") + ');\
background-attachment: scroll;\
background-repeat: no-repeat;\
background-position: bottom right;\
}\
a:hover,\
#dump:hover,\
.entry:hover,\
div.post > blockquote a[href^="//"]:hover,\
.sideArrows a:hover,\
div.post div.postInfo span.postNum a:hover,\
div.postContainer span.postNum > .replylink:hover,\
.nameBlock > .useremail > .name:hover,\
.nameBlock > .useremail > .postertrip:hover {\
color: ' + theme["Hovered Links"] + ';\
}\
.boardBanner a:hover,\
#boardNavDesktop a:hover {\
color: ' + theme["Hovered Navigation Links"] + ';\
}\
.boardBanner {\
color: ' + theme["Board Title"] + ';\
}\
.name {\
color: ' + theme["Names"] + ';\
}\
.postertrip,\
.trip {\
color: ' + theme["Tripcodes"] + ';\
}\
.nameBlock > .useremail > .postertrip,\
.nameBlock > .useremail > .name {\
color: ' + theme["Emails"] + ';\
}\
.nameBlock > .useremail > .name,\
.name {\
font-weight: 600;\
}\
a.forwardlink {\
border-bottom: 1px dashed;\
}\
.qphl {\
outline-color: ' + theme["Backlinked Reply Outline"] + ';\
}\
#qr input:' + agent + 'placeholder,\
#qr textarea:' + agent + 'placeholder {\
color: ' + (theme["Dark Theme"] === "1" ? "rgba(255,255,255,0.2)" : "rgba(0,0,0,0.3)") + ' !important;\
}\
.boxcontent dd,\
#options ul {\
border-color: ' + (theme["Dark Theme"] === "1" ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)") + ';\
}\
' + theme['Custom CSS'];
if (theme['Dark Theme'] === '1') {
css += '\
.prettyprint {\
background-color: rgba(255,255,255,.1);\
border: 1px solid rgba(0,0,0,0.5);\
}\
span.tag {\
color: #96562c;\
}\
span.pun {\
color: #5b6f2a;\
}\
span.com {\
color: #a34443;\
}\
span.str,\
span.atv {\
color: #8ba446;\
}\
span.kwd {\
color: #987d3e;\
}\
span.typ,\
span.atn {\
color: #897399;\
}\
span.lit {\
color: #558773;\
}\
/* 4chan X options */\
#navtopright .settingsWindowLink::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUGNOFkVENwCAMRE8CUiYBCZOAM6Rg4CWTMAlIuH0AG9mS0f7Q67W9FmkyMoWstxGIEgljTJKIhCd59IQp9+voBHaMOUmdnqgYs41qcxLYKZhCJFCxbrZJvUfz2LCm1liappoiYUxu8AiHVw2cPIXf6sXsl/L6Vb7c++9qi5v//dgFtjLxtKnNCFwAAAAASUVORK5CYII=");\
}\
/* Delete buttons */\
.deleteform::before {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAeRJREFUOE9tlM0rRFEYh0dMPiKxkWxsyEpWshCpURbWNPkvlCwYe6VJWU+zkmytZIOttZJsaHZioQkhH8+j++p0M/U0Z8597+/83o8zhUajUcjRwu8OGIAJmIFZmIJh6IHW/Ht5kXYCxmAVzuABvuAbXuAS9mAOesFDfzVSoW42FuEYXrOXFcjzyd41rMFQiIWQThS5AAP/E8jv3RO3Bf3hSHumo5MQeWZ9CjfJ3mO2d8d3pMuysQxFHVlYaxLpKLIP07ACV/AE2zAJ63CbuVbwBAYVsjsWNqzrRJE26ART3jAYdG/8bnJwk3VJIVtsd0LIdHSiiM+LYIdcKzQOR5DWsuJD5yRyVswA09GJItEQRUbgIHETh9cMctjyHbEmphNOjGuF+eyQfGfrBjixDluI2R0La00iHUVcm+4SOJipWNWHjr0P0mLbHVOJdHQSNetjvQNv2TvvfJcV8u7sJSc4J7bY7lhYa2LNdKLIApwn8T4bjdy9O469riy8c2KL7Y7zZRq61okiujDWmduEruiIRfXuOPaRYgjEb8VMJ2rzwfoQ7GRL2lovoHfHTzoO/907nShiLX9HJL39FtYL6N1x7JuJuxAzJWtiOjr5m7P8/1FMsq0vQQVqUIcqlGEUukxHJ8EPyeEKDPe5ibUAAAAASUVORK5CYII=");\
}\
/* Return button */\
div.navLinks > a:first-of-type::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC1QTFRFAAAA5OHk5OHk5OHk5OHk5OHk5OHk5OHk5OHk5OHk5OHk5OHk5OHk5OHk5OHkJaAqNQAAAA50Uk5TABAgQFBgcICPn6+/3+9ACPafAAAASElEQVQI15XMyxKAIAxD0eCr1ZT8/+eKDCOw07O700mBT45rrDXEXgul3sn0yCwsAaGBv/cw86xc92fbl0v7z7mBzeeudhJ/3aoUA1Vr0uhDAAAAAElFTkSuQmCC");\
}\
/* Watcher */\
#watcher::before {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACpQTFRFAAAA0dLU0dLU0dLU0dLU0dLU0dLU0dLU0dLU0dLU0dLU0dLU0dLU0dLUmYS1qAAAAA10Uk5TABAgQFBggI+fv8/f74aeqbgAAABVSURBVAjXnY0xDsMwEMNo+5TYPen/3+2SpUCXlhvBgfAH2uecrcdWt5O4ewHIdVtTvmXB9BoRoIzy5DqsDIAszvXRlyfItS3kXRZA9StJ0l1f/z/xBlXVAtkqW+Q3AAAAAElFTkSuQmCC");\
}\
/* Announcement */\
.globalMessage::before {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAK5JREFUGNN1kF0RxCAMhCMBCZVQCUhAwkmohDhAAhKQEAPfDBKQUAm5B3qU3s3t425mfyJygUTBMIzMLivYaTiGoigNpxJu8aSxLeeRTiOICIGOXfQLH8aT5eD8GKE4cTo4UTDKND1uWYRGFpzXkrnKGROc9JDnKBQTjDyJjbr0b+RnteO3WpgbhYSN/QQabX1L/HqLzyA2DKdTUCodx/E7dHgoFaOgJMo4kP8gEt+mlap7ZbvCVgAAAABJRU5ErkJggg==");\
}\
/* Slideout nav */\
#boardNavDesktopFoot::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC1QTFRFAAAAzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMdShx9gAAAA50Uk5TABAgMEBggI+fr7/P3+82uMT1AAAAb0lEQVQIHQXBiQHDIAwEMOE8gGlu/3ErgWt297wAYyenT7IGjJNVqJUzsPMAniyuLODedspMQe3cKq8+8HxZOK0b9eUb6NYHO98Dv/am3FkDKq/Ktm9gp1h5AE8mxsku1M4ZMGby618yB6De7n4L/v79BDw2df22AAAAAElFTkSuQmCC");\
}\
/* 4sight */\
body > a[style="cursor: pointer; float: right;"]::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFAAAAzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMzczMIXMlggAAAA90Uk5TABAgMEBQYICPn6+/z9/vD6iGsgAAAFRJREFUCB0FwYcBwyAMADAZCCN2y//fRgIAAG0MAMSba/8eAO9EVAe0BOMAxgISMDaIBKgGewKMesS+C0A7mXPdCgCQtwIAou6/A0DUPQCgnw4A4APNOQHMJOa9jgAAAABJRU5ErkJggg==");\
}\
/* Expand */\
#imgControls label:first-of-type::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAALlJREFUKFOFkT0KwlAQhANWaUSb+AciVmLlSZLcVhttBH9QjyIIHiDOF2ZhOxeGebM7b3dfUnRdVwmN0Aq1UAqFGU2eekWSQ8RTh6HNMDqiwczNiJsnkR8Jx1RrSTKKDlE467wR9jY+XK9jN0bSKQwfGy/iqVcrMWespd82fsW7XP/XmZUmuXPsfHLHq3grHKzveef8NXjozKPH4mjAvf5rZPNLGtPAjI7ozUtfiD+1kp4LPLZxDV78APzYoty/jZXwAAAAAElFTkSuQmCC");\
}\
';
} else {
css += '\
.prettyprint {\
background-color: #e7e7e7;\
border: 1px solid #dcdcdc;\
}\
span.com {\
color: #d00;\
}\
span.str,\
span.atv {\
color: #7fa61b;\
}\
span.pun {\
color: #61663a;\
}\
span.tag {\
color: #117743;\
}\
span.kwd {\
color: #5a6F9e;\
}\
span.typ,\
span.atn {\
color: #9474bd;\
}\
span.lit {\
color: #368c72;\
}\
/* 4chan X options */\
#navtopright .settingsWindowLink::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUGNOFkVERwCAMQyMBKZOAhEng69lCChImYRKQkH0AG7fdjfaHpmmbFmkyMoWstxGIEgljTJKIhCd59IQp9+voBHaMOUmdnqgYs41qcxLYKZhCJFCxbrZJvUfz2LCm1liappoiYUxu8AiHVw2cPIXf6sXsl/L6Vb7c++9qi5v//dgFAGGyWuspVmQAAAAASUVORK5CYII=");\
}\
/* Delete buttons */\
.deleteform::before {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAftJREFUOE991M0rRFEYx/E7jYkRTWymycZmZCUrWYgUZTFrkub1T1Cy8LJXkrKWlWRrJZsZW+upSTZkJxbSmIzmXt/feK6O8aI+nnPOc+7vnHnB8zp+isVipFQq9SCJcUxjBpMYRj97op3Pfc1peujGKJtXUcEjfAR4RRUH7JlFQod+C7SQPmoG52gg+EOL9WusYehbmN1EIVfQxr9C3PUH9m1jsFAoeB6/Ino5dpMwpM68jBsn+MnW7qi+HXbP80uIKagHq2gggEKOMYUV5jU8M97BBNaZ39pen3qBlIKSqFhDQWVMoQtxZLChzbq97d93Dn5hPKegcTw6QTeMdZO4PhFqDAl4+XxeQWM4Q8t5ZkvNafgITItaQwax8ONVCNI4QcPZr+cOFTTTsajGMzaQcIKizOftEB0WHqx6pKBJvDqNJ8Y7SMHL5XIRtL/JzONYRBVu2J6aw9YITygzn7AAhaQxj/Z7Rh2gv4s3O7xJXVajHwdoIcAd1pHEGE5Qw6JCsIBLZ796IwqKYhbXFuRTb7GPMzTsoSp110KatrdO3URv+71kkMAaHmyDbhYGaCy68Ztzk3fGp9BL//zj1QBD2M5ms/fwEfyjTk8hei+/viLtMBoRDGIJF3j5JajJWg2bSCOGn/+atGjNFHUOWzjEEfawjBH06mA34QPkk++/bAlEMAAAAABJRU5ErkJggg==");\
}\
/* Return button */\
div.navLinks > a:first-of-type::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGNJREFUGNNjYKAaiC2IXY9LyiH2fuz/2P3YpBRi9wOl/mORjhWIbYBKgeB7oEIIbIgVAEnfR5JEhf2Yuu8DeQ2x/UBTgCYh7J6PajdEC6rL9+ORBgsGgO3DJY2kMAHkegbaAgCK4libswvDKwAAAABJRU5ErkJggg==");\
}\
/* Watcher */\
#watcher::before {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAALhJREFUOE+tkl0RgzAQhJFQCUhBAhJ4yENnMIEDJFRKJVRCJSCh3HfsMQfTFzI87CS5n+zuJU0ppalFdSOE9zY/x3EwvAzvBM7D2d7ObMnO8BUWW38JnCPXxSXeLDYKesNsYI+CNuWIE/Oce1YBAZgfYjtIVBNKyENAfUvzhDcp4AIvOvtT3CVrFlMNMwQb8x/PTHb3lXwSD8mb55CnBBP9SGKeNvuYdn+YdvYnpmvvXPO/7/2eVxSsk6VHBDjH8sAAAAAASUVORK5CYII=");\
}\
/* Announcement */\
.globalMessage::before {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAK5JREFUGNN1kE0VxCAMhCMBCZVQCUhAwp6+cyXEARKQgIRIQAISKiF7oEvp7ts5zuTNT0QukCgYhpHZZQU7DcdQFKXhVMItnjS25TzSaQQRIdCxi37hw3iyHJwfIxQnTgcnCkaZpscti9DIgvNaMlc5Y4KTHvIchWKCkSexUZf+jfysdvxWC3OjkLCxn0CjrW+JX2/xGcSG4XQKSqXjOH6HDg+lYhSURBkH8h9E4htm9nkTaedRxgAAAABJRU5ErkJggg==");\
}\
/* Slideout nav */\
#boardNavDesktopFoot::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEVQTFRFAAAAZ2dnzczMZ2dnzczMZ2dntLOzZ2dnq6qqZ2dnZ2dnZ2dnkI+PZ2dnjIyMqKenZ2dnZ2dnZ2dndXR0e3t7Z2dndHR03/W/BgAAABV0Uk5TABAQICAwQGBggI+fn6+vr7/P3+/vEpdk4gAAAHlJREFUCB0FwYEBgjAQBLDUCghY/aLn/qOagOWoqmMBtJHMmsnZoM2cHf3MbBjZAFtOlpzA+jbSHelwf/1WPbua8PjkiVmqcP/ke0OVmnjl+4Cr7OnW3/MGPbue4b0CI50zG2DLgTYzOvrIbNCO5KorORqg71W1d/gDBFEGZ/GMsaMAAAAASUVORK5CYII=");\
}\
/* 4sight */\
body > a[style="cursor: pointer; float: right;"]::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAH9JREFUGNONkFEZgCAMhIlABCIQgQhE8O2vQQMiEMEIi7AIRjACPqGC4ueetu/udrcZ869wBMI7ZFkREpmN+IRXlpOo+HGt3KZA6eFA6mYZ4dzlkNFbcWefW467XonGYMnU3qrFKwjCQqKi2PmD5JOARansw/0PQpkbeMpUfdUBLYs3tDb03tIAAAAASUVORK5CYII=");\
}\
/* Expand */\
#imgControls label:first-of-type::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMRJREFUKFNtks0OAUEQhOdM4iBx8XMSwb6En0dw89CciQMXvIIb9XW6pXfYpDKlu6rV9G4ppfSElbB2THTGA486GrQmfjteOnfJAKcWfbQ2IQp38WkyDMWvqY/WDEyJxkl8JoyFg4sfrjEDOflrpoUAU/CLD0CT72dB8lRiIp6niD+0NkS8lvBfJCYfPf9ZJ4v4RqovjXjh8cLUujSGWOuzyjzS71vq25a2qcB690JH6DrPL26DYSDkT2PpNeqNwFSApv8BTpBEE3rYF6oAAAAASUVORK5CYII=");\
}\
';
}
switch (Conf['4chan Banner']) {
case 'in sidebar':
logoOffset = 83 + sidebarOffsetH;
css += '\
.boardBanner img {\
position: fixed;\
width: ' + (248 + sidebarOffsetW) + 'px;\
top: 19px;\
right: 2px;\
}\
';
break;
case 'at top':
logoOffset = 0;
break;
case 'hide':
logoOffset = 0;
css += '\
.boardBanner img {\
display: none;\
}\
';
}
css += '\
#watcher::before {\
top: ' + (20 + logoOffset) + 'px;\
}\
#watcher:hover {\
top: ' + (34 + logoOffset) + 'px;\
}\
#watcher {\
position: fixed;\
top: ' + (34 + logoOffset) + 'px;\
}\
#boardNavDesktopFoot::after {\
top: ' + (19 + logoOffset) + 'px;\
}\
#boardNavDesktopFoot:hover {\
top: ' + (34 + logoOffset) + 'px;\
}\
#navtopright .settingsWindowLink::after {\
top: ' + (19 + logoOffset) + 'px;\
}\
#settingsBox {\
top: ' + (25 + logoOffset) + 'px;\
}\
body > a[style="cursor: pointer; float: right;"]::after {\
top: ' + (19 + logoOffset) + 'px;\
}\
.globalMessage::before {\
top: ' + (19 + logoOffset) + 'px;\
}\
.globalMessage:hover {\
top: ' + (34 + logoOffset) + 'px;\
}\
';
switch (Conf['Board Logo']) {
case 'in sidebar':
css += '\
.boardTitle {\
position: fixed;\
left: auto;\
right: 2px;\
top: ' + (45 + logoOffset) + 'px;\
z-index: 1;\
width: ' + (248 + sidebarOffsetW) + 'px;\
}\
.boardSubtitle {\
display: none;\
}\
';
break;
case 'hide':
css += '\
.boardTitle,\
.boardSubtitle {\
display: none;\
}\
';
}
switch (Conf['Post Form Style']) {
case 'fixed':
mascotposition = '264';
css += '\
#qr {\
right: 2px !important;\
left: auto !important;\
}\
';
break;
case 'slideout':
mascotposition = '0';
css += '\
#qr {\
right: -' + (233 + sidebarOffsetW) + 'px !important;\
left: auto !important;\
' + agent + 'transition: right .3s ease-in-out 1s, left .3s ease-in-out 1s;\
}\
#qr:hover,\
#qr.focus,\
#qr.dump {\
right: 2px !important;\
left: auto !important;\
' + agent + 'transition: right .3s linear, left .3s linear;\
}\
';
break;
case 'tabbed slideout':
mascotposition = '0';
css += '\
#qr {\
right: -' + (249 + sidebarOffsetW) + 'px !important;\
left: auto !important;\
' + agent + 'transition: right .3s ease-in-out 1s, left .3s ease-in-out 1s;\
}\
#qr:hover,\
#qr.focus,\
#qr.dump {\
right: 2px !important;\
left: auto !important;\
' + agent + 'transition: right .3s linear, left .3s linear;\
}\
#qr::before {\
' + agent + 'transform: rotate(-90deg);\
' + agent + 'transform-origin: bottom right;\
margin-left: -210px;\
margin-right: 264px;\
margin-bottom: -20px;\
width: 210px;\
display: inline-block;\
font-size: 12px;\
opacity: 0.8;\
height: 18px;\
text-align: center;\
content: "Post Form";\
padding-top: 3px;\
vertical-align: middle;\
color: ' + theme["Text"] + ';\
' + agent + 'transition: opacity .3s ease-in-out 1s;\
}\
#qr:hover::before,\
#qr.focus::before,\
#qr.dump::before {\
opacity: 0;\
' + agent + 'transition: opacity .3s linear;\
}\
';
break;
case 'transparent fade':
mascotposition = '0';
css += '\
#qr {\
right: 2px !important;\
left: auto !important;\
opacity: 0.2;\
' + agent + 'transition: opacity .3s ease-in-out 1s;\
}\
#qr:hover,\
#qr.focus,\
#qr.dump {\
opacity: 1;\
' + agent + 'transition: opacity .3s linear;\
}\
';
}
if (Conf['Fit Width Replies']) {
css += '\
.summary {\
clear: both;\
padding-left: 20px;\
display: block;\
}\
.replyContainer {\
clear: both;\
}\
.sideArrows {\
z-index: 1;\
position: absolute;\
right: 0px;\
height: 10px;\
}\
div.postInfo {\
margin: 1px 0 0;\
position: relative;\
width: 100%;\
}\
.sideArrows a,\
.sideArrows span {\
position: static;\
width: 20px;\
font-size: 9px;\
height: 10px;\
}\
.sideArrows {\
width: 20px;\
padding-top: 1px;\
}\
div.reply .report_button,\
.sideArrows,\
div.reply .postInfo input,\
div.reply .postInfo .rice,\
div.reply .menu_button {\
opacity: 0;\
}\
form .replyContainer:not(:hover) div.reply .report_button,\
form .replyContainer:not(:hover) div.reply .menu_button,\
form .replyContainer:not(:hover) .sideArrows,\
form .replyContainer:not(:hover) .postInfo input,\
.postInfo .rice {\
' + agent + 'transition: opacity .3s ease-out 0s;\
}\
form .replyContainer:hover div.reply .report_button,\
form .replyContainer:hover div.reply .menu_button,\
form .replyContainer:hover .sideArrows,\
.replyContainer:hover .postInfo input,\
.replyContainer:hover .postInfo .rice {\
opacity: 1;\
' + agent + 'transition: opacity .3s ease-in 0s;\
}\
div.reply input:checked {\
opacity: 1;\
}\
form .postContainer blockquote {\
margin-left: 30px;\
}\
div.reply {\
padding-top: 6px;\
padding-left: 10px;\
}\
div.reply .postInfo input,\
div.reply .postInfo .rice {\
position: absolute;\
top: -3px;\
right: 5px;\
}\
div.reply .report_button,\
div.reply .menu_button {\
position: absolute;\
right: 26px;\
top: -1px;\
font-size: 9px;\
}\
.sideArrows a {\
position: absolute;\
right: 40px;\
top: 7px;\
}\
.sideArrows a {\
font-size: 9px;\
}\
div.thread {\
padding: 0;\
position: relative;\
}\
div.post:not(#qp):not([hidden]) {\
margin: 0;\
width: 100%;\
}\
div.reply {\
display: table;\
clear: both;\
}\
div.sideArrows {\
float: none;\
}\
.hide_thread_button {\
position: relative;\
z-index: 2;\
margin-right: 10px;\
margin-left: 5px;\
font-size: 9px;\
}\
.opContainer input {\
opacity: 1;\
}\
#options.reply {\
display: inline-block;\
}\
';
} else {
css += '\
.sideArrows a {\
font-size: 9px;\
}\
.sideArrows a {\
position: static;\
}\
div.reply {\
padding-right: 5px;\
}\
.sideArrows {\
margin-right: 5px;\
width: 20px;\
float: left;\
}\
.sideArrows a {\
width: 20px;\
font-size: 12px;\
}\
.hide_thread_button {\
position: relative;\
z-index: 2;\
margin-right: 5px;\
}\
div.reply {\
padding-top: 5px;\
padding-left: 2px;\
display: table;\
}\
div.thread {\
overflow: visible;\
padding: 0;\
position: relative;\
}\
div.post:not(#qp):not([hidden]) {\
margin: 0;\
}\
.thread > div > .post {\
overflow: visible;\
}\
.sideArrows span {\
font-size: 9px;\
}\
.sideArrows {\
width: 20px;\
}\
.sideArrows a {\
right: 27px;\
}\
div.reply .report_button,\
div.reply .menu_button {\
right: 13px;\
}\
div.reply {\
padding-top: 6px;\
padding-left: 8px;\
}\
.sideArrows {\
margin-right: 2px;\
width: 20px;\
}\
form .postContainer blockquote {\
margin-left: 30px;\
}\
';
}
switch (Conf['Page Margin']) {
case 'none':
pagemargin = '2px';
break;
case 'small':
pagemargin = '50px';
break;
case 'medium':
pagemargin = '150px';
break;
case 'fully centered':
pagemargin = (248 + sidebarOffsetW) + 'px';
break;
case 'large':
pagemargin = '350px';
}
if (editMode && pagemargin < 250) {
pagemargin = '300px';
}
if (Conf['Sidebar'] !== 'hide') {
css += '\
body {\
margin: 1px ' + (252 + sidebarOffsetW) + 'px 0 ' + pagemargin + ';\
}\
#boardNavDesktop,\
.pages {\
left: ' + pagemargin + ';\
right: ' + (252 + sidebarOffsetW) + 'px;\
}\
';
} else {
css += '\
body {\
margin: 1px ' + pagemargin + ' 0 ' + pagemargin + ';\
}\
#boardNavDesktop,\
.pages {\
left: ' + pagemargin + ';\
right: ' + pagemargin + ';\
}\
';
}
if (Conf['Compact Post Form Inputs']) {
css += '\
#qr textarea.field {\
height: 114px !important;\
}\
.textarea {\
height: 115px;\
}\
#qr .field[name="name"],\
#qr .field[name="email"],\
#qr .field[name="sub"] {\
width: ' + (75 + (sidebarOffsetW / 3)) + 'px !important;\
margin-left: 1px !important;\
}\
';
} else {
css += '\
#qr .field[name="email"],\
#qr .field[name="sub"] {\
width: ' + (248 + sidebarOffsetW) + 'px !important;\
}\
#qr .field[name="name"] {\
width: ' + (227 + sidebarOffsetW) + 'px !important;\
margin-left: 1px !important;\
}\
#qr .field[name="email"],\
#qr .field[name="sub"] {\
margin-top: 1px;\
}\
';
}
if (Conf['Expand Post Form Textarea']) {
css += '\
#qr textarea {\
display: block;\
' + agent + 'transition: all 0.25s ease 0s, width .3s ease-in-out .3s;\
float: right;\
}\
#qr textarea:focus {\
width: 400px;\
}\
';
}
if (Conf['Filtered Backlinks']) {
css += '\
.filtered.backlink {\
display: none;\
}\
';
}
if (Conf['Rounded Edges']) {
css += '\
.rice {\
border-radius: 2px;\
}\
div.reply,\
div.reply.highlight,\
#content,\
#options,\
#watcher,\
#qp,\
td[style="border: 1px dashed;"],\
div.reply > tr > div.reply,\
.inline div.reply,\
h2,\
.deleteform,\
#boardNavDesktopFoot,\
.globalMessage {\
border-radius: 3px;\
}\
.pages b,\
.pages input,\
a,\
.new {\
border-radius: 9px;\
}\
#qr::before {\
border-radius: 6px 6px 0 0;\
}\
.qphl {\
' + agent + 'outline-radius: 3px;\
}\
';
}
if (Conf['Slideout Watcher']) {
css += '\
#watcher {\
position: fixed;\
top: -1000px !important;\
right: 2px !important;\
left: auto !important;\
bottom: auto !important;\
width: ' + (246 + sidebarOffsetW) + 'px !important;\
padding-bottom: 4px;\
}\
#watcher:hover {\
z-index: 99 !important;\
top: ' + (34 + logoOffset) + 'px !important;\
}\
';
} else {
css += '\
#watcher::before {\
display: none;\
}\
#watcher {\
right: 2px !important;\
left: auto !important;\
width: ' + (246 + sidebarOffsetW) + 'px;\
padding-bottom: 4px;\
z-index: 96;\
}\
';
}
if (Conf['Underline Links']) {
css += '\
#credits a,\
.abbr a,\
.backlink:not(.filtered),\
.chanlinkify,\
.file a,\
.pages,\
.pages a,\
.quotejs,\
.quotelink:not(.filtered),\
.quotelink:not(.filtered),\
.useremail,\
a.deadlink,\
a[href*="//dis"],\
a[href*=res],\
div.post > blockquote .chanlinkify.YTLT-link.YTLT-text,\
div.postContainer span.postNum > .replylink {\
text-decoration: underline;\
}\
';
}
switch (Conf['Slideout Navigation']) {
case 'compact':
css += '\
#boardNavDesktopFoot {\
height: 84px;\
padding-bottom: 0px;\
padding-top: 0px;\
word-spacing: 3px;\
}\
#navbotright {\
display: none;\
}\
';
break;
case 'list':
css += '\
#boardNavDesktopFoot a {\
z-index: 1;\
display: block;\
}\
#boardNavDesktopFoot {\
height: 300px;\
overflow-y: scroll;\
padding-bottom: 0px;\
padding-top: 0px;\
word-spacing: 0px;\
}\
#boardNavDesktopFoot a::after{\
content: " - " attr(title);\
font-size: 12px;\
}\
#boardNavDesktopFoot a[href*="//boards.4chan.org/"]::after,\
#boardNavDesktopFoot a[href*="//rs.4chan.org/"]::after {\
content: "/ - " attr(title);\
font-size: 12px;\
}\
#boardNavDesktopFoot a[href*="//boards.4chan.org/"]::before,\
#boardNavDesktopFoot a[href*="//rs.4chan.org/"]::before {\
content: "/";\
font-size: 12px;\
}\
#navbotright {\
display: none;\
}\
';
break;
case 'hide':
css += '\
#boardNavDesktopFoot::after,\
#boardNavDesktopFoot {\
display: none;\
}\
';
}
switch (Conf['Reply Spacing']) {
case 'none':
css += '\
.replyContainer {\
margin-bottom: 0px;\
}\
#delform {\
margin-bottom: 12px;\
}\
';
break;
case 'small':
css += '\
.replyContainer {\
margin-bottom: 2px;\
}\
#delform {\
margin-bottom: 10px;\
}\
';
break;
case 'medium':
css += '\
.replyContainer {\
margin-bottom: 4px;\
}\
#delform {\
margin-bottom: 8px;\
}\
';
break;
case 'large':
css += '\
.replyContainer {\
margin-bottom: 6px;\
}\
#delform {\
margin-bottom: 6px;\
}\
';
}
switch (Conf['Sage Highlighting']) {
case 'text':
css += '\
a.useremail[href*="sage"]:last-of-type::after,\
a.useremail[href*="Sage"]:last-of-type::after,\
a.useremail[href*="SAGE"]:last-of-type::after {\
content: " (sage) ";\
color: ' + theme["Sage"] + ';\
}\
';
break;
case 'image':
css += '\
a.useremail[href*="sage"]:last-of-type::after,\
a.useremail[href*="Sage"]:last-of-type::after,\
a.useremail[href*="SAGE"]:last-of-type::after {\
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAABa1BMVEUAAACqrKiCgYIAAAAAAAAAAACHmX5pgl5NUEx/hnx4hXRSUVMiIyKwrbFzn19SbkZ1d3OvtqtpaWhcX1ooMyRsd2aWkZddkEV8vWGcpZl+kHd7jHNdYFuRmI4bHRthaV5WhUFsfGZReUBFZjdJazpGVUBnamYfHB9TeUMzSSpHgS1cY1k1NDUyOC8yWiFywVBoh1lDSEAZHBpucW0ICQgUHhBjfFhCRUA+QTtEQUUBAQFyo1praWspKigWFRZHU0F6j3E9Oz5VWFN0j2hncWONk4sAAABASDxJWkJKTUgAAAAvNC0fJR0DAwMAAAA9QzoWGhQAAAA8YytvrFOJsnlqyT9oqExqtkdrsExpsUsqQx9rpVJDbzBBbi5utk9jiFRuk11iqUR64k5Wf0JIZTpadk5om1BkyjmF1GRNY0FheFdXpjVXhz86XSp2yFJwslR3w1NbxitbtDWW5nNnilhFXTtYqDRwp1dSijiJ7H99AAAAUnRSTlMAJTgNGQml71ypu3cPEN/RDh8HBbOwQN7wVg4CAQZ28vs9EDluXjo58Ge8xwMy0P3+rV8cT73sawEdTv63NAa3rQwo4cUdAl3hWQSWvS8qqYsjEDiCzAAAAIVJREFUeNpFx7GKAQAYAOD/A7GbZVAWZTBZFGQw6LyCF/MIkiTdcOmWSzYbJVE2u1KX0J1v+8QDv/EkyS0yXF/NgeEILiHfyc74mICTQltqYXBeAWU9HGxU09YqqEvAElGjyZYjPyLqitjzHSEiGkrsfMWr0VLe+oy/djGP//YwfbeP8bN3Or0bkqEVblAAAAAASUVORK5CYII=") " ";\
}\
';
}
switch (Conf['Announcements']) {
case '4chan default':
css += '\
.globalMessage {\
position: static;\
background: none;\
border: none;\
margin-top: 0px;\
}\
.globalMessage::before {\
display: none;\
}\
.globalMessage:hover {\
top: 0px;\
}\
';
break;
case 'slideout':
css += '\
.globalMessage:hover {\
position: fixed;\
z-index: 99;\
}\
.globalMessage {\
width: ' + (236 + sidebarOffsetW) + 'px;\
background: ' + theme["Dialog Background"] + ';\
border: 1px solid ' + theme["Dialog Border"] + ';\
}\
';
break;
case 'hide':
css += '\
.globalMessage {\
display: none;\
}\
.globalMessage::before {\
display: none;\
}\
';
}
switch (Conf['Boards Navigation']) {
case 'sticky top':
css += '\
#boardNavDesktop {\
position: fixed;\
top: 0;\
}\
';
break;
case 'sticky bottom':
css += '\
#boardNavDesktop {\
position: fixed;\
bottom: 0;\
}\
';
break;
case 'top':
css += '\
#boardNavDesktop {\
position: absolute;\
top: 0;\
}\
';
break;
case 'hide':
css += '\
#boardNavDesktop {\
position: absolute;\
top: -100px;\
}\
';
}
switch (Conf['Pagination']) {
case 'sticky top':
css += '\
.pages {\
position: fixed;\
top: 0;\
z-index: 101;\
}\
';
break;
case 'sticky bottom':
css += '\
.pages {\
position: fixed;\
bottom: 0;\
z-index: 101;\
}\
';
break;
case 'top':
css += '\
.pages {\
position: absolute;\
top: 0;\
}\
';
break;
case 'on side':
css += '\
.pages {\
padding: 0;\
visibility: hidden;\
top: auto;\
bottom: 175px;\
width: 290px;\
left: auto;\
right: ' + (251 + sidebarOffsetW) + 'px;\
position: fixed;\
' + agent + 'transform: rotate(90deg);\
' + agent + 'transform-origin: bottom right;\
letter-spacing: -1px;\
word-spacing: -6px;\
z-index: 6;\
margin: 0;\
height: 15px;\
}\
.pages a,\
.pages strong {\
visibility: visible;\
min-width: 0;\
}\
';
break;
case 'hide':
css += '\
.pages {\
display: none;\
}\
';
}
switch (Conf["Checkboxes"]) {
case "show":
css += '\
.rice {\
display: none;\
}\
';
break;
case "make checkboxes circular":
css += '\
input[type=checkbox] {\
display: none;\
}\
.rice {\
border-radius: 6px;\
}\
';
break;
case "do not style checkboxes":
css += '\
.rice {\
display: none;\
}\
';
break;
case "hide":
css += '\
input[type=checkbox] {\
display: none;\
}\
.rice {\
display: none;\
}\
';
}
if (Conf["Mascots"]) {
mascotnames = [];
for (name in userMascots) {
mascot = userMascots[name];
if (enabledmascots[name] === true) {
mascotnames.push(name);
}
}
if (mascot = userMascots[mascotnames[Math.floor(Math.random() * mascotnames.length)]]) {
css += '\
#mascot img {\
position: fixed;\
bottom: ' + (mascot.bottom || mascotposition) + 'px;\
right: ' + (mascot.big ? 0 : Math.floor(sidebarOffsetW / 2)) + 'px;\
left: auto;\
' + agent + 'transform: scaleX(1);\
pointer-events: none;\
}\
#mascot img {\
z-index: ' + (Conf["Mascots Overlap Posts"] ? "3" : "-1") + ';\
}\
';
try {
$.rm($('#mascot', d.body));
} catch (_error) {}
div = $.el('div', {
id: "mascot"
});
div.innerHTML = "<img src='" + mascot.image + "'>";
$.ready(function() {
return $.add(d.body, div);
});
}
}
if (Conf["Block Ads"]) {
css += '\
/* AdBlock Minus */\
a[href*="jlist"],\
img[src^="//static.4chan.org/support/"] {\
display: none;\
}\
';
}
switch (Conf['Emoji Position']) {
case 'left':
css += Style.emoji('before', 'left');
break;
case 'right':
css += Style.emoji('after', 'right');
}
}
return css;
}
};
Main = {
init: function() {
var key, mascot, name, now, path, pathname, temp, val;
Main.flatten(null, Config);
for (key in Conf) {
val = Conf[key];
Conf[key] = $.get(key, val);
}
userThemes = $.get("userThemes", Themes);
userMascots = $.get("userMascots", Mascots);
for (name in userMascots) {
mascot = userMascots[name];
enabledmascots[name] = $.get(name, function() {
if (mascot.category === 'SFW') {
return true;
} else {
return false;
}
});
}
path = location.pathname;
pathname = path.slice(1).split('/');
g.BOARD = pathname[0], temp = pathname[1];
if (temp === 'res') {
g.REPLY = true;
g.THREAD_ID = pathname[2];
}
switch (location.hostname) {
case 'sys.4chan.org':
if (/report/.test(location.search)) {
$.ready(function() {
var field, form;
form = $('form');
field = $.id('recaptcha_response_field');
$.on(field, 'keydown', function(e) {
if (e.keyCode === 8 && !e.target.value) {
return window.location = 'javascript:Recaptcha.reload()';
}
});
return $.on(form, 'submit', function(e) {
var response;
e.preventDefault();
response = field.value.trim();
if (!/\s/.test(response)) {
field.value = "" + response + " " + response;
}
return form.submit();
});
});
}
return;
case 'images.4chan.org':
$.ready(function() {
var url;
if (/^4chan - 404/.test(d.title) && Conf['404 Redirect']) {
path = location.pathname.split('/');
url = Redirect.image(path[1], path[3]);
if (url) {
return location.href = url;
}
}
});
return;
}
Main.pruneHidden();
Style.init();
now = Date.now();
if (Conf['Check for Updates'] && $.get('lastUpdate', 0) < now - 18 * $.HOUR) {
$.ready(function() {
$.on(window, 'message', Main.message);
$.set('lastUpdate', now);
return $.add(d.head, $.el('script', {
src: 'https://github.com/zixaphir/appchan-x/raw/master/latest.js'
}));
});
}
if (Conf['Disable inline 4chan addon'] || Conf['Style']) {
localStorage.setItem('4chan-settings', '{"disableAll":true}');
}
if (Conf['Filter']) {
Filter.init();
}
if (Conf['Reply Hiding']) {
ReplyHiding.init();
}
if (Conf['Filter'] || Conf['Reply Hiding']) {
StrikethroughQuotes.init();
}
if (Conf['Anonymize']) {
Anonymize.init();
}
if (Conf['Time Formatting']) {
Time.init();
}
if (Conf['File Info Formatting']) {
FileInfo.init();
}
if (Conf['Sauce']) {
Sauce.init();
}
if (Conf['Reveal Spoilers']) {
RevealSpoilers.init();
}
if (Conf['Image Auto-Gif']) {
AutoGif.init();
}
if (Conf['Png Thumbnail Fix']) {
PngFix.init();
}
if (Conf['Image Hover']) {
ImageHover.init();
}
if (Conf['Menu']) {
Menu.init();
if (Conf['Report Link']) {
ReportLink.init();
}
if (Conf['Delete Link']) {
DeleteLink.init();
}
if (Conf['Filter']) {
Filter.menuInit();
}
if (Conf['Download Link']) {
DownloadLink.init();
}
if (Conf['Archive Link']) {
ArchiveLink.init();
}
}
if (Conf['Resurrect Quotes']) {
Quotify.init();
}
if (Conf['Quote Inline']) {
QuoteInline.init();
}
if (Conf['Quote Preview']) {
QuotePreview.init();
}
if (Conf['Quote Backlinks']) {
QuoteBacklink.init();
}
if (Conf['Indicate OP quote']) {
QuoteOP.init();
}
if (Conf['Indicate Cross-thread Quotes']) {
QuoteCT.init();
}
return $.ready(Main.ready);
},
ready: function() {
var a, board, nav, node, nodes, now, _i, _j, _len, _len1, _ref, _ref1;
if (/^4chan - 404/.test(d.title)) {
if (Conf['404 Redirect'] && /^\d+$/.test(g.THREAD_ID)) {
location.href = Redirect.thread(g.BOARD, g.THREAD_ID, location.hash);
}
return;
}
if (!$.id('navtopright')) {
return;
}
$.addClass(d.body, $.engine);
$.addClass(d.body, 'fourchan_x');
_ref = ['boardNavDesktop', 'boardNavDesktopFoot'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
nav = _ref[_i];
if (a = $("a[href$='/" + g.BOARD + "/']", $.id(nav))) {
$.addClass(a, 'current');
}
}
now = Date.now();
Favicon.init();
Options.init();
if (Conf['Quick Reply']) {
QR.init();
}
if (Conf['Image Expansion']) {
ImageExpand.init();
}
if (Conf['Thread Watcher']) {
Watcher.init();
}
if (Conf['Keybinds']) {
Keybinds.init();
}
if (g.REPLY) {
if (Conf['Prefetch']) {
Prefetch.init();
}
if (Conf['Thread Updater']) {
Updater.init();
}
if (Conf['Thread Stats']) {
ThreadStats.init();
}
if (Conf['Reply Navigation']) {
Nav.init();
}
if (Conf['Post in Title']) {
TitlePost.init();
}
if (Conf['Unread Count'] || Conf['Unread Favicon']) {
Unread.init();
}
if (Conf['Quote Threading']) {
QuoteThreading.init();
}
} else {
if (Conf['Thread Hiding']) {
ThreadHiding.init();
}
if (Conf['Thread Expansion']) {
ExpandThread.init();
}
if (Conf['Comment Expansion']) {
ExpandComment.init();
}
if (Conf['Index Navigation']) {
Nav.init();
}
}
board = $('.board');
nodes = [];
_ref1 = $$('.postContainer', board);
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
node = _ref1[_j];
nodes.push(Main.preParse(node));
}
Main.node(nodes, true);
Main.prettify = Main._prettify;
return Main.observe();
},
observe: function() {
var MutationObserver, board, observer;
board = $('.board');
if (MutationObserver = window.WebKitMutationObserver || window.MozMutationObserver || window.OMutationObserver || window.MutationObserver) {
Main.observer2 = observer = new MutationObserver(Main.observer);
return observer.observe(board, {
childList: true,
subtree: true
});
} else {
return $.on(board, 'DOMNodeInserted', Main.listener);
}
},
disconnect: function() {
var board;
if (Main.observer2) {
return Main.observer2.disconnect();
} else {
board = $('.board');
return $.off(board, 'DOMNodeInserted', Main.listener);
}
},
pruneHidden: function() {
var cutoff, hiddenThreads, id, now, timestamp, _ref;
now = Date.now();
g.hiddenReplies = $.get("hiddenReplies/" + g.BOARD + "/", {});
if ($.get('lastChecked', 0) < now - 1 * $.DAY) {
$.set('lastChecked', now);
cutoff = now - 7 * $.DAY;
hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
for (id in hiddenThreads) {
timestamp = hiddenThreads[id];
if (timestamp < cutoff) {
delete hiddenThreads[id];
}
}
_ref = g.hiddenReplies;
for (id in _ref) {
timestamp = _ref[id];
if (timestamp < cutoff) {
delete g.hiddenReplies[id];
}
}
$.set("hiddenThreads/" + g.BOARD + "/", hiddenThreads);
return $.set("hiddenReplies/" + g.BOARD + "/", g.hiddenReplies);
}
},
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];
Main.flatten(key, val);
}
} else {
Conf[parent] = obj;
}
},
message: function(e) {
var version;
version = e.data.version;
if (version && version !== Main.version && confirm('An updated version of appchan X is available, would you like to install it now?')) {
return window.location = "https://raw.github.com/zixaphir/appchan-x/" + version + "/appchan_x.user.js";
}
},
preParse: function(node) {
var el, img, parentClass, post;
parentClass = node.parentNode.className;
el = $('.post', node);
post = {
root: node,
el: el,
"class": el.className,
ID: el.id.match(/\d+$/)[0],
threadID: g.THREAD_ID || $.x('ancestor::div[parent::div[@class="board"]]', node).id.match(/\d+$/)[0],
isArchived: /\barchivedPost\b/.test(parentClass),
isInlined: /\binline\b/.test(parentClass),
isCrosspost: /\bcrosspost\b/.test(parentClass),
blockquote: el.lastElementChild,
quotes: el.getElementsByClassName('quotelink'),
backlinks: el.getElementsByClassName('backlink'),
fileInfo: false,
img: false
};
if (img = $('img[data-md5]', el)) {
post.fileInfo = img.parentNode.previousElementSibling;
post.img = img;
}
Main.prettify(post.blockquote);
return post;
},
node: function(nodes, notify) {
var callback, node, _i, _j, _len, _len1, _ref;
_ref = Main.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
callback = _ref[_i];
try {
for (_j = 0, _len1 = nodes.length; _j < _len1; _j++) {
node = nodes[_j];
callback(node);
}
} catch (err) {
if (notify) {
alert("AppChan X has experienced an error. You can help by sending this snippet to:\nhttps://github.com/zixaphir/appchan-x/issues\n\n" + Main.version + "\n" + window.location + "\n" + navigator.userAgent + "\n\n" + err.stack);
}
}
}
},
observer: function(mutations) {
var addedNode, mutation, nodes, _i, _j, _len, _len1, _ref;
nodes = [];
for (_i = 0, _len = mutations.length; _i < _len; _i++) {
mutation = mutations[_i];
_ref = mutation.addedNodes;
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
addedNode = _ref[_j];
if (/\bpostContainer\b/.test(addedNode.className) && addedNode.parentNode.className !== 'threadContainer') {
nodes.push(Main.preParse(addedNode));
}
}
}
if (nodes.length) {
return Main.node(nodes);
}
},
listener: function(e) {
var target;
target = e.target;
if (/\bpostContainer\b/.test(target.className) && target.parentNode.className !== 'threadContainer') {
return Main.node([Main.preParse(target)]);
}
},
prettify: function() {},
_prettify: function(bq) {
var code;
switch (g.BOARD) {
case 'g':
code = function() {
var pre, _i, _len, _ref;
_ref = document.getElementById('_id_').getElementsByClassName('prettyprint');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
pre = _ref[_i];
pre.innerHTML = prettyPrintOne(pre.innerHTML.replace(/\s/g, '&nbsp;'));
}
};
break;
case 'sci':
code = function() {
jsMath.Process(document.getElementById('_id_'));
};
break;
default:
return;
}
return $.globalEval(("" + code).replace('_id_', bq.id));
},
namespace: 'appchan_x.',
version: '0.8beta',
callbacks: []
};
Main.init();
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment