function exportPreview() {
    var checkboxes = getCheckedAnnotation();
    finalPreview('help', checkboxes, false); // load data from server

    setTimeout(function () {
        var a = document.createElement("a");
        document.body.appendChild(a);
        a.download = "export.html";
        var helpDiv = $('#help');
        helpDiv.css('display', 'block'); // must be visible because of mermaid
        if (loadMermaid) {
            mermaid.init(undefined, ".mermaid");
        }

        $.when($.post("/get-css"))
            .done(function (data) {
                var text = "data:text/html,";
                text += "<html><head><title>export</title><meta charset=\"UTF-8\"><style>";
                text += encodeURIComponent(data) + "</style></head><body>";
                text += encodeURIComponent(document.getElementById("help").innerHTML) + "</body></html>";
                console.log(text);
                a.href = text;
                a.click();
                helpDiv.css('display', 'none');
                document.body.removeChild(a);
                document.getElementById('help').innerHTML = ''; // clear help div
            });
    }, 1000);
}
/**
 * Show download dialog to download html of markdown code.
 */
Show download dialog to download html of markdown code.
Show download dialog to download html of markdown code .
function exportPreview() {
    var checkboxes = getCheckedAnnotation();
    finalPreview('help', checkboxes, false); 
    setTimeout(function () {
        var a = document.createElement("a");
        document.body.appendChild(a);
        a.download = "export.html";
        var helpDiv = $('#help');
        helpDiv.css('display', 'block'); 
        if (loadMermaid) {
            mermaid.init(undefined, ".mermaid");
        }
        $.when($.post("/get-css"))
            .done(function (data) {
                var text = "data:text/html,";
                text += "<html><head><title>export</title><meta charset=\"UTF-8\"><style>";
                text += encodeURIComponent(data) + "</style></head><body>";
                text += encodeURIComponent(document.getElementById("help").innerHTML) + "</body></html>";
                console.log(text);
                a.href = text;
                a.click();
                helpDiv.css('display', 'none');
                document.body.removeChild(a);
                document.getElementById('help').innerHTML = ''; 
            });
    }, 1000);
}
function exportPreview ( ) { var checkboxes = getCheckedAnnotation ( ) ; finalPreview ( 'help' , checkboxes , false ) ; setTimeout ( function ( ) { var a = document . createElement ( "a" ) ; document . body . appendChild ( a ) ; a . download = "export.html" ; var helpDiv = $ ( '#help' ) ; helpDiv . css ( 'display' , 'block' ) ; if ( loadMermaid ) { mermaid . init ( undefined , ".mermaid" ) ; } $ . when ( $ . post ( "/get-css" ) ) . done ( function ( data ) { var text = "data:text/html," ; text += "<html><head><title>export</title><meta charset=\"UTF-8\"><style>" ; text += encodeURIComponent ( data ) + "</style></head><body>" ; text += encodeURIComponent ( document . getElementById ( "help" ) . innerHTML ) + "</body></html>" ; console . log ( text ) ; a . href = text ; a . click ( ) ; helpDiv . css ( 'display' , 'none' ) ; document . body . removeChild ( a ) ; document . getElementById ( 'help' ) . innerHTML = '' ; } ) ; } , 1000 ) ; }
Show download dialog to download html of markdown code.
Show download dialog to download html of markdown code .
// load data from server // must be visible because of mermaid // clear help div