scripts/utils.js
// Saves the current graph under the given filename.
Saves the current graph under the given filename.
Saves the current graph under the given filename .
function saveProject(editor, name) {
    if (name != null) {
        if (editor.graph.isEditing()) {
            editor.graph.stopEditing();
        }
        var enc = new mxCodec(mxUtils.createXmlDocument());
        var node = enc.encode(editor.graph.getModel());
        var xml = mxUtils.getXml(node);
        try {
            localStorage.setItem(name, xml);
            editor.setStatus(mxUtils.htmlEntities(mxResources.get('saved')) + ' ' + new Date());
            editor.setModified(false);
        } catch (e) {
            console.log(e);
        }
    }
}
function saveProject ( editor , name ) { if ( name != null ) { if ( editor . graph . isEditing ( ) ) { editor . graph . stopEditing ( ) ; } var enc = new mxCodec ( mxUtils . createXmlDocument ( ) ) ; var node = enc . encode ( editor . graph . getModel ( ) ) ; var xml = mxUtils . getXml ( node ) ; try { localStorage . setItem ( name , xml ) ; editor . setStatus ( mxUtils . htmlEntities ( mxResources . get ( 'saved' ) ) + ' ' + new Date ( ) ) ; editor . setModified ( false ) ; } catch ( e ) { console . log ( e ) ; } } }
Saves the current graph under the given filename.
Saves the current graph under the given filename .
//editor.setStatus(mxUtils.htmlEntities(mxResources.get('errorSavingFile')));