diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fcf71031..1826c7750 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +**ccd0**: +- Add updater for Chrom* extension. +- Fix flag selector not being removed from post form. +- Fix [navigation bug](https://github.com/ccd0/4chan-x/issues/14) + ### v2.9.10 *2014-04-02* diff --git a/Gruntfile.coffee b/Gruntfile.coffee index cc725392f..464cd9434 100755 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -50,6 +50,7 @@ module.exports = (grunt) -> crx: files: 'builds/crx/manifest.json': 'src/General/meta/manifest.json' + 'builds/updates.xml': 'src/General/meta/updates.xml' 'builds/crx/script.js': [ 'src/General/meta/botproc.js' 'src/General/meta/banner.js' diff --git a/LICENSE b/LICENSE index 917ac2605..da5b78a4c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* appchan x - Version 2.9.10 - 2014-04-02 +* appchan x - Version 2.9.10 - 2014-04-03 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index c057f780d..524f9a534 100755 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,11 +1,11 @@ // ==UserScript== // @name 4chan X -// @version 1.4.1 +// @version 1.4.5 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. -// @license MIT; https://github.com/Spittie/4chan-x/blob/master/LICENSE +// @license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE // @match *://boards.4chan.org/* // @match *://sys.4chan.org/* // @match *://a.4cdn.org/* @@ -17,7 +17,7 @@ // @grant GM_openInTab // @grant GM_xmlhttpRequest // @run-at document-start -// @updateURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.meta.js -// @downloadURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.user.js +// @updateURL https://github.com/ccd0/4chan-x/raw/stable/builds/4chan-X.meta.js +// @downloadURL https://github.com/ccd0/4chan-x/raw/stable/builds/4chan-X.user.js // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII= // ==/UserScript== diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 88fb866d5..bfd328f14 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -25,7 +25,7 @@ // ==/UserScript== /* -* appchan x - Version 2.9.10 - 2014-04-02 +* appchan x - Version 2.9.10 - 2014-04-03 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -390,7 +390,7 @@ 'Bottom Board List': true, 'Custom Board Navigation': true }, - boardnav: "[ toggle-all ]\n[current-title]\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", + boardnav: "[ toggle-all ]\n[current-title]\n[external-text:\"FAQ\",\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions\"]", QR: { 'QR.personas': "#email:\"sage\";boards:jp;always" }, @@ -8057,9 +8057,16 @@ Linkify = { init: function() { + var type, _i, _len, _ref; if (!Conf['Linkify']) { return; } + this.types = {}; + _ref = this.ordered_types; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + type = _ref[_i]; + this.types[type.key] = type; + } if (Conf['Comment Expansion']) { ExpandComment.callbacks.push(this.node); } @@ -8191,14 +8198,18 @@ return a; }, services: function(link) { - var href, key, match, type, _ref; + var href, match, type, _i, _len, _ref; href = link.href; - _ref = Linkify.types; - for (key in _ref) { - type = _ref[key]; - if (match = type.regExp.exec(href)) { - return [key, match[1], match[2], link]; + _ref = Linkify.ordered_types; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + type = _ref[_i]; + if (!(match = type.regExp.exec(href))) { + continue; } + if (type.dummy) { + return; + } + return [type.key, match[1], match[2], link]; } }, embed: function(data) { @@ -8309,8 +8320,9 @@ } } }, - types: { - audio: { + ordered_types: [ + { + key: 'audio', regExp: /(.*\.(mp3|ogg|wav))$/, el: function(a) { return $.el('audio', { @@ -8319,8 +8331,8 @@ src: a.dataset.uid }); } - }, - gist: { + }, { + key: 'gist', regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/, el: function(a) { var div; @@ -8342,8 +8354,8 @@ } } } - }, - image: { + }, { + key: 'image', regExp: /(http|www).*\.(gif|png|jpg|jpeg|bmp)$/, style: 'border: 0; width: auto; height: auto;', el: function(a) { @@ -8351,24 +8363,24 @@ innerHTML: "" }); } - }, - InstallGentoo: { + }, { + key: 'InstallGentoo', regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/, el: function(a) { return $.el('iframe', { src: "http://paste.installgentoo.com/view/embed/" + a.dataset.uid }); } - }, - Twitter: { + }, { + key: 'Twitter', regExp: /.*twitter.com\/(.+\/status\/\d+)/, el: function(a) { return $.el('iframe', { src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid }); } - }, - LiveLeak: { + }, { + key: 'LiveLeak', regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/, el: function(a) { var el; @@ -8381,8 +8393,8 @@ el.setAttribute("allowfullscreen", "true"); return el; } - }, - MediaCrush: { + }, { + key: 'MediaCrush', regExp: /.*(?:mediacru.sh\/)([0-9a-z_]+)/i, style: 'border: 0;', el: function(a) { @@ -8433,8 +8445,8 @@ }); return el; } - }, - pastebin: { + }, { + key: 'pastebin', regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/, el: function(a) { var div; @@ -8442,8 +8454,8 @@ src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid }); } - }, - gfycat: { + }, { + key: 'gfycat', regExp: /.*gfycat.com\/(?:iframe\/)?(\S*)/, el: function(a) { var div; @@ -8451,8 +8463,8 @@ src: "http://gfycat.com/iframe/" + a.dataset.uid }); } - }, - SoundCloud: { + }, { + key: 'SoundCloud', regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/, style: 'height: auto; width: 500px; display: inline-block;', el: function(a) { @@ -8476,8 +8488,8 @@ return _.title; } } - }, - StrawPoll: { + }, { + key: 'StrawPoll', regExp: /strawpoll\.me\/(?:embed_\d+\/)?(\d+)/, style: 'border: 0; width: 600px; height: 406px;', el: function(a) { @@ -8485,8 +8497,8 @@ src: "http://strawpoll.me/embed_1/" + a.dataset.uid }); } - }, - TwitchTV: { + }, { + key: 'TwitchTV', regExp: /.*(?:twitch.tv\/)([^#\&\?]*).*/, style: "border: none; width: 640px; height: 360px;", el: function(a) { @@ -8505,8 +8517,8 @@ }); } } - }, - Vocaroo: { + }, { + key: 'Vocaroo', regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/, style: 'border: 0; width: 150px; height: 45px;', el: function(a) { @@ -8514,8 +8526,8 @@ innerHTML: "" }); } - }, - Vimeo: { + }, { + key: 'Vimeo', regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/, el: function(a) { return $.el('iframe', { @@ -8530,8 +8542,8 @@ return _.title; } } - }, - Vine: { + }, { + key: 'Vine', regExp: /.*(?:vine.co\/)([^#\&\?]*).*/, style: 'border: none; width: 500px; height: 500px;', el: function(a) { @@ -8539,8 +8551,8 @@ src: "https://vine.co/" + a.dataset.uid + "/card" }); } - }, - YouTube: { + }, { + key: 'YouTube', regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/, el: function(a) { var el; @@ -8558,8 +8570,26 @@ return data.entry.title.$t; } } + }, { + key: 'Loopvid', + regExp: /.*loopvid.appspot.com\/.*/, + dummy: true + }, { + key: 'MediaFire', + regExp: /.*mediafire.com\/.*/, + dummy: true + }, { + key: 'video', + regExp: /(.*\.(ogv|webm|mp4))$/, + el: function(a) { + return $.el('video', { + controls: 'controls', + preload: 'auto', + src: a.dataset.uid + }); + } } - } + ] }; QR = { @@ -9229,20 +9259,20 @@ }, flags: function() { var flag, fn, select, _i, _len, _ref; - fn = function(val) { - return $.el('option', { - value: val[0], - textContent: val[1] - }); - }; select = $.el('select', { name: 'flag', className: 'flagSelector' }); + fn = function(val) { + return $.add(select, $.el('option', { + value: val[0], + textContent: val[1] + })); + }; _ref = [['0', 'None'], ['US', 'American'], ['KP', 'Best Korean'], ['BL', 'Black Nationalist'], ['CM', 'Communist'], ['CF', 'Confederate'], ['RE', 'Conservative'], ['EU', 'European'], ['GY', 'Gay'], ['PC', 'Hippie'], ['IL', 'Israeli'], ['DM', 'Liberal'], ['RP', 'Libertarian'], ['MF', 'Muslim'], ['NZ', 'Nazi'], ['OB', 'Obama'], ['PR', 'Pirate'], ['RB', 'Rebel'], ['TP', 'Tea Partier'], ['TX', 'Texan'], ['TR', 'Tree Hugger'], ['WP', 'White Supremacist']]; for (_i = 0, _len = _ref.length; _i < _len; _i++) { flag = _ref[_i]; - $.add(select, fn(flag)); + fn(flag); } return select; }, @@ -9411,6 +9441,8 @@ if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') { if (/mistyped/i.test(err.textContent)) { err = 'You seem to have mistyped the CAPTCHA.'; + } else if (/expired/i.test(err.textContent)) { + err = 'This CAPTCHA is no longer valid because it has expired.'; } QR.cooldown.auto = false; QR.cooldown.set({ diff --git a/builds/crx.crx b/builds/crx.crx index 7bda9ea53..d6f999455 100644 Binary files a/builds/crx.crx and b/builds/crx.crx differ diff --git a/builds/crx/manifest.json b/builds/crx/manifest.json index 27d236313..ee9cd7574 100644 --- a/builds/crx/manifest.json +++ b/builds/crx/manifest.json @@ -15,6 +15,7 @@ "run_at": "document_start" }], "homepage_url": "http://zixaphir.github.com/appchan-x/", + "update_url": "https://github.com/zixaphir/appchan-x/raw/master/builds/updates.xml", "minimum_chrome_version": "32", "permissions": [ "storage", diff --git a/builds/crx/script.js b/builds/crx/script.js index 3c79fca5c..93f47b6fe 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* appchan x - Version 2.9.10 - 2014-04-02 +* appchan x - Version 2.9.10 - 2014-04-03 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -365,7 +365,7 @@ 'Bottom Board List': true, 'Custom Board Navigation': true }, - boardnav: "[ toggle-all ]\n[current-title]\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", + boardnav: "[ toggle-all ]\n[current-title]\n[external-text:\"FAQ\",\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions\"]", QR: { 'QR.personas': "#email:\"sage\";boards:jp;always" }, @@ -8110,9 +8110,16 @@ Linkify = { init: function() { + var type, _i, _len, _ref; if (!Conf['Linkify']) { return; } + this.types = {}; + _ref = this.ordered_types; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + type = _ref[_i]; + this.types[type.key] = type; + } if (Conf['Comment Expansion']) { ExpandComment.callbacks.push(this.node); } @@ -8244,14 +8251,18 @@ return a; }, services: function(link) { - var href, key, match, type, _ref; + var href, match, type, _i, _len, _ref; href = link.href; - _ref = Linkify.types; - for (key in _ref) { - type = _ref[key]; - if (match = type.regExp.exec(href)) { - return [key, match[1], match[2], link]; + _ref = Linkify.ordered_types; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + type = _ref[_i]; + if (!(match = type.regExp.exec(href))) { + continue; } + if (type.dummy) { + return; + } + return [type.key, match[1], match[2], link]; } }, embed: function(data) { @@ -8362,8 +8373,9 @@ } } }, - types: { - audio: { + ordered_types: [ + { + key: 'audio', regExp: /(.*\.(mp3|ogg|wav))$/, el: function(a) { return $.el('audio', { @@ -8372,8 +8384,8 @@ src: a.dataset.uid }); } - }, - gist: { + }, { + key: 'gist', regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/, el: function(a) { var div; @@ -8395,8 +8407,8 @@ } } } - }, - image: { + }, { + key: 'image', regExp: /(http|www).*\.(gif|png|jpg|jpeg|bmp)$/, style: 'border: 0; width: auto; height: auto;', el: function(a) { @@ -8404,24 +8416,24 @@ innerHTML: "" }); } - }, - InstallGentoo: { + }, { + key: 'InstallGentoo', regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/, el: function(a) { return $.el('iframe', { src: "http://paste.installgentoo.com/view/embed/" + a.dataset.uid }); } - }, - Twitter: { + }, { + key: 'Twitter', regExp: /.*twitter.com\/(.+\/status\/\d+)/, el: function(a) { return $.el('iframe', { src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid }); } - }, - LiveLeak: { + }, { + key: 'LiveLeak', regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/, el: function(a) { var el; @@ -8434,8 +8446,8 @@ el.setAttribute("allowfullscreen", "true"); return el; } - }, - MediaCrush: { + }, { + key: 'MediaCrush', regExp: /.*(?:mediacru.sh\/)([0-9a-z_]+)/i, style: 'border: 0;', el: function(a) { @@ -8486,8 +8498,8 @@ }); return el; } - }, - pastebin: { + }, { + key: 'pastebin', regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/, el: function(a) { var div; @@ -8495,8 +8507,8 @@ src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid }); } - }, - gfycat: { + }, { + key: 'gfycat', regExp: /.*gfycat.com\/(?:iframe\/)?(\S*)/, el: function(a) { var div; @@ -8504,8 +8516,8 @@ src: "http://gfycat.com/iframe/" + a.dataset.uid }); } - }, - SoundCloud: { + }, { + key: 'SoundCloud', regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/, style: 'height: auto; width: 500px; display: inline-block;', el: function(a) { @@ -8529,8 +8541,8 @@ return _.title; } } - }, - StrawPoll: { + }, { + key: 'StrawPoll', regExp: /strawpoll\.me\/(?:embed_\d+\/)?(\d+)/, style: 'border: 0; width: 600px; height: 406px;', el: function(a) { @@ -8538,8 +8550,8 @@ src: "http://strawpoll.me/embed_1/" + a.dataset.uid }); } - }, - TwitchTV: { + }, { + key: 'TwitchTV', regExp: /.*(?:twitch.tv\/)([^#\&\?]*).*/, style: "border: none; width: 640px; height: 360px;", el: function(a) { @@ -8558,8 +8570,8 @@ }); } } - }, - Vocaroo: { + }, { + key: 'Vocaroo', regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/, style: 'border: 0; width: 150px; height: 45px;', el: function(a) { @@ -8567,8 +8579,8 @@ innerHTML: "" }); } - }, - Vimeo: { + }, { + key: 'Vimeo', regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/, el: function(a) { return $.el('iframe', { @@ -8583,8 +8595,8 @@ return _.title; } } - }, - Vine: { + }, { + key: 'Vine', regExp: /.*(?:vine.co\/)([^#\&\?]*).*/, style: 'border: none; width: 500px; height: 500px;', el: function(a) { @@ -8592,8 +8604,8 @@ src: "https://vine.co/" + a.dataset.uid + "/card" }); } - }, - YouTube: { + }, { + key: 'YouTube', regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/, el: function(a) { var el; @@ -8611,8 +8623,26 @@ return data.entry.title.$t; } } + }, { + key: 'Loopvid', + regExp: /.*loopvid.appspot.com\/.*/, + dummy: true + }, { + key: 'MediaFire', + regExp: /.*mediafire.com\/.*/, + dummy: true + }, { + key: 'video', + regExp: /(.*\.(ogv|webm|mp4))$/, + el: function(a) { + return $.el('video', { + controls: 'controls', + preload: 'auto', + src: a.dataset.uid + }); + } } - } + ] }; QR = { @@ -9273,20 +9303,20 @@ }, flags: function() { var flag, fn, select, _i, _len, _ref; - fn = function(val) { - return $.el('option', { - value: val[0], - textContent: val[1] - }); - }; select = $.el('select', { name: 'flag', className: 'flagSelector' }); + fn = function(val) { + return $.add(select, $.el('option', { + value: val[0], + textContent: val[1] + })); + }; _ref = [['0', 'None'], ['US', 'American'], ['KP', 'Best Korean'], ['BL', 'Black Nationalist'], ['CM', 'Communist'], ['CF', 'Confederate'], ['RE', 'Conservative'], ['EU', 'European'], ['GY', 'Gay'], ['PC', 'Hippie'], ['IL', 'Israeli'], ['DM', 'Liberal'], ['RP', 'Libertarian'], ['MF', 'Muslim'], ['NZ', 'Nazi'], ['OB', 'Obama'], ['PR', 'Pirate'], ['RB', 'Rebel'], ['TP', 'Tea Partier'], ['TX', 'Texan'], ['TR', 'Tree Hugger'], ['WP', 'White Supremacist']]; for (_i = 0, _len = _ref.length; _i < _len; _i++) { flag = _ref[_i]; - $.add(select, fn(flag)); + fn(flag); } return select; }, @@ -9455,6 +9485,8 @@ if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') { if (/mistyped/i.test(err.textContent)) { err = 'You seem to have mistyped the CAPTCHA.'; + } else if (/expired/i.test(err.textContent)) { + err = 'This CAPTCHA is no longer valid because it has expired.'; } QR.cooldown.auto = false; QR.cooldown.set({ diff --git a/builds/updates.xml b/builds/updates.xml new file mode 100644 index 000000000..82e6c2565 --- /dev/null +++ b/builds/updates.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/General/Config.coffee b/src/General/Config.coffee index e77c1bbb5..a85442f93 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -865,10 +865,11 @@ Config = 'Custom Board Navigation': true boardnav: """ -[ toggle-all ] -[current-title] -[external-text:"FAQ","https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions"] -""" + [ toggle-all ] + [current-title] + [external-text:"FAQ","https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions"] + """ + QR: 'QR.personas': """ diff --git a/src/General/css/style.css b/src/General/css/style.css new file mode 100755 index 000000000..3ecf23e61 --- /dev/null +++ b/src/General/css/style.css @@ -0,0 +1,1559 @@ +/* General */ +.dialog { + border: 1px solid; + display: block; +} +.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; + transition: color .25s, border-color .25s; +} +.field::-moz-placeholder, +.field:hover::-moz-placeholder { + color: #AAA !important; + font-size: 13px !important; + opacity: 1.0 !important; +} +.captch-img:hover, +.field:hover { + border-color: #999; +} +.field:hover, .field:focus { + color: #000; +} +.field[disabled] { + background-color: #F2F2F2; + color: #888; +} +.field::-webkit-search-decoration { + display: none; +} +.move { + cursor: move; + overflow: hidden; +} +label, +.watch-thread-link { + cursor: pointer; +} +a[href="javascript:;"] { + text-decoration: none; +} +.warning { + color: red; +} +#boardNavDesktop { + display: none !important; +} +a { + outline: none !important; +} +.painted { + border-radius: 3px; + padding: 0px 2px; +} +body>hr, .ad-plea-bottom + hr { + display: none; +} +.board > hr:last-of-type { + border-top-color: transparent !important; +} +div.navLinks { + margin-bottom: -10px !important; +} +.ad-plea { + display: none; +} +.ad-cnt { + margin: 10px !important; +} + +/* 4chan style fixes */ +.opContainer, .op { + display: block !important; + overflow: visible !important; +} +.reply > .file > .fileText { + margin: 0 20px; +} +.hashlink::before { + content: ' '; + visibility: hidden; +} +.inline + .hashlink, +[hidden] { + display: none !important; +} +div.center:not(.ad-cnt) { + display: none !important; +} +.page-num { + margin-right: -8px; +} + +/* fixed, z-index */ +#overlay, +#fourchanx-settings, +#qp, #ihover, +#navlinks, .fixed #header-bar, +:root.float #updater, +:root.float #thread-stats, +#qr { + position: fixed; +} +#fourchanx-settings { + z-index: 999; +} +#overlay { + z-index: 900; +} +#notifications { + z-index: 70; +} +#qp, #ihover { + z-index: 60; +} +#menu { + z-index: 50; +} +#navlinks, #updater, #thread-stats { + z-index: 40; +} +.fixed #header-bar.autohide { + z-index: 35; +} +#qr { + z-index: 30; +} +#thread-watcher { + z-index: 8; +} +:root.fixed-watcher #thread-watcher { + z-index: 20; +} +.fixed #header-bar { + z-index: 10; +} +/* 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; +} +.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); +} +#custom-board-list .current { + padding: 1px 1px 4px 1px; +} +:root.centered-links #shortcuts { + width: 300px; + text-align: right; +} +:root.centered-links #header-bar { + text-align: center; +} +#board-list { + font-size: 13px; +} +: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; +} +#board-list { + text-align: center; +} +.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; +} +:root: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%; +} +#header-bar a:not(.entry):not(.close) { + text-decoration: none; +} +#header-bar a:not(.entry):not(.close):not(.current) { + padding: 1px; +} +#header-bar input { + margin: 0; + vertical-align: bottom; +} +#shortcuts:empty { + display: none; +} +.brackets-wrap::before { + content: "\\00a0["; +} +.brackets-wrap::after { + content: "]\\00a0"; +} +.dead-thread, +.disabled { + opacity: .45; +} +#shortcuts { + float: right; +} +.shortcut { + margin-left: 3px; +} +#navbotright, +#navtopright { + display: none; +} +#toggleMsgBtn { + display: none !important; +} +.current { + font-weight: bold; +} +/* 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; + transition: all .8s .6s cubic-bezier(.55, .055, .675, .19); +} +.fixed.top-header #header-bar #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: 500px; + max-width: 100%; + position: relative; + transition: all .25s ease-in-out; +} +.notification.error { + background-color: hsla(0, 100%, 38%, .9); +} +.notification.warning { + background-color: hsla(36, 100%, 38%, .9); +} +.notification.info { + background-color: hsla(200, 100%, 38%, .9); +} +.notification.success { + background-color: hsla(104, 100%, 38%, .9); +} +.notification 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; +} + +/* Settings */ +:root.fourchan-x body { + -moz-box-sizing: border-box; + box-sizing: border-box; +} +#overlay { + background-color: rgba(0, 0, 0, .5); + 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: 3px; + top: 50%; + left: 50%; + -moz-transform: translate(-50%, -50%); + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} +#fourchanx-settings > nav { + padding: 2px 2px 0; + height: 15px; +} +#fourchanx-settings > nav a { + text-decoration: underline; +} +#fourchanx-settings > nav a.close { + text-decoration: none; + padding: 2px 2px .5em; +} +.section-container { + overflow: auto; + position: absolute; + top: 2.1em; + right: 5px; + bottom: 5px; + left: 5px; + padding-right: 5px; +} +.sections-list { + padding: 0 3px; + float: left; +} +.credits { + float: right; +} +.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 label { + text-decoration: underline; +} +.section-filter ul { + padding: 0; +} +.section-filter li { + margin: 10px 40px; +} +.section-filter textarea { + height: 500px; +} +.section-sauce textarea { + height: 350px; +} +.section-advanced .field[name="boardnav"] { + width: 100%; +} +.section-advanced textarea { + height: 150px; +} +.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; +} +.section-keybinds .field { + font-family: monospace; +} +#fourchanx-settings fieldset { + border: 1px solid; + border-radius: 3px; +} +#fourchanx-settings legend { + font-weight: 700; +} +#fourchanx-settings textarea { + font-family: monospace; + min-width: 100%; + max-width: 100%; +} +#fourchanx-settings code { + color: #000; + background-color: #FFF; + padding: 0 2px; +} +.unscroll { + overflow: hidden; +} + +/* Index */ +#index-menu { + display: flex; +} +:root.thread #index-menu, +:root.index-loading .navLinks, +:root.index-loading .board, +:root.index-loading .pagelist, +:root.thread .pagelist { + display: none; +} +:root:not(.catalog-mode) #index-size, +.index:not(.catalog-mode) #returnlink { + 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; + position: relative; + left: -1.25em; + width: 0; +} +<% if (type === 'crx') { %> +/* ``::-webkit-*'' selectors break selector lists on Firefox. */ +#index-search::-webkit-search-cancel-button, +<% } %> +#index-search:not([data-searching]) + #index-search-clear { + display: none; +} +.summary { + text-decoration: none; +} +.catalog-mode .board { + text-align: center; +} +.catalog-thread { + display: inline-flex; + text-align: left; + flex-direction: column; + align-items: center; + margin: 0 2px 5px; + word-break: break-word; + vertical-align: top; +} +.catalog-small .catalog-thread { + width: 165px; + max-height: 320px; +} +.catalog-large .catalog-thread { + width: 270px; + max-height: 410px; +} +.thumb { + flex-shrink: 0; + position: relative; + background-size: 100% 100%; + background-repeat: no-repeat; + background-position: center; + border-radius: 2px; + box-shadow: 0 0 5px rgba(0, 0, 0, .25); +} +.thumb:not(.deleted-file):not(.no-file) { + min-width: 30px; + min-height: 30px; +} +.thumb.spoiler-file { + background-size: 100px; + width: 100px; + height: 100px; +} +.thumb.deleted-file { + background-size: 127px 13px; + width: 127px; + height: 13px; + padding: 20px 11px; +} +.thumb.no-file { + background-size: 77px 13px; + width: 77px; + height: 13px; + padding: 20px 36px; +} +.thread-icons > img { + width: 1em; + height: 1em; + margin: 0; + vertical-align: text-top; +} +.thumb:not(:hover):not(:focus) > .menu-button:not(.open):not(:focus) > i { + display: none; +} +.thumb > .menu-button { + position: absolute; + top: 0; + right: 0; +} +.thumb > .menu-button > i { + width: 1em; + height: 1em; + padding: 1px; + border-radius: 0 2px 0 2px; + font-size: 14px; + text-align: center; +<% if (type === 'userscript') { %> + line-height: normal; +<% } %> +} +.thread-stats { + flex-shrink: 0; + cursor: help; + font-size: 10px; + font-weight: 700; + margin-top: 2px; +} +.catalog-thread > .subject { + flex-shrink: 0; + font-weight: 700; + line-height: 1; + text-align: center; +} +.catalog-thread > .comment { + flex-shrink: 1; + align-self: stretch; + overflow: hidden; + text-align: center; +} +.thread-info { + position: fixed; + padding: 2px; + border-radius: 2px; + box-shadow: 0 0 5px rgba(0, 0, 0, .25); +} +.thread-info .post { + margin: 0; +} + +/* Announcement Hiding */ +:root.hide-announcement #globalMessage { + display: none; +} +span.hide-announcement { + font-size: 11px; + position: relative; + bottom: 5px; +} +.globalMessage, h2, h3 { + color: inherit !important; + font-size: 13px; + font-weight: 100; +} + a.hide-announcement { + float: left; + font-size: 14px; +} + +/* Unread */ +#unread-line { + margin: 0; + border-color: rgb(255,0,0); +} + +/* Thread Updater */ +#updater { + background: none; + border: none; + box-shadow: none; +} +#updater > .move { + padding: 5px 3px 0px; + margin-bottom: -3px; +} +#updater > div:last-child { + text-align: center; +} +#updater input[type=number] { + width: 4em; +} +:root.float #updater { + padding: 0px 3px; +} +.new { + color: limegreen; +} +#update-status.new { + margin-right: 5px; +} +#update-timer { + cursor: pointer; +} + +/* Thread Watcher */ +#thread-watcher { + position: absolute; +} +#thread-watcher { + padding-bottom: 3px; + padding-left: 3px; + overflow: hidden; + white-space: nowrap; + min-width: 136px; + max-height: 92%; + overflow-y: auto; +} +#thread-watcher .menu-button { + bottom: 1px; +} +:root.fixed-watcher #thread-watcher { + position: fixed; +} +:root:not(.fixed-watcher) #thread-watcher:not(:hover) { + max-height: 210px; + overflow-y: hidden; +} +#thread-watcher > .move { + padding-top: 3px; +} +#watched-threads > div { + max-width: 250px; + overflow: hidden; + padding-left: 3px; + padding-right: 3px; + text-overflow: ellipsis; +} +#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; +} +.watch-thread-link.watched { + opacity: 1; +} + + +/* Thread Stats */ +#thread-stats { + background: none; + border: none; + box-shadow: none; +} +:root.float #post-count, :root.float #file-count { + pointer-events: none; +} +:root.float #thread-stats { + padding: 0px 3px; +} + +/* Quote */ +.deadlink { + text-decoration: none !important; +} +.backlink.deadlink:not(.forwardlink), +.quotelink.deadlink:not(.forwardlink) { + text-decoration: underline !important; +} +.inlined { + opacity: .5; +} +#qp input, .forwarded { + display: none; +} +.quotelink.forwardlink, +.backlink.forwardlink { + text-decoration: none; + border-bottom: 1px dashed; +} +@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; + } +} +.filtered { + text-decoration: underline line-through; +} +:root.hide-backlinks .backlink.filtered { + display: none; +} +.inline { + border: 1px solid; + display: table; + margin: 2px 0; +} +.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; +} +.qphl { + outline: 2px solid rgba(216, 94, 49, .7); +} +:root.highlight-own .your-post > .reply, +:root.highlight-you .quotesYou > .reply { + border-left: 2px solid rgba(221,0,0,.5); +} +/* Quote Threading */ +.threadContainer { + margin-left: 20px; + border-left: 1px solid rgba(128,128,128,.3); +} +.threadOP { + clear: both; +} + +/* File */ +.fileText:hover .fntrunc, +.fileText:not(:hover) .fnfull, +.expanded-image > .post > .file > .fileThumb > img[data-md5], +:not(.expanded-image) > .post > .file > .fileThumb > .full-image { + display: none; +} +.expanding { + opacity: .5; +} +:root.fit-height .full-image { + max-height: 100vh; +} +:root.fit-width .full-image { + max-width: 100%; +} +:root.gecko.fit-width .full-image { + width: 100%; +} +#ihover { + -moz-box-sizing: border-box; + box-sizing: border-box; + max-height: 100%; + max-width: 75%; + padding-bottom: 16px; +} +/* Fappe Tyme */ +.fappeTyme .thread > .noFile, +.fappeTyme .threadContainer > .noFile { + display: none; +} +/* Werk Tyme */ +.werkTyme .post .file { + display: none; +} + +/* Index/Reply Navigation */ +#navlinks { + font-size: 16px; + top: 25px; + right: 10px; +} + +/* Filter */ +.opContainer.filter-highlight { + box-shadow: inset 5px 0 rgba(255, 0, 0, .5); +} +.filter-highlight > .reply { + box-shadow: -5px 0 rgba(255, 0, 0, .5); +} + +/* Spoiler text */ +:root.reveal-spoilers s { + color: white !important; +} + +/* Post Hiding */ +.hide-post-button, +.show-post-button { + font-size: 14px; + line-height: 12px; /* Prevent the floating effect from affecting the thumbnail too */ +} +.opContainer > .show-post-button, +.hide-post-button { + float: left; + margin-right: 3px; +} +.stub input { + display: inline-block; +} + +/* QR */ +:root.hide-original-post-form #postForm, +:root.hide-original-post-form .postingMode, +:root.hide-original-post-form #togglePostForm, +#qr.autohide:not(.focus):not(:hover) > form, +.thread #qr select[data-name=thread], +#file-n-submit:not(.has-file) #qr-filerm { + display: none; +} +#qr select, +#dump-button, +#url-button, +.remove, +.captcha-img { + cursor: pointer; +} +#qr { + z-index: 20; + position: fixed; + padding: 1px; + border: 1px solid transparent; + min-width: 300px; + border-radius: 3px 3px 0 0; +} +#qrtab { + border-radius: 3px 3px 0 0; +} +#qrtab { + margin-bottom: 1px; +} +#qr .close { + float: right; + padding: 0 3px; +} +#qr .warning { + min-height: 1.6em; + vertical-align: middle; + padding: 0 1px; + border-width: 1px; + border-style: solid; +} +.qr-link-container { + 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; +} +.persona { + width: 248px; + max-width: 100%; + min-width: 100%; +} +#dump-button { + width: 10%; + margin: 0; + margin-right: 4px; + font: 13px sans-serif; + padding: 1px 0px 2px; + opacity: 0.6; +} +#url-button { + width: 10%; + margin: 0; + margin-right: 4px; + font: 13px sans-serif; + padding: 1px 0px 2px; + opacity: 0.6; +} +.persona .field:not(#dump) { + width: 95px; + min-width: 33.3%; + max-width: 33.3%; +} +#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 { + resize: both; +} +.captcha-img { + margin: 0px; + text-align: center; + background-image: #fff; + font-size: 0px; + min-height: 59px; + min-width: 302px; +} +.captcha-input{ + width: 100%; + margin: 1px 0 0; +} +.captcha-input.error:focus { + border-color: rgb(255,0,0) !important; +} +.field { + -moz-box-sizing: border-box; + margin: 0px; + padding: 2px 4px 3px; +} +#qr textarea { + min-width: 100%; +} +#qr [type='submit'] { + width: 25%; + vertical-align: top; +} +:root.webkit #qr [type='submit'] { + height: 24px; +} +#qr label input[type="checkbox"] { + position: relative; + top: 2px; +} +/* Fake File Input */ +input#qr-filename { + border: none !important; + width: 80%; + padding: 0px 4px; + position: relative; + bottom: 1px; + background: none !important; +} +input#qr-filename:not(.edit) { + pointer-events: none; +} +#qr-filename, +#qr-filesize, +.has-file #qr-no-file { + display: none; +} +#qr-no-file, +.has-file #qr-filename, +.has-file #qr-filesize { + display: inline-block; + margin: 0 0 2px; + overflow: hidden; + text-overflow: ellipsis; + vertical-align: top; +} +#qr-no-file { + color: #AAA; + padding: 1px 4px; +} +#qr-filename-container { + -moz-box-sizing: border-box; + display: inline-block; + position: relative; + width: 100px; + min-width: 74.6%; + max-width: 74.6%; + margin-right: 0.4%; + margin-top: 1px; + overflow: hidden; + padding: 2px 1px 0; + height: 22px; +} +#qr-filename-container:hover { + cursor: text; +} +#qr-extras-container { + position: absolute; + right: 0px; +} +#qr-filerm { + margin-right: 3px; + z-index: 2; +} +#file-n-submit { + height: 23px; +} +#qr input[type=file] { + visibility: hidden; + position: absolute; +} +/* Thread Select / Spoiler Label */ +#qr select[data-name=thread] { + float: right; +} +#qr.has-spoiler .has-file #qr-spoiler-label { + width: 6.7%; + min-width: 6.7%; + max-width: 6.7%; + display: inline-block; + text-align: center; + vertical-align: top; +} +#qr.has-spoiler #file-n-submit:not(.has-file) #qr-spoiler-label { + display: none; +} +#qr.has-spoiler .has-file #qr-filename-container { + max-width: 67.9%; + min-width: 67.9%; +} +#qr-spoiler-label input { + position: relative; + top: 3px; +} +/* Dumping UI */ +.dump #dump-list-container { + display: block; +} +#dump-list-container { + display: none; + position: relative; + overflow-y: hidden; + margin-top: 1px; +} +#dump-list { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + width: 248px; + max-width: 100%; + min-width: 100%; +} +#dump-list:hover { + overflow-x: auto; +} +.qr-preview { + -moz-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; + -moz-transition: opacity .25s ease-in-out; + vertical-align: top; + background-size: cover; +} +.qr-preview:hover, +.qr-preview:focus { + opacity: .9; +} +.qr-preview::before { + content: counter(thumbnails); + color: #fff; + position: absolute; + top: 3px; + right: 3px; + text-shadow: 0 0 3px #000, 0 0 8px #000; +} +.qr-preview#selected { + opacity: 1; +} +.qr-preview.drag { + box-shadow: 0 0 10px rgba(0,0,0,.5); +} +.qr-preview.over { + border-color: #fff; +} +.qr-preview > span { + color: #fff; +} +.remove { + background: none; + color: #e00; + padding: 1px; +} +a:only-of-type > .remove { + display: none; +} +.remove:hover::after { + content: " Remove"; +} +.qr-preview > label { + background: rgba(0,0,0,.5); + color: #fff; + right: 0; + bottom: 0; + left: 0; + position: absolute; + text-align: center; +} +.qr-preview > label > input { + margin: 0; +} +#add-post { + cursor: pointer; + font-size: 2em; + position: absolute; + top: 50%; + right: 10px; + -moz-transform: translateY(-50%); +} +.textarea { + position: relative; +} +:root.webkit .textarea { + margin-bottom: -2px; +} +#char-count { + color: #000; + background: hsla(0, 0%, 100%, .5); + font-size: 8pt; + position: absolute; + bottom: 1px; + right: 1px; + pointer-events: none; +} + +/* Menu */ +.menu-button:not(.fa-bars) { + display: inline-block; + position: relative; + cursor: pointer; +} +.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; +} +.reply .menu-button, +.op .menu-button, +#thread-watcher .menu-button { + margin-left: -1px !important; + position: relative; +} +.op .menu-button, +#thread-watcher .menu-button { + top: 1px; +} +:root.blink .reply .menu-button { + position: relative; + top: 2px; +} +:root.blink .op .menu-button, +:root.blink #thread-watcher .menu-button { + top: 3px; +} +.menu-button + .container:not(:empty) { + margin-left: -5px !important; +} +#menu { + position: fixed; + outline: none; +} +#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; +} +.left>.entry.has-submenu { + padding-right: 17px !important; +} +.entry input[type="checkbox"], +.entry input[type="radio"] { + margin: 0px; + position: relative; + top: 2px; +} +.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; +} +.export, .import, .reset { + cursor: pointer; + text-decoration: none !important; +} +/* Custom Board Titles */ +.boardTitle[contenteditable="true"], +.boardSubtitle[contenteditable="true"] { + cursor: text !important; +} +div.boardTitle { + font-weight: 400 !important; +} +/* Link Title Favicons */ +.linkify.YouTube { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/youtube.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.Vimeo { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/vimeo.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.SoundCloud { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/soundcloud.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.audio { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/audio.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.LiveLeak { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/liveleak.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.Vocaroo { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/vocaroo.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.pastebin { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/pastebin.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.gist { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/gist.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.image { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/image.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.InstallGentoo { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/installgentoo.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} +.linkify.video { + background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/video.png", {encoding: "base64"}) %>') center left no-repeat!important; + padding-left: 18px; +} + +/* Gallery */ +#a-gallery { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + z-index: 30; + display: <%= flex %>; + <%= flex %>-direction: row; + background: rgba(0,0,0,0.7); +} +.gal-viewport { + display: <%= flex %>; + <%= align %>-items: stretch; + <%= flex %>-direction: row; + <%= flex %>: 1 1 auto; +} +.gal-thumbnails { + <%= flex %>: 0 0 150px; + overflow-y: auto; + display: <%= flex %>; + <%= flex %>-direction: column; + <%= align %>-items: stretch; + text-align: center; + background: rgba(0,0,0,.5); + border-left: 1px solid #222; +} +.gal-hide-thumbnails .gal-thumbnails { + display: none; +} +.gal-thumb img { + max-width: 125px; + max-height: 125px; + height: auto; + width: auto; +} +.gal-thumb { + <%= flex %>: 0 0 auto; + padding: 3px; + line-height: 0; + transition: background .2s linear; +} +.gal-highlight { + background: rgba(0, 190, 255,.8); +} +.gal-prev { + order: 0; + border-right: 1px solid #222; +} +.gal-next { + order: 2; + border-left: 1px solid #222; +} +.gal-prev, +.gal-next { + <%= flex %>: 0 0 20px; + position: relative; + cursor: pointer; + opacity: 0.7; + background-color: rgba(0, 0, 0, 0.3); +} +.gal-prev:hover, +.gal-next:hover { + opacity: 1; +} +.gal-prev::after, +.gal-next::after { + position: absolute; + top: 48.6%; + <%= transform %>: translateY(-50%) + display: inline-block; + border-top: 11px solid transparent; + border-bottom: 11px solid transparent; + content: ""; +} +.gal-prev::after { + border-right: 12px solid #fff; + right: 5px; +} +.gal-next::after { + border-left: 12px solid #fff; + right: 3px; +} +.gal-image { + order: 1; + <%= flex %>: 1 0 auto; + display: <%= flex %>; + <%= align %>-items: flex-start; + <%= justify %>: space-around; + overflow: hidden; + /* Flex > Non-Flex child max-width and overflow fix (Firefox only?) */ + width: 1%; +} +:root:not(.gal-fit-height) .gal-image { + overflow-y: scroll !important; +} +:root:not(.gal-fit-width) .gal-image { + overflow-x: scroll !important; +} +.gal-image a { + margin: auto; + line-height: 0; +} +.gal-fit-width .gal-image img { + max-width: 100%; +} +.gal-fit-height .gal-image img { + /* + Chrome doesn't support viewpoint units in calc() + http://bugs.chromium.org/168840 + "It looks like the original author of viewport units in WebKit is not coming back to fix this stuff." + Well, fuck. + */ + max-height: 95vh; + max-height: calc(100vh - 25px); +} +.gal-buttons { + font-size: 2em; + margin-right: 10px; + top: 5px; +} +.gal-buttons i { + vertical-align: baseline; + border-top-width: .4em; + border-right-width: .25em; + border-left-width: .25em; +} +.gal-buttons .menu-button { + bottom: 2px; + color: #ffffff; + text-shadow: 0px 0px 1px #000000; +} +.gal-close { + color: #ffffff; + text-shadow: 0px 0px 1px #000000; +} +.gal-buttons, +.gal-name, +.gal-count { + position: fixed; + right: 178px; +} +.gal-hide-thumbnails .gal-buttons, +.gal-hide-thumbnails .gal-count, +.gal-hide-thumbnails .gal-name { + right: 28px; +} +.gal-name { + bottom: 6px; + background: rgba(0,0,0,0.6) !important; + border-radius: 3px; + padding: 1px 5px 2px 5px; + text-decoration: none !important; + color: white !important; +} +.gal-name:hover, +.gal-close:hover, +.gal-buttons .menu-button:hover { + color: rgb(95, 95, 101) !important; +} +.gal-count { + bottom: 27px; + background: rgba(0,0,0,0.6) !important; + border-radius: 3px; + padding: 1px 5px 2px 5px; + color: #ffffff !important; +} +:root:not(.gal-fit-width) .gal-name { + bottom: 23px !important; +} +:root:not(.gal-fit-width) .gal-count { + bottom: 44px !important; +} +:root:not(.gal-fit-height):not(.gal-hide-thumbnails) .gal-buttons, +:root:not(.gal-fit-height):not(.gal-hide-thumbnails) .gal-name, +:root:not(.gal-fit-height):not(.gal-hide-thumbnails) .gal-count { + right: 195px !important; +} +:root.gal-hide-thumbnails:not(.gal-fit-height) .gal-buttons, +:root.gal-hide-thumbnails:not(.gal-fit-height) .gal-name, +:root.gal-hide-thumbnails:not(.gal-fit-height) .gal-count { + right: 44px !important; +} +@media screen and (resolution: 1dppx) { + .fa-bars { + font-size: 14px; + } + #shortcuts .fa-bars { + vertical-align: -1px; + } +} diff --git a/src/General/img/links/video.png b/src/General/img/links/video.png new file mode 100644 index 000000000..0a3019b88 Binary files /dev/null and b/src/General/img/links/video.png differ diff --git a/src/General/meta/manifest.json b/src/General/meta/manifest.json index cb022ecea..b9401d1e3 100755 --- a/src/General/meta/manifest.json +++ b/src/General/meta/manifest.json @@ -15,6 +15,7 @@ "run_at": "document_start" }], "homepage_url": "<%= meta.page %>", + "update_url": "<%= meta.repo %>raw/master/builds/updates.xml", "minimum_chrome_version": "<%= meta.min.chrome %>", "permissions": [ "storage", diff --git a/src/General/meta/updates.xml b/src/General/meta/updates.xml new file mode 100644 index 000000000..4b3f6b662 --- /dev/null +++ b/src/General/meta/updates.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index b57a16adc..056933822 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -2,6 +2,9 @@ Linkify = init: -> return if !Conf['Linkify'] + @types = {} + @types[type.key] = type for type in @ordered_types + if Conf['Comment Expansion'] ExpandComment.callbacks.push @node @@ -147,8 +150,9 @@ Linkify = services: (link) -> {href} = link - for key, type of Linkify.types when match = type.regExp.exec href - return [key, match[1], match[2], link] + for type in Linkify.ordered_types when match = type.regExp.exec href + return if type.dummy + return [type.key, match[1], match[2], link] return embed: (data) -> @@ -242,16 +246,16 @@ Linkify = embed.dataset.title = text if Conf['Embedding'] and status in [200, 304] link.textContent = text if link - types: - audio: + ordered_types: [ + key: 'audio' regExp: /(.*\.(mp3|ogg|wav))$/ el: (a) -> $.el 'audio', controls: 'controls' preload: 'auto' src: a.dataset.uid - - gist: + , + key: 'gist' regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/ el: (a) -> div = $.el 'iframe', @@ -261,27 +265,27 @@ Linkify = api: (uid) -> "https://api.github.com/gists/#{uid}" text: ({files}) -> return file for file of files when files.hasOwnProperty file - - image: + , + key: 'image' regExp: /(http|www).*\.(gif|png|jpg|jpeg|bmp)$/ style: 'border: 0; width: auto; height: auto;' el: (a) -> $.el 'div', innerHTML: "" - - InstallGentoo: + , + key: 'InstallGentoo' regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/ el: (a) -> $.el 'iframe', src: "http://paste.installgentoo.com/view/embed/#{a.dataset.uid}" - - Twitter: + , + key: 'Twitter' regExp: /.*twitter.com\/(.+\/status\/\d+)/ el: (a) -> $.el 'iframe', src: "https://twitframe.com/show?url=https://twitter.com/#{a.dataset.uid}" - - LiveLeak: + , + key: 'LiveLeak' regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/ el: (a) -> el = $.el 'iframe', @@ -291,8 +295,8 @@ Linkify = frameborder: "0" el.setAttribute "allowfullscreen", "true" el - - MediaCrush: + , + key: 'MediaCrush' regExp: /.*(?:mediacru.sh\/)([0-9a-z_]+)/i style: 'border: 0;' el: (a) -> @@ -323,20 +327,20 @@ Linkify = else "ERROR: No valid filetype." el - - pastebin: + , + key: 'pastebin' regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/ el: (a) -> div = $.el 'iframe', src: "http://pastebin.com/embed_iframe.php?i=#{a.dataset.uid}" - - gfycat: + , + key: 'gfycat' regExp: /.*gfycat.com\/(?:iframe\/)?(\S*)/ el: (a) -> div = $.el 'iframe', src: "http://gfycat.com/iframe/#{a.dataset.uid}" - - SoundCloud: + , + key: 'SoundCloud' regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/ style: 'height: auto; width: 500px; display: inline-block;' el: (a) -> @@ -352,15 +356,15 @@ Linkify = title: api: (uid) -> "//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/#{uid}" text: (_) -> _.title - - StrawPoll: + , + key: 'StrawPoll' regExp: /strawpoll\.me\/(?:embed_\d+\/)?(\d+)/ style: 'border: 0; width: 600px; height: 406px;' el: (a) -> $.el 'iframe', src: "http://strawpoll.me/embed_1/#{a.dataset.uid}" - - TwitchTV: + , + key: 'TwitchTV' regExp: /.*(?:twitch.tv\/)([^#\&\?]*).*/ style: "border: none; width: 640px; height: 360px;" el: (a) -> @@ -384,15 +388,15 @@ Linkify = """ - - Vocaroo: + , + key: 'Vocaroo' regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/ style: 'border: 0; width: 150px; height: 45px;' el: (a) -> $.el 'object', innerHTML: "" - - Vimeo: + , + key: 'Vimeo' regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/ el: (a) -> $.el 'iframe', @@ -400,15 +404,15 @@ Linkify = title: api: (uid) -> "https://vimeo.com/api/oembed.json?url=http://vimeo.com/#{uid}" text: (_) -> _.title - - Vine: + , + key: 'Vine' regExp: /.*(?:vine.co\/)([^#\&\?]*).*/ style: 'border: none; width: 500px; height: 500px;' el: (a) -> $.el 'iframe', src: "https://vine.co/#{a.dataset.uid}/card" - - YouTube: + , + key: 'YouTube' regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/ el: (a) -> el = $.el 'iframe', @@ -418,4 +422,22 @@ Linkify = title: api: (uid) -> "https://gdata.youtube.com/feeds/api/videos/#{uid}?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode" text: (data) -> data.entry.title.$t + , + # dummy entries: not implemented yet but included to prevent them being wrongly embedded as a subsequent type + key: 'Loopvid' + regExp: /.*loopvid.appspot.com\/.*/ + dummy: true + , + key: 'MediaFire' + regExp: /.*mediafire.com\/.*/ + dummy: true + , + key: 'video' + regExp: /(.*\.(ogv|webm|mp4))$/ + el: (a) -> + $.el 'video', + controls: 'controls' + preload: 'auto' + src: a.dataset.uid + ] diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index cd57406db..ad504c7a1 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -573,14 +573,16 @@ QR = else if !check and @.className.match "\\btripped\\b" then $.rmClass @, 'tripped' flags: -> - fn = (val) -> $.el 'option', - value: val[0] - textContent: val[1] select = $.el 'select', name: 'flag' className: 'flagSelector' - $.add select, fn flag for flag in [ + fn = (val) -> + $.add select, $.el 'option', + value: val[0] + textContent: val[1] + + fn flag for flag in [ ['0', 'None'] ['US', 'American'] ['KP', 'Best Korean'] @@ -770,6 +772,8 @@ QR = # Remove the obnoxious 4chan Pass ad. if /mistyped/i.test err.textContent err = 'You seem to have mistyped the CAPTCHA.' + else if /expired/i.test err.textContent + err = 'This CAPTCHA is no longer valid because it has expired.' QR.cooldown.auto = false # Too many frequent mistyped captchas will auto-ban you! # On connection error, the post most likely didn't go through.