\
\
- Global
\
- A — Toggle auto-updater
\
- Q — Open Quick Reply
\
- R — Update thread
\
- W — Watch/Unwatch thread
\
- B — Previous page
\
- N — Next page
\
- I — Return to index
\
- C — Open catalog
\
- F — Filter selected text
\
\
- Quick Reply (always enabled)
\
- Ctrl + Click the post number — Quote without linking
\
- Ctrl + S — Spoiler tags
\
- Esc — Close the Quick Reply
\
';
document.body.appendChild(cnt);
cnt.addEventListener('click', this.onClick, false);
};
Keybinds.close = function() {
var cnt;
if (cnt = $.id('keybindsHelp')) {
cnt.removeEventListener('click', this.onClick, false);
document.body.removeChild(cnt);
}
};
Keybinds.onClick = function(e) {
var cmd;
if ((cmd = e.target.getAttribute('data-cmd')) && cmd == 'keybinds-close') {
Keybinds.close();
}
};
/**
* Reporting
*/
var Report = {
init: function() {
window.addEventListener('message', Report.onMessage, false);
}
};
Report.onMessage = function(e) {
var id;
if (e.origin === 'https://sys.4chan.org' && /^done-report/.test(e.data)) {
id = e.data.split('-')[2];
if (Config.threadHiding && $.id('t' + id)) {
if (!ThreadHiding.isHidden(id)) {
ThreadHiding.hide(id);
ThreadHiding.save();
}
return;
}
if ($.id('p' + id)) {
if (!ReplyHiding.isHidden(id)) {
ReplyHiding.hide(id);
ReplyHiding.save();
}
return;
}
}
};
Report.open = function(pid, board) {
window.open('https://sys.4chan.org/'
+ (board || Main.board) + '/imgboard.php?mode=report&no=' + pid
, Date.now(),
"toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=600,height=170");
};
/**
* Custom Menu
*/
var CustomMenu = {};
CustomMenu.reset = function() {
var i, el, full, custom, navs;
full = $.cls('boardList');
custom = $.cls('customBoardList');
navs = $.cls('show-all-boards');
for (i = 0; el = navs[i]; ++i) {
el.removeEventListener('click', CustomMenu.reset, false);
}
for (i = custom.length - 1; el = custom[i]; i--) {
full[i].style.display = null;
el.parentNode.removeChild(el);
}
};
CustomMenu.apply = function(str) {
var i, j, el, cntBottom, board, navs, boardList, more;
if (!str) {
return;
}
boardList = str.split(/[^0-9a-z]/i);
cnt = document.createElement('span');
cnt.className = 'customBoardList';
for (i = 0; board = boardList[i]; ++i) {
if (i) {
cnt.appendChild(document.createTextNode(' / '));
}
else {
cnt.appendChild(document.createTextNode('['));
}
el = document.createElement('a');
el.textContent = board;
el.href = '//boards.4chan.org/' + board + '/';
cnt.appendChild(el);
}
cnt.appendChild(document.createTextNode(']'));
cnt.appendChild(document.createTextNode(' ['));
el = document.createElement('a');
el.textContent = '…';
el.title = 'Show all';
el.className = 'show-all-boards pointer';
cnt.appendChild(el);
cnt.appendChild(document.createTextNode('] '));
cntBottom = cnt.cloneNode(true);
navs = $.cls('boardList');
for (i = 0; el = navs[i]; ++i) {
el.style.display = 'none';
el.parentNode.insertBefore(i ? cntBottom : cnt, el);
}
navs = $.cls('show-all-boards');
for (i = 0; el = navs[i]; ++i) {
el.addEventListener('click', CustomMenu.reset, false);
}
};
CustomMenu.onClick = function(e) {
var t;
if ((t = e.target) == document) {
return;
}
if (t.hasAttribute('data-close')) {
CustomMenu.closeEditor();
}
else if (t.hasAttribute('data-save')) {
CustomMenu.save();
}
};
CustomMenu.showEditor = function() {
var cnt;
cnt = document.createElement('div');
cnt.id = 'customMenu';
cnt.className = 'UIPanel';
cnt.setAttribute('data-close', '1');
cnt.innerHTML = '\
';
document.body.appendChild(cnt);
if (Config.customMenuList) {
$.id('customMenuBox').value = Config.customMenuList;
}
cnt.addEventListener('click', CustomMenu.onClick, false);
};
CustomMenu.closeEditor = function() {
var el;
if (el = $.id('customMenu')) {
el.removeEventListener('click', CustomMenu.onClick, false);
document.body.removeChild(el);
}
};
CustomMenu.save = function() {
var input;
if (input = $.id('customMenuBox')) {
Config.customMenuList = input.value;
}
CustomMenu.closeEditor();
};
/**
* Draggable helper
*/
var Draggable = {
el: null,
key: null,
scrollX: null,
scrollY: null,
dx: null, dy: null, right: null, bottom: null,
set: function(handle) {
handle.addEventListener('mousedown', Draggable.startDrag, false);
},
unset: function(handle) {
handle.removeEventListener('mousedown', Draggable.startDrag, false);
},
startDrag: function(e) {
var self, doc, offs;
if (this.parentNode.hasAttribute('data-shiftkey') && !e.shiftKey) {
return;
}
e.preventDefault();
self = Draggable;
doc = document.documentElement;
self.el = this.parentNode;
self.key = self.el.getAttribute('data-trackpos');
offs = self.el.getBoundingClientRect();
self.dx = e.clientX - offs.left;
self.dy = e.clientY - offs.top;
self.right = doc.clientWidth - offs.width;
self.bottom = doc.clientHeight - offs.height;
if (getComputedStyle(self.el, null).position != 'fixed') {
self.scrollX = window.pageXOffset;
self.scrollY = window.pageYOffset;
}
else {
self.scrollX = self.scrollY = 0;
}
document.addEventListener('mouseup', self.endDrag, false);
document.addEventListener('mousemove', self.onDrag, false);
},
endDrag: function(e) {
document.removeEventListener('mouseup', Draggable.endDrag, false);
document.removeEventListener('mousemove', Draggable.onDrag, false);
if (Draggable.key) {
Config[Draggable.key] = Draggable.el.style.cssText;
Config.save();
}
delete Draggable.el;
},
onDrag: function(e) {
var left, top, style;
left = e.clientX - Draggable.dx + Draggable.scrollX;
top = e.clientY - Draggable.dy + Draggable.scrollY;
style = Draggable.el.style;
if (left < 1) {
style.left = '0';
style.right = '';
}
else if (Draggable.right < left) {
style.left = '';
style.right = '0';
}
else {
style.left = (left / document.documentElement.clientWidth * 100) + '%';
style.right = '';
}
if (top < 1) {
style.top = '0';
style.bottom = '';
}
else if (Draggable.bottom < top) {
style.bottom = '0';
style.top = '';
}
else {
style.top = (top / document.documentElement.clientHeight * 100) + '%';
style.bottom = '';
}
}
};
/**
* User Agent
*/
var UA = {};
UA.init = function() {
document.head = document.head || $.tag('head')[0];
this.isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
this.hasCORS = 'withCredentials' in new XMLHttpRequest;
this.hasFormData = 'FormData' in window;
this.hasDragAndDrop = false; /*'draggable' in document.createElement('div');*/
};
UA.dispatchEvent = function(name, detail) {
var e = document.createEvent('Event');
e.initEvent(name, false, false);
if (detail) {
e.detail = detail;
}
document.dispatchEvent(e);
};
UA.getSelection = function(raw) {
var sel;
if (UA.isOpera && typeof (sel = document.getSelection()) == 'string') {}
else {
sel = window.getSelection();
if (!raw) {
sel = sel.toString();
}
}
return sel;
};
/**
* Config
*/
var Config = {
quotePreview: true,
backlinks: true,
quickReply: true,
threadUpdater: true,
threadHiding: true,
alwaysAutoUpdate: false,
topPageNav: false,
threadWatcher: false,
imageExpansion: true,
fitToScreenExpansion: false,
threadExpansion: true,
alwaysDepage: false,
localTime: true,
stickyNav: false,
keyBinds: false,
inlineQuotes: false,
filter: false,
revealSpoilers: false,
imageHover: false,
threadStats: true,
IDColor: true,
noPictures: false,
embedYouTube: true,
embedSoundCloud: false,
updaterSound: false,
customCSS: false,
autoScroll: false,
hideStubs: false,
compactThreads: false,
centeredThreads: false,
dropDownNav: false,
classicNav: false,
fixedThreadWatcher: false,
persistentQR: false,
forceHTTPS: false,
reportButton: false,
disableAll: false
};
var ConfigMobile = {
embedYouTube: false,
compactThreads: false
};
Config.load = function() {
if (storage = localStorage.getItem('4chan-settings')) {
storage = JSON.parse(storage);
$.extend(Config, storage);
if (Main.getCookie('https') === '1') {
Config.forceHTTPS = true;
}
else {
Config.forceHTTPS = false;
}
}
else {
Main.firstRun = true;
}
};
Config.loadFromURL = function() {
var cmd, data;
cmd = location.href.split('=', 2);
if (/#cfg$/.test(cmd[0])) {
try {
data = JSON.parse(decodeURIComponent(cmd[1]));
history.replaceState(null, '', location.href.split('#', 1)[0]);
$.extend(Config, JSON.parse(data.settings));
Config.save();
if (data.filters) {
localStorage.setItem('4chan-filters', data.filters);
}
if (data.css) {
localStorage.setItem('4chan-css', data.css);
}
if (data.catalogFilters) {
localStorage.setItem('catalog-filters', data.catalogFilters);
}
if (data.catalogSettings) {
localStorage.setItem('catalog-settings', data.catalogSettings);
}
return true;
}
catch (e) {
console.log(e);
}
}
return false;
};
Config.toURL = function() {
var data, cfg = {};
cfg.settings = localStorage.getItem('4chan-settings');
if (data = localStorage.getItem('4chan-filters')) {
cfg.filters = data;
}
if (data = localStorage.getItem('4chan-css')) {
cfg.css = data;
}
if (data = localStorage.getItem('catalog-filters')) {
cfg.catalogFilters = data;
}
if (data = localStorage.getItem('catalog-settings')) {
cfg.catalogSettings = data;
}
return encodeURIComponent(JSON.stringify(cfg));
};
Config.save = function() {
localStorage.setItem('4chan-settings', JSON.stringify(Config));
if (Config.forceHTTPS) {
Main.setCookie('https', 1);
}
else {
Main.removeCookie('https');
}
};
/**
* Settings menu
*/
var SettingsMenu = {};
// [ Name, Subtitle, available on mobile?, is sub-option?, is mobile only? ]
SettingsMenu.options = {
'Quotes & Replying': {
quotePreview: [ 'Quote preview', 'Show post when mousing over post links', true ],
backlinks: [ 'Backlinks', 'Show who has replied to a post', true ],
inlineQuotes: [ 'Inline quote links', 'Clicking quote links will inline expand the quoted post, Shift-click to bypass inlining' ],
quickReply: [ 'Quick Reply', 'Quickly respond to a post by clicking its post number', true ],
persistentQR: [ 'Persistent Quick Reply', 'Keep Quick Reply window open after posting' ]
},
'Monitoring': {
threadUpdater: [ 'Thread updater', 'Append new posts to bottom of thread without refreshing the page', true ],
alwaysAutoUpdate:[ 'Auto-update by default', 'Always auto-update threads', true ],
threadWatcher: [ 'Thread Watcher', 'Keep track of threads you\'re watching and see when they receive new posts', true ],
autoScroll: [ 'Auto-scroll with auto-updated posts', 'Automatically scroll the page as new posts are added' ],
updaterSound: [ 'Sound notification', 'Play a sound when somebody replies to your post(s)' ],
fixedThreadWatcher: [ 'Pin Thread Watcher to the page', 'Thread Watcher will scroll with you' ],
threadStats: [ 'Thread statistics', 'Display post and image counts on the right of the page,
italics signify bump/image limit has been met' ],
},
'Filters & Post Hiding': {
filter: [ 'Filter and highlight specific threads/posts [
Edit]', 'Enable pattern-based filters' ],
threadHiding: [ 'Thread hiding [
Clear History]', 'Hide entire threads by clicking the minus button', true ],
hideStubs: [ 'Hide thread stubs', "Don't display stubs of hidden threads" ]
},
'Navigation': {
threadExpansion: [ 'Thread expansion', 'Expand threads inline on board indexes', true ],
dropDownNav: [ 'Use persistent drop-down navigation bar', '' ],
classicNav: [ 'Use traditional board list', '', false, true ],
customMenu: [ 'Custom board list [
Edit]', 'Only show selected boards in top and bottom board lists' ],
alwaysDepage: [ 'Always use infinite scroll', 'Enable infinite scroll by default, so reaching the bottom of the board index will load subsequent pages' ],
topPageNav: [ 'Page navigation at top of page', 'Show the page switcher at the top of the page, hold Shift and drag to move' ],
stickyNav: [ 'Navigation arrows', 'Show top and bottom navigation arrows, hold Shift and drag to move' ],
keyBinds: [ 'Use keyboard shortcuts [
Show]', 'Enable handy keyboard shortcuts for common actions' ]
},
'Images & Media': {
imageExpansion: [ 'Image expansion', 'Enable inline image expansion, limited to browser width', true ],
fitToScreenExpansion: [ 'Fit expanded images to screen', 'Limit expanded images to both browser width and height' ],
imageHover: [ 'Image hover', 'Mouse over images to view full size, limited to browser size' ],
revealSpoilers: [ "Don't spoiler images", 'Show image thumbnail and original filename instead of spoiler placeholders' ],
noPictures: [ 'Hide thumbnails', 'Don\'t display thumbnails while browsing', true ],
embedYouTube: [ 'Embed YouTube links', 'Embed YouTube player into replies' ],
embedSoundCloud: [ 'Embed SoundCloud links', 'Embed SoundCloud player into replies' ],
embedVocaroo: [ 'Embed Vocaroo links', 'Embed Vocaroo player into replies' ]
},
'Miscellaneous': {
customCSS: [ 'Custom CSS [
Edit]', 'Include your own CSS rules', true ],
IDColor: [ 'Color user IDs', 'Assign unique colors to user IDs on boards that use them', true ],
compactThreads: [ 'Force long posts to wrap', 'Long posts will wrap at 75% browser width' ],
centeredThreads: [ 'Center threads', 'Align threads to the center of page', false ],
reportButton: [ 'Report button', 'Add a report button next to posts for easy reporting', true, false, true ],
localTime: [ 'Convert dates to local time', 'Convert 4chan server time (US Eastern Time) to your local time', true ],
forceHTTPS: [ 'Always use HTTPS', 'Rewrite 4chan URLs to always use HTTPS', true ]
}
};
SettingsMenu.save = function() {
var i, options, el, key;
options = $.id('settingsMenu').getElementsByClassName('menuOption');
for (i = 0; el = options[i]; ++i) {
key = el.getAttribute('data-option');
Config[key] = el.type == 'checkbox' ? el.checked : el.value;
}
Config.save();
SettingsMenu.close();
location.href = location.href.replace(/#.+$/, '');
};
SettingsMenu.toggle = function() {
if ($.id('settingsMenu')) {
SettingsMenu.close();
}
else {
SettingsMenu.open();
}
};
SettingsMenu.open = function() {
var i, cat, categories, key, html, cnt, opts, mobileOpts, el;
if (Main.firstRun) {
if (el = $.id('settingsTip')) {
el.parentNode.removeChild(el);
}
if (el = $.id('settingsTipBottom')) {
el.parentNode.removeChild(el);
}
Config.save();
}
cnt = document.createElement('div');
cnt.id = 'settingsMenu';
cnt.className = 'UIPanel';
html = '
';
html += '';
if (Main.hasMobileLayout) {
categories = {};
for (cat in SettingsMenu.options) {
mobileOpts = {};
opts = SettingsMenu.options[cat];
for (key in opts) {
if (opts[key][2]) {
mobileOpts[key] = opts[key];
}
}
for (i in mobileOpts) {
categories[cat] = mobileOpts;
break;
}
}
}
else {
categories = SettingsMenu.options;
}
for (cat in categories) {
opts = categories[cat];
html += '- '
+ '
'
+ ''
+ cat + ' ';
for (key in opts) {
// Mobile layout only?
if (opts[key][4] && !Main.hasMobileLayout) {
continue;
}
html += '- ' : '>')
+ ''
+ (opts[key][1] !== false ? '
- ' : '">') + opts[key][1] : '')
+ '
';
}
html += '
';
}
html += '
- '
+ '
'
+ '
'
+ '
';
cnt.innerHTML = html;
cnt.addEventListener('click', SettingsMenu.onClick, false);
document.body.appendChild(cnt);
if (Main.firstRun) {
SettingsMenu.expandAll();
}
(el = $.cls('menuOption', cnt)[0]) && el.focus();
};
SettingsMenu.showExport = function() {
var cnt, str, el;
if ($.id('exportSettings')) {
return;
}
str = location.href.replace(location.hash, '') + '#cfg=' + Config.toURL();
cnt = document.createElement('div');
cnt.id = 'exportSettings';
cnt.className = 'UIPanel';
cnt.setAttribute('data-cmd', 'export-close');
cnt.innerHTML = '\
\
Copy and save the URL below, and visit it from another \
browser or computer to restore your extension and catalog settings.
\
\
\
Alternatively, you can drag the link below into your \
bookmarks bar and click it to restore.
\
[Restore 4chan Settings]
';
document.body.appendChild(cnt);
cnt.addEventListener('click', this.onExportClick, false);
el = $.cls('export-field', cnt)[0];
el.focus();
el.select();
};
SettingsMenu.closeExport = function() {
var cnt;
if (cnt = $.id('exportSettings')) {
cnt.removeEventListener('click', this.onExportClick, false);
document.body.removeChild(cnt);
}
};
SettingsMenu.onExportClick = function(e) {
var el;
if (e.target.id == 'exportSettings') {
e.preventDefault();
e.stopPropagation();
SettingsMenu.closeExport();
}
};
SettingsMenu.expandAll = function() {
var i, el, nodes = $.cls('settings-expand');
for (i = 0; el = nodes[i]; ++i) {
el.src = Main.icons.minus;
el.parentNode.nextElementSibling.style.display = 'block';
}
};
SettingsMenu.toggleCat = function(t) {
var icon, disp, el = t.parentNode.nextElementSibling;
if (!el.style.display) {
disp = 'block';
icon = 'minus';
}
else {
disp = '';
icon = 'plus';
}
el.style.display = disp;
t.parentNode.firstElementChild.src = Main.icons[icon];
};
SettingsMenu.onClick = function(e) {
var el, t, i, j;
t = e.target;
if ($.hasClass(t, 'settings-expand')) {
SettingsMenu.toggleCat(t);
}
else if (t.getAttribute('data-cmd') == 'settings-exp-all') {
e.preventDefault();
SettingsMenu.expandAll();
}
else if (t.id == 'settingsMenu' && (el = $.id('settingsMenu'))) {
e.preventDefault();
SettingsMenu.close(el);
}
};
SettingsMenu.close = function(el) {
if (el = (el || $.id('settingsMenu'))) {
el.removeEventListener('click', SettingsMenu.onClick, false);
document.body.removeChild(el);
}
};
/**
* Main
*/
var Main = {};
Main.addTooltip = function(link, message, id) {
var el, pos;
el = document.createElement('div');
el.className = 'click-me';
if (id) {
el.id = id;
}
el.innerHTML = message || 'Change your settings';
link.parentNode.appendChild(el);
pos = (link.offsetWidth - el.offsetWidth + link.offsetLeft - el.offsetLeft) / 2;
el.style.marginLeft = pos + 'px';
return el;
};
Main.init = function() {
var params;
document.addEventListener('DOMContentLoaded', Main.run, false);
Main.now = Date.now();
UA.init();
Config.load();
if (Config.forceHTTPS && location.protocol != 'https:') {
location.href = location.href.replace(/^http:/, 'https:');
return;
}
if (Main.firstRun && Config.loadFromURL()) {
Main.firstRun = false;
}
if (Main.stylesheet = Main.getCookie(style_group)) {
Main.stylesheet = Main.stylesheet.toLowerCase().replace(/ /g, '_');
}
else {
Main.stylesheet =
style_group == 'nws_style' ? 'yotsuba_new' : 'yotsuba_b_new';
}
Main.passEnabled = Main.getCookie('pass_enabled');
QR.noCaptcha = QR.noCaptcha || Main.passEnabled;
Main.initIcons();
Main.addCSS();
Main.type = style_group.split('_')[0];
params = location.pathname.split(/\//);
Main.board = params[1];
Main.page = params[2];
Main.tid = params[3];
Report.init();
if (Config.IDColor) {
IDColor.init();
}
if (Config.customCSS) {
CustomCSS.init();
}
if (Config.keyBinds) {
Keybinds.init();
}
UA.dispatchEvent('4chanMainInit');
};
Main.initPersistentNav = function() {
var el, top, bottom;
top = $.id('boardNavDesktop');
bottom = $.id('boardNavDesktopFoot');
if (Config.classicNav) {
el = document.createElement('div');
el.className = 'pageJump';
el.innerHTML = '
▼'
+ '
Settings'
+ '
Home';
top.appendChild(el);
$.id('settingsWindowLinkClassic')
.addEventListener('click', SettingsMenu.toggle, false);
$.addClass(top, 'persistentNav');
}
else {
top.style.display = 'none';
$.removeClass($.id('boardNavMobile'), 'mobile');
}
bottom.style.display = 'none';
$.addClass(document.body, 'hasDropDownNav');
};
Main.checkMobileLayout = function() {
var mobile, desktop;
if (window.matchMedia) {
return window.matchMedia('(max-width: 480px)').matches
&& localStorage.getItem('4chan_never_show_mobile') != 'true';
}
mobile = $.id('boardNavMobile');
desktop = $.id('boardNavDesktop');
return mobile && desktop && mobile.offsetWidth > 0 && desktop.offsetWidth == 0;
};
Main.run = function() {
var thread;
document.removeEventListener('DOMContentLoaded', Main.run, false);
document.addEventListener('click', Main.onclick, false);
$.id('settingsWindowLink').addEventListener('click', SettingsMenu.toggle, false);
$.id('settingsWindowLinkBot').addEventListener('click', SettingsMenu.toggle, false);
$.id('settingsWindowLinkMobile').addEventListener('click', SettingsMenu.toggle, false);
if (Config.disableAll) {
return;
}
Main.hasMobileLayout = Main.checkMobileLayout();
Main.isMobileDevice = /Mobile|Android|Dolfin|Opera Mobi|PlayStation Vita|Nintendo DS/.test(navigator.userAgent);
if (Main.hasMobileLayout) {
$.extend(Config, ConfigMobile);
}
else {
$.id('bottomReportBtn').style.display = 'none';
if (Main.isMobileDevice) {
$.addClass(document.body, 'isMobileDevice');
}
}
if (Main.firstRun && Main.isMobileDevice) {
Config.topPageNav = false;
Config.dropDownNav = true;
}
if (Config.dropDownNav && !Main.hasMobileLayout) {
Main.initPersistentNav();
}
$.addClass(document.body, Main.stylesheet);
$.addClass(document.body, Main.type);
if (Config.compactThreads) {
$.addClass(document.body, 'compact');
}
else if (Config.centeredThreads) {
$.addClass(document.body, 'centeredThreads');
}
if (Config.noPictures) {
$.addClass(document.body, 'noPictures');
}
if (Config.customMenu) {
CustomMenu.apply(Config.customMenuList);
}
if (Config.quotePreview || Config.imageHover|| Config.filter) {
thread = $.id('delform');
thread.addEventListener('mouseover', Main.onThreadMouseOver, false);
thread.addEventListener('mouseout', Main.onThreadMouseOut, false);
}
if (!Main.hasMobileLayout) {
Main.initGlobalMessage();
}
if (Config.stickyNav) {
Main.setStickyNav();
}
if (Config.threadExpansion) {
ThreadExpansion.init();
}
if (Config.threadWatcher) {
ThreadWatcher.init();
}
if (Config.filter) {
Filter.init();
}
if (Config.embedSoundCloud || Config.embedYouTube || Config.embedVocaroo) {
Media.init();
}
ReplyHiding.init();
if (Config.quotePreview) {
QuotePreview.init();
}
Parser.init();
if (Main.tid) {
Main.threadClosed = !document.forms.post;
Main.threadSticky = !!$.cls('stickyIcon', $.id('pi' + Main.tid))[0];
if (Config.threadStats) {
ThreadStats.init();
}
Parser.parseThread(Main.tid);
if (Config.threadUpdater) {
ThreadUpdater.init();
}
}
else {
if (!Main.page) {
Depager.init();
}
if (Config.topPageNav) {
Main.setPageNav();
}
if (Config.threadHiding) {
ThreadHiding.init();
Parser.parseBoard();
}
else {
Parser.parseBoard();
}
}
if (Main.board === 'f') {
SWFEmbed.init();
}
if (Config.quickReply) {
QR.init();
}
ReplyHiding.purge();
};
Main.isThreadClosed = function(tid) {
return window.thread_archived || ((el = $.id('pi' + tid)) && $.cls('closedIcon', el)[0])
};
Main.setThreadState = function(state, mode) {
var cnt, el, ref, cap;
cap = state.charAt(0).toUpperCase() + state.slice(1);
if (mode) {
cnt = $.cls('postNum', $.id('pi' + Main.tid))[0];
el = document.createElement('img');
el.className = state + 'Icon retina';
el.title = cap;
el.src = Main.icons2[state];
if (state == 'sticky' && (ref = $.cls('closedIcon', cnt)[0])) {
cnt.insertBefore(el, ref);
cnt.insertBefore(document.createTextNode(' '), ref);
}
else {
cnt.appendChild(document.createTextNode(' '));
cnt.appendChild(el);
}
}
else {
if (el = $.cls(state + 'Icon', $.id('pi' + Main.tid))[0]) {
el.parentNode.removeChild(el.previousSibling);
el.parentNode.removeChild(el);
}
}
Main['thread' + cap] = mode;
};
Main.icons = {
up: 'arrow_up.png',
down: 'arrow_down.png',
right: 'arrow_right.png',
download: 'arrow_down2.png',
refresh: 'refresh.png',
cross: 'cross.png',
gis: 'gis.png',
iqdb: 'iqdb.png',
minus: 'post_expand_minus.png',
plus: 'post_expand_plus.png',
rotate: 'post_expand_rotate.gif',
quote: 'quote.png',
report: 'report.png',
notwatched: 'watch_thread_off.png',
watched: 'watch_thread_on.png',
help: 'question.png'
};
Main.icons2 = {
archived: 'archived.gif',
closed: 'closed.gif',
sticky: 'sticky.gif',
trash: 'trash.gif'
},
Main.initIcons = function() {
var key, paths, url;
paths = {
yotsuba_new: 'futaba/',
futaba_new: 'futaba/',
yotsuba_b_new: 'burichan/',
burichan_new: 'burichan/',
tomorrow: 'tomorrow/',
photon: 'photon/'
};
url = '//s.4cdn.org/image/'
if (window.devicePixelRatio >= 2) {
for (key in Main.icons) {
Main.icons[key] = Main.icons[key].replace('.', '@2x.');
}
for (key in Main.icons2) {
Main.icons2[key] = Main.icons2[key].replace('.', '@2x.');
}
}
for (key in Main.icons2) {
Main.icons2[key] = url + Main.icons2[key];
}
url += 'buttons/' + paths[Main.stylesheet];
for (key in Main.icons) {
Main.icons[key] = url + Main.icons[key];
}
};
Main.setPageNav = function() {
var el, cnt;
cnt = document.createElement('div');
cnt.setAttribute('data-shiftkey', '1');
cnt.setAttribute('data-trackpos', 'TN-position');
cnt.className = 'topPageNav';
if (Config['TN-position']) {
cnt.style.cssText = Config['TN-position'];
}
else {
cnt.style.left = '10px';
cnt.style.top = '50px';
}
el = $.cls('pagelist')[0]
if (!el) {
return;
}
el = el.cloneNode(true);
cnt.appendChild(el);
Draggable.set(el);
document.body.appendChild(cnt);
};
Main.initGlobalMessage = function() {
var msg, btn, thisTs, oldTs;
if ((msg = $.id('globalMessage')) && msg.textContent) {
msg.nextElementSibling.style.clear = 'both';
btn = document.createElement('img');
btn.id = 'toggleMsgBtn';
btn.className = 'extButton';
btn.setAttribute('data-cmd', 'toggleMsg');
btn.alt = 'Toggle';
btn.title = 'Toggle announcement';
oldTs = localStorage.getItem('4chan-global-msg');
thisTs = msg.getAttribute('data-utc');
if (oldTs && thisTs <= oldTs) {
msg.style.display = 'none';
btn.style.opacity = '0.5';
btn.src = Main.icons.plus;
}
else {
btn.src = Main.icons.minus;
}
msg.parentNode.insertBefore(btn, msg);
}
};
Main.toggleGlobalMessage = function() {
var msg, btn;
msg = $.id('globalMessage');
btn = $.id('toggleMsgBtn');
if (msg.style.display == 'none') {
msg.style.display = '';
btn.src = Main.icons.minus;
btn.style.opacity = '1';
localStorage.removeItem('4chan-global-msg');
}
else {
msg.style.display = 'none';
btn.src = Main.icons.plus;
btn.style.opacity = '0.5';
localStorage.setItem('4chan-global-msg', msg.getAttribute('data-utc'));
}
};
Main.setStickyNav = function() {
var cnt, hdr;
cnt = document.createElement('div');
cnt.id = 'stickyNav';
cnt.className = 'extPanel reply';
cnt.setAttribute('data-shiftkey', '1');
cnt.setAttribute('data-trackpos', 'SN-position');
if (Config['SN-position']) {
cnt.style.cssText = Config['SN-position'];
}
else {
cnt.style.right = '10px';
cnt.style.top = '50px';
}
hdr = document.createElement('div');
hdr.innerHTML = '

'
+ '

';
Draggable.set(hdr);
cnt.appendChild(hdr);
document.body.appendChild(cnt);
};
Main.getCookie = function(name) {
var i, c, ca, key;
key = name + "=";
ca = document.cookie.split(';');
for (i = 0; c = ca[i]; ++i) {
while (c.charAt(0) == ' ') {
c = c.substring(1, c.length);
}
if (c.indexOf(key) == 0) {
return decodeURIComponent(c.substring(key.length, c.length));
}
}
return null;
};
Main.setCookie = function(name, value) {
var date = new Date();
date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000));
document.cookie = name + '=' + value
+ '; expires=' + date.toGMTString()
+ '; path=/; domain=boards.4chan.org';
};
Main.removeCookie = function(name) {
document.cookie = name + '='
+ '; expires=Thu, 01 Jan 1970 00:00:01 GMT;'
+ '; path=/; domain=boards.4chan.org';
};
Main.onclick = function(e) {
var t, cmd, tid;
if ((t = e.target) == document) {
return;
}
if (cmd = t.getAttribute('data-cmd')) {
id = t.getAttribute('data-id');
switch (cmd) {
case 'update':
e.preventDefault();
ThreadUpdater.forceUpdate();
break;
case 'post-menu':
e.preventDefault();
PostMenu.open(t);
break;
case 'auto':
ThreadUpdater.toggleAuto();
break;
case 'totop':
case 'tobottom':
if (!e.shiftKey) {
location.href = '#' + cmd.slice(2);
}
break;
case 'hide':
ThreadHiding.toggle(id);
break;
case 'watch':
ThreadWatcher.toggle(id);
break;
case 'hide-r':
ReplyHiding.toggle(id);
break;
case 'expand':
ThreadExpansion.toggle(id);
break;
case 'open-qr':
e.preventDefault();
QR.show(Main.tid);
$.tag('textarea', document.forms.qrPost)[0].focus();
break;
case 'depage':
e.preventDefault();
Depager.toggle();
break;
case 'report':
Report.open(id, t.getAttribute('data-board'));
break;
case 'filter-sel':
e.preventDefault();
Filter.addSelection();
break;
case 'embed':
Media.toggleEmbed(t);
break
case 'sound':
ThreadUpdater.toggleSound();
break;
case 'toggleMsg':
Main.toggleGlobalMessage();
break;
case 'settings-toggle':
SettingsMenu.toggle();
break;
case 'settings-save':
SettingsMenu.save();
break;
case 'keybinds-open':
Keybinds.open();
break;
case 'filters-open':
Filter.open();
break;
case 'thread-hiding-clear':
ThreadHiding.clear();
break;
case 'css-open':
CustomCSS.open();
break;
case 'settings-export':
SettingsMenu.showExport();
break;
case 'export-close':
SettingsMenu.closeExport();
break;
case 'custom-menu-edit':
CustomMenu.showEditor();
break;
}
}
else if (!Config.disableAll) {
if (QR.enabled && t.title == 'Reply to this post') {
e.preventDefault();
tid = Main.tid || t.previousElementSibling.getAttribute('href').split('#')[0].split('/')[1];
QR.quotePost(tid, !e.ctrlKey && t.textContent);
}
else if (Config.imageExpansion && e.which == 1 && t.parentNode
&& $.hasClass(t.parentNode, 'fileThumb')
&& t.parentNode.nodeName == 'A'
&& !$.hasClass(t.parentNode, 'deleted')) {
if (ImageExpansion.toggle(t)) {
e.preventDefault();
}
}
else if (Config.inlineQuotes && e.which == 1 && $.hasClass(t, 'quotelink')) {
if (!e.shiftKey) {
QuoteInline.toggle(t, e);
}
else {
e.preventDefault();
window.location = t.href;
}
}
else if (Config.threadExpansion && t.parentNode && $.hasClass(t.parentNode, 'abbr')) {
e.preventDefault();
ThreadExpansion.expandComment(t);
}
else if (Main.isMobileDevice && Config.quotePreview) {
if ($.hasClass(t, 'quotelink')
&& (cmd = t.getAttribute('href').match(QuotePreview.regex))
&& cmd[1] != 'rs') {
e.preventDefault();
}
}
}
};
Main.onThreadMouseOver = function(e) {
var t = e.target;
if (Config.quotePreview
&& $.hasClass(t, 'quotelink')
&& !$.hasClass(t, 'deadlink')
&& !$.hasClass(t, 'linkfade')) {
QuotePreview.resolve(e.target);
}
else if (Config.imageHover && t.hasAttribute('data-md5')
&& !$.hasClass(t.parentNode, 'deleted')) {
ImageHover.show(t);
}
else if (Config.embedYouTube && t.getAttribute('data-type') === 'yt' && !Main.hasMobileLayout) {
Media.showYTPreview(t);
}
else if (Config.filter && t.hasAttribute('data-filtered')) {
QuotePreview.show(t,
t.href ? t.parentNode.parentNode.parentNode : t.parentNode.parentNode);
}
};
Main.onThreadMouseOut = function(e) {
var t = e.target;
if (Config.quotePreview && $.hasClass(t, 'quotelink')) {
QuotePreview.remove(t);
}
else if (Config.imageHover && t.hasAttribute('data-md5')) {
ImageHover.hide();
}
else if (Config.embedYouTube && t.getAttribute('data-type') === 'yt' && !Main.hasMobileLayout) {
Media.removeYTPreview();
}
else if (Config.filter && t.hasAttribute('data-filtered')) {
QuotePreview.remove(t);
}
};
Main.linkToThread = function(tid, board, post) {
return '//' + location.host + '/'
+ (board || Main.board) + '/thread/'
+ tid + (post > 0 ? ('#p' + post) : '');
};
Main.addCSS = function() {
var style, css = '\
body.hasDropDownNav {\
margin-top: 45px;\
}\
.extButton.threadHideButton {\
float: left;\
margin-right: 5px;\
margin-top: -1px;\
}\
.extButton.replyHideButton {\
margin-top: 1px;\
}\
div.op > span .postHideButtonCollapsed {\
margin-right: 1px;\
}\
.dropDownNav #boardNavMobile, {\
display: block !important;\
}\
.extPanel {\
border: 1px solid rgba(0, 0, 0, 0.20);\
}\
.tomorrow .extPanel {\
border: 1px solid #111;\
}\
.extButton,\
img.pointer {\
width: 18px;\
height: 18px;\
}\
.extControls {\
display: inline;\
margin-left: 5px;\
}\
.extButton {\
cursor: pointer;\
margin-bottom: -4px;\
}\
.trashIcon {\
width: 16px;\
height: 16px;\
margin-bottom: -2px;\
margin-left: 5px;\
}\
.threadUpdateStatus {\
margin-left: 0.5ex;\
}\
.futaba_new .stub,\
.burichan_new .stub {\
line-height: 1;\
padding-bottom: 1px;\
}\
.stub .extControls,\
.stub .wbtn,\
.stub input {\
display: none;\
}\
.stub .threadHideButton {\
float: none;\
margin-right: 2px;\
}\
div.post div.postInfo {\
width: auto;\
display: inline;\
}\
.right {\
float: right;\
}\
.center {\
display: block;\
margin: auto;\
}\
.pointer {\
cursor: pointer;\
}\
.drag {\
cursor: move !important;\
user-select: none !important;\
-moz-user-select: none !important;\
-webkit-user-select: none !important;\
}\
#quickReport,\
#quickReply {\
display: block;\
position: fixed;\
padding: 2px;\
font-size: 10pt;\
}\
#qrepHeader,\
#qrHeader {\
text-align: center;\
margin-bottom: 1px;\
padding: 0;\
height: 18px;\
line-height: 18px;\
}\
#qrepClose,\
#qrClose {\
float: right;\
}\
#quickReport iframe {\
overflow: hidden;\
}\
#quickReport {\
height: 190px;\
}\
#qrForm > div {\
clear: both;\
}\
#quickReply input[type="text"],\
#quickReply textarea,\
#quickReply #recaptcha_response_field {\
border: 1px solid #aaa;\
font-family: arial,helvetica,sans-serif;\
font-size: 10pt;\
outline: medium none;\
width: 296px;\
padding: 2px;\
margin: 0 0 1px 0;\
}\
#quickReply textarea {\
min-width: 296px;\
float: left;\
}\
#quickReply input::-moz-placeholder,\
#quickReply textarea::-moz-placeholder {\
color: #aaa !important;\
opacity: 1 !important;\
}\
#quickReply input[type="submit"] {\
width: 83px;\
margin: 0;\
font-size: 10pt;\
float: left;\
}\
#quickReply #qrCapField {\
display: block;\
margin-top: 1px;\
}\
#qrCaptcha {\
width: 300px;\
height: 53px;\
cursor: pointer;\
border: 1px solid #aaa;\
display: block;\
}\
#quickReply input.presubmit {\
margin-right: 1px;\
width: 212px;\
float: left;\
}\
#qrFile {\
width: 215px;\
margin-right: 5px;\
}\
.qrRealFile {\
position: absolute;\
left: 0;\
visibility: hidden;\
}\
.yotsuba_new #qrFile {\
color:black;\
}\
#qrSpoiler {\
display: inline;\
}\
#qrError {\
width: 292px;\
display: none;\
font-family: monospace;\
background-color: #E62020;\
font-size: 12px;\
color: white;\
padding: 3px 5px;\
text-shadow: 0 1px rgba(0, 0, 0, 0.20);\
clear: both;\
}\
#qrError a:hover,\
#qrError a {\
color: white !important;\
text-decoration: underline;\
}\
#twHeader {\
font-weight: bold;\
text-align: center;\
height: 17px;\
}\
.futaba_new #twHeader,\
.burichan_new #twHeader {\
line-height: 1;\
}\
#twPrune {\
margin-left: 3px;\
margin-top: -1px;\
}\
#twClose {\
float: left;\
margin-top: -1px;\
}\
#threadWatcher {\
max-width: 265px;\
display: block;\
position: absolute;\
padding: 3px;\
}\
#watchList {\
margin: 0;\
padding: 0;\
user-select: none;\
-moz-user-select: none;\
-webkit-user-select: none;\
}\
#watchList li:first-child {\
margin-top: 3px;\
padding-top: 2px;\
border-top: 1px solid rgba(0, 0, 0, 0.20);\
}\
.photon #watchList li:first-child {\
border-top: 1px solid #ccc;\
}\
.yotsuba_new #watchList li:first-child {\
border-top: 1px solid #d9bfb7;\
}\
.yotsuba_b_new #watchList li:first-child {\
border-top: 1px solid #b7c5d9;\
}\
.tomorrow #watchList li:first-child {\
border-top: 1px solid #111;\
}\
#watchList a {\
text-decoration: none;\
}\
#watchList li {\
overflow: hidden;\
white-space: nowrap;\
text-overflow: ellipsis;\
}\
div.post div.image-expanded {\
display: table;\
}\
div.op div.file .image-expanded-anti {\
margin-left: -3px;\
}\
#quote-preview {\
display: block;\
position: absolute;\
top: 0;\
padding: 3px 6px 6px 3px;\
margin: 0;\
}\
#quote-preview .dateTime {\
white-space: nowrap;\
}\
.yotsuba_new #quote-preview.highlight,\
.yotsuba_b_new #quote-preview.highlight {\
border-width: 1px 2px 2px 1px !important;\
border-style: solid !important;\
}\
.yotsuba_new #quote-preview.highlight {\
border-color: #D99F91 !important;\
}\
.yotsuba_b_new #quote-preview.highlight {\
border-color: #BA9DBF !important;\
}\
.yotsuba_b_new .highlight-anti,\
.burichan_new .highlight-anti {\
border-width: 1px !important;\
background-color: #bfa6ba !important;\
}\
.yotsuba_new .highlight-anti,\
.futaba_new .highlight-anti {\
background-color: #e8a690 !important;\
}\
.tomorrow .highlight-anti {\
background-color: #111 !important;\
border-color: #111;\
}\
.photon .highlight-anti {\
background-color: #bbb !important;\
}\
.op.inlined {\
display: block;\
}\
#quote-preview .inlined,\
#quote-preview .postMenuBtn,\
#quote-preview .extButton,\
#quote-preview .extControls {\
display: none;\
}\
.hasNewReplies {\
font-weight: bold;\
}\
.archivelink {\
opacity: 0.5;\
}\
.deadlink {\
text-decoration: line-through !important;\
}\
div.backlink {\
font-size: 0.8em !important;\
display: inline;\
padding: 0;\
padding-left: 5px;\
}\
.backlink.mobile {\
padding: 3px 5px;\
display: block;\
clear: both;\
line-height: 2;\
}\
.op .backlink.mobile,\
#quote-preview .backlink.mobile {\
display: none !important;\
}\
.backlink.mobile .quoteLink {\
padding-right: 2px;\
}\
.backlink span {\
padding: 0;\
}\
.burichan_new .backlink a,\
.yotsuba_b_new .backlink a {\
color: #34345C !important;\
}\
.burichan_new .backlink a:hover,\
.yotsuba_b_new .backlink a:hover {\
color: #dd0000 !important;\
}\
.expbtn {\
margin-right: 3px;\
margin-left: 2px;\
}\
.tCollapsed .rExpanded {\
display: none;\
}\
#stickyNav {\
position: fixed;\
font-size: 0;\
}\
#stickyNav img {\
vertical-align: middle;\
}\
.tu-error {\
color: red;\
}\
.topPageNav {\
position: absolute;\
}\
.yotsuba_b_new .topPageNav {\
border-top: 1px solid rgba(255, 255, 255, 0.25);\
border-left: 1px solid rgba(255, 255, 255, 0.25);\
}\
.newPostsMarker:not(#quote-preview) {\
box-shadow: 0 3px red;\
}\
#toggleMsgBtn {\
float: left;\
margin-bottom: 6px;\
}\
.panelHeader {\
font-weight: bold;\
font-size: 16px;\
text-align: center;\
margin-bottom: 5px;\
margin-top: 5px;\
padding-bottom: 5px;\
border-bottom: 1px solid rgba(0, 0, 0, 0.20);\
}\
.yotsuba_new .panelHeader {\
border-bottom: 1px solid #d9bfb7;\
}\
.yotsuba_b_new .panelHeader {\
border-bottom: 1px solid #b7c5d9;\
}\
.tomorrow .panelHeader {\
border-bottom: 1px solid #111;\
}\
.panelHeader span {\
position: absolute;\
right: 5px;\
top: 5px;\
}\
.UIMenu,\
.UIPanel {\
position: fixed;\
width: 100%;\
height: 100%;\
z-index: 9002;\
top: 0;\
left: 0;\
}\
.UIPanel {\
line-height: 14px;\
font-size: 14px;\
background-color: rgba(0, 0, 0, 0.25);\
}\
.UIPanel:after {\
display: inline-block;\
height: 100%;\
vertical-align: middle;\
content: "";\
}\
.UIPanel > div {\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
display: inline-block;\
height: auto;\
max-height: 100%;\
position: relative;\
width: 400px;\
left: 50%;\
margin-left: -200px;\
overflow: auto;\
box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);\
vertical-align: middle;\
}\
#settingsMenu > div {\
top: 25px;;\
vertical-align: top;\
max-height: 85%;\
}\
.extPanel input[type="text"],\
.extPanel textarea {\
border: 1px solid #AAA;\
outline: none;\
}\
.UIPanel .center {\
margin-bottom: 5px;\
}\
.UIPanel button {\
display: inline-block;\
margin-right: 5px;\
}\
.UIPanel code {\
background-color: #eee;\
color: #000000;\
padding: 1px 4px;\
font-size: 12px;\
}\
.UIPanel ul {\
list-style: none;\
padding: 0;\
margin: 0 0 10px;\
}\
.UIPanel .export-field {\
width: 385px;\
}\
#settingsMenu label input {\
margin-right: 5px;\
}\
.tomorrow #settingsMenu ul {\
border-bottom: 1px solid #282a2e;\
}\
.settings-off {\
padding-left: 3px;\
}\
.settings-cat-lbl {\
font-weight: bold;\
margin: 10px 0 5px;\
padding-left: 5px;\
}\
.settings-cat-lbl img {\
vertical-align: text-bottom;\
margin-right: 5px;\
cursor: pointer;\
width: 18px;\
height: 18px;\
}\
.settings-tip {\
font-size: 0.85em;\
margin: 2px 0 5px 0;\
padding-left: 23px;\
}\
#settings-exp-all {\
padding-left: 7px;\
text-align: center;\
}\
#settingsMenu .settings-cat {\
display: none;\
margin-left: 3px;\
}\
#customCSSMenu textarea {\
display: block;\
max-width: 100%;\
min-width: 100%;\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
height: 200px;\
margin: 0 0 5px;\
font-family: monospace;\
}\
#customCSSMenu .right,\
#settingsMenu .right {\
margin-top: 2px;\
}\
#settingsMenu label {\
display: inline-block;\
user-select: none;\
-moz-user-select: none;\
-webkit-user-select: none;\
}\
#filtersHelp > div {\
width: 600px;\
left: 50%;\
margin-left: -300px;\
}\
#filtersHelp h4 {\
font-size: 15px;\
margin: 20px 0 0 10px;\
}\
#filtersHelp h4:before {\
content: "»";\
margin-right: 3px;\
}\
#filtersHelp ul {\
padding: 0;\
margin: 10px;\
}\
#filtersHelp li {\
padding: 3px 0;\
list-style: none;\
}\
#filtersMenu table {\
width: 100%;\
}\
#filtersMenu th {\
font-size: 12px;\
}\
#filtersMenu tbody {\
text-align: center;\
}\
#filtersMenu select,\
#filtersMenu .fPattern,\
#filtersMenu .fBoards,\
#palette-custom-input {\
padding: 1px;\
font-size: 11px;\
}\
#filtersMenu select {\
width: 75px;\
}\
#filtersMenu tfoot td {\
padding-top: 10px;\
}\
#keybindsHelp li {\
padding: 3px 5px;\
}\
.fPattern {\
width: 110px;\
}\
.fBoards {\
width: 25px;\
}\
.fColor {\
width: 60px;\
}\
.fDel {\
font-size: 16px;\
}\
.filter-preview {\
cursor: default;\
margin-left: 3px;\
}\
#quote-preview iframe,\
#quote-preview .filter-preview {\
display: none;\
}\
.post-hidden .extButton,\
.post-hidden:not(#quote-preview) .postInfo {\
opacity: 0.5;\
}\
.post-hidden:not(.thread) .postInfo {\
padding-left: 5px;\
}\
.post-hidden:not(#quote-preview) input,\
.post-hidden:not(#quote-preview) .replyContainer,\
.post-hidden:not(#quote-preview) .summary,\
.post-hidden:not(#quote-preview) .op .file,\
.post-hidden:not(#quote-preview) .file,\
.post-hidden .wbtn,\
.post-hidden .postNum span,\
.post-hidden:not(#quote-preview) .backlink,\
div.post-hidden:not(#quote-preview) div.file,\
div.post-hidden:not(#quote-preview) blockquote.postMessage {\
display: none;\
}\
.click-me {\
border-radius: 5px;\
margin-top: 5px;\
padding: 2px 5px;\
position: absolute;\
font-weight: bold;\
z-index: 2;\
white-space: nowrap;\
}\
.yotsuba_new .click-me,\
.futaba_new .click-me {\
color: #800000;\
background-color: #F0E0D6;\
border: 2px solid #D9BFB7;\
}\
.yotsuba_b_new .click-me,\
.burichan_new .click-me {\
color: #000;\
background-color: #D6DAF0;\
border: 2px solid #B7C5D9;\
}\
.tomorrow .click-me {\
color: #C5C8C6;\
background-color: #282A2E;\
border: 2px solid #111;\
}\
.photon .click-me {\
color: #333;\
background-color: #ddd;\
border: 2px solid #ccc;\
}\
.click-me:before {\
content: "";\
border-width: 0 6px 6px;\
border-style: solid;\
left: 50%;\
margin-left: -6px;\
position: absolute;\
width: 0;\
height: 0;\
top: -6px;\
}\
.yotsuba_new .click-me:before,\
.futaba_new .click-me:before {\
border-color: #D9BFB7 transparent;\
}\
.yotsuba_b_new .click-me:before,\
.burichan_new .click-me:before {\
border-color: #B7C5D9 transparent;\
}\
.tomorrow .click-me:before {\
border-color: #111 transparent;\
}\
.photon .click-me:before {\
border-color: #ccc transparent;\
}\
.click-me:after {\
content: "";\
border-width: 0 4px 4px;\
top: -4px;\
display: block;\
left: 50%;\
margin-left: -4px;\
position: absolute;\
width: 0;\
height: 0;\
}\
.yotsuba_new .click-me:after,\
.futaba_new .click-me:after {\
border-color: #F0E0D6 transparent;\
border-style: solid;\
}\
.yotsuba_b_new .click-me:after,\
.burichan_new .click-me:after {\
border-color: #D6DAF0 transparent;\
border-style: solid;\
}\
.tomorrow .click-me:after {\
border-color: #282A2E transparent;\
border-style: solid;\
}\
.photon .click-me:after {\
border-color: #DDD transparent;\
border-style: solid;\
}\
#image-hover {\
position: fixed;\
max-width: 100%;\
max-height: 100%;\
top: 0px;\
right: 0px;\
z-index: 9002;\
}\
.thread-stats {\
float: right;\
margin-right: 5px;\
cursor: default;\
}\
.compact .thread {\
max-width: 75%;\
}\
.dotted {\
text-decoration: none;\
border-bottom: 1px dashed;\
}\
.linkfade {\
opacity: 0.5;\
}\
#quote-preview .linkfade {\
opacity: 1.0;\
}\
kbd {\
background-color: #f7f7f7;\
color: black;\
border: 1px solid #ccc;\
border-radius: 3px 3px 3px 3px;\
box-shadow: 0 1px 0 #ccc, 0 0 0 2px #fff inset;\
font-family: monospace;\
font-size: 11px;\
line-height: 1.4;\
padding: 0 5px;\
}\
.deleted {\
opacity: 0.66;\
}\
.noPictures a.fileThumb img:not(.expanded-thumb) {\
opacity: 0;\
}\
.noPictures.futaba_new a.fileThumb,\
.noPictures.yotsuba_new a.fileThumb {\
border: 1px solid #800;\
}\
.noPictures.burichan_new a.fileThumb,\
.noPictures.yotsuba_b_new a.fileThumb {\
border: 1px solid #34345C;\
}\
.noPictures.tomorrow a.fileThumb:not(.expanded-thumb) {\
border: 1px solid #C5C8C6;\
}\
.noPictures.photon a.fileThumb:not(.expanded-thumb) {\
border: 1px solid #004A99;\
}\
.spinner {\
margin-top: 2px;\
padding: 3px;\
display: table;\
}\
#settings-presets {\
position: relative;\
top: -1px;\
}\
#colorpicker { \
position: fixed;\
text-align: center;\
}\
.colorbox {\
font-size: 10px;\
width: 16px;\
height: 16px;\
line-height: 17px;\
display: inline-block;\
text-align: center;\
background-color: #fff;\
border: 1px solid #aaa;\
text-decoration: none;\
color: #000;\
cursor: pointer;\
vertical-align: top;\
}\
#palette-custom-input {\
vertical-align: top;\
width: 45px;\
margin-right: 2px;\
}\
#qrDummyFile {\
float: left;\
margin-right: 5px;\
width: 220px;\
cursor: default;\
-moz-user-select: none;\
-webkit-user-select: none;\
-ms-user-select: none;\
user-select: none;\
white-space: nowrap;\
text-overflow: ellipsis;\
overflow: hidden;\
}\
#qrDummyFileLabel {\
margin-left: 3px;\
}\
.depageNumber {\
position: absolute;\
right: 5px;\
}\
.depagerEnabled .depagelink {\
font-weight: bold;\
}\
.depagerEnabled strong {\
font-weight: normal;\
}\
.depagelink {\
display: inline-block;\
padding: 4px 0;\
cursor: pointer;\
text-decoration: none;\
}\
.burichan_new .depagelink,\
.futaba_new .depagelink {\
text-decoration: underline;\
}\
#customMenuBox {\
margin: 0 auto 5px auto;\
width: 385px;\
display: block;\
}\
.preview-summary {\
display: block;\
}\
#swf-embed-header {\
padding: 0 0 0 3px;\
font-weight: normal;\
height: 20px;\
line-height: 20px;\
}\
.yotsuba_new #swf-embed-header,\
.yotsuba_b_new #swf-embed-header {\
height: 18px;\
line-height: 18px;\
}\
#swf-embed-close {\
position: absolute;\
right: 0;\
top: 1px;\
}\
.open-qr-wrap {\
text-align: center;\
width: 200px;\
position: absolute;\
margin-left: 50%;\
left: -100px;\
}\
.postMenuBtn {\
margin-left: 5px;\
text-decoration: none;\
line-height: 1em;\
display: inline-block;\
-webkit-transition: -webkit-transform 0.1s;\
-moz-transition: -moz-transform 0.1s;\
transition: transform 0.1s;\
width: 1em;\
height: 1em;\
text-align: center;\
outline: none;\
opacity: 0.8;\
}\
.postMenuBtn:hover{\
opacity: 1;\
}\
.yotsuba_new .postMenuBtn,\
.futaba_new .postMenuBtn {\
color: #000080;\
}\
.tomorrow .postMenuBtn {\
color: #5F89AC !important;\
}\
.tomorrow .postMenuBtn:hover {\
color: #81a2be !important;\
}\
.photon .postMenuBtn {\
color: #FF6600 !important;\
}\
.photon .postMenuBtn:hover {\
color: #FF3300 !important;\
}\
.menuOpen {\
-webkit-transform: rotate(90deg);\
-moz-transform: rotate(90deg);\
-ms-transform: rotate(90deg);\
transform: rotate(90deg);\
}\
.settings-sub label:before {\
border-bottom: 1px solid;\
border-left: 1px solid;\
content: " ";\
display: inline-block;\
height: 8px;\
margin-bottom: 5px;\
width: 8px;\
}\
.settings-sub {\
margin-left: 25px;\
}\
.settings-tip.settings-sub {\
padding-left: 32px;\
}\
.centeredThreads .opContainer {\
display: block;\
}\
.centeredThreads .postContainer {\
margin: auto;\
width: 75%;\
}\
.centeredThreads .sideArrows {\
display: none;\
}\
.centre-exp {\
width: auto !important;\
clear: both;\
}\
.centeredThreads .expandedWebm {\
float: none;\
}\
.centeredThreads .summary {\
margin-left: 12.5%;\
display: block;\
}\
.centre-exp div.op{\
display: table;\
}\
#yt-preview { position: absolute; }\
#yt-preview img { display: block; }\
\
@media only screen and (max-width: 480px) {\
#threadWatcher {\
max-width: none;\
padding: 3px 0;\
left: 0;\
width: 100%;\
border-left: none;\
border-right: none;\
}\
#watchList {\
padding: 0 10px;\
}\
.btn-row {\
margin-top: 5px;\
}\
.image-expanded .mFileInfo {\
display: none !important;\
}\
.mobile-report {\
float: right;\
font-size: 11px;\
margin-bottom: 3px;\
margin-left: 10px;\
}\
.mobile-report:after {\
content: "]";\
}\
.mobile-report:before {\
content: "[";\
}\
.nws .mobile-report:after {\
color: #800000;\
}\
.nws .mobile-report:before {\
color: #800000;\
}\
.ws .mobile-report {\
color: #34345C;\
}\
.nws .mobile-report {\
color:#0000EE;\
}\
.reply .mobile-report {\
margin: 5px 5px 0 5px;\
}\
.postLink .mobileHideButton {\
margin-right: 3px;\
}\
.board .mobile-hr-hidden {\
margin-top: 10px !important;\
}\
.board > .mobileHideButton {\
margin-top: -20px !important;\
}\
.board > .mobileHideButton:first-child {\
margin-top: 10px !important;\
}\
.extButton.threadHideButton {\
float: none;\
margin: 0;\
margin-bottom: 5px;\
}\
.mobile-post-hidden {\
display: none;\
}\
#toggleMsgBtn {\
display: none;\
}\
.mobile-tu-status {\
height: 20px;\
line-height: 20px;\
}\
.mobile-tu-show {\
width: 150px;\
margin: auto;\
display: block;\
text-align: center;\
}\
.button input {\
margin: 0 3px 0 0;\
position: relative;\
top: -2px;\
border-radius: 0;\
height: 10px;\
width: 10px;\
}\
.UIPanel > div {\
width: 320px;\
margin-left: -160px;\
}\
.UIPanel .export-field {\
width: 300px;\
}\
.yotsuba_new #quote-preview.highlight,\
#quote-preview {\
border-width: 1px !important;\
}\
.yotsuba_new #quote-preview.highlight {\
border-color: #D9BFB7 !important;\
}\
#quickReply input[type="text"],\
#quickReply textarea,\
.extPanel input[type="text"],\
.extPanel textarea {\
font-size: 16px;\
}\
#quickReply {\
position: absolute;\
left: 50%;\
margin-left: -154px;\
}\
}\
';
style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.textContent = css;
document.head.appendChild(style);
};
Main.init();