From a25a4d7c442a5916f6b5d0407d52c9b457c1610b Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 1 Nov 2015 23:50:36 -0800 Subject: [PATCH] Add UI to choose oekaki background color. #555 --- src/General/css/style.css | 25 +++++++++++++++++++++++ src/General/html/Features/QuickReply.html | 1 + src/Posting/QR.oekaki.coffee | 8 ++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/General/css/style.css b/src/General/css/style.css index 5bbe377ff..25efa39c3 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -1444,6 +1444,31 @@ input#qr-filename { 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; diff --git a/src/General/html/Features/QuickReply.html b/src/General/html/Features/QuickReply.html index 8cb855a13..9c6803564 100755 --- a/src/General/html/Features/QuickReply.html +++ b/src/General/html/Features/QuickReply.html @@ -29,6 +29,7 @@ +
diff --git a/src/Posting/QR.oekaki.coffee b/src/Posting/QR.oekaki.coffee index 0104f135c..8c28c59d7 100644 --- a/src/Posting/QR.oekaki.coffee +++ b/src/Posting/QR.oekaki.coffee @@ -82,10 +82,14 @@ QR.oekaki = FCX.oekakiName = 'tegaki.png' Tegaki.open onDone: FCX.oekakiCB - onCancel: -> + onCancel: -> Tegaki.bgColor = '#ffffff' width: +document.querySelector('#qr [name=oekaki-width]').value height: +document.querySelector('#qr [name=oekaki-height]').value - bgColor: '#ffffff' + bgColor: + if document.querySelector('#qr [name=oekaki-bg]').checked + document.querySelector('#qr [name=oekaki-bgcolor]').value + else + 'transparent' button: -> if QR.selected.file