diff --git a/.gitignore b/.gitignore index 53eaa21..678dcbf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/target -**/*.rs.bk +*.zip +*.crx diff --git a/Chrome/background.js b/Chrome/background.js index ebe3de4..c822eba 100644 --- a/Chrome/background.js +++ b/Chrome/background.js @@ -1,4 +1,4 @@ -import { updateBrowserAction, openInMPV } from "./common.js"; +import { getOptions, openInMPV, updateBrowserAction } from "./common.js"; updateBrowserAction(); @@ -8,7 +8,13 @@ updateBrowserAction(); id: `open${item}inmpv`, contexts: [item], onclick: (info, tab) => { - openInMPV(tab.id, info[linkType]); + getOptions((options) => { + console.log("Got options: ", options); + openInMPV(tab.id, info[linkType], { + mode: options.iconActionOption, + ...options, + }); + }); }, }); }); diff --git a/Chrome/options.css b/Chrome/options.css index c542d42..e9ed6f2 100644 --- a/Chrome/options.css +++ b/Chrome/options.css @@ -18,12 +18,16 @@ body { margin: 0; } +.item:not(:last-child) { + margin-bottom: 0.5rem; +} + .option { padding: 1rem; + border-top: 1px solid #e4e4e4; } .option:not(:last-child) { - border-top: 1px solid #e4e4e4; border-bottom: 1px solid #e4e4e4; } @@ -32,8 +36,28 @@ body { } .option .option-details { + padding-left: 0.5rem; +} + +.option .option-details:not(:first-child) { margin-top: 0.5rem; - padding-left: 1rem; +} + +.option .option-details:not(:last-child) { + margin-bottom: 1rem; +} + +.option-details > p { + color: rgb(70, 70, 70); + margin-block: 0; +} + +input[type="text"] { + font-family: monospace; + border: 1px solid rgb(169, 169, 169); + margin: 0 0 0.5rem 0; + padding: 0.2rem; + border-radius: 6px; } select { @@ -41,12 +65,4 @@ select { padding: 0.2rem; border-radius: 6px; background-color: #fff; -} - -input[type="text"] { - font-family: monospace; - border: 1px solid rgb(169, 169, 169); - margin: 0.1rem; - padding: 0.2rem; - border-radius: 6px; } \ No newline at end of file diff --git a/Chrome/options.html b/Chrome/options.html index 6d16853..260b94b 100644 --- a/Chrome/options.html +++ b/Chrome/options.html @@ -10,7 +10,7 @@
Note: do include hyphens (e.g.'--fs')
+Note: do include hyphens (e.g.'--fs')
Applies to "Open current page in mpv" and the right click context menu