diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/options.css | 14 | ||||
-rw-r--r-- | src/ui/options.html | 26 | ||||
-rw-r--r-- | src/ui/options.js | 7 | ||||
-rw-r--r-- | src/ui/popup.css | 3 | ||||
-rw-r--r-- | src/ui/prompt.css | 11 | ||||
-rw-r--r-- | src/ui/prompt.html | 4 | ||||
-rw-r--r-- | src/ui/ui-hc.css | 26 | ||||
-rw-r--r-- | src/ui/ui.js | 44 |
8 files changed, 98 insertions, 37 deletions
diff --git a/src/ui/options.css b/src/ui/options.css index 9230eb1..ca64859 100644 --- a/src/ui/options.css +++ b/src/ui/options.css @@ -136,9 +136,19 @@ input[type="file"] { .opt-group { padding: 0.5em 0; } + #xssFaq { padding: 0.5em 1em; } + +#tb-options { + display: none; +} + +.tor #tb-options { + display: initial; +} + #clearclick-options { display: none; } @@ -186,10 +196,10 @@ input[type="file"] { padding: .2em .4em; } -#xss-opt-group { +#xss-options { display: none; } -.mozwebext #xss-opt-group { +.mozwebext #xss-options { display: block; } diff --git a/src/ui/options.html b/src/ui/options.html index 5198795..dbf1e15 100644 --- a/src/ui/options.html +++ b/src/ui/options.html @@ -46,7 +46,9 @@ <span id="auto-opt"> <input type="checkbox" class="enforcement_required" id="opt-auto"><label for="opt-auto" id="lbl-auto">__MSG_AutoAllowTopLevel__</label> </span> - + <span id="cascadeRestrictions-opt"> + <input type="checkbox" class="enforcement_required" id="opt-cascadeRestrictions"><label for="opt-cascadeRestrictions" id="lbl-cascadeRestrictions">__MSG_CascadeRestrictions__</label> + </span> </div> <fieldset class="enforcement_required"> @@ -101,17 +103,33 @@ <h3 class="flextabs__tab"><button class="flextabs__toggle">__MSG_SectionAdvanced__</button></h3> <div class="flextabs__content"> - <div class="opt-group" id="xss-opt-group"> - <span id="xss-opts"> + <div id="xss-options" class="opt-group"> + <span id="xss-opt"> <input type="checkbox" id="opt-xss"><label for="opt-xss" id="lbl-xss">__MSG_OptFilterXGet__</label> - <span id="xssFaq">(<a href="https://noscript.net/faq#xss" title="https://noscript.net/faq#xss">__MSG_XssFaq__</a>)</span> + <span id="xssFaq">(<a href="https://noscript.net/faq#xss" title="https://noscript.net/faq#xss">__MSG_XssFaq__</a>)</span> </span> <button id="btn-delete-xss-choices" disabled>__MSG_XSS_clearUserChoices__</button> + <br /> + <span id="xssScanRequestBody-opt"> + <input type="checkbox" id="opt-xssScanRequestBody"> + <label for="opt-xssScanRequestBody" id="lbl-opt-xssScanRequestBody">__MSG_OptScanXUpload__</label> + </span> + <span id="xssBlockUnscannedPOST-opt"> + <input type="checkbox" id="opt-xssBlockUnscannedPOST"> + <label for="opt-xssBlockUnscannedPOST" id="lbl-opt-xssBlockUnscannedPOST">__MSG_OptBlockUnscannedXPost__</label> + </span> </div> <div id="clearclick-options" class="opt-group"> <input type="checkbox" id="opt-clearclick"><label for="opt-clearclick" id="lbl-clearclick">ClearClick</label> </div> + <div id="tb-options" class="opt-group"> + <span id="overrideTorBrowserPolicy-opt"> + <input type="checkbox" id="opt-overrideTorBrowserPolicy"> + <label for="opt-overrideTorBrowserPolicy" id="lbl-opt-overrideTorBrowserPolicy">__MSG_OptOverrideTorBrowserPolicy__</label> + </span> + </div> + <section id="debug" class="browser-style"> <div class="opt-group"> <span><input type="checkbox" id="opt-debug"><label id="label-debug" for="opt-debug">Debug</label></span> diff --git a/src/ui/options.js b/src/ui/options.js index a3f7fe8..2a52a82 100644 --- a/src/ui/options.js +++ b/src/ui/options.js @@ -32,7 +32,14 @@ return policy.autoAllowTop; }); + opt("cascadeRestrictions"); + opt("xss"); + opt("xssScanRequestBody"); + opt("xssBlockUnscannedPOST"); + + opt("overrideTorBrowserPolicy"); + { let button = document.querySelector("#btn-reset"); button.onclick = async () => { diff --git a/src/ui/popup.css b/src/ui/popup.css index a0febc6..a463905 100644 --- a/src/ui/popup.css +++ b/src/ui/popup.css @@ -29,7 +29,7 @@ body { background: transparent no-repeat center; background-size: 100%; transform: unset; - transition: all 0.3s; + transition: transform 0.3s; border: none; display: block; @@ -223,7 +223,6 @@ body { background-position: left top; background-repeat: no-repeat; min-height: 3em; - transition: height .5s; font-size: 1.2em; vertical-align: middle; } diff --git a/src/ui/prompt.css b/src/ui/prompt.css index 9406f01..b85762b 100644 --- a/src/ui/prompt.css +++ b/src/ui/prompt.css @@ -47,7 +47,6 @@ body { max-height: 300px; padding: 8px; text-align: center; - word-break: break-all; } #message.multiline { overflow: auto; @@ -77,6 +76,16 @@ body { text-align: left; } +.choices div { + display: flex; + flex-direction: row; + align-items: baseline; +} +.choices label { + display: block; + padding-bottom: .5em; +} + #buttons { width: 100%; display: flex; diff --git a/src/ui/prompt.html b/src/ui/prompt.html index 3c723e5..7761128 100644 --- a/src/ui/prompt.html +++ b/src/ui/prompt.html @@ -19,10 +19,10 @@ <div id="main"> <div id="message"> </div> -<div id="options"> +<div id="options" class="choices"> <input type="radio"> </div> -<div id="checks"> +<div id="checks" class="choices"> <input type="checkbox"> </div> <div id="buttons"> diff --git a/src/ui/ui-hc.css b/src/ui/ui-hc.css index eaa5914..0978458 100644 --- a/src/ui/ui-hc.css +++ b/src/ui/ui-hc.css @@ -55,15 +55,33 @@ tr.site { display:flex; flex-flow: row; justify-content: space-around; - + height: auto; } -#top button { +#top a { position: static; width: auto; + appearance: initial !important; + -moz-appearance: initial !important; + width: auto; + height: auto; + display: block; } -#top button.icon { +#top a.icon { font-size: 12px !important; - font-family: arial sans-serif !important; + font-family: sans-serif !important; + text-indent: 0; + color: black !important; + background: white !important; + background-image: none !important; + border-radius: .3em; + text-align: center; + border: 1px solid black; + height: auto; + padding: .2em; + vertical-align: middle; +} +#top a.icon:hover { + transform: none; } #noscript-popup #high-contrast-chooser { diff --git a/src/ui/ui.js b/src/ui/ui.js index 205d2a9..7e4d45d 100644 --- a/src/ui/ui.js +++ b/src/ui/ui.js @@ -41,6 +41,9 @@ var UI = (() => { if (UI.local && !UI.local.debug) { debug = () => {}; // be quiet! } + if (UI.local) { + document.documentElement.classList.toggle("tor", !!UI.local.isTorBrowser); + } resolve(); if (UI.onSettings) UI.onSettings(); await HighContrast.init(); @@ -313,33 +316,30 @@ var UI = (() => { sizer.id = "presets-sizer"; sizer.appendChild(presets.cloneNode(true)); document.body.appendChild(sizer); - setTimeout(async () => { - let presetWidth = sizer.querySelector("input.preset").offsetWidth; - let labelWidth = 0; - for (let l of sizer.querySelectorAll("label.preset")) { - let lw = l.offsetWidth; - debug("lw", l.textContent, lw); - if (lw > labelWidth) labelWidth = lw; - } - - debug(`Preset: %s Label: %s`, presetWidth, labelWidth); - labelWidth += 16; - if (presetWidth < labelWidth) { - for (let ss of document.styleSheets) { - if (ss.href.endsWith("/ui.css")) { - for (let r of ss.cssRules) { - if (/input\.preset:checked.*min-width:/.test(r.cssText)) { - r.style.minWidth = (labelWidth) + "px"; - break; - } + let presetWidth = sizer.querySelector("input.preset").offsetWidth; + let labelWidth = 0; + for (let l of sizer.querySelectorAll("label.preset")) { + let lw = l.offsetWidth; + debug("lw", l.textContent, lw); + if (lw > labelWidth) labelWidth = lw; + } + + debug(`Preset: %s Label: %s`, presetWidth, labelWidth); + labelWidth += 16; + if (presetWidth < labelWidth) { + for (let ss of document.styleSheets) { + if (ss.href.endsWith("/ui.css")) { + for (let r of ss.cssRules) { + if (/input\.preset:checked.*min-width:/.test(r.cssText)) { + r.style.minWidth = (labelWidth) + "px"; + break; } } } } + } - sizer.remove(); - - }, 100); + sizer.remove(); UI.Sites.correctSize = () => {}; // just once, please! } |