aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-12-22 18:18:30 -0500
committerGitHub <noreply@github.com>2020-12-22 18:18:30 -0500
commitd0adf2ca156f92c4f62e8ee5082f26e21e4fde70 (patch)
tree60e0bdfd26d09e3f195ef0417e13a69b00aa0920
parentbb902c76e8f6b09f2d994091715ae31027354cd6 (diff)
Add window settings (#1160)
* Add window icon * Move some options to a new "Window" section
-rw-r--r--ext/bg/css/settings2.css1
-rw-r--r--ext/bg/settings2.html134
-rw-r--r--ext/mixed/img/window.svg1
-rw-r--r--resources/icons.svg18
4 files changed, 87 insertions, 67 deletions
diff --git a/ext/bg/css/settings2.css b/ext/bg/css/settings2.css
index 765a9c55..80217d9b 100644
--- a/ext/bg/css/settings2.css
+++ b/ext/bg/css/settings2.css
@@ -317,6 +317,7 @@ h3 {
.icon[data-icon=magnifying-glass] { --icon-image: url(/mixed/img/magnifying-glass.svg); }
.icon[data-icon=collapse] { --icon-image: url(/mixed/img/collapse.svg); }
.icon[data-icon=expand] { --icon-image: url(/mixed/img/expand.svg); }
+.icon[data-icon=window] { --icon-image: url(/mixed/img/window.svg); }
/* Content layout */
diff --git a/ext/bg/settings2.html b/ext/bg/settings2.html
index 2f448370..850b6794 100644
--- a/ext/bg/settings2.html
+++ b/ext/bg/settings2.html
@@ -28,6 +28,7 @@
<a href="#!popup" class="outline-item"><span class="outline-item-left"><span class="outline-item-icon icon" data-icon="popup"></span></span><span class="outline-item-label">Popup</span></a>
<a href="#!popup-appearance" class="outline-item"><span class="outline-item-left"><span class="outline-item-icon icon" data-icon="palette"></span></span><span class="outline-item-label">Appearance</span></a>
<a href="#!popup-size" class="outline-item"><span class="outline-item-left"><span class="outline-item-icon icon" data-icon="popup-size"></span></span><span class="outline-item-label">Position &amp; Size</span></a>
+ <a href="#!window" class="outline-item"><span class="outline-item-left"><span class="outline-item-icon icon" data-icon="window"></span></span><span class="outline-item-label">Window</span></a>
<a href="#!audio" class="outline-item"><span class="outline-item-left"><span class="outline-item-icon icon" data-icon="speaker"></span></span><span class="outline-item-label">Audio</span></a>
<a href="#!text-parsing" class="outline-item"><span class="outline-item-left"><span class="outline-item-icon icon" data-icon="text-parsing"></span></span><span class="outline-item-label">Text Parsing</span></a>
<a href="#!translation" class="outline-item"><span class="outline-item-left"><span class="outline-item-icon icon" data-icon="translation"></span></span><span class="outline-item-label">Translation</span></a>
@@ -525,69 +526,6 @@
</p>
</div>
</div>
- <div class="settings-item advanced-only">
- <div class="settings-item-inner">
- <div class="settings-item-left">
- <div class="settings-item-label">
- Use a native browser window instead of an embedded popup
- <a class="more-toggle more-only" data-parent-distance="4">(?)</a>
- </div>
- </div>
- <div class="settings-item-right">
- <label class="toggle"><input type="checkbox" data-setting="general.usePopupWindow"><span class="toggle-body"><span class="toggle-track"></span><span class="toggle-knob"></span></span></label>
- </div>
- </div>
- <div class="settings-item-children more" hidden>
- <p>
- Instead of showing definitions in a popup embedded into the webpage,
- a native browser window containing the popup content will be opened instead.
- This window will be shared across all tabs.
- </p>
- <p>
- <a class="more-toggle" data-parent-distance="3">Less&hellip;</a>
- </p>
- </div>
- </div>
- <div class="settings-item advanced-only">
- <div class="settings-item-inner">
- <div class="settings-item-left">
- <div class="settings-item-label">
- Open a native browser window when copying Japanese text
- <a class="more-toggle more-only" data-parent-distance="4">(?)</a>
- </div>
- </div>
- <div class="settings-item-right">
- <label class="toggle"><input type="checkbox" id="enable-clipboard-popups"><span class="toggle-body"><span class="toggle-track"></span><span class="toggle-knob"></span></span></label>
- </div>
- </div>
- <div class="settings-item-children more" hidden>
- <p>
- When Japanese text is copied to the clipboard, a browser window popup searching for the clipboard
- text will be opened.
- This can be useful for using Yomichan to scan text from external applications.
- </p>
- <p>
- This feature requires Yomichan to have clipboard reading permissions, and when this option is enabled,
- the clipboard will be frequently polled for new text.
- </p>
- <p>
- Alternatively, this feature can be enabled only on the search page, and clipboard contents polling will
- only be performed when the search page is already open.
- </p>
- <p>
- <a class="more-toggle" data-parent-distance="3">Less&hellip;</a>
- </p>
- </div>
- </div>
- <div class="settings-item advanced-only"><div class="settings-item-inner">
- <div class="settings-item-left">
- <div class="settings-item-label">Maximum clipboard text search length</div>
- <div class="settings-item-description">Limit the number of text characters used when searching clipboard content.</div>
- </div>
- <div class="settings-item-right">
- <input type="number" min="0" step="1" data-setting="general.maximumClipboardSearchLength">
- </div>
- </div></div>
</div>
<div class="heading-container">
@@ -932,6 +870,76 @@
</div>
<div class="heading-container">
+ <div class="heading-container-icon"><span class="icon" data-icon="window"></span></div>
+ <div class="heading-container-left"><h2 id="window">Window</h2></div>
+ </div>
+ <div class="settings-group">
+ <div class="settings-item">
+ <div class="settings-item-inner">
+ <div class="settings-item-left">
+ <div class="settings-item-label">
+ Use a native browser window instead of an embedded popup
+ <a class="more-toggle more-only" data-parent-distance="4">(?)</a>
+ </div>
+ </div>
+ <div class="settings-item-right">
+ <label class="toggle"><input type="checkbox" data-setting="general.usePopupWindow"><span class="toggle-body"><span class="toggle-track"></span><span class="toggle-knob"></span></span></label>
+ </div>
+ </div>
+ <div class="settings-item-children more" hidden>
+ <p>
+ Instead of showing definitions in a popup embedded into the webpage,
+ a native browser window containing the popup content will be opened instead.
+ This window will be shared across all tabs.
+ </p>
+ <p>
+ <a class="more-toggle" data-parent-distance="3">Less&hellip;</a>
+ </p>
+ </div>
+ </div>
+ <div class="settings-item">
+ <div class="settings-item-inner">
+ <div class="settings-item-left">
+ <div class="settings-item-label">
+ Open a native browser window when copying Japanese text
+ <a class="more-toggle more-only" data-parent-distance="4">(?)</a>
+ </div>
+ </div>
+ <div class="settings-item-right">
+ <label class="toggle"><input type="checkbox" id="enable-clipboard-popups"><span class="toggle-body"><span class="toggle-track"></span><span class="toggle-knob"></span></span></label>
+ </div>
+ </div>
+ <div class="settings-item-children more" hidden>
+ <p>
+ When Japanese text is copied to the clipboard, a browser window popup searching for the clipboard
+ text will be opened.
+ This can be useful for using Yomichan to scan text from external applications.
+ </p>
+ <p>
+ This feature requires Yomichan to have clipboard reading permissions, and when this option is enabled,
+ the clipboard will be frequently polled for new text.
+ </p>
+ <p>
+ Alternatively, this feature can be enabled only on the search page, and clipboard contents polling will
+ only be performed when the search page is already open.
+ </p>
+ <p>
+ <a class="more-toggle" data-parent-distance="3">Less&hellip;</a>
+ </p>
+ </div>
+ </div>
+ <div class="settings-item"><div class="settings-item-inner">
+ <div class="settings-item-left">
+ <div class="settings-item-label">Maximum clipboard text search length</div>
+ <div class="settings-item-description">Limit the number of text characters used when searching clipboard content.</div>
+ </div>
+ <div class="settings-item-right">
+ <input type="number" min="0" step="1" data-setting="general.maximumClipboardSearchLength">
+ </div>
+ </div></div>
+ </div>
+
+ <div class="heading-container">
<div class="heading-container-icon"><span class="icon" data-icon="speaker"></span></div>
<div class="heading-container-left"><h2 id="audio">Audio</h2></div>
</div>
diff --git a/ext/mixed/img/window.svg b/ext/mixed/img/window.svg
new file mode 100644
index 00000000..d0d3b0fb
--- /dev/null
+++ b/ext/mixed/img/window.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M1 3v10h14V3H1zm1 1h5v1H2V4zm9 0h1v1h-1V4zm2 0h1v1h-1V4zM2 6h12v6H2V6zm1 1.5v1h10v-1H3zm0 2v1h8v-1H3z"/></svg> \ No newline at end of file
diff --git a/resources/icons.svg b/resources/icons.svg
index cd188ad6..7cfc4103 100644
--- a/resources/icons.svg
+++ b/resources/icons.svg
@@ -28,10 +28,10 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="22.627417"
- inkscape:cx="3.1138994"
- inkscape:cy="7.3363221"
+ inkscape:cx="14.845666"
+ inkscape:cy="-0.0071760774"
inkscape:document-units="px"
- inkscape:current-layer="layer46"
+ inkscape:current-layer="layer47"
showgrid="true"
units="px"
inkscape:snap-center="true"
@@ -1494,11 +1494,21 @@
inkscape:label="Collapse"
id="g1073"
inkscape:groupmode="layer"
- style="display:inline">
+ style="display:none">
<path
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 5,1 V 5 H 1 V 7 H 7 V 1 Z m 4,0 v 6 h 6 V 5 H 11 V 1 Z M 1,9 v 2 h 4 v 4 H 7 V 9 Z m 8,0 v 6 h 2 v -4 h 4 V 9 Z"
id="path1065"
inkscape:connector-curvature="0" />
</g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer47"
+ inkscape:label="Window"
+ style="display:inline">
+ <path
+ style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
+ d="M 1 3 L 1 13 L 15 13 L 15 3 L 1 3 z M 2 4 L 7 4 L 7 5 L 2 5 L 2 4 z M 11 4 L 12 4 L 12 5 L 11 5 L 11 4 z M 13 4 L 14 4 L 14 5 L 13 5 L 13 4 z M 2 6 L 14 6 L 14 12 L 2 12 L 2 6 z M 3 7.5 L 3 8.5 L 13 8.5 L 13 7.5 L 3 7.5 z M 3 9.5 L 3 10.5 L 11 10.5 L 11 9.5 L 3 9.5 z "
+ id="rect1060" />
+ </g>
</svg>