Tag:
%g
+
Literal %: %%
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`;
- var KeybindsPage = `
Keybinds are disabled.
-
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
-
Press Backspace to disable a keybind.
-
+ var KeybindsPage = `
Keybinds are disabled.
+
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
+
Press Backspace to disable a keybind.
+
`;
- var FilterSelectPage = `
-
+ var FilterSelectPage = `
+
`;
- var burichan = `/* General */
-:root.burichan .dialog {
- background-color: #D6DAF0;
- border-color: #B7C5D9;
-}
-:root.burichan .field:focus,
-:root.burichan .field.focus {
- border-color: #98E;
-}
-
-/* Header */
-:root.burichan #header-bar.dialog {
- background-color: rgba(214,218,240,0.98);
-}
-:root.burichan:not(.fixed) #header-bar, :root.burichan #header-bar #notifications {
- font-size: 11pt;
-}
-:root.burichan #header-bar, :root.burichan #header-bar #notifications {
- color: #89A;
-}
-:root.burichan #header-bar a, :root.burichan #header-bar #notifications a {
- color: #34345C;
-}
-
-/* Settings */
-:root.burichan #fourchanx-settings fieldset, :root.burichan .section-main div::before {
- border-color: #B7C5D9;
-}
-:root.burichan .suboption-list > div:last-of-type {
- background-color: #D6DAF0;
-}
-
-/* Catalog */
-:root.burichan.catalog-hover-expand .catalog-container:hover > .post {
- background-color: #D6DAF0;
-}
-:root.burichan.werkTyme .catalog-thread:not(:hover),
-:root.burichan.werkTyme:not(.catalog-hover-expand) .catalog-thread,
-:root.burichan.catalog-hover-expand .catalog-container:hover > .post,
-:root.burichan.catalog-hover-expand .catalog-container:hover .catalog-reply {
- border-color: #B7C5D9;
-}
-
-/* Quote */
-:root.burichan .backlink.deadlink {
- color: #34345C !important;
-}
-:root.burichan .inline {
- border-color: #B7C5D9;
- background-color: rgba(255, 255, 255, .14);
-}
-
-/* Fappe and Werk Tyme */
-:root.burichan .indicator {
- color: #D6DAF0;
-}
-
-/* Anonymize */
-:root.burichan.anonymize $site$info$name::before {
- font-size: 12pt;
-}
-
-/* QR */
-.burichan #dump-list::-webkit-scrollbar-thumb {
- background-color: #D6DAF0;
- border-color: #B7C5D9;
-}
-:root.burichan .qr-preview {
- background-color: rgba(0, 0, 0, .15);
-}
-:root.burichan .qr-link {
- border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);
- background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;
-}
-:root.burichan .qr-link:hover {
- background: #D9DDF3;
-}
-
-/* Menu */
-:root.burichan #menu {
- color: #000000;
-}
-:root.burichan .entry {
- font-size: 12pt;
-}
-:root.burichan .focused.entry {
- background: rgba(255, 255, 255, .33);
-}
-
-/* Unread */
-:root.burichan .unread-mark-read {
- background-color: rgba(214,218,240,0.5);
-}
-
-/* Thread Watcher */
-:root.burichan .replies-quoting-you > a, :root.burichan #watcher-link.replies-quoting-you, :root.burichan .last-page > a > .watcher-page {
- color: #F00;
-}
-
-/* Watcher Favicon */
-:root.burichan .watch-thread-link
-{
- background-image: url("data:image/svg+xml,
");
-}
+ var burichan = `/* General */
+:root.burichan .dialog {
+ background-color: #D6DAF0;
+ border-color: #B7C5D9;
+}
+:root.burichan .field:focus,
+:root.burichan .field.focus {
+ border-color: #98E;
+}
+
+/* Header */
+:root.burichan #header-bar.dialog {
+ background-color: rgba(214,218,240,0.98);
+}
+:root.burichan:not(.fixed) #header-bar, :root.burichan #header-bar #notifications {
+ font-size: 11pt;
+}
+:root.burichan #header-bar, :root.burichan #header-bar #notifications {
+ color: #89A;
+}
+:root.burichan #header-bar a, :root.burichan #header-bar #notifications a {
+ color: #34345C;
+}
+
+/* Settings */
+:root.burichan #fourchanx-settings fieldset, :root.burichan .section-main div::before {
+ border-color: #B7C5D9;
+}
+:root.burichan .suboption-list > div:last-of-type {
+ background-color: #D6DAF0;
+}
+
+/* Catalog */
+:root.burichan.catalog-hover-expand .catalog-container:hover > .post {
+ background-color: #D6DAF0;
+}
+:root.burichan.werkTyme .catalog-thread:not(:hover),
+:root.burichan.werkTyme:not(.catalog-hover-expand) .catalog-thread,
+:root.burichan.catalog-hover-expand .catalog-container:hover > .post,
+:root.burichan.catalog-hover-expand .catalog-container:hover .catalog-reply {
+ border-color: #B7C5D9;
+}
+
+/* Quote */
+:root.burichan .backlink.deadlink {
+ color: #34345C !important;
+}
+:root.burichan .inline {
+ border-color: #B7C5D9;
+ background-color: rgba(255, 255, 255, .14);
+}
+
+/* Fappe and Werk Tyme */
+:root.burichan .indicator {
+ color: #D6DAF0;
+}
+
+/* Anonymize */
+:root.burichan.anonymize $site$info$name::before {
+ font-size: 12pt;
+}
+
+/* QR */
+.burichan #dump-list::-webkit-scrollbar-thumb {
+ background-color: #D6DAF0;
+ border-color: #B7C5D9;
+}
+:root.burichan .qr-preview {
+ background-color: rgba(0, 0, 0, .15);
+}
+:root.burichan .qr-link {
+ border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);
+ background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;
+}
+:root.burichan .qr-link:hover {
+ background: #D9DDF3;
+}
+
+/* Menu */
+:root.burichan #menu {
+ color: #000000;
+}
+:root.burichan .entry {
+ font-size: 12pt;
+}
+:root.burichan .focused.entry {
+ background: rgba(255, 255, 255, .33);
+}
+
+/* Unread */
+:root.burichan .unread-mark-read {
+ background-color: rgba(214,218,240,0.5);
+}
+
+/* Thread Watcher */
+:root.burichan .replies-quoting-you > a, :root.burichan #watcher-link.replies-quoting-you, :root.burichan .last-page > a > .watcher-page {
+ color: #F00;
+}
+
+/* Watcher Favicon */
+:root.burichan .watch-thread-link
+{
+ background-image: url("data:image/svg+xml,
");
+}
`;
- var futaba = `/* General */
-:root.futaba .dialog {
- background-color: #F0E0D6;
- border-color: #D9BFB7;
-}
-:root.futaba .field:focus,
-:root.futaba .field.focus {
- border-color: #EA8;
-}
-
-/* Header */
-:root.futaba #header-bar.dialog {
- background-color: rgba(240,224,214,0.98);
-}
-:root.futaba:not(.fixed) #header-bar, :root.futaba #notifications {
- font-size: 11pt;
-}
-:root.futaba #header-bar, :root.futaba #notifications {
- color: #B86;
-}
-:root.futaba #header-bar a, :root.futaba #notifications a {
- color: #800000;
-}
-
-/* Settings */
-:root.futaba #fourchanx-settings fieldset, :root.futaba .section-main div::before {
- border-color: #D9BFB7;
-}
-:root.futaba .suboption-list > div:last-of-type {
- background-color: #F0E0D6;
-}
-
-/* Catalog */
-:root.futaba.catalog-hover-expand .catalog-container:hover > .post {
- background-color: #F0E0D6;
-}
-:root.futaba.werkTyme .catalog-thread:not(:hover),
-:root.futaba.werkTyme:not(.catalog-hover-expand) .catalog-thread,
-:root.futaba.catalog-hover-expand .catalog-container:hover > .post,
-:root.futaba.catalog-hover-expand .catalog-container:hover .catalog-reply {
- border-color: #D9BFB7;
-}
-
-/* Quote */
-:root.futaba .backlink.deadlink {
- color: #00E !important;
-}
-:root.futaba .inline {
- border-color: #D9BFB7;
- background-color: rgba(255, 255, 255, .14);
-}
-
-/* Fappe and Werk Tyme */
-:root.futaba .indicator {
- color: #F0E0D6;
-}
-
-/* Anonymize */
-:root.futaba.anonymize $site$info$name::before {
- font-size: 12pt;
-}
-
-/* QR */
-.futaba #dump-list::-webkit-scrollbar-thumb {
- background-color: #F0E0D6;
- border-color: #D9BFB7;
-}
-:root.futaba .qr-preview {
- background-color: rgba(0, 0, 0, .15);
-}
-:root.futaba .qr-link {
- border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);
- background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;
-}
-:root.futaba .qr-link:hover {
- background: #F0E0D6;
-}
-
-/* Menu */
-:root.futaba #menu {
- color: #800000;
-}
-:root.futaba .entry {
- font-size: 12pt;
-}
-:root.futaba .focused.entry {
- background: rgba(255, 255, 255, .33);
-}
-
-/* Unread */
-:root.futaba .unread-mark-read {
- background-color: rgba(240,224,214,0.5);
-}
-
-/* Thread Watcher */
-:root.futaba .replies-quoting-you > a, :root.futaba #watcher-link.replies-quoting-you, :root.futaba .last-page > a > .watcher-page {
- color: #F00;
-}
-
-/* Watcher Favicon */
-:root.futaba .watch-thread-link
-{
- background-image: url("data:image/svg+xml,
");
-}
+ var futaba = `/* General */
+:root.futaba .dialog {
+ background-color: #F0E0D6;
+ border-color: #D9BFB7;
+}
+:root.futaba .field:focus,
+:root.futaba .field.focus {
+ border-color: #EA8;
+}
+
+/* Header */
+:root.futaba #header-bar.dialog {
+ background-color: rgba(240,224,214,0.98);
+}
+:root.futaba:not(.fixed) #header-bar, :root.futaba #notifications {
+ font-size: 11pt;
+}
+:root.futaba #header-bar, :root.futaba #notifications {
+ color: #B86;
+}
+:root.futaba #header-bar a, :root.futaba #notifications a {
+ color: #800000;
+}
+
+/* Settings */
+:root.futaba #fourchanx-settings fieldset, :root.futaba .section-main div::before {
+ border-color: #D9BFB7;
+}
+:root.futaba .suboption-list > div:last-of-type {
+ background-color: #F0E0D6;
+}
+
+/* Catalog */
+:root.futaba.catalog-hover-expand .catalog-container:hover > .post {
+ background-color: #F0E0D6;
+}
+:root.futaba.werkTyme .catalog-thread:not(:hover),
+:root.futaba.werkTyme:not(.catalog-hover-expand) .catalog-thread,
+:root.futaba.catalog-hover-expand .catalog-container:hover > .post,
+:root.futaba.catalog-hover-expand .catalog-container:hover .catalog-reply {
+ border-color: #D9BFB7;
+}
+
+/* Quote */
+:root.futaba .backlink.deadlink {
+ color: #00E !important;
+}
+:root.futaba .inline {
+ border-color: #D9BFB7;
+ background-color: rgba(255, 255, 255, .14);
+}
+
+/* Fappe and Werk Tyme */
+:root.futaba .indicator {
+ color: #F0E0D6;
+}
+
+/* Anonymize */
+:root.futaba.anonymize $site$info$name::before {
+ font-size: 12pt;
+}
+
+/* QR */
+.futaba #dump-list::-webkit-scrollbar-thumb {
+ background-color: #F0E0D6;
+ border-color: #D9BFB7;
+}
+:root.futaba .qr-preview {
+ background-color: rgba(0, 0, 0, .15);
+}
+:root.futaba .qr-link {
+ border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);
+ background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;
+}
+:root.futaba .qr-link:hover {
+ background: #F0E0D6;
+}
+
+/* Menu */
+:root.futaba #menu {
+ color: #800000;
+}
+:root.futaba .entry {
+ font-size: 12pt;
+}
+:root.futaba .focused.entry {
+ background: rgba(255, 255, 255, .33);
+}
+
+/* Unread */
+:root.futaba .unread-mark-read {
+ background-color: rgba(240,224,214,0.5);
+}
+
+/* Thread Watcher */
+:root.futaba .replies-quoting-you > a, :root.futaba #watcher-link.replies-quoting-you, :root.futaba .last-page > a > .watcher-page {
+ color: #F00;
+}
+
+/* Watcher Favicon */
+:root.futaba .watch-thread-link
+{
+ background-image: url("data:image/svg+xml,
");
+}
`;
var linkifyAudio = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==';
@@ -9501,3261 +9504,3261 @@ https://*.hcaptcha.com
var linkifyYoutube = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII=';
- var photon = `/* General */
-:root.photon .dialog {
- background-color: #DDD;
- border-color: #CCC;
-}
-:root.photon .field:focus,
-:root.photon .field.focus {
- border-color: #EA8;
-}
-
-/* 4chan style fixes */
-:root.photon #arc-list tr:nth-of-type(odd) span.quote {
- color: #C0E17A;
-}
-:root.photon.highlight-you .quotesYou$site$highlightable$reply {
- border-left: 3px solid rgba(221, 0, 0, .8) !important;
-}
-:root.photon.highlight-own .yourPost$site$highlightable$reply {
- border-left: 3px dashed rgba(221, 0, 0, .8) !important;
-}
-
-/* Header */
-:root.photon #header-bar.dialog {
- background-color: rgba(221,221,221,0.98);
-}
-:root.photon:not(.fixed) #header-bar, :root.photon #notifications {
- font-size: 9pt;
-}
-:root.photon #header-bar, :root.photon #notifications {
- color: #333;
-}
-:root.photon #header-bar a, :root.photon #notifications a {
- color: #FF6600;
-}
-
-/* Settings */
-:root.photon #fourchanx-settings fieldset, :root.photon .section-main div::before {
- border-color: #CCC;
-}
-:root.photon .suboption-list > div:last-of-type {
- background-color: #DDD;
-}
-
-/* Catalog */
-:root.photon.catalog-hover-expand .catalog-container:hover > .post {
- background-color: #DDD;
-}
-:root.photon.werkTyme .catalog-thread:not(:hover),
-:root.photon.werkTyme:not(.catalog-hover-expand) .catalog-thread,
-:root.photon.catalog-hover-expand .catalog-container:hover > .post,
-:root.photon.catalog-hover-expand .catalog-container:hover .catalog-reply {
- border-color: #CCC;
-}
-
-/* Quote */
-:root.photon .backlink.deadlink {
- color: #F60 !important;
-}
-:root.photon .inline {
- border-color: #CCC;
- background-color: rgba(255, 255, 255, .14);
-}
-
-/* Fappe and Werk Tyme */
-:root.photon .indicator {
- color: #DDD;
-}
-
-/* QR */
-.photon #dump-list::-webkit-scrollbar-thumb {
- background-color: #DDD;
- border-color: #CCC;
-}
-:root.photon .qr-preview {
- background-color: rgba(0, 0, 0, .15);
-}
-:root.photon .qr-link {
- border-color: rgb(206, 206, 206) rgb(206, 206, 206) rgb(191, 191, 191);
- background: linear-gradient(#ECECEC, #DDD) repeat scroll 0% 0% transparent;
-}
-:root.photon .qr-link:hover {
- background: #DDDDDD;
-}
-
-/* Menu */
-:root.photon #menu {
- color: #333;
-}
-:root.photon .entry {
- font-size: 10pt;
-}
-:root.photon .focused.entry {
- background: rgba(255, 255, 255, .33);
-}
-
-/* Unread */
-:root.photon .unread-mark-read {
- background-color: rgba(221,221,221,0.5);
-}
-
-/* Thread Watcher */
-:root.photon .replies-quoting-you > a, :root.photon #watcher-link.replies-quoting-you, :root.photon .last-page > a > .watcher-page {
- color: #00F !important;
-}
-
-/* Watcher Favicon */
-:root.photon .watch-thread-link
-{
- background-image: url("data:image/svg+xml,
");
-}
+ var photon = `/* General */
+:root.photon .dialog {
+ background-color: #DDD;
+ border-color: #CCC;
+}
+:root.photon .field:focus,
+:root.photon .field.focus {
+ border-color: #EA8;
+}
+
+/* 4chan style fixes */
+:root.photon #arc-list tr:nth-of-type(odd) span.quote {
+ color: #C0E17A;
+}
+:root.photon.highlight-you .quotesYou$site$highlightable$reply {
+ border-left: 3px solid rgba(221, 0, 0, .8) !important;
+}
+:root.photon.highlight-own .yourPost$site$highlightable$reply {
+ border-left: 3px dashed rgba(221, 0, 0, .8) !important;
+}
+
+/* Header */
+:root.photon #header-bar.dialog {
+ background-color: rgba(221,221,221,0.98);
+}
+:root.photon:not(.fixed) #header-bar, :root.photon #notifications {
+ font-size: 9pt;
+}
+:root.photon #header-bar, :root.photon #notifications {
+ color: #333;
+}
+:root.photon #header-bar a, :root.photon #notifications a {
+ color: #FF6600;
+}
+
+/* Settings */
+:root.photon #fourchanx-settings fieldset, :root.photon .section-main div::before {
+ border-color: #CCC;
+}
+:root.photon .suboption-list > div:last-of-type {
+ background-color: #DDD;
+}
+
+/* Catalog */
+:root.photon.catalog-hover-expand .catalog-container:hover > .post {
+ background-color: #DDD;
+}
+:root.photon.werkTyme .catalog-thread:not(:hover),
+:root.photon.werkTyme:not(.catalog-hover-expand) .catalog-thread,
+:root.photon.catalog-hover-expand .catalog-container:hover > .post,
+:root.photon.catalog-hover-expand .catalog-container:hover .catalog-reply {
+ border-color: #CCC;
+}
+
+/* Quote */
+:root.photon .backlink.deadlink {
+ color: #F60 !important;
+}
+:root.photon .inline {
+ border-color: #CCC;
+ background-color: rgba(255, 255, 255, .14);
+}
+
+/* Fappe and Werk Tyme */
+:root.photon .indicator {
+ color: #DDD;
+}
+
+/* QR */
+.photon #dump-list::-webkit-scrollbar-thumb {
+ background-color: #DDD;
+ border-color: #CCC;
+}
+:root.photon .qr-preview {
+ background-color: rgba(0, 0, 0, .15);
+}
+:root.photon .qr-link {
+ border-color: rgb(206, 206, 206) rgb(206, 206, 206) rgb(191, 191, 191);
+ background: linear-gradient(#ECECEC, #DDD) repeat scroll 0% 0% transparent;
+}
+:root.photon .qr-link:hover {
+ background: #DDDDDD;
+}
+
+/* Menu */
+:root.photon #menu {
+ color: #333;
+}
+:root.photon .entry {
+ font-size: 10pt;
+}
+:root.photon .focused.entry {
+ background: rgba(255, 255, 255, .33);
+}
+
+/* Unread */
+:root.photon .unread-mark-read {
+ background-color: rgba(221,221,221,0.5);
+}
+
+/* Thread Watcher */
+:root.photon .replies-quoting-you > a, :root.photon #watcher-link.replies-quoting-you, :root.photon .last-page > a > .watcher-page {
+ color: #00F !important;
+}
+
+/* Watcher Favicon */
+:root.photon .watch-thread-link
+{
+ background-image: url("data:image/svg+xml,
");
+}
`;
- var report = `#g-recaptcha,
-:root:not(.js-enabled) #captchaContainerAlt {
- height: auto;
-}
-#captchaContainerAlt td:nth-child(2) {
- display: table-cell !important;
-}
-
-/* Archive reports */
-#archive-report {
- padding: 3px;
-}
-#archive-report-enabled {
- vertical-align: middle;
-}
-#archive-report > label {
- display: block;
-}
-#archive-report-reason {
- display: block;
- width: 98%;
-}
-.archive-report-success {
- color: green;
-}
-.archive-report-error {
- color: red;
+ var report = `#g-recaptcha,
+:root:not(.js-enabled) #captchaContainerAlt {
+ height: auto;
+}
+#captchaContainerAlt td:nth-child(2) {
+ display: table-cell !important;
+}
+
+/* Archive reports */
+#archive-report {
+ padding: 3px;
+}
+#archive-report-enabled {
+ vertical-align: middle;
+}
+#archive-report > label {
+ display: block;
+}
+#archive-report-reason {
+ display: block;
+ width: 98%;
+}
+.archive-report-success {
+ color: green;
+}
+.archive-report-error {
+ color: red;
}`;
- var spooky = `/* General */
-:root.spooky .dialog {
- background-color: #171526;
- border-color: #707070;
-}
-:root.spooky .field:focus,
-:root.spooky .field.focus {
- border-color: #98E;
-}
-
-/* 4chan style fixes */
-:root.spooky #arc-list span.quote {
- color: #634C2C;
-}
-:root.spooky.highlight-you .quotesYou$site$highlightable$reply {
- border-left: 3px solid rgba(145, 182, 214, .8) !important;
-}
-:root.spooky.highlight-own .yourPost$site$highlightable$reply {
- border-left: 3px dashed rgba(145, 182, 214, .8) !important;
-}
-
-/* Header */
-:root.spooky #header-bar.dialog {
- background-color: rgba(23,21,38,0.98);
-}
-:root.spooky:not(.fixed) #header-bar, :root.spooky #notifications {
- font-size: 9pt;
-}
-:root.spooky #header-bar, :root.spooky #notifications {
- color: #C49756;
-}
-:root.spooky #board-list a, :root.spooky #shortcuts a {
- color: #FE9600;
-}
-:root.spooky.shortcut-icons .native-settings {
- background-image: url('//s.4cdn.org/image/favicon-ws.ico');
-}
-
-/* Settings */
-:root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before {
- border-color: #707070;
-}
-:root.spooky .suboption-list > div:last-of-type {
- background-color: #171526;
-}
-
-/* Catalog */
-:root.spooky.catalog-hover-expand .catalog-container:hover > .post {
- background-color: #171526;
-}
-:root.spooky.werkTyme .catalog-thread:not(:hover),
-:root.spooky.werkTyme:not(.catalog-hover-expand) .catalog-thread,
-:root.spooky.catalog-hover-expand .catalog-container:hover > .post,
-:root.spooky.catalog-hover-expand .catalog-container:hover .catalog-reply {
- border-color: #707070;
-}
-
-/* Quote */
-:root.spooky .backlink.deadlink {
- color: #FE9600 !important;
-}
-:root.spooky .inline {
- border-color: #707070;
- background-color: rgba(255, 255, 255, .14);
-}
-
-/* Fappe and Werk Tyme */
-:root.spooky .indicator {
- color: #171526;
-}
-
-/* Highlighting */
-:root.spooky .qphl {
- outline: 2px solid rgba(145, 182, 214, .8);
-}
-:root.spooky.highlight-you .quotesYou$site$highlightable$op,
-:root.spooky.highlight-you .quotesYou$site$highlightable$reply {
- border-left: 3px solid rgba(145, 182, 214, .8);
-}
-:root.spooky.highlight-own .yourPost$site$highlightable$op,
-:root.spooky.highlight-own .yourPost$site$highlightable$reply {
- border-left: 3px dashed rgba(145, 182, 214, .8);
-}
-:root.spooky .filter-highlight$site$highlightable$op,
-:root.spooky .filter-highlight$site$highlightable$reply {
- box-shadow: inset 5px 0 rgba(145, 182, 214, .5);
-}
-:root.spooky.highlight-own .yourPost > $site$sideArrows,
-:root.spooky.highlight-you .quotesYou > $site$sideArrows,
-:root.spooky .filter-highlight > $site$sideArrows {
- color: rgb(155, 185, 210);
-}
-
-/* QR */
-.spooky #dump-list::-webkit-scrollbar-thumb {
- background-color: #171526;
- border-color: #707070;
-}
-:root.spooky .qr-preview {
- background-color: rgba(0, 0, 0, .15);
-}
-:root.spooky #qr .field {
- background-color: rgb(26, 27, 29);
- color: rgb(197,200,198);
- border-color: rgb(40, 41, 42);
-}
-:root.spooky #qr .field:focus,
-:root.spooky #qr .field.focus {
- border-color: rgb(254, 150, 0) !important;
- background-color: rgb(30,32,36);
-}
-:root.spooky .persona button {
- background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;
- color: rgb(197,200,198);
- border-color: rgb(40, 41, 42);
- outline: none;
-}
-:root.spooky .persona button::-moz-focus-inner {
- border: none;
-}
-:root.spooky .persona button:focus {
- border-color: rgb(254, 150, 0);
-}
-:root.spooky #qr.sjis-preview #sjis-toggle,
-:root.spooky #qr.tex-preview #tex-preview-button {
- background: rgb(26, 27, 29);
-}
-:root.spooky #qr select,
-:root.spooky #file-n-submit > input,
-:root.spooky #qr-draw-button {
- border-color: rgb(40, 41, 42);
-}
-:root.spooky #qr-filename {
- color: rgb(197,200,198);
-}
-
-:root.spooky .qr-link {
- border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8);
- background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent;
-}
-:root.spooky .qr-link:hover {
- background: #1A1829;
-}
-
-
-/* Menu */
-:root.spooky #menu {
- color: #FE9600;
-}
-:root.spooky .entry {
- font-size: 10pt;
-}
-:root.spooky .focused.entry {
- background: rgba(255, 255, 255, .33);
-}
-
-/* Unread */
-:root.spooky .unread-line {
- border-color: rgb(197, 200, 198);
- visibility: visible;
- opacity: 1;
-}
-:root.spooky .unread-mark-read {
- background-color: rgba(23,21,38,0.5);
-}
-
-/* Thread Watcher */
-:root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.replies-quoting-you, :root.spooky .last-page > a > .watcher-page {
- color: #F00 !important;
-}
-
-/* Watcher Favicon */
-:root.spooky .watch-thread-link
-{
- background-image: url("data:image/svg+xml,
");
-}
+ var spooky = `/* General */
+:root.spooky .dialog {
+ background-color: #171526;
+ border-color: #707070;
+}
+:root.spooky .field:focus,
+:root.spooky .field.focus {
+ border-color: #98E;
+}
+
+/* 4chan style fixes */
+:root.spooky #arc-list span.quote {
+ color: #634C2C;
+}
+:root.spooky.highlight-you .quotesYou$site$highlightable$reply {
+ border-left: 3px solid rgba(145, 182, 214, .8) !important;
+}
+:root.spooky.highlight-own .yourPost$site$highlightable$reply {
+ border-left: 3px dashed rgba(145, 182, 214, .8) !important;
+}
+
+/* Header */
+:root.spooky #header-bar.dialog {
+ background-color: rgba(23,21,38,0.98);
+}
+:root.spooky:not(.fixed) #header-bar, :root.spooky #notifications {
+ font-size: 9pt;
+}
+:root.spooky #header-bar, :root.spooky #notifications {
+ color: #C49756;
+}
+:root.spooky #board-list a, :root.spooky #shortcuts a {
+ color: #FE9600;
+}
+:root.spooky.shortcut-icons .native-settings {
+ background-image: url('//s.4cdn.org/image/favicon-ws.ico');
+}
+
+/* Settings */
+:root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before {
+ border-color: #707070;
+}
+:root.spooky .suboption-list > div:last-of-type {
+ background-color: #171526;
+}
+
+/* Catalog */
+:root.spooky.catalog-hover-expand .catalog-container:hover > .post {
+ background-color: #171526;
+}
+:root.spooky.werkTyme .catalog-thread:not(:hover),
+:root.spooky.werkTyme:not(.catalog-hover-expand) .catalog-thread,
+:root.spooky.catalog-hover-expand .catalog-container:hover > .post,
+:root.spooky.catalog-hover-expand .catalog-container:hover .catalog-reply {
+ border-color: #707070;
+}
+
+/* Quote */
+:root.spooky .backlink.deadlink {
+ color: #FE9600 !important;
+}
+:root.spooky .inline {
+ border-color: #707070;
+ background-color: rgba(255, 255, 255, .14);
+}
+
+/* Fappe and Werk Tyme */
+:root.spooky .indicator {
+ color: #171526;
+}
+
+/* Highlighting */
+:root.spooky .qphl {
+ outline: 2px solid rgba(145, 182, 214, .8);
+}
+:root.spooky.highlight-you .quotesYou$site$highlightable$op,
+:root.spooky.highlight-you .quotesYou$site$highlightable$reply {
+ border-left: 3px solid rgba(145, 182, 214, .8);
+}
+:root.spooky.highlight-own .yourPost$site$highlightable$op,
+:root.spooky.highlight-own .yourPost$site$highlightable$reply {
+ border-left: 3px dashed rgba(145, 182, 214, .8);
+}
+:root.spooky .filter-highlight$site$highlightable$op,
+:root.spooky .filter-highlight$site$highlightable$reply {
+ box-shadow: inset 5px 0 rgba(145, 182, 214, .5);
+}
+:root.spooky.highlight-own .yourPost > $site$sideArrows,
+:root.spooky.highlight-you .quotesYou > $site$sideArrows,
+:root.spooky .filter-highlight > $site$sideArrows {
+ color: rgb(155, 185, 210);
+}
+
+/* QR */
+.spooky #dump-list::-webkit-scrollbar-thumb {
+ background-color: #171526;
+ border-color: #707070;
+}
+:root.spooky .qr-preview {
+ background-color: rgba(0, 0, 0, .15);
+}
+:root.spooky #qr .field {
+ background-color: rgb(26, 27, 29);
+ color: rgb(197,200,198);
+ border-color: rgb(40, 41, 42);
+}
+:root.spooky #qr .field:focus,
+:root.spooky #qr .field.focus {
+ border-color: rgb(254, 150, 0) !important;
+ background-color: rgb(30,32,36);
+}
+:root.spooky .persona button {
+ background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;
+ color: rgb(197,200,198);
+ border-color: rgb(40, 41, 42);
+ outline: none;
+}
+:root.spooky .persona button::-moz-focus-inner {
+ border: none;
+}
+:root.spooky .persona button:focus {
+ border-color: rgb(254, 150, 0);
+}
+:root.spooky #qr.sjis-preview #sjis-toggle,
+:root.spooky #qr.tex-preview #tex-preview-button {
+ background: rgb(26, 27, 29);
+}
+:root.spooky #qr select,
+:root.spooky #file-n-submit > input,
+:root.spooky #qr-draw-button {
+ border-color: rgb(40, 41, 42);
+}
+:root.spooky #qr-filename {
+ color: rgb(197,200,198);
+}
+
+:root.spooky .qr-link {
+ border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8);
+ background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent;
+}
+:root.spooky .qr-link:hover {
+ background: #1A1829;
+}
+
+
+/* Menu */
+:root.spooky #menu {
+ color: #FE9600;
+}
+:root.spooky .entry {
+ font-size: 10pt;
+}
+:root.spooky .focused.entry {
+ background: rgba(255, 255, 255, .33);
+}
+
+/* Unread */
+:root.spooky .unread-line {
+ border-color: rgb(197, 200, 198);
+ visibility: visible;
+ opacity: 1;
+}
+:root.spooky .unread-mark-read {
+ background-color: rgba(23,21,38,0.5);
+}
+
+/* Thread Watcher */
+:root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.replies-quoting-you, :root.spooky .last-page > a > .watcher-page {
+ color: #F00 !important;
+}
+
+/* Watcher Favicon */
+:root.spooky .watch-thread-link
+{
+ background-image: url("data:image/svg+xml,
");
+}
`;
- var style = `/* General */
-.dialog {
- border: 1px solid;
- display: block;
- background-color: inherit;
-}
-.dialog:not(#qr):not(#thread-watcher):not(#header-bar) {
- box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
-}
-#qr,
-#thread-watcher {
- box-shadow: -1px 2px 2px rgba(0, 0, 0, 0.25);
-}
-.captcha-img,
-.field {
- background-color: #FFF;
- border: 1px solid #CCC;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- color: #333;
- font: 13px sans-serif;
- outline: none;
- transition: color .25s, border-color .25s;
-}
-.field::-moz-placeholder {
- color: #AAA;
- font-size: 13px;
- opacity: 1;
-}
-.captch-img:hover,
-.field:hover {
- border-color: #999;
-}
-.field:hover, .field:focus, .field.focus {
- color: #000;
-}
-.field[disabled] {
- background-color: #F2F2F2;
- color: #888;
-}
-.field::-webkit-search-decoration {
- display: none;
-}
-.move {
- cursor: move;
- overflow: hidden;
-}
-label {
- cursor: pointer;
-}
-a[href="javascript:;"] {
- text-decoration: none;
-}
-.warning {
- color: red;
-}
-:root.sw-yotsuba #boardNavDesktop, :root.sw-yotsuba #boardNavMobile {
- display: none !important;
-}
-:root.hide-bottom-board-list $site$boardListBottom {
- display: none;
-}
-body.hasDropDownNav{
- margin-top: 5px;
-}
-:root:not(.keyboard-focus) a {
- outline: none;
-}
-.painted {
- border-radius: 3px;
- padding: 0px 2px;
-}
-[hidden] {
- display: none !important;
-}
-
-/* 4chan style fixes */
-/* overrides 4chan CSS on div.opContainer, div.op */
-:root.sw-yotsuba .opContainer, :root.sw-yotsuba .op {
- display: block;
- overflow: visible;
-}
-:root.sw-yotsuba .reply > .file > .fileText {
- margin: 0 20px;
-}
-:root.sw-yotsuba #arc-list span.quote {
- color: #789922;
-}
-:root.sw-yotsuba .fileText a {
- unicode-bidi: -moz-isolate;
- unicode-bidi: -webkit-isolate;
-}
-:root.sw-yotsuba #g-recaptcha {
- min-height: 78px;
- height: auto;
-}
-:root.sw-yotsuba:not(.js-enabled) #postForm {
- display: table;
-}
-:root.sw-yotsuba #captchaContainerAlt td:nth-child(2) {
- display: table-cell !important;
-}
-:root.sw-yotsuba canvas#tegaki-canvas {
- background: none;
-}
-/* Disable obnoxious captcha fade-in. */
-:root.sw-yotsuba > body > div:last-of-type {
- transition: none !important;
-}
-/* Fix captcha scrolling to top of page. */
-:root.sw-yotsuba > body > div[style*=" top: -10000px;"] {
- visibility: hidden !important;
-}
-/* Make long filenames wrap properly: https://github.com/ccd0/4chan-x/issues/1082 */
-:root.sw-yotsuba .post > .file {
- /* currently nonstandard but may be added: https://lists.w3.org/Archives/Public/www-style/2016Mar/0352.html, https://bugzilla.mozilla.org/show_bug.cgi?id=1296042 */
- word-break: break-word;
-}
-:root.sw-yotsuba:not(.ua-webkit):not(.ua-blink) .fileText {
- word-wrap: break-word;
- max-width: calc(100vw - 90px);
-}
-:root.sw-yotsuba > body.is_catalog .thread > a > img {
- display: inline-block;
-}
-/* Links to NSFW boards */
-:root.sw-yotsuba .nwsb {
- display: inline;
-}
-:root.sw-yotsuba .fileText {
- max-width: auto;
- white-space: normal;
-}
-
-/* Ads */
-:root.sw-yotsuba .ad-cnt > *, :root.sw-yotsuba .adg-rects > *, :root.sw-yotsuba .bsa-cnt {
- height: auto !important;
-}
-:root.sw-yotsuba:not(.ads-loaded) hr.abovePostForm,
-:root.sw-yotsuba:not(.ads-loaded) .adg-rects > hr,
-:root.sw-yotsuba #adg-ol + hr,
-:root.sw-yotsuba .danbo-slot:empty {
- display: none;
-}
-:root.sw-yotsuba .adg-rects {
- margin: 0;
- font-size: 0;
-}
-:root.sw-yotsuba div.center[style] {
- display: none !important;
-}
-
-/* Tinyboard / vichan conflicts */
-#menu > .hide-thread-link {
- width: auto;
- height: auto;
- overflow: visible;
- background-image: none;
-}
-#menu label.entry {
- display: block;
-}
-#fourchanx-settings label {
- display: inline;
-}
-.intro a[href="javascript:;"],
-#menu a {
- margin: 0;
-}
-.gal-buttons.gal-buttons a {
- font-size: inherit;
-}
-:root.sw-tinyboard.fixed.top-header:not(.autohide) .boardlist,
-:root.sw-tinyboard.fixed.top-header:not(.autohide) .bar.top {
- position: static;
-}
-:root.sw-tinyboard.fixed.top-header:not(.autohide) div.pages.top {
- top: auto;
- bottom: 0;
-}
-:root.sw-tinyboard.fixed.top-header.autohide .boardlist,
-:root.sw-tinyboard.fixed.top-header.autohide .bar.top {
- z-index: 3;
-}
-
-/* Tinyboard site style conflicts */
-:root[data-host="fufufu.moe"].fixed.top-header:not(.autohide) div.pages.top {
- top: 26px;
- bottom: auto;
-}
-:root[data-host="merorin.com"].fixed.top-header:not(.autohide) span.settings {
- top: 26px;
-}
-:root[data-host="fufufu.moe"]:not(.fixed) #header-bar {
- margin-top: 38px;
-}
-:root[data-host="lainchan.org"]:not(.fixed) #header-bar {
- margin-top: 17px;
-}
-:root[data-host="smuglo.li"]:not(.fixed) #header-bar {
- margin-top: 8px;
-}
-
-/* Anti-autoplay */
-audio.controls-added {
- display: block;
- margin: auto;
- white-space: normal;
-}
-:root.anti-autoplay div.embed {
- position: static;
- width: auto;
- height: auto;
- text-align: center;
-}
-:root.anti-autoplay .autoplay-removed {
- visibility: visible !important;
- min-width: 640px;
- min-height: 360px;
-}
-
-/* fixed, z-index */
-#overlay,
-#qp, #ihover,
-#navlinks, .fixed #header-bar,
-:root.float #updater,
-:root.float #thread-stats,
-#qr {
- position: fixed;
-}
-#overlay {
- z-index: 999;
-}
-#qp, #ihover {
- z-index: 60;
-}
-#menu, .gal-buttons {
- z-index: 50;
-}
-#updater, #thread-stats {
- z-index: 40;
-}
-:root.fixed #header-bar, #notifications {
- z-index: 35;
-}
-#a-gallery {
- z-index: 30;
-}
-#navlinks {
- z-index: 25;
-}
-#qr {
- z-index: 20;
-}
-#embedding {
- z-index: 11;
-}
-:root.fixed-watcher #thread-watcher {
- z-index: 10;
-}
-:root.fixed:not(.gallery-open) #header-bar:not(:hover) {
- z-index: 8;
-}
-#thread-watcher {
- z-index: 5;
-}
-
-/* Header */
-.fixed.top-header body {
- padding-top: 2em;
-}
-.fixed.bottom-header body {
- padding-bottom: 2em;
-}
-.fixed #header-bar {
- right: 0;
- left: 0;
- padding: 3px 4px 4px;
- font-size: 12px;
-}
-.fixed.top-header #header-bar {
- top: 0;
-}
-.fixed.bottom-header #header-bar {
- bottom: 0;
-}
-#header-bar {
- border-width: 0;
- transition: all .1s .05s ease-in-out;
-}
-:root.fixed #header-bar {
- box-shadow: -5px 1px 10px rgba(0, 0, 0, 0.20);
-}
-:root.centered-links #shortcuts {
- width: 300px;
- text-align: right;
-}
-:root.centered-links #header-bar {
- text-align: center;
-}
-#custom-board-list {
- font-size: 13px;
- vertical-align: middle;
-}
-#full-board-list {
- vertical-align: middle;
-}
-:root.centered-links #custom-board-list {
- position: relative;
- left: 150px;
-}
-.fixed.top-header #header-bar {
- border-bottom-width: 1px;
-}
-.fixed.bottom-header #header-bar {
- box-shadow: 0 -1px 2px rgba(0, 0, 0, .15);
- border-top-width: 1px;
-}
-.fixed.bottom-header #header-bar .menu-button i {
- border-top: none;
- border-bottom: 6px solid;
-}
-.fixed #header-bar.autohide:not(:hover) {
- box-shadow: none;
- transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);
-}
-.fixed.top-header #header-bar.autohide:not(:hover) {
- margin-bottom: -1em;
- -webkit-transform: translateY(-100%);
- transform: translateY(-100%);
-}
-.fixed.bottom-header #header-bar.autohide:not(:hover) {
- -webkit-transform: translateY(100%);
- transform: translateY(100%);
-}
-#scroll-marker {
- left: 0;
- right: 0;
- height: 10px;
- position: absolute;
-}
-#header-bar:not(.autohide) #scroll-marker {
- pointer-events: none;
-}
-#header-bar #scroll-marker {
- display: none;
-}
-.fixed #header-bar #scroll-marker {
- display: block;
-}
-.fixed.top-header #header-bar #scroll-marker {
- top: 100%;
-}
-.fixed.bottom-header #header-bar #scroll-marker {
- bottom: 100%;
-}
-#board-list a, #shortcuts a:not(.entry) {
- text-decoration: none;
- padding: 1px;
-}
-#shortcuts:empty {
- display: none;
-}
-.brackets-wrap::before {
- content: "\\00a0[";
-}
-.brackets-wrap::after {
- content: "]\\00a0";
-}
-.dead-thread,
-.disabled:not(.replies-quoting-you) {
- opacity: .45;
-}
-#shortcuts {
- float: right;
-}
-:root.autohiding-scrollbar #shortcuts {
- margin-right: 12px;
-}
-.shortcut {
- margin-left: 3px;
- vertical-align: middle;
-}
-:root.shortcut-icons .native-settings {
- font-size: 0;
- color: transparent;
- display: inline-block;
- vertical-align: top;
- height: 12px;
- width: 14px;
- background: url('//s.4cdn.org/image/favicon.ico') 0px -1px no-repeat;
-}
-#navbotright,
-#navtopright {
- display: none;
-}
-#toggleMsgBtn {
- display: none !important;
-}
-.current,
-:root.sw-yotsuba div#boardNavDesktopFoot a.current {
- font-weight: bold;
-}
-@media (min-width: 1300px) {
- :root.sw-yotsuba.fixed:not(.centered-links) #header-bar {
- white-space: nowrap;
- display: -webkit-flex;
- display: flex;
- -webkit-align-items: center;
- align-items: center;
- }
- :root.sw-yotsuba.fixed:not(.centered-links) #board-list {
- -webkit-flex: auto;
- flex: auto;
- }
- :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list {
- display: -webkit-flex;
- display: flex;
- }
- :root.sw-yotsuba.fixed:not(.centered-links) .hide-board-list-container {
- -webkit-flex: none;
- flex: none;
- margin-right: 5px;
- }
- :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList {
- -webkit-flex: auto;
- flex: auto;
- display: -webkit-flex;
- display: flex;
- width: 0px; /* XXX Fixes Edge not shrinking the board list below default size when needed */
- }
- :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > a,
- :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {
- -webkit-flex: none;
- flex: none;
- padding: .17em;
- margin: -.17em -.32em;
- }
- :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span {
- pointer-events: none;
- }
- :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.space {
- -webkit-flex: 0 .63 .63em;
- flex: 0 .63 .63em;
- }
- :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {
- -webkit-flex: 0 .38 .38em;
- flex: 0 .38 .38em;
- }
- :root.sw-yotsuba.fixed:not(.centered-links) #shortcuts {
- float: initial;
- -webkit-flex: none;
- flex: none;
- display: -webkit-flex;
- display: flex;
- -webkit-align-items: center;
- align-items: center;
- }
-}
-/* 4chan X link brackets */
-.brackets-wrap::before {
- content: "[";
-}
-.brackets-wrap::after {
- content: "]";
-}
-/* Notifications */
-#notifications {
- position: fixed;
- top: 0;
- height: 0;
- text-align: center;
- right: 0;
- left: 0;
- visibility: visible;
-}
-#notifications:empty {
- display: none;
-}
-:root.fixed.top-header:not(.gallery-open) #header-bar #notifications,
-:root.fixed.top-header #header-bar.autohide #notifications {
- position: absolute;
- top: 100%;
-}
-.notification {
- color: #FFF;
- font-weight: 700;
- text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
- box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
- border-radius: 2px;
- margin: 1px auto;
- width: 550px;
- max-width: 100%;
- position: relative;
- transition: all .25s ease-in-out;
-}
-.notification.error {
- background-color: hsla(0, 100%, 38%, .9);
-}
-.notification.warning {
- background-color: hsla(36, 100%, 38%, .9);
-}
-.notification.info {
- background-color: hsla(200, 100%, 38%, .9);
-}
-.notification.success {
- background-color: hsla(104, 100%, 38%, .9);
-}
-.notification a {
- color: white;
-}
-.notification > .close {
- padding: 7px;
- top: 0px;
- right: 5px;
- position: absolute;
-}
-.notification > .fa-times::before {
- font-size: 11px !important;
-}
-.message {
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- padding: 6px 20px;
- max-height: 200px;
- width: 100%;
- overflow: auto;
- white-space: pre-line;
-}
-.message a {
- text-decoration: underline;
-}
-:root.tainted .report-error {
- display: none;
-}
-
-/* Settings */
-:root.fourchan-x body {
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-#overlay {
- background-color: rgba(0, 0, 0, .5);
- display: -webkit-flex;
- display: flex;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
-}
-#fourchanx-settings {
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- box-shadow: 0 0 15px rgba(0, 0, 0, .15);
- height: 600px;
- max-height: 100%;
- width: 900px;
- max-width: 100%;
- margin: auto;
- padding: 5px;
- display: -webkit-flex;
- display: flex;
- -webkit-flex-direction: column;
- flex-direction: column;
-}
-#fourchanx-settings > nav {
- padding: 2px 2px 8px;
- display: -webkit-flex;
- display: flex;
-}
-#fourchanx-settings > nav a {
- text-decoration: underline;
-}
-#fourchanx-settings > nav a.close {
- text-decoration: none;
- padding: 0 2px;
- margin: 0;
-}
-.section-container {
- -webkit-flex: 1;
- flex: 1;
- position: relative;
- overflow: auto;
- padding-right: 5px;
- overscroll-behavior: contain;
-}
-.sections-list {
- -webkit-flex: 1;
- flex: 1;
-}
-.export, .import, .reset {
- cursor: pointer;
- text-decoration: none !important;
-}
-.tab-selected {
- font-weight: 700;
-}
-.section-sauce ul,
-.section-advanced ul {
- list-style: none;
- margin: 0;
-}
-.section-sauce ul {
- padding: 8px;
-}
-.section-advanced ul {
- padding: 0px;
-}
-.section-sauce li,
-.section-advanced li {
- padding-left: 4px;
-}
-.section-main ul {
- margin: 0;
- padding: 0 0 0 16px;
-}
-.section-main li {
- white-space: pre-line;
- list-style: disc;
-}
-.section-main li:not(:first-of-type) {
- margin-top: 4px;
-}
-.section-main label {
- text-decoration: underline;
-}
-div[data-checked="false"] > .suboption-list {
- display: none;
-}
-.suboption-list {
- position: relative;
-}
-.suboption-list::before {
- content: "";
- display: inline-block;
- position: absolute;
- left: .7em;
- width: 0;
- height: 100%;
- border-left: 1px solid;
-}
-.suboption-list > div {
- position: relative;
- padding-left: 1.4em;
-}
-.suboption-list > div::before {
- content: "";
- display: inline-block;
- position: absolute;
- left: .7em;
- width: .7em;
- height: .6em;
- border-left: 1px solid;
- border-bottom: 1px solid;
-}
-#fourchanx-settings .section-main p {
- margin: .5em 0 0;
-}
-.section-filter ul {
- padding: 0;
-}
-.section-filter li {
- margin: 10px 40px;
- list-style: disc;
-}
-.section-filter textarea {
- height: 500px;
-}
-.section-main a, .section-filter a, .section-advanced a {
- text-decoration: underline;
-}
-#sauce-doc-expand:not(:checked) ~ #sauce-doc {
- max-height: 130px;
- overflow: auto;
-}
-#sauce-doc > label {
- float: right;
- margin: 0 5px;
-}
-/* XXX for OneeChan */
-#sauce-doc-expand + .riceCheck {
- display: none;
-}
-.section-sauce textarea {
- height: 430px;
-}
-.section-advanced .field[name="boardnav"] {
- width: 100%;
-}
-.section-advanced textarea {
- height: 150px;
-}
-.section-advanced textarea[name="archiveLists"],
-.section-advanced textarea[name="externalCatalogURLs"],
-.section-advanced textarea[name="knownBanners"] {
- height: 75px;
-}
-.section-advanced .archive-cell {
- min-width: 160px;
- text-align: center;
-}
-.section-advanced #archive-board-select {
- position: absolute;
-}
-.section-advanced .note {
- font-size: 0.8em;
- font-style: italic;
- margin-left: 10px;
-}
-.section-advanced .note code {
- font-style: normal;
- font-size: 11px;
-}
-.favicon-preview > img {
- vertical-align: middle;
-}
-.favicon-preview > img:nth-of-type(3n+1) {
- margin-left: 4px;
-}
-.section-keybinds .field {
- font-family: monospace;
-}
-#fourchanx-settings fieldset {
- border: 1px solid;
- border-radius: 3px;
- padding: 0.35em 0.625em 0.75em;
- margin: 0px 2px;
-}
-#fourchanx-settings legend {
- font-weight: 700;
- color: inherit;
-}
-#fourchanx-settings textarea {
- font-family: monospace;
- width: 100%;
- resize: vertical;
-}
-#fourchanx-settings code {
- color: #000;
- background-color: #FFF;
- padding: 0 2px;
-}
-#fourchanx-settings th {
- text-align: center;
- font-weight: bold;
-}
-#fourchanx-settings p {
- margin: 1em 0px;
-}
-#fourchanx-settings table {
- margin: auto;
-}
-
-/* Index */
-:root.index-loading .navLinks:not(.json-index),
-:root.index-loading .board:not(.json-index),
-:root.index-loading .pagelist:not(.json-index),
-:root.infinite-mode .pagelist,
-:root.all-pages-mode .pagelist,
-:root.catalog-mode .pagelist,
-:root:not(.catalog-mode) .indexlink,
-:root.catalog-mode .cataloglink,
-:root:not(.catalog-mode) #hidden-label,
-:root:not(.catalog-mode) #index-size {
- display: none;
-}
-#index-search {
- padding-right: 1.5em;
- width: 100px;
- transition: color .25s, border-color .25s, width .25s;
-}
-#index-search:focus,
-#index-search[data-searching] {
- width: 200px;
-}
-#index-search-clear {
- color: gray;
- display: inline-block;
- position: relative;
- left: -1em;
- width: 0;
-}
-/* \`\`::-webkit-*'' selectors break selector lists on Firefox. */
-#index-search::-webkit-search-cancel-button {
- display: none;
-}
-#index-search:not([data-searching]) + #index-search-clear {
- display: none;
-}
-#index-options {
- float: right;
-}
-#lastlong-options {
- display: inline-block;
- vertical-align: middle;
- height: 28px;
- margin: -14px 0;
-}
-#lastlong-options > input {
- padding: 0;
- border: 0 !important;
- text-align: center;
- background: transparent;
- display: block;
- font-size: 12px;
- height: 12px;
- width: 30px;
- margin: 1px 0;
-}
-.summary {
- text-decoration: none;
-}
-
-/* Catalog */
-:root.catalog-mode .board {
- text-align: center;
-}
-.catalog-thread {
- display: inline-block;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- border: 1px solid transparent;
- word-wrap: break-word;
- vertical-align: top;
- position: relative;
-}
-/* overrides 4chan CSS on div.thread */
-.catalog-thread.catalog-thread {
- margin: 2px;
-}
-.catalog-small > .catalog-thread {
- width: 165px;
- height: 320px;
-}
-.catalog-large > .catalog-thread {
- width: 270px;
- height: 410px;
-}
-:root.catalog-hover-expand .catalog-thread:hover {
- z-index: 1;
-}
-.catalog-container {
- position: absolute;
- top: -4px;
- left: 0;
- right: 0;
- bottom: 0;
-}
-.catalog-container:not(:hover),
-:root:not(.catalog-hover-expand) .catalog-container {
- overflow: hidden;
-}
-.catalog-post {
- position: absolute;
- top: 4px;
- left: 0;
- right: 0;
- border: 1px solid transparent;
- padding-top: 20px;
-}
-/* overrides inline CSS from Index.cb.hoverAdjust */
-:root:not(.catalog-hover-expand) .catalog-post {
- left: 0 !important;
- right: 0 !important;
-}
-/* overrides 4chan CSS on div.post */
-.catalog-post.catalog-post {
- margin: -21px -1px -1px;
- overflow: visible;
-}
-.catalog-thread.noFile > * > .catalog-post {
- margin-top: -7px;
- padding-top: 6px;
-}
-:root.catalog-hover-expand .catalog-container:hover > .catalog-post {
- margin-left: -61px;
- margin-right: -61px;
-}
-:root.catalog-hover-expand .catalog-container:hover > * > :not(.catalog-replies) {
- padding-left: 2px;
- padding-right: 2px;
-}
-.catalog-link {
- display: block;
- position: relative;
-}
-.catalog-thumb {
- border-radius: 2px;
- box-shadow: 0 0 5px rgba(0, 0, 0, .25);
- vertical-align: top;
-}
-.catalog-thumb.spoiler-file {
- width: 100px;
- height: 100px;
-}
-.catalog-thumb.deleted-file {
- width: 127px;
- height: 13px;
- padding: 20px 11px;
-}
-.catalog-thumb.no-file {
- width: 77px;
- height: 13px;
- padding: 20px 36px;
-}
-.catalog-icons > img,
-.catalog-stats > .menu-button {
- width: 1em;
- height: 1em;
- margin: 0;
- vertical-align: text-top;
- padding-left: 2px;
-}
-.catalog-stats > .menu-button {
- font-weight: normal;
-}
-.catalog-stats > .menu-button > i::before {
- line-height: 11px;
-}
-.catalog-stats {
- font-size: 10px;
- font-weight: 700;
- padding-top: 2px;
-}
-.catalog-stats > [title] {
- cursor: help;
-}
-.catalog-post > .postMessage {
- margin: 0;
- padding-bottom: .3em;
-}
-.catalog-container:not(:hover) > * > .file,
-.catalog-container:not(:hover) > * > .postInfo > :not(.subject),
-.catalog-container:not(:hover) > * > .catalog-replies,
-.catalog-container:not(:hover) .extra-linebreak,
-.catalog-container:not(:hover) .abbr,
-:root:not(.catalog-hover-expand) .catalog-container > * > .file,
-:root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject),
-:root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies,
-:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak,
-:root:not(.catalog-hover-expand) .catalog-container .abbr,
-.catalog-thread > .catalog-container > :not(.catalog-post),
-.catalog-post > .file > :not(.fileText),
-.catalog-post > * > .fileText > :not(:first-child),
-.catalog-post > .postInfo > :not(.subject):not(.nameBlock):not(.dateTime),
-.catalog-post > .postInfo > .nameBlock > .contact-links,
-.catalog-post > * > * > .posteruid,
-.catalog-post > * > * > .postJumper,
-:root.bottom-backlinks .catalog-post > .container,
-.post:not(.catalog-post) > .catalog-link,
-.post:not(.catalog-post) > .catalog-stats,
-.post:not(.catalog-post) > .catalog-replies {
- display: none;
-}
-.catalog-post > .file {
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- min-height: 20px;
- background-color: inherit;
-}
-.catalog-post > * > .fileText {
- position: relative;
- padding: 2px;
- background-color: inherit;
-}
-.catalog-small .catalog-post > * .fileText {
- font-size: 10px;
-}
-.catalog-post > * > .fileText:not(:hover) {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.catalog-post > * > .fileText:hover {
- z-index: 1;
-}
-/* overrides 4chan CSS on div.post div.postInfo */
-.catalog-post > .postInfo.postInfo {
- width: auto;
-}
-.catalog-post > * > .subject {
- display: block;
-}
-.catalog-post > * > .dateTime {
- display: inline-block;
- font-style: italic;
-}
-:root.catalog-hover-expand .catalog-container:hover > * > * > .nameBlock,
-:root.catalog-hover-expand .catalog-container:hover > * > * > .dateTime,
-:root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) {
- padding-top: .3em;
-}
-.catalog-post .extra-linebreak {
- content: ''; /* makes this work in Blink/WebKit */
- display: block;
- margin-top: .3em;
-}
-.catalog-reply {
- text-align: left;
- white-space: nowrap;
- border-top: 1px solid transparent;
- display: -webkit-flex;
- display: flex;
- -webkit-flex-direction: row;
- flex-direction: row;
- -webkit-align-items: stretch;
- align-items: stretch;
-}
-.catalog-reply > * {
- padding: 3px;
- overflow: hidden;
- -webkit-flex: none;
- flex: none;
-}
-.catalog-reply > span {
- font-style: italic;
- font-weight: bold;
-}
-.catalog-reply-excerpt {
- -webkit-flex: 1 1 auto;
- flex: 1 1 auto;
-}
-.catalog-post .prettyprinted {
- max-width: 100%;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-.catalog-post .MathJax_Display {
- text-align: center !important;
-}
-.catalog-container:not(:hover) .exif,
-:root:not(.catalog-hover-expand) .catalog-container .exif {
- display: none !important;
-}
-.catalog-post > * > .exif {
- border-collapse: collapse;
-}
-:root.catalog-hover-expand .catalog-container:hover .exif[style*="display: block;"] {
- display: inline-block !important;
-}
-.catalog-post > * > .exif,
-.catalog-post > * > .exif > tbody {
- background-color: inherit;
-}
-.catalog-post > * > .exif,
-.catalog-post > * > .exif td {
- min-width: 0;
-}
-.catalog-post > * > .exif td {
- padding-top: 1px;
-}
-:root.hats-enabled .catalog-thread::after {
- content: '';
- pointer-events: none;
- position: absolute;
- background-size: contain;
-}
-:root.hats-enabled .catalog-small > .catalog-thread::after {
- left: -8px;
- top: -59px;
- width: 96px;
- height: 96px;
-}
-:root.hats-enabled:not(.werkTyme) .catalog-small > .catalog-thread:not(.noFile)::after {
- left: calc(67px - .3px * var(--tn-w));
-}
-:root.hats-enabled .catalog-large > .catalog-thread::after {
- left: -15px;
- top: -98px;
- width: 160px;
- height: 160px;
-}
-:root.hats-enabled:not(.werkTyme) .catalog-large > .catalog-thread:not(.noFile)::after {
- left: calc(110px - .5px * var(--tn-w));
-}
-
-/* Copy Text Link's textarea element */
-textarea.copy-text-element {
- height: 0;
- width: 0;
- position: absolute;
- top: -10000px;
-}
-
-/* Announcement Hiding */
-:root.hide-announcement $site$psa {
- display: none;
-}
-.hide-announcement-button {
- opacity: 0.4;
- float: left;
-}
-
-/* Unread */
-.unread-line {
- margin: 0;
- border-color: rgb(255,0,0);
-}
-.unread-line + br {
- display: none;
-}
-.unread-mark-read {
- float: right;
- clear: both;
- width: 100%;
- text-align: right;
-}
-:not(.unread-thread) > .unread-mark-read {
- display: none;
-}
-
-/* Thread Updater */
-#updater {
- background: none;
- border: none;
- box-shadow: none;
-}
-#updater > .move {
- position: absolute;
- top: -5px;
- bottom: -5px;
- left: -5px;
- right: -5px;
- z-index: -1;
-}
-#updater > div:last-child {
- text-align: center;
-}
-#updater input[type="number"] {
- width: 4em;
-}
-:root.float #updater {
- padding: 0px 3px;
-}
-:root:not(.float).shortcut-icons #updater {
- display: inline-block;
- min-width: 12pt;
- text-align: right;
-}
-.new {
- color: limegreen;
-}
-#update-status:not(.empty) + #update-timer:not(.empty):not(.loading) {
- margin-left: 5px;
-}
-#update-timer {
- cursor: pointer;
-}
-
-/* Thread Watcher */
-#thread-watcher {
- position: absolute;
-}
-#thread-watcher {
- padding-bottom: 3px;
- padding-left: 3px;
- white-space: nowrap;
- min-width: 146px;
-}
-#watched-threads {
- overflow-x: hidden;
- overflow-y: auto;
-}
-#thread-watcher .refresh {
- padding: 0px 3px;
-}
-:root.fixed-watcher #thread-watcher {
- position: fixed;
-}
-:root.fixed-watcher #watched-threads {
- /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
- max-height: 85vh;
- max-height: calc(100vh - 75px);
-}
-:root:not(.fixed-watcher) #watched-threads:not(:hover) {
- max-height: 210px;
- overflow-y: hidden;
-}
-#thread-watcher > .move {
- padding-top: 3px;
-}
-#watched-threads > div {
- padding-left: 3px;
- padding-right: 3px;
-}
-#watched-threads .watcher-link {
- max-width: 250px;
- display: -webkit-inline-flex;
- display: inline-flex;
- -webkit-flex-direction: row;
- flex-direction: row;
-}
-#watched-threads .watcher-page,
-#watched-threads .watcher-unread {
- -webkit-flex: 0 0 auto;
- flex: 0 0 auto;
- margin-right: 2px;
-}
-#watched-threads .watcher-title {
- overflow: hidden;
- text-overflow: ellipsis;
- -webkit-flex: 0 1 auto;
- flex: 0 1 auto;
-}
-#watched-threads .watcher-title:not(:first-child) {
- margin-left: 2px;
-}
-.replies-quoting-you > a, #watcher-link.replies-quoting-you, .last-page > a > .watcher-page {
- color: #F00;
-}
-#thread-watcher a {
- text-decoration: none;
-}
-#thread-watcher .move > .close {
- position: absolute;
- right: 0px;
- top: 0px;
- padding: 0px 4px;
-}
-.watch-thread-link {
- padding-top: 18px;
- width: 18px;
- height: 0px;
- display: inline-block;
- background-repeat: no-repeat;
- opacity: 0.2;
- position: relative;
- top: 1px;
- background-image: url("data:image/svg+xml,
");
-}
-.watch-thread-link.watched {
- opacity: 1;
-}
-
-
-/* Thread Stats */
-#thread-stats {
- background: none;
- border: none;
- box-shadow: none;
-}
-:root.float #thread-stats > .move > :not(#page-count) {
- pointer-events: none;
-}
-:root.float #thread-stats {
- padding: 0px 3px;
-}
-#page-count {
- cursor: pointer;
-}
-
-/* Quote */
-.hashlink::before {
- content: ' ';
- visibility: hidden;
-}
-.inline + .hashlink {
- display: none !important;
-}
-:root.resurrect-quotes .deadlink {
- text-decoration: none !important;
-}
-.catalog-post .qmark-ct {
- display: none;
-}
-.backlink.deadlink:not(.forwardlink),
-.quotelink.deadlink:not(.forwardlink) {
- text-decoration: underline !important;
-}
-:root:not(.catalog-mode) .inlined {
- opacity: .5;
-}
-#qp input, .forwarded {
- display: none;
-}
-.quotelink.forwardlink,
-.backlink.forwardlink {
- text-decoration: none;
- border-bottom: 1px dashed;
-}
-.filtered {
- text-decoration: underline line-through;
-}
-:root.hide-backlinks .backlink.filtered,
-:root.hide-backlinks .backlink.filtered + .hashlink.filtered {
- display: none;
-}
-.postNum + .container::before {
- content: " ";
-}
-:root.bottom-backlinks .container {
- display: block;
- clear: both;
- margin: 0 4px;
-}
-:root.bottom-backlinks .backlink {
- font-size: 90%;
-}
-.inline {
- border: 1px solid;
- display: table;
- margin: 2px 0;
-}
-.container ~ .inline {
- margin-left: 20px;
-}
-:root.catalog-mode .inline {
- display: none;
-}
-.inline .post {
- border: 0 !important;
- background-color: transparent !important;
- display: table !important;
- margin: 0 !important;
- padding: 1px 2px !important;
-}
-#qp > .opContainer::after {
- content: '';
- clear: both;
- display: table;
-}
-#qp .post {
- border: none;
- margin: 0;
- padding: 2px 2px 5px;
-}
-#qp img {
- max-height: 80vh;
- max-width: 50vw;
-}
-
-/* Quote Threading */
-.threadContainer {
- margin-left: 20px;
- border-left: 1px solid rgba(128,128,128,.3);
-}
-.threadOP {
- clear: both;
-}
-
-/* File */
-.expanded-image > .post > .file > .fileThumb {
- display: flex;
- flex-direction: column;
-}
-.fileText-original,
-.fnswitch:hover > .fntrunc,
-.fnswitch:not(:hover) > .fnfull,
-.expanded-image > .post > .file > .fileThumb > video[data-md5],
-.expanded-image > .post > .file > .fileThumb > img[data-md5] {
- display: none;
-}
-.full-image[data-file-i-d] {
- display: none;
- cursor: pointer;
-}
-.expanded-image > .post > .file > .fileThumb > .full-image {
- display: inline;
-}
-.expanded-image > .post > .file > .fileThumb > audio {
- height: 30px;
- width: 100%;
- min-width: 300px;
-}
-.expanded-image {
- clear: left;
-}
-.expanding {
- opacity: .5;
-}
-:root.fit-height .full-image {
- max-height: 100vh;
-}
-:root.fit-height.fixed .full-image {
- /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
- max-height: 93vh;
- max-height: calc(100vh - 35px);
-}
-:root.fit-width .full-image {
- max-width: 100%;
-}
-:root.ua-gecko.fit-width .full-image {
- width: 100%;
-}
-.fileThumb > .warning {
- clear: both;
-}
-#ihover {
- pointer-events: none;
- /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
- max-height: 95vh;
- max-height: calc(100vh - 25px);
- max-width: 100vw;
-}
-/* WEBM Metadata */
-.webm-title > a::before {
- content: "title";
- text-decoration: underline;
-}
-.webm-title.loading > a::after {
- content: "...";
-}
-.webm-title.error > a:hover::before,
-.webm-title.error > a:focus::before {
- content: "error";
- text-decoration: none;
-}
-.webm-title > span {
- cursor: text;
-}
-.webm-title.not-found > span::before {
- content: "not found";
-}
-.webm-title:not(:hover):not(:focus) > span,
-.webm-title:hover > span + a,
-.webm-title:focus > span + a {
- display: none;
-}
-/* Volume control */
-input[name="Default Volume"] {
- width: 4em;
- height: 1ex;
- vertical-align: middle;
- margin: 0px;
-}
-/* Fappe and Werk Tyme */
-:root.fappeTyme $site$replyOriginal.noFile,
-:root.fappeTyme $site$replyOriginal.noFile + br {
- display: none;
-}
-:root.werkTyme $site$thumbLink,
-:root.werkTyme $site$file$thumb,
-:root.werkTyme .catalog-thumb:not(.deleted-file):not(.no-file),
-:root:not(.werkTyme) .werkTyme-filename {
- display: none;
-}
-.werkTyme-filename {
- font-weight: bold;
- font-size: 110%;
-}
-:root.werkTyme .catalog-link {
- box-shadow: 0 0 5px rgba(0, 0, 0, .25);
- padding: 8px;
- text-align: center;
-}
-:root.werkTyme .catalog-thumb {
- box-shadow: none;
- padding: 0;
- vertical-align: middle;
-}
-.indicator {
- background: rgba(255,0,0,0.8);
- font-weight: bold;
- display: inline-block;
- min-width: 9px;
- padding: 0px 2px;
- margin: 0 1px;
- text-align: center;
- color: white;
- border-radius: 2px;
- cursor: pointer;
-}
-:root:not(.fappeTyme) #shortcut-fappe,
-:root:not(.werkTyme) #shortcut-werk {
- display: none;
-}
-
-/* Index/Reply Navigation */
-#navlinks {
- font-size: 16px;
- top: 25px;
- right: 10px;
-}
-:root.catalog-mode #navlinks {
- display: none;
-}
-
-/* Highlighting */
-.qphl {
- outline: 2px solid rgba(216, 94, 49, .8);
-}
-:root.highlight-you .quotesYou$site$highlightable$op,
-:root.highlight-you .quotesYou$site$highlightable$reply {
- border-left: 3px solid rgba(221, 0, 0, .8);
-}
-:root.highlight-own .yourPost$site$highlightable$op,
-:root.highlight-own .yourPost$site$highlightable$reply {
- border-left: 3px dashed rgba(221, 0, 0, .8);
-}
-.filter-highlight$site$highlightable$op,
-.filter-highlight$site$highlightable$reply {
- box-shadow: inset 5px 0 rgba(221, 0, 0, .5);
-}
-:root.highlight-own .yourPost > $site$sideArrows,
-:root.highlight-you .quotesYou > $site$sideArrows,
-.filter-highlight > $site$sideArrows {
- color: rgba(221, 0, 0, .8);
-}
-:root.highlight-own .yourPost$site$highlightable$op::after,
-:root.highlight-you .quotesYou$site$highlightable$op::after,
-.filter-highlight$site$highlightable$op::after {
- content: "";
- display: block;
- clear: both;
-}
-:root:not(.werkTyme) .catalog-thread.filter-highlight .catalog-thumb,
-:root.werkTyme .catalog-thread.filter-highlight:not(:hover),
-:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,
-:root.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post,
-:root.catalog $site$catalog$thread.filter-highlight$site$highlightable$catalog {
- box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5);
-}
-:root:not(.werkTyme) .catalog-thread.watched .catalog-thumb,
-:root:root.werkTyme .catalog-thread.watched:not(:hover),
-:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,
-:root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {
- border: 2px solid rgba(255, 0, 0, .75);
-}
-
-/* Spoiler text */
-:root.reveal-spoilers $site$spoiler,
-:root.reveal-spoilers $site$spoiler > a {
- color: white !important;
-}
-:root.reveal-spoilers .removed-spoiler::before {
- content: "[spoiler]";
-}
-:root.reveal-spoilers .removed-spoiler::after {
- content: "[/spoiler]";
-}
-
-/* Thread & Reply Hiding */
-.hide-thread-button,
-.hide-reply-button {
- float: left;
- margin-right: 4px;
- padding: 2px;
-}
-$site$infoRoot a.hide-reply-button {
- margin-right: 6px;
- padding: 0;
-}
-.replacedSideArrows {
- float: left;
-}
-.hide-thread-button:not(:hover),
-.hide-reply-button:not(:hover) {
- opacity: 0.4;
-}
-.threadContainer .hide-reply-button {
- margin-left: 2px !important;
- position: relative;
- left: 1px;
-}
-.hide-thread-button {
- margin-top: -1px;
- width: 11px;
-}
-.stub ~ :not(.threadDivider) {
- display: none !important;
-}
-.stub input {
- display: inline-block;
-}
-$site$thread[hidden] + hr {
- display: none;
-}
-:root.reply-hide $site$sideArrows {
- display: none;
-}
-:root.sw-yotsuba.thread-hide .party-hat {
- left: 19px;
-}
-
-/* Anonymize */
-:root.anonymize $site$info$name,
-:root.sw-yotsuba.anonymize .post-author:not([class*=capcode]) {
- font-size: 0;
-}
-:root.anonymize $site$info$tripcode,
-:root.sw-yotsuba.anonymize .n-pu {
- display: none;
-}
-:root.anonymize $site$info$name::before,
-:root.sw-yotsuba.anonymize .post-author:not([class*=capcode])::before {
- content: "Anonymous";
- font-size: 10pt;
-}
-:root.sw-yotsuba.anonymize .flashListing .name::before,
-:root.sw-yotsuba.anonymize .post-last > .post-author:not([class*=capcode])::before {
- font-size: 9pt;
-}
-
-/* QR */
-:root.hide-original-post-form #togglePostFormLink,
-#qr.autohide:not(.focus):not(:hover):not(:active) > form,
-:root.thread-view #qr:not(.show-new-thread-option) select[data-name="thread"],
-#file-n-submit:not(.has-file) #qr-filerm {
- display: none;
-}
-:root.hide-original-post-form #postForm {
- display: none !important;
-}
-#qr select,
-#qr-filename-container > a,
-.remove,
-.captcha-img {
- cursor: pointer;
-}
-#qr {
- position: fixed;
- padding: 1px;
- border: 1px solid transparent;
- min-width: 300px;
- border-radius: 3px 3px 0 0;
-}
-#qr > form {
- /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
- max-height: 85vh;
- max-height: calc(100vh - 75px);
- overflow-y: auto;
- overflow-x: hidden;
-}
-#qrtab {
- border-radius: 3px 3px 0 0;
-}
-#qrtab {
- margin-bottom: 1px;
-}
-#qr .close {
- float: right;
- padding: 0 3px;
-}
-.qr-link-container {
- text-align: center;
- margin: 16px 0;
-}
-.qr-link-container-bottom {
- width: 200px;
- position: absolute;
- left: -100px;
- margin-left: 50%;
- text-align: center;
-}
-.qr-link {
- border-radius: 3px;
- padding: 6px 10px 5px;
- font-weight: bold;
- vertical-align: middle;
- border-style: solid;
- border-width: 1px;
- font-size: 10pt;
-}
-.qr-link-container + #togglePostFormLink {
- font-size: 10pt;
- font-weight: normal;
- margin: -8px 0 3.5px;
-}
-.persona {
- width: 100%;
- display: -webkit-flex;
- display: flex;
- -webkit-flex-direction: row;
- flex-direction: row;
-}
-.persona .field {
- -webkit-flex: 1;
- flex: 1;
- width: 0;
-}
-#qr.forced-anon input[data-name="name"]:not(.force-show),
-#qr.forced-anon input[data-name="sub"]:not(.force-show),
-#qr.reply-to-thread input[data-name="sub"]:not(.force-show),
-body:not(.board_f) #qr select[name="filetag"],
-#qr.reply-to-thread select[name="filetag"],
-#qr:not(.has-sjis) #sjis-toggle,
-#qr:not(.has-math) #tex-preview-button,
-#qr.tex-preview .textarea > :not(#tex-preview),
-#qr:not(.tex-preview) #tex-preview {
- display: none;
-}
-.persona button {
- -webkit-flex: 0 0 23px;
- flex: 0 0 23px;
- -webkit-align-self: stretch;
- align-self: stretch;
- border: 1px solid #BBB;
- padding: 0;
- background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;
- color: #000;
-}
-#qr.sjis-preview #sjis-toggle, #qr.tex-preview #tex-preview-button {
- background: #DCDCDC;
-}
-#sjis-toggle, #qr.sjis-preview textarea.field {
- font-family: "IPAMonaPGothic","Mona","MS PGothic",monospace;
- font-size: 16px;
- line-height: 17px;
-}
-#tex-preview-button {
- font-size: 10px;
-}
-#tex-preview {
- white-space: pre-line;
-}
-#qr textarea.field {
- height: 14.8em;
- min-height: 9em;
-}
-#qr.has-captcha textarea.field {
- height: 9em;
-}
-input.field.tripped:not(:hover):not(:focus) {
- color: transparent !important;
- text-shadow: none !important;
-}
-#qr textarea {
- min-width: 300px;
- resize: both;
-}
-.field {
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- margin: 0px;
- padding: 2px 4px 3px;
-}
-#qr label input[type="checkbox"] {
- position: relative;
- top: 2px;
-}
-
-/* Recaptcha v2 */
-#qr .captcha-root {
- position: relative;
-}
-#qr .captcha-container > div {
- margin: auto;
- width: 304px;
-}
-/* XXX scrollable with scroll bar hidden; prevents scroll on space press */
-:root.ua-blink #qr .captcha-container > div,
-:root.ua-edge #qr .captcha-container > div {
- overflow: hidden;
-}
-:root.ua-blink #qr .captcha-container > div > div:first-of-type,
-:root.ua-edge #qr .captcha-container > div > div:first-of-type {
- overflow-y: scroll;
- overflow-x: hidden;
- padding-right: 30px;
- height: 99%;
- width: 100%;
-}
-#qr .captcha-counter {
- display: block;
- width: 100%;
- text-align: center;
- pointer-events: none;
-}
-#qr.captcha-open .captcha-counter {
- position: absolute;
- bottom: 3px;
-}
-#qr .captcha-counter > a {
- pointer-events: auto;
- display: inline-block; /* XXX https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8851747/ */
-}
-#qr:not(.captcha-open) .captcha-counter > a {
- display: block;
- width: 100%;
-}
-#qr.captcha-v2 #qr-captcha-iframe {
- width: 302px;
- height: 423px;
- border: 0;
- display: block;
- margin: auto;
-}
-.goog-bubble-content {
- max-width: 100vw;
- max-height: 100vh;
- overflow: auto;
-}
-.goog-bubble-content iframe {
- position: static !important;
-}
-
-/* File Input, Submit Button, Oekaki */
-#file-n-submit, #qr .oekaki {
- display: -webkit-flex;
- display: flex;
- -webkit-align-items: stretch;
- align-items: stretch;
- height: 25px;
- margin-top: 1px;
-}
-#file-n-submit > input, #qr-draw-button {
- background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;
- border: 1px solid #BBB;
- border-radius: 2px;
- height: 100%;
-}
-#qr-file-button, #qr-draw-button {
- width: 15%;
-}
-#file-n-submit input[type="submit"] {
- width: 25%;
-}
-#qr-filename-container {
- -webkit-flex: 1 1 auto;
- flex: 1 1 auto;
- width: 0;
- display: -webkit-flex;
- display: flex;
- -webkit-align-items: center;
- align-items: center;
- position: relative;
- padding: 1px;
-}
-input#qr-filename {
- border: none !important;
- background: none !important;
- outline: none;
-}
-#qr-filename,
-.has-file #qr-no-file {
- display: none;
-}
-#qr-no-file,
-.has-file #qr-filename {
- -webkit-flex: 1 1 auto;
- flex: 1 1 auto;
- width: 0px; /* XXX Fixes filename not shrinking to allow space for buttons in Edge */
- display: inline-block;
- padding: 0;
- padding-left: 3px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-#qr-no-file {
- color: #AAA;
-}
-#qr .oekaki.has-file {
- display: none;
-}
-#qr .oekaki > label {
- -webkit-flex: 1 1 auto;
- flex: 1 1 auto;
- width: 0;
- display: -webkit-flex;
- display: flex;
- -webkit-align-items: center;
- align-items: center;
- height: 100%;
-}
-#qr .oekaki > label > span {
- margin: 0 3px;
-}
-#qr .oekaki > label > input {
- -webkit-flex: 1 1 auto;
- flex: 1 1 auto;
- width: 0;
- height: 100%;
-}
-#qr .oekaki-bg {
- position: relative;
- display: inline-block;
- height: 100%;
- width: 10%;
- margin-left: 3px;
-}
-#qr .oekaki-bg > * {
- position: absolute;
- top: 0;
- left: 0;
- margin: 0;
-}
-#qr .oekaki-bg > :not([name="oekaki-bgcolor"]) {
- z-index: 1;
-}
-#qr [name="oekaki-bgcolor"] {
- height: 100%;
- width: 100%;
- border: none;
- padding: 0;
-}
-#qr [name="oekaki-bg"]:not(:checked) ~ [name="oekaki-bgcolor"] {
- visibility: hidden;
-}
-#qr input[type="file"] {
- visibility: hidden;
- position: absolute;
-}
-
-/* Spoiler Checkbox, QR Icons */
-#qr-filename-container > label, #qr-filename-container > a {
- -webkit-flex: none;
- flex: none;
- margin: 0;
- margin-right: 3px;
-}
-#qr:not(.has-spoiler) #qr-spoiler-label,
-#file-n-submit:not(.has-file) #qr-spoiler-label,
-.has-file #paste-area,
-.has-file #url-button,
-#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {
- display: none;
-}
-#qr-filename-container > label {
- position: relative;
-}
-#qr-filename-container input[type="checkbox"] {
- margin: 0;
-}
-.checkbox-letter {
- font-size: 13px;
- font-weight: bold;
-}
-#qr-filename-container label:not(:hover) > input[type="checkbox"]:not(:focus):not(:checked),
-#qr-filename-container label:not(:hover) > input[type="checkbox"]:not(:focus):not(:checked) ~ :not(.checkbox-letter),
-#qr-filename-container label:hover > .checkbox-letter,
-input[type="checkbox"]:focus ~ .checkbox-letter,
-input[type="checkbox"]:checked ~ .checkbox-letter {
- /* not displayed but still focusable */
- position: absolute;
- opacity: 0;
- pointer-events: none;
-}
-.checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button {
- opacity: 0.6;
-}
-#paste-area {
- font-size: 0;
-}
-#paste-area:focus {
- opacity: 1;
-}
-#custom-cooldown-button.disabled {
- opacity: 0.27;
-}
-
-/* Thread and Flash Tag Select */
-#qr select {
- background: white;
- border: 1px solid #CCC;
-}
-#qr select[data-name="thread"] {
- float: right;
-}
-#qr > form > select {
- margin-top: 1px;
-}
-
-/* Dumping UI */
-.dump #dump-list-container {
- display: block;
-}
-#dump-list-container {
- display: none;
- position: relative;
- overflow-y: hidden;
- margin-top: 1px;
-}
-#dump-list {
- overflow-x: auto;
- overflow-y: auto;
- white-space: nowrap;
- width: 248px;
- max-height: 248px;
- min-height: 90px;
- max-width: 100%;
- min-width: 100%;
- display: -webkit-flex;
- display: flex;
- -webkit-flex-wrap: wrap;
- flex-wrap: wrap;
-}
-#dump-list:hover {
- overflow-x: auto;
-}
-.qr-preview {
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- counter-increment: thumbnails;
- cursor: move;
- display: inline-block;
- height: 90px;
- width: 90px;
- padding: 2px;
- opacity: .5;
- overflow: hidden;
- position: relative;
- text-shadow: 0 0 2px #000;
- -webkit-transition: opacity .25s ease-in-out, -webkit-transform .25s ease-in-out;
- transition: opacity .25s ease-in-out, transform .25s ease-in-out, -webkit-transform .25s ease-in-out;
- vertical-align: top;
- background-size: cover;
- -webkit-flex: none;
- flex: none;
-}
-.qr-preview:hover,
-.qr-preview:focus {
- opacity: .9;
-}
-.qr-preview::before {
- content: counter(thumbnails);
- color: #fff;
- position: absolute;
- top: 3px;
- right: 3px;
- text-shadow: 0 0 3px #000, 0 0 8px #000;
-}
-.qr-preview#selected {
- opacity: 1;
-}
-.qr-preview.drag {
- box-shadow: 0 0 10px rgba(0,0,0,.5);
- -webkit-transform: scale(.8);
- transform: scale(.8);
-}
-.qr-preview.over {
- border-color: #fff;
- -webkit-transform: scale(1.1);
- transform: scale(1.1);
- opacity: 0.9;
- z-index: 10;
-}
-.qr-preview > span {
- color: #fff;
-}
-.remove {
- background: none;
- color: #e00;
- padding: 1px;
-}
-a:only-of-type > .remove {
- display: none;
-}
-.remove:hover::after {
- content: " Remove";
-}
-.qr-preview:not(.has-file) label,
-#qr:not(.has-spoiler) .qr-preview-spoiler {
- display: none;
-}
-.qr-preview > label {
- background: rgba(0,0,0,.5);
- color: #fff;
- right: 0;
- bottom: 0;
- left: 0;
- position: absolute;
- text-align: center;
-}
-.qr-preview > label > input {
- margin: 0;
-}
-#add-post {
- cursor: pointer;
- font-size: 2em;
- position: absolute;
- bottom: 20px;
- right: 10px;
- -webkit-transform: translateY(-50%);
- transform: translateY(-50%);
-}
-.textarea {
- position: relative;
- display: -webkit-flex;
- display: flex;
-}
-#char-count {
- color: #000;
- background: hsla(0, 0%, 100%, .5);
- font-size: 8pt;
- position: absolute;
- bottom: 1px;
- right: 1px;
- pointer-events: none;
-}
-#char-count.warning {
- color: red;
-}
-
-/* Menu */
-.menu-button:not(.fa-bars) {
- display: inline-block;
- position: relative;
- cursor: pointer;
-}
-#header-bar .menu-button i {
- border-top: 6px solid;
- border-right: 4px solid transparent;
- border-left: 4px solid transparent;
- display: inline-block;
- margin: 2px;
- vertical-align: middle;
-}
-.postInfo > .menu-button,
-#thread-watcher .menu-button {
- width: 18px;
- height: 15px;
- text-align: center;
-}
-#menu {
- position: fixed;
- outline: none;
- font-weight: normal;
-}
-#menu, .submenu {
- border-radius: 3px;
- padding-top: 1px;
- padding-bottom: 3px;
-}
-.entry {
- cursor: pointer;
- display: block;
- outline: none;
- padding: 2px 10px;
- position: relative;
- text-decoration: none;
- white-space: nowrap;
- min-width: 70px;
- text-align: left;
- text-shadow: none;
- font-size: 10pt;
-}
-.left>.entry.has-submenu {
- padding-right: 17px !important;
-}
-.entry input[type="checkbox"],
-.entry input[type="radio"] {
- margin: 0px;
- position: relative;
- top: 2px;
-}
-.entry input[type="number"] {
- width: 4.5em;
-}
-.entry.has-shortcut-text {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-.entry .shortcut-text {
- opacity: 0.5;
- font-size: 70%;
- margin-left: 5px;
-}
-.has-submenu::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;
-}
-.left .has-submenu::after {
- border-left: 0;
- border-right: .5em solid;
-}
-.submenu {
- display: none;
- position: absolute;
- left: 100%;
- top: -1px;
- margin-left: 0px;
- margin-top: -2px;
-}
-.focused > .submenu {
- display: block;
-}
-.imp-exp-result {
- position: absolute;
- text-align: center;
- margin: auto;
- right: 0px;
- left: 0px;
- width: 200px;
-}
-
-/* Custom Board Titles */
-.boardTitle, .boardSubtitle {
- white-space: pre-line;
-}
-.boardTitle[contenteditable="true"],
-.boardSubtitle[contenteditable="true"] {
- cursor: text !important;
-}
-
-/* Embedding */
-.embedder:not(.embedded) > span {
- display: none;
-}
-#embedding {
- padding: 1px 4px 1px 4px;
- position: fixed;
-}
-#embedding.empty {
- display: none;
-}
-#embedding > div:first-child {
- display: -webkit-flex;
- display: flex;
-}
-#embedding .move {
- -webkit-flex: 1;
- flex: 1;
-}
-#embedding .jump {
- margin: -1px 4px;
- text-decoration: none;
-}
-
-/* Gallery */
-#a-gallery {
- position: fixed;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- display: -webkit-flex;
- display: flex;
- -webkit-flex-direction: row;
- flex-direction: row;
- background: rgba(0,0,0,0.7);
-}
-.gal-viewport {
- display: -webkit-flex;
- display: flex;
- -webkit-align-items: stretch;
- align-items: stretch;
- -webkit-flex-direction: row;
- flex-direction: row;
- -webkit-flex: 1 1 auto;
- flex: 1 1 auto;
- overflow: hidden;
-}
-.gal-thumbnails {
- -webkit-flex: 0 0 150px;
- flex: 0 0 150px;
- overflow-y: auto;
- display: -webkit-flex;
- display: flex;
- -webkit-flex-direction: column;
- flex-direction: column;
- -webkit-align-items: stretch;
- align-items: stretch;
- text-align: center;
- background: rgba(0,0,0,.5);
- border-left: 1px solid #222;
-}
-.gal-hide-thumbnails .gal-thumbnails {
- display: none;
-}
-.gal-thumb img,
-.gal-thumb video {
- max-width: 125px;
- max-height: 125px;
- height: auto;
- width: auto;
-}
-.gal-thumb {
- -webkit-flex: 0 0 auto;
- flex: 0 0 auto;
- padding: 3px;
- line-height: 0;
- transition: background .2s linear;
-}
-.gal-highlight {
- background: rgba(0, 190, 255,.8);
-}
-.gal-prev {
- border-right: 1px solid #222;
-}
-.gal-next {
- border-left: 1px solid #222;
-}
-.gal-prev,
-.gal-next {
- -webkit-flex: 0 0 20px;
- flex: 0 0 20px;
- position: relative;
- cursor: pointer;
- opacity: 0.7;
- background-color: rgba(0, 0, 0, 0.3);
-}
-.gal-prev:hover,
-.gal-next:hover {
- opacity: 1;
-}
-.gal-prev::after,
-.gal-next::after {
- position: absolute;
- top: 48.6%;
- -webkit-transform: translateY(-50%);
- transform: translateY(-50%);
- display: inline-block;
- border-top: 11px solid transparent;
- border-bottom: 11px solid transparent;
- content: "";
-}
-.gal-prev::after {
- border-right: 12px solid #fff;
- right: 5px;
-}
-.gal-next::after {
- border-left: 12px solid #fff;
- right: 3px;
-}
-.gal-image {
- -webkit-flex: 1 0 auto;
- flex: 1 0 auto;
- display: -webkit-flex;
- display: flex;
- -webkit-align-items: flex-start;
- align-items: flex-start;
- -webkit-justify-content: space-around;
- justify-content: space-around;
- overflow: hidden;
- /* Flex > Non-Flex child max-width and overflow fix (Firefox only?) */
- width: 1%;
-}
-:root:not(.gal-fit-height):not(.gal-pdf) .gal-image {
- overflow-y: scroll !important;
-}
-:root:not(.gal-fit-width):not(.gal-pdf) .gal-image {
- overflow-x: scroll !important;
-}
-.gal-image a {
- display: -webkit-flex;
- display: flex;
- -webkit-align-items: flex-start;
- align-items: flex-start;
- margin: auto;
- line-height: 0;
- max-width: 100%;
-}
-:root.gal-pdf .gal-image a {
- width: 100%;
- height: 100%;
-}
-.gal-image img,
-.gal-image video {
- -webkit-flex: none;
- flex: none;
-}
-.gal-fit-width .gal-image img,
-.gal-fit-width .gal-image video {
- max-width: 100%;
-}
-.gal-fit-height .gal-image img,
-.gal-fit-height .gal-image video {
- /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
- max-height: 95vh;
- max-height: calc(100vh - 25px);
-}
-.gal-image iframe {
- width: 100%;
- height: 100%;
-}
-.gal-buttons {
- font-size: 2em;
- margin-right: 3px;
- padding-left: 7px;
- padding-right: 7px;
- top: 5px;
-}
-:root.gal-pdf .gal-buttons {
- top: 40px;
- background: rgba(0,0,0,0.6) !important;
- border-radius: 3px;
-}
-.gal-buttons a {
- color: #ffffff;
- text-shadow: 0px 0px 1px #000000;
-}
-.gal-buttons i {
- display: inline-block;
- margin: 2px;
- position: relative;
-}
-.gal-start i {
- border-left: 10px solid;
- border-top: 6px solid transparent;
- border-bottom: 6px solid transparent;
- bottom: 1px;
-}
-.gal-stop i {
- border: 5px solid;
- bottom: 2px;
-}
-.gal-buttons.gal-playing > .gal-start,
-.gal-buttons:not(.gal-playing) > .gal-stop {
- display: none;
-}
-.gal-buttons .menu-button i {
- border-top: 10px solid;
- border-right: 6px solid transparent;
- border-left: 6px solid transparent;
- bottom: 2px;
- vertical-align: baseline;
-}
-.gal-labels {
- position: fixed;
- bottom: 6px;
- display: -webkit-flex;
- display: flex;
- -webkit-flex-direction: column;
- flex-direction: column;
- -webkit-align-items: flex-end;
- align-items: flex-end;
-
-}
-:root:not(.show-sauce) .gal-sauce {
- display: none;
-}
-.gal-name,
-.gal-count,
-.gal-sauce {
- background: rgba(0,0,0,0.6) !important;
- border-radius: 3px;
- padding: 1px 5px 2px 5px;
- margin-top: 3px;
- color: #ffffff !important;
- text-decoration: none !important;
-}
-.gal-sauce a {
- color: #ffffff !important;
-}
-.gal-name:hover,
-.gal-buttons a:hover,
-.gal-sauce a:hover {
- color: rgb(95, 95, 101) !important;
-}
-:root.gal-pdf .gal-buttons a:hover {
- color: rgb(204, 204, 204) !important;
-}
-.gal-buttons,
-.gal-labels {
- position: fixed;
- right: 195px;
-}
-.gal-hide-thumbnails .gal-buttons,
-.gal-hide-thumbnails .gal-labels {
- right: 44px;
-}
-:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels {
- bottom: 23px !important;
-}
-:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,
-:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels {
- right: 178px !important;
-}
-:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,
-:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels {
- right: 28px !important;
-}
-:root.gallery-open.fixed #header-bar:not(.autohide),
-:root.gallery-open.fixed #header-bar:not(.autohide) #shortcuts .fa::before {
- visibility: hidden;
-}
-
-/* Mod Contact Links */
-.contact-links {
- margin-left: 2px;
-}
-.move-note > a {
- text-decoration: underline;
-}
-.invisible {
- font-size: 0;
-}
-
-/* PostJumper */
-.postJumper > .prev,
-.postJumper > .next {
- font-size: 120%;
-}
-
-/* PSA */
-.fcx-announcement {
- text-align: center;
-}
-.fcx-announcement a {
- text-decoration: underline;
-}
-
-@keyframes spin {
- 0% {transform:rotate(0deg);}
- 100% {transform:rotate(359deg);}
-}
-
-.spin {
- animation:spin 2s infinite linear;
-}
+ var style = `/* General */
+.dialog {
+ border: 1px solid;
+ display: block;
+ background-color: inherit;
+}
+.dialog:not(#qr):not(#thread-watcher):not(#header-bar) {
+ box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
+}
+#qr,
+#thread-watcher {
+ box-shadow: -1px 2px 2px rgba(0, 0, 0, 0.25);
+}
+.captcha-img,
+.field {
+ background-color: #FFF;
+ border: 1px solid #CCC;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ color: #333;
+ font: 13px sans-serif;
+ outline: none;
+ transition: color .25s, border-color .25s;
+}
+.field::-moz-placeholder {
+ color: #AAA;
+ font-size: 13px;
+ opacity: 1;
+}
+.captch-img:hover,
+.field:hover {
+ border-color: #999;
+}
+.field:hover, .field:focus, .field.focus {
+ color: #000;
+}
+.field[disabled] {
+ background-color: #F2F2F2;
+ color: #888;
+}
+.field::-webkit-search-decoration {
+ display: none;
+}
+.move {
+ cursor: move;
+ overflow: hidden;
+}
+label {
+ cursor: pointer;
+}
+a[href="javascript:;"] {
+ text-decoration: none;
+}
+.warning {
+ color: red;
+}
+:root.sw-yotsuba #boardNavDesktop, :root.sw-yotsuba #boardNavMobile {
+ display: none !important;
+}
+:root.hide-bottom-board-list $site$boardListBottom {
+ display: none;
+}
+body.hasDropDownNav{
+ margin-top: 5px;
+}
+:root:not(.keyboard-focus) a {
+ outline: none;
+}
+.painted {
+ border-radius: 3px;
+ padding: 0px 2px;
+}
+[hidden] {
+ display: none !important;
+}
+
+/* 4chan style fixes */
+/* overrides 4chan CSS on div.opContainer, div.op */
+:root.sw-yotsuba .opContainer, :root.sw-yotsuba .op {
+ display: block;
+ overflow: visible;
+}
+:root.sw-yotsuba .reply > .file > .fileText {
+ margin: 0 20px;
+}
+:root.sw-yotsuba #arc-list span.quote {
+ color: #789922;
+}
+:root.sw-yotsuba .fileText a {
+ unicode-bidi: -moz-isolate;
+ unicode-bidi: -webkit-isolate;
+}
+:root.sw-yotsuba #g-recaptcha {
+ min-height: 78px;
+ height: auto;
+}
+:root.sw-yotsuba:not(.js-enabled) #postForm {
+ display: table;
+}
+:root.sw-yotsuba #captchaContainerAlt td:nth-child(2) {
+ display: table-cell !important;
+}
+:root.sw-yotsuba canvas#tegaki-canvas {
+ background: none;
+}
+/* Disable obnoxious captcha fade-in. */
+:root.sw-yotsuba > body > div:last-of-type {
+ transition: none !important;
+}
+/* Fix captcha scrolling to top of page. */
+:root.sw-yotsuba > body > div[style*=" top: -10000px;"] {
+ visibility: hidden !important;
+}
+/* Make long filenames wrap properly: https://github.com/ccd0/4chan-x/issues/1082 */
+:root.sw-yotsuba .post > .file {
+ /* currently nonstandard but may be added: https://lists.w3.org/Archives/Public/www-style/2016Mar/0352.html, https://bugzilla.mozilla.org/show_bug.cgi?id=1296042 */
+ word-break: break-word;
+}
+:root.sw-yotsuba:not(.ua-webkit):not(.ua-blink) .fileText {
+ word-wrap: break-word;
+ max-width: calc(100vw - 90px);
+}
+:root.sw-yotsuba > body.is_catalog .thread > a > img {
+ display: inline-block;
+}
+/* Links to NSFW boards */
+:root.sw-yotsuba .nwsb {
+ display: inline;
+}
+:root.sw-yotsuba .fileText {
+ max-width: auto;
+ white-space: normal;
+}
+
+/* Ads */
+:root.sw-yotsuba .ad-cnt > *, :root.sw-yotsuba .adg-rects > *, :root.sw-yotsuba .bsa-cnt {
+ height: auto !important;
+}
+:root.sw-yotsuba:not(.ads-loaded) hr.abovePostForm,
+:root.sw-yotsuba:not(.ads-loaded) .adg-rects > hr,
+:root.sw-yotsuba #adg-ol + hr,
+:root.sw-yotsuba .danbo-slot:empty {
+ display: none;
+}
+:root.sw-yotsuba .adg-rects {
+ margin: 0;
+ font-size: 0;
+}
+:root.sw-yotsuba div.center[style] {
+ display: none !important;
+}
+
+/* Tinyboard / vichan conflicts */
+#menu > .hide-thread-link {
+ width: auto;
+ height: auto;
+ overflow: visible;
+ background-image: none;
+}
+#menu label.entry {
+ display: block;
+}
+#fourchanx-settings label {
+ display: inline;
+}
+.intro a[href="javascript:;"],
+#menu a {
+ margin: 0;
+}
+.gal-buttons.gal-buttons a {
+ font-size: inherit;
+}
+:root.sw-tinyboard.fixed.top-header:not(.autohide) .boardlist,
+:root.sw-tinyboard.fixed.top-header:not(.autohide) .bar.top {
+ position: static;
+}
+:root.sw-tinyboard.fixed.top-header:not(.autohide) div.pages.top {
+ top: auto;
+ bottom: 0;
+}
+:root.sw-tinyboard.fixed.top-header.autohide .boardlist,
+:root.sw-tinyboard.fixed.top-header.autohide .bar.top {
+ z-index: 3;
+}
+
+/* Tinyboard site style conflicts */
+:root[data-host="fufufu.moe"].fixed.top-header:not(.autohide) div.pages.top {
+ top: 26px;
+ bottom: auto;
+}
+:root[data-host="merorin.com"].fixed.top-header:not(.autohide) span.settings {
+ top: 26px;
+}
+:root[data-host="fufufu.moe"]:not(.fixed) #header-bar {
+ margin-top: 38px;
+}
+:root[data-host="lainchan.org"]:not(.fixed) #header-bar {
+ margin-top: 17px;
+}
+:root[data-host="smuglo.li"]:not(.fixed) #header-bar {
+ margin-top: 8px;
+}
+
+/* Anti-autoplay */
+audio.controls-added {
+ display: block;
+ margin: auto;
+ white-space: normal;
+}
+:root.anti-autoplay div.embed {
+ position: static;
+ width: auto;
+ height: auto;
+ text-align: center;
+}
+:root.anti-autoplay .autoplay-removed {
+ visibility: visible !important;
+ min-width: 640px;
+ min-height: 360px;
+}
+
+/* fixed, z-index */
+#overlay,
+#qp, #ihover,
+#navlinks, .fixed #header-bar,
+:root.float #updater,
+:root.float #thread-stats,
+#qr {
+ position: fixed;
+}
+#overlay {
+ z-index: 999;
+}
+#qp, #ihover {
+ z-index: 60;
+}
+#menu, .gal-buttons {
+ z-index: 50;
+}
+#updater, #thread-stats {
+ z-index: 40;
+}
+:root.fixed #header-bar, #notifications {
+ z-index: 35;
+}
+#a-gallery {
+ z-index: 30;
+}
+#navlinks {
+ z-index: 25;
+}
+#qr {
+ z-index: 20;
+}
+#embedding {
+ z-index: 11;
+}
+:root.fixed-watcher #thread-watcher {
+ z-index: 10;
+}
+:root.fixed:not(.gallery-open) #header-bar:not(:hover) {
+ z-index: 8;
+}
+#thread-watcher {
+ z-index: 5;
+}
+
+/* Header */
+.fixed.top-header body {
+ padding-top: 2em;
+}
+.fixed.bottom-header body {
+ padding-bottom: 2em;
+}
+.fixed #header-bar {
+ right: 0;
+ left: 0;
+ padding: 3px 4px 4px;
+ font-size: 12px;
+}
+.fixed.top-header #header-bar {
+ top: 0;
+}
+.fixed.bottom-header #header-bar {
+ bottom: 0;
+}
+#header-bar {
+ border-width: 0;
+ transition: all .1s .05s ease-in-out;
+}
+:root.fixed #header-bar {
+ box-shadow: -5px 1px 10px rgba(0, 0, 0, 0.20);
+}
+:root.centered-links #shortcuts {
+ width: 300px;
+ text-align: right;
+}
+:root.centered-links #header-bar {
+ text-align: center;
+}
+#custom-board-list {
+ font-size: 13px;
+ vertical-align: middle;
+}
+#full-board-list {
+ vertical-align: middle;
+}
+:root.centered-links #custom-board-list {
+ position: relative;
+ left: 150px;
+}
+.fixed.top-header #header-bar {
+ border-bottom-width: 1px;
+}
+.fixed.bottom-header #header-bar {
+ box-shadow: 0 -1px 2px rgba(0, 0, 0, .15);
+ border-top-width: 1px;
+}
+.fixed.bottom-header #header-bar .menu-button i {
+ border-top: none;
+ border-bottom: 6px solid;
+}
+.fixed #header-bar.autohide:not(:hover) {
+ box-shadow: none;
+ transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);
+}
+.fixed.top-header #header-bar.autohide:not(:hover) {
+ margin-bottom: -1em;
+ -webkit-transform: translateY(-100%);
+ transform: translateY(-100%);
+}
+.fixed.bottom-header #header-bar.autohide:not(:hover) {
+ -webkit-transform: translateY(100%);
+ transform: translateY(100%);
+}
+#scroll-marker {
+ left: 0;
+ right: 0;
+ height: 10px;
+ position: absolute;
+}
+#header-bar:not(.autohide) #scroll-marker {
+ pointer-events: none;
+}
+#header-bar #scroll-marker {
+ display: none;
+}
+.fixed #header-bar #scroll-marker {
+ display: block;
+}
+.fixed.top-header #header-bar #scroll-marker {
+ top: 100%;
+}
+.fixed.bottom-header #header-bar #scroll-marker {
+ bottom: 100%;
+}
+#board-list a, #shortcuts a:not(.entry) {
+ text-decoration: none;
+ padding: 1px;
+}
+#shortcuts:empty {
+ display: none;
+}
+.brackets-wrap::before {
+ content: "\\00a0[";
+}
+.brackets-wrap::after {
+ content: "]\\00a0";
+}
+.dead-thread,
+.disabled:not(.replies-quoting-you) {
+ opacity: .45;
+}
+#shortcuts {
+ float: right;
+}
+:root.autohiding-scrollbar #shortcuts {
+ margin-right: 12px;
+}
+.shortcut {
+ margin-left: 3px;
+ vertical-align: middle;
+}
+:root.shortcut-icons .native-settings {
+ font-size: 0;
+ color: transparent;
+ display: inline-block;
+ vertical-align: top;
+ height: 12px;
+ width: 14px;
+ background: url('//s.4cdn.org/image/favicon.ico') 0px -1px no-repeat;
+}
+#navbotright,
+#navtopright {
+ display: none;
+}
+#toggleMsgBtn {
+ display: none !important;
+}
+.current,
+:root.sw-yotsuba div#boardNavDesktopFoot a.current {
+ font-weight: bold;
+}
+@media (min-width: 1300px) {
+ :root.sw-yotsuba.fixed:not(.centered-links) #header-bar {
+ white-space: nowrap;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-align-items: center;
+ align-items: center;
+ }
+ :root.sw-yotsuba.fixed:not(.centered-links) #board-list {
+ -webkit-flex: auto;
+ flex: auto;
+ }
+ :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list {
+ display: -webkit-flex;
+ display: flex;
+ }
+ :root.sw-yotsuba.fixed:not(.centered-links) .hide-board-list-container {
+ -webkit-flex: none;
+ flex: none;
+ margin-right: 5px;
+ }
+ :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList {
+ -webkit-flex: auto;
+ flex: auto;
+ display: -webkit-flex;
+ display: flex;
+ width: 0px; /* XXX Fixes Edge not shrinking the board list below default size when needed */
+ }
+ :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > a,
+ :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {
+ -webkit-flex: none;
+ flex: none;
+ padding: .17em;
+ margin: -.17em -.32em;
+ }
+ :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span {
+ pointer-events: none;
+ }
+ :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.space {
+ -webkit-flex: 0 .63 .63em;
+ flex: 0 .63 .63em;
+ }
+ :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {
+ -webkit-flex: 0 .38 .38em;
+ flex: 0 .38 .38em;
+ }
+ :root.sw-yotsuba.fixed:not(.centered-links) #shortcuts {
+ float: initial;
+ -webkit-flex: none;
+ flex: none;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-align-items: center;
+ align-items: center;
+ }
+}
+/* 4chan X link brackets */
+.brackets-wrap::before {
+ content: "[";
+}
+.brackets-wrap::after {
+ content: "]";
+}
+/* Notifications */
+#notifications {
+ position: fixed;
+ top: 0;
+ height: 0;
+ text-align: center;
+ right: 0;
+ left: 0;
+ visibility: visible;
+}
+#notifications:empty {
+ display: none;
+}
+:root.fixed.top-header:not(.gallery-open) #header-bar #notifications,
+:root.fixed.top-header #header-bar.autohide #notifications {
+ position: absolute;
+ top: 100%;
+}
+.notification {
+ color: #FFF;
+ font-weight: 700;
+ text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
+ box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
+ border-radius: 2px;
+ margin: 1px auto;
+ width: 550px;
+ max-width: 100%;
+ position: relative;
+ transition: all .25s ease-in-out;
+}
+.notification.error {
+ background-color: hsla(0, 100%, 38%, .9);
+}
+.notification.warning {
+ background-color: hsla(36, 100%, 38%, .9);
+}
+.notification.info {
+ background-color: hsla(200, 100%, 38%, .9);
+}
+.notification.success {
+ background-color: hsla(104, 100%, 38%, .9);
+}
+.notification a {
+ color: white;
+}
+.notification > .close {
+ padding: 7px;
+ top: 0px;
+ right: 5px;
+ position: absolute;
+}
+.notification > .fa-times::before {
+ font-size: 11px !important;
+}
+.message {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 6px 20px;
+ max-height: 200px;
+ width: 100%;
+ overflow: auto;
+ white-space: pre-line;
+}
+.message a {
+ text-decoration: underline;
+}
+:root.tainted .report-error {
+ display: none;
+}
+
+/* Settings */
+:root.fourchan-x body {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+#overlay {
+ background-color: rgba(0, 0, 0, .5);
+ display: -webkit-flex;
+ display: flex;
+ top: 0;
+ left: 0;
+ height: 100%;
+ width: 100%;
+}
+#fourchanx-settings {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ box-shadow: 0 0 15px rgba(0, 0, 0, .15);
+ height: 600px;
+ max-height: 100%;
+ width: 900px;
+ max-width: 100%;
+ margin: auto;
+ padding: 5px;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+}
+#fourchanx-settings > nav {
+ padding: 2px 2px 8px;
+ display: -webkit-flex;
+ display: flex;
+}
+#fourchanx-settings > nav a {
+ text-decoration: underline;
+}
+#fourchanx-settings > nav a.close {
+ text-decoration: none;
+ padding: 0 2px;
+ margin: 0;
+}
+.section-container {
+ -webkit-flex: 1;
+ flex: 1;
+ position: relative;
+ overflow: auto;
+ padding-right: 5px;
+ overscroll-behavior: contain;
+}
+.sections-list {
+ -webkit-flex: 1;
+ flex: 1;
+}
+.export, .import, .reset {
+ cursor: pointer;
+ text-decoration: none !important;
+}
+.tab-selected {
+ font-weight: 700;
+}
+.section-sauce ul,
+.section-advanced ul {
+ list-style: none;
+ margin: 0;
+}
+.section-sauce ul {
+ padding: 8px;
+}
+.section-advanced ul {
+ padding: 0px;
+}
+.section-sauce li,
+.section-advanced li {
+ padding-left: 4px;
+}
+.section-main ul {
+ margin: 0;
+ padding: 0 0 0 16px;
+}
+.section-main li {
+ white-space: pre-line;
+ list-style: disc;
+}
+.section-main li:not(:first-of-type) {
+ margin-top: 4px;
+}
+.section-main label {
+ text-decoration: underline;
+}
+div[data-checked="false"] > .suboption-list {
+ display: none;
+}
+.suboption-list {
+ position: relative;
+}
+.suboption-list::before {
+ content: "";
+ display: inline-block;
+ position: absolute;
+ left: .7em;
+ width: 0;
+ height: 100%;
+ border-left: 1px solid;
+}
+.suboption-list > div {
+ position: relative;
+ padding-left: 1.4em;
+}
+.suboption-list > div::before {
+ content: "";
+ display: inline-block;
+ position: absolute;
+ left: .7em;
+ width: .7em;
+ height: .6em;
+ border-left: 1px solid;
+ border-bottom: 1px solid;
+}
+#fourchanx-settings .section-main p {
+ margin: .5em 0 0;
+}
+.section-filter ul {
+ padding: 0;
+}
+.section-filter li {
+ margin: 10px 40px;
+ list-style: disc;
+}
+.section-filter textarea {
+ height: 500px;
+}
+.section-main a, .section-filter a, .section-advanced a {
+ text-decoration: underline;
+}
+#sauce-doc-expand:not(:checked) ~ #sauce-doc {
+ max-height: 130px;
+ overflow: auto;
+}
+#sauce-doc > label {
+ float: right;
+ margin: 0 5px;
+}
+/* XXX for OneeChan */
+#sauce-doc-expand + .riceCheck {
+ display: none;
+}
+.section-sauce textarea {
+ height: 430px;
+}
+.section-advanced .field[name="boardnav"] {
+ width: 100%;
+}
+.section-advanced textarea {
+ height: 150px;
+}
+.section-advanced textarea[name="archiveLists"],
+.section-advanced textarea[name="externalCatalogURLs"],
+.section-advanced textarea[name="knownBanners"] {
+ height: 75px;
+}
+.section-advanced .archive-cell {
+ min-width: 160px;
+ text-align: center;
+}
+.section-advanced #archive-board-select {
+ position: absolute;
+}
+.section-advanced .note {
+ font-size: 0.8em;
+ font-style: italic;
+ margin-left: 10px;
+}
+.section-advanced .note code {
+ font-style: normal;
+ font-size: 11px;
+}
+.favicon-preview > img {
+ vertical-align: middle;
+}
+.favicon-preview > img:nth-of-type(3n+1) {
+ margin-left: 4px;
+}
+.section-keybinds .field {
+ font-family: monospace;
+}
+#fourchanx-settings fieldset {
+ border: 1px solid;
+ border-radius: 3px;
+ padding: 0.35em 0.625em 0.75em;
+ margin: 0px 2px;
+}
+#fourchanx-settings legend {
+ font-weight: 700;
+ color: inherit;
+}
+#fourchanx-settings textarea {
+ font-family: monospace;
+ width: 100%;
+ resize: vertical;
+}
+#fourchanx-settings code {
+ color: #000;
+ background-color: #FFF;
+ padding: 0 2px;
+}
+#fourchanx-settings th {
+ text-align: center;
+ font-weight: bold;
+}
+#fourchanx-settings p {
+ margin: 1em 0px;
+}
+#fourchanx-settings table {
+ margin: auto;
+}
+
+/* Index */
+:root.index-loading .navLinks:not(.json-index),
+:root.index-loading .board:not(.json-index),
+:root.index-loading .pagelist:not(.json-index),
+:root.infinite-mode .pagelist,
+:root.all-pages-mode .pagelist,
+:root.catalog-mode .pagelist,
+:root:not(.catalog-mode) .indexlink,
+:root.catalog-mode .cataloglink,
+:root:not(.catalog-mode) #hidden-label,
+:root:not(.catalog-mode) #index-size {
+ display: none;
+}
+#index-search {
+ padding-right: 1.5em;
+ width: 100px;
+ transition: color .25s, border-color .25s, width .25s;
+}
+#index-search:focus,
+#index-search[data-searching] {
+ width: 200px;
+}
+#index-search-clear {
+ color: gray;
+ display: inline-block;
+ position: relative;
+ left: -1em;
+ width: 0;
+}
+/* \`\`::-webkit-*'' selectors break selector lists on Firefox. */
+#index-search::-webkit-search-cancel-button {
+ display: none;
+}
+#index-search:not([data-searching]) + #index-search-clear {
+ display: none;
+}
+#index-options {
+ float: right;
+}
+#lastlong-options {
+ display: inline-block;
+ vertical-align: middle;
+ height: 28px;
+ margin: -14px 0;
+}
+#lastlong-options > input {
+ padding: 0;
+ border: 0 !important;
+ text-align: center;
+ background: transparent;
+ display: block;
+ font-size: 12px;
+ height: 12px;
+ width: 30px;
+ margin: 1px 0;
+}
+.summary {
+ text-decoration: none;
+}
+
+/* Catalog */
+:root.catalog-mode .board {
+ text-align: center;
+}
+.catalog-thread {
+ display: inline-block;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ border: 1px solid transparent;
+ word-wrap: break-word;
+ vertical-align: top;
+ position: relative;
+}
+/* overrides 4chan CSS on div.thread */
+.catalog-thread.catalog-thread {
+ margin: 2px;
+}
+.catalog-small > .catalog-thread {
+ width: 165px;
+ height: 320px;
+}
+.catalog-large > .catalog-thread {
+ width: 270px;
+ height: 410px;
+}
+:root.catalog-hover-expand .catalog-thread:hover {
+ z-index: 1;
+}
+.catalog-container {
+ position: absolute;
+ top: -4px;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+.catalog-container:not(:hover),
+:root:not(.catalog-hover-expand) .catalog-container {
+ overflow: hidden;
+}
+.catalog-post {
+ position: absolute;
+ top: 4px;
+ left: 0;
+ right: 0;
+ border: 1px solid transparent;
+ padding-top: 20px;
+}
+/* overrides inline CSS from Index.cb.hoverAdjust */
+:root:not(.catalog-hover-expand) .catalog-post {
+ left: 0 !important;
+ right: 0 !important;
+}
+/* overrides 4chan CSS on div.post */
+.catalog-post.catalog-post {
+ margin: -21px -1px -1px;
+ overflow: visible;
+}
+.catalog-thread.noFile > * > .catalog-post {
+ margin-top: -7px;
+ padding-top: 6px;
+}
+:root.catalog-hover-expand .catalog-container:hover > .catalog-post {
+ margin-left: -61px;
+ margin-right: -61px;
+}
+:root.catalog-hover-expand .catalog-container:hover > * > :not(.catalog-replies) {
+ padding-left: 2px;
+ padding-right: 2px;
+}
+.catalog-link {
+ display: block;
+ position: relative;
+}
+.catalog-thumb {
+ border-radius: 2px;
+ box-shadow: 0 0 5px rgba(0, 0, 0, .25);
+ vertical-align: top;
+}
+.catalog-thumb.spoiler-file {
+ width: 100px;
+ height: 100px;
+}
+.catalog-thumb.deleted-file {
+ width: 127px;
+ height: 13px;
+ padding: 20px 11px;
+}
+.catalog-thumb.no-file {
+ width: 77px;
+ height: 13px;
+ padding: 20px 36px;
+}
+.catalog-icons > img,
+.catalog-stats > .menu-button {
+ width: 1em;
+ height: 1em;
+ margin: 0;
+ vertical-align: text-top;
+ padding-left: 2px;
+}
+.catalog-stats > .menu-button {
+ font-weight: normal;
+}
+.catalog-stats > .menu-button > i::before {
+ line-height: 11px;
+}
+.catalog-stats {
+ font-size: 10px;
+ font-weight: 700;
+ padding-top: 2px;
+}
+.catalog-stats > [title] {
+ cursor: help;
+}
+.catalog-post > .postMessage {
+ margin: 0;
+ padding-bottom: .3em;
+}
+.catalog-container:not(:hover) > * > .file,
+.catalog-container:not(:hover) > * > .postInfo > :not(.subject),
+.catalog-container:not(:hover) > * > .catalog-replies,
+.catalog-container:not(:hover) .extra-linebreak,
+.catalog-container:not(:hover) .abbr,
+:root:not(.catalog-hover-expand) .catalog-container > * > .file,
+:root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject),
+:root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies,
+:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak,
+:root:not(.catalog-hover-expand) .catalog-container .abbr,
+.catalog-thread > .catalog-container > :not(.catalog-post),
+.catalog-post > .file > :not(.fileText),
+.catalog-post > * > .fileText > :not(:first-child),
+.catalog-post > .postInfo > :not(.subject):not(.nameBlock):not(.dateTime),
+.catalog-post > .postInfo > .nameBlock > .contact-links,
+.catalog-post > * > * > .posteruid,
+.catalog-post > * > * > .postJumper,
+:root.bottom-backlinks .catalog-post > .container,
+.post:not(.catalog-post) > .catalog-link,
+.post:not(.catalog-post) > .catalog-stats,
+.post:not(.catalog-post) > .catalog-replies {
+ display: none;
+}
+.catalog-post > .file {
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ min-height: 20px;
+ background-color: inherit;
+}
+.catalog-post > * > .fileText {
+ position: relative;
+ padding: 2px;
+ background-color: inherit;
+}
+.catalog-small .catalog-post > * .fileText {
+ font-size: 10px;
+}
+.catalog-post > * > .fileText:not(:hover) {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.catalog-post > * > .fileText:hover {
+ z-index: 1;
+}
+/* overrides 4chan CSS on div.post div.postInfo */
+.catalog-post > .postInfo.postInfo {
+ width: auto;
+}
+.catalog-post > * > .subject {
+ display: block;
+}
+.catalog-post > * > .dateTime {
+ display: inline-block;
+ font-style: italic;
+}
+:root.catalog-hover-expand .catalog-container:hover > * > * > .nameBlock,
+:root.catalog-hover-expand .catalog-container:hover > * > * > .dateTime,
+:root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) {
+ padding-top: .3em;
+}
+.catalog-post .extra-linebreak {
+ content: ''; /* makes this work in Blink/WebKit */
+ display: block;
+ margin-top: .3em;
+}
+.catalog-reply {
+ text-align: left;
+ white-space: nowrap;
+ border-top: 1px solid transparent;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: stretch;
+ align-items: stretch;
+}
+.catalog-reply > * {
+ padding: 3px;
+ overflow: hidden;
+ -webkit-flex: none;
+ flex: none;
+}
+.catalog-reply > span {
+ font-style: italic;
+ font-weight: bold;
+}
+.catalog-reply-excerpt {
+ -webkit-flex: 1 1 auto;
+ flex: 1 1 auto;
+}
+.catalog-post .prettyprinted {
+ max-width: 100%;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.catalog-post .MathJax_Display {
+ text-align: center !important;
+}
+.catalog-container:not(:hover) .exif,
+:root:not(.catalog-hover-expand) .catalog-container .exif {
+ display: none !important;
+}
+.catalog-post > * > .exif {
+ border-collapse: collapse;
+}
+:root.catalog-hover-expand .catalog-container:hover .exif[style*="display: block;"] {
+ display: inline-block !important;
+}
+.catalog-post > * > .exif,
+.catalog-post > * > .exif > tbody {
+ background-color: inherit;
+}
+.catalog-post > * > .exif,
+.catalog-post > * > .exif td {
+ min-width: 0;
+}
+.catalog-post > * > .exif td {
+ padding-top: 1px;
+}
+:root.hats-enabled .catalog-thread::after {
+ content: '';
+ pointer-events: none;
+ position: absolute;
+ background-size: contain;
+}
+:root.hats-enabled .catalog-small > .catalog-thread::after {
+ left: -8px;
+ top: -59px;
+ width: 96px;
+ height: 96px;
+}
+:root.hats-enabled:not(.werkTyme) .catalog-small > .catalog-thread:not(.noFile)::after {
+ left: calc(67px - .3px * var(--tn-w));
+}
+:root.hats-enabled .catalog-large > .catalog-thread::after {
+ left: -15px;
+ top: -98px;
+ width: 160px;
+ height: 160px;
+}
+:root.hats-enabled:not(.werkTyme) .catalog-large > .catalog-thread:not(.noFile)::after {
+ left: calc(110px - .5px * var(--tn-w));
+}
+
+/* Copy Text Link's textarea element */
+textarea.copy-text-element {
+ height: 0;
+ width: 0;
+ position: absolute;
+ top: -10000px;
+}
+
+/* Announcement Hiding */
+:root.hide-announcement $site$psa {
+ display: none;
+}
+.hide-announcement-button {
+ opacity: 0.4;
+ float: left;
+}
+
+/* Unread */
+.unread-line {
+ margin: 0;
+ border-color: rgb(255,0,0);
+}
+.unread-line + br {
+ display: none;
+}
+.unread-mark-read {
+ float: right;
+ clear: both;
+ width: 100%;
+ text-align: right;
+}
+:not(.unread-thread) > .unread-mark-read {
+ display: none;
+}
+
+/* Thread Updater */
+#updater {
+ background: none;
+ border: none;
+ box-shadow: none;
+}
+#updater > .move {
+ position: absolute;
+ top: -5px;
+ bottom: -5px;
+ left: -5px;
+ right: -5px;
+ z-index: -1;
+}
+#updater > div:last-child {
+ text-align: center;
+}
+#updater input[type="number"] {
+ width: 4em;
+}
+:root.float #updater {
+ padding: 0px 3px;
+}
+:root:not(.float).shortcut-icons #updater {
+ display: inline-block;
+ min-width: 12pt;
+ text-align: right;
+}
+.new {
+ color: limegreen;
+}
+#update-status:not(.empty) + #update-timer:not(.empty):not(.loading) {
+ margin-left: 5px;
+}
+#update-timer {
+ cursor: pointer;
+}
+
+/* Thread Watcher */
+#thread-watcher {
+ position: absolute;
+}
+#thread-watcher {
+ padding-bottom: 3px;
+ padding-left: 3px;
+ white-space: nowrap;
+ min-width: 146px;
+}
+#watched-threads {
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+#thread-watcher .refresh {
+ padding: 0px 3px;
+}
+:root.fixed-watcher #thread-watcher {
+ position: fixed;
+}
+:root.fixed-watcher #watched-threads {
+ /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
+ max-height: 85vh;
+ max-height: calc(100vh - 75px);
+}
+:root:not(.fixed-watcher) #watched-threads:not(:hover) {
+ max-height: 210px;
+ overflow-y: hidden;
+}
+#thread-watcher > .move {
+ padding-top: 3px;
+}
+#watched-threads > div {
+ padding-left: 3px;
+ padding-right: 3px;
+}
+#watched-threads .watcher-link {
+ max-width: 250px;
+ display: -webkit-inline-flex;
+ display: inline-flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+}
+#watched-threads .watcher-page,
+#watched-threads .watcher-unread {
+ -webkit-flex: 0 0 auto;
+ flex: 0 0 auto;
+ margin-right: 2px;
+}
+#watched-threads .watcher-title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ -webkit-flex: 0 1 auto;
+ flex: 0 1 auto;
+}
+#watched-threads .watcher-title:not(:first-child) {
+ margin-left: 2px;
+}
+.replies-quoting-you > a, #watcher-link.replies-quoting-you, .last-page > a > .watcher-page {
+ color: #F00;
+}
+#thread-watcher a {
+ text-decoration: none;
+}
+#thread-watcher .move > .close {
+ position: absolute;
+ right: 0px;
+ top: 0px;
+ padding: 0px 4px;
+}
+.watch-thread-link {
+ padding-top: 18px;
+ width: 18px;
+ height: 0px;
+ display: inline-block;
+ background-repeat: no-repeat;
+ opacity: 0.2;
+ position: relative;
+ top: 1px;
+ background-image: url("data:image/svg+xml,
");
+}
+.watch-thread-link.watched {
+ opacity: 1;
+}
+
+
+/* Thread Stats */
+#thread-stats {
+ background: none;
+ border: none;
+ box-shadow: none;
+}
+:root.float #thread-stats > .move > :not(#page-count) {
+ pointer-events: none;
+}
+:root.float #thread-stats {
+ padding: 0px 3px;
+}
+#page-count {
+ cursor: pointer;
+}
+
+/* Quote */
+.hashlink::before {
+ content: ' ';
+ visibility: hidden;
+}
+.inline + .hashlink {
+ display: none !important;
+}
+:root.resurrect-quotes .deadlink {
+ text-decoration: none !important;
+}
+.catalog-post .qmark-ct {
+ display: none;
+}
+.backlink.deadlink:not(.forwardlink),
+.quotelink.deadlink:not(.forwardlink) {
+ text-decoration: underline !important;
+}
+:root:not(.catalog-mode) .inlined {
+ opacity: .5;
+}
+#qp input, .forwarded {
+ display: none;
+}
+.quotelink.forwardlink,
+.backlink.forwardlink {
+ text-decoration: none;
+ border-bottom: 1px dashed;
+}
+.filtered {
+ text-decoration: underline line-through;
+}
+:root.hide-backlinks .backlink.filtered,
+:root.hide-backlinks .backlink.filtered + .hashlink.filtered {
+ display: none;
+}
+.postNum + .container::before {
+ content: " ";
+}
+:root.bottom-backlinks .container {
+ display: block;
+ clear: both;
+ margin: 0 4px;
+}
+:root.bottom-backlinks .backlink {
+ font-size: 90%;
+}
+.inline {
+ border: 1px solid;
+ display: table;
+ margin: 2px 0;
+}
+.container ~ .inline {
+ margin-left: 20px;
+}
+:root.catalog-mode .inline {
+ display: none;
+}
+.inline .post {
+ border: 0 !important;
+ background-color: transparent !important;
+ display: table !important;
+ margin: 0 !important;
+ padding: 1px 2px !important;
+}
+#qp > .opContainer::after {
+ content: '';
+ clear: both;
+ display: table;
+}
+#qp .post {
+ border: none;
+ margin: 0;
+ padding: 2px 2px 5px;
+}
+#qp img {
+ max-height: 80vh;
+ max-width: 50vw;
+}
+
+/* Quote Threading */
+.threadContainer {
+ margin-left: 20px;
+ border-left: 1px solid rgba(128,128,128,.3);
+}
+.threadOP {
+ clear: both;
+}
+
+/* File */
+.expanded-image > .post > .file > .fileThumb {
+ display: flex;
+ flex-direction: column;
+}
+.fileText-original,
+.fnswitch:hover > .fntrunc,
+.fnswitch:not(:hover) > .fnfull,
+.expanded-image > .post > .file > .fileThumb > video[data-md5],
+.expanded-image > .post > .file > .fileThumb > img[data-md5] {
+ display: none;
+}
+.full-image[data-file-i-d] {
+ display: none;
+ cursor: pointer;
+}
+.expanded-image > .post > .file > .fileThumb > .full-image {
+ display: inline;
+}
+.expanded-image > .post > .file > .fileThumb > audio {
+ height: 30px;
+ width: 100%;
+ min-width: 300px;
+}
+.expanded-image {
+ clear: left;
+}
+.expanding {
+ opacity: .5;
+}
+:root.fit-height .full-image {
+ max-height: 100vh;
+}
+:root.fit-height.fixed .full-image {
+ /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
+ max-height: 93vh;
+ max-height: calc(100vh - 35px);
+}
+:root.fit-width .full-image {
+ max-width: 100%;
+}
+:root.ua-gecko.fit-width .full-image {
+ width: 100%;
+}
+.fileThumb > .warning {
+ clear: both;
+}
+#ihover {
+ pointer-events: none;
+ /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
+ max-height: 95vh;
+ max-height: calc(100vh - 25px);
+ max-width: 100vw;
+}
+/* WEBM Metadata */
+.webm-title > a::before {
+ content: "title";
+ text-decoration: underline;
+}
+.webm-title.loading > a::after {
+ content: "...";
+}
+.webm-title.error > a:hover::before,
+.webm-title.error > a:focus::before {
+ content: "error";
+ text-decoration: none;
+}
+.webm-title > span {
+ cursor: text;
+}
+.webm-title.not-found > span::before {
+ content: "not found";
+}
+.webm-title:not(:hover):not(:focus) > span,
+.webm-title:hover > span + a,
+.webm-title:focus > span + a {
+ display: none;
+}
+/* Volume control */
+input[name="Default Volume"] {
+ width: 4em;
+ height: 1ex;
+ vertical-align: middle;
+ margin: 0px;
+}
+/* Fappe and Werk Tyme */
+:root.fappeTyme $site$replyOriginal.noFile,
+:root.fappeTyme $site$replyOriginal.noFile + br {
+ display: none;
+}
+:root.werkTyme $site$thumbLink,
+:root.werkTyme $site$file$thumb,
+:root.werkTyme .catalog-thumb:not(.deleted-file):not(.no-file),
+:root:not(.werkTyme) .werkTyme-filename {
+ display: none;
+}
+.werkTyme-filename {
+ font-weight: bold;
+ font-size: 110%;
+}
+:root.werkTyme .catalog-link {
+ box-shadow: 0 0 5px rgba(0, 0, 0, .25);
+ padding: 8px;
+ text-align: center;
+}
+:root.werkTyme .catalog-thumb {
+ box-shadow: none;
+ padding: 0;
+ vertical-align: middle;
+}
+.indicator {
+ background: rgba(255,0,0,0.8);
+ font-weight: bold;
+ display: inline-block;
+ min-width: 9px;
+ padding: 0px 2px;
+ margin: 0 1px;
+ text-align: center;
+ color: white;
+ border-radius: 2px;
+ cursor: pointer;
+}
+:root:not(.fappeTyme) #shortcut-fappe,
+:root:not(.werkTyme) #shortcut-werk {
+ display: none;
+}
+
+/* Index/Reply Navigation */
+#navlinks {
+ font-size: 16px;
+ top: 25px;
+ right: 10px;
+}
+:root.catalog-mode #navlinks {
+ display: none;
+}
+
+/* Highlighting */
+.qphl {
+ outline: 2px solid rgba(216, 94, 49, .8);
+}
+:root.highlight-you .quotesYou$site$highlightable$op,
+:root.highlight-you .quotesYou$site$highlightable$reply {
+ border-left: 3px solid rgba(221, 0, 0, .8);
+}
+:root.highlight-own .yourPost$site$highlightable$op,
+:root.highlight-own .yourPost$site$highlightable$reply {
+ border-left: 3px dashed rgba(221, 0, 0, .8);
+}
+.filter-highlight$site$highlightable$op,
+.filter-highlight$site$highlightable$reply {
+ box-shadow: inset 5px 0 rgba(221, 0, 0, .5);
+}
+:root.highlight-own .yourPost > $site$sideArrows,
+:root.highlight-you .quotesYou > $site$sideArrows,
+.filter-highlight > $site$sideArrows {
+ color: rgba(221, 0, 0, .8);
+}
+:root.highlight-own .yourPost$site$highlightable$op::after,
+:root.highlight-you .quotesYou$site$highlightable$op::after,
+.filter-highlight$site$highlightable$op::after {
+ content: "";
+ display: block;
+ clear: both;
+}
+:root:not(.werkTyme) .catalog-thread.filter-highlight .catalog-thumb,
+:root.werkTyme .catalog-thread.filter-highlight:not(:hover),
+:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,
+:root.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post,
+:root.catalog $site$catalog$thread.filter-highlight$site$highlightable$catalog {
+ box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5);
+}
+:root:not(.werkTyme) .catalog-thread.watched .catalog-thumb,
+:root:root.werkTyme .catalog-thread.watched:not(:hover),
+:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,
+:root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {
+ border: 2px solid rgba(255, 0, 0, .75);
+}
+
+/* Spoiler text */
+:root.reveal-spoilers $site$spoiler,
+:root.reveal-spoilers $site$spoiler > a {
+ color: white !important;
+}
+:root.reveal-spoilers .removed-spoiler::before {
+ content: "[spoiler]";
+}
+:root.reveal-spoilers .removed-spoiler::after {
+ content: "[/spoiler]";
+}
+
+/* Thread & Reply Hiding */
+.hide-thread-button,
+.hide-reply-button {
+ float: left;
+ margin-right: 4px;
+ padding: 2px;
+}
+$site$infoRoot a.hide-reply-button {
+ margin-right: 6px;
+ padding: 0;
+}
+.replacedSideArrows {
+ float: left;
+}
+.hide-thread-button:not(:hover),
+.hide-reply-button:not(:hover) {
+ opacity: 0.4;
+}
+.threadContainer .hide-reply-button {
+ margin-left: 2px !important;
+ position: relative;
+ left: 1px;
+}
+.hide-thread-button {
+ margin-top: -1px;
+ width: 11px;
+}
+.stub ~ :not(.threadDivider) {
+ display: none !important;
+}
+.stub input {
+ display: inline-block;
+}
+$site$thread[hidden] + hr {
+ display: none;
+}
+:root.reply-hide $site$sideArrows {
+ display: none;
+}
+:root.sw-yotsuba.thread-hide .party-hat {
+ left: 19px;
+}
+
+/* Anonymize */
+:root.anonymize $site$info$name,
+:root.sw-yotsuba.anonymize .post-author:not([class*=capcode]) {
+ font-size: 0;
+}
+:root.anonymize $site$info$tripcode,
+:root.sw-yotsuba.anonymize .n-pu {
+ display: none;
+}
+:root.anonymize $site$info$name::before,
+:root.sw-yotsuba.anonymize .post-author:not([class*=capcode])::before {
+ content: "Anonymous";
+ font-size: 10pt;
+}
+:root.sw-yotsuba.anonymize .flashListing .name::before,
+:root.sw-yotsuba.anonymize .post-last > .post-author:not([class*=capcode])::before {
+ font-size: 9pt;
+}
+
+/* QR */
+:root.hide-original-post-form #togglePostFormLink,
+#qr.autohide:not(.focus):not(:hover):not(:active) > form,
+:root.thread-view #qr:not(.show-new-thread-option) select[data-name="thread"],
+#file-n-submit:not(.has-file) #qr-filerm {
+ display: none;
+}
+:root.hide-original-post-form #postForm {
+ display: none !important;
+}
+#qr select,
+#qr-filename-container > a,
+.remove,
+.captcha-img {
+ cursor: pointer;
+}
+#qr {
+ position: fixed;
+ padding: 1px;
+ border: 1px solid transparent;
+ min-width: 300px;
+ border-radius: 3px 3px 0 0;
+}
+#qr > form {
+ /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
+ max-height: 85vh;
+ max-height: calc(100vh - 75px);
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+#qrtab {
+ border-radius: 3px 3px 0 0;
+}
+#qrtab {
+ margin-bottom: 1px;
+}
+#qr .close {
+ float: right;
+ padding: 0 3px;
+}
+.qr-link-container {
+ text-align: center;
+ margin: 16px 0;
+}
+.qr-link-container-bottom {
+ width: 200px;
+ position: absolute;
+ left: -100px;
+ margin-left: 50%;
+ text-align: center;
+}
+.qr-link {
+ border-radius: 3px;
+ padding: 6px 10px 5px;
+ font-weight: bold;
+ vertical-align: middle;
+ border-style: solid;
+ border-width: 1px;
+ font-size: 10pt;
+}
+.qr-link-container + #togglePostFormLink {
+ font-size: 10pt;
+ font-weight: normal;
+ margin: -8px 0 3.5px;
+}
+.persona {
+ width: 100%;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+}
+.persona .field {
+ -webkit-flex: 1;
+ flex: 1;
+ width: 0;
+}
+#qr.forced-anon input[data-name="name"]:not(.force-show),
+#qr.forced-anon input[data-name="sub"]:not(.force-show),
+#qr.reply-to-thread input[data-name="sub"]:not(.force-show),
+body:not(.board_f) #qr select[name="filetag"],
+#qr.reply-to-thread select[name="filetag"],
+#qr:not(.has-sjis) #sjis-toggle,
+#qr:not(.has-math) #tex-preview-button,
+#qr.tex-preview .textarea > :not(#tex-preview),
+#qr:not(.tex-preview) #tex-preview {
+ display: none;
+}
+.persona button {
+ -webkit-flex: 0 0 23px;
+ flex: 0 0 23px;
+ -webkit-align-self: stretch;
+ align-self: stretch;
+ border: 1px solid #BBB;
+ padding: 0;
+ background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;
+ color: #000;
+}
+#qr.sjis-preview #sjis-toggle, #qr.tex-preview #tex-preview-button {
+ background: #DCDCDC;
+}
+#sjis-toggle, #qr.sjis-preview textarea.field {
+ font-family: "IPAMonaPGothic","Mona","MS PGothic",monospace;
+ font-size: 16px;
+ line-height: 17px;
+}
+#tex-preview-button {
+ font-size: 10px;
+}
+#tex-preview {
+ white-space: pre-line;
+}
+#qr textarea.field {
+ height: 14.8em;
+ min-height: 9em;
+}
+#qr.has-captcha textarea.field {
+ height: 9em;
+}
+input.field.tripped:not(:hover):not(:focus) {
+ color: transparent !important;
+ text-shadow: none !important;
+}
+#qr textarea {
+ min-width: 300px;
+ resize: both;
+}
+.field {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ margin: 0px;
+ padding: 2px 4px 3px;
+}
+#qr label input[type="checkbox"] {
+ position: relative;
+ top: 2px;
+}
+
+/* Recaptcha v2 */
+#qr .captcha-root {
+ position: relative;
+}
+#qr .captcha-container > div {
+ margin: auto;
+ width: 304px;
+}
+/* XXX scrollable with scroll bar hidden; prevents scroll on space press */
+:root.ua-blink #qr .captcha-container > div,
+:root.ua-edge #qr .captcha-container > div {
+ overflow: hidden;
+}
+:root.ua-blink #qr .captcha-container > div > div:first-of-type,
+:root.ua-edge #qr .captcha-container > div > div:first-of-type {
+ overflow-y: scroll;
+ overflow-x: hidden;
+ padding-right: 30px;
+ height: 99%;
+ width: 100%;
+}
+#qr .captcha-counter {
+ display: block;
+ width: 100%;
+ text-align: center;
+ pointer-events: none;
+}
+#qr.captcha-open .captcha-counter {
+ position: absolute;
+ bottom: 3px;
+}
+#qr .captcha-counter > a {
+ pointer-events: auto;
+ display: inline-block; /* XXX https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8851747/ */
+}
+#qr:not(.captcha-open) .captcha-counter > a {
+ display: block;
+ width: 100%;
+}
+#qr.captcha-v2 #qr-captcha-iframe {
+ width: 302px;
+ height: 423px;
+ border: 0;
+ display: block;
+ margin: auto;
+}
+.goog-bubble-content {
+ max-width: 100vw;
+ max-height: 100vh;
+ overflow: auto;
+}
+.goog-bubble-content iframe {
+ position: static !important;
+}
+
+/* File Input, Submit Button, Oekaki */
+#file-n-submit, #qr .oekaki {
+ display: -webkit-flex;
+ display: flex;
+ -webkit-align-items: stretch;
+ align-items: stretch;
+ height: 25px;
+ margin-top: 1px;
+}
+#file-n-submit > input, #qr-draw-button {
+ background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;
+ border: 1px solid #BBB;
+ border-radius: 2px;
+ height: 100%;
+}
+#qr-file-button, #qr-draw-button {
+ width: 15%;
+}
+#file-n-submit input[type="submit"] {
+ width: 25%;
+}
+#qr-filename-container {
+ -webkit-flex: 1 1 auto;
+ flex: 1 1 auto;
+ width: 0;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-align-items: center;
+ align-items: center;
+ position: relative;
+ padding: 1px;
+}
+input#qr-filename {
+ border: none !important;
+ background: none !important;
+ outline: none;
+}
+#qr-filename,
+.has-file #qr-no-file {
+ display: none;
+}
+#qr-no-file,
+.has-file #qr-filename {
+ -webkit-flex: 1 1 auto;
+ flex: 1 1 auto;
+ width: 0px; /* XXX Fixes filename not shrinking to allow space for buttons in Edge */
+ display: inline-block;
+ padding: 0;
+ padding-left: 3px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+#qr-no-file {
+ color: #AAA;
+}
+#qr .oekaki.has-file {
+ display: none;
+}
+#qr .oekaki > label {
+ -webkit-flex: 1 1 auto;
+ flex: 1 1 auto;
+ width: 0;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-align-items: center;
+ align-items: center;
+ height: 100%;
+}
+#qr .oekaki > label > span {
+ margin: 0 3px;
+}
+#qr .oekaki > label > input {
+ -webkit-flex: 1 1 auto;
+ flex: 1 1 auto;
+ width: 0;
+ height: 100%;
+}
+#qr .oekaki-bg {
+ position: relative;
+ display: inline-block;
+ height: 100%;
+ width: 10%;
+ margin-left: 3px;
+}
+#qr .oekaki-bg > * {
+ position: absolute;
+ top: 0;
+ left: 0;
+ margin: 0;
+}
+#qr .oekaki-bg > :not([name="oekaki-bgcolor"]) {
+ z-index: 1;
+}
+#qr [name="oekaki-bgcolor"] {
+ height: 100%;
+ width: 100%;
+ border: none;
+ padding: 0;
+}
+#qr [name="oekaki-bg"]:not(:checked) ~ [name="oekaki-bgcolor"] {
+ visibility: hidden;
+}
+#qr input[type="file"] {
+ visibility: hidden;
+ position: absolute;
+}
+
+/* Spoiler Checkbox, QR Icons */
+#qr-filename-container > label, #qr-filename-container > a {
+ -webkit-flex: none;
+ flex: none;
+ margin: 0;
+ margin-right: 3px;
+}
+#qr:not(.has-spoiler) #qr-spoiler-label,
+#file-n-submit:not(.has-file) #qr-spoiler-label,
+.has-file #paste-area,
+.has-file #url-button,
+#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {
+ display: none;
+}
+#qr-filename-container > label {
+ position: relative;
+}
+#qr-filename-container input[type="checkbox"] {
+ margin: 0;
+}
+.checkbox-letter {
+ font-size: 13px;
+ font-weight: bold;
+}
+#qr-filename-container label:not(:hover) > input[type="checkbox"]:not(:focus):not(:checked),
+#qr-filename-container label:not(:hover) > input[type="checkbox"]:not(:focus):not(:checked) ~ :not(.checkbox-letter),
+#qr-filename-container label:hover > .checkbox-letter,
+input[type="checkbox"]:focus ~ .checkbox-letter,
+input[type="checkbox"]:checked ~ .checkbox-letter {
+ /* not displayed but still focusable */
+ position: absolute;
+ opacity: 0;
+ pointer-events: none;
+}
+.checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button {
+ opacity: 0.6;
+}
+#paste-area {
+ font-size: 0;
+}
+#paste-area:focus {
+ opacity: 1;
+}
+#custom-cooldown-button.disabled {
+ opacity: 0.27;
+}
+
+/* Thread and Flash Tag Select */
+#qr select {
+ background: white;
+ border: 1px solid #CCC;
+}
+#qr select[data-name="thread"] {
+ float: right;
+}
+#qr > form > select {
+ margin-top: 1px;
+}
+
+/* Dumping UI */
+.dump #dump-list-container {
+ display: block;
+}
+#dump-list-container {
+ display: none;
+ position: relative;
+ overflow-y: hidden;
+ margin-top: 1px;
+}
+#dump-list {
+ overflow-x: auto;
+ overflow-y: auto;
+ white-space: nowrap;
+ width: 248px;
+ max-height: 248px;
+ min-height: 90px;
+ max-width: 100%;
+ min-width: 100%;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-wrap: wrap;
+ flex-wrap: wrap;
+}
+#dump-list:hover {
+ overflow-x: auto;
+}
+.qr-preview {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ counter-increment: thumbnails;
+ cursor: move;
+ display: inline-block;
+ height: 90px;
+ width: 90px;
+ padding: 2px;
+ opacity: .5;
+ overflow: hidden;
+ position: relative;
+ text-shadow: 0 0 2px #000;
+ -webkit-transition: opacity .25s ease-in-out, -webkit-transform .25s ease-in-out;
+ transition: opacity .25s ease-in-out, transform .25s ease-in-out, -webkit-transform .25s ease-in-out;
+ vertical-align: top;
+ background-size: cover;
+ -webkit-flex: none;
+ flex: none;
+}
+.qr-preview:hover,
+.qr-preview:focus {
+ opacity: .9;
+}
+.qr-preview::before {
+ content: counter(thumbnails);
+ color: #fff;
+ position: absolute;
+ top: 3px;
+ right: 3px;
+ text-shadow: 0 0 3px #000, 0 0 8px #000;
+}
+.qr-preview#selected {
+ opacity: 1;
+}
+.qr-preview.drag {
+ box-shadow: 0 0 10px rgba(0,0,0,.5);
+ -webkit-transform: scale(.8);
+ transform: scale(.8);
+}
+.qr-preview.over {
+ border-color: #fff;
+ -webkit-transform: scale(1.1);
+ transform: scale(1.1);
+ opacity: 0.9;
+ z-index: 10;
+}
+.qr-preview > span {
+ color: #fff;
+}
+.remove {
+ background: none;
+ color: #e00;
+ padding: 1px;
+}
+a:only-of-type > .remove {
+ display: none;
+}
+.remove:hover::after {
+ content: " Remove";
+}
+.qr-preview:not(.has-file) label,
+#qr:not(.has-spoiler) .qr-preview-spoiler {
+ display: none;
+}
+.qr-preview > label {
+ background: rgba(0,0,0,.5);
+ color: #fff;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ position: absolute;
+ text-align: center;
+}
+.qr-preview > label > input {
+ margin: 0;
+}
+#add-post {
+ cursor: pointer;
+ font-size: 2em;
+ position: absolute;
+ bottom: 20px;
+ right: 10px;
+ -webkit-transform: translateY(-50%);
+ transform: translateY(-50%);
+}
+.textarea {
+ position: relative;
+ display: -webkit-flex;
+ display: flex;
+}
+#char-count {
+ color: #000;
+ background: hsla(0, 0%, 100%, .5);
+ font-size: 8pt;
+ position: absolute;
+ bottom: 1px;
+ right: 1px;
+ pointer-events: none;
+}
+#char-count.warning {
+ color: red;
+}
+
+/* Menu */
+.menu-button:not(.fa-bars) {
+ display: inline-block;
+ position: relative;
+ cursor: pointer;
+}
+#header-bar .menu-button i {
+ border-top: 6px solid;
+ border-right: 4px solid transparent;
+ border-left: 4px solid transparent;
+ display: inline-block;
+ margin: 2px;
+ vertical-align: middle;
+}
+.postInfo > .menu-button,
+#thread-watcher .menu-button {
+ width: 18px;
+ height: 15px;
+ text-align: center;
+}
+#menu {
+ position: fixed;
+ outline: none;
+ font-weight: normal;
+}
+#menu, .submenu {
+ border-radius: 3px;
+ padding-top: 1px;
+ padding-bottom: 3px;
+}
+.entry {
+ cursor: pointer;
+ display: block;
+ outline: none;
+ padding: 2px 10px;
+ position: relative;
+ text-decoration: none;
+ white-space: nowrap;
+ min-width: 70px;
+ text-align: left;
+ text-shadow: none;
+ font-size: 10pt;
+}
+.left>.entry.has-submenu {
+ padding-right: 17px !important;
+}
+.entry input[type="checkbox"],
+.entry input[type="radio"] {
+ margin: 0px;
+ position: relative;
+ top: 2px;
+}
+.entry input[type="number"] {
+ width: 4.5em;
+}
+.entry.has-shortcut-text {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+.entry .shortcut-text {
+ opacity: 0.5;
+ font-size: 70%;
+ margin-left: 5px;
+}
+.has-submenu::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;
+}
+.left .has-submenu::after {
+ border-left: 0;
+ border-right: .5em solid;
+}
+.submenu {
+ display: none;
+ position: absolute;
+ left: 100%;
+ top: -1px;
+ margin-left: 0px;
+ margin-top: -2px;
+}
+.focused > .submenu {
+ display: block;
+}
+.imp-exp-result {
+ position: absolute;
+ text-align: center;
+ margin: auto;
+ right: 0px;
+ left: 0px;
+ width: 200px;
+}
+
+/* Custom Board Titles */
+.boardTitle, .boardSubtitle {
+ white-space: pre-line;
+}
+.boardTitle[contenteditable="true"],
+.boardSubtitle[contenteditable="true"] {
+ cursor: text !important;
+}
+
+/* Embedding */
+.embedder:not(.embedded) > span {
+ display: none;
+}
+#embedding {
+ padding: 1px 4px 1px 4px;
+ position: fixed;
+}
+#embedding.empty {
+ display: none;
+}
+#embedding > div:first-child {
+ display: -webkit-flex;
+ display: flex;
+}
+#embedding .move {
+ -webkit-flex: 1;
+ flex: 1;
+}
+#embedding .jump {
+ margin: -1px 4px;
+ text-decoration: none;
+}
+
+/* Gallery */
+#a-gallery {
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ background: rgba(0,0,0,0.7);
+}
+.gal-viewport {
+ display: -webkit-flex;
+ display: flex;
+ -webkit-align-items: stretch;
+ align-items: stretch;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ -webkit-flex: 1 1 auto;
+ flex: 1 1 auto;
+ overflow: hidden;
+}
+.gal-thumbnails {
+ -webkit-flex: 0 0 150px;
+ flex: 0 0 150px;
+ overflow-y: auto;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ -webkit-align-items: stretch;
+ align-items: stretch;
+ text-align: center;
+ background: rgba(0,0,0,.5);
+ border-left: 1px solid #222;
+}
+.gal-hide-thumbnails .gal-thumbnails {
+ display: none;
+}
+.gal-thumb img,
+.gal-thumb video {
+ max-width: 125px;
+ max-height: 125px;
+ height: auto;
+ width: auto;
+}
+.gal-thumb {
+ -webkit-flex: 0 0 auto;
+ flex: 0 0 auto;
+ padding: 3px;
+ line-height: 0;
+ transition: background .2s linear;
+}
+.gal-highlight {
+ background: rgba(0, 190, 255,.8);
+}
+.gal-prev {
+ border-right: 1px solid #222;
+}
+.gal-next {
+ border-left: 1px solid #222;
+}
+.gal-prev,
+.gal-next {
+ -webkit-flex: 0 0 20px;
+ flex: 0 0 20px;
+ position: relative;
+ cursor: pointer;
+ opacity: 0.7;
+ background-color: rgba(0, 0, 0, 0.3);
+}
+.gal-prev:hover,
+.gal-next:hover {
+ opacity: 1;
+}
+.gal-prev::after,
+.gal-next::after {
+ position: absolute;
+ top: 48.6%;
+ -webkit-transform: translateY(-50%);
+ transform: translateY(-50%);
+ display: inline-block;
+ border-top: 11px solid transparent;
+ border-bottom: 11px solid transparent;
+ content: "";
+}
+.gal-prev::after {
+ border-right: 12px solid #fff;
+ right: 5px;
+}
+.gal-next::after {
+ border-left: 12px solid #fff;
+ right: 3px;
+}
+.gal-image {
+ -webkit-flex: 1 0 auto;
+ flex: 1 0 auto;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-align-items: flex-start;
+ align-items: flex-start;
+ -webkit-justify-content: space-around;
+ justify-content: space-around;
+ overflow: hidden;
+ /* Flex > Non-Flex child max-width and overflow fix (Firefox only?) */
+ width: 1%;
+}
+:root:not(.gal-fit-height):not(.gal-pdf) .gal-image {
+ overflow-y: scroll !important;
+}
+:root:not(.gal-fit-width):not(.gal-pdf) .gal-image {
+ overflow-x: scroll !important;
+}
+.gal-image a {
+ display: -webkit-flex;
+ display: flex;
+ -webkit-align-items: flex-start;
+ align-items: flex-start;
+ margin: auto;
+ line-height: 0;
+ max-width: 100%;
+}
+:root.gal-pdf .gal-image a {
+ width: 100%;
+ height: 100%;
+}
+.gal-image img,
+.gal-image video {
+ -webkit-flex: none;
+ flex: none;
+}
+.gal-fit-width .gal-image img,
+.gal-fit-width .gal-image video {
+ max-width: 100%;
+}
+.gal-fit-height .gal-image img,
+.gal-fit-height .gal-image video {
+ /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */
+ max-height: 95vh;
+ max-height: calc(100vh - 25px);
+}
+.gal-image iframe {
+ width: 100%;
+ height: 100%;
+}
+.gal-buttons {
+ font-size: 2em;
+ margin-right: 3px;
+ padding-left: 7px;
+ padding-right: 7px;
+ top: 5px;
+}
+:root.gal-pdf .gal-buttons {
+ top: 40px;
+ background: rgba(0,0,0,0.6) !important;
+ border-radius: 3px;
+}
+.gal-buttons a {
+ color: #ffffff;
+ text-shadow: 0px 0px 1px #000000;
+}
+.gal-buttons i {
+ display: inline-block;
+ margin: 2px;
+ position: relative;
+}
+.gal-start i {
+ border-left: 10px solid;
+ border-top: 6px solid transparent;
+ border-bottom: 6px solid transparent;
+ bottom: 1px;
+}
+.gal-stop i {
+ border: 5px solid;
+ bottom: 2px;
+}
+.gal-buttons.gal-playing > .gal-start,
+.gal-buttons:not(.gal-playing) > .gal-stop {
+ display: none;
+}
+.gal-buttons .menu-button i {
+ border-top: 10px solid;
+ border-right: 6px solid transparent;
+ border-left: 6px solid transparent;
+ bottom: 2px;
+ vertical-align: baseline;
+}
+.gal-labels {
+ position: fixed;
+ bottom: 6px;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ -webkit-align-items: flex-end;
+ align-items: flex-end;
+
+}
+:root:not(.show-sauce) .gal-sauce {
+ display: none;
+}
+.gal-name,
+.gal-count,
+.gal-sauce {
+ background: rgba(0,0,0,0.6) !important;
+ border-radius: 3px;
+ padding: 1px 5px 2px 5px;
+ margin-top: 3px;
+ color: #ffffff !important;
+ text-decoration: none !important;
+}
+.gal-sauce a {
+ color: #ffffff !important;
+}
+.gal-name:hover,
+.gal-buttons a:hover,
+.gal-sauce a:hover {
+ color: rgb(95, 95, 101) !important;
+}
+:root.gal-pdf .gal-buttons a:hover {
+ color: rgb(204, 204, 204) !important;
+}
+.gal-buttons,
+.gal-labels {
+ position: fixed;
+ right: 195px;
+}
+.gal-hide-thumbnails .gal-buttons,
+.gal-hide-thumbnails .gal-labels {
+ right: 44px;
+}
+:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels {
+ bottom: 23px !important;
+}
+:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,
+:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels {
+ right: 178px !important;
+}
+:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,
+:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels {
+ right: 28px !important;
+}
+:root.gallery-open.fixed #header-bar:not(.autohide),
+:root.gallery-open.fixed #header-bar:not(.autohide) #shortcuts .fa::before {
+ visibility: hidden;
+}
+
+/* Mod Contact Links */
+.contact-links {
+ margin-left: 2px;
+}
+.move-note > a {
+ text-decoration: underline;
+}
+.invisible {
+ font-size: 0;
+}
+
+/* PostJumper */
+.postJumper > .prev,
+.postJumper > .next {
+ font-size: 120%;
+}
+
+/* PSA */
+.fcx-announcement {
+ text-align: center;
+}
+.fcx-announcement a {
+ text-decoration: underline;
+}
+
+@keyframes spin {
+ 0% {transform:rotate(0deg);}
+ 100% {transform:rotate(359deg);}
+}
+
+.spin {
+ animation:spin 2s infinite linear;
+}
`;
- var supports = `/* XXX Moved to end of stylesheet to avoid breaking whole stylesheet in Maxthon. */
-@supports (text-decoration-style: dashed) or (-moz-text-decoration-style: dashed) {
- .quotelink.forwardlink,
- .backlink.forwardlink {
- text-decoration: underline;
- -moz-text-decoration-style: dashed;
- text-decoration-style: dashed;
- border-bottom: none;
- }
-}
+ var supports = `/* XXX Moved to end of stylesheet to avoid breaking whole stylesheet in Maxthon. */
+@supports (text-decoration-style: dashed) or (-moz-text-decoration-style: dashed) {
+ .quotelink.forwardlink,
+ .backlink.forwardlink {
+ text-decoration: underline;
+ -moz-text-decoration-style: dashed;
+ text-decoration-style: dashed;
+ border-bottom: none;
+ }
+}
`;
- var tomorrow = `/* General */
-:root.tomorrow .dialog {
- background-color: #282A2E;
- border-color: #111;
-}
-
-/* 4chan style fixes */
-:root.tomorrow #arc-list span.quote {
- color: #B5BD68;
-}
-:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {
- border-left: 3px solid rgba(145, 182, 214, .8) !important;
-}
-:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {
- border-left: 3px dashed rgba(145, 182, 214, .8) !important;
-}
-
-/* Header */
-:root.tomorrow #header-bar.dialog {
- background-color: rgba(40,42,46,0.9);
-}
-:root.tomorrow:not(.fixed) #header-bar, :root.tomorrow #notifications {
- font-size: 9pt;
-}
-:root.tomorrow #header-bar, :root.tomorrow #notifications {
- color: #C5C8C6;
-}
-:root.tomorrow #header-bar a, :root.tomorrow #notifications a {
- color: #81A2BE;
-}
-:root.tomorrow.shortcut-icons .native-settings {
- background-image: url('//s.4cdn.org/image/favicon-ws.ico');
-}
-
-/* Settings */
-:root.tomorrow #fourchanx-settings fieldset, :root.tomorrow .section-main div::before {
- border-color: #111;
-}
-:root.tomorrow .suboption-list > div:last-of-type {
- background-color: #282A2E;
-}
-
-/* Catalog */
-:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post {
- background-color: #282A2E;
-}
-:root.tomorrow.werkTyme .catalog-thread:not(:hover),
-:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread,
-:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post,
-:root.tomorrow.catalog-hover-expand .catalog-container:hover .catalog-reply {
- border-color: #111;
-}
-
-/* Quote */
-:root.tomorrow .backlink.deadlink {
- color: #81A2BE !important;
-}
-:root.tomorrow .inline {
- border-color: #111;
- background-color: rgba(0, 0, 0, .14);
-}
-
-/* Fappe and Werk Tyme */
-:root.tomorrow .indicator {
- color: #282A2E;
-}
-
-/* Highlighting */
-:root.tomorrow .qphl {
- outline: 2px solid rgba(145, 182, 214, .8);
-}
-:root.tomorrow.highlight-you .quotesYou$site$highlightable$op,
-:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {
- border-left: 3px solid rgba(145, 182, 214, .8);
-}
-:root.tomorrow.highlight-own .yourPost$site$highlightable$op,
-:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {
- border-left: 3px dashed rgba(145, 182, 214, .8);
-}
-:root.tomorrow .filter-highlight$site$highlightable$op,
-:root.tomorrow .filter-highlight$site$highlightable$reply {
- box-shadow: inset 5px 0 rgba(145, 182, 214, .5);
-}
-:root.tomorrow.highlight-own .yourPost > $site$sideArrows,
-:root.tomorrow.highlight-you .quotesYou > $site$sideArrows,
-:root.tomorrow .filter-highlight > $site$sideArrows {
- color: rgb(155, 185, 210);
-}
-:root.tomorrow .catalog-thread.filter-highlight .catalog-thumb,
-:root.tomorrow.werkTyme .catalog-thread.filter-highlight:not(:hover),
-:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,
-:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post {
- box-shadow: 0 0 3px 3px rgba(64, 192, 255, .7);
-}
-:root.tomorrow .catalog-thread.watched .catalog-thumb,
-:root.tomorrow.werkTyme .catalog-thread.watched:not(:hover),
-:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,
-:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {
- border: 2px solid rgb(64, 192, 255);
-}
-
-
-/* QR */
-.tomorrow #dump-list::-webkit-scrollbar-thumb {
- background-color: #282A2E;
- border-color: #111;
-}
-:root.tomorrow .qr-preview {
- background-color: rgba(255, 255, 255, .15);
-}
-:root.tomorrow #qr .field {
- background-color: rgb(26, 27, 29);
- color: rgb(197,200,198);
- border-color: rgb(40, 41, 42);
-}
-:root.tomorrow #qr .field:focus,
-:root.tomorrow #qr .field.focus {
- border-color: rgb(129, 162, 190) !important;
- background-color: rgb(30,32,36);
-}
-:root.tomorrow .persona button {
- background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;
- color: rgb(197,200,198);
- border-color: rgb(40, 41, 42);
- outline: none;
-}
-:root.tomorrow .persona button::-moz-focus-inner {
- border: none;
-}
-:root.tomorrow .persona button:focus {
- border-color: rgb(129, 162, 190);
-}
-:root.tomorrow #qr.sjis-preview #sjis-toggle,
-:root.tomorrow #qr.tex-preview #tex-preview-button {
- background: rgb(26, 27, 29);
-}
-:root.tomorrow #qr select,
-:root.tomorrow #file-n-submit > input,
-:root.tomorrow #qr-draw-button {
- border-color: rgb(40, 41, 42);
-}
-:root.tomorrow #qr-filename {
- color: rgb(197,200,198);
-}
-:root.tomorrow .qr-link {
- border-color: rgb(25, 27, 31) rgb(25, 27, 31) rgb(10, 12, 16);
- background: linear-gradient(#37393D, #282A2E) repeat scroll 0% 0% transparent;
-}
-:root.tomorrow .qr-link:hover {
- background: #282A2E;
-}
-
-/* Menu */
-:root.tomorrow #menu {
- color: #C5C8C6;
-}
-:root.tomorrow .entry {
- font-size: 10pt;
-}
-:root.tomorrow .focused.entry {
- background: rgba(0, 0, 0, .33);
-}
-
-/* Unread */
-:root.tomorrow .unread-line {
- border-color: rgb(197, 200, 198);
-}
-:root.tomorrow .unread-mark-read {
- background-color: rgba(40,42,46,0.5);
-}
-
-/* Thread Watcher */
-:root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.replies-quoting-you, :root.tomorrow .last-page > a > .watcher-page {
- color: #F00 !important;
-}
-
-/* Watcher Favicon */
-:root.tomorrow .watch-thread-link
-{
- background-image: url("data:image/svg+xml,
");
-}
+ var tomorrow = `/* General */
+:root.tomorrow .dialog {
+ background-color: #282A2E;
+ border-color: #111;
+}
+
+/* 4chan style fixes */
+:root.tomorrow #arc-list span.quote {
+ color: #B5BD68;
+}
+:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {
+ border-left: 3px solid rgba(145, 182, 214, .8) !important;
+}
+:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {
+ border-left: 3px dashed rgba(145, 182, 214, .8) !important;
+}
+
+/* Header */
+:root.tomorrow #header-bar.dialog {
+ background-color: rgba(40,42,46,0.9);
+}
+:root.tomorrow:not(.fixed) #header-bar, :root.tomorrow #notifications {
+ font-size: 9pt;
+}
+:root.tomorrow #header-bar, :root.tomorrow #notifications {
+ color: #C5C8C6;
+}
+:root.tomorrow #header-bar a, :root.tomorrow #notifications a {
+ color: #81A2BE;
+}
+:root.tomorrow.shortcut-icons .native-settings {
+ background-image: url('//s.4cdn.org/image/favicon-ws.ico');
+}
+
+/* Settings */
+:root.tomorrow #fourchanx-settings fieldset, :root.tomorrow .section-main div::before {
+ border-color: #111;
+}
+:root.tomorrow .suboption-list > div:last-of-type {
+ background-color: #282A2E;
+}
+
+/* Catalog */
+:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post {
+ background-color: #282A2E;
+}
+:root.tomorrow.werkTyme .catalog-thread:not(:hover),
+:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread,
+:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post,
+:root.tomorrow.catalog-hover-expand .catalog-container:hover .catalog-reply {
+ border-color: #111;
+}
+
+/* Quote */
+:root.tomorrow .backlink.deadlink {
+ color: #81A2BE !important;
+}
+:root.tomorrow .inline {
+ border-color: #111;
+ background-color: rgba(0, 0, 0, .14);
+}
+
+/* Fappe and Werk Tyme */
+:root.tomorrow .indicator {
+ color: #282A2E;
+}
+
+/* Highlighting */
+:root.tomorrow .qphl {
+ outline: 2px solid rgba(145, 182, 214, .8);
+}
+:root.tomorrow.highlight-you .quotesYou$site$highlightable$op,
+:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {
+ border-left: 3px solid rgba(145, 182, 214, .8);
+}
+:root.tomorrow.highlight-own .yourPost$site$highlightable$op,
+:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {
+ border-left: 3px dashed rgba(145, 182, 214, .8);
+}
+:root.tomorrow .filter-highlight$site$highlightable$op,
+:root.tomorrow .filter-highlight$site$highlightable$reply {
+ box-shadow: inset 5px 0 rgba(145, 182, 214, .5);
+}
+:root.tomorrow.highlight-own .yourPost > $site$sideArrows,
+:root.tomorrow.highlight-you .quotesYou > $site$sideArrows,
+:root.tomorrow .filter-highlight > $site$sideArrows {
+ color: rgb(155, 185, 210);
+}
+:root.tomorrow .catalog-thread.filter-highlight .catalog-thumb,
+:root.tomorrow.werkTyme .catalog-thread.filter-highlight:not(:hover),
+:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,
+:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post {
+ box-shadow: 0 0 3px 3px rgba(64, 192, 255, .7);
+}
+:root.tomorrow .catalog-thread.watched .catalog-thumb,
+:root.tomorrow.werkTyme .catalog-thread.watched:not(:hover),
+:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,
+:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {
+ border: 2px solid rgb(64, 192, 255);
+}
+
+
+/* QR */
+.tomorrow #dump-list::-webkit-scrollbar-thumb {
+ background-color: #282A2E;
+ border-color: #111;
+}
+:root.tomorrow .qr-preview {
+ background-color: rgba(255, 255, 255, .15);
+}
+:root.tomorrow #qr .field {
+ background-color: rgb(26, 27, 29);
+ color: rgb(197,200,198);
+ border-color: rgb(40, 41, 42);
+}
+:root.tomorrow #qr .field:focus,
+:root.tomorrow #qr .field.focus {
+ border-color: rgb(129, 162, 190) !important;
+ background-color: rgb(30,32,36);
+}
+:root.tomorrow .persona button {
+ background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;
+ color: rgb(197,200,198);
+ border-color: rgb(40, 41, 42);
+ outline: none;
+}
+:root.tomorrow .persona button::-moz-focus-inner {
+ border: none;
+}
+:root.tomorrow .persona button:focus {
+ border-color: rgb(129, 162, 190);
+}
+:root.tomorrow #qr.sjis-preview #sjis-toggle,
+:root.tomorrow #qr.tex-preview #tex-preview-button {
+ background: rgb(26, 27, 29);
+}
+:root.tomorrow #qr select,
+:root.tomorrow #file-n-submit > input,
+:root.tomorrow #qr-draw-button {
+ border-color: rgb(40, 41, 42);
+}
+:root.tomorrow #qr-filename {
+ color: rgb(197,200,198);
+}
+:root.tomorrow .qr-link {
+ border-color: rgb(25, 27, 31) rgb(25, 27, 31) rgb(10, 12, 16);
+ background: linear-gradient(#37393D, #282A2E) repeat scroll 0% 0% transparent;
+}
+:root.tomorrow .qr-link:hover {
+ background: #282A2E;
+}
+
+/* Menu */
+:root.tomorrow #menu {
+ color: #C5C8C6;
+}
+:root.tomorrow .entry {
+ font-size: 10pt;
+}
+:root.tomorrow .focused.entry {
+ background: rgba(0, 0, 0, .33);
+}
+
+/* Unread */
+:root.tomorrow .unread-line {
+ border-color: rgb(197, 200, 198);
+}
+:root.tomorrow .unread-mark-read {
+ background-color: rgba(40,42,46,0.5);
+}
+
+/* Thread Watcher */
+:root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.replies-quoting-you, :root.tomorrow .last-page > a > .watcher-page {
+ color: #F00 !important;
+}
+
+/* Watcher Favicon */
+:root.tomorrow .watch-thread-link
+{
+ background-image: url("data:image/svg+xml,
");
+}
`;
- var www = `#captcha-cnt {
- height: auto;
-}
-:root:not(.js-enabled) #form {
- display: block;
-}
-#bd > div[style], #bd > div[style] > * {
- height: auto !important;
- margin: 0 !important;
- font-size: 0;
-}
+ var www = `#captcha-cnt {
+ height: auto;
+}
+:root:not(.js-enabled) #form {
+ display: block;
+}
+#bd > div[style], #bd > div[style] > * {
+ height: auto !important;
+ margin: 0 !important;
+ font-size: 0;
+}
`;
- var yotsubaB = `/* General */
-:root.yotsuba-b .dialog {
- background-color: #D6DAF0;
- border-color: #B7C5D9;
-}
-:root.yotsuba-b .field:focus,
-:root.yotsuba-b .field.focus {
- border-color: #98E;
-}
-
-/* 4chan style fixes */
-:root.yotsuba-b.highlight-you .quotesYou$site$highlightable$reply {
- border-left: 3px solid rgba(221, 0, 0, .8) !important;
-}
-:root.yotsuba-b.highlight-own .yourPost$site$highlightable$reply {
- border-left: 3px dashed rgba(221, 0, 0, .8) !important;
-}
-
-/* Header */
-:root.yotsuba-b #header-bar.dialog {
- background-color: rgba(214,218,240,0.98);
-}
-:root.yotsuba-b:not(.fixed) #header-bar, :root.yotsuba-b #notifications {
- font-size: 9pt;
-}
-:root.yotsuba-b #header-bar, :root.yotsuba-b #notifications {
- color: #89A;
-}
-:root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a {
- color: #34345C;
-}
-
-/* Settings */
-:root.yotsuba-b #fourchanx-settings fieldset, :root.yotsuba-b .section-main div::before {
- border-color: #B7C5D9;
-}
-:root.yotsuba-b .suboption-list > div:last-of-type {
- background-color: #D6DAF0;
-}
-
-/* Catalog */
-:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post {
- background-color: #D6DAF0;
-}
-:root.yotsuba-b.werkTyme .catalog-thread:not(:hover),
-:root.yotsuba-b.werkTyme:not(.catalog-hover-expand) .catalog-thread,
-:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post,
-:root.yotsuba-b.catalog-hover-expand .catalog-container:hover .catalog-reply {
- border-color: #B7C5D9;
-}
-
-/* Quote */
-:root.yotsuba-b .backlink.deadlink {
- color: #34345C !important;
-}
-:root.yotsuba-b .inline {
- border-color: #B7C5D9;
- background-color: rgba(255, 255, 255, .14);
-}
-
-/* Fappe and Werk Tyme */
-:root.yotsuba-b .indicator {
- color: #D6DAF0;
-}
-
-/* QR */
-.yotsuba-b #dump-list::-webkit-scrollbar-thumb {
- background-color: #D6DAF0;
- border-color: #B7C5D9;
-}
-:root.yotsuba-b .qr-preview {
- background-color: rgba(0, 0, 0, .15);
-}
-:root.yotsuba-b .qr-link {
- border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);
- background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;
-}
-:root.yotsuba-b .qr-link:hover {
- background: #D9DDF3;
-}
-
-
-/* Menu */
-:root.yotsuba-b #menu {
- color: #000;
-}
-:root.yotsuba-b .entry {
- font-size: 10pt;
-}
-:root.yotsuba-b .focused.entry {
- background: rgba(255, 255, 255, .33);
-}
-
-/* Unread */
-:root.yotsuba-b .unread-mark-read {
- background-color: rgba(214,218,240,0.5);
-}
-
-/* Thread Watcher */
-:root.yotsuba-b .replies-quoting-you > a, :root.yotsuba-b #watcher-link.replies-quoting-you {
- color: #F00;
-}
-
-/* Watcher Favicon */
-:root.yotsuba-b .watch-thread-link
-{
- background-image: url("data:image/svg+xml,
");
-}
+ var yotsubaB = `/* General */
+:root.yotsuba-b .dialog {
+ background-color: #D6DAF0;
+ border-color: #B7C5D9;
+}
+:root.yotsuba-b .field:focus,
+:root.yotsuba-b .field.focus {
+ border-color: #98E;
+}
+
+/* 4chan style fixes */
+:root.yotsuba-b.highlight-you .quotesYou$site$highlightable$reply {
+ border-left: 3px solid rgba(221, 0, 0, .8) !important;
+}
+:root.yotsuba-b.highlight-own .yourPost$site$highlightable$reply {
+ border-left: 3px dashed rgba(221, 0, 0, .8) !important;
+}
+
+/* Header */
+:root.yotsuba-b #header-bar.dialog {
+ background-color: rgba(214,218,240,0.98);
+}
+:root.yotsuba-b:not(.fixed) #header-bar, :root.yotsuba-b #notifications {
+ font-size: 9pt;
+}
+:root.yotsuba-b #header-bar, :root.yotsuba-b #notifications {
+ color: #89A;
+}
+:root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a {
+ color: #34345C;
+}
+
+/* Settings */
+:root.yotsuba-b #fourchanx-settings fieldset, :root.yotsuba-b .section-main div::before {
+ border-color: #B7C5D9;
+}
+:root.yotsuba-b .suboption-list > div:last-of-type {
+ background-color: #D6DAF0;
+}
+
+/* Catalog */
+:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post {
+ background-color: #D6DAF0;
+}
+:root.yotsuba-b.werkTyme .catalog-thread:not(:hover),
+:root.yotsuba-b.werkTyme:not(.catalog-hover-expand) .catalog-thread,
+:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post,
+:root.yotsuba-b.catalog-hover-expand .catalog-container:hover .catalog-reply {
+ border-color: #B7C5D9;
+}
+
+/* Quote */
+:root.yotsuba-b .backlink.deadlink {
+ color: #34345C !important;
+}
+:root.yotsuba-b .inline {
+ border-color: #B7C5D9;
+ background-color: rgba(255, 255, 255, .14);
+}
+
+/* Fappe and Werk Tyme */
+:root.yotsuba-b .indicator {
+ color: #D6DAF0;
+}
+
+/* QR */
+.yotsuba-b #dump-list::-webkit-scrollbar-thumb {
+ background-color: #D6DAF0;
+ border-color: #B7C5D9;
+}
+:root.yotsuba-b .qr-preview {
+ background-color: rgba(0, 0, 0, .15);
+}
+:root.yotsuba-b .qr-link {
+ border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);
+ background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;
+}
+:root.yotsuba-b .qr-link:hover {
+ background: #D9DDF3;
+}
+
+
+/* Menu */
+:root.yotsuba-b #menu {
+ color: #000;
+}
+:root.yotsuba-b .entry {
+ font-size: 10pt;
+}
+:root.yotsuba-b .focused.entry {
+ background: rgba(255, 255, 255, .33);
+}
+
+/* Unread */
+:root.yotsuba-b .unread-mark-read {
+ background-color: rgba(214,218,240,0.5);
+}
+
+/* Thread Watcher */
+:root.yotsuba-b .replies-quoting-you > a, :root.yotsuba-b #watcher-link.replies-quoting-you {
+ color: #F00;
+}
+
+/* Watcher Favicon */
+:root.yotsuba-b .watch-thread-link
+{
+ background-image: url("data:image/svg+xml,
");
+}
`;
- var yotsuba = `/* General */
-:root.yotsuba .dialog {
- background-color: #F0E0D6;
- border-color: #D9BFB7;
-}
-:root.yotsuba .field:focus,
-:root.yotsuba .field.focus {
- border-color: #EA8;
-}
-
-/* 4chan style fixes */
-:root.yotsuba.highlight-you .quotesYou$site$highlightable$reply {
- border-left: 3px solid rgba(221, 0, 0, .8) !important;
-}
-:root.yotsuba.highlight-own .yourPost$site$highlightable$reply {
- border-left: 3px dashed rgba(221, 0, 0, .8) !important;
-}
-
-/* Header */
-:root.yotsuba #header-bar.dialog {
- background-color: rgba(240,224,214,0.98);
-}
-:root.yotsuba:not(.fixed) #header-bar, :root.yotsuba #notifications {
- font-size: 9pt;
-}
-:root.yotsuba #header-bar, :root.yotsuba #notifications {
- color: #B86;
-}
-:root.yotsuba #board-list a, :root.yotsuba #shortcuts a {
- color: #800000;
-}
-
-/* Settings */
-:root.yotsuba #fourchanx-settings fieldset, :root.yotsuba .section-main div::before {
- border-color: #D9BFB7;
-}
-:root.yotsuba .suboption-list > div:last-of-type {
- background-color: #F0E0D6;
-}
-
-/* Catalog */
-:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post {
- background-color: #F0E0D6;
-}
-:root.yotsuba.werkTyme .catalog-thread:not(:hover),
-:root.yotsuba.werkTyme:not(.catalog-hover-expand) .catalog-thread,
-:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post,
-:root.yotsuba.catalog-hover-expand .catalog-container:hover .catalog-reply {
- border-color: #D9BFB7;
-}
-
-/* Quote */
-:root.yotsuba .backlink.deadlink {
- color: #00E !important;
-}
-:root.yotsuba .inline {
- border-color: #D9BFB7;
- background-color: rgba(255, 255, 255, .14);
-}
-
-/* Fappe and Werk Tyme */
-:root.yotsuba .indicator {
- color: #F0E0D6;
-}
-
-/* QR */
-.yotsuba #dump-list::-webkit-scrollbar-thumb {
- background-color: #F0E0D6;
- border-color: #D9BFB7;
-}
-:root.yotsuba .qr-preview {
- background-color: rgba(0, 0, 0, .15);
-}
-:root.yotsuba .qr-link {
- border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);
- background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;
-}
-:root.yotsuba .qr-link:hover {
- background: #F0E0D6;
-}
-
-/* Menu */
-:root.yotsuba #menu {
- color: #800000;
-}
-:root.yotsuba .entry {
- font-size: 10pt;
-}
-:root.yotsuba .focused.entry {
- background: rgba(255, 255, 255, .33);
-}
-
-/* Unread */
-:root.yotsuba .unread-mark-read {
- background-color: rgba(240,224,214,0.5);
-}
-
-/* Thread Watcher */
-:root.yotsuba .replies-quoting-you > a, :root.yotsuba #watcher-link.replies-quoting-you, :root.yotsuba .last-page > a > .watcher-page {
- color: #F00;
-}
-
-/* Watcher Favicon */
-:root.yotsuba .watch-thread-link
-{
- background-image: url("data:image/svg+xml,
");
-}
+ var yotsuba = `/* General */
+:root.yotsuba .dialog {
+ background-color: #F0E0D6;
+ border-color: #D9BFB7;
+}
+:root.yotsuba .field:focus,
+:root.yotsuba .field.focus {
+ border-color: #EA8;
+}
+
+/* 4chan style fixes */
+:root.yotsuba.highlight-you .quotesYou$site$highlightable$reply {
+ border-left: 3px solid rgba(221, 0, 0, .8) !important;
+}
+:root.yotsuba.highlight-own .yourPost$site$highlightable$reply {
+ border-left: 3px dashed rgba(221, 0, 0, .8) !important;
+}
+
+/* Header */
+:root.yotsuba #header-bar.dialog {
+ background-color: rgba(240,224,214,0.98);
+}
+:root.yotsuba:not(.fixed) #header-bar, :root.yotsuba #notifications {
+ font-size: 9pt;
+}
+:root.yotsuba #header-bar, :root.yotsuba #notifications {
+ color: #B86;
+}
+:root.yotsuba #board-list a, :root.yotsuba #shortcuts a {
+ color: #800000;
+}
+
+/* Settings */
+:root.yotsuba #fourchanx-settings fieldset, :root.yotsuba .section-main div::before {
+ border-color: #D9BFB7;
+}
+:root.yotsuba .suboption-list > div:last-of-type {
+ background-color: #F0E0D6;
+}
+
+/* Catalog */
+:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post {
+ background-color: #F0E0D6;
+}
+:root.yotsuba.werkTyme .catalog-thread:not(:hover),
+:root.yotsuba.werkTyme:not(.catalog-hover-expand) .catalog-thread,
+:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post,
+:root.yotsuba.catalog-hover-expand .catalog-container:hover .catalog-reply {
+ border-color: #D9BFB7;
+}
+
+/* Quote */
+:root.yotsuba .backlink.deadlink {
+ color: #00E !important;
+}
+:root.yotsuba .inline {
+ border-color: #D9BFB7;
+ background-color: rgba(255, 255, 255, .14);
+}
+
+/* Fappe and Werk Tyme */
+:root.yotsuba .indicator {
+ color: #F0E0D6;
+}
+
+/* QR */
+.yotsuba #dump-list::-webkit-scrollbar-thumb {
+ background-color: #F0E0D6;
+ border-color: #D9BFB7;
+}
+:root.yotsuba .qr-preview {
+ background-color: rgba(0, 0, 0, .15);
+}
+:root.yotsuba .qr-link {
+ border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);
+ background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;
+}
+:root.yotsuba .qr-link:hover {
+ background: #F0E0D6;
+}
+
+/* Menu */
+:root.yotsuba #menu {
+ color: #800000;
+}
+:root.yotsuba .entry {
+ font-size: 10pt;
+}
+:root.yotsuba .focused.entry {
+ background: rgba(255, 255, 255, .33);
+}
+
+/* Unread */
+:root.yotsuba .unread-mark-read {
+ background-color: rgba(240,224,214,0.5);
+}
+
+/* Thread Watcher */
+:root.yotsuba .replies-quoting-you > a, :root.yotsuba #watcher-link.replies-quoting-you, :root.yotsuba .last-page > a > .watcher-page {
+ color: #F00;
+}
+
+/* Watcher Favicon */
+:root.yotsuba .watch-thread-link
+{
+ background-image: url("data:image/svg+xml,
");
+}
`;
// == Create CSS for Link Title Favicons == //
const icons = (data) => ('/* Link Title Favicons */\n' +
- data.map(({ name, data }) => `.linkify.${name}::before {
- content: "";
- background: transparent url('data:image/png;base64,${data}') center left no-repeat!important;
- padding-left: 18px;
-}
+ data.map(({ name, data }) => `.linkify.${name}::before {
+ content: "";
+ background: transparent url('data:image/png;base64,${data}') center left no-repeat!important;
+ padding-left: 18px;
+}
`).join(''));
// cSpell:ignore installGentoo, webfont
@@ -12813,332 +12816,332 @@ a:only-of-type > .remove {
}
};
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
- const CustomCSS = {
- init() {
- if (!Conf['Custom CSS']) { return; }
- return this.addStyle();
- },
-
- addStyle() {
- return this.style = $$1.addStyle(CSS.sub(Conf['usercss']), 'custom-css', '#fourchanx-css');
- },
-
- rmStyle() {
- if (this.style) {
- $$1.rm(this.style);
- return delete this.style;
- }
- },
-
- update() {
- if (!this.style) {
- return this.addStyle();
- }
- return this.style.textContent = CSS.sub(Conf['usercss']);
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+ const CustomCSS = {
+ init() {
+ if (!Conf['Custom CSS']) { return; }
+ return this.addStyle();
+ },
+
+ addStyle() {
+ return this.style = $$1.addStyle(CSS.sub(Conf['usercss']), 'custom-css', '#fourchanx-css');
+ },
+
+ rmStyle() {
+ if (this.style) {
+ $$1.rm(this.style);
+ return delete this.style;
+ }
+ },
+
+ update() {
+ if (!this.style) {
+ return this.addStyle();
+ }
+ return this.style.textContent = CSS.sub(Conf['usercss']);
+ }
};
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
- const SWTinyboard = {
- isOPContainerThread: true,
- mayLackJSON: true,
- threadModTimeIgnoresSage: true,
-
- disabledFeatures: [
- 'Resurrect Quotes',
- 'Quick Reply Personas',
- 'Quick Reply',
- 'Cooldown',
- 'Report Link',
- 'Delete Link',
- 'Edit Link',
- 'Quote Inlining',
- 'Quote Previewing',
- 'Quote Backlinks',
- 'File Info Formatting',
- 'Image Expansion',
- 'Image Expansion (Menu)',
- 'Comment Expansion',
- 'Thread Expansion',
- 'Favicon',
- 'Quote Threading',
- 'Thread Updater',
- 'Banner',
- 'Flash Features',
- 'Reply Pruning'
- ],
-
- detect() {
- for (var script of $$('script:not([src])', d$1.head)) {
- var m;
- if (m = script.textContent.match(/\bvar configRoot=(".*?")/)) {
- var properties = dict();
- try {
- var root = JSON.parse(m[1]);
- if (root[0] === '/') {
- properties.root = location.origin + root;
- } else if (/^https?:/.test(root)) {
- properties.root = root;
- }
- } catch (error) {}
- return properties;
- }
- }
- return false;
- },
-
- awaitBoard(cb) {
- if ($$1.id('react-ui')) {
- const s = (this.selectors = Object.create(this.selectors));
- s.boardFor = {index: '.page-container'};
- s.thread = 'div[id^="thread_"]';
- return Main$1.mounted(cb);
- } else {
- return cb();
- }
- },
-
- urls: {
- thread({siteID, boardID, threadID}, isArchived) {
- return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.html`;
- },
- post({postID}) { return `#${postID}`; },
- index({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/`; },
- catalog({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/catalog.html`; },
- threadJSON({siteID, boardID, threadID}, isArchived) {
- const root = Conf['siteProperties'][siteID]?.root;
- if (root) { return `${root}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.json`; } else { return ''; }
- },
- archivedThreadJSON(thread) {
- return SWTinyboard.urls.threadJSON(thread, true);
- },
- threadsListJSON({siteID, boardID}) {
- const root = Conf['siteProperties'][siteID]?.root;
- if (root) { return `${root}${boardID}/threads.json`; } else { return ''; }
- },
- archiveListJSON({siteID, boardID}) {
- const root = Conf['siteProperties'][siteID]?.root;
- if (root) { return `${root}${boardID}/archive/archive.json`; } else { return ''; }
- },
- catalogJSON({siteID, boardID}) {
- const root = Conf['siteProperties'][siteID]?.root;
- if (root) { return `${root}${boardID}/catalog.json`; } else { return ''; }
- },
- file({siteID, boardID}, filename) {
- return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${filename}`;
- },
- thumb(board, filename) {
- return SWTinyboard.urls.file(board, filename);
- }
- },
-
- selectors: {
- board: 'form[name="postcontrols"]',
- thread: 'input[name="board"] ~ div[id^="thread_"]',
- threadDivider: 'div[id^="thread_"] > hr:last-child',
- summary: '.omitted',
- postContainer: 'div[id^="reply_"]:not(.hidden)', // postContainer is thread for OP
- opBottom: '.op',
- replyOriginal: 'div[id^="reply_"]:not(.hidden)',
- infoRoot: '.intro',
- info: {
- subject: '.subject',
- name: '.name',
- email: '.email',
- tripcode: '.trip',
- uniqueID: '.poster_id',
- capcode: '.capcode',
- flag: '.flag',
- date: 'time',
- nameBlock: 'label',
- quote: 'a[href*="#q"]',
- reply: 'a[href*="/res/"]:not([href*="#"])'
- },
- icons: {
- isSticky: '.fa-thumb-tack',
- isClosed: '.fa-lock'
- },
- file: {
- text: '.fileinfo',
- link: '.fileinfo > a',
- thumb: 'a > .post-image'
- },
- thumbLink: '.file > a',
- multifile: '.files > .file',
- highlightable: {
- op: ' > .op',
- reply: '.reply',
- catalog: ' > .thread'
- },
- comment: '.body',
- spoiler: '.spoiler',
- quotelink: 'a[onclick*="highlightReply("]',
- catalog: {
- board: '#Grid',
- thread: '.mix',
- thumb: '.thread-image'
- },
- boardList: '.boardlist',
- boardListBottom: '.boardlist.bottom',
- styleSheet: '#stylesheet',
- psa: '.blotter',
- nav: {
- prev: '.pages > form > [value=Previous]',
- next: '.pages > form > [value=Next]'
- }
- },
-
- classes: {
- highlight: 'highlighted'
- },
-
- xpath: {
- thread: 'div[starts-with(@id,"thread_")]',
- postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]',
- replyContainer: 'div[starts-with(@id,"reply_")]'
- },
-
- regexp: {
- quotelink:
- new RegExp(`\
-/\
-([^/]+)\
-/res/\
-(\\d+)\
-(?:\\.\\w+)?#\
-(\\d+)\
-$\
-`),
- quotelinkHTML:
- /
]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)"/g
- },
-
- Build: {
- parseJSON(data, board) {
- const o = this.parseJSON(data, board);
- if (data.ext === 'deleted') {
- delete o.file;
- $$1.extend(o, {
- files: [],
- fileDeleted: true,
- filesDeleted: [0]
- });
- }
- if (data.extra_files) {
- let file;
- for (let i = 0; i < data.extra_files.length; i++) {
- var extra_file = data.extra_files[i];
- if (extra_file.ext === 'deleted') {
- o.filesDeleted.push(i);
- } else {
- file = this.parseJSONFile(data, board);
- o.files.push(file);
- }
- }
- if (o.files.length) {
- o.file = o.files[0];
- }
- }
- return o;
- },
-
- parseComment(html) {
- html = html
- .replace(/
/gi, '\n')
- .replace(/<[^>]*>/g, '');
- return $$1.unescape(html);
- }
- },
-
- bgColoredEl() {
- return $$1.el('div', {className: 'post reply'});
- },
-
- isFileURL(url) {
- return /\/src\/[^\/]+/.test(url.pathname);
- },
-
- preParsingFixes(board) {
- // fixes effects of unclosed link in announcement
- let broken;
- if (broken = $$1('a > input[name="board"]', board)) {
- return $$1.before(broken.parentNode, broken);
- }
- },
-
- parseNodes(post, nodes) {
- // Add vichan's span.poster_id around the ID if not already present.
- let m;
- if (nodes.uniqueID) { return; }
- let text = '';
- let node = nodes.nameBlock.nextSibling;
- while (node && (node.nodeType === 3)) {
- text += node.textContent;
- node = node.nextSibling;
- }
- if (m = text.match(/(\s*ID:\s*)(\S+)/)) {
- let uniqueID;
- nodes.info.normalize();
- let {nextSibling} = nodes.nameBlock;
- nextSibling = nextSibling.splitText(m[1].length);
- nextSibling.splitText(m[2].length);
- nodes.uniqueID = (uniqueID = $$1.el('span', {className: 'poster_id'}));
- $$1.replace(nextSibling, uniqueID);
- return $$1.add(uniqueID, nextSibling);
- }
- },
-
- parseDate(node) {
- let date = Date.parse(node.getAttribute('datetime')?.trim());
- if (!isNaN(date)) { return new Date(date); }
- date = Date.parse(node.textContent.trim() + ' UTC'); // e.g. onesixtwo.club
- if (!isNaN(date)) { return new Date(date); }
- return undefined;
- },
-
- parseFile(post, file) {
- let info, infoNode;
- const {text, link, thumb} = file;
- if ($$1.x(`ancestor::${this.xpath.postContainer}[1]`, text) !== post.nodes.root) { return false; } // file belongs to a reply
- if (!(infoNode = link.nextSibling?.textContent.includes('(') ? link.nextSibling : link.nextElementSibling)) { return false; }
- if (!(info = infoNode.textContent.match(/\((.*,\s*)?([\d.]+ ?[KMG]?B).*\)/))) { return false; }
- const nameNode = $$1('.postfilename', text);
- $$1.extend(file, {
- name: nameNode ? (nameNode.title || nameNode.textContent) : link.pathname.match(/[^/]*$/)[0],
- size: info[2],
- dimensions: info[0].match(/\d+x\d+/)?.[0]
- });
- if (thumb) {
- $$1.extend(file, {
- thumbURL: /\/static\//.test(thumb.src) && $$1.isImage(link.href) ? link.href : thumb.src,
- isSpoiler: /^Spoiler/i.test(info[1] || '') || (link.textContent === 'Spoiler Image')
- }
- );
- }
- return true;
- },
-
- isThumbExpanded(file) {
- // Detect old Tinyboard image expansion that changes src attribute on thumbnail.
- return $$1.hasClass(file.thumb.parentNode, 'expanded') || (file.thumb.parentNode.dataset.expanded === 'true');
- },
-
- isLinkified(link) {
- return /\bnofollow\b/.test(link.rel);
- },
-
- catalogPin(threadRoot) {
- return threadRoot.dataset.sticky = 'true';
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+ const SWTinyboard = {
+ isOPContainerThread: true,
+ mayLackJSON: true,
+ threadModTimeIgnoresSage: true,
+
+ disabledFeatures: [
+ 'Resurrect Quotes',
+ 'Quick Reply Personas',
+ 'Quick Reply',
+ 'Cooldown',
+ 'Report Link',
+ 'Delete Link',
+ 'Edit Link',
+ 'Quote Inlining',
+ 'Quote Previewing',
+ 'Quote Backlinks',
+ 'File Info Formatting',
+ 'Image Expansion',
+ 'Image Expansion (Menu)',
+ 'Comment Expansion',
+ 'Thread Expansion',
+ 'Favicon',
+ 'Quote Threading',
+ 'Thread Updater',
+ 'Banner',
+ 'Flash Features',
+ 'Reply Pruning'
+ ],
+
+ detect() {
+ for (var script of $$('script:not([src])', d$1.head)) {
+ var m;
+ if (m = script.textContent.match(/\bvar configRoot=(".*?")/)) {
+ var properties = dict();
+ try {
+ var root = JSON.parse(m[1]);
+ if (root[0] === '/') {
+ properties.root = location.origin + root;
+ } else if (/^https?:/.test(root)) {
+ properties.root = root;
+ }
+ } catch (error) {}
+ return properties;
+ }
+ }
+ return false;
+ },
+
+ awaitBoard(cb) {
+ if ($$1.id('react-ui')) {
+ const s = (this.selectors = Object.create(this.selectors));
+ s.boardFor = {index: '.page-container'};
+ s.thread = 'div[id^="thread_"]';
+ return Main$1.mounted(cb);
+ } else {
+ return cb();
+ }
+ },
+
+ urls: {
+ thread({siteID, boardID, threadID}, isArchived) {
+ return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.html`;
+ },
+ post({postID}) { return `#${postID}`; },
+ index({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/`; },
+ catalog({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/catalog.html`; },
+ threadJSON({siteID, boardID, threadID}, isArchived) {
+ const root = Conf['siteProperties'][siteID]?.root;
+ if (root) { return `${root}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.json`; } else { return ''; }
+ },
+ archivedThreadJSON(thread) {
+ return SWTinyboard.urls.threadJSON(thread, true);
+ },
+ threadsListJSON({siteID, boardID}) {
+ const root = Conf['siteProperties'][siteID]?.root;
+ if (root) { return `${root}${boardID}/threads.json`; } else { return ''; }
+ },
+ archiveListJSON({siteID, boardID}) {
+ const root = Conf['siteProperties'][siteID]?.root;
+ if (root) { return `${root}${boardID}/archive/archive.json`; } else { return ''; }
+ },
+ catalogJSON({siteID, boardID}) {
+ const root = Conf['siteProperties'][siteID]?.root;
+ if (root) { return `${root}${boardID}/catalog.json`; } else { return ''; }
+ },
+ file({siteID, boardID}, filename) {
+ return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${filename}`;
+ },
+ thumb(board, filename) {
+ return SWTinyboard.urls.file(board, filename);
+ }
+ },
+
+ selectors: {
+ board: 'form[name="postcontrols"]',
+ thread: 'input[name="board"] ~ div[id^="thread_"]',
+ threadDivider: 'div[id^="thread_"] > hr:last-child',
+ summary: '.omitted',
+ postContainer: 'div[id^="reply_"]:not(.hidden)', // postContainer is thread for OP
+ opBottom: '.op',
+ replyOriginal: 'div[id^="reply_"]:not(.hidden)',
+ infoRoot: '.intro',
+ info: {
+ subject: '.subject',
+ name: '.name',
+ email: '.email',
+ tripcode: '.trip',
+ uniqueID: '.poster_id',
+ capcode: '.capcode',
+ flag: '.flag',
+ date: 'time',
+ nameBlock: 'label',
+ quote: 'a[href*="#q"]',
+ reply: 'a[href*="/res/"]:not([href*="#"])'
+ },
+ icons: {
+ isSticky: '.fa-thumb-tack',
+ isClosed: '.fa-lock'
+ },
+ file: {
+ text: '.fileinfo',
+ link: '.fileinfo > a',
+ thumb: 'a > .post-image'
+ },
+ thumbLink: '.file > a',
+ multifile: '.files > .file',
+ highlightable: {
+ op: ' > .op',
+ reply: '.reply',
+ catalog: ' > .thread'
+ },
+ comment: '.body',
+ spoiler: '.spoiler',
+ quotelink: 'a[onclick*="highlightReply("]',
+ catalog: {
+ board: '#Grid',
+ thread: '.mix',
+ thumb: '.thread-image'
+ },
+ boardList: '.boardlist',
+ boardListBottom: '.boardlist.bottom',
+ styleSheet: '#stylesheet',
+ psa: '.blotter',
+ nav: {
+ prev: '.pages > form > [value=Previous]',
+ next: '.pages > form > [value=Next]'
+ }
+ },
+
+ classes: {
+ highlight: 'highlighted'
+ },
+
+ xpath: {
+ thread: 'div[starts-with(@id,"thread_")]',
+ postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]',
+ replyContainer: 'div[starts-with(@id,"reply_")]'
+ },
+
+ regexp: {
+ quotelink:
+ new RegExp(`\
+/\
+([^/]+)\
+/res/\
+(\\d+)\
+(?:\\.\\w+)?#\
+(\\d+)\
+$\
+`),
+ quotelinkHTML:
+ /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)"/g
+ },
+
+ Build: {
+ parseJSON(data, board) {
+ const o = this.parseJSON(data, board);
+ if (data.ext === 'deleted') {
+ delete o.file;
+ $$1.extend(o, {
+ files: [],
+ fileDeleted: true,
+ filesDeleted: [0]
+ });
+ }
+ if (data.extra_files) {
+ let file;
+ for (let i = 0; i < data.extra_files.length; i++) {
+ var extra_file = data.extra_files[i];
+ if (extra_file.ext === 'deleted') {
+ o.filesDeleted.push(i);
+ } else {
+ file = this.parseJSONFile(data, board);
+ o.files.push(file);
+ }
+ }
+ if (o.files.length) {
+ o.file = o.files[0];
+ }
+ }
+ return o;
+ },
+
+ parseComment(html) {
+ html = html
+ .replace(/
/gi, '\n')
+ .replace(/<[^>]*>/g, '');
+ return $$1.unescape(html);
+ }
+ },
+
+ bgColoredEl() {
+ return $$1.el('div', {className: 'post reply'});
+ },
+
+ isFileURL(url) {
+ return /\/src\/[^\/]+/.test(url.pathname);
+ },
+
+ preParsingFixes(board) {
+ // fixes effects of unclosed link in announcement
+ let broken;
+ if (broken = $$1('a > input[name="board"]', board)) {
+ return $$1.before(broken.parentNode, broken);
+ }
+ },
+
+ parseNodes(post, nodes) {
+ // Add vichan's span.poster_id around the ID if not already present.
+ let m;
+ if (nodes.uniqueID) { return; }
+ let text = '';
+ let node = nodes.nameBlock.nextSibling;
+ while (node && (node.nodeType === 3)) {
+ text += node.textContent;
+ node = node.nextSibling;
+ }
+ if (m = text.match(/(\s*ID:\s*)(\S+)/)) {
+ let uniqueID;
+ nodes.info.normalize();
+ let {nextSibling} = nodes.nameBlock;
+ nextSibling = nextSibling.splitText(m[1].length);
+ nextSibling.splitText(m[2].length);
+ nodes.uniqueID = (uniqueID = $$1.el('span', {className: 'poster_id'}));
+ $$1.replace(nextSibling, uniqueID);
+ return $$1.add(uniqueID, nextSibling);
+ }
+ },
+
+ parseDate(node) {
+ let date = Date.parse(node.getAttribute('datetime')?.trim());
+ if (!isNaN(date)) { return new Date(date); }
+ date = Date.parse(node.textContent.trim() + ' UTC'); // e.g. onesixtwo.club
+ if (!isNaN(date)) { return new Date(date); }
+ return undefined;
+ },
+
+ parseFile(post, file) {
+ let info, infoNode;
+ const {text, link, thumb} = file;
+ if ($$1.x(`ancestor::${this.xpath.postContainer}[1]`, text) !== post.nodes.root) { return false; } // file belongs to a reply
+ if (!(infoNode = link.nextSibling?.textContent.includes('(') ? link.nextSibling : link.nextElementSibling)) { return false; }
+ if (!(info = infoNode.textContent.match(/\((.*,\s*)?([\d.]+ ?[KMG]?B).*\)/))) { return false; }
+ const nameNode = $$1('.postfilename', text);
+ $$1.extend(file, {
+ name: nameNode ? (nameNode.title || nameNode.textContent) : link.pathname.match(/[^/]*$/)[0],
+ size: info[2],
+ dimensions: info[0].match(/\d+x\d+/)?.[0]
+ });
+ if (thumb) {
+ $$1.extend(file, {
+ thumbURL: /\/static\//.test(thumb.src) && $$1.isImage(link.href) ? link.href : thumb.src,
+ isSpoiler: /^Spoiler/i.test(info[1] || '') || (link.textContent === 'Spoiler Image')
+ }
+ );
+ }
+ return true;
+ },
+
+ isThumbExpanded(file) {
+ // Detect old Tinyboard image expansion that changes src attribute on thumbnail.
+ return $$1.hasClass(file.thumb.parentNode, 'expanded') || (file.thumb.parentNode.dataset.expanded === 'true');
+ },
+
+ isLinkified(link) {
+ return /\bnofollow\b/.test(link.rel);
+ },
+
+ catalogPin(threadRoot) {
+ return threadRoot.dataset.sticky = 'true';
+ }
};
const passMessagePage = h("div", { class: "box-inner" },
@@ -13151,205 +13154,205 @@ $\
h("a", { href: `${meta.captchaFAQ}#alternatives`, target: "_blank", rel: "noopener" }, "alternative solutions"),
"."));
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
-
- const PassMessage = {
- init() {
- if (Conf['passMessageClosed']) { return; }
- const msg = $$1.el('div',
- {className: 'box-outer top-box'}
- ,
- passMessagePage);
- msg.style.cssText = 'padding-bottom: 0;';
- const close = $$1('a', msg);
- $$1.on(close, 'click', function() {
- $$1.rm(msg);
- return $$1.set('passMessageClosed', true);
- });
- return $$1.ready(function() {
- let hd;
- if (hd = $$1.id('hd')) {
- return $$1.after(hd, msg);
- } else {
- return $$1.prepend(d$1.body, msg);
- }
- });
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+
+ const PassMessage = {
+ init() {
+ if (Conf['passMessageClosed']) { return; }
+ const msg = $$1.el('div',
+ {className: 'box-outer top-box'}
+ ,
+ passMessagePage);
+ msg.style.cssText = 'padding-bottom: 0;';
+ const close = $$1('a', msg);
+ $$1.on(close, 'click', function() {
+ $$1.rm(msg);
+ return $$1.set('passMessageClosed', true);
+ });
+ return $$1.ready(function() {
+ let hd;
+ if (hd = $$1.id('hd')) {
+ return $$1.after(hd, msg);
+ } else {
+ return $$1.prepend(d$1.body, msg);
+ }
+ });
+ }
};
- var ReportPage = `
-
-
-
+ var ReportPage = `
+
+
+
`;
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
-
- var Report = {
- init() {
- let match;
- if (!(match = location.search.match(/\bno=(\d+)/))) { return; }
- Captcha.replace.init();
- this.postID = +match[1];
- return $$1.ready(this.ready);
- },
-
- ready() {
- $$1.addStyle(CSS.report);
-
- if (Conf['Archive Report']) { Report.archive(); }
-
- new MutationObserver(function() {
- Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
- return Report.fit('body');
- }).observe(d$1.body, {
- childList: true,
- attributes: true,
- subtree: true
- }
- );
- return Report.fit('body');
- },
-
- fit(selector) {
- let el;
- if (!((el = $$1(selector, doc)) && (getComputedStyle(el).visibility !== 'hidden'))) { return; }
- const dy = (el.getBoundingClientRect().bottom - doc.clientHeight) + 8;
- if (dy > 0) { return window.resizeBy(0, dy); }
- },
-
- archive() {
- let match, urls;
- if (!(urls = Redirect$1.report(g.BOARD.ID)).length) { return; }
-
- const form = $$1('form');
- const types = $$1.id('reportTypes');
- const message = $$1('h3');
-
- const fieldset = $$1.el('fieldset', {
- id: 'archive-report',
- hidden: true
- }
- ,
- { innerHTML: ReportPage });
- const enabled = $$1('#archive-report-enabled', fieldset);
- const reason = $$1('#archive-report-reason', fieldset);
- const submit = $$1('#archive-report-submit', fieldset);
-
- $$1.on(enabled, 'change', function() {
- return reason.disabled = !this.checked;
- });
-
- if (form && types) {
- fieldset.hidden = !$$1('[value="31"]', types).checked;
- $$1.on(types, 'change', function(e) {
- fieldset.hidden = (e.target.value !== '31');
- return Report.fit('body');
- });
- $$1.after(types, fieldset);
- Report.fit('body');
- $$1.one(form, 'submit', function(e) {
- if (!fieldset.hidden && enabled.checked) {
- e.preventDefault();
- return Report.archiveSubmit(urls, reason.value, results => {
- this.action = '#archiveresults=' + encodeURIComponent(JSON.stringify(results));
- return this.submit();
- });
- }
- });
- } else if (message) {
- fieldset.hidden = /Report submitted!/.test(message.textContent);
- $$1.on(enabled, 'change', function() {
- return submit.hidden = !this.checked;
- });
- $$1.after(message, fieldset);
- $$1.on(submit, 'click', () => Report.archiveSubmit(urls, reason.value, Report.archiveResults));
- }
-
- if (match = location.hash.match(/^#archiveresults=(.*)$/)) {
- try {
- return Report.archiveResults(JSON.parse(decodeURIComponent(match[1])));
- } catch (error) {}
- }
- },
-
- archiveSubmit(urls, reason, cb) {
- const form = $$1.formData({
- board: g.BOARD.ID,
- num: Report.postID,
- reason
- });
- const results = [];
- for (var [name, url] of urls) {
- (function(name, url) {
- return $$1.ajax(url, {
- onloadend() {
- results.push([name, this.response || {error: ''}]);
- if (results.length === urls.length) {
- return cb(results);
- }
- },
- form
- });
- })(name, url);
- }
- },
-
- archiveResults(results) {
- const fieldset = $$1.id('archive-report');
- for (var [name, response] of results) {
- var line = $$1.el('h3',
- {className: 'archive-report-response'});
- if ('success' in response) {
- $$1.addClass(line, 'archive-report-success');
- line.textContent = `${name}: ${response.success}`;
- } else {
- $$1.addClass(line, 'archive-report-error');
- line.textContent = `${name}: ${response.error || 'Error reporting post.'}`;
- }
- if (fieldset) {
- $$1.before(fieldset, line);
- } else {
- $$1.add(d$1.body, line);
- }
- }
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+
+ var Report = {
+ init() {
+ let match;
+ if (!(match = location.search.match(/\bno=(\d+)/))) { return; }
+ Captcha.replace.init();
+ this.postID = +match[1];
+ return $$1.ready(this.ready);
+ },
+
+ ready() {
+ $$1.addStyle(CSS.report);
+
+ if (Conf['Archive Report']) { Report.archive(); }
+
+ new MutationObserver(function() {
+ Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
+ return Report.fit('body');
+ }).observe(d$1.body, {
+ childList: true,
+ attributes: true,
+ subtree: true
+ }
+ );
+ return Report.fit('body');
+ },
+
+ fit(selector) {
+ let el;
+ if (!((el = $$1(selector, doc)) && (getComputedStyle(el).visibility !== 'hidden'))) { return; }
+ const dy = (el.getBoundingClientRect().bottom - doc.clientHeight) + 8;
+ if (dy > 0) { return window.resizeBy(0, dy); }
+ },
+
+ archive() {
+ let match, urls;
+ if (!(urls = Redirect$1.report(g.BOARD.ID)).length) { return; }
+
+ const form = $$1('form');
+ const types = $$1.id('reportTypes');
+ const message = $$1('h3');
+
+ const fieldset = $$1.el('fieldset', {
+ id: 'archive-report',
+ hidden: true
+ }
+ ,
+ { innerHTML: ReportPage });
+ const enabled = $$1('#archive-report-enabled', fieldset);
+ const reason = $$1('#archive-report-reason', fieldset);
+ const submit = $$1('#archive-report-submit', fieldset);
+
+ $$1.on(enabled, 'change', function() {
+ return reason.disabled = !this.checked;
+ });
+
+ if (form && types) {
+ fieldset.hidden = !$$1('[value="31"]', types).checked;
+ $$1.on(types, 'change', function(e) {
+ fieldset.hidden = (e.target.value !== '31');
+ return Report.fit('body');
+ });
+ $$1.after(types, fieldset);
+ Report.fit('body');
+ $$1.one(form, 'submit', function(e) {
+ if (!fieldset.hidden && enabled.checked) {
+ e.preventDefault();
+ return Report.archiveSubmit(urls, reason.value, results => {
+ this.action = '#archiveresults=' + encodeURIComponent(JSON.stringify(results));
+ return this.submit();
+ });
+ }
+ });
+ } else if (message) {
+ fieldset.hidden = /Report submitted!/.test(message.textContent);
+ $$1.on(enabled, 'change', function() {
+ return submit.hidden = !this.checked;
+ });
+ $$1.after(message, fieldset);
+ $$1.on(submit, 'click', () => Report.archiveSubmit(urls, reason.value, Report.archiveResults));
+ }
+
+ if (match = location.hash.match(/^#archiveresults=(.*)$/)) {
+ try {
+ return Report.archiveResults(JSON.parse(decodeURIComponent(match[1])));
+ } catch (error) {}
+ }
+ },
+
+ archiveSubmit(urls, reason, cb) {
+ const form = $$1.formData({
+ board: g.BOARD.ID,
+ num: Report.postID,
+ reason
+ });
+ const results = [];
+ for (var [name, url] of urls) {
+ (function(name, url) {
+ return $$1.ajax(url, {
+ onloadend() {
+ results.push([name, this.response || {error: ''}]);
+ if (results.length === urls.length) {
+ return cb(results);
+ }
+ },
+ form
+ });
+ })(name, url);
+ }
+ },
+
+ archiveResults(results) {
+ const fieldset = $$1.id('archive-report');
+ for (var [name, response] of results) {
+ var line = $$1.el('h3',
+ {className: 'archive-report-response'});
+ if ('success' in response) {
+ $$1.addClass(line, 'archive-report-success');
+ line.textContent = `${name}: ${response.success}`;
+ } else {
+ $$1.addClass(line, 'archive-report-error');
+ line.textContent = `${name}: ${response.error || 'Error reporting post.'}`;
+ }
+ if (fieldset) {
+ $$1.before(fieldset, line);
+ } else {
+ $$1.add(d$1.body, line);
+ }
+ }
+ }
};
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
- const PostSuccessful = {
- init() {
- if (!Conf['Remember Your Posts']) { return; }
- return $$1.ready(this.ready);
- },
-
- ready() {
- if (d$1.title !== 'Post successful!') { return; }
-
- let [_, threadID, postID] = $$1('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/);
- postID = +postID;
- threadID = +threadID || postID;
-
- const db = new DataBoard('yourPosts');
- return db.set({
- boardID: g.BOARD.ID,
- threadID,
- postID,
- val: true
- });
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+ const PostSuccessful = {
+ init() {
+ if (!Conf['Remember Your Posts']) { return; }
+ return $$1.ready(this.ready);
+ },
+
+ ready() {
+ if (d$1.title !== 'Post successful!') { return; }
+
+ let [_, threadID, postID] = $$1('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/);
+ postID = +postID;
+ threadID = +threadID || postID;
+
+ const db = new DataBoard('yourPosts');
+ return db.set({
+ boardID: g.BOARD.ID,
+ threadID,
+ postID,
+ val: true
+ });
+ }
};
function generatePostInfoHtml(ID, o, subject, capcode, email, name, tripcode, pass, capcodeLC, capcodePlural, staticPath, gifIcon, capcodeDescription, uniqueID, flag, flagCode, flagCodeTroll, dateUTC, dateText, postLink, quoteLink, boardID, threadID) {
@@ -13592,16 +13595,16 @@ $\
replyContainer: 'div[contains(@class,"replyContainer")]'
},
regexp: {
- quotelink: new RegExp(`\
-^https?://boards\\.4chan(?:nel)?\\.org/+\
-([^/]+)\
-/+thread/+\
-(\\d+)\
-(?:[/?][^#]*)?\
-(?:#p\
-(\\d+)\
-)?\
-$\
+ quotelink: new RegExp(`\
+^https?://boards\\.4chan(?:nel)?\\.org/+\
+([^/]+)\
+/+thread/+\
+(\\d+)\
+(?:[/?][^#]*)?\
+(?:#p\
+(\\d+)\
+)?\
+$\
`),
quotelinkHTML: /]*\bhref="(?:(?:\/\/boards\.4chan(?:nel)?\.org)?\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g,
pass: /^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/,
@@ -14350,380 +14353,380 @@ $\
var Beep = 'UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA';
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS104: Avoid inline assignments
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
- var ReplyPruning = {
- init() {
- if ((g.VIEW !== 'thread') || !Conf['Reply Pruning']) { return; }
-
- this.container = $$1.frag();
-
- this.summary = $$1.el('span', {
- hidden: true,
- className: 'summary'
- }
- );
- this.summary.style.cursor = 'pointer';
- $$1.on(this.summary, 'click', () => {
- this.inputs.enabled.checked = !this.inputs.enabled.checked;
- return $$1.event('change', null, this.inputs.enabled);
- });
-
- const label = UI.checkbox('Prune Replies', 'Show Last', Conf['Prune All Threads']);
- const el = $$1.el('span',
- {title: 'Maximum number of replies to show.'}
- ,
- {innerHTML: " "});
- $$1.prepend(el, label);
-
- this.inputs = {
- enabled: label.firstElementChild,
- replies: el.lastElementChild
- };
-
- this.setEnabled.call(this.inputs.enabled);
- $$1.on(this.inputs.enabled, 'change', this.setEnabled);
- $$1.on(this.inputs.replies, 'change', $$1.cb.value);
-
- Header$1.menu.addEntry({
- el,
- order: 190
- });
-
- return Callbacks.Thread.push({
- name: 'Reply Pruning',
- cb: this.node
- });
- },
-
- position: 0,
- hidden: 0,
- hiddenFiles: 0,
- total: 0,
- totalFiles: 0,
-
- setEnabled() {
- const other = QuoteThreading.input;
- if (this.checked && other?.checked) {
- other.checked = false;
- $$1.event('change', null, other);
- }
- return ReplyPruning.active = this.checked;
- },
-
- showIfHidden(id) {
- if (ReplyPruning.container && $$1(`#${id}`, ReplyPruning.container)) {
- ReplyPruning.inputs.enabled.checked = false;
- return $$1.event('change', null, ReplyPruning.inputs.enabled);
- }
- },
-
- node() {
- let middle;
- ReplyPruning.thread = this;
-
- if (this.isSticky) {
- ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = true);
- if (QuoteThreading.input) {
- // Disable Quote Threading for this thread but don't save the setting.
- Conf['Thread Quotes'] = (QuoteThreading.input.checked = false);
- }
- }
-
- this.posts.forEach(function(post) {
- if (post.isReply) {
- ReplyPruning.total++;
- if (post.file) { return ReplyPruning.totalFiles++; }
- }
- });
-
- // If we're linked to a post that we would hide, don't hide the posts in the first place.
- if (
- ReplyPruning.active &&
- /^#p\d+$/.test(location.hash) &&
- (1 <= (middle = this.posts.keys.indexOf(location.hash.slice(2))) && middle < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))
- ) {
- ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = false);
- }
-
- $$1.after(this.OP.nodes.root, ReplyPruning.summary);
-
- $$1.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update);
- $$1.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update);
- $$1.on(d$1, 'ThreadUpdate', ReplyPruning.updateCount);
- $$1.on(d$1, 'ThreadUpdate', ReplyPruning.update);
-
- return ReplyPruning.update();
- },
-
- updateCount(e) {
- if (e.detail[404]) { return; }
- for (var fullID of e.detail.newPosts) {
- ReplyPruning.total++;
- if (g.posts.get(fullID).file) { ReplyPruning.totalFiles++; }
- }
- },
-
- update() {
- let boardTop, node, post;
- const hidden1 = ReplyPruning.hidden;
- const hidden2 = ReplyPruning.active ?
- Math.max(ReplyPruning.total - +Conf["Max Replies"], 0)
- :
- 0;
-
- // Record position from bottom of document
- const oldPos = d$1.body.clientHeight - window.scrollY;
-
- const {posts} = ReplyPruning.thread;
-
- if (ReplyPruning.hidden < hidden2) {
- while ((ReplyPruning.hidden < hidden2) && (ReplyPruning.position < posts.keys.length)) {
- post = posts.get(posts.keys[ReplyPruning.position++]);
- if (post.isReply && !post.isFetchedQuote) {
- while ((node = ReplyPruning.summary.nextSibling) && (node !== post.nodes.root)) { $$1.add(ReplyPruning.container, node); }
- $$1.add(ReplyPruning.container, post.nodes.root);
- ReplyPruning.hidden++;
- if (post.file) { ReplyPruning.hiddenFiles++; }
- }
- }
-
- } else if (ReplyPruning.hidden > hidden2) {
- const frag = $$1.frag();
- while ((ReplyPruning.hidden > hidden2) && (ReplyPruning.position > 0)) {
- post = posts.get(posts.keys[--ReplyPruning.position]);
- if (post.isReply && !post.isFetchedQuote) {
- while ((node = ReplyPruning.container.lastChild) && (node !== post.nodes.root)) { $$1.prepend(frag, node); }
- $$1.prepend(frag, post.nodes.root);
- ReplyPruning.hidden--;
- if (post.file) { ReplyPruning.hiddenFiles--; }
- }
- }
- $$1.after(ReplyPruning.summary, frag);
- $$1.event('PostsInserted', null, ReplyPruning.summary.parentNode);
- }
-
- ReplyPruning.summary.textContent = ReplyPruning.active ?
- g.SITE.Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles)
- :
- g.SITE.Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles);
- ReplyPruning.summary.hidden = (ReplyPruning.total <= +Conf["Max Replies"]);
-
- // Maintain position in thread when posts are added/removed above
- if ((hidden1 !== hidden2) && ((boardTop = Header$1.getTopOf($$1('.board'))) < 0)) {
- return window.scrollBy(0, Math.max(d$1.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY);
- }
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * DS104: Avoid inline assignments
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+ var ReplyPruning = {
+ init() {
+ if ((g.VIEW !== 'thread') || !Conf['Reply Pruning']) { return; }
+
+ this.container = $$1.frag();
+
+ this.summary = $$1.el('span', {
+ hidden: true,
+ className: 'summary'
+ }
+ );
+ this.summary.style.cursor = 'pointer';
+ $$1.on(this.summary, 'click', () => {
+ this.inputs.enabled.checked = !this.inputs.enabled.checked;
+ return $$1.event('change', null, this.inputs.enabled);
+ });
+
+ const label = UI.checkbox('Prune Replies', 'Show Last', Conf['Prune All Threads']);
+ const el = $$1.el('span',
+ {title: 'Maximum number of replies to show.'}
+ ,
+ {innerHTML: " "});
+ $$1.prepend(el, label);
+
+ this.inputs = {
+ enabled: label.firstElementChild,
+ replies: el.lastElementChild
+ };
+
+ this.setEnabled.call(this.inputs.enabled);
+ $$1.on(this.inputs.enabled, 'change', this.setEnabled);
+ $$1.on(this.inputs.replies, 'change', $$1.cb.value);
+
+ Header$1.menu.addEntry({
+ el,
+ order: 190
+ });
+
+ return Callbacks.Thread.push({
+ name: 'Reply Pruning',
+ cb: this.node
+ });
+ },
+
+ position: 0,
+ hidden: 0,
+ hiddenFiles: 0,
+ total: 0,
+ totalFiles: 0,
+
+ setEnabled() {
+ const other = QuoteThreading.input;
+ if (this.checked && other?.checked) {
+ other.checked = false;
+ $$1.event('change', null, other);
+ }
+ return ReplyPruning.active = this.checked;
+ },
+
+ showIfHidden(id) {
+ if (ReplyPruning.container && $$1(`#${id}`, ReplyPruning.container)) {
+ ReplyPruning.inputs.enabled.checked = false;
+ return $$1.event('change', null, ReplyPruning.inputs.enabled);
+ }
+ },
+
+ node() {
+ let middle;
+ ReplyPruning.thread = this;
+
+ if (this.isSticky) {
+ ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = true);
+ if (QuoteThreading.input) {
+ // Disable Quote Threading for this thread but don't save the setting.
+ Conf['Thread Quotes'] = (QuoteThreading.input.checked = false);
+ }
+ }
+
+ this.posts.forEach(function(post) {
+ if (post.isReply) {
+ ReplyPruning.total++;
+ if (post.file) { return ReplyPruning.totalFiles++; }
+ }
+ });
+
+ // If we're linked to a post that we would hide, don't hide the posts in the first place.
+ if (
+ ReplyPruning.active &&
+ /^#p\d+$/.test(location.hash) &&
+ (1 <= (middle = this.posts.keys.indexOf(location.hash.slice(2))) && middle < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))
+ ) {
+ ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = false);
+ }
+
+ $$1.after(this.OP.nodes.root, ReplyPruning.summary);
+
+ $$1.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update);
+ $$1.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update);
+ $$1.on(d$1, 'ThreadUpdate', ReplyPruning.updateCount);
+ $$1.on(d$1, 'ThreadUpdate', ReplyPruning.update);
+
+ return ReplyPruning.update();
+ },
+
+ updateCount(e) {
+ if (e.detail[404]) { return; }
+ for (var fullID of e.detail.newPosts) {
+ ReplyPruning.total++;
+ if (g.posts.get(fullID).file) { ReplyPruning.totalFiles++; }
+ }
+ },
+
+ update() {
+ let boardTop, node, post;
+ const hidden1 = ReplyPruning.hidden;
+ const hidden2 = ReplyPruning.active ?
+ Math.max(ReplyPruning.total - +Conf["Max Replies"], 0)
+ :
+ 0;
+
+ // Record position from bottom of document
+ const oldPos = d$1.body.clientHeight - window.scrollY;
+
+ const {posts} = ReplyPruning.thread;
+
+ if (ReplyPruning.hidden < hidden2) {
+ while ((ReplyPruning.hidden < hidden2) && (ReplyPruning.position < posts.keys.length)) {
+ post = posts.get(posts.keys[ReplyPruning.position++]);
+ if (post.isReply && !post.isFetchedQuote) {
+ while ((node = ReplyPruning.summary.nextSibling) && (node !== post.nodes.root)) { $$1.add(ReplyPruning.container, node); }
+ $$1.add(ReplyPruning.container, post.nodes.root);
+ ReplyPruning.hidden++;
+ if (post.file) { ReplyPruning.hiddenFiles++; }
+ }
+ }
+
+ } else if (ReplyPruning.hidden > hidden2) {
+ const frag = $$1.frag();
+ while ((ReplyPruning.hidden > hidden2) && (ReplyPruning.position > 0)) {
+ post = posts.get(posts.keys[--ReplyPruning.position]);
+ if (post.isReply && !post.isFetchedQuote) {
+ while ((node = ReplyPruning.container.lastChild) && (node !== post.nodes.root)) { $$1.prepend(frag, node); }
+ $$1.prepend(frag, post.nodes.root);
+ ReplyPruning.hidden--;
+ if (post.file) { ReplyPruning.hiddenFiles--; }
+ }
+ }
+ $$1.after(ReplyPruning.summary, frag);
+ $$1.event('PostsInserted', null, ReplyPruning.summary.parentNode);
+ }
+
+ ReplyPruning.summary.textContent = ReplyPruning.active ?
+ g.SITE.Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles)
+ :
+ g.SITE.Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles);
+ ReplyPruning.summary.hidden = (ReplyPruning.total <= +Conf["Max Replies"]);
+
+ // Maintain position in thread when posts are added/removed above
+ if ((hidden1 !== hidden2) && ((boardTop = Header$1.getTopOf($$1('.board'))) < 0)) {
+ return window.scrollBy(0, Math.max(d$1.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY);
+ }
+ }
};
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
- /*
- <3 aeosynth
- */
-
- var QuoteThreading = {
- init() {
- if (!Conf['Quote Threading'] || (g.VIEW !== 'thread')) { return; }
-
- this.controls = $$1.el('label',
- {innerHTML: " Threading"});
-
- this.threadNewLink = $$1.el('span', {
- className: 'brackets-wrap threadnewlink',
- hidden: true
- }
- );
- $$1.extend(this.threadNewLink, {innerHTML: "Thread New Posts"});
-
- this.input = $$1('input', this.controls);
- this.input.checked = Conf['Thread Quotes'];
-
- $$1.on(this.input, 'change', this.setEnabled);
- $$1.on(this.input, 'change', this.rethread);
- $$1.on(this.threadNewLink.firstElementChild, 'click', this.rethread);
- $$1.on(d$1, '4chanXInitFinished', () => { return this.ready = true; });
-
- Header$1.menu.addEntry(this.entry = {
- el: this.controls,
- order: 99
- }
- );
-
- Callbacks.Thread.push({
- name: 'Quote Threading',
- cb: this.setThread
- });
-
- return Callbacks.Post.push({
- name: 'Quote Threading',
- cb: this.node
- });
- },
-
- parent: dict(),
- children: dict(),
- inserted: dict(),
-
- toggleThreading() {
- return this.setThreadingState(!Conf['Thread Quotes']);
- },
-
- setThreadingState(enabled) {
- this.input.checked = enabled;
- this.setEnabled.call(this.input);
- return this.rethread.call(this.input);
- },
-
- setEnabled() {
- if (this.checked) {
- $$1.set('Prune All Threads', false);
- const other = ReplyPruning.inputs?.enabled;
- if (other?.checked) {
- other.checked = false;
- $$1.event('change', null, other);
- }
- }
- return $$1.cb.checked.call(this);
- },
-
- setThread() {
- QuoteThreading.thread = this;
- return $$1.asap((() => !Conf['Thread Updater'] || $$1('.navLinksBot > .updatelink')), function() {
- let navLinksBot;
- if (navLinksBot = $$1('.navLinksBot')) { return $$1.add(navLinksBot, [$$1.tn(' '), QuoteThreading.threadNewLink]); }
- });
- },
-
- node() {
- let parent;
- if (this.isFetchedQuote || this.isClone || !this.isReply) { return; }
-
- const parents = new Set();
- let lastParent = null;
- for (var quote of this.quotes) {
- if ((parent = g.posts.get(quote))) {
- if (!parent.isFetchedQuote && parent.isReply && (parent.ID < this.ID)) {
- parents.add(parent.ID);
- if (!lastParent || (parent.ID > lastParent.ID)) { lastParent = parent; }
- }
- }
- }
-
- if (!lastParent) { return; }
-
- let ancestor = lastParent;
- while ((ancestor = QuoteThreading.parent[ancestor.fullID])) {
- parents.delete(ancestor.ID);
- }
-
- if (parents.size === 1) {
- return QuoteThreading.parent[this.fullID] = lastParent;
- }
- },
-
- descendants(post) {
- let children;
- let posts = [post];
- if (children = QuoteThreading.children[post.fullID]) {
- for (var child of children) {
- posts = posts.concat(QuoteThreading.descendants(child));
- }
- }
- return posts;
- },
-
- insert(post) {
- let parent, x;
- if (!(
- Conf['Thread Quotes'] &&
- (parent = QuoteThreading.parent[post.fullID]) &&
- !QuoteThreading.inserted[post.fullID]
- )) { return false; }
-
- const descendants = QuoteThreading.descendants(post);
- if (!Unread.posts.has(parent.ID)) {
- if ((function() { for (var x of descendants) { if (Unread.posts.has(x.ID)) { return true; } } })()) {
- QuoteThreading.threadNewLink.hidden = false;
- return false;
- }
- }
-
- const {order} = Unread;
- const children = (QuoteThreading.children[parent.fullID] || (QuoteThreading.children[parent.fullID] = []));
- const threadContainer = parent.nodes.threadContainer || $$1.el('div', {className: 'threadContainer'});
- const nodes = [post.nodes.root];
- if (post.nodes.threadContainer) { nodes.push(post.nodes.threadContainer); }
-
- let i = children.length;
- for (let j = children.length - 1; j >= 0; j--) { var child = children[j]; if (child.ID >= post.ID) { i--; } }
- if (i !== children.length) {
- const next = children[i];
- for (x of descendants) { order.before(order[next.ID], order[x.ID]); }
- children.splice(i, 0, post);
- $$1.before(next.nodes.root, nodes);
- } else {
- let prev2;
- let prev = parent;
- while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
- prev = prev2[prev2.length-1];
- }
- for (let k = descendants.length - 1; k >= 0; k--) { x = descendants[k]; order.after(order[prev.ID], order[x.ID]); }
- children.push(post);
- $$1.add(threadContainer, nodes);
- }
-
- QuoteThreading.inserted[post.fullID] = true;
-
- if (!parent.nodes.threadContainer) {
- parent.nodes.threadContainer = threadContainer;
- $$1.addClass(parent.nodes.root, 'threadOP');
- $$1.after(parent.nodes.root, threadContainer);
- }
-
- return true;
- },
-
- rethread() {
- if (!QuoteThreading.ready) { return; }
- const {thread} = QuoteThreading;
- const {posts} = thread;
-
- QuoteThreading.threadNewLink.hidden = true;
-
- if (Conf['Thread Quotes']) {
- posts.forEach(QuoteThreading.insert);
- } else {
- const nodes = [];
- Unread.order = new RandomAccessList();
- QuoteThreading.inserted = dict();
- posts.forEach(function(post) {
- if (post.isFetchedQuote) { return; }
- Unread.order.push(post);
- if (post.isReply) { nodes.push(post.nodes.root); }
- if (QuoteThreading.children[post.fullID]) {
- delete QuoteThreading.children[post.fullID];
- $$1.rmClass(post.nodes.root, 'threadOP');
- $$1.rm(post.nodes.threadContainer);
- return delete post.nodes.threadContainer;
- }
- });
- $$1.add(thread.nodes.root, nodes);
- }
-
- Unread.position = Unread.order.first;
- Unread.updatePosition();
- Unread.setLine(true);
- Unread.read();
- return Unread.update();
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+ /*
+ <3 aeosynth
+ */
+
+ var QuoteThreading = {
+ init() {
+ if (!Conf['Quote Threading'] || (g.VIEW !== 'thread')) { return; }
+
+ this.controls = $$1.el('label',
+ {innerHTML: "
Threading"});
+
+ this.threadNewLink = $$1.el('span', {
+ className: 'brackets-wrap threadnewlink',
+ hidden: true
+ }
+ );
+ $$1.extend(this.threadNewLink, {innerHTML: "
Thread New Posts"});
+
+ this.input = $$1('input', this.controls);
+ this.input.checked = Conf['Thread Quotes'];
+
+ $$1.on(this.input, 'change', this.setEnabled);
+ $$1.on(this.input, 'change', this.rethread);
+ $$1.on(this.threadNewLink.firstElementChild, 'click', this.rethread);
+ $$1.on(d$1, '4chanXInitFinished', () => { return this.ready = true; });
+
+ Header$1.menu.addEntry(this.entry = {
+ el: this.controls,
+ order: 99
+ }
+ );
+
+ Callbacks.Thread.push({
+ name: 'Quote Threading',
+ cb: this.setThread
+ });
+
+ return Callbacks.Post.push({
+ name: 'Quote Threading',
+ cb: this.node
+ });
+ },
+
+ parent: dict(),
+ children: dict(),
+ inserted: dict(),
+
+ toggleThreading() {
+ return this.setThreadingState(!Conf['Thread Quotes']);
+ },
+
+ setThreadingState(enabled) {
+ this.input.checked = enabled;
+ this.setEnabled.call(this.input);
+ return this.rethread.call(this.input);
+ },
+
+ setEnabled() {
+ if (this.checked) {
+ $$1.set('Prune All Threads', false);
+ const other = ReplyPruning.inputs?.enabled;
+ if (other?.checked) {
+ other.checked = false;
+ $$1.event('change', null, other);
+ }
+ }
+ return $$1.cb.checked.call(this);
+ },
+
+ setThread() {
+ QuoteThreading.thread = this;
+ return $$1.asap((() => !Conf['Thread Updater'] || $$1('.navLinksBot > .updatelink')), function() {
+ let navLinksBot;
+ if (navLinksBot = $$1('.navLinksBot')) { return $$1.add(navLinksBot, [$$1.tn(' '), QuoteThreading.threadNewLink]); }
+ });
+ },
+
+ node() {
+ let parent;
+ if (this.isFetchedQuote || this.isClone || !this.isReply) { return; }
+
+ const parents = new Set();
+ let lastParent = null;
+ for (var quote of this.quotes) {
+ if ((parent = g.posts.get(quote))) {
+ if (!parent.isFetchedQuote && parent.isReply && (parent.ID < this.ID)) {
+ parents.add(parent.ID);
+ if (!lastParent || (parent.ID > lastParent.ID)) { lastParent = parent; }
+ }
+ }
+ }
+
+ if (!lastParent) { return; }
+
+ let ancestor = lastParent;
+ while ((ancestor = QuoteThreading.parent[ancestor.fullID])) {
+ parents.delete(ancestor.ID);
+ }
+
+ if (parents.size === 1) {
+ return QuoteThreading.parent[this.fullID] = lastParent;
+ }
+ },
+
+ descendants(post) {
+ let children;
+ let posts = [post];
+ if (children = QuoteThreading.children[post.fullID]) {
+ for (var child of children) {
+ posts = posts.concat(QuoteThreading.descendants(child));
+ }
+ }
+ return posts;
+ },
+
+ insert(post) {
+ let parent, x;
+ if (!(
+ Conf['Thread Quotes'] &&
+ (parent = QuoteThreading.parent[post.fullID]) &&
+ !QuoteThreading.inserted[post.fullID]
+ )) { return false; }
+
+ const descendants = QuoteThreading.descendants(post);
+ if (!Unread.posts.has(parent.ID)) {
+ if ((function() { for (var x of descendants) { if (Unread.posts.has(x.ID)) { return true; } } })()) {
+ QuoteThreading.threadNewLink.hidden = false;
+ return false;
+ }
+ }
+
+ const {order} = Unread;
+ const children = (QuoteThreading.children[parent.fullID] || (QuoteThreading.children[parent.fullID] = []));
+ const threadContainer = parent.nodes.threadContainer || $$1.el('div', {className: 'threadContainer'});
+ const nodes = [post.nodes.root];
+ if (post.nodes.threadContainer) { nodes.push(post.nodes.threadContainer); }
+
+ let i = children.length;
+ for (let j = children.length - 1; j >= 0; j--) { var child = children[j]; if (child.ID >= post.ID) { i--; } }
+ if (i !== children.length) {
+ const next = children[i];
+ for (x of descendants) { order.before(order[next.ID], order[x.ID]); }
+ children.splice(i, 0, post);
+ $$1.before(next.nodes.root, nodes);
+ } else {
+ let prev2;
+ let prev = parent;
+ while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
+ prev = prev2[prev2.length-1];
+ }
+ for (let k = descendants.length - 1; k >= 0; k--) { x = descendants[k]; order.after(order[prev.ID], order[x.ID]); }
+ children.push(post);
+ $$1.add(threadContainer, nodes);
+ }
+
+ QuoteThreading.inserted[post.fullID] = true;
+
+ if (!parent.nodes.threadContainer) {
+ parent.nodes.threadContainer = threadContainer;
+ $$1.addClass(parent.nodes.root, 'threadOP');
+ $$1.after(parent.nodes.root, threadContainer);
+ }
+
+ return true;
+ },
+
+ rethread() {
+ if (!QuoteThreading.ready) { return; }
+ const {thread} = QuoteThreading;
+ const {posts} = thread;
+
+ QuoteThreading.threadNewLink.hidden = true;
+
+ if (Conf['Thread Quotes']) {
+ posts.forEach(QuoteThreading.insert);
+ } else {
+ const nodes = [];
+ Unread.order = new RandomAccessList();
+ QuoteThreading.inserted = dict();
+ posts.forEach(function(post) {
+ if (post.isFetchedQuote) { return; }
+ Unread.order.push(post);
+ if (post.isReply) { nodes.push(post.nodes.root); }
+ if (QuoteThreading.children[post.fullID]) {
+ delete QuoteThreading.children[post.fullID];
+ $$1.rmClass(post.nodes.root, 'threadOP');
+ $$1.rm(post.nodes.threadContainer);
+ return delete post.nodes.threadContainer;
+ }
+ });
+ $$1.add(thread.nodes.root, nodes);
+ }
+
+ Unread.position = Unread.order.first;
+ Unread.updatePosition();
+ Unread.setLine(true);
+ Unread.read();
+ return Unread.update();
+ }
};
/*
@@ -15282,9 +15285,9 @@ $\
if ($$1.cantSync) {
const why = $$1.cantSet ? 'save your settings' : 'synchronize settings between tabs';
return cb($$1.el('li', {
- textContent: `\
-${meta.name} needs local storage to ${why}.
-Enable it on boards.${location.hostname.split('.')[1]}.org in your browser's privacy settings (may be listed as part of "local data" or "cookies").\
+ textContent: `\
+${meta.name} needs local storage to ${why}.
+Enable it on boards.${location.hostname.split('.')[1]}.org in your browser's privacy settings (may be listed as part of "local data" or "cookies").\
`
}));
}
@@ -15871,24 +15874,24 @@ Enable it on boards.${location.hostname.split('.')[1]}.org in your browser's pri
}
if (compareString < '00001.00014.00012.00008') {
if (data['boardnav'] == null) {
- set('boardnav', `\
-[ toggle-all ]
-a-replace
-c-replace
-g-replace
-k-replace
-v-replace
-vg-replace
-vr-replace
-ck-replace
-co-replace
-fit-replace
-jp-replace
-mu-replace
-sp-replace
-tv-replace
-vp-replace
-[external-text:"FAQ","${meta.faq}"]\
+ set('boardnav', `\
+[ toggle-all ]
+a-replace
+c-replace
+g-replace
+k-replace
+v-replace
+vg-replace
+vr-replace
+ck-replace
+co-replace
+fit-replace
+jp-replace
+mu-replace
+sp-replace
+tv-replace
+vp-replace
+[external-text:"FAQ","${meta.faq}"]\
`);
}
}
@@ -16263,4716 +16266,4716 @@ vp-replace
}
};
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
- var FappeTyme = {
- init() {
- if ((!Conf['Fappe Tyme'] && !Conf['Werk Tyme']) || !['index', 'thread', 'archive'].includes(g.VIEW)) { return; }
-
- this.nodes = {};
- this.enabled = {
- fappe: false,
- werk: Conf['werk']
- };
-
- for (var type of ["Fappe", "Werk"]) {
- if (Conf[`${type} Tyme`]) {
- var lc = type.toLowerCase();
- var el = UI.checkbox(lc, `${type} Tyme`, false);
- el.title = `${type} Tyme`;
-
- this.nodes[lc] = el.firstElementChild;
- if (Conf[lc]) { this.set(lc, true); }
- $$1.on(this.nodes[lc], 'change', this.toggle.bind(this, lc));
-
- Header$1.menu.addEntry({
- el,
- order: 97
- });
-
- var indicator = $$1.el('span', {
- className: 'indicator',
- textContent: type[0],
- title: `${type} Tyme active`
- }
- );
- $$1.on(indicator, 'click', function() {
- const check = $$1.getOwn(FappeTyme.nodes, this.parentNode.id.replace('shortcut-', ''));
- check.checked = !check.checked;
- return $$1.event('change', null, check);
- });
- Header$1.addShortcut(lc, indicator, 410);
- }
- }
-
- if (Conf['Werk Tyme']) {
- $$1.sync('werk', this.set.bind(this, 'werk'));
- }
-
- Callbacks.Post.push({
- name: 'Fappe Tyme',
- cb: this.node
- });
-
- return Callbacks.CatalogThread.push({
- name: 'Werk Tyme',
- cb: this.catalogNode
- });
- },
-
- node() {
- return this.nodes.root.classList.toggle('noFile', !this.files.length);
- },
-
- catalogNode() {
- const file = this.thread.OP.files[0];
- if (!file) { return; }
- const filename = $$1.el('div', {
- textContent: file.name,
- className: 'werkTyme-filename'
- }
- );
- return $$1.add(this.nodes.thumb.parentNode, filename);
- },
-
- set(type, enabled) {
- this.enabled[type] = (this.nodes[type].checked = enabled);
- return $$1[`${enabled ? 'add' : 'rm'}Class`](doc$1, `${type}Tyme`);
- },
-
- toggle(type) {
- this.set(type, !this.enabled[type]);
- if (type === 'werk') { return $$1.cb.checked.call(this.nodes[type]); }
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+ var FappeTyme = {
+ init() {
+ if ((!Conf['Fappe Tyme'] && !Conf['Werk Tyme']) || !['index', 'thread', 'archive'].includes(g.VIEW)) { return; }
+
+ this.nodes = {};
+ this.enabled = {
+ fappe: false,
+ werk: Conf['werk']
+ };
+
+ for (var type of ["Fappe", "Werk"]) {
+ if (Conf[`${type} Tyme`]) {
+ var lc = type.toLowerCase();
+ var el = UI.checkbox(lc, `${type} Tyme`, false);
+ el.title = `${type} Tyme`;
+
+ this.nodes[lc] = el.firstElementChild;
+ if (Conf[lc]) { this.set(lc, true); }
+ $$1.on(this.nodes[lc], 'change', this.toggle.bind(this, lc));
+
+ Header$1.menu.addEntry({
+ el,
+ order: 97
+ });
+
+ var indicator = $$1.el('span', {
+ className: 'indicator',
+ textContent: type[0],
+ title: `${type} Tyme active`
+ }
+ );
+ $$1.on(indicator, 'click', function() {
+ const check = $$1.getOwn(FappeTyme.nodes, this.parentNode.id.replace('shortcut-', ''));
+ check.checked = !check.checked;
+ return $$1.event('change', null, check);
+ });
+ Header$1.addShortcut(lc, indicator, 410);
+ }
+ }
+
+ if (Conf['Werk Tyme']) {
+ $$1.sync('werk', this.set.bind(this, 'werk'));
+ }
+
+ Callbacks.Post.push({
+ name: 'Fappe Tyme',
+ cb: this.node
+ });
+
+ return Callbacks.CatalogThread.push({
+ name: 'Werk Tyme',
+ cb: this.catalogNode
+ });
+ },
+
+ node() {
+ return this.nodes.root.classList.toggle('noFile', !this.files.length);
+ },
+
+ catalogNode() {
+ const file = this.thread.OP.files[0];
+ if (!file) { return; }
+ const filename = $$1.el('div', {
+ textContent: file.name,
+ className: 'werkTyme-filename'
+ }
+ );
+ return $$1.add(this.nodes.thumb.parentNode, filename);
+ },
+
+ set(type, enabled) {
+ this.enabled[type] = (this.nodes[type].checked = enabled);
+ return $$1[`${enabled ? 'add' : 'rm'}Class`](doc$1, `${type}Tyme`);
+ },
+
+ toggle(type) {
+ this.set(type, !this.enabled[type]);
+ if (type === 'werk') { return $$1.cb.checked.call(this.nodes[type]); }
+ }
};
- var galleryPage = `
-
-
-
-
- ×
-
-
-
-
-
![]()
-
-
-
-
+ var galleryPage = `
+
+
+
+
+ ×
+
+
+
+
+
![]()
+
+
+
+
`;
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS104: Avoid inline assignments
- * DS204: Change includes calls to have a more natural evaluation order
- * DS207: Consider shorter variations of null checks
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
- var Sauce = {
- init() {
- let link;
- if (!['index', 'thread'].includes(g.VIEW) || !Conf['Sauce']) { return; }
- $$1.addClass(doc$1, 'show-sauce');
-
- const links = [];
- for (link of Conf['sauces'].split('\n')) {
- var linkData;
- if ((link[0] !== '#') && (linkData = this.parseLink(link))) {
- links.push(linkData);
- }
- }
- if (!links.length) { return; }
-
- this.links = links;
- this.link = $$1.el('a', {
- target: '_blank',
- className: 'sauce'
- }
- );
- return Callbacks.Post.push({
- name: 'Sauce',
- cb: this.node
- });
- },
-
- parseLink(link) {
- if (!(link = link.trim())) { return null; }
- const parts = dict();
- const iterable = link.split(/;(?=(?:text|boards|types|regexp|sandbox):?)/);
- for (let i = 0; i < iterable.length; i++) {
- var part = iterable[i];
- if (i === 0) {
- parts['url'] = part;
- } else {
- var m = part.match(/^(\w*):?(.*)$/);
- parts[m[1]] = m[2];
- }
- }
- if (!parts['text']) { parts['text'] = parts['url'].match(/(\w+)\.\w+\//)?.[1] || '?'; }
- if ('boards' in parts) {
- parts['boards'] = Filter.parseBoards(parts['boards']);
- }
- if ('regexp' in parts) {
- try {
- let regexp;
- if (regexp = parts['regexp'].match(/^\/(.*)\/(\w*)$/)) {
- parts['regexp'] = RegExp(regexp[1], regexp[2]);
- } else {
- parts['regexp'] = RegExp(parts['regexp']);
- }
- } catch (err) {
- new Notice('warning', [
- $$1.tn("Invalid regexp for Sauce link:"),
- $$1.el('br'),
- $$1.tn(link),
- $$1.el('br'),
- $$1.tn(err.message)
- ], 60);
- return null;
- }
- }
- return parts;
- },
-
- createSauceLink(link, post, file) {
- let a, matches, needle;
- const ext = file.url.match(/[^.]*$/)[0];
- const parts = dict();
- $$1.extend(parts, link);
-
- if (!!parts['boards'] && !parts['boards'][`${post.siteID}/${post.boardID}`] && !parts['boards'][`${post.siteID}/*`]) { return null; }
- if (!!parts['types'] && (needle = ext, !parts['types'].split(',').includes(needle))) { return null; }
- if (!!parts['regexp'] && (!(matches = file.name.match(parts['regexp'])))) { return null; }
-
- const missing = [];
- for (var key of ['url', 'text']) {
- parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi|\$\d+)/g, function(orig, parameter) {
- let type;
- if (parameter[0] === '$') {
- if (!matches) { return orig; }
- type = matches[parameter.slice(1)] || '';
- } else {
- type = Sauce.formatters[parameter](post, file, ext);
- if ((type == null)) {
- missing.push(parameter);
- return '';
- }
- }
-
- if ((key === 'url') && !['%', 'semi'].includes(parameter)) {
- if (/^javascript:/i.test(parts['url'])) { type = JSON.stringify(type); }
- type = encodeURIComponent(type);
- }
- return type;
- });
- }
-
- if (g.SITE.areMD5sDeferred?.(post.board) && missing.length && !missing.filter(x => !/^.?MD5$/.test(x)).length) {
- a = Sauce.link.cloneNode(false);
- a.dataset.skip = '1';
- return a;
- }
-
- if (missing.length) { return null; }
-
- a = Sauce.link.cloneNode(false);
- a.href = parts['url'];
- a.textContent = parts['text'];
- if (/^javascript:/i.test(parts['url'])) { a.removeAttribute('target'); }
- return a;
- },
-
- node() {
- if (this.isClone) { return; }
- for (var file of this.files) {
- Sauce.file(this, file);
- }
- },
-
- file(post, file) {
- let link, node;
- const nodes = [];
- const skipped = [];
- for (link of Sauce.links) {
- if (node = Sauce.createSauceLink(link, post, file)) {
- nodes.push($$1.tn(' '), node);
- if (node.dataset.skip) { skipped.push([link, node]); }
- }
- }
- $$1.add(file.text, nodes);
-
- if (skipped.length) {
- var observer = new MutationObserver(function() {
- if (file.text.dataset.md5) {
- for ([link, node] of skipped) {
- var node2;
- if (node2 = Sauce.createSauceLink(link, post, file)) {
- $$1.replace(node, node2);
- }
- }
- return observer.disconnect();
- }
- });
- return observer.observe(file.text, {attributes: true});
- }
- },
-
- formatters: {
- TURL(post, file) { return file.thumbURL; },
- URL(post, file) { return file.url; },
- IMG(post, file, ext) { if (['gif', 'jpg', 'jpeg', 'png'].includes(ext)) { return file.url; } else { return file.thumbURL; } },
- MD5(post, file) { return file.MD5; },
- sMD5(post, file) { return file.MD5?.replace(/[+/=]/g, c => ({'+': '-', '/': '_', '=': ''})[c]); },
- hMD5(post, file) { if (file.MD5) { return (atob(file.MD5).map((c) => `0${c.charCodeAt(0).toString(16)}`.slice(-2))).join(''); } },
- board(post) { return post.board.ID; },
- name(post, file) { return file.name; },
- '%'() { return '%'; },
- semi() { return ';'; }
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * DS104: Avoid inline assignments
+ * DS204: Change includes calls to have a more natural evaluation order
+ * DS207: Consider shorter variations of null checks
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+ var Sauce = {
+ init() {
+ let link;
+ if (!['index', 'thread'].includes(g.VIEW) || !Conf['Sauce']) { return; }
+ $$1.addClass(doc$1, 'show-sauce');
+
+ const links = [];
+ for (link of Conf['sauces'].split('\n')) {
+ var linkData;
+ if ((link[0] !== '#') && (linkData = this.parseLink(link))) {
+ links.push(linkData);
+ }
+ }
+ if (!links.length) { return; }
+
+ this.links = links;
+ this.link = $$1.el('a', {
+ target: '_blank',
+ className: 'sauce'
+ }
+ );
+ return Callbacks.Post.push({
+ name: 'Sauce',
+ cb: this.node
+ });
+ },
+
+ parseLink(link) {
+ if (!(link = link.trim())) { return null; }
+ const parts = dict();
+ const iterable = link.split(/;(?=(?:text|boards|types|regexp|sandbox):?)/);
+ for (let i = 0; i < iterable.length; i++) {
+ var part = iterable[i];
+ if (i === 0) {
+ parts['url'] = part;
+ } else {
+ var m = part.match(/^(\w*):?(.*)$/);
+ parts[m[1]] = m[2];
+ }
+ }
+ if (!parts['text']) { parts['text'] = parts['url'].match(/(\w+)\.\w+\//)?.[1] || '?'; }
+ if ('boards' in parts) {
+ parts['boards'] = Filter.parseBoards(parts['boards']);
+ }
+ if ('regexp' in parts) {
+ try {
+ let regexp;
+ if (regexp = parts['regexp'].match(/^\/(.*)\/(\w*)$/)) {
+ parts['regexp'] = RegExp(regexp[1], regexp[2]);
+ } else {
+ parts['regexp'] = RegExp(parts['regexp']);
+ }
+ } catch (err) {
+ new Notice('warning', [
+ $$1.tn("Invalid regexp for Sauce link:"),
+ $$1.el('br'),
+ $$1.tn(link),
+ $$1.el('br'),
+ $$1.tn(err.message)
+ ], 60);
+ return null;
+ }
+ }
+ return parts;
+ },
+
+ createSauceLink(link, post, file) {
+ let a, matches, needle;
+ const ext = file.url.match(/[^.]*$/)[0];
+ const parts = dict();
+ $$1.extend(parts, link);
+
+ if (!!parts['boards'] && !parts['boards'][`${post.siteID}/${post.boardID}`] && !parts['boards'][`${post.siteID}/*`]) { return null; }
+ if (!!parts['types'] && (needle = ext, !parts['types'].split(',').includes(needle))) { return null; }
+ if (!!parts['regexp'] && (!(matches = file.name.match(parts['regexp'])))) { return null; }
+
+ const missing = [];
+ for (var key of ['url', 'text']) {
+ parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi|\$\d+)/g, function(orig, parameter) {
+ let type;
+ if (parameter[0] === '$') {
+ if (!matches) { return orig; }
+ type = matches[parameter.slice(1)] || '';
+ } else {
+ type = Sauce.formatters[parameter](post, file, ext);
+ if ((type == null)) {
+ missing.push(parameter);
+ return '';
+ }
+ }
+
+ if ((key === 'url') && !['%', 'semi'].includes(parameter)) {
+ if (/^javascript:/i.test(parts['url'])) { type = JSON.stringify(type); }
+ type = encodeURIComponent(type);
+ }
+ return type;
+ });
+ }
+
+ if (g.SITE.areMD5sDeferred?.(post.board) && missing.length && !missing.filter(x => !/^.?MD5$/.test(x)).length) {
+ a = Sauce.link.cloneNode(false);
+ a.dataset.skip = '1';
+ return a;
+ }
+
+ if (missing.length) { return null; }
+
+ a = Sauce.link.cloneNode(false);
+ a.href = parts['url'];
+ a.textContent = parts['text'];
+ if (/^javascript:/i.test(parts['url'])) { a.removeAttribute('target'); }
+ return a;
+ },
+
+ node() {
+ if (this.isClone) { return; }
+ for (var file of this.files) {
+ Sauce.file(this, file);
+ }
+ },
+
+ file(post, file) {
+ let link, node;
+ const nodes = [];
+ const skipped = [];
+ for (link of Sauce.links) {
+ if (node = Sauce.createSauceLink(link, post, file)) {
+ nodes.push($$1.tn(' '), node);
+ if (node.dataset.skip) { skipped.push([link, node]); }
+ }
+ }
+ $$1.add(file.text, nodes);
+
+ if (skipped.length) {
+ var observer = new MutationObserver(function() {
+ if (file.text.dataset.md5) {
+ for ([link, node] of skipped) {
+ var node2;
+ if (node2 = Sauce.createSauceLink(link, post, file)) {
+ $$1.replace(node, node2);
+ }
+ }
+ return observer.disconnect();
+ }
+ });
+ return observer.observe(file.text, {attributes: true});
+ }
+ },
+
+ formatters: {
+ TURL(post, file) { return file.thumbURL; },
+ URL(post, file) { return file.url; },
+ IMG(post, file, ext) { if (['gif', 'jpg', 'jpeg', 'png'].includes(ext)) { return file.url; } else { return file.thumbURL; } },
+ MD5(post, file) { return file.MD5; },
+ sMD5(post, file) { return file.MD5?.replace(/[+/=]/g, c => ({'+': '-', '/': '_', '=': ''})[c]); },
+ hMD5(post, file) { if (file.MD5) { return (atob(file.MD5).map((c) => `0${c.charCodeAt(0).toString(16)}`.slice(-2))).join(''); } },
+ board(post) { return post.board.ID; },
+ name(post, file) { return file.name; },
+ '%'() { return '%'; },
+ semi() { return ';'; }
+ }
};
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS205: Consider reworking code to avoid use of IIFEs
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
-
- var Gallery = {
- init() {
- if (!(this.enabled = Conf['Gallery'] && ['index', 'thread'].includes(g.VIEW))) { return; }
-
- this.delay = Conf['Slide Delay'];
-
- const el = $$1.el('a', {
- href: 'javascript:;',
- title: 'Gallery',
- textContent: '🖼︎',
- });
-
- $$1.on(el, 'click', this.cb.toggle);
-
- Header$1.addShortcut('gallery', el, 530);
-
- return Callbacks.Post.push({
- name: 'Gallery',
- cb: this.node
- });
- },
-
- node() {
- return (() => {
- const result = [];
- for (var file of this.files) {
- if (file.thumb) {
- if (Gallery.nodes) {
- Gallery.generateThumb(this, file);
- Gallery.nodes.total.textContent = Gallery.images.length;
- }
-
- if (!Conf['Image Expansion'] && ((g.SITE.software !== 'tinyboard') || !Main$1.jsEnabled)) {
- result.push($$1.on(file.thumbLink, 'click', Gallery.cb.image));
- } else {
- result.push(undefined);
- }
- }
- }
- return result;
- })();
- },
-
- build(image) {
- let dialog, thumb;
- const {cb} = Gallery;
-
- if (Conf['Fullscreen Gallery']) {
- $$1.one(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', () => $$1.on(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close));
- doc$1.mozRequestFullScreen?.();
- doc$1.webkitRequestFullScreen?.(Element.ALLOW_KEYBOARD_INPUT);
- }
-
- Gallery.images = [];
- const nodes = (Gallery.nodes = {});
- Gallery.fileIDs = dict();
- Gallery.slideshow = false;
-
- nodes.el = (dialog = $$1.el('div',
- {id: 'a-gallery'}));
- $$1.extend(dialog, {innerHTML: galleryPage });
-
- const object = {
- buttons: '.gal-buttons',
- frame: '.gal-image',
- name: '.gal-name',
- count: '.count',
- total: '.total',
- sauce: '.gal-sauce',
- thumbs: '.gal-thumbnails',
- next: '.gal-image a',
- current: '.gal-image img'
- };
- for (var key in object) { var value = object[key]; nodes[key] = $$1(value, dialog); }
-
- const menuButton = $$1('.menu-button', dialog);
- nodes.menu = new UI.Menu('gallery');
-
- $$1.on(nodes.frame, 'click', cb.blank);
- if (Conf['Mouse Wheel Volume']) { $$1.on(nodes.frame, 'wheel', Volume.wheel); }
- $$1.on(nodes.next, 'click', cb.click);
- $$1.on(nodes.name, 'click', ImageCommon.download);
-
- $$1.on($$1('.gal-prev', dialog), 'click', cb.prev);
- $$1.on($$1('.gal-next', dialog), 'click', cb.next);
- $$1.on($$1('.gal-start', dialog), 'click', cb.start);
- $$1.on($$1('.gal-stop', dialog), 'click', cb.stop);
- $$1.on($$1('.gal-close', dialog), 'click', cb.close);
-
- $$1.on(menuButton, 'click', function(e) {
- return nodes.menu.toggle(e, this, g);
- });
-
- for (var entry of Gallery.menu.createSubEntries()) {
- entry.order = 0;
- nodes.menu.addEntry(entry);
- }
-
- $$1.on(d$1, 'keydown', cb.keybinds);
- if (Conf['Keybinds']) { $$1.off(d$1, 'keydown', Keybinds.keydown); }
-
- $$1.on(window, 'resize', Gallery.cb.setHeight);
-
- for (var postThumb of $$(g.SITE.selectors.file.thumb)) {
- var post;
- if (!(post = Get$1.postFromNode(postThumb))) { continue; }
- for (var file of post.files) {
- if (file.thumb) {
- Gallery.generateThumb(post, file);
- // If no image to open is given, pick image we have scrolled to.
- if (!image && Gallery.fileIDs[`${post.fullID}.${file.index}`]) {
- var candidate = file.thumbLink;
- if ((Header$1.getTopOf(candidate) + candidate.getBoundingClientRect().height) >= 0) {
- image = candidate;
- }
- }
- }
- }
- }
- $$1.addClass(doc$1, 'gallery-open');
-
- $$1.add(d$1.body, dialog);
-
- nodes.thumbs.scrollTop = 0;
- nodes.current.parentElement.scrollTop = 0;
-
- if (image) { thumb = $$1(`[href='${image.href}']`, nodes.thumbs); }
- if (!thumb) { thumb = Gallery.images[Gallery.images.length-1]; }
- if (thumb) { Gallery.open(thumb); }
-
- doc$1.style.overflow = 'hidden';
- return nodes.total.textContent = Gallery.images.length;
- },
-
- generateThumb(post, file) {
- if (post.isClone || post.isHidden) { return; }
- if (!file || !file.thumb || (!file.isImage && !file.isVideo && !Conf['PDF in Gallery'])) { return; }
- if (Gallery.fileIDs[`${post.fullID}.${file.index}`]) { return; }
-
- Gallery.fileIDs[`${post.fullID}.${file.index}`] = true;
-
- const thumb = $$1.el('a', {
- className: 'gal-thumb',
- href: file.url,
- target: '_blank',
- title: file.name
- }
- );
-
- thumb.dataset.id = Gallery.images.length;
- thumb.dataset.post = post.fullID;
- thumb.dataset.file = file.index;
-
- const thumbImg = file.thumb.cloneNode(false);
- thumbImg.style.cssText = '';
- $$1.add(thumb, thumbImg);
-
- $$1.on(thumb, 'click', Gallery.cb.open);
-
- Gallery.images.push(thumb);
- return $$1.add(Gallery.nodes.thumbs, thumb);
- },
-
- load(thumb, errorCB) {
- const ext = thumb.href.match(/\w*$/);
- const elType = $$1.getOwn({'webm': 'video', 'mp4': 'video', 'ogv': 'video', 'pdf': 'iframe'}, ext) || 'img';
- const file = $$1.el(elType);
- $$1.extend(file.dataset, thumb.dataset);
- $$1.on(file, 'error', errorCB);
- file.src = thumb.href;
- return file;
- },
-
- open(thumb) {
- let el, file, post;
- const {nodes} = Gallery;
- const oldID = +nodes.current.dataset.id;
- const newID = +thumb.dataset.id;
-
- // Highlight, center selected thumbnail
- if (el = Gallery.images[oldID]) { $$1.rmClass(el, 'gal-highlight'); }
- $$1.addClass(thumb, 'gal-highlight');
- nodes.thumbs.scrollTop = (thumb.offsetTop + (thumb.offsetHeight/2)) - (nodes.thumbs.clientHeight/2);
-
- // Load image or use preloaded image
- if (Gallery.cache?.dataset.id === (''+newID)) {
- file = Gallery.cache;
- $$1.off(file, 'error', Gallery.cacheError);
- $$1.on(file, 'error', Gallery.error);
- } else {
- file = Gallery.load(thumb, Gallery.error);
- }
-
- // Replace old image with new one
- $$1.off(nodes.current, 'error', Gallery.error);
- ImageCommon.pause(nodes.current);
- $$1.replace(nodes.current, file);
- nodes.current = file;
-
- if (file.nodeName === 'VIDEO') {
- file.loop = true;
- Volume.setup(file);
- if (Conf['Autoplay']) { file.play(); }
- if (Conf['Show Controls']) { ImageCommon.addControls(file); }
- }
-
- doc$1.classList.toggle('gal-pdf', file.nodeName === 'IFRAME');
- Gallery.cb.setHeight();
- nodes.count.textContent = +thumb.dataset.id + 1;
- nodes.name.download = (nodes.name.textContent = thumb.title);
- nodes.name.href = thumb.href;
- nodes.frame.scrollTop = 0;
- nodes.next.focus();
-
- // Set sauce links
- $$1.rmAll(nodes.sauce);
- if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) {
- const sauces = [];
- for (var link of Sauce.links) {
- var node;
- if (node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file])) {
- sauces.push($$1.tn(' '), node);
- }
- }
- $$1.add(nodes.sauce, sauces);
- }
-
- // Continue slideshow if moving forward, stop otherwise
- if (Gallery.slideshow && ((newID > oldID) || ((oldID === (Gallery.images.length-1)) && (newID === 0)))) {
- Gallery.setupTimer();
- } else {
- Gallery.cb.stop();
- }
-
- // Scroll to post
- if (Conf['Scroll to Post'] && (post = g.posts.get(file.dataset.post))) {
- Header$1.scrollTo(post.nodes.root);
- }
-
- // Preload next image
- if (isNaN(oldID) || (newID === ((oldID + 1) % Gallery.images.length))) {
- return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError);
- }
- },
-
- error() {
- if (this.error?.code === MediaError.MEDIA_ERR_DECODE) {
- return new Notice('error', 'Corrupt or unplayable video', 30);
- }
- if (ImageCommon.isFromArchive(this)) { return; }
- const post = g.posts.get(this.dataset.post);
- const file = post.files[+this.dataset.file];
- return ImageCommon.error(this, post, file, null, url => {
- if (!url) { return; }
- Gallery.images[+this.dataset.id].href = url;
- if (Gallery.nodes.current === this) { return this.src = url; }
- });
- },
-
- cacheError() {
- return delete Gallery.cache;
- },
-
- cleanupTimer() {
- clearTimeout(Gallery.timeoutID);
- const {current} = Gallery.nodes;
- $$1.off(current, 'canplaythrough load', Gallery.startTimer);
- return $$1.off(current, 'ended', Gallery.cb.next);
- },
-
- startTimer() {
- return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * SECOND);
- },
-
- setupTimer() {
- Gallery.cleanupTimer();
- const {current} = Gallery.nodes;
- const isVideo = current.nodeName === 'VIDEO';
- if (isVideo) { current.play(); }
- if ((isVideo ? current.readyState >= 4 : current.complete) || (current.nodeName === 'IFRAME')) {
- return Gallery.startTimer();
- } else {
- return $$1.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer);
- }
- },
-
- checkTimer() {
- const {current} = Gallery.nodes;
- if ((current.nodeName === 'VIDEO') && !current.paused) {
- $$1.on(current, 'ended', Gallery.cb.next);
- return current.loop = false;
- } else {
- return Gallery.cb.next();
- }
- },
-
- cb: {
- keybinds(e) {
- let key;
- if (!(key = Keybinds.keyCode(e))) { return; }
-
- const cb = (() => { switch (key) {
- case Conf['Close']: case Conf['Open Gallery']:
- return Gallery.cb.close;
- case Conf['Next Gallery Image']:
- return Gallery.cb.next;
- case Conf['Advance Gallery']:
- return Gallery.cb.advance;
- case Conf['Previous Gallery Image']:
- return Gallery.cb.prev;
- case Conf['Pause']:
- return Gallery.cb.pause;
- case Conf['Slideshow']:
- return Gallery.cb.toggleSlideshow;
- case Conf['Rotate image anticlockwise']:
- return Gallery.cb.rotateLeft;
- case Conf['Rotate image clockwise']:
- return Gallery.cb.rotateRight;
- case Conf['Download Gallery Image']:
- return Gallery.cb.download;
- } })();
-
- if (!cb) { return; }
- e.stopPropagation();
- e.preventDefault();
- return cb();
- },
-
- open(e) {
- if (e) { e.preventDefault(); }
- if (this) { return Gallery.open(this); }
- },
-
- image(e) {
- e.preventDefault();
- e.stopPropagation();
- return Gallery.build(this);
- },
-
- prev() {
- return Gallery.cb.open.call(
- Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]
- );
- },
- next() {
- return Gallery.cb.open.call(
- Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]
- );
- },
-
- click(e) {
- if (ImageCommon.onControls(e)) { return; }
- e.preventDefault();
- return Gallery.cb.advance();
- },
-
- advance() { if (!Conf['Autoplay'] && Gallery.nodes.current.paused) { return Gallery.nodes.current.play(); } else { return Gallery.cb.next(); } },
- toggle() { return (Gallery.nodes ? Gallery.cb.close : Gallery.build)(); },
- blank(e) { if (e.target === this) { return Gallery.cb.close(); } },
- toggleSlideshow() { return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); },
-
- download() {
- const name = $$1('.gal-name');
- return name.click();
- },
-
- pause() {
- Gallery.cb.stop();
- const {current} = Gallery.nodes;
- if (current.nodeName === 'VIDEO') { return current[current.paused ? 'play' : 'pause'](); }
- },
-
- start() {
- $$1.addClass(Gallery.nodes.buttons, 'gal-playing');
- Gallery.slideshow = true;
- return Gallery.setupTimer();
- },
-
- stop() {
- if (!Gallery.slideshow) { return; }
- Gallery.cleanupTimer();
- const {current} = Gallery.nodes;
- if (current.nodeName === 'VIDEO') { current.loop = true; }
- $$1.rmClass(Gallery.nodes.buttons, 'gal-playing');
- return Gallery.slideshow = false;
- },
-
- rotateLeft() { return Gallery.cb.rotate(270); },
- rotateRight() { return Gallery.cb.rotate(90); },
-
- rotate: debounce(100, function(delta) {
- const {current} = Gallery.nodes;
- if (current.nodeName === 'IFRAME') { return; }
- current.dataRotate = ((current.dataRotate || 0) + delta) % 360;
- current.style.transform = `rotate(${current.dataRotate}deg)`;
- return Gallery.cb.setHeight();
- }),
-
- close() {
- $$1.off(Gallery.nodes.current, 'error', Gallery.error);
- ImageCommon.pause(Gallery.nodes.current);
- $$1.rm(Gallery.nodes.el);
- $$1.rmClass(doc$1, 'gallery-open');
- if (Conf['Fullscreen Gallery']) {
- $$1.off(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close);
- d$1.mozCancelFullScreen?.();
- d$1.webkitExitFullscreen?.();
- }
- delete Gallery.nodes;
- delete Gallery.fileIDs;
- doc$1.style.overflow = '';
-
- $$1.off(d$1, 'keydown', Gallery.cb.keybinds);
- if (Conf['Keybinds']) { $$1.on(d$1, 'keydown', Keybinds.keydown); }
- $$1.off(window, 'resize', Gallery.cb.setHeight);
- return clearTimeout(Gallery.timeoutID);
- },
-
- setFitness() {
- return (this.checked ? $$1.addClass : $$1.rmClass)(doc$1, `gal-${this.name.toLowerCase().replace(/\s+/g, '-')}`);
- },
-
- setHeight: debounce(100, function () {
- let dim, margin, minHeight;
- const {current, frame} = Gallery.nodes;
- const {style} = current;
-
- if (Conf['Stretch to Fit'] && (dim = g.posts.get(current.dataset.post)?.files[+current.dataset.file].dimensions)) {
- const [width, height] = dim.split('x');
- let containerWidth = frame.clientWidth;
- let containerHeight = doc$1.clientHeight - 25;
- if (((current.dataRotate || 0) % 180) === 90) {
- [containerWidth, containerHeight] = [containerHeight, containerWidth];
- }
- minHeight = Math.min(containerHeight, (height / width) * containerWidth);
- style.minHeight = minHeight + 'px';
- style.minWidth = ((width / height) * minHeight) + 'px';
- } else {
- style.minHeight = (style.minWidth = '');
- }
-
- if (((current.dataRotate || 0) % 180) === 90) {
- style.maxWidth = Conf['Fit Height'] ? `${doc$1.clientHeight - 25}px` : 'none';
- style.maxHeight = Conf['Fit Width'] ? `${frame.clientWidth}px` : 'none';
- margin = (current.clientWidth - current.clientHeight)/2;
- return style.margin = `${margin}px ${-margin}px`;
- } else {
- return style.maxWidth = (style.maxHeight = (style.margin = ''));
- }
- }),
-
- setDelay() { return Gallery.delay = +this.value; }
- },
-
- menu: {
- init() {
- if (!Gallery.enabled) { return; }
-
- const el = $$1.el('span', {
- textContent: 'Gallery',
- className: 'gallery-link'
- }
- );
-
- return Header$1.menu.addEntry({
- el,
- order: 105,
- subEntries: Gallery.menu.createSubEntries()
- });
- },
-
- createSubEntry(name) {
- const label = UI.checkbox(name, name);
- const input = label.firstElementChild;
- if (['Hide Thumbnails', 'Fit Width', 'Fit Height'].includes(name)) { $$1.on(input, 'change', Gallery.cb.setFitness); }
- $$1.event('change', null, input);
- $$1.on(input, 'change', $$1.cb.checked);
- if (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit'].includes(name)) { $$1.on(input, 'change', Gallery.cb.setHeight); }
- return {el: label};
- },
-
- createSubEntries() {
- const subEntries = (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'].map((item) => Gallery.menu.createSubEntry(item)));
-
- const delayLabel = $$1.el('label', {innerHTML: 'Slide Delay:
'});
- const delayInput = delayLabel.firstElementChild;
- delayInput.value = Gallery.delay;
- $$1.on(delayInput, 'change', Gallery.cb.setDelay);
- $$1.on(delayInput, 'change', $$1.cb.value);
- subEntries.push({el: delayLabel});
-
- return subEntries;
- }
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * DS205: Consider reworking code to avoid use of IIFEs
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+
+ var Gallery = {
+ init() {
+ if (!(this.enabled = Conf['Gallery'] && ['index', 'thread'].includes(g.VIEW))) { return; }
+
+ this.delay = Conf['Slide Delay'];
+
+ const el = $$1.el('a', {
+ href: 'javascript:;',
+ title: 'Gallery',
+ textContent: '🖼︎',
+ });
+
+ $$1.on(el, 'click', this.cb.toggle);
+
+ Header$1.addShortcut('gallery', el, 530);
+
+ return Callbacks.Post.push({
+ name: 'Gallery',
+ cb: this.node
+ });
+ },
+
+ node() {
+ return (() => {
+ const result = [];
+ for (var file of this.files) {
+ if (file.thumb) {
+ if (Gallery.nodes) {
+ Gallery.generateThumb(this, file);
+ Gallery.nodes.total.textContent = Gallery.images.length;
+ }
+
+ if (!Conf['Image Expansion'] && ((g.SITE.software !== 'tinyboard') || !Main$1.jsEnabled)) {
+ result.push($$1.on(file.thumbLink, 'click', Gallery.cb.image));
+ } else {
+ result.push(undefined);
+ }
+ }
+ }
+ return result;
+ })();
+ },
+
+ build(image) {
+ let dialog, thumb;
+ const {cb} = Gallery;
+
+ if (Conf['Fullscreen Gallery']) {
+ $$1.one(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', () => $$1.on(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close));
+ doc$1.mozRequestFullScreen?.();
+ doc$1.webkitRequestFullScreen?.(Element.ALLOW_KEYBOARD_INPUT);
+ }
+
+ Gallery.images = [];
+ const nodes = (Gallery.nodes = {});
+ Gallery.fileIDs = dict();
+ Gallery.slideshow = false;
+
+ nodes.el = (dialog = $$1.el('div',
+ {id: 'a-gallery'}));
+ $$1.extend(dialog, {innerHTML: galleryPage });
+
+ const object = {
+ buttons: '.gal-buttons',
+ frame: '.gal-image',
+ name: '.gal-name',
+ count: '.count',
+ total: '.total',
+ sauce: '.gal-sauce',
+ thumbs: '.gal-thumbnails',
+ next: '.gal-image a',
+ current: '.gal-image img'
+ };
+ for (var key in object) { var value = object[key]; nodes[key] = $$1(value, dialog); }
+
+ const menuButton = $$1('.menu-button', dialog);
+ nodes.menu = new UI.Menu('gallery');
+
+ $$1.on(nodes.frame, 'click', cb.blank);
+ if (Conf['Mouse Wheel Volume']) { $$1.on(nodes.frame, 'wheel', Volume.wheel); }
+ $$1.on(nodes.next, 'click', cb.click);
+ $$1.on(nodes.name, 'click', ImageCommon.download);
+
+ $$1.on($$1('.gal-prev', dialog), 'click', cb.prev);
+ $$1.on($$1('.gal-next', dialog), 'click', cb.next);
+ $$1.on($$1('.gal-start', dialog), 'click', cb.start);
+ $$1.on($$1('.gal-stop', dialog), 'click', cb.stop);
+ $$1.on($$1('.gal-close', dialog), 'click', cb.close);
+
+ $$1.on(menuButton, 'click', function(e) {
+ return nodes.menu.toggle(e, this, g);
+ });
+
+ for (var entry of Gallery.menu.createSubEntries()) {
+ entry.order = 0;
+ nodes.menu.addEntry(entry);
+ }
+
+ $$1.on(d$1, 'keydown', cb.keybinds);
+ if (Conf['Keybinds']) { $$1.off(d$1, 'keydown', Keybinds.keydown); }
+
+ $$1.on(window, 'resize', Gallery.cb.setHeight);
+
+ for (var postThumb of $$(g.SITE.selectors.file.thumb)) {
+ var post;
+ if (!(post = Get$1.postFromNode(postThumb))) { continue; }
+ for (var file of post.files) {
+ if (file.thumb) {
+ Gallery.generateThumb(post, file);
+ // If no image to open is given, pick image we have scrolled to.
+ if (!image && Gallery.fileIDs[`${post.fullID}.${file.index}`]) {
+ var candidate = file.thumbLink;
+ if ((Header$1.getTopOf(candidate) + candidate.getBoundingClientRect().height) >= 0) {
+ image = candidate;
+ }
+ }
+ }
+ }
+ }
+ $$1.addClass(doc$1, 'gallery-open');
+
+ $$1.add(d$1.body, dialog);
+
+ nodes.thumbs.scrollTop = 0;
+ nodes.current.parentElement.scrollTop = 0;
+
+ if (image) { thumb = $$1(`[href='${image.href}']`, nodes.thumbs); }
+ if (!thumb) { thumb = Gallery.images[Gallery.images.length-1]; }
+ if (thumb) { Gallery.open(thumb); }
+
+ doc$1.style.overflow = 'hidden';
+ return nodes.total.textContent = Gallery.images.length;
+ },
+
+ generateThumb(post, file) {
+ if (post.isClone || post.isHidden) { return; }
+ if (!file || !file.thumb || (!file.isImage && !file.isVideo && !Conf['PDF in Gallery'])) { return; }
+ if (Gallery.fileIDs[`${post.fullID}.${file.index}`]) { return; }
+
+ Gallery.fileIDs[`${post.fullID}.${file.index}`] = true;
+
+ const thumb = $$1.el('a', {
+ className: 'gal-thumb',
+ href: file.url,
+ target: '_blank',
+ title: file.name
+ }
+ );
+
+ thumb.dataset.id = Gallery.images.length;
+ thumb.dataset.post = post.fullID;
+ thumb.dataset.file = file.index;
+
+ const thumbImg = file.thumb.cloneNode(false);
+ thumbImg.style.cssText = '';
+ $$1.add(thumb, thumbImg);
+
+ $$1.on(thumb, 'click', Gallery.cb.open);
+
+ Gallery.images.push(thumb);
+ return $$1.add(Gallery.nodes.thumbs, thumb);
+ },
+
+ load(thumb, errorCB) {
+ const ext = thumb.href.match(/\w*$/);
+ const elType = $$1.getOwn({'webm': 'video', 'mp4': 'video', 'ogv': 'video', 'pdf': 'iframe'}, ext) || 'img';
+ const file = $$1.el(elType);
+ $$1.extend(file.dataset, thumb.dataset);
+ $$1.on(file, 'error', errorCB);
+ file.src = thumb.href;
+ return file;
+ },
+
+ open(thumb) {
+ let el, file, post;
+ const {nodes} = Gallery;
+ const oldID = +nodes.current.dataset.id;
+ const newID = +thumb.dataset.id;
+
+ // Highlight, center selected thumbnail
+ if (el = Gallery.images[oldID]) { $$1.rmClass(el, 'gal-highlight'); }
+ $$1.addClass(thumb, 'gal-highlight');
+ nodes.thumbs.scrollTop = (thumb.offsetTop + (thumb.offsetHeight/2)) - (nodes.thumbs.clientHeight/2);
+
+ // Load image or use preloaded image
+ if (Gallery.cache?.dataset.id === (''+newID)) {
+ file = Gallery.cache;
+ $$1.off(file, 'error', Gallery.cacheError);
+ $$1.on(file, 'error', Gallery.error);
+ } else {
+ file = Gallery.load(thumb, Gallery.error);
+ }
+
+ // Replace old image with new one
+ $$1.off(nodes.current, 'error', Gallery.error);
+ ImageCommon.pause(nodes.current);
+ $$1.replace(nodes.current, file);
+ nodes.current = file;
+
+ if (file.nodeName === 'VIDEO') {
+ file.loop = true;
+ Volume.setup(file);
+ if (Conf['Autoplay']) { file.play(); }
+ if (Conf['Show Controls']) { ImageCommon.addControls(file); }
+ }
+
+ doc$1.classList.toggle('gal-pdf', file.nodeName === 'IFRAME');
+ Gallery.cb.setHeight();
+ nodes.count.textContent = +thumb.dataset.id + 1;
+ nodes.name.download = (nodes.name.textContent = thumb.title);
+ nodes.name.href = thumb.href;
+ nodes.frame.scrollTop = 0;
+ nodes.next.focus();
+
+ // Set sauce links
+ $$1.rmAll(nodes.sauce);
+ if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) {
+ const sauces = [];
+ for (var link of Sauce.links) {
+ var node;
+ if (node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file])) {
+ sauces.push($$1.tn(' '), node);
+ }
+ }
+ $$1.add(nodes.sauce, sauces);
+ }
+
+ // Continue slideshow if moving forward, stop otherwise
+ if (Gallery.slideshow && ((newID > oldID) || ((oldID === (Gallery.images.length-1)) && (newID === 0)))) {
+ Gallery.setupTimer();
+ } else {
+ Gallery.cb.stop();
+ }
+
+ // Scroll to post
+ if (Conf['Scroll to Post'] && (post = g.posts.get(file.dataset.post))) {
+ Header$1.scrollTo(post.nodes.root);
+ }
+
+ // Preload next image
+ if (isNaN(oldID) || (newID === ((oldID + 1) % Gallery.images.length))) {
+ return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError);
+ }
+ },
+
+ error() {
+ if (this.error?.code === MediaError.MEDIA_ERR_DECODE) {
+ return new Notice('error', 'Corrupt or unplayable video', 30);
+ }
+ if (ImageCommon.isFromArchive(this)) { return; }
+ const post = g.posts.get(this.dataset.post);
+ const file = post.files[+this.dataset.file];
+ return ImageCommon.error(this, post, file, null, url => {
+ if (!url) { return; }
+ Gallery.images[+this.dataset.id].href = url;
+ if (Gallery.nodes.current === this) { return this.src = url; }
+ });
+ },
+
+ cacheError() {
+ return delete Gallery.cache;
+ },
+
+ cleanupTimer() {
+ clearTimeout(Gallery.timeoutID);
+ const {current} = Gallery.nodes;
+ $$1.off(current, 'canplaythrough load', Gallery.startTimer);
+ return $$1.off(current, 'ended', Gallery.cb.next);
+ },
+
+ startTimer() {
+ return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * SECOND);
+ },
+
+ setupTimer() {
+ Gallery.cleanupTimer();
+ const {current} = Gallery.nodes;
+ const isVideo = current.nodeName === 'VIDEO';
+ if (isVideo) { current.play(); }
+ if ((isVideo ? current.readyState >= 4 : current.complete) || (current.nodeName === 'IFRAME')) {
+ return Gallery.startTimer();
+ } else {
+ return $$1.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer);
+ }
+ },
+
+ checkTimer() {
+ const {current} = Gallery.nodes;
+ if ((current.nodeName === 'VIDEO') && !current.paused) {
+ $$1.on(current, 'ended', Gallery.cb.next);
+ return current.loop = false;
+ } else {
+ return Gallery.cb.next();
+ }
+ },
+
+ cb: {
+ keybinds(e) {
+ let key;
+ if (!(key = Keybinds.keyCode(e))) { return; }
+
+ const cb = (() => { switch (key) {
+ case Conf['Close']: case Conf['Open Gallery']:
+ return Gallery.cb.close;
+ case Conf['Next Gallery Image']:
+ return Gallery.cb.next;
+ case Conf['Advance Gallery']:
+ return Gallery.cb.advance;
+ case Conf['Previous Gallery Image']:
+ return Gallery.cb.prev;
+ case Conf['Pause']:
+ return Gallery.cb.pause;
+ case Conf['Slideshow']:
+ return Gallery.cb.toggleSlideshow;
+ case Conf['Rotate image anticlockwise']:
+ return Gallery.cb.rotateLeft;
+ case Conf['Rotate image clockwise']:
+ return Gallery.cb.rotateRight;
+ case Conf['Download Gallery Image']:
+ return Gallery.cb.download;
+ } })();
+
+ if (!cb) { return; }
+ e.stopPropagation();
+ e.preventDefault();
+ return cb();
+ },
+
+ open(e) {
+ if (e) { e.preventDefault(); }
+ if (this) { return Gallery.open(this); }
+ },
+
+ image(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ return Gallery.build(this);
+ },
+
+ prev() {
+ return Gallery.cb.open.call(
+ Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]
+ );
+ },
+ next() {
+ return Gallery.cb.open.call(
+ Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]
+ );
+ },
+
+ click(e) {
+ if (ImageCommon.onControls(e)) { return; }
+ e.preventDefault();
+ return Gallery.cb.advance();
+ },
+
+ advance() { if (!Conf['Autoplay'] && Gallery.nodes.current.paused) { return Gallery.nodes.current.play(); } else { return Gallery.cb.next(); } },
+ toggle() { return (Gallery.nodes ? Gallery.cb.close : Gallery.build)(); },
+ blank(e) { if (e.target === this) { return Gallery.cb.close(); } },
+ toggleSlideshow() { return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); },
+
+ download() {
+ const name = $$1('.gal-name');
+ return name.click();
+ },
+
+ pause() {
+ Gallery.cb.stop();
+ const {current} = Gallery.nodes;
+ if (current.nodeName === 'VIDEO') { return current[current.paused ? 'play' : 'pause'](); }
+ },
+
+ start() {
+ $$1.addClass(Gallery.nodes.buttons, 'gal-playing');
+ Gallery.slideshow = true;
+ return Gallery.setupTimer();
+ },
+
+ stop() {
+ if (!Gallery.slideshow) { return; }
+ Gallery.cleanupTimer();
+ const {current} = Gallery.nodes;
+ if (current.nodeName === 'VIDEO') { current.loop = true; }
+ $$1.rmClass(Gallery.nodes.buttons, 'gal-playing');
+ return Gallery.slideshow = false;
+ },
+
+ rotateLeft() { return Gallery.cb.rotate(270); },
+ rotateRight() { return Gallery.cb.rotate(90); },
+
+ rotate: debounce(100, function(delta) {
+ const {current} = Gallery.nodes;
+ if (current.nodeName === 'IFRAME') { return; }
+ current.dataRotate = ((current.dataRotate || 0) + delta) % 360;
+ current.style.transform = `rotate(${current.dataRotate}deg)`;
+ return Gallery.cb.setHeight();
+ }),
+
+ close() {
+ $$1.off(Gallery.nodes.current, 'error', Gallery.error);
+ ImageCommon.pause(Gallery.nodes.current);
+ $$1.rm(Gallery.nodes.el);
+ $$1.rmClass(doc$1, 'gallery-open');
+ if (Conf['Fullscreen Gallery']) {
+ $$1.off(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close);
+ d$1.mozCancelFullScreen?.();
+ d$1.webkitExitFullscreen?.();
+ }
+ delete Gallery.nodes;
+ delete Gallery.fileIDs;
+ doc$1.style.overflow = '';
+
+ $$1.off(d$1, 'keydown', Gallery.cb.keybinds);
+ if (Conf['Keybinds']) { $$1.on(d$1, 'keydown', Keybinds.keydown); }
+ $$1.off(window, 'resize', Gallery.cb.setHeight);
+ return clearTimeout(Gallery.timeoutID);
+ },
+
+ setFitness() {
+ return (this.checked ? $$1.addClass : $$1.rmClass)(doc$1, `gal-${this.name.toLowerCase().replace(/\s+/g, '-')}`);
+ },
+
+ setHeight: debounce(100, function () {
+ let dim, margin, minHeight;
+ const {current, frame} = Gallery.nodes;
+ const {style} = current;
+
+ if (Conf['Stretch to Fit'] && (dim = g.posts.get(current.dataset.post)?.files[+current.dataset.file].dimensions)) {
+ const [width, height] = dim.split('x');
+ let containerWidth = frame.clientWidth;
+ let containerHeight = doc$1.clientHeight - 25;
+ if (((current.dataRotate || 0) % 180) === 90) {
+ [containerWidth, containerHeight] = [containerHeight, containerWidth];
+ }
+ minHeight = Math.min(containerHeight, (height / width) * containerWidth);
+ style.minHeight = minHeight + 'px';
+ style.minWidth = ((width / height) * minHeight) + 'px';
+ } else {
+ style.minHeight = (style.minWidth = '');
+ }
+
+ if (((current.dataRotate || 0) % 180) === 90) {
+ style.maxWidth = Conf['Fit Height'] ? `${doc$1.clientHeight - 25}px` : 'none';
+ style.maxHeight = Conf['Fit Width'] ? `${frame.clientWidth}px` : 'none';
+ margin = (current.clientWidth - current.clientHeight)/2;
+ return style.margin = `${margin}px ${-margin}px`;
+ } else {
+ return style.maxWidth = (style.maxHeight = (style.margin = ''));
+ }
+ }),
+
+ setDelay() { return Gallery.delay = +this.value; }
+ },
+
+ menu: {
+ init() {
+ if (!Gallery.enabled) { return; }
+
+ const el = $$1.el('span', {
+ textContent: 'Gallery',
+ className: 'gallery-link'
+ }
+ );
+
+ return Header$1.menu.addEntry({
+ el,
+ order: 105,
+ subEntries: Gallery.menu.createSubEntries()
+ });
+ },
+
+ createSubEntry(name) {
+ const label = UI.checkbox(name, name);
+ const input = label.firstElementChild;
+ if (['Hide Thumbnails', 'Fit Width', 'Fit Height'].includes(name)) { $$1.on(input, 'change', Gallery.cb.setFitness); }
+ $$1.event('change', null, input);
+ $$1.on(input, 'change', $$1.cb.checked);
+ if (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit'].includes(name)) { $$1.on(input, 'change', Gallery.cb.setHeight); }
+ return {el: label};
+ },
+
+ createSubEntries() {
+ const subEntries = (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'].map((item) => Gallery.menu.createSubEntry(item)));
+
+ const delayLabel = $$1.el('label', {innerHTML: 'Slide Delay:
'});
+ const delayInput = delayLabel.firstElementChild;
+ delayInput.value = Gallery.delay;
+ $$1.on(delayInput, 'change', Gallery.cb.setDelay);
+ $$1.on(delayInput, 'change', $$1.cb.value);
+ subEntries.push({el: delayLabel});
+
+ return subEntries;
+ }
+ }
};
- var EmbeddingPage = `
-
+ var EmbeddingPage = `
+
`;
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS205: Consider reworking code to avoid use of IIFEs
- * DS207: Consider shorter variations of null checks
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
-
- var Embedding = {
- init() {
- if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['Linkify'] || (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview'])) { return; }
- this.types = dict();
- for (var type of this.ordered_types) { this.types[type.key] = type; }
-
- if (Conf['Embedding'] && (g.VIEW !== 'archive')) {
- this.dialog = UI.dialog('embedding',
- { innerHTML: EmbeddingPage });
- this.media = $$1('#media-embed', this.dialog);
- $$1.one(d$1, '4chanXInitFinished', this.ready);
- $$1.on(d$1, 'IndexRefreshInternal', () => g.posts.forEach(function(post) {
- for (post of [post, ...post.clones]) {
- for (var embed of post.nodes.embedlinks) {
- Embedding.cb.catalogRemove.call(embed);
- }
- }
- }));
- }
- if (Conf['Link Title']) {
- return $$1.on(d$1, '4chanXInitFinished PostsInserted', function() {
- for (var key in Embedding.types) {
- var service = Embedding.types[key];
- if (service.title?.batchSize) {
- Embedding.flushTitles(service.title);
- }
- }
- });
- }
- },
-
- events(post) {
- let el, i, items;
- if (g.VIEW === 'archive') { return; }
- if (Conf['Embedding']) {
- i = 0;
- items = (post.nodes.embedlinks = $$('.embedder', post.nodes.comment));
- while ((el = items[i++])) {
- $$1.on(el, 'click', Embedding.cb.click);
- if ($$1.hasClass(el, 'embedded')) { Embedding.cb.toggle.call(el); }
- }
- }
- if (Conf['Cover Preview']) {
- i = 0;
- items = $$('.linkify', post.nodes.comment);
- while ((el = items[i++])) {
- var data;
- if (data = Embedding.services(el)) {
- Embedding.preview(data);
- }
- }
- return;
- }
- },
-
- process(link, post) {
- let data;
- if (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview']) { return; }
- if ($$1.x('ancestor::pre', link)) { return; }
- if (data = Embedding.services(link)) {
- data.post = post;
- if (Conf['Embedding'] && (g.VIEW !== 'archive')) { Embedding.embed(data); }
- if (Conf['Link Title']) { Embedding.title(data); }
- if (Conf['Cover Preview'] && (g.VIEW !== 'archive')) { return Embedding.preview(data); }
- }
- },
-
- services(link) {
- const {href} = link;
- for (var type of Embedding.ordered_types) {
- var match;
- if (match = type.regExp.exec(href)) {
- return {key: type.key, uid: match[1], options: match[2], link};
- }
- }
- },
-
- embed(data) {
- const {key, uid, options, link, post} = data;
- const {href} = link;
-
- $$1.addClass(link, key.toLowerCase());
-
- const embed = $$1.el('a', {
- className: 'embedder',
- href: 'javascript:;'
- }
- ,
- {innerHTML: '(
unembed)'});
-
- const object = {key, uid, options, href};
- for (var name in object) { var value = object[name]; embed.dataset[name] = value; }
-
- $$1.on(embed, 'click', Embedding.cb.click);
- $$1.after(link, [$$1.tn(' '), embed]);
- post.nodes.embedlinks.push(embed);
-
- if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {
- if ($$1.hasClass(doc$1, 'catalog-mode')) {
- return $$1.addClass(embed, 'embed-removed');
- } else {
- return Embedding.cb.toggle.call(embed);
- }
- }
- },
-
- ready() {
- if (!Main$1.isThisPageLegit()) { return; }
- $$1.addClass(Embedding.dialog, 'empty');
- $$1.on($$1('.close', Embedding.dialog), 'click', Embedding.closeFloat);
- $$1.on($$1('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed);
- $$1.on($$1('.jump', Embedding.dialog), 'click', function() {
- if (doc$1.contains(Embedding.lastEmbed)) { return Header$1.scrollTo(Embedding.lastEmbed); }
- });
- return $$1.add(d$1.body, Embedding.dialog);
- },
-
- closeFloat() {
- delete Embedding.lastEmbed;
- $$1.addClass(Embedding.dialog, 'empty');
- return $$1.replace(Embedding.media.firstChild, $$1.el('div'));
- },
-
- dragEmbed() {
- // only webkit can handle a blocking div
- const {style} = Embedding.media;
- if (Embedding.dragEmbed.mouseup) {
- $$1.off(d$1, 'mouseup', Embedding.dragEmbed);
- Embedding.dragEmbed.mouseup = false;
- style.pointerEvents = '';
- return;
- }
- $$1.on(d$1, 'mouseup', Embedding.dragEmbed);
- Embedding.dragEmbed.mouseup = true;
- return style.pointerEvents = 'none';
- },
-
- title(data) {
- let service;
- const {key, uid, options, link, post} = data;
- if (!(service = Embedding.types[key].title)) { return; }
- $$1.addClass(link, key.toLowerCase());
- if (service.batchSize) {
- (service.queue || (service.queue = [])).push(data);
- if (service.queue.length >= service.batchSize) {
- return Embedding.flushTitles(service);
- }
- } else {
- return CrossOrigin$1.cache(service.api(uid), (function() { return Embedding.cb.title(this, data); }));
- }
- },
-
- flushTitles(service) {
- let data;
- const {queue} = service;
- if (!queue?.length) { return; }
- service.queue = [];
- const cb = function() {
- for (data of queue) { Embedding.cb.title(this, data); }
- };
- return CrossOrigin$1.cache(service.api((() => {
- const result = [];
- for (data of queue) { result.push(data.uid);
- }
- return result;
- })()), cb);
- },
-
- preview(data) {
- let service;
- const {key, uid, link} = data;
- if (!(service = Embedding.types[key].preview)) { return; }
- return $$1.on(link, 'mouseover', function(e) {
- const src = service.url(uid);
- const {height} = service;
- const el = $$1.el('img', {
- src,
- id: 'ihover'
- }
- );
- $$1.add(Header$1.hover, el);
- return UI.hover({
- root: link,
- el,
- latestEvent: e,
- endEvents: 'mouseout click',
- height
- });
- });
- },
-
- cb: {
- click(e) {
- e.preventDefault();
- if (!$$1.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $$1.hasClass(doc$1, 'catalog-mode'))) {
- let div;
- if (!(div = Embedding.media.firstChild)) { return; }
- $$1.replace(div, Embedding.cb.embed(this));
- Embedding.lastEmbed = Get$1.postFromNode(this).nodes.root;
- return $$1.rmClass(Embedding.dialog, 'empty');
- } else {
- return Embedding.cb.toggle.call(this);
- }
- },
-
- toggle() {
- if ($$1.hasClass(this, "embedded")) {
- $$1.rm(this.nextElementSibling);
- } else {
- $$1.after(this, Embedding.cb.embed(this));
- }
- return $$1.toggleClass(this, 'embedded');
- },
-
- embed(a) {
- // We create an element to embed
- let el, type;
- const container = $$1.el('div', {className: 'media-embed'});
- $$1.add(container, (el = (type = Embedding.types[a.dataset.key]).el(a)));
-
- // Set style values.
- el.style.cssText = (type.style != null) ?
- type.style
- :
- 'border: none; width: 640px; height: 360px;';
-
- return container;
- },
-
- catalogRemove() {
- const isCatalog = $$1.hasClass(doc$1, 'catalog-mode');
- if ((isCatalog && $$1.hasClass(this, 'embedded')) || (!isCatalog && $$1.hasClass(this, 'embed-removed'))) {
- Embedding.cb.toggle.call(this);
- return $$1.toggleClass(this, 'embed-removed');
- }
- },
-
- title(req, data) {
- let text;
- const {key, uid, options, link, post} = data;
- const service = Embedding.types[key].title;
-
- let {status} = req;
- if ([200, 304].includes(status) && service.status) {
- status = service.status(req.response)[0];
- }
-
- if (!status) { return; }
-
- text = `[${key}] ${(() => { switch (status) {
- case 200: case 304:
- text = service.text(req.response, uid);
- if (typeof text === 'string') {
- return text;
- } else {
- return text = link.textContent;
- }
- case 404:
- return "Not Found";
- case 403: case 401:
- return "Forbidden or Private";
- default:
- return `${status}'d`;
- } })()
- }`;
-
- link.dataset.original = link.textContent;
- link.textContent = text;
- for (var post2 of post.clones) {
- for (var link2 of $$('a.linkify', post2.nodes.comment)) {
- if (link2.href === link.href) {
- if (link2.dataset.original == null) { link2.dataset.original = link2.textContent; }
- link2.textContent = text;
- }
- }
- }
- }
- },
-
- ordered_types: [{
- key: 'audio',
- regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i,
- style: '',
- el(a) {
- return $$1.el('audio', {
- controls: true,
- preload: 'auto',
- src: a.dataset.href
- }
- );
- }
- }
- , {
- key: 'image',
- regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i,
- style: '',
- el(a) {
- const hrefEsc = E(a.dataset.href);
- return $$1.el('div', { innerHTML: `

`});
- }
- }
- , {
- key: 'video',
- regExp: /^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i,
- style: 'max-width: 80vw; max-height: 80vh;',
- el(a) {
- const el = $$1.el('video', {
- hidden: true,
- controls: true,
- preload: 'auto',
- src: a.dataset.href,
- loop: ImageHost.test(a.dataset.href.split('/')[2])
- });
- $$1.on(el, 'loadedmetadata', function() {
- if ((el.videoHeight === 0) && el.parentNode) {
- return $$1.replace(el, Embedding.types.audio.el(a));
- } else {
- return el.hidden = false;
- }
- });
- return el;
- }
- }
- , {
- key: 'PeerTube',
- regExp: /^(\w+:\/\/[^\/]+\/videos\/watch\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12})(.*)/,
- el(a) {
- let start;
- const options = (start = a.dataset.options.match(/[?&](start=\w+)/)) ? `?${start[1]}` : '';
- const el = $$1.el('iframe',
- {src: a.dataset.uid.replace('/videos/watch/', '/videos/embed/') + options});
- el.setAttribute("allowfullscreen", "true");
- return el;
- }
- }
- , {
- key: 'BitChute',
- regExp: /^\w+:\/\/(?:www\.)?bitchute\.com\/video\/([\w\-]+)/,
- el(a) {
- const el = $$1.el('iframe',
- {src: `https://www.bitchute.com/embed/${a.dataset.uid}/`});
- el.setAttribute("allowfullscreen", "true");
- return el;
- }
- }
- , {
- key: 'Clyp',
- regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w{8})/,
- style: 'border: 0; width: 640px; height: 160px;',
- el(a) {
- return $$1.el('iframe',
- {src: `https://clyp.it/${a.dataset.uid}/widget`});
- },
- title: {
- api(uid) { return `https://api.clyp.it/oembed?url=https://clyp.it/${uid}`; },
- text(_) { return _.title; }
- }
- }
- , {
- key: 'Dailymotion',
- regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/,
- el(a) {
- let start;
- const options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? `?${start[1]}` : '';
- const el = $$1.el('iframe',
- {src: `//www.dailymotion.com/embed/video/${a.dataset.uid}${options}`});
- el.setAttribute("allowfullscreen", "true");
- return el;
- },
- title: {
- api(uid) { return `https://api.dailymotion.com/video/${uid}`; },
- text(_) { return _.title; }
- },
- preview: {
- url(uid) { return `https://www.dailymotion.com/thumbnail/video/${uid}`; },
- height: 240
- }
- }
- , {
- key: 'Gfycat',
- regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
- el(a) {
- const el = $$1.el('iframe',
- {src: `//gfycat.com/ifr/${a.dataset.uid}`});
- el.setAttribute("allowfullscreen", "true");
- return el;
- }
- }
- , {
- key: 'Gist',
- regExp: /^\w+:\/\/gist\.github\.com\/[\w\-]+\/(\w+)/,
- style: '',
- el: (function() {
- let counter = 0;
- return function(a) {
- const el = $$1.el('pre', {
- hidden: true,
- id: `gist-embed-${counter++}`
- }
- );
- CrossOrigin$1.cache(`https://api.github.com/gists/${a.dataset.uid}`, function() {
- el.textContent = Object.values(this.response.files)[0].content;
- el.className = 'prettyprint';
- $$1.global(() => window.prettyPrint?.((function() {}), document.getElementById(document.currentScript.dataset.id).parentNode)
- , {id: el.id});
- return el.hidden = false;
- });
- return el;
- };
- })(),
- title: {
- api(uid) { return `https://api.github.com/gists/${uid}`; },
- text({files}) {
- for (var file in files) { if (files.hasOwnProperty(file)) { return file; } }
- }
- }
- }
- , {
- key: 'InstallGentoo',
- regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,
- el(a) {
- return $$1.el('iframe',
- {src: `https://paste.installgentoo.com/view/embed/${a.dataset.uid}`});
- }
- }
- , {
- key: 'LiveLeak',
- regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*[tif]=(\w+)/,
- el(a) {
- const el = $$1.el('iframe',
- {src: `https://www.liveleak.com/e/${a.dataset.uid}`,});
- el.setAttribute("allowfullscreen", "true");
- return el;
- }
- }
- , {
- key: 'Loopvid',
- regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|m2|pc|1c|pi|ni|wl|ko|mm|ic|gc)\/[\w\-\/]+(?:,[\w\-\/]+)*|fc\/\w+\/\d+|https?:\/\/.+)/,
- style: 'max-width: 80vw; max-height: 80vh;',
- el(a) {
- const el = $$1.el('video', {
- controls: true,
- preload: 'auto',
- loop: true
- }
- );
- if (/^http/.test(a.dataset.uid)) {
- $$1.add(el, $$1.el('source', {src: a.dataset.uid}));
- return el;
- }
- const [_, host, names] = a.dataset.uid.match(/(\w+)\/(.*)/);
- const types = (() => { switch (host) {
- case 'gd': case 'wu': case 'fc': return [''];
- case 'gc': return ['giant', 'fat', 'zippy'];
- default: return ['.webm', '.mp4'];
- } })();
- for (var name of names.split(',')) {
- for (var type of types) {
- var base = `${name}${type}`;
- var urls = (() => { switch (host) {
- // list from src/common.py at http://loopvid.appspot.com/source.html
- case 'pf': return [`https://kastden.org/_loopvid_media/pf/${base}`, `https://web.archive.org/web/2/http://a.pomf.se/${base}`];
- case 'kd': return [`https://kastden.org/loopvid/${base}`];
- case 'lv': return [`https://lv.kastden.org/${base}`];
- case 'gd': return [`https://docs.google.com/uc?export=download&id=${base}`];
- case 'gh': return [`https://googledrive.com/host/${base}`];
- case 'db': return [`https://dl.dropboxusercontent.com/u/${base}`];
- case 'dx': return [`https://dl.dropboxusercontent.com/${base}`];
- case 'nn': return [`https://kastden.org/_loopvid_media/nn/${base}`];
- case 'cp': return [`https://copy.com/${base}`];
- case 'wu': return [`http://webmup.com/${base}/vid.webm`];
- case 'ig': return [`https://i.imgur.com/${base}`];
- case 'ky': return [`https://kastden.org/_loopvid_media/ky/${base}`];
- case 'mf': return [`https://kastden.org/_loopvid_media/mf/${base}`, `https://web.archive.org/web/2/https://d.maxfile.ro/${base}`];
- case 'm2': return [`https://kastden.org/_loopvid_media/m2/${base}`];
- case 'pc': return [`https://kastden.org/_loopvid_media/pc/${base}`, `https://web.archive.org/web/2/http://a.pomf.cat/${base}`];
- case '1c': return [`http://b.1339.cf/${base}`];
- case 'pi': return [`https://kastden.org/_loopvid_media/pi/${base}`, `https://web.archive.org/web/2/https://u.pomf.is/${base}`];
- case 'ni': return [`https://kastden.org/_loopvid_media/ni/${base}`, `https://web.archive.org/web/2/https://u.nya.is/${base}`];
- case 'wl': return [`http://webm.land/media/${base}`];
- case 'ko': return [`https://kordy.kastden.org/loopvid/${base}`];
- case 'mm': return [`https://kastden.org/_loopvid_media/mm/${base}`, `https://web.archive.org/web/2/https://my.mixtape.moe/${base}`];
- case 'ic': return [`https://media.8ch.net/file_store/${base}`];
- case 'fc': return [`//${ImageHost.host()}/${base}.webm`];
- case 'gc': return [`https://${type}.gfycat.com/${name}.webm`];
- } })();
-
- for (var url of urls) {
- $$1.add(el, $$1.el('source', {src: url}));
- }
- }
- }
- return el;
- }
- }
- , {
- key: 'Openings.moe',
- regExp: /^\w+:\/\/openings.moe\/\?video=([^.&=]+)/,
- style: 'width: 1280px; height: 720px; max-width: 80vw; max-height: 80vh;',
- el(a) {
- const el = $$1.el('iframe',
- {src: `https://openings.moe/?video=${a.dataset.uid}`,});
- el.setAttribute("allowfullscreen", "true");
- return el;
- }
- }
- , {
- key: 'Pastebin',
- regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w.]+(?:\/|\?i\=))?(\w+)/,
- el(a) {
- return $$1.el('iframe',
- {src: `//pastebin.com/embed_iframe.php?i=${a.dataset.uid}`});
- }
- }
- , {
- key: 'SoundCloud',
- regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/,
- style: 'border: 0; width: 500px; height: 400px;',
- el(a) {
- return $$1.el('iframe',
- {src: `https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(a.dataset.uid)}`});
- },
- title: {
- api(uid) { return `${location.protocol}//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(uid)}`; },
- text(_) { return _.title; }
- }
- }
- , {
- key: 'StrawPoll',
- regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
- style: 'border: 0; width: 600px; height: 406px;',
- el(a) {
- return $$1.el('iframe',
- {src: `https://www.strawpoll.me/embed_1/${a.dataset.uid}`});
- }
- }
- , {
- key: 'Streamable',
- regExp: /^\w+:\/\/(?:www\.)?streamable\.com\/(\w+)/,
- el(a) {
- const el = $$1.el('iframe',
- {src: `https://streamable.com/o/${a.dataset.uid}`});
- el.setAttribute("allowfullscreen", "true");
- return el;
- },
- title: {
- api(uid) { return `https://api.streamable.com/oembed?url=https://streamable.com/${uid}`; },
- text(_) { return _.title; }
- }
- }
- , {
- key: 'TwitchTV',
- regExp: /^\w+:\/\/(?:www\.|secure\.|clips\.|m\.)?twitch\.tv\/(\w[^#\&\?]*)/,
- el(a) {
- let url;
- let m = a.dataset.href.match(/^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(?:\w+\/)?(clip\/)?(\w[^#\&\?]*)/);
- if (m[1] || m[2]) {
- url = `//clips.twitch.tv/embed?clip=${m[3]}&parent=${location.hostname}`;
- } else {
- let time;
- m = a.dataset.uid.match(/(\w+)(?:\/(?:v\/)?(\d+))?/);
- url = `//player.twitch.tv/?${m[2] ? `video=v${m[2]}` : `channel=${m[1]}`}&autoplay=false&parent=${location.hostname}`;
- if (time = a.dataset.href.match(/\bt=(\w+)/)) {
- url += `&time=${time[1]}`;
- }
- }
- const el = $$1.el('iframe',
- {src: url});
- el.setAttribute("allowfullscreen", "true");
- return el;
- }
- }
- , {
- key: 'Twitter',
- regExp: /^\w+:\/\/(?:www\.|mobile\.)?(?:twitter|x)\.com\/(\w+\/status\/\d+)/,
- style: 'border: none; width: 550px; height: 250px; overflow: hidden; resize: both;',
- el(a) {
- const el = $$1.el('iframe');
- $$1.on(el, 'load', function() {
- return this.contentWindow.postMessage({element: 't', query: 'height'}, 'https://twitframe.com');
- });
- var onMessage = function(e) {
- if ((e.source === el.contentWindow) && (e.origin === 'https://twitframe.com')) {
- $$1.off(window, 'message', onMessage);
- return (cont || el).style.height = `${+$$1.minmax(e.data.height, 250, 0.8 * doc$1.clientHeight)}px`;
- }
- };
- $$1.on(window, 'message', onMessage);
- el.src = `https://twitframe.com/show?url=https://twitter.com/${a.dataset.uid}`;
- if ($$1.engine === 'gecko') {
- // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=680823
- el.style.cssText = 'border: none; width: 100%; height: 100%;';
- var cont = $$1.el('div');
- $$1.add(cont, el);
- return cont;
- } else {
- return el;
- }
- }
- }
- , {
- key: 'VidLii',
- regExp: /^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/,
- style: 'border: none; width: 640px; height: 392px;',
- el(a) {
- const el = $$1.el('iframe',
- {src: `https://www.vidlii.com/embed?v=${a.dataset.uid}&a=0`});
- el.setAttribute("allowfullscreen", "true");
- return el;
- }
- }
- , {
- key: 'Vimeo',
- regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/,
- el(a) {
- const el = $$1.el('iframe',
- {src: `//player.vimeo.com/video/${a.dataset.uid}?wmode=opaque`});
- el.setAttribute("allowfullscreen", "true");
- return el;
- },
- title: {
- api(uid) { return `https://vimeo.com/api/oembed.json?url=https://vimeo.com/${uid}`; },
- text(_) { return _.title; }
- }
- }
- , {
- key: 'Vine',
- regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/,
- style: 'border: none; width: 500px; height: 500px;',
- el(a) {
- return $$1.el('iframe',
- {src: `https://vine.co/v/${a.dataset.uid}/card`});
- }
- }
- , {
- key: 'Vocaroo',
- regExp: /^\w+:\/\/(?:(?:www\.|old\.)?vocaroo\.com|voca\.ro)\/((?:i\/)?\w+)/,
- style: '',
- el(a) {
- const el = $$1.el('iframe');
- el.width = 300;
- el.height = 60;
- el.setAttribute('frameborder', 0);
- el.src = `https://vocaroo.com/embed/${a.dataset.uid.replace(/^i\//, '')}?autoplay=0`;
- return el;
- }
- }
- , {
- key: 'YouTube',
- regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/|live\/))([\w\-]{11})(.*)/,
- el(a) {
- let start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/);
- if (start) { start = start[1]; }
- if (start && !/^\d+$/.test(start)) {
- start += ' 0h0m0s';
- start = (3600 * start.match(/(\d+)h/)[1]) + (60 * start.match(/(\d+)m/)[1]) + (1 * start.match(/(\d+)s/)[1]);
- }
- const el = $$1.el('iframe',
- {src: `//www.youtube.com/embed/${a.dataset.uid}?rel=0&wmode=opaque${start ? '&start=' + start : ''}`});
- el.setAttribute("allowfullscreen", "true");
- return el;
- },
- title: {
- api(uid) { return `https://www.youtube.com/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D${uid}&format=json`; },
- text(_) { return _.title; },
- status(_) {
- if (_.error) {
- const m = _.error.match(/^(\d*)\s*(.*)/);
- return [+m[1], m[2]];
- } else {
- return [200, 'OK'];
- }
- }
- },
- preview: {
- url(uid) { return `https://img.youtube.com/vi/${uid}/0.jpg`; },
- height: 360
- }
- }
- ]
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * DS205: Consider reworking code to avoid use of IIFEs
+ * DS207: Consider shorter variations of null checks
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+
+ var Embedding = {
+ init() {
+ if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['Linkify'] || (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview'])) { return; }
+ this.types = dict();
+ for (var type of this.ordered_types) { this.types[type.key] = type; }
+
+ if (Conf['Embedding'] && (g.VIEW !== 'archive')) {
+ this.dialog = UI.dialog('embedding',
+ { innerHTML: EmbeddingPage });
+ this.media = $$1('#media-embed', this.dialog);
+ $$1.one(d$1, '4chanXInitFinished', this.ready);
+ $$1.on(d$1, 'IndexRefreshInternal', () => g.posts.forEach(function(post) {
+ for (post of [post, ...post.clones]) {
+ for (var embed of post.nodes.embedlinks) {
+ Embedding.cb.catalogRemove.call(embed);
+ }
+ }
+ }));
+ }
+ if (Conf['Link Title']) {
+ return $$1.on(d$1, '4chanXInitFinished PostsInserted', function() {
+ for (var key in Embedding.types) {
+ var service = Embedding.types[key];
+ if (service.title?.batchSize) {
+ Embedding.flushTitles(service.title);
+ }
+ }
+ });
+ }
+ },
+
+ events(post) {
+ let el, i, items;
+ if (g.VIEW === 'archive') { return; }
+ if (Conf['Embedding']) {
+ i = 0;
+ items = (post.nodes.embedlinks = $$('.embedder', post.nodes.comment));
+ while ((el = items[i++])) {
+ $$1.on(el, 'click', Embedding.cb.click);
+ if ($$1.hasClass(el, 'embedded')) { Embedding.cb.toggle.call(el); }
+ }
+ }
+ if (Conf['Cover Preview']) {
+ i = 0;
+ items = $$('.linkify', post.nodes.comment);
+ while ((el = items[i++])) {
+ var data;
+ if (data = Embedding.services(el)) {
+ Embedding.preview(data);
+ }
+ }
+ return;
+ }
+ },
+
+ process(link, post) {
+ let data;
+ if (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview']) { return; }
+ if ($$1.x('ancestor::pre', link)) { return; }
+ if (data = Embedding.services(link)) {
+ data.post = post;
+ if (Conf['Embedding'] && (g.VIEW !== 'archive')) { Embedding.embed(data); }
+ if (Conf['Link Title']) { Embedding.title(data); }
+ if (Conf['Cover Preview'] && (g.VIEW !== 'archive')) { return Embedding.preview(data); }
+ }
+ },
+
+ services(link) {
+ const {href} = link;
+ for (var type of Embedding.ordered_types) {
+ var match;
+ if (match = type.regExp.exec(href)) {
+ return {key: type.key, uid: match[1], options: match[2], link};
+ }
+ }
+ },
+
+ embed(data) {
+ const {key, uid, options, link, post} = data;
+ const {href} = link;
+
+ $$1.addClass(link, key.toLowerCase());
+
+ const embed = $$1.el('a', {
+ className: 'embedder',
+ href: 'javascript:;'
+ }
+ ,
+ {innerHTML: '(
unembed)'});
+
+ const object = {key, uid, options, href};
+ for (var name in object) { var value = object[name]; embed.dataset[name] = value; }
+
+ $$1.on(embed, 'click', Embedding.cb.click);
+ $$1.after(link, [$$1.tn(' '), embed]);
+ post.nodes.embedlinks.push(embed);
+
+ if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {
+ if ($$1.hasClass(doc$1, 'catalog-mode')) {
+ return $$1.addClass(embed, 'embed-removed');
+ } else {
+ return Embedding.cb.toggle.call(embed);
+ }
+ }
+ },
+
+ ready() {
+ if (!Main$1.isThisPageLegit()) { return; }
+ $$1.addClass(Embedding.dialog, 'empty');
+ $$1.on($$1('.close', Embedding.dialog), 'click', Embedding.closeFloat);
+ $$1.on($$1('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed);
+ $$1.on($$1('.jump', Embedding.dialog), 'click', function() {
+ if (doc$1.contains(Embedding.lastEmbed)) { return Header$1.scrollTo(Embedding.lastEmbed); }
+ });
+ return $$1.add(d$1.body, Embedding.dialog);
+ },
+
+ closeFloat() {
+ delete Embedding.lastEmbed;
+ $$1.addClass(Embedding.dialog, 'empty');
+ return $$1.replace(Embedding.media.firstChild, $$1.el('div'));
+ },
+
+ dragEmbed() {
+ // only webkit can handle a blocking div
+ const {style} = Embedding.media;
+ if (Embedding.dragEmbed.mouseup) {
+ $$1.off(d$1, 'mouseup', Embedding.dragEmbed);
+ Embedding.dragEmbed.mouseup = false;
+ style.pointerEvents = '';
+ return;
+ }
+ $$1.on(d$1, 'mouseup', Embedding.dragEmbed);
+ Embedding.dragEmbed.mouseup = true;
+ return style.pointerEvents = 'none';
+ },
+
+ title(data) {
+ let service;
+ const {key, uid, options, link, post} = data;
+ if (!(service = Embedding.types[key].title)) { return; }
+ $$1.addClass(link, key.toLowerCase());
+ if (service.batchSize) {
+ (service.queue || (service.queue = [])).push(data);
+ if (service.queue.length >= service.batchSize) {
+ return Embedding.flushTitles(service);
+ }
+ } else {
+ return CrossOrigin$1.cache(service.api(uid), (function() { return Embedding.cb.title(this, data); }));
+ }
+ },
+
+ flushTitles(service) {
+ let data;
+ const {queue} = service;
+ if (!queue?.length) { return; }
+ service.queue = [];
+ const cb = function() {
+ for (data of queue) { Embedding.cb.title(this, data); }
+ };
+ return CrossOrigin$1.cache(service.api((() => {
+ const result = [];
+ for (data of queue) { result.push(data.uid);
+ }
+ return result;
+ })()), cb);
+ },
+
+ preview(data) {
+ let service;
+ const {key, uid, link} = data;
+ if (!(service = Embedding.types[key].preview)) { return; }
+ return $$1.on(link, 'mouseover', function(e) {
+ const src = service.url(uid);
+ const {height} = service;
+ const el = $$1.el('img', {
+ src,
+ id: 'ihover'
+ }
+ );
+ $$1.add(Header$1.hover, el);
+ return UI.hover({
+ root: link,
+ el,
+ latestEvent: e,
+ endEvents: 'mouseout click',
+ height
+ });
+ });
+ },
+
+ cb: {
+ click(e) {
+ e.preventDefault();
+ if (!$$1.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $$1.hasClass(doc$1, 'catalog-mode'))) {
+ let div;
+ if (!(div = Embedding.media.firstChild)) { return; }
+ $$1.replace(div, Embedding.cb.embed(this));
+ Embedding.lastEmbed = Get$1.postFromNode(this).nodes.root;
+ return $$1.rmClass(Embedding.dialog, 'empty');
+ } else {
+ return Embedding.cb.toggle.call(this);
+ }
+ },
+
+ toggle() {
+ if ($$1.hasClass(this, "embedded")) {
+ $$1.rm(this.nextElementSibling);
+ } else {
+ $$1.after(this, Embedding.cb.embed(this));
+ }
+ return $$1.toggleClass(this, 'embedded');
+ },
+
+ embed(a) {
+ // We create an element to embed
+ let el, type;
+ const container = $$1.el('div', {className: 'media-embed'});
+ $$1.add(container, (el = (type = Embedding.types[a.dataset.key]).el(a)));
+
+ // Set style values.
+ el.style.cssText = (type.style != null) ?
+ type.style
+ :
+ 'border: none; width: 640px; height: 360px;';
+
+ return container;
+ },
+
+ catalogRemove() {
+ const isCatalog = $$1.hasClass(doc$1, 'catalog-mode');
+ if ((isCatalog && $$1.hasClass(this, 'embedded')) || (!isCatalog && $$1.hasClass(this, 'embed-removed'))) {
+ Embedding.cb.toggle.call(this);
+ return $$1.toggleClass(this, 'embed-removed');
+ }
+ },
+
+ title(req, data) {
+ let text;
+ const {key, uid, options, link, post} = data;
+ const service = Embedding.types[key].title;
+
+ let {status} = req;
+ if ([200, 304].includes(status) && service.status) {
+ status = service.status(req.response)[0];
+ }
+
+ if (!status) { return; }
+
+ text = `[${key}] ${(() => { switch (status) {
+ case 200: case 304:
+ text = service.text(req.response, uid);
+ if (typeof text === 'string') {
+ return text;
+ } else {
+ return text = link.textContent;
+ }
+ case 404:
+ return "Not Found";
+ case 403: case 401:
+ return "Forbidden or Private";
+ default:
+ return `${status}'d`;
+ } })()
+ }`;
+
+ link.dataset.original = link.textContent;
+ link.textContent = text;
+ for (var post2 of post.clones) {
+ for (var link2 of $$('a.linkify', post2.nodes.comment)) {
+ if (link2.href === link.href) {
+ if (link2.dataset.original == null) { link2.dataset.original = link2.textContent; }
+ link2.textContent = text;
+ }
+ }
+ }
+ }
+ },
+
+ ordered_types: [{
+ key: 'audio',
+ regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i,
+ style: '',
+ el(a) {
+ return $$1.el('audio', {
+ controls: true,
+ preload: 'auto',
+ src: a.dataset.href
+ }
+ );
+ }
+ }
+ , {
+ key: 'image',
+ regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i,
+ style: '',
+ el(a) {
+ const hrefEsc = E(a.dataset.href);
+ return $$1.el('div', { innerHTML: `

`});
+ }
+ }
+ , {
+ key: 'video',
+ regExp: /^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el(a) {
+ const el = $$1.el('video', {
+ hidden: true,
+ controls: true,
+ preload: 'auto',
+ src: a.dataset.href,
+ loop: ImageHost.test(a.dataset.href.split('/')[2])
+ });
+ $$1.on(el, 'loadedmetadata', function() {
+ if ((el.videoHeight === 0) && el.parentNode) {
+ return $$1.replace(el, Embedding.types.audio.el(a));
+ } else {
+ return el.hidden = false;
+ }
+ });
+ return el;
+ }
+ }
+ , {
+ key: 'PeerTube',
+ regExp: /^(\w+:\/\/[^\/]+\/videos\/watch\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12})(.*)/,
+ el(a) {
+ let start;
+ const options = (start = a.dataset.options.match(/[?&](start=\w+)/)) ? `?${start[1]}` : '';
+ const el = $$1.el('iframe',
+ {src: a.dataset.uid.replace('/videos/watch/', '/videos/embed/') + options});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }
+ , {
+ key: 'BitChute',
+ regExp: /^\w+:\/\/(?:www\.)?bitchute\.com\/video\/([\w\-]+)/,
+ el(a) {
+ const el = $$1.el('iframe',
+ {src: `https://www.bitchute.com/embed/${a.dataset.uid}/`});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }
+ , {
+ key: 'Clyp',
+ regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w{8})/,
+ style: 'border: 0; width: 640px; height: 160px;',
+ el(a) {
+ return $$1.el('iframe',
+ {src: `https://clyp.it/${a.dataset.uid}/widget`});
+ },
+ title: {
+ api(uid) { return `https://api.clyp.it/oembed?url=https://clyp.it/${uid}`; },
+ text(_) { return _.title; }
+ }
+ }
+ , {
+ key: 'Dailymotion',
+ regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/,
+ el(a) {
+ let start;
+ const options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? `?${start[1]}` : '';
+ const el = $$1.el('iframe',
+ {src: `//www.dailymotion.com/embed/video/${a.dataset.uid}${options}`});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ api(uid) { return `https://api.dailymotion.com/video/${uid}`; },
+ text(_) { return _.title; }
+ },
+ preview: {
+ url(uid) { return `https://www.dailymotion.com/thumbnail/video/${uid}`; },
+ height: 240
+ }
+ }
+ , {
+ key: 'Gfycat',
+ regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
+ el(a) {
+ const el = $$1.el('iframe',
+ {src: `//gfycat.com/ifr/${a.dataset.uid}`});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }
+ , {
+ key: 'Gist',
+ regExp: /^\w+:\/\/gist\.github\.com\/[\w\-]+\/(\w+)/,
+ style: '',
+ el: (function() {
+ let counter = 0;
+ return function(a) {
+ const el = $$1.el('pre', {
+ hidden: true,
+ id: `gist-embed-${counter++}`
+ }
+ );
+ CrossOrigin$1.cache(`https://api.github.com/gists/${a.dataset.uid}`, function() {
+ el.textContent = Object.values(this.response.files)[0].content;
+ el.className = 'prettyprint';
+ $$1.global(() => window.prettyPrint?.((function() {}), document.getElementById(document.currentScript.dataset.id).parentNode)
+ , {id: el.id});
+ return el.hidden = false;
+ });
+ return el;
+ };
+ })(),
+ title: {
+ api(uid) { return `https://api.github.com/gists/${uid}`; },
+ text({files}) {
+ for (var file in files) { if (files.hasOwnProperty(file)) { return file; } }
+ }
+ }
+ }
+ , {
+ key: 'InstallGentoo',
+ regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,
+ el(a) {
+ return $$1.el('iframe',
+ {src: `https://paste.installgentoo.com/view/embed/${a.dataset.uid}`});
+ }
+ }
+ , {
+ key: 'LiveLeak',
+ regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*[tif]=(\w+)/,
+ el(a) {
+ const el = $$1.el('iframe',
+ {src: `https://www.liveleak.com/e/${a.dataset.uid}`,});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }
+ , {
+ key: 'Loopvid',
+ regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|m2|pc|1c|pi|ni|wl|ko|mm|ic|gc)\/[\w\-\/]+(?:,[\w\-\/]+)*|fc\/\w+\/\d+|https?:\/\/.+)/,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el(a) {
+ const el = $$1.el('video', {
+ controls: true,
+ preload: 'auto',
+ loop: true
+ }
+ );
+ if (/^http/.test(a.dataset.uid)) {
+ $$1.add(el, $$1.el('source', {src: a.dataset.uid}));
+ return el;
+ }
+ const [_, host, names] = a.dataset.uid.match(/(\w+)\/(.*)/);
+ const types = (() => { switch (host) {
+ case 'gd': case 'wu': case 'fc': return [''];
+ case 'gc': return ['giant', 'fat', 'zippy'];
+ default: return ['.webm', '.mp4'];
+ } })();
+ for (var name of names.split(',')) {
+ for (var type of types) {
+ var base = `${name}${type}`;
+ var urls = (() => { switch (host) {
+ // list from src/common.py at http://loopvid.appspot.com/source.html
+ case 'pf': return [`https://kastden.org/_loopvid_media/pf/${base}`, `https://web.archive.org/web/2/http://a.pomf.se/${base}`];
+ case 'kd': return [`https://kastden.org/loopvid/${base}`];
+ case 'lv': return [`https://lv.kastden.org/${base}`];
+ case 'gd': return [`https://docs.google.com/uc?export=download&id=${base}`];
+ case 'gh': return [`https://googledrive.com/host/${base}`];
+ case 'db': return [`https://dl.dropboxusercontent.com/u/${base}`];
+ case 'dx': return [`https://dl.dropboxusercontent.com/${base}`];
+ case 'nn': return [`https://kastden.org/_loopvid_media/nn/${base}`];
+ case 'cp': return [`https://copy.com/${base}`];
+ case 'wu': return [`http://webmup.com/${base}/vid.webm`];
+ case 'ig': return [`https://i.imgur.com/${base}`];
+ case 'ky': return [`https://kastden.org/_loopvid_media/ky/${base}`];
+ case 'mf': return [`https://kastden.org/_loopvid_media/mf/${base}`, `https://web.archive.org/web/2/https://d.maxfile.ro/${base}`];
+ case 'm2': return [`https://kastden.org/_loopvid_media/m2/${base}`];
+ case 'pc': return [`https://kastden.org/_loopvid_media/pc/${base}`, `https://web.archive.org/web/2/http://a.pomf.cat/${base}`];
+ case '1c': return [`http://b.1339.cf/${base}`];
+ case 'pi': return [`https://kastden.org/_loopvid_media/pi/${base}`, `https://web.archive.org/web/2/https://u.pomf.is/${base}`];
+ case 'ni': return [`https://kastden.org/_loopvid_media/ni/${base}`, `https://web.archive.org/web/2/https://u.nya.is/${base}`];
+ case 'wl': return [`http://webm.land/media/${base}`];
+ case 'ko': return [`https://kordy.kastden.org/loopvid/${base}`];
+ case 'mm': return [`https://kastden.org/_loopvid_media/mm/${base}`, `https://web.archive.org/web/2/https://my.mixtape.moe/${base}`];
+ case 'ic': return [`https://media.8ch.net/file_store/${base}`];
+ case 'fc': return [`//${ImageHost.host()}/${base}.webm`];
+ case 'gc': return [`https://${type}.gfycat.com/${name}.webm`];
+ } })();
+
+ for (var url of urls) {
+ $$1.add(el, $$1.el('source', {src: url}));
+ }
+ }
+ }
+ return el;
+ }
+ }
+ , {
+ key: 'Openings.moe',
+ regExp: /^\w+:\/\/openings.moe\/\?video=([^.&=]+)/,
+ style: 'width: 1280px; height: 720px; max-width: 80vw; max-height: 80vh;',
+ el(a) {
+ const el = $$1.el('iframe',
+ {src: `https://openings.moe/?video=${a.dataset.uid}`,});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }
+ , {
+ key: 'Pastebin',
+ regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w.]+(?:\/|\?i\=))?(\w+)/,
+ el(a) {
+ return $$1.el('iframe',
+ {src: `//pastebin.com/embed_iframe.php?i=${a.dataset.uid}`});
+ }
+ }
+ , {
+ key: 'SoundCloud',
+ regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/,
+ style: 'border: 0; width: 500px; height: 400px;',
+ el(a) {
+ return $$1.el('iframe',
+ {src: `https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(a.dataset.uid)}`});
+ },
+ title: {
+ api(uid) { return `${location.protocol}//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(uid)}`; },
+ text(_) { return _.title; }
+ }
+ }
+ , {
+ key: 'StrawPoll',
+ regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
+ style: 'border: 0; width: 600px; height: 406px;',
+ el(a) {
+ return $$1.el('iframe',
+ {src: `https://www.strawpoll.me/embed_1/${a.dataset.uid}`});
+ }
+ }
+ , {
+ key: 'Streamable',
+ regExp: /^\w+:\/\/(?:www\.)?streamable\.com\/(\w+)/,
+ el(a) {
+ const el = $$1.el('iframe',
+ {src: `https://streamable.com/o/${a.dataset.uid}`});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ api(uid) { return `https://api.streamable.com/oembed?url=https://streamable.com/${uid}`; },
+ text(_) { return _.title; }
+ }
+ }
+ , {
+ key: 'TwitchTV',
+ regExp: /^\w+:\/\/(?:www\.|secure\.|clips\.|m\.)?twitch\.tv\/(\w[^#\&\?]*)/,
+ el(a) {
+ let url;
+ let m = a.dataset.href.match(/^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(?:\w+\/)?(clip\/)?(\w[^#\&\?]*)/);
+ if (m[1] || m[2]) {
+ url = `//clips.twitch.tv/embed?clip=${m[3]}&parent=${location.hostname}`;
+ } else {
+ let time;
+ m = a.dataset.uid.match(/(\w+)(?:\/(?:v\/)?(\d+))?/);
+ url = `//player.twitch.tv/?${m[2] ? `video=v${m[2]}` : `channel=${m[1]}`}&autoplay=false&parent=${location.hostname}`;
+ if (time = a.dataset.href.match(/\bt=(\w+)/)) {
+ url += `&time=${time[1]}`;
+ }
+ }
+ const el = $$1.el('iframe',
+ {src: url});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }
+ , {
+ key: 'Twitter',
+ regExp: /^\w+:\/\/(?:www\.|mobile\.)?(?:twitter|x)\.com\/(\w+\/status\/\d+)/,
+ style: 'border: none; width: 550px; height: 250px; overflow: hidden; resize: both;',
+ el(a) {
+ const el = $$1.el('iframe');
+ $$1.on(el, 'load', function() {
+ return this.contentWindow.postMessage({element: 't', query: 'height'}, 'https://twitframe.com');
+ });
+ var onMessage = function(e) {
+ if ((e.source === el.contentWindow) && (e.origin === 'https://twitframe.com')) {
+ $$1.off(window, 'message', onMessage);
+ return (cont || el).style.height = `${+$$1.minmax(e.data.height, 250, 0.8 * doc$1.clientHeight)}px`;
+ }
+ };
+ $$1.on(window, 'message', onMessage);
+ el.src = `https://twitframe.com/show?url=https://twitter.com/${a.dataset.uid}`;
+ if ($$1.engine === 'gecko') {
+ // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=680823
+ el.style.cssText = 'border: none; width: 100%; height: 100%;';
+ var cont = $$1.el('div');
+ $$1.add(cont, el);
+ return cont;
+ } else {
+ return el;
+ }
+ }
+ }
+ , {
+ key: 'VidLii',
+ regExp: /^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/,
+ style: 'border: none; width: 640px; height: 392px;',
+ el(a) {
+ const el = $$1.el('iframe',
+ {src: `https://www.vidlii.com/embed?v=${a.dataset.uid}&a=0`});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }
+ , {
+ key: 'Vimeo',
+ regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/,
+ el(a) {
+ const el = $$1.el('iframe',
+ {src: `//player.vimeo.com/video/${a.dataset.uid}?wmode=opaque`});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ api(uid) { return `https://vimeo.com/api/oembed.json?url=https://vimeo.com/${uid}`; },
+ text(_) { return _.title; }
+ }
+ }
+ , {
+ key: 'Vine',
+ regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/,
+ style: 'border: none; width: 500px; height: 500px;',
+ el(a) {
+ return $$1.el('iframe',
+ {src: `https://vine.co/v/${a.dataset.uid}/card`});
+ }
+ }
+ , {
+ key: 'Vocaroo',
+ regExp: /^\w+:\/\/(?:(?:www\.|old\.)?vocaroo\.com|voca\.ro)\/((?:i\/)?\w+)/,
+ style: '',
+ el(a) {
+ const el = $$1.el('iframe');
+ el.width = 300;
+ el.height = 60;
+ el.setAttribute('frameborder', 0);
+ el.src = `https://vocaroo.com/embed/${a.dataset.uid.replace(/^i\//, '')}?autoplay=0`;
+ return el;
+ }
+ }
+ , {
+ key: 'YouTube',
+ regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/|live\/))([\w\-]{11})(.*)/,
+ el(a) {
+ let start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/);
+ if (start) { start = start[1]; }
+ if (start && !/^\d+$/.test(start)) {
+ start += ' 0h0m0s';
+ start = (3600 * start.match(/(\d+)h/)[1]) + (60 * start.match(/(\d+)m/)[1]) + (1 * start.match(/(\d+)s/)[1]);
+ }
+ const el = $$1.el('iframe',
+ {src: `//www.youtube.com/embed/${a.dataset.uid}?rel=0&wmode=opaque${start ? '&start=' + start : ''}`});
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ api(uid) { return `https://www.youtube.com/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D${uid}&format=json`; },
+ text(_) { return _.title; },
+ status(_) {
+ if (_.error) {
+ const m = _.error.match(/^(\d*)\s*(.*)/);
+ return [+m[1], m[2]];
+ } else {
+ return [200, 'OK'];
+ }
+ }
+ },
+ preview: {
+ url(uid) { return `https://img.youtube.com/vi/${uid}/0.jpg`; },
+ height: 360
+ }
+ }
+ ]
};
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS205: Consider reworking code to avoid use of IIFEs
- * DS207: Consider shorter variations of null checks
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
- var Keybinds = {
- init() {
- if (!Conf['Keybinds']) { return; }
-
- for (var hotkey in Config.hotkeys) {
- $$1.sync(hotkey, Keybinds.sync);
- }
-
- var init = function() {
- $$1.off(d$1, '4chanXInitFinished', init);
- $$1.on(d$1, 'keydown', Keybinds.keydown);
- for (var node of $$('[accesskey]')) {
- node.removeAttribute('accesskey');
- }
- };
- return $$1.on(d$1, '4chanXInitFinished', init);
- },
-
- sync(key, hotkey) {
- return Conf[hotkey] = key;
- },
-
- keydown(e) {
- let key, thread, threadRoot;
- let catalog, notifications;
- if (!(key = Keybinds.keyCode(e))) { return; }
- const {target} = e;
- if (['INPUT', 'TEXTAREA'].includes(target.nodeName)) {
- if (!/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) || !!/^Alt\+(\d|Up|Down|Left|Right)$/.test(key)) { return; }
- }
- if (['index', 'thread'].includes(g.VIEW)) {
- threadRoot = Nav.getThread();
- thread = Get$1.threadFromRoot(threadRoot);
- }
- switch (key) {
- // QR & Options
- case Conf['Toggle board list']:
- if (!Conf['Custom Board Navigation']) { return; }
- Header$1.toggleBoardList();
- break;
- case Conf['Toggle header']:
- Header$1.toggleBarVisibility();
- break;
- case Conf['Open empty QR']:
- if (!QR.postingIsEnabled) { return; }
- Keybinds.qr();
- break;
- case Conf['Open QR']:
- if (!QR.postingIsEnabled || !threadRoot) { return; }
- Keybinds.qr(threadRoot);
- break;
- case Conf['Open settings']:
- Settings.open();
- break;
- case Conf['Close']:
- if (Settings.dialog) {
- Settings.close();
- } else if ((notifications = $$('.notification')).length) {
- for (var notification of notifications) {
- $$1('.close', notification).click();
- }
- } else if (QR.nodes && !(QR.nodes.el.hidden || (window.getComputedStyle(QR.nodes.form).display === 'none'))) {
- if (Conf['Persistent QR']) {
- QR.hide();
- } else {
- QR.close();
- }
- } else if (Embedding.lastEmbed) {
- Embedding.closeFloat();
- } else {
- return;
- }
- break;
- case Conf['Spoiler tags']:
- if (target.nodeName !== 'TEXTAREA') { return; }
- Keybinds.tags('spoiler', target);
- break;
- case Conf['Code tags']:
- if (target.nodeName !== 'TEXTAREA') { return; }
- Keybinds.tags('code', target);
- break;
- case Conf['Eqn tags']:
- if (target.nodeName !== 'TEXTAREA') { return; }
- Keybinds.tags('eqn', target);
- break;
- case Conf['Math tags']:
- if (target.nodeName !== 'TEXTAREA') { return; }
- Keybinds.tags('math', target);
- break;
- case Conf['SJIS tags']:
- if (target.nodeName !== 'TEXTAREA') { return; }
- Keybinds.tags('sjis', target);
- break;
- case Conf['Toggle sage']:
- if (!QR.nodes || !!QR.nodes.el.hidden) { return; }
- Keybinds.sage();
- break;
- case Conf['Toggle Cooldown']:
- if (!QR.nodes || !!QR.nodes.el.hidden || !$$1.hasClass(QR.nodes.fileSubmit, 'custom-cooldown')) { return; }
- QR.toggleCustomCooldown();
- break;
- case Conf['Post from URL']:
- if (!QR.postingIsEnabled) { return; }
- QR.handleUrl('');
- break;
- case Conf['Add new post']:
- if (!QR.postingIsEnabled) { return; }
- QR.addPost();
- break;
- case Conf['Submit QR']:
- if (!QR.nodes || !!QR.nodes.el.hidden) { return; }
- if (!QR.status()) { QR.submit(); }
- break;
- // Index/Thread related
- case Conf['Update']:
- switch (g.VIEW) {
- case 'thread':
- if (!ThreadUpdater.enabled) { return; }
- ThreadUpdater.update();
- break;
- case 'index':
- if (!Index$1.enabled) { return; }
- Index$1.update();
- break;
- default:
- return;
- }
- break;
- case Conf['Watch']:
- if (!ThreadWatcher$1.enabled || !thread) { return; }
- ThreadWatcher$1.toggle(thread);
- break;
- case Conf['Update thread watcher']:
- if (!ThreadWatcher$1.enabled) { return; }
- ThreadWatcher$1.buttonFetchAll();
- break;
- case Conf['Toggle thread watcher']:
- if (!ThreadWatcher$1.enabled) { return; }
- ThreadWatcher$1.toggleWatcher();
- break;
- case Conf['Toggle threading']:
- if (!QuoteThreading.ready) { return; }
- QuoteThreading.toggleThreading();
- break;
- case Conf['Mark thread read']:
- if ((g.VIEW !== 'index') || !thread || !UnreadIndex.enabled) { return; }
- UnreadIndex.markRead.call(threadRoot);
- break;
- // Images
- case Conf['Expand image']:
- if (!ImageExpand.enabled || !threadRoot) { return; }
- var post = Get$1.postFromNode(Keybinds.post(threadRoot));
- if (post.file) { ImageExpand.toggle(post); }
- break;
- case Conf['Expand images']:
- if (!ImageExpand.enabled) { return; }
- ImageExpand.cb.toggleAll();
- break;
- case Conf['Open Gallery']:
- if (!Gallery.enabled) { return; }
- Gallery.cb.toggle();
- break;
- case Conf['fappeTyme']:
- if (!FappeTyme.nodes?.fappe) { return; }
- FappeTyme.toggle('fappe');
- break;
- case Conf['werkTyme']:
- if (!FappeTyme.nodes?.werk) { return; }
- FappeTyme.toggle('werk');
- break;
- // Board Navigation
- case Conf['Front page']:
- if (Index$1.enabled) {
- Index$1.userPageNav(1);
- } else {
- location.href = `/${g.BOARD}/`;
- }
- break;
- case Conf['Open front page']:
- $$1.open(`${location.origin}/${g.BOARD}/`);
- break;
- case Conf['Next page']:
- if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; }
- if (Index$1.enabled) {
- if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; }
- $$1('.next button', Index$1.pagelist).click();
- } else {
- $$1(g.SITE.selectors.nav.next)?.click();
- }
- break;
- case Conf['Previous page']:
- if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; }
- if (Index$1.enabled) {
- if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; }
- $$1('.prev button', Index$1.pagelist).click();
- } else {
- $$1(g.SITE.selectors.nav.prev)?.click();
- }
- break;
- case Conf['Search form']:
- if (g.VIEW !== 'index') { return; }
- var searchInput = Index$1.enabled ?
- Index$1.searchInput
- : g.SITE.selectors.searchBox ?
- $$1(g.SITE.selectors.searchBox)
- :
- undefined;
- if (!searchInput) { return; }
- Header$1.scrollToIfNeeded(searchInput);
- searchInput.focus();
- break;
- case Conf['Paged mode']:
- if (!Index$1.enabledOn(g.BOARD)) { return; }
- location.href = g.VIEW === 'index' ? '#paged' : `/${g.BOARD}/#paged`;
- break;
- case Conf['Infinite scrolling mode']:
- if (!Index$1.enabledOn(g.BOARD)) { return; }
- location.href = g.VIEW === 'index' ? '#infinite' : `/${g.BOARD}/#infinite`;
- break;
- case Conf['All pages mode']:
- if (!Index$1.enabledOn(g.BOARD)) { return; }
- location.href = g.VIEW === 'index' ? '#all-pages' : `/${g.BOARD}/#all-pages`;
- break;
- case Conf['Open catalog']:
- if (!(catalog = CatalogLinks.catalog())) { return; }
- location.href = catalog;
- break;
- case Conf['Cycle sort type']:
- if (!Index$1.enabled) { return; }
- Index$1.cycleSortType();
- break;
- // Thread Navigation
- case Conf['Next thread']:
- if ((g.VIEW !== 'index') || !threadRoot) { return; }
- Nav.scroll(+1);
- break;
- case Conf['Previous thread']:
- if ((g.VIEW !== 'index') || !threadRoot) { return; }
- Nav.scroll(-1);
- break;
- case Conf['Expand thread']:
- if ((g.VIEW !== 'index') || !threadRoot) { return; }
- ExpandThread.toggle(thread);
- // Keep thread from moving off screen when contracted.
- Header$1.scrollTo(threadRoot);
- break;
- case Conf['Open thread']:
- if ((g.VIEW !== 'index') || !threadRoot) { return; }
- Keybinds.open(thread);
- break;
- case Conf['Open thread tab']:
- if ((g.VIEW !== 'index') || !threadRoot) { return; }
- Keybinds.open(thread, true);
- break;
- // Reply Navigation
- case Conf['Next reply']:
- if (!threadRoot) { return; }
- Keybinds.hl(+1, threadRoot);
- break;
- case Conf['Previous reply']:
- if (!threadRoot) { return; }
- Keybinds.hl(-1, threadRoot);
- break;
- case Conf['Deselect reply']:
- if (!threadRoot) { return; }
- Keybinds.hl(0, threadRoot);
- break;
- case Conf['Hide']:
- if (!thread || !ThreadHiding.db) { return; }
- Header$1.scrollTo(threadRoot);
- ThreadHiding.toggle(thread);
- break;
- case Conf['Quick Filter MD5']:
- if (!threadRoot) { return; }
- post = Keybinds.post(threadRoot);
- Keybinds.hl(+1, threadRoot);
- Filter.quickFilterMD5.call(post, e);
- break;
- case Conf['Previous Post Quoting You']:
- if (!threadRoot || !QuoteYou.db) { return; }
- QuoteYou.cb.seek('preceding');
- break;
- case Conf['Next Post Quoting You']:
- if (!threadRoot || !QuoteYou.db) { return; }
- QuoteYou.cb.seek('following');
- break;
- default:
- return;
- }
- e.preventDefault();
- return e.stopPropagation();
- },
-
- keyCode(e) {
- let key = (() => { let kc;
- switch ((kc = e.keyCode)) {
- case 8: // return
- return '';
- case 13:
- return 'Enter';
- case 27:
- return 'Esc';
- case 32:
- return 'Space';
- case 37:
- return 'Left';
- case 38:
- return 'Up';
- case 39:
- return 'Right';
- case 40:
- return 'Down';
- case 188:
- return 'Comma';
- case 190:
- return 'Period';
- case 191:
- return 'Slash';
- case 59: case 186:
- return 'Semicolon';
- default:
- if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { // 0-9, A-Z
- return String.fromCharCode(kc).toLowerCase();
- } else if (96 <= kc && kc <= 105) { // numpad 0-9
- return String.fromCharCode(kc - 48).toLowerCase();
- } else {
- return null;
- }
- } })();
- if (key) {
- if (e.altKey) { key = 'Alt+' + key; }
- if (e.ctrlKey) { key = 'Ctrl+' + key; }
- if (e.metaKey) { key = 'Meta+' + key; }
- if (e.shiftKey) { key = 'Shift+' + key; }
- }
- return key;
- },
-
- post(thread) {
- const s = g.SITE.selectors;
- return (
- $$1(`${s.postContainer}${s.highlightable.reply}.${g.SITE.classes.highlight}`, thread) ||
- $$1(`${g.SITE.isOPContainerThread ? s.thread : s.postContainer}${s.highlightable.op}`, thread)
- );
- },
-
- qr(thread) {
- QR.open();
- if (thread != null) {
- QR.quote.call(Keybinds.post(thread));
- }
- return QR.nodes.com.focus();
- },
-
- tags(tag, ta) {
- BoardConfig.ready(function() {
- const {config} = g.BOARD;
- const supported = (() => { switch (tag) {
- case 'spoiler': return !!config.spoilers;
- case 'code': return !!config.code_tags;
- case 'math': case 'eqn': return !!config.math_tags;
- case 'sjis': return !!config.sjis_tags;
- } })();
- if (!supported) { return new Notice('warning', `[${tag}] tags are not supported on /${g.BOARD}/.`, 20); }
- });
-
- const {
- value
- } = ta;
- const selStart = ta.selectionStart;
- const selEnd = ta.selectionEnd;
-
- ta.value =
- value.slice(0, selStart) +
- `[${tag}]` + value.slice(selStart, selEnd) + `[/${tag}]` +
- value.slice(selEnd);
-
- // Move the caret to the end of the selection.
- const range = (`[${tag}]`).length + selEnd;
- ta.setSelectionRange(range, range);
-
- // Fire the 'input' event
- return $$1.event('input', null, ta);
- },
-
- sage() {
- const isSage = /sage/i.test(QR.nodes.email.value);
- return QR.nodes.email.value = isSage ?
- ""
- : "sage";
- },
-
- open(thread, tab) {
- if (g.VIEW !== 'index') { return; }
- const url = Get$1.url('thread', thread);
- if (tab) {
- return $$1.open(url);
- } else {
- return location.href = url;
- }
- },
-
- hl(delta, thread) {
- const replySelector = `${g.SITE.selectors.postContainer}${g.SITE.selectors.highlightable.reply}`;
- const {highlight} = g.SITE.classes;
-
- const postEl = $$1(`${replySelector}.${highlight}`, thread);
-
- if (!delta) {
- if (postEl) { $$1.rmClass(postEl, highlight); }
- return;
- }
-
- if (postEl) {
- const {height} = postEl.getBoundingClientRect();
- if ((Header$1.getTopOf(postEl) >= -height) && (Header$1.getBottomOf(postEl) >= -height)) { // We're at least partially visible
- let next;
- const {root} = Get$1.postFromNode(postEl).nodes;
- const axis = delta === +1 ?
- 'following'
- :
- 'preceding';
- if (!(next = $$1.x(`${axis}-sibling::${g.SITE.xpath.replyContainer}[not(@hidden) and not(child::div[@class='stub'])][1]`, root))) { return; }
- if (!next.matches(replySelector)) { next = $$1(replySelector, next); }
- Header$1.scrollToIfNeeded(next, delta === +1);
- $$1.addClass(next, highlight);
- $$1.rmClass(postEl, highlight);
- return;
- }
- $$1.rmClass(postEl, highlight);
- }
-
- const replies = $$(replySelector, thread);
- if (delta === -1) { replies.reverse(); }
- for (var reply of replies) {
- if (((delta === +1) && (Header$1.getTopOf(reply) > 0)) || ((delta === -1) && (Header$1.getBottomOf(reply) > 0))) {
- $$1.addClass(reply, highlight);
- return;
- }
- }
- }
+ /*
+ * decaffeinate suggestions:
+ * DS102: Remove unnecessary code created because of implicit returns
+ * DS205: Consider reworking code to avoid use of IIFEs
+ * DS207: Consider shorter variations of null checks
+ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+ */
+ var Keybinds = {
+ init() {
+ if (!Conf['Keybinds']) { return; }
+
+ for (var hotkey in Config.hotkeys) {
+ $$1.sync(hotkey, Keybinds.sync);
+ }
+
+ var init = function() {
+ $$1.off(d$1, '4chanXInitFinished', init);
+ $$1.on(d$1, 'keydown', Keybinds.keydown);
+ for (var node of $$('[accesskey]')) {
+ node.removeAttribute('accesskey');
+ }
+ };
+ return $$1.on(d$1, '4chanXInitFinished', init);
+ },
+
+ sync(key, hotkey) {
+ return Conf[hotkey] = key;
+ },
+
+ keydown(e) {
+ let key, thread, threadRoot;
+ let catalog, notifications;
+ if (!(key = Keybinds.keyCode(e))) { return; }
+ const {target} = e;
+ if (['INPUT', 'TEXTAREA'].includes(target.nodeName)) {
+ if (!/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) || !!/^Alt\+(\d|Up|Down|Left|Right)$/.test(key)) { return; }
+ }
+ if (['index', 'thread'].includes(g.VIEW)) {
+ threadRoot = Nav.getThread();
+ thread = Get$1.threadFromRoot(threadRoot);
+ }
+ switch (key) {
+ // QR & Options
+ case Conf['Toggle board list']:
+ if (!Conf['Custom Board Navigation']) { return; }
+ Header$1.toggleBoardList();
+ break;
+ case Conf['Toggle header']:
+ Header$1.toggleBarVisibility();
+ break;
+ case Conf['Open empty QR']:
+ if (!QR.postingIsEnabled) { return; }
+ Keybinds.qr();
+ break;
+ case Conf['Open QR']:
+ if (!QR.postingIsEnabled || !threadRoot) { return; }
+ Keybinds.qr(threadRoot);
+ break;
+ case Conf['Open settings']:
+ Settings.open();
+ break;
+ case Conf['Close']:
+ if (Settings.dialog) {
+ Settings.close();
+ } else if ((notifications = $$('.notification')).length) {
+ for (var notification of notifications) {
+ $$1('.close', notification).click();
+ }
+ } else if (QR.nodes && !(QR.nodes.el.hidden || (window.getComputedStyle(QR.nodes.form).display === 'none'))) {
+ if (Conf['Persistent QR']) {
+ QR.hide();
+ } else {
+ QR.close();
+ }
+ } else if (Embedding.lastEmbed) {
+ Embedding.closeFloat();
+ } else {
+ return;
+ }
+ break;
+ case Conf['Spoiler tags']:
+ if (target.nodeName !== 'TEXTAREA') { return; }
+ Keybinds.tags('spoiler', target);
+ break;
+ case Conf['Code tags']:
+ if (target.nodeName !== 'TEXTAREA') { return; }
+ Keybinds.tags('code', target);
+ break;
+ case Conf['Eqn tags']:
+ if (target.nodeName !== 'TEXTAREA') { return; }
+ Keybinds.tags('eqn', target);
+ break;
+ case Conf['Math tags']:
+ if (target.nodeName !== 'TEXTAREA') { return; }
+ Keybinds.tags('math', target);
+ break;
+ case Conf['SJIS tags']:
+ if (target.nodeName !== 'TEXTAREA') { return; }
+ Keybinds.tags('sjis', target);
+ break;
+ case Conf['Toggle sage']:
+ if (!QR.nodes || !!QR.nodes.el.hidden) { return; }
+ Keybinds.sage();
+ break;
+ case Conf['Toggle Cooldown']:
+ if (!QR.nodes || !!QR.nodes.el.hidden || !$$1.hasClass(QR.nodes.fileSubmit, 'custom-cooldown')) { return; }
+ QR.toggleCustomCooldown();
+ break;
+ case Conf['Post from URL']:
+ if (!QR.postingIsEnabled) { return; }
+ QR.handleUrl('');
+ break;
+ case Conf['Add new post']:
+ if (!QR.postingIsEnabled) { return; }
+ QR.addPost();
+ break;
+ case Conf['Submit QR']:
+ if (!QR.nodes || !!QR.nodes.el.hidden) { return; }
+ if (!QR.status()) { QR.submit(); }
+ break;
+ // Index/Thread related
+ case Conf['Update']:
+ switch (g.VIEW) {
+ case 'thread':
+ if (!ThreadUpdater.enabled) { return; }
+ ThreadUpdater.update();
+ break;
+ case 'index':
+ if (!Index$1.enabled) { return; }
+ Index$1.update();
+ break;
+ default:
+ return;
+ }
+ break;
+ case Conf['Watch']:
+ if (!ThreadWatcher$1.enabled || !thread) { return; }
+ ThreadWatcher$1.toggle(thread);
+ break;
+ case Conf['Update thread watcher']:
+ if (!ThreadWatcher$1.enabled) { return; }
+ ThreadWatcher$1.buttonFetchAll();
+ break;
+ case Conf['Toggle thread watcher']:
+ if (!ThreadWatcher$1.enabled) { return; }
+ ThreadWatcher$1.toggleWatcher();
+ break;
+ case Conf['Toggle threading']:
+ if (!QuoteThreading.ready) { return; }
+ QuoteThreading.toggleThreading();
+ break;
+ case Conf['Mark thread read']:
+ if ((g.VIEW !== 'index') || !thread || !UnreadIndex.enabled) { return; }
+ UnreadIndex.markRead.call(threadRoot);
+ break;
+ // Images
+ case Conf['Expand image']:
+ if (!ImageExpand.enabled || !threadRoot) { return; }
+ var post = Get$1.postFromNode(Keybinds.post(threadRoot));
+ if (post.file) { ImageExpand.toggle(post); }
+ break;
+ case Conf['Expand images']:
+ if (!ImageExpand.enabled) { return; }
+ ImageExpand.cb.toggleAll();
+ break;
+ case Conf['Open Gallery']:
+ if (!Gallery.enabled) { return; }
+ Gallery.cb.toggle();
+ break;
+ case Conf['fappeTyme']:
+ if (!FappeTyme.nodes?.fappe) { return; }
+ FappeTyme.toggle('fappe');
+ break;
+ case Conf['werkTyme']:
+ if (!FappeTyme.nodes?.werk) { return; }
+ FappeTyme.toggle('werk');
+ break;
+ // Board Navigation
+ case Conf['Front page']:
+ if (Index$1.enabled) {
+ Index$1.userPageNav(1);
+ } else {
+ location.href = `/${g.BOARD}/`;
+ }
+ break;
+ case Conf['Open front page']:
+ $$1.open(`${location.origin}/${g.BOARD}/`);
+ break;
+ case Conf['Next page']:
+ if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; }
+ if (Index$1.enabled) {
+ if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; }
+ $$1('.next button', Index$1.pagelist).click();
+ } else {
+ $$1(g.SITE.selectors.nav.next)?.click();
+ }
+ break;
+ case Conf['Previous page']:
+ if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; }
+ if (Index$1.enabled) {
+ if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; }
+ $$1('.prev button', Index$1.pagelist).click();
+ } else {
+ $$1(g.SITE.selectors.nav.prev)?.click();
+ }
+ break;
+ case Conf['Search form']:
+ if (g.VIEW !== 'index') { return; }
+ var searchInput = Index$1.enabled ?
+ Index$1.searchInput
+ : g.SITE.selectors.searchBox ?
+ $$1(g.SITE.selectors.searchBox)
+ :
+ undefined;
+ if (!searchInput) { return; }
+ Header$1.scrollToIfNeeded(searchInput);
+ searchInput.focus();
+ break;
+ case Conf['Paged mode']:
+ if (!Index$1.enabledOn(g.BOARD)) { return; }
+ location.href = g.VIEW === 'index' ? '#paged' : `/${g.BOARD}/#paged`;
+ break;
+ case Conf['Infinite scrolling mode']:
+ if (!Index$1.enabledOn(g.BOARD)) { return; }
+ location.href = g.VIEW === 'index' ? '#infinite' : `/${g.BOARD}/#infinite`;
+ break;
+ case Conf['All pages mode']:
+ if (!Index$1.enabledOn(g.BOARD)) { return; }
+ location.href = g.VIEW === 'index' ? '#all-pages' : `/${g.BOARD}/#all-pages`;
+ break;
+ case Conf['Open catalog']:
+ if (!(catalog = CatalogLinks.catalog())) { return; }
+ location.href = catalog;
+ break;
+ case Conf['Cycle sort type']:
+ if (!Index$1.enabled) { return; }
+ Index$1.cycleSortType();
+ break;
+ // Thread Navigation
+ case Conf['Next thread']:
+ if ((g.VIEW !== 'index') || !threadRoot) { return; }
+ Nav.scroll(+1);
+ break;
+ case Conf['Previous thread']:
+ if ((g.VIEW !== 'index') || !threadRoot) { return; }
+ Nav.scroll(-1);
+ break;
+ case Conf['Expand thread']:
+ if ((g.VIEW !== 'index') || !threadRoot) { return; }
+ ExpandThread.toggle(thread);
+ // Keep thread from moving off screen when contracted.
+ Header$1.scrollTo(threadRoot);
+ break;
+ case Conf['Open thread']:
+ if ((g.VIEW !== 'index') || !threadRoot) { return; }
+ Keybinds.open(thread);
+ break;
+ case Conf['Open thread tab']:
+ if ((g.VIEW !== 'index') || !threadRoot) { return; }
+ Keybinds.open(thread, true);
+ break;
+ // Reply Navigation
+ case Conf['Next reply']:
+ if (!threadRoot) { return; }
+ Keybinds.hl(+1, threadRoot);
+ break;
+ case Conf['Previous reply']:
+ if (!threadRoot) { return; }
+ Keybinds.hl(-1, threadRoot);
+ break;
+ case Conf['Deselect reply']:
+ if (!threadRoot) { return; }
+ Keybinds.hl(0, threadRoot);
+ break;
+ case Conf['Hide']:
+ if (!thread || !ThreadHiding.db) { return; }
+ Header$1.scrollTo(threadRoot);
+ ThreadHiding.toggle(thread);
+ break;
+ case Conf['Quick Filter MD5']:
+ if (!threadRoot) { return; }
+ post = Keybinds.post(threadRoot);
+ Keybinds.hl(+1, threadRoot);
+ Filter.quickFilterMD5.call(post, e);
+ break;
+ case Conf['Previous Post Quoting You']:
+ if (!threadRoot || !QuoteYou.db) { return; }
+ QuoteYou.cb.seek('preceding');
+ break;
+ case Conf['Next Post Quoting You']:
+ if (!threadRoot || !QuoteYou.db) { return; }
+ QuoteYou.cb.seek('following');
+ break;
+ default:
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ },
+
+ keyCode(e) {
+ let key = (() => { let kc;
+ switch ((kc = e.keyCode)) {
+ case 8: // return
+ return '';
+ case 13:
+ return 'Enter';
+ case 27:
+ return 'Esc';
+ case 32:
+ return 'Space';
+ case 37:
+ return 'Left';
+ case 38:
+ return 'Up';
+ case 39:
+ return 'Right';
+ case 40:
+ return 'Down';
+ case 188:
+ return 'Comma';
+ case 190:
+ return 'Period';
+ case 191:
+ return 'Slash';
+ case 59: case 186:
+ return 'Semicolon';
+ default:
+ if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { // 0-9, A-Z
+ return String.fromCharCode(kc).toLowerCase();
+ } else if (96 <= kc && kc <= 105) { // numpad 0-9
+ return String.fromCharCode(kc - 48).toLowerCase();
+ } else {
+ return null;
+ }
+ } })();
+ if (key) {
+ if (e.altKey) { key = 'Alt+' + key; }
+ if (e.ctrlKey) { key = 'Ctrl+' + key; }
+ if (e.metaKey) { key = 'Meta+' + key; }
+ if (e.shiftKey) { key = 'Shift+' + key; }
+ }
+ return key;
+ },
+
+ post(thread) {
+ const s = g.SITE.selectors;
+ return (
+ $$1(`${s.postContainer}${s.highlightable.reply}.${g.SITE.classes.highlight}`, thread) ||
+ $$1(`${g.SITE.isOPContainerThread ? s.thread : s.postContainer}${s.highlightable.op}`, thread)
+ );
+ },
+
+ qr(thread) {
+ QR.open();
+ if (thread != null) {
+ QR.quote.call(Keybinds.post(thread));
+ }
+ return QR.nodes.com.focus();
+ },
+
+ tags(tag, ta) {
+ BoardConfig.ready(function() {
+ const {config} = g.BOARD;
+ const supported = (() => { switch (tag) {
+ case 'spoiler': return !!config.spoilers;
+ case 'code': return !!config.code_tags;
+ case 'math': case 'eqn': return !!config.math_tags;
+ case 'sjis': return !!config.sjis_tags;
+ } })();
+ if (!supported) { return new Notice('warning', `[${tag}] tags are not supported on /${g.BOARD}/.`, 20); }
+ });
+
+ const {
+ value
+ } = ta;
+ const selStart = ta.selectionStart;
+ const selEnd = ta.selectionEnd;
+
+ ta.value =
+ value.slice(0, selStart) +
+ `[${tag}]` + value.slice(selStart, selEnd) + `[/${tag}]` +
+ value.slice(selEnd);
+
+ // Move the caret to the end of the selection.
+ const range = (`[${tag}]`).length + selEnd;
+ ta.setSelectionRange(range, range);
+
+ // Fire the 'input' event
+ return $$1.event('input', null, ta);
+ },
+
+ sage() {
+ const isSage = /sage/i.test(QR.nodes.email.value);
+ return QR.nodes.email.value = isSage ?
+ ""
+ : "sage";
+ },
+
+ open(thread, tab) {
+ if (g.VIEW !== 'index') { return; }
+ const url = Get$1.url('thread', thread);
+ if (tab) {
+ return $$1.open(url);
+ } else {
+ return location.href = url;
+ }
+ },
+
+ hl(delta, thread) {
+ const replySelector = `${g.SITE.selectors.postContainer}${g.SITE.selectors.highlightable.reply}`;
+ const {highlight} = g.SITE.classes;
+
+ const postEl = $$1(`${replySelector}.${highlight}`, thread);
+
+ if (!delta) {
+ if (postEl) { $$1.rmClass(postEl, highlight); }
+ return;
+ }
+
+ if (postEl) {
+ const {height} = postEl.getBoundingClientRect();
+ if ((Header$1.getTopOf(postEl) >= -height) && (Header$1.getBottomOf(postEl) >= -height)) { // We're at least partially visible
+ let next;
+ const {root} = Get$1.postFromNode(postEl).nodes;
+ const axis = delta === +1 ?
+ 'following'
+ :
+ 'preceding';
+ if (!(next = $$1.x(`${axis}-sibling::${g.SITE.xpath.replyContainer}[not(@hidden) and not(child::div[@class='stub'])][1]`, root))) { return; }
+ if (!next.matches(replySelector)) { next = $$1(replySelector, next); }
+ Header$1.scrollToIfNeeded(next, delta === +1);
+ $$1.addClass(next, highlight);
+ $$1.rmClass(postEl, highlight);
+ return;
+ }
+ $$1.rmClass(postEl, highlight);
+ }
+
+ const replies = $$(replySelector, thread);
+ if (delta === -1) { replies.reverse(); }
+ for (var reply of replies) {
+ if (((delta === +1) && (Header$1.getTopOf(reply) > 0)) || ((delta === -1) && (Header$1.getBottomOf(reply) > 0))) {
+ $$1.addClass(reply, highlight);
+ return;
+ }
+ }
+ }
};
- const Captcha = {
- Cache: {
- init() {
- $$1.on(d$1, 'SaveCaptcha', e => {
- return this.saveAPI(e.detail);
- });
- return $$1.on(d$1, 'NoCaptcha', e => {
- return this.noCaptcha(e.detail);
- });
- },
-
- captchas: [],
-
- getCount() {
- return this.captchas.length;
- },
-
- neededRaw() {
- return !(
- this.haveCookie() || this.captchas.length || QR.req || this.submitCB
- ) && (
- (QR.posts.length > 1) || Conf['Auto-load captcha'] || !QR.posts[0].isOnlyQuotes() || QR.posts[0].file
- );
- },
-
- needed() {
- return this.neededRaw() && $$1.event('LoadCaptcha');
- },
-
- prerequest() {
- if (!Conf['Prerequest Captcha']) { return; }
- // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit
- return $$1.queueTask(() => {
- if (
- !this.prerequested &&
- this.neededRaw() &&
- !$$1.event('LoadCaptcha') &&
- !QR.captcha.occupied() &&
- (QR.cooldown.seconds <= 60) &&
- (QR.selected === QR.posts[QR.posts.length - 1]) &&
- !QR.selected.isOnlyQuotes()
- ) {
- const isReply = (QR.selected.thread !== 'new');
- if (!$$1.event('RequestCaptcha', { isReply })) {
- this.prerequested = true;
- this.submitCB = captcha => {
- if (captcha) { return this.save(captcha); }
- };
- return this.updateCount();
- }
- }
- });
- },
-
- haveCookie() {
- return /\b_ct=/.test(d$1.cookie) && (QR.posts[0].thread !== 'new');
- },
-
- getOne() {
- let captcha;
- delete this.prerequested;
- this.clear();
- if (captcha = this.captchas.shift()) {
- this.count();
- return captcha;
- } else {
- return null;
- }
- },
-
- request(isReply) {
- if (!this.submitCB) {
- if ($$1.event('RequestCaptcha', { isReply })) { return; }
- }
- return cb => {
- this.submitCB = cb;
- return this.updateCount();
- };
- },
-
- abort() {
- if (this.submitCB) {
- delete this.submitCB;
- $$1.event('AbortCaptcha');
- return this.updateCount();
- }
- },
-
- saveAPI(captcha) {
- let cb;
- if (cb = this.submitCB) {
- delete this.submitCB;
- cb(captcha);
- return this.updateCount();
- } else {
- return this.save(captcha);
- }
- },
-
- noCaptcha(detail) {
- let cb;
- if (cb = this.submitCB) {
- if (!this.haveCookie() || detail?.error) {
- QR.error(detail?.error || 'Failed to retrieve captcha.');
- QR.captcha.setup(d$1.activeElement === QR.nodes.status);
- }
- delete this.submitCB;
- cb();
- return this.updateCount();
- }
- },
-
- save(captcha) {
- let cb;
- if (cb = this.submitCB) {
- this.abort();
- cb(captcha);
- return;
- }
- this.captchas.push(captcha);
- this.captchas.sort((a, b) => a.timeout - b.timeout);
- return this.count();
- },
-
- clear() {
- if (this.captchas.length) {
- let i;
- const now = Date.now();
- for (i = 0; i < this.captchas.length; i++) {
- var captcha = this.captchas[i];
- if (captcha.timeout > now) { break; }
- }
- if (i) {
- this.captchas = this.captchas.slice(i);
- return this.count();
- }
- }
- },
-
- count() {
- clearTimeout(this.timer);
- if (this.captchas.length) {
- this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
- }
- return this.updateCount();
- },
-
- updateCount() {
- return $$1.event('CaptchaCount', this.captchas.length);
- }
- }, Replace: CaptchaReplace, t: CaptchaT, v2: {
- lifetime: 2 * MINUTE,
-
- init() {
- if (d$1.cookie.indexOf('pass_enabled=1') >= 0) { return; }
- if (!(this.isEnabled = !!$$1('#g-recaptcha, #captcha-forced-noscript') || !$$1.id('postForm'))) { return; }
-
- if (this.noscript = Conf['Force Noscript Captcha'] || !Main$1.jsEnabled) {
- $$1.addClass(QR.nodes.el, 'noscript-captcha');
- }
-
- Captcha.cache.init();
- $$1.on(d$1, 'CaptchaCount', this.count.bind(this));
-
- const root = $$1.el('div', { className: 'captcha-root' });
- $$1.extend(root, {
- innerHTML:
- '
'
- }
- );
- const counter = $$1('.captcha-counter > a', root);
- this.nodes = { root, counter };
- this.count();
- $$1.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2');
- $$1.after(QR.nodes.com.parentNode, root);
-
- $$1.on(counter, 'click', this.toggle.bind(this));
- $$1.on(counter, 'keydown', e => {
- if (Keybinds.keyCode(e) !== 'Space') { return; }
- this.toggle();
- e.preventDefault();
- return e.stopPropagation();
- });
- return $$1.on(window, 'captcha:success', () => {
- // XXX Greasemonkey 1.x workaround to gain access to GM_* functions.
- return $$1.queueTask(() => this.save(false));
- });
- },
-
- timeouts: {},
- prevNeeded: 0,
-
- noscriptURL() {
- let lang;
- let url = `https://www.google.com/recaptcha/api/fallback?k=${meta.recaptchaKey}`;
- if (lang = Conf['captchaLanguage'].trim()) {
- url += `&hl=${encodeURIComponent(lang)}`;
- }
- return url;
- },
-
- moreNeeded() {
- // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit
- return $$1.queueTask(() => {
- const needed = Captcha.cache.needed();
- if (needed && !this.prevNeeded) {
- this.setup(QR.cooldown.auto && (d$1.activeElement === QR.nodes.status));
- }
- return this.prevNeeded = needed;
- });
- },
-
- toggle() {
- if (this.nodes.container && !this.timeouts.destroy) {
- return this.destroy();
- } else {
- return this.setup(true, true);
- }
- },
-
- setup(focus, force) {
- if (!this.isEnabled || (!Captcha.cache.needed() && !force)) { return; }
-
- if (focus) {
- $$1.addClass(QR.nodes.el, 'focus');
- this.nodes.counter.focus();
- }
-
- if (this.timeouts.destroy) {
- clearTimeout(this.timeouts.destroy);
- delete this.timeouts.destroy;
- return this.reload();
- }
-
- if (this.nodes.container) {
- // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1226835
- $$1.queueTask(() => {
- let iframe;
- if (this.nodes.container && (d$1.activeElement === this.nodes.counter) && (iframe = $$1('iframe[src^="https://www.google.com/recaptcha/"]', this.nodes.container))) {
- iframe.focus();
- return QR.focus();
- }
- }); // Event handler not fired in Firefox
- return;
- }
-
- this.nodes.container = $$1.el('div', { className: 'captcha-container' });
- $$1.prepend(this.nodes.root, this.nodes.container);
- new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, {
- childList: true,
- subtree: true
- }
- );
-
- if (this.noscript) {
- return this.setupNoscript();
- } else {
- return this.setupJS();
- }
- },
-
- setupNoscript() {
- const iframe = $$1.el('iframe', {
- id: 'qr-captcha-iframe',
- scrolling: 'no',
- src: this.noscriptURL()
- }
- );
- const div = $$1.el('div');
- const textarea = $$1.el('textarea');
- $$1.add(div, textarea);
- return $$1.add(this.nodes.container, [iframe, div]);
- },
-
- setupJS() {
- return $$1.global(function () {
- const render = function () {
- const { classList } = document.documentElement;
- const container = document.querySelector('#qr .captcha-container');
- return container.dataset.widgetID = window.grecaptcha.render(container, {
- sitekey: meta.recaptchaKey,
- theme: classList.contains('tomorrow') || classList.contains('spooky') || classList.contains('dark-captcha') ? 'dark' : 'light',
- callback(response) {
- return window.dispatchEvent(new CustomEvent('captcha:success', { detail: response }));
- }
- }
- );
- };
- if (window.grecaptcha) {
- return render();
- } else {
- const cbNative = window.onRecaptchaLoaded;
- window.onRecaptchaLoaded = function () {
- render();
- return cbNative();
- };
- if (!document.head.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')) {
- const script = document.createElement('script');
- script.src = 'https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit';
- return document.head.appendChild(script);
- }
- }
- });
- },
-
- afterSetup(mutations) {
- for (var mutation of mutations) {
- for (var node of mutation.addedNodes) {
- var iframe, textarea;
- if (iframe = $$1.x('./descendant-or-self::iframe[starts-with(@src, "https://www.google.com/recaptcha/")]', node)) { this.setupIFrame(iframe); }
- if (textarea = $$1.x('./descendant-or-self::textarea', node)) { this.setupTextArea(textarea); }
- }
- }
- },
-
- setupIFrame(iframe) {
- let needle;
- if (!doc.contains(iframe)) { return; }
- Captcha.replace.iframe(iframe);
- $$1.addClass(QR.nodes.el, 'captcha-open');
- this.fixQRPosition();
- $$1.on(iframe, 'load', this.fixQRPosition);
- if (d$1.activeElement === this.nodes.counter) { iframe.focus(); }
- // XXX Make sure scroll on space prevention (see src/css/style.css) doesn't cause scrolling of div
- if (['blink', 'edge'].includes($$1.engine) && (needle = iframe.parentNode, $$('#qr .captcha-container > div > div:first-of-type').includes(needle))) {
- return $$1.on(iframe.parentNode, 'scroll', function () { return this.scrollTop = 0; });
- }
- },
-
- fixQRPosition() {
- if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
- QR.nodes.el.style.top = '';
- return QR.nodes.el.style.bottom = '0px';
- }
- },
-
- setupTextArea(textarea) {
- return $$1.one(textarea, 'input', () => this.save(true));
- },
-
- destroy() {
- if (!this.isEnabled) { return; }
- delete this.timeouts.destroy;
- $$1.rmClass(QR.nodes.el, 'captcha-open');
- if (this.nodes.container) {
- $$1.global(function () {
- const container = document.querySelector('#qr .captcha-container');
- return window.grecaptcha.reset(container.dataset.widgetID);
- });
- $$1.rm(this.nodes.container);
- return delete this.nodes.container;
- }
- },
-
- getOne(isReply) {
- return Captcha.cache.getOne(isReply);
- },
-
- save(pasted, token) {
- Captcha.cache.save({
- response: token || $$1('textarea', this.nodes.container).value,
- timeout: Date.now() + this.lifetime
- });
-
- const focus = (d$1.activeElement?.nodeName === 'IFRAME') && /https?:\/\/www\.google\.com\/recaptcha\//.test(d$1.activeElement.src);
- if (Captcha.cache.needed()) {
- if (focus) {
- if (QR.cooldown.auto || Conf['Post on Captcha Completion']) {
- this.nodes.counter.focus();
- } else {
- QR.nodes.status.focus();
- }
- }
- this.reload();
- } else {
- if (pasted) {
- this.destroy();
- } else {
- if (this.timeouts.destroy == null) { this.timeouts.destroy = setTimeout(this.destroy.bind(this), 3 * SECOND); }
- }
- if (focus) { QR.nodes.status.focus(); }
- }
-
- if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) { return QR.submit(); }
- },
-
- count() {
- const count = Captcha.cache.getCount();
- const loading = Captcha.cache.submitCB ? '...' : '';
- this.nodes.counter.textContent = `Captchas: ${count}${loading}`;
- return this.moreNeeded();
- },
-
- reload() {
- if ($$1('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) {
- this.destroy();
- return this.setup(false, true);
- } else {
- return $$1.global(function () {
- const container = document.querySelector('#qr .captcha-container');
- return window.grecaptcha.reset(container.dataset.widgetID);
- });
- }
- },
-
- occupied() {
- return !!this.nodes.container && !this.timeouts.destroy;
- }
- }
+ const Captcha = {
+ Cache: {
+ init() {
+ $$1.on(d$1, 'SaveCaptcha', e => {
+ return this.saveAPI(e.detail);
+ });
+ return $$1.on(d$1, 'NoCaptcha', e => {
+ return this.noCaptcha(e.detail);
+ });
+ },
+
+ captchas: [],
+
+ getCount() {
+ return this.captchas.length;
+ },
+
+ neededRaw() {
+ return !(
+ this.haveCookie() || this.captchas.length || QR.req || this.submitCB
+ ) && (
+ (QR.posts.length > 1) || Conf['Auto-load captcha'] || !QR.posts[0].isOnlyQuotes() || QR.posts[0].file
+ );
+ },
+
+ needed() {
+ return this.neededRaw() && $$1.event('LoadCaptcha');
+ },
+
+ prerequest() {
+ if (!Conf['Prerequest Captcha']) { return; }
+ // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit
+ return $$1.queueTask(() => {
+ if (
+ !this.prerequested &&
+ this.neededRaw() &&
+ !$$1.event('LoadCaptcha') &&
+ !QR.captcha.occupied() &&
+ (QR.cooldown.seconds <= 60) &&
+ (QR.selected === QR.posts[QR.posts.length - 1]) &&
+ !QR.selected.isOnlyQuotes()
+ ) {
+ const isReply = (QR.selected.thread !== 'new');
+ if (!$$1.event('RequestCaptcha', { isReply })) {
+ this.prerequested = true;
+ this.submitCB = captcha => {
+ if (captcha) { return this.save(captcha); }
+ };
+ return this.updateCount();
+ }
+ }
+ });
+ },
+
+ haveCookie() {
+ return /\b_ct=/.test(d$1.cookie) && (QR.posts[0].thread !== 'new');
+ },
+
+ getOne() {
+ let captcha;
+ delete this.prerequested;
+ this.clear();
+ if (captcha = this.captchas.shift()) {
+ this.count();
+ return captcha;
+ } else {
+ return null;
+ }
+ },
+
+ request(isReply) {
+ if (!this.submitCB) {
+ if ($$1.event('RequestCaptcha', { isReply })) { return; }
+ }
+ return cb => {
+ this.submitCB = cb;
+ return this.updateCount();
+ };
+ },
+
+ abort() {
+ if (this.submitCB) {
+ delete this.submitCB;
+ $$1.event('AbortCaptcha');
+ return this.updateCount();
+ }
+ },
+
+ saveAPI(captcha) {
+ let cb;
+ if (cb = this.submitCB) {
+ delete this.submitCB;
+ cb(captcha);
+ return this.updateCount();
+ } else {
+ return this.save(captcha);
+ }
+ },
+
+ noCaptcha(detail) {
+ let cb;
+ if (cb = this.submitCB) {
+ if (!this.haveCookie() || detail?.error) {
+ QR.error(detail?.error || 'Failed to retrieve captcha.');
+ QR.captcha.setup(d$1.activeElement === QR.nodes.status);
+ }
+ delete this.submitCB;
+ cb();
+ return this.updateCount();
+ }
+ },
+
+ save(captcha) {
+ let cb;
+ if (cb = this.submitCB) {
+ this.abort();
+ cb(captcha);
+ return;
+ }
+ this.captchas.push(captcha);
+ this.captchas.sort((a, b) => a.timeout - b.timeout);
+ return this.count();
+ },
+
+ clear() {
+ if (this.captchas.length) {
+ let i;
+ const now = Date.now();
+ for (i = 0; i < this.captchas.length; i++) {
+ var captcha = this.captchas[i];
+ if (captcha.timeout > now) { break; }
+ }
+ if (i) {
+ this.captchas = this.captchas.slice(i);
+ return this.count();
+ }
+ }
+ },
+
+ count() {
+ clearTimeout(this.timer);
+ if (this.captchas.length) {
+ this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
+ }
+ return this.updateCount();
+ },
+
+ updateCount() {
+ return $$1.event('CaptchaCount', this.captchas.length);
+ }
+ }, Replace: CaptchaReplace, t: CaptchaT, v2: {
+ lifetime: 2 * MINUTE,
+
+ init() {
+ if (d$1.cookie.indexOf('pass_enabled=1') >= 0) { return; }
+ if (!(this.isEnabled = !!$$1('#g-recaptcha, #captcha-forced-noscript') || !$$1.id('postForm'))) { return; }
+
+ if (this.noscript = Conf['Force Noscript Captcha'] || !Main$1.jsEnabled) {
+ $$1.addClass(QR.nodes.el, 'noscript-captcha');
+ }
+
+ Captcha.cache.init();
+ $$1.on(d$1, 'CaptchaCount', this.count.bind(this));
+
+ const root = $$1.el('div', { className: 'captcha-root' });
+ $$1.extend(root, {
+ innerHTML:
+ '
'
+ }
+ );
+ const counter = $$1('.captcha-counter > a', root);
+ this.nodes = { root, counter };
+ this.count();
+ $$1.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2');
+ $$1.after(QR.nodes.com.parentNode, root);
+
+ $$1.on(counter, 'click', this.toggle.bind(this));
+ $$1.on(counter, 'keydown', e => {
+ if (Keybinds.keyCode(e) !== 'Space') { return; }
+ this.toggle();
+ e.preventDefault();
+ return e.stopPropagation();
+ });
+ return $$1.on(window, 'captcha:success', () => {
+ // XXX Greasemonkey 1.x workaround to gain access to GM_* functions.
+ return $$1.queueTask(() => this.save(false));
+ });
+ },
+
+ timeouts: {},
+ prevNeeded: 0,
+
+ noscriptURL() {
+ let lang;
+ let url = `https://www.google.com/recaptcha/api/fallback?k=${meta.recaptchaKey}`;
+ if (lang = Conf['captchaLanguage'].trim()) {
+ url += `&hl=${encodeURIComponent(lang)}`;
+ }
+ return url;
+ },
+
+ moreNeeded() {
+ // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit
+ return $$1.queueTask(() => {
+ const needed = Captcha.cache.needed();
+ if (needed && !this.prevNeeded) {
+ this.setup(QR.cooldown.auto && (d$1.activeElement === QR.nodes.status));
+ }
+ return this.prevNeeded = needed;
+ });
+ },
+
+ toggle() {
+ if (this.nodes.container && !this.timeouts.destroy) {
+ return this.destroy();
+ } else {
+ return this.setup(true, true);
+ }
+ },
+
+ setup(focus, force) {
+ if (!this.isEnabled || (!Captcha.cache.needed() && !force)) { return; }
+
+ if (focus) {
+ $$1.addClass(QR.nodes.el, 'focus');
+ this.nodes.counter.focus();
+ }
+
+ if (this.timeouts.destroy) {
+ clearTimeout(this.timeouts.destroy);
+ delete this.timeouts.destroy;
+ return this.reload();
+ }
+
+ if (this.nodes.container) {
+ // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1226835
+ $$1.queueTask(() => {
+ let iframe;
+ if (this.nodes.container && (d$1.activeElement === this.nodes.counter) && (iframe = $$1('iframe[src^="https://www.google.com/recaptcha/"]', this.nodes.container))) {
+ iframe.focus();
+ return QR.focus();
+ }
+ }); // Event handler not fired in Firefox
+ return;
+ }
+
+ this.nodes.container = $$1.el('div', { className: 'captcha-container' });
+ $$1.prepend(this.nodes.root, this.nodes.container);
+ new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, {
+ childList: true,
+ subtree: true
+ }
+ );
+
+ if (this.noscript) {
+ return this.setupNoscript();
+ } else {
+ return this.setupJS();
+ }
+ },
+
+ setupNoscript() {
+ const iframe = $$1.el('iframe', {
+ id: 'qr-captcha-iframe',
+ scrolling: 'no',
+ src: this.noscriptURL()
+ }
+ );
+ const div = $$1.el('div');
+ const textarea = $$1.el('textarea');
+ $$1.add(div, textarea);
+ return $$1.add(this.nodes.container, [iframe, div]);
+ },
+
+ setupJS() {
+ return $$1.global(function () {
+ const render = function () {
+ const { classList } = document.documentElement;
+ const container = document.querySelector('#qr .captcha-container');
+ return container.dataset.widgetID = window.grecaptcha.render(container, {
+ sitekey: meta.recaptchaKey,
+ theme: classList.contains('tomorrow') || classList.contains('spooky') || classList.contains('dark-captcha') ? 'dark' : 'light',
+ callback(response) {
+ return window.dispatchEvent(new CustomEvent('captcha:success', { detail: response }));
+ }
+ }
+ );
+ };
+ if (window.grecaptcha) {
+ return render();
+ } else {
+ const cbNative = window.onRecaptchaLoaded;
+ window.onRecaptchaLoaded = function () {
+ render();
+ return cbNative();
+ };
+ if (!document.head.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')) {
+ const script = document.createElement('script');
+ script.src = 'https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit';
+ return document.head.appendChild(script);
+ }
+ }
+ });
+ },
+
+ afterSetup(mutations) {
+ for (var mutation of mutations) {
+ for (var node of mutation.addedNodes) {
+ var iframe, textarea;
+ if (iframe = $$1.x('./descendant-or-self::iframe[starts-with(@src, "https://www.google.com/recaptcha/")]', node)) { this.setupIFrame(iframe); }
+ if (textarea = $$1.x('./descendant-or-self::textarea', node)) { this.setupTextArea(textarea); }
+ }
+ }
+ },
+
+ setupIFrame(iframe) {
+ let needle;
+ if (!doc.contains(iframe)) { return; }
+ Captcha.replace.iframe(iframe);
+ $$1.addClass(QR.nodes.el, 'captcha-open');
+ this.fixQRPosition();
+ $$1.on(iframe, 'load', this.fixQRPosition);
+ if (d$1.activeElement === this.nodes.counter) { iframe.focus(); }
+ // XXX Make sure scroll on space prevention (see src/css/style.css) doesn't cause scrolling of div
+ if (['blink', 'edge'].includes($$1.engine) && (needle = iframe.parentNode, $$('#qr .captcha-container > div > div:first-of-type').includes(needle))) {
+ return $$1.on(iframe.parentNode, 'scroll', function () { return this.scrollTop = 0; });
+ }
+ },
+
+ fixQRPosition() {
+ if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
+ QR.nodes.el.style.top = '';
+ return QR.nodes.el.style.bottom = '0px';
+ }
+ },
+
+ setupTextArea(textarea) {
+ return $$1.one(textarea, 'input', () => this.save(true));
+ },
+
+ destroy() {
+ if (!this.isEnabled) { return; }
+ delete this.timeouts.destroy;
+ $$1.rmClass(QR.nodes.el, 'captcha-open');
+ if (this.nodes.container) {
+ $$1.global(function () {
+ const container = document.querySelector('#qr .captcha-container');
+ return window.grecaptcha.reset(container.dataset.widgetID);
+ });
+ $$1.rm(this.nodes.container);
+ return delete this.nodes.container;
+ }
+ },
+
+ getOne(isReply) {
+ return Captcha.cache.getOne(isReply);
+ },
+
+ save(pasted, token) {
+ Captcha.cache.save({
+ response: token || $$1('textarea', this.nodes.container).value,
+ timeout: Date.now() + this.lifetime
+ });
+
+ const focus = (d$1.activeElement?.nodeName === 'IFRAME') && /https?:\/\/www\.google\.com\/recaptcha\//.test(d$1.activeElement.src);
+ if (Captcha.cache.needed()) {
+ if (focus) {
+ if (QR.cooldown.auto || Conf['Post on Captcha Completion']) {
+ this.nodes.counter.focus();
+ } else {
+ QR.nodes.status.focus();
+ }
+ }
+ this.reload();
+ } else {
+ if (pasted) {
+ this.destroy();
+ } else {
+ if (this.timeouts.destroy == null) { this.timeouts.destroy = setTimeout(this.destroy.bind(this), 3 * SECOND); }
+ }
+ if (focus) { QR.nodes.status.focus(); }
+ }
+
+ if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) { return QR.submit(); }
+ },
+
+ count() {
+ const count = Captcha.cache.getCount();
+ const loading = Captcha.cache.submitCB ? '...' : '';
+ this.nodes.counter.textContent = `Captchas: ${count}${loading}`;
+ return this.moreNeeded();
+ },
+
+ reload() {
+ if ($$1('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) {
+ this.destroy();
+ return this.setup(false, true);
+ } else {
+ return $$1.global(function () {
+ const container = document.querySelector('#qr .captcha-container');
+ return window.grecaptcha.reset(container.dataset.widgetID);
+ });
+ }
+ },
+
+ occupied() {
+ return !!this.nodes.container && !this.timeouts.destroy;
+ }
+ }
};
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS202: Simplify dynamic range loops
- * DS207: Consider shorter variations of null checks
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
-
- var QR = {
- mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'],
-
- validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i,
-
- typeFromExtension: {
- 'jpg': 'image/jpeg',
- 'jpeg': 'image/jpeg',
- 'png': 'image/png',
- 'gif': 'image/gif',
- 'pdf': 'application/pdf',
- 'swf': 'application/vnd.adobe.flash.movie',
- 'webm': 'video/webm'
- },
-
- extensionFromType: {
- 'image/jpeg': 'jpg',
- 'image/png': 'png',
- 'image/gif': 'gif',
- 'application/pdf': 'pdf',
- 'application/vnd.adobe.flash.movie': 'swf',
- 'application/x-shockwave-flash': 'swf',
- 'video/webm': 'webm'
- },
-
- init() {
- let sc;
- if (!Conf['Quick Reply']) { return; }
-
- this.posts = [];
-
- $$1.on(d$1, '4chanXInitFinished', () => BoardConfig.ready(QR.initReady));
-
- Callbacks.Post.push({
- name: 'Quick Reply',
- cb: this.node
- });
-
- this.shortcut = (sc = $$1.el('a', {
- className: 'disabled',
- textContent: '↩',
- title: 'Quick Reply',
- href: 'javascript:;'
- }
- ));
- $$1.on(sc, 'click', function() {
- if (!QR.postingIsEnabled) { return; }
- if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) {
- QR.open();
- return QR.nodes.com.focus();
- } else {
- return QR.close();
- }
- });
-
- return Header$1.addShortcut('qr', sc, 540);
- },
-
- initReady() {
- let origToggle;
- const captchaVersion = $$1('#g-recaptcha, #captcha-forced-noscript') ? 'v2' : 't';
- QR.captcha = Captcha[captchaVersion];
- QR.postingIsEnabled = true;
-
- const {config} = g.BOARD;
- const prop = (key, def) => +(config[key] ?? def);
-
- QR.min_width = prop('min_image_width', 1);
- QR.min_height = prop('min_image_height', 1);
- QR.max_width = (QR.max_height = 10000);
-
- QR.max_size = prop('max_filesize', 4194304);
- QR.max_size_video = prop('max_webm_filesize', QR.max_size);
- QR.max_comment = prop('max_comment_chars', 2000);
-
- QR.max_width_video = (QR.max_height_video = 2048);
- QR.max_duration_video = prop('max_webm_duration', 120);
-
- QR.forcedAnon = !!config.forced_anon;
- QR.spoiler = !!config.spoilers;
-
- if (origToggle = $$1.id('togglePostFormLink')) {
- const link = $$1.el('h1',
- {className: "qr-link-container"});
- $$1.extend(link, {
- innerHTML:
- `
${g.VIEW === "thread" ? "Reply to Thread" : "Start a Thread"}`
- });
-
- QR.link = link.firstElementChild;
- $$1.on(link.firstChild, 'click', function() {
- QR.open();
- return QR.nodes.com.focus();
- });
-
- $$1.before(origToggle, link);
- origToggle.firstElementChild.textContent = 'Original Form';
- }
-
- if (g.VIEW === 'thread') {
- let navLinksBot;
- const linkBot = $$1.el('div',
- {className: "brackets-wrap qr-link-container-bottom"});
- $$1.extend(linkBot, {innerHTML: '
Reply to Thread'});
-
- $$1.on(linkBot.firstElementChild, 'click', function() {
- QR.open();
- return QR.nodes.com.focus();
- });
-
- if (navLinksBot = $$1('.navLinksBot')) { $$1.prepend(navLinksBot, linkBot); }
- }
-
- $$1.on(d$1, 'QRGetFile', QR.getFile);
- $$1.on(d$1, 'QRDrawFile', QR.drawFile);
- $$1.on(d$1, 'QRSetFile', QR.setFile);
-
- $$1.on(d$1, 'paste', QR.paste);
- $$1.on(d$1, 'dragover', QR.dragOver);
- $$1.on(d$1, 'drop', QR.dropFile);
- $$1.on(d$1, 'dragstart dragend', QR.drag);
-
- $$1.on(d$1, 'IndexRefreshInternal', QR.generatePostableThreadsList);
- $$1.on(d$1, 'ThreadUpdate', QR.statusCheck);
-
- if (!Conf['Persistent QR']) { return; }
- QR.open();
- if (Conf['Auto Hide QR']) { return QR.hide(); }
- },
-
- statusCheck() {
- if (!QR.nodes) { return; }
- const {thread} = QR.posts[0];
- if ((thread !== 'new') && g.threads.get(`${g.BOARD}.${thread}`).isDead) {
- return QR.abort();
- } else {
- return QR.status();
- }
- },
-
- node() {
- $$1.on(this.nodes.quote, 'click', QR.quote);
- if (this.isFetchedQuote) { return QR.generatePostableThreadsList(); }
- },
-
- open() {
- if (QR.nodes) {
- if (QR.nodes.el.hidden) { QR.captcha.setup(); }
- QR.nodes.el.hidden = false;
- QR.unhide();
- } else {
- try {
- QR.dialog();
- } catch (err) {
- delete QR.nodes;
- Main$1.handleErrors({
- message: 'Quick Reply dialog creation crashed.',
- error: err
- });
- return;
- }
- }
- return $$1.rmClass(QR.shortcut, 'disabled');
- },
-
- close() {
- if (QR.req) {
- QR.abort();
- return;
- }
- QR.nodes.el.hidden = true;
- QR.cleanNotifications();
- QR.blur();
- $$1.rmClass(QR.nodes.el, 'dump');
- $$1.addClass(QR.shortcut, 'disabled');
- new QR.post(true);
- for (var post of QR.posts.splice(0, QR.posts.length - 1)) {
- post.delete();
- }
- QR.cooldown.auto = false;
- QR.status();
- return QR.captcha.destroy();
- },
-
- focus() {
- return $$1.queueTask(function() {
- if (!QR.inBubble()) {
- QR.hasFocus = d$1.activeElement && QR.nodes.el.contains(d$1.activeElement);
- return QR.nodes.el.classList.toggle('focus', QR.hasFocus);
- }
- });
- },
-
- inBubble() {
- const bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
- return bubbles.includes(d$1.activeElement) || bubbles.some(el => (getComputedStyle(el).visibility !== 'hidden') && (el.getBoundingClientRect().bottom > 0));
- },
-
- hide() {
- QR.blur();
- $$1.addClass(QR.nodes.el, 'autohide');
- return QR.nodes.autohide.checked = true;
- },
-
- unhide() {
- $$1.rmClass(QR.nodes.el, 'autohide');
- return QR.nodes.autohide.checked = false;
- },
-
- toggleHide() {
- if (this.checked) {
- return QR.hide();
- } else {
- return QR.unhide();
- }
- },
-
- blur() {
- if (QR.nodes.el.contains(d$1.activeElement)) { return d$1.activeElement.blur(); }
- },
-
- toggleSJIS(e) {
- e.preventDefault();
- Conf['sjisPreview'] = !Conf['sjisPreview'];
- $$1.set('sjisPreview', Conf['sjisPreview']);
- return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']);
- },
-
- texPreviewShow() {
- if ($$1.hasClass(QR.nodes.el, 'tex-preview')) { return QR.texPreviewHide(); }
- $$1.addClass(QR.nodes.el, 'tex-preview');
- QR.nodes.texPreview.textContent = QR.nodes.com.value;
- return $$1.event('mathjax', null, QR.nodes.texPreview);
- },
-
- texPreviewHide() {
- return $$1.rmClass(QR.nodes.el, 'tex-preview');
- },
-
- addPost() {
- const wasOpen = (QR.nodes && !QR.nodes.el.hidden);
- QR.open();
- if (wasOpen) {
- $$1.addClass(QR.nodes.el, 'dump');
- new QR.post(true);
- }
- return QR.nodes.com.focus();
- },
-
- setCustomCooldown(enabled) {
- Conf['customCooldownEnabled'] = enabled;
- QR.cooldown.customCooldown = enabled;
- return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);
- },
-
- toggleCustomCooldown() {
- const enabled = $$1.hasClass(QR.nodes.customCooldown, 'disabled');
- QR.setCustomCooldown(enabled);
- return $$1.set('customCooldownEnabled', enabled);
- },
-
- error(err, focusOverride) {
- let el;
- QR.open();
- if (typeof err === 'string') {
- el = $$1.tn(err);
- } else {
- el = err;
- el.removeAttribute('style');
- }
- const notice = new Notice('warning', el);
- QR.notifications.push(notice);
- if (!Header$1.areNotificationsEnabled) {
- if (d$1.hidden && !QR.cooldown.auto) { return alert(el.textContent); }
- } else if (d$1.hidden || !(focusOverride || d$1.hasFocus())) {
- const notif = new Notification(el.textContent, {
- body: el.textContent,
- icon: Favicon.logo
- }
- );
- notif.onclick = () => window.focus();
- if ($$1.engine !== 'gecko') {
- // Firefox automatically closes notifications
- // so we can't control the onclose properly.
- notif.onclose = () => notice.close();
- return notif.onshow = () => setTimeout(function() {
- notif.onclose = null;
- return notif.close();
- }
- , 7 * SECOND);
- }
- }
- },
-
- connectionError() {
- return $$1.el('span',
- { innerHTML:
- 'Connection error while posting. ' +
- '[
More info]'
- }
- );
- },
-
- notifications: [],
-
- cleanNotifications() {
- for (var notification of QR.notifications) {
- notification.close();
- }
- return QR.notifications = [];
- },
-
- status() {
- let disabled, value;
- if (!QR.nodes) { return; }
- const {thread} = QR.posts[0];
- if ((thread !== 'new') && g.threads.get(`${g.BOARD}.${thread}`).isDead) {
- value = 'Dead';
- disabled = true;
- QR.cooldown.auto = false;
- }
-
- value = QR.req ?
- QR.req.progress
- :
- QR.cooldown.seconds || value;
-
- const {status} = QR.nodes;
- status.value = !value ?
- 'Submit'
- : QR.cooldown.auto ?
- `Auto ${value}`
- :
- value;
- return status.disabled = disabled || false;
- },
-
- openPost() {
- QR.open();
- if (QR.selected.isLocked) {
- const index = QR.posts.indexOf(QR.selected);
- (QR.posts[index+1] || new QR.post()).select();
- $$1.addClass(QR.nodes.el, 'dump');
- return QR.cooldown.auto = true;
- }
- },
-
- quote(e) {
- let range;
- e?.preventDefault();
- if (!QR.postingIsEnabled) { return; }
- const sel = d$1.getSelection();
- const post = Get$1.postFromNode(this);
- const {root} = post.nodes;
- const postRange = new Range();
- postRange.selectNode(root);
- let text = post.board.ID === g.BOARD.ID ? `>>${post}\n` : `>>>/${post.board}/${post}\n`;
- for (let i = 0, end = sel.rangeCount, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) {
- try {
- var insideCode, node;
- range = sel.getRangeAt(i);
- // Trim range to be fully inside post
- if (range.compareBoundaryPoints(Range.START_TO_START, postRange) < 0) {
- range.setStartBefore(root);
- }
- if (range.compareBoundaryPoints(Range.END_TO_END, postRange) > 0) {
- range.setEndAfter(root);
- }
-
- if (!range.toString().trim()) { continue; }
-
- var frag = range.cloneContents();
- var ancestor = range.commonAncestorContainer;
- // Quoting the insides of a spoiler/code tag.
- if ($$1.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) {
- $$1.prepend(frag, $$1.tn('[spoiler]'));
- $$1.add(frag, $$1.tn('[/spoiler]'));
- }
- if (insideCode = $$1.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) {
- $$1.prepend(frag, $$1.tn('[code]'));
- $$1.add(frag, $$1.tn('[/code]'));
- }
- for (node of $$((insideCode ? 'br' : '.prettyprint br'), frag)) {
- $$1.replace(node, $$1.tn('\n'));
- }
- for (node of $$('br', frag)) {
- if (node !== frag.lastChild) { $$1.replace(node, $$1.tn('\n>')); }
- }
- g.SITE.insertTags?.(frag);
- for (node of $$('.linkify[data-original]', frag)) {
- $$1.replace(node, $$1.tn(node.dataset.original));
- }
- for (node of $$('.embedder', frag)) {
- if (node.previousSibling?.nodeValue === ' ') { $$1.rm(node.previousSibling); }
- $$1.rm(node);
- }
- text += `>${frag.textContent.trim()}\n`;
- } catch (error) { }
- }
-
- QR.openPost();
- const {com, thread} = QR.nodes;
- if (!com.value) { thread.value = Get$1.threadFromNode(this); }
-
- const wasOnlyQuotes = QR.selected.isOnlyQuotes();
-
- const caretPos = com.selectionStart;
- // Replace selection for text.
- com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
- // Move the caret to the end of the new quote.
- range = caretPos + text.length;
- com.setSelectionRange(range, range);
- com.focus();
-
- // This allows us to determine if any text other than quotes has been typed.
- if (wasOnlyQuotes) { QR.selected.quotedText = com.value; }
-
- QR.selected.save(com);
- return QR.selected.save(thread);
- },
-
- characterCount() {
- const counter = QR.nodes.charCount;
- const count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
- counter.textContent = count;
- counter.hidden = count < (QR.max_comment/2);
- return (count > QR.max_comment ? $$1.addClass : $$1.rmClass)(counter, 'warning');
- },
-
- getFile() {
- return $$1.event('QRFile', QR.selected?.file);
- },
-
- drawFile(e) {
- const file = QR.selected?.file;
- if (!file || !/^(image|video)\//.test(file.type)) { return; }
- const isVideo = /^video\//.test(file);
- const el = $$1.el((isVideo ? 'video' : 'img'));
- $$1.on(el, 'error', () => QR.openError());
- $$1.on(el, (isVideo ? 'loadeddata' : 'load'), function() {
- e.target.getContext('2d').drawImage(el, 0, 0);
- URL.revokeObjectURL(el.src);
- return $$1.event('QRImageDrawn', null, e.target);
- });
- return el.src = URL.createObjectURL(file);
- },
-
- openError() {
- const div = $$1.el('div');
- $$1.extend(div, {
- innerHTML:
- 'Could not open file. [
More info]'
- });
- return QR.error(div);
- },
-
- setFile(e) {
- const {file, name, source} = e.detail;
- if (name != null) { file.name = name; }
- if (source != null) { file.source = source; }
- QR.open();
- return QR.handleFiles([file]);
- },
-
- drag(e) {
- // Let it drag anything from the page.
- const toggle = e.type === 'dragstart' ? $$1.off : $$1.on;
- toggle(d$1, 'dragover', QR.dragOver);
- return toggle(d$1, 'drop', QR.dropFile);
- },
-
- dragOver(e) {
- e.preventDefault();
- return e.dataTransfer.dropEffect = 'copy';
- }, // cursor feedback
-
- dropFile(e) {
- // Let it only handle files from the desktop.
- if (!e.dataTransfer.files.length) { return; }
- e.preventDefault();
- QR.open();
- return QR.handleFiles(e.dataTransfer.files);
- },
-
- paste(e) {
- if (!e.clipboardData.items) { return; }
- let file = null;
- let score = -1;
- for (var item of e.clipboardData.items) {
- var file2;
- if ((item.kind === 'file') && (file2 = item.getAsFile())) {
- var score2 = (2*(file2.size <= QR.max_size)) + (file2.type === 'image/png');
- if (score2 > score) {
- file = file2;
- score = score2;
- }
- }
- }
- if (file) {
- const {type} = file;
- const blob = new Blob([file], {type});
- blob.name = `${Conf['pastedname']}.${$$1.getOwn(QR.extensionFromType, type) || 'jpg'}`;
- QR.open();
- QR.handleFiles([blob]);
- $$1.addClass(QR.nodes.el, 'dump');
- }
- },
-
- pasteFF() {
- const {pasteArea} = QR.nodes;
- if (!pasteArea.childNodes.length) { return; }
- const images = $$('img', pasteArea);
- $$1.rmAll(pasteArea);
- for (var img of images) {
- var m;
- var {src} = img;
- if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) {
- var bstr = atob(m[3]);
- var arr = new Uint8Array(bstr.length);
- for (var i = 0, end = bstr.length, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) {
- arr[i] = bstr.charCodeAt(i);
- }
- var blob = new Blob([arr], {type: m[1]});
- blob.name = `${Conf['pastedname']}.${m[2]}`;
- QR.handleFiles([blob]);
- } else if (/^https?:\/\//.test(src)) {
- QR.handleUrl(src);
- }
- }
- },
-
- handleUrl(urlDefault) {
- QR.open();
- QR.selected.preventAutoPost();
- return CrossOrigin$1.permission(function() {
- const url = prompt('Enter a URL:', urlDefault);
- if (url === null) { return; }
- QR.nodes.fileButton.focus();
- return CrossOrigin$1.file(url, function(blob) {
- if (blob && !/^text\//.test(blob.type)) {
- return QR.handleFiles([blob]);
- } else {
- return QR.error("Can't load file.");
- }
- });
- });
- },
-
- handleFiles(files) {
- if (this !== QR) { // file input
- files = [...this.files];
- this.value = null;
- }
- if (!files.length) { return; }
- QR.cleanNotifications();
- for (var file of files) {
- QR.handleFile(file, files.length);
- }
- if (files.length !== 1) { $$1.addClass(QR.nodes.el, 'dump'); }
- if ((d$1.activeElement === QR.nodes.fileButton) && $$1.hasClass(QR.nodes.fileSubmit, 'has-file')) {
- return QR.nodes.filename.focus();
- }
- },
-
- handleFile(file, nfiles) {
- let post;
- const isText = /^text\//.test(file.type);
- if (nfiles === 1) {
- post = QR.selected;
- } else {
- post = QR.posts[QR.posts.length - 1];
- if (isText ? post.com || post.pasting : post.file) {
- post = new QR.post();
- }
- }
- return post[isText ? 'pasteText' : 'setFile'](file);
- },
-
- openFileInput() {
- if (QR.nodes.fileButton.disabled) { return; }
- QR.nodes.fileInput.click();
- return QR.nodes.fileButton.focus();
- },
-
- generatePostableThreadsList() {
- if (!QR.nodes) { return; }
- const list = QR.nodes.thread;
- const options = [list.firstElementChild];
- for (var thread of g.BOARD.threads.keys) {
- options.push($$1.el('option', {
- value: thread,
- textContent: `Thread ${thread}`
- }
- )
- );
- }
- const val = list.value;
- $$1.rmAll(list);
- $$1.add(list, options);
- list.value = val;
- if (list.value === val) { return; }
- // Fix the value if the option disappeared.
- list.value = g.VIEW === 'thread' ?
- g.THREADID
- :
- 'new';
- return (g.VIEW === 'thread' ? $$1.addClass : $$1.rmClass)(QR.nodes.el, 'reply-to-thread');
- },
-
- dialog() {
- let dialog, event, nodes;
- let name;
- QR.nodes = (nodes = {
- el: (dialog = UI.dialog('qr',
- { innerHTML: QuickReplyPage }))
- });
-
- const setNode = (name, query) => nodes[name] = $$1(query, dialog);
-
- setNode('move', '.move');
- setNode('autohide', '#autohide');
- setNode('close', '.close');
- setNode('thread', 'select');
- setNode('form', 'form');
- setNode('sjisToggle', '#sjis-toggle');
- setNode('texButton', '#tex-preview-button');
- setNode('name', '[data-name=name]');
- setNode('email', '[data-name=email]');
- setNode('sub', '[data-name=sub]');
- setNode('com', '[data-name=com]');
- setNode('charCount', '#char-count');
- setNode('texPreview', '#tex-preview');
- setNode('dumpList', '#dump-list');
- setNode('addPost', '#add-post');
- setNode('oekaki', '.oekaki');
- setNode('drawButton', '#qr-draw-button');
- setNode('fileSubmit', '#file-n-submit');
- setNode('fileButton', '#qr-file-button');
- setNode('noFile', '#qr-no-file');
- setNode('filename', '#qr-filename');
- setNode('spoiler', '#qr-file-spoiler');
- setNode('oekakiButton', '#qr-oekaki-button');
- setNode('fileRM', '#qr-filerm');
- setNode('urlButton', '#url-button');
- setNode('pasteArea', '#paste-area');
- setNode('customCooldown', '#custom-cooldown-button');
- setNode('dumpButton', '#dump-button');
- setNode('status', '[type=submit]');
- setNode('flashTag', '[name=filetag]');
- setNode('fileInput', '[type=file]');
-
- const {config} = g.BOARD;
- const {classList} = QR.nodes.el;
- classList.toggle('forced-anon', QR.forcedAnon);
- classList.toggle('has-spoiler', QR.spoiler);
- classList.toggle('has-sjis', !!config.sjis_tags);
- classList.toggle('has-math', !!config.math_tags);
- classList.toggle('sjis-preview', !!config.sjis_tags && Conf['sjisPreview']);
- classList.toggle('show-new-thread-option', Conf['Show New Thread Option in Threads']);
-
- if (parseInt(Conf['customCooldown'], 10) > 0) {
- $$1.addClass(QR.nodes.fileSubmit, 'custom-cooldown');
- $$1.get('customCooldownEnabled', Conf['customCooldownEnabled'], function({customCooldownEnabled}) {
- QR.setCustomCooldown(customCooldownEnabled);
- return $$1.sync('customCooldownEnabled', QR.setCustomCooldown);
- });
- }
-
- QR.flagsInput();
-
- $$1.on(nodes.autohide, 'change', QR.toggleHide);
- $$1.on(nodes.close, 'click', QR.close);
- $$1.on(nodes.status, 'click', QR.submit);
- $$1.on(nodes.form, 'submit', QR.submit);
- $$1.on(nodes.sjisToggle, 'click', QR.toggleSJIS);
- $$1.on(nodes.texButton, 'mousedown', QR.texPreviewShow);
- $$1.on(nodes.texButton, 'mouseup', QR.texPreviewHide);
- $$1.on(nodes.addPost, 'click', () => new QR.post(true));
- $$1.on(nodes.drawButton, 'click', QR.oekaki.draw);
- $$1.on(nodes.fileButton, 'click', QR.openFileInput);
- $$1.on(nodes.noFile, 'click', QR.openFileInput);
- $$1.on(nodes.filename, 'focus', function() { return $$1.addClass(this.parentNode, 'focus'); });
- $$1.on(nodes.filename, 'blur', function() { return $$1.rmClass(this.parentNode, 'focus'); });
- $$1.on(nodes.spoiler, 'change', () => QR.selected.nodes.spoiler.click());
- $$1.on(nodes.oekakiButton, 'click', QR.oekaki.button);
- $$1.on(nodes.fileRM, 'click', () => QR.selected.rmFile());
- $$1.on(nodes.urlButton, 'click', () => QR.handleUrl(''));
- $$1.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);
- $$1.on(nodes.dumpButton, 'click', () => nodes.el.classList.toggle('dump'));
- $$1.on(nodes.fileInput, 'change', QR.handleFiles);
-
- window.addEventListener('focus', QR.focus, true);
- window.addEventListener('blur', QR.focus, true);
- // We don't receive blur events from captcha iframe.
- $$1.on(d$1, 'click', QR.focus);
-
- // XXX Workaround for image pasting in Firefox, obsolete as of v50.
- // https://bugzilla.mozilla.org/show_bug.cgi?id=906420
- if (($$1.engine === 'gecko') && !window.DataTransferItemList) {
- nodes.pasteArea.hidden = false;
- }
- new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {childList: true});
-
- // save selected post's data
- const items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag'];
- let i = 0;
- const save = function() { return QR.selected.save(this); };
- while ((name = items[i++])) {
- var node;
- if (!(node = nodes[name])) { continue; }
- event = node.nodeName === 'SELECT' ? 'change' : 'input';
- $$1.on(nodes[name], event, save);
- }
-
- // XXX Blink and WebKit treat width and height of