X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/efe36f4f1b5df351eeb4d40a54c3900cf9a7079b..fea8fda1a2f6a07eac7bb37c3c40a053d398ef92:/src/editor/modules/data/data.js diff --git a/src/editor/modules/data/data.js b/src/editor/modules/data/data.js index 9b2f163..5e45b26 100644 --- a/src/editor/modules/data/data.js +++ b/src/editor/modules/data/data.js @@ -1,28 +1,19 @@ -define(['./saveDialog'], function(saveDialog) { +define([ + './saveDialog', + 'wlxml/wlxml' + +], function(saveDialog, wlxml) { 'use strict'; return function(sandbox) { - var doc = sandbox.getBootstrappedData().document; var document_id = sandbox.getBootstrappedData().document_id; var document_version = sandbox.getBootstrappedData().version; var history = sandbox.getBootstrappedData().history; - - if(doc === '') { - doc = '\n\ - \n\ - \n\ -
\n\ - '; - } - + var wlxmlDocument = wlxml.WLXMLDocumentFromXML(sandbox.getBootstrappedData().document); + function readCookie(name) { var nameEQ = escape(name) + "="; @@ -60,11 +51,11 @@ return function(sandbox) { sandbox.publish('ready'); }, getDocument: function() { - return doc; + return wlxmlDocument; }, commitDocument: function(newDocument, reason) { - doc = newDocument; - sandbox.publish('documentChanged', doc, reason); + // doc = newDocument; + // sandbox.publish('documentChanged', doc, reason); }, saveDocument: function() {