X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/71b7ba4d1d17adc39165914016fa892671cc4316..46359b91eb01a6d5c43cedf477751e1ca6fea3e4:/src/editor/modules/data/data.js diff --git a/src/editor/modules/data/data.js b/src/editor/modules/data/data.js index 896fc56..c9ecf7d 100644 --- a/src/editor/modules/data/data.js +++ b/src/editor/modules/data/data.js @@ -8,26 +8,12 @@ define([ 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; var wlxmlDocument = wlxml.WLXMLDocumentFromXML(sandbox.getBootstrappedData().document); - - if(doc === '') { - doc = '\n\ - \n\ - \n\ -
\n\ - '; - } - + function readCookie(name) { var nameEQ = escape(name) + "="; @@ -65,14 +51,11 @@ return function(sandbox) { sandbox.publish('ready'); }, getDocument: function() { - return doc; - }, - getDocument2: function() { return wlxmlDocument; }, commitDocument: function(newDocument, reason) { - doc = newDocument; - sandbox.publish('documentChanged', doc, reason); + // doc = newDocument; + // sandbox.publish('documentChanged', doc, reason); }, saveDocument: function() { @@ -83,7 +66,7 @@ return function(sandbox) { $.ajax({ method: 'post', url: '/' + gettext('editor') + '/' + document_id, - data: JSON.stringify({document:doc, description: event.data.description}), + data: JSON.stringify({document:wlxmlDocument.toXML(), description: event.data.description}), success: function() { event.success(); sandbox.publish('savingEnded', 'success'); @@ -121,7 +104,6 @@ return function(sandbox) { url: '/' + gettext('editor') + '/' + document_id + '/revert', data: JSON.stringify(options), success: function(data) { - doc = data.document; document_version = data.version; reloadHistory(); sandbox.publish('documentReverted', data);