aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-02-10 11:12:36 +0200
committerGitHub <noreply@github.com>2020-02-10 11:12:36 +0200
commitcbfae2b9d7a5c8824edd7d2d7f80fdacd15cd333 (patch)
tree26761e13bc7bcb9c3170c477ca0fe8efe43de813 /ext/mixed
parentd5708de4eed15567e14e0c1fd4998561eee1680e (diff)
parent14b9f4a82781b9a5044e22437f6b0b02af67a120 (diff)
Merge pull request #333 from siikamiika/native-popup-windows
Native popup windows
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/css/display.css4
-rw-r--r--ext/mixed/js/core.js8
2 files changed, 12 insertions, 0 deletions
diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css
index 3a66cec3..62e62243 100644
--- a/ext/mixed/css/display.css
+++ b/ext/mixed/css/display.css
@@ -136,6 +136,10 @@ html:root[data-yomichan-page=float] .navigation-header:not([hidden])~.navigation
margin-right: 0.2em;
}
+html:root[data-yomichan-page=search][data-search-mode=popup] .search-input {
+ display: none;
+}
+
/*
* Entries
diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js
index 0142d594..ca9e98e5 100644
--- a/ext/mixed/js/core.js
+++ b/ext/mixed/js/core.js
@@ -128,6 +128,14 @@ function stringReverse(string) {
return string.split('').reverse().join('').replace(/([\uDC00-\uDFFF])([\uD800-\uDBFF])/g, '$2$1');
}
+function parseUrl(url) {
+ const parsedUrl = new URL(url);
+ const baseUrl = `${parsedUrl.origin}${parsedUrl.pathname}`;
+ const queryParams = Array.from(parsedUrl.searchParams.entries())
+ .reduce((a, [k, v]) => Object.assign({}, a, {[k]: v}), {});
+ return {baseUrl, queryParams};
+}
+
/*
* Async utilities