X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/0990bc1dc7fad5165148a8993901138de9e22d0e..811645a7d810c562f38edc705affff6822ebbdc9:/src/editor/modules/data/data.js diff --git a/src/editor/modules/data/data.js b/src/editor/modules/data/data.js index a8144cb..006bf0f 100644 --- a/src/editor/modules/data/data.js +++ b/src/editor/modules/data/data.js @@ -1,9 +1,10 @@ define([ 'libs/jquery', './saveDialog', - 'wlxml/wlxml' + 'wlxml/wlxml', + 'wlxml/extensions/list/list' -], function($, saveDialog, wlxml) { +], function($, saveDialog, wlxml, listExtension) { 'use strict'; @@ -15,10 +16,17 @@ return function(sandbox) { var history = sandbox.getBootstrappedData().history; var wlxmlDocument = wlxml.WLXMLDocumentFromXML(sandbox.getBootstrappedData().document); + + wlxmlDocument.registerExtension(listExtension); + sandbox.getPlugins().forEach(function(plugin) { + if(plugin.documentExtension) { + wlxmlDocument.registerExtension(plugin.documentExtension); + } + }); function readCookie(name) { - /* global escape, unescape */ + /* global escape, unescape, document */ var nameEQ = escape(name) + '='; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { @@ -106,8 +114,9 @@ return function(sandbox) { url: '/' + gettext('editor') + '/' + document_id + '/revert', data: JSON.stringify(options), success: function(data) { - document_version = data.version; + document_version = data.current_version; reloadHistory(); + wlxmlDocument.loadXML(data.document); sandbox.publish('documentReverted', data); }, });