mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
fix copy
This commit is contained in:
+15
-14
@@ -507,16 +507,13 @@
|
||||
let defaultResolutions = [];
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
fetch("/static/config.json")
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
populateSelect("indexers", data.indexers);
|
||||
populateSelect("languages", data.languages);
|
||||
populateSelect("resolutions", data.resolutions);
|
||||
|
||||
defaultLanguages = data.languages;
|
||||
defaultResolutions = data.resolutions;
|
||||
});
|
||||
const webConfig = {{webConfig|tojson}};
|
||||
populateSelect("indexers", webConfig.indexers);
|
||||
populateSelect("languages", webConfig.languages);
|
||||
populateSelect("resolutions", webConfig.resolutions);
|
||||
|
||||
defaultLanguages = webConfig.languages;
|
||||
defaultResolutions = webConfig.resolutions;
|
||||
});
|
||||
|
||||
function populateSelect(selectId, options) {
|
||||
@@ -551,10 +548,14 @@
|
||||
resolutions: selectedResolutions,
|
||||
languages: selectedLanguages
|
||||
};
|
||||
|
||||
navigator.clipboard.writeText(`${window.location.origin}/${btoa(JSON.stringify(settings))}/manifest.json`).then(() => {
|
||||
alert.toast();
|
||||
});
|
||||
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.value = `${window.location.origin}/${btoa(JSON.stringify(settings))}/manifest.json`;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
document.body.removeChild(textarea);
|
||||
alert.toast();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user