Commit 97d330db authored by Thorsten Wißmann's avatar Thorsten Wißmann 🐧
Browse files

Disable download for besucher user

parent 3650dfef
......@@ -47,17 +47,19 @@
// window.open("data:text/plain;charset=UTF-8;base64,"+base64,"UTF-8 Text");
app.ports.showOverlayMessage.send(params);
});
app.ports.downloadPlainText.subscribe(
function(params) {
/* from http://stackoverflow.com/a/20194533/4400896 */
var a = window.document.createElement('a');
a.href = window.URL.createObjectURL(new Blob([params.content], {encoding:"UTF-8",type:"text/plain;charset=UTF-8"}));
a.download = params.filename;
/* a.download = 'test.txt'; */
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
});
if (!window.location.href.startsWith("file:///home/besucher/")) {
app.ports.downloadPlainText.subscribe(
function(params) {
/* from http://stackoverflow.com/a/20194533/4400896 */
var a = window.document.createElement('a');
a.href = window.URL.createObjectURL(new Blob([params.content], {encoding:"UTF-8",type:"text/plain;charset=UTF-8"}));
a.download = params.filename;
/* a.download = 'test.txt'; */
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
});
}
app.ports.svgScreenshot.subscribe(
function(name) {
var svg = document.getElementsByClassName('railPuzzle')[0];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment