From e8f8a288b76c80036bd393b528725c97b81e68be Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 15 Dec 2011 11:16:28 +0100 Subject: [PATCH] Remove more QR stuff. --- 4chan_x.user.js | 65 ++++--------------------------------------------- script.coffee | 62 +++------------------------------------------- 2 files changed, 9 insertions(+), 118 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index afced9c46..4e227d7c6 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2667,14 +2667,6 @@ } else { g.PAGENUM = parseInt(temp) || 0; } - if (location.hostname === 'sys.4chan.org') { - if (/interactive|complete/.test(d.readyState)) { - qr.sys(); - } else { - $.on(d, 'DOMContentLoaded', qr.sys); - } - return; - } $.on(window, 'message', Main.message); now = Date.now(); if (conf['Check for Updates'] && $.get('lastUpdate', 0) < now - 6 * HOUR) { @@ -2772,12 +2764,10 @@ return options.init(); }, message: function(e) { - var data, origin; - origin = e.origin, data = e.data; - if (origin === 'http://sys.4chan.org') { - return qr.message(data); - } else if (data.version && data.version !== VERSION && confirm('An updated version of 4chan X is available, would you like to install it now?')) { - return window.location = "https://raw.github.com/mayhemydg/4chan-x/" + data.version + "/4chan_x.user.js"; + var version; + version = e.data.version; + if (version && version !== VERSION && confirm('An updated version of 4chan X is available, would you like to install it now?')) { + return window.location = "https://raw.github.com/mayhemydg/4chan-x/" + version + "/4chan_x.user.js"; } }, node: function(e) { @@ -2804,7 +2794,7 @@ div.dialog > div.move {\ cursor: move;\ }\ - label, a, .favicon, #qr img {\ + label, a, .favicon {\ cursor: pointer;\ }\ a[href="javascript:;"] {\ @@ -2910,47 +2900,6 @@ #flavors {\ height: 100%;\ }\ -\ - #qr {\ - position: fixed;\ - max-height: 100%;\ - overflow-x: hidden;\ - overflow-y: auto;\ - }\ - #qr > div.move {\ - text-align: right;\ - }\ - #qr input[name=name] {\ - float: left;\ - }\ - #qr_form {\ - clear: left;\ - }\ - #qr_form, #qr #com_submit, #qr input[name=upfile] {\ - margin: 0;\ - }\ - #qr textarea {\ - width: 100%;\ - height: 125px;\ - }\ - #qr #close, #qr #autohide {\ - float: right;\ - }\ - #qr:not(:hover) > #autohide:checked ~ .autohide {\ - height: 0;\ - overflow: hidden;\ - }\ - /* http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css */\ - #qr input::-webkit-input-placeholder {\ - color: grey;\ - }\ - #qr input:-moz-placeholder {\ - color: grey;\ - }\ - /* qr reCAPTCHA */\ - #qr img {\ - border: 1px solid #AAA;\ - }\ \ #updater {\ position: fixed;\ @@ -3008,10 +2957,6 @@ .filtered {\ text-decoration: line-through;\ }\ -\ - #files > input {\ - display: block;\ - }\ ' }; diff --git a/script.coffee b/script.coffee index c87846d4f..23d0e0201 100644 --- a/script.coffee +++ b/script.coffee @@ -2000,13 +2000,6 @@ Main = else g.PAGENUM = parseInt(temp) or 0 - if location.hostname is 'sys.4chan.org' - if /interactive|complete/.test d.readyState - qr.sys() - else - $.on d, 'DOMContentLoaded', qr.sys - return - $.on window, 'message', Main.message now = Date.now() @@ -2151,11 +2144,9 @@ Main = options.init() message: (e) -> - {origin, data} = e - if origin is 'http://sys.4chan.org' - qr.message data - else if data.version and data.version isnt VERSION and confirm 'An updated version of 4chan X is available, would you like to install it now?' - window.location = "https://raw.github.com/mayhemydg/4chan-x/#{data.version}/4chan_x.user.js" + {version} = e.data + if version and version isnt VERSION and confirm 'An updated version of 4chan X is available, would you like to install it now?' + window.location = "https://raw.github.com/mayhemydg/4chan-x/#{version}/4chan_x.user.js" node: (e) -> {target} = e @@ -2174,7 +2165,7 @@ Main = div.dialog > div.move { cursor: move; } - label, a, .favicon, #qr img { + label, a, .favicon { cursor: pointer; } a[href="javascript:;"] { @@ -2281,47 +2272,6 @@ Main = height: 100%; } - #qr { - position: fixed; - max-height: 100%; - overflow-x: hidden; - overflow-y: auto; - } - #qr > div.move { - text-align: right; - } - #qr input[name=name] { - float: left; - } - #qr_form { - clear: left; - } - #qr_form, #qr #com_submit, #qr input[name=upfile] { - margin: 0; - } - #qr textarea { - width: 100%; - height: 125px; - } - #qr #close, #qr #autohide { - float: right; - } - #qr:not(:hover) > #autohide:checked ~ .autohide { - height: 0; - overflow: hidden; - } - /* http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css */ - #qr input::-webkit-input-placeholder { - color: grey; - } - #qr input:-moz-placeholder { - color: grey; - } - /* qr reCAPTCHA */ - #qr img { - border: 1px solid #AAA; - } - #updater { position: fixed; text-align: right; @@ -2378,10 +2328,6 @@ Main = .filtered { text-decoration: line-through; } - - #files > input { - display: block; - } ' Main.init()