www/js/visuility.js
// Download the given text to a file directly from the browser (not supported in all)
Download the given text to a file directly from the browser (not supported in all)
Download the given text to a file directly from the browser ( not supported in all )
function download(filename, text) {
    var pom = document.createElement('a');
    pom.setAttribute('href', 'data:image/svg;charset=utf-8,' + encodeURIComponent(text));
    pom.setAttribute('download', filename);
    if (document.createEvent) {
        var event = document.createEvent('MouseEvents');
        event.initEvent('click', true, true);
        pom.dispatchEvent(event);
    } else {
        pom.click();
    }
}
function download ( filename , text ) { var pom = document . createElement ( 'a' ) ; pom . setAttribute ( 'href' , 'data:image/svg;charset=utf-8,' + encodeURIComponent ( text ) ) ; pom . setAttribute ( 'download' , filename ) ; if ( document . createEvent ) { var event = document . createEvent ( 'MouseEvents' ) ; event . initEvent ( 'click' , true , true ) ; pom . dispatchEvent ( event ) ; } else { pom . click ( ) ; } }
Download the given text to a file directly from the browser (not supported in all)
Download the given text to a file directly from the browser ( not supported in all )