From 14e0a418bf8652a9d9ecbcb9d9e0462b7762a647 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 17 Jan 2022 03:53:16 +0300 Subject: [PATCH 1/4] create URL fallback only when necessary --- js/toolbox.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/js/toolbox.js b/js/toolbox.js index a11ae1c0..4e8a277e 100644 --- a/js/toolbox.js +++ b/js/toolbox.js @@ -290,26 +290,24 @@ function tryJSONparse(jsonString) { } catch (e) {} } -function tryURL( - url, - fallback = { - hash: '', - host: '', - hostname: '', - href: '', - origin: '', - password: '', - pathname: '', - port: '', - protocol: '', - search: '', - searchParams: new URLSearchParams(), - username: '', - }) { +function tryURL(url) { try { return new URL(url); } catch (e) { - return fallback; + return { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + password: '', + pathname: '', + port: '', + protocol: '', + search: '', + searchParams: new URLSearchParams(), + username: '', + }; } } From 9136631bc610bb1e1dfd93f42b582f7ea1cf2598 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 18 Jan 2022 00:11:31 +0300 Subject: [PATCH 2/4] manager: trivial alignments * removed `Filters` left shift * removed inadvertent extra padding in compact mode * fixed `Backup` label in verbose languages * flexible width of header blocks in compact mode --- manage/manage.css | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/manage/manage.css b/manage/manage.css index 5caf56a2..f2e5a6f9 100644 --- a/manage/manage.css +++ b/manage/manage.css @@ -281,18 +281,18 @@ a:hover { margin-left: -13px; cursor: pointer; } - #header #filters summary { - margin: 0 0 -2px -13px; + margin-bottom: -2px; } #header #filters summary h2 { - margin-left: -4px; + display: inline-flex; + flex-wrap: wrap; + align-items: center; } #header summary h2 { - display: inline-flex; - flex-wrap: wrap; + display: inline; border-bottom: 1px dotted transparent; margin-top: .1em; margin-bottom: .1em; @@ -301,8 +301,9 @@ a:hover { border-color: #bbb; } #header summary h2 [data-cmd="note"] { - display: flex; + display: inline-flex; align-items: center; + vertical-align: middle; } /* compact layout */ @@ -828,6 +829,8 @@ a:hover { #search-wrapper, #sort-wrapper { display: flex; align-items: center; +} +#search-wrapper { margin-bottom: .5rem; } #searchMode { @@ -1052,7 +1055,8 @@ a:hover { #search-wrapper, #sort-wrapper, #header summary { - max-width: 247px; + min-width: 10em; + max-width: 50vw; } #message-box > div { @@ -1062,10 +1066,6 @@ a:hover { margin-right: auto; } - .filter-selection { - max-width: 226px; - } - #header { display: table-header-group; height: auto; @@ -1080,7 +1080,7 @@ a:hover { display: flex; flex-wrap: wrap; width: 100%; - padding: .5rem 0 1rem; + padding: 0 0 1rem; } #manage-settings > .settings-column { @@ -1097,8 +1097,6 @@ a:hover { } #header h1, - #header h2, - #header h3, #backup-message { display: none; } From 936f5b40d23432b473422440316985074e0530a9 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 18 Jan 2022 01:08:28 +0300 Subject: [PATCH 3/4] pixel-align (i) icon --- edit.html | 4 +++- manage.html | 8 +++++--- options.html | 4 +++- popup.html | 4 +++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/edit.html b/edit.html index b862d77f..84768688 100644 --- a/edit.html +++ b/edit.html @@ -486,7 +486,9 @@ - + + + diff --git a/manage.html b/manage.html index 625ceba8..1a960c80 100644 --- a/manage.html +++ b/manage.html @@ -321,8 +321,8 @@
-

- +

@@ -369,7 +369,9 @@ - + + + diff --git a/options.html b/options.html index 7705accf..c56930c7 100644 --- a/options.html +++ b/options.html @@ -329,7 +329,9 @@ - + + + diff --git a/popup.html b/popup.html index 584d3bde..cef9b3d6 100644 --- a/popup.html +++ b/popup.html @@ -280,7 +280,9 @@ - + + + From 0705392fb2e59b8df2d4b786f9717cf214ea333a Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 18 Jan 2022 16:39:33 +0300 Subject: [PATCH 4/4] fix/deduplicate/simplify installer html/css/js (#1383) --- edit.html | 38 ----- edit/settings.html | 35 ++++ edit/settings.js | 3 +- install-usercss.html | 112 ++++++------- install-usercss/install-usercss.css | 242 +++++++++++----------------- install-usercss/install-usercss.js | 96 +++++------ install-usercss/preinit.js | 3 + js/localization.js | 11 ++ js/toolbox.js | 2 +- 9 files changed, 248 insertions(+), 294 deletions(-) create mode 100644 edit/settings.html diff --git a/edit.html b/edit.html index 84768688..c74a4b66 100644 --- a/edit.html +++ b/edit.html @@ -230,44 +230,6 @@ - - diff --git a/edit/settings.html b/edit/settings.html new file mode 100644 index 00000000..054beece --- /dev/null +++ b/edit/settings.html @@ -0,0 +1,35 @@ +
+
+ +
+
+ + + +
+ + +
+
+ + + +
+
diff --git a/edit/settings.js b/edit/settings.js index 29d0e176..6e6d0b9a 100644 --- a/edit/settings.js +++ b/edit/settings.js @@ -7,9 +7,10 @@ /* exported StyleSettings */ 'use strict'; -function StyleSettings() { +async function StyleSettings() { const AUTOSAVE_DELAY = 500; // same as config-dialog.js const SS_ID = 'styleSettings'; + await t.fetchTemplate('/edit/settings.html', SS_ID); const {style} = editor; const ui = t.template[SS_ID].cloneNode(true); const elAuto = $('[id="config.autosave"]', ui); diff --git a/install-usercss.html b/install-usercss.html index 87f9a9cf..246720c7 100644 --- a/install-usercss.html +++ b/install-usercss.html @@ -11,13 +11,12 @@ - - - + + @@ -25,66 +24,59 @@ -
-