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 @@ ...@@ -47,17 +47,19 @@
// window.open("data:text/plain;charset=UTF-8;base64,"+base64,"UTF-8 Text"); // window.open("data:text/plain;charset=UTF-8;base64,"+base64,"UTF-8 Text");
app.ports.showOverlayMessage.send(params); app.ports.showOverlayMessage.send(params);
}); });
app.ports.downloadPlainText.subscribe( if (!window.location.href.startsWith("file:///home/besucher/")) {
function(params) { app.ports.downloadPlainText.subscribe(
/* from http://stackoverflow.com/a/20194533/4400896 */ function(params) {
var a = window.document.createElement('a'); /* from http://stackoverflow.com/a/20194533/4400896 */
a.href = window.URL.createObjectURL(new Blob([params.content], {encoding:"UTF-8",type:"text/plain;charset=UTF-8"})); var a = window.document.createElement('a');
a.download = params.filename; a.href = window.URL.createObjectURL(new Blob([params.content], {encoding:"UTF-8",type:"text/plain;charset=UTF-8"}));
/* a.download = 'test.txt'; */ a.download = params.filename;
document.body.appendChild(a); /* a.download = 'test.txt'; */
a.click(); document.body.appendChild(a);
document.body.removeChild(a); a.click();
}); document.body.removeChild(a);
});
}
app.ports.svgScreenshot.subscribe( app.ports.svgScreenshot.subscribe(
function(name) { function(name) {
var svg = document.getElementsByClassName('railPuzzle')[0]; 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