2 #installSearchPluginContainer {
6 #installSearchPluginContainer button {
16 <div id=
"installSearchPluginContainer">
17 <label for=
"newPluginPath">QBT_TR(Plugin path:)QBT_TR[CONTEXT=PluginSourceDlg]
</label>
20 <input type=
"text" id=
"newPluginPath" placeholder=
"QBT_TR(URL or local directory)QBT_TR[CONTEXT=PluginSourceDlg]" autocorrect=
"off" autocapitalize=
"none">
21 <div style=
"margin-top: 10px; text-align: center;">
22 <button type=
"button" id=
"newPluginCancel" onclick=
"window.qBittorrent.Client.closeWindow(document.getElementById('installSearchPlugin'));">QBT_TR(Cancel)QBT_TR[CONTEXT=PluginSourceDlg]
</button>
23 <button type=
"button" id=
"newPluginOk" onclick=
"qBittorrent.InstallSearchPlugin.newPluginOk();">QBT_TR(Ok)QBT_TR[CONTEXT=PluginSourceDlg]
</button>
31 window
.qBittorrent
??= {};
32 window
.qBittorrent
.InstallSearchPlugin
??= (() => {
33 const exports
= () => {
36 newPluginOk
: newPluginOk
41 const windowEl
= document
.getElementById("installSearchPlugin");
43 windowEl
.addEventListener("keydown", (event
) => {
46 // accept enter key as a click
47 event
.preventDefault();
48 event
.stopPropagation();
50 switch (event
.target
.id
) {
51 case "newPluginCancel":
52 window
.qBittorrent
.Client
.closeWindow(windowEl
);
64 $("newPluginPath").select();
67 const newPluginOk
= () => {
68 const path
= $("newPluginPath").value
.trim();
70 fetch("api/v2/search/installPlugin", {
72 body
: new URLSearchParams({
80 window
.qBittorrent
.Client
.closeWindow(document
.getElementById("installSearchPlugin"));
87 Object
.freeze(window
.qBittorrent
.InstallSearchPlugin
);
89 window
.qBittorrent
.InstallSearchPlugin
.setup();