From 7197c8c033fccc05d96ce871e9484adbb9561eca Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 1 Jan 2012 02:53:45 +0100 Subject: [PATCH] Finish redesign. I'll make the dump mode list later. --- 4chan_x.user.js | 54 +++++++++++++++++++++++++++++++++++++++++-------- script.coffee | 51 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 90 insertions(+), 15 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index ec819c88f..1c9c7d71d 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1247,14 +1247,37 @@ #qr > form {\ margin: 0;\ }\ +#dump {\ + background: -webkit-linear-gradient(#EEE, #CCC);\ + background: -moz-linear-gradient(#EEE, #CCC);\ + background: -o-linear-gradient(#EEE, #CCC);\ + background: linear-gradient(#EEE, #CCC);\ + width: 10%;\ +}\ +#dump:hover, #dump:focus {\ + background: -webkit-linear-gradient(#FFF, #DDD);\ + background: -moz-linear-gradient(#FFF, #DDD);\ + background: -o-linear-gradient(#FFF, #DDD);\ + background: linear-gradient(#FFF, #DDD);\ +}\ +#dump:active, .dump #dump:not(:hover):not(:focus) {\ + background: -webkit-linear-gradient(#CCC, #DDD);\ + background: -moz-linear-gradient(#CCC, #DDD);\ + background: -o-linear-gradient(#CCC, #DDD);\ + background: linear-gradient(#CCC, #DDD);\ +}\ +#qr:not(.dump) #replies {\ + display: none;\ +}\ .field {\ - border: 1px solid #AAA;\ + border: 1px solid #CCC;\ + box-sizing: border-box;\ + font: 13px sans-serif;\ margin: 0;\ padding: 2px 4px 3px;\ - width: 33%;\ + width: 30%;\ }\ textarea.field {\ - font-family: sans-serif;\ min-height: 120px;\ width: 100%;\ }\ @@ -1269,20 +1292,33 @@ textarea.field {\ .field[name=captcha] {\ width: 100%;\ }\ +#qr [type=file] {\ + width: 80%;\ +}\ +#qr [type=submit] {\ + width: 20%;\ +}\ \ \
\ + Quick Reply\ \ \
\
\ -
\ - \ +
\ +
\ +
\
\ - \ +
\ +
\ +
\ '); $.on($('#autohide', qr.el), 'click', qr.hide); $.on($('.close', qr.el), 'click', qr.close); + $.on($('button', qr.el), 'click', function() { + return qr.el.classList.toggle('dump'); + }); $.on($('form', qr.el), 'submit', qr.submit); qr.inputs = { name: $('[name=name]', qr.el), @@ -1304,7 +1340,8 @@ textarea.field {\ }, submit: function(e) { if (e != null) e.preventDefault(); - if (conf['Auto Hide QR']) return qr.hide(); + if (conf['Auto Hide QR']) qr.hide(); + return $('.error', qr.el).textContent = null; }, response: function(e) { var input, name, _ref, _results; @@ -1312,8 +1349,9 @@ textarea.field {\ if (!conf['Persistent QR']) qr.close(); if (/sage/i.test(qr.inputs.email.value)) { qr.sage = true; - qr.inputs[1].value = null; + qr.inputs.email.value = null; } + if (!conf['Remember Subject']) $('[name=subject]', qr.el).value = null; _ref = qr.inputs; _results = []; for (name in _ref) { diff --git a/script.coffee b/script.coffee index 2f28c82f6..3a5c8b129 100644 --- a/script.coffee +++ b/script.coffee @@ -920,14 +920,37 @@ qr = #qr > form { margin: 0; } +#dump { + background: -webkit-linear-gradient(#EEE, #CCC); + background: -moz-linear-gradient(#EEE, #CCC); + background: -o-linear-gradient(#EEE, #CCC); + background: linear-gradient(#EEE, #CCC); + width: 10%; +} +#dump:hover, #dump:focus { + background: -webkit-linear-gradient(#FFF, #DDD); + background: -moz-linear-gradient(#FFF, #DDD); + background: -o-linear-gradient(#FFF, #DDD); + background: linear-gradient(#FFF, #DDD); +} +#dump:active, .dump #dump:not(:hover):not(:focus) { + background: -webkit-linear-gradient(#CCC, #DDD); + background: -moz-linear-gradient(#CCC, #DDD); + background: -o-linear-gradient(#CCC, #DDD); + background: linear-gradient(#CCC, #DDD); +} +#qr:not(.dump) #replies { + display: none; +} .field { - border: 1px solid #AAA; + border: 1px solid #CCC; + box-sizing: border-box; + font: 13px sans-serif; margin: 0; padding: 2px 4px 3px; - width: 33%; + width: 30%; } textarea.field { - font-family: sans-serif; min-height: 120px; width: 100%; } @@ -942,20 +965,31 @@ textarea.field { .field[name=captcha] { width: 100%; } +#qr [type=file] { + width: 80%; +} +#qr [type=submit] { + width: 20%; +}
+ Quick Reply
-
- +
+
+
- +
+
+
' $.on $('#autohide', qr.el), 'click', qr.hide $.on $('.close', qr.el), 'click', qr.close + $.on $('button', qr.el), 'click', -> qr.el.classList.toggle 'dump' $.on $('form', qr.el), 'submit', qr.submit # save & load inputs' value with localStorage @@ -975,6 +1009,7 @@ textarea.field { submit: (e) -> e?.preventDefault() qr.hide() if conf['Auto Hide QR'] + $('.error', qr.el).textContent = null # magical xhr2 response: (e) -> @@ -986,7 +1021,9 @@ textarea.field { if /sage/i.test qr.inputs.email.value qr.sage = true - qr.inputs[1].value = null + qr.inputs.email.value = null + unless conf['Remember Subject'] + $('[name=subject]', qr.el).value = null for name, input of qr.inputs $.set "qr_#{name}", input.value