X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/1aba836313d1513bbe0ca947e01176806c900233..3a363b061bed9e1ca68989889bae9c701ddce772:/modules/data.js diff --git a/modules/data.js b/modules/data.js index e4b564e..5f3fd39 100644 --- a/modules/data.js +++ b/modules/data.js @@ -3,6 +3,23 @@ rng.modules.data = function(sandbox) { var doc = sandbox.getBootstrappedData().document; var document_id = sandbox.getBootstrappedData().document_id; + + if(doc === '') { + doc = '<document>\n\ + <section\n\ + xmlns="http://nowoczesnapolska.org.pl/sst#"\n\ + xmlns:xlink="http://www.w3.org/1999/xlink"\n\ + xmlns:dc="http://purl.org/dc/elements/1.1/"\n\ + xmlns:dcterms="http://purl.org/dc/terms/"\n\ + >\n\ + <metadata>\n\ + </metadata>\n\ + <div class="p"></div>\n\ + </section>\n\ +</document>'; + } + + function readCookie(name) { var nameEQ = escape(name) + "="; var ca = document.cookie.split(';'); @@ -37,7 +54,7 @@ rng.modules.data = function(sandbox) { saveDocument: function() { $.ajax({ method: 'post', - url: '/editor/' + document_id, + url: '/' + gettext('editor') + '/' + document_id, data: JSON.stringify({document:doc}) }); }