mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-10 10:18:23 +00:00
cleanup
This commit is contained in:
parent
7899b4aea4
commit
5b7f99c9e0
@ -143,15 +143,6 @@ export default {
|
|||||||
});
|
});
|
||||||
this.download(data, this.playlist.name + ".txt");
|
this.download(data, this.playlist.name + ".txt");
|
||||||
},
|
},
|
||||||
download(text, filename) {
|
|
||||||
var element = document.createElement("a");
|
|
||||||
element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(text));
|
|
||||||
element.setAttribute("download", filename);
|
|
||||||
element.style.display = "none";
|
|
||||||
document.body.appendChild(element);
|
|
||||||
element.click();
|
|
||||||
document.body.removeChild(element);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -97,14 +97,7 @@ export default {
|
|||||||
subscriptions: subscriptions,
|
subscriptions: subscriptions,
|
||||||
});
|
});
|
||||||
|
|
||||||
var file = new Blob([json], { type: "application/json" });
|
this.download(json, "subscriptions.json", "application/json");
|
||||||
|
|
||||||
const elem = document.createElement("a");
|
|
||||||
|
|
||||||
elem.href = URL.createObjectURL(file);
|
|
||||||
elem.download = "subscriptions.json";
|
|
||||||
elem.click();
|
|
||||||
elem.remove();
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
18
src/main.js
18
src/main.js
@ -220,14 +220,16 @@ const mixin = {
|
|||||||
const localSubscriptions = this.getLocalSubscriptions();
|
const localSubscriptions = this.getLocalSubscriptions();
|
||||||
return localSubscriptions != null ? localSubscriptions.join(",") : "";
|
return localSubscriptions != null ? localSubscriptions.join(",") : "";
|
||||||
},
|
},
|
||||||
download(text, filename) {
|
/* generate a temporary file and ask the user to download it */
|
||||||
var element = document.createElement("a");
|
download(text, filename, type) {
|
||||||
element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(text));
|
var file = new Blob([text], { type: type });
|
||||||
element.setAttribute("download", filename);
|
|
||||||
element.style.display = "none";
|
const elem = document.createElement("a");
|
||||||
document.body.appendChild(element);
|
|
||||||
element.click();
|
elem.href = URL.createObjectURL(file);
|
||||||
document.body.removeChild(element);
|
elem.download = filename;
|
||||||
|
elem.click();
|
||||||
|
elem.remove();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
Loading…
Reference in New Issue
Block a user