'wlxml/wlxml',
'wlxml/extensions/list/list',
'fnpjs/logging/logging',
- 'fnpjs/datetime'
-], function($, Dialog, wlxml, listExtension, logging, datetime) {
+ 'fnpjs/datetime',
+ './document'
+], function($, Dialog, wlxml, listExtension, logging, datetime, Document) {
'use strict';
/* global gettext, alert, window */
var loadDocument = function(text, isDraft, draftTimestamp) {
logger.debug('loading document');
try {
- wlxmlDocument = wlxml.WLXMLDocumentFromXML(text);
+ wlxmlDocument = wlxml.WLXMLDocumentFromXML(text, {}, Document);
} catch(e) {
logger.exception(e);
alert(gettext('This document contains errors and can\'t be loaded. :(')); // TODO
- wlxmlDocument = wlxml.WLXMLDocumentFromXML(stubDocument);
+ wlxmlDocument = wlxml.WLXMLDocumentFromXML(stubDocument, {}, Document);
}
wlxmlDocument.registerExtension(listExtension);
dialog = Dialog.create({
fields: documentSaveForm.fields,
title: gettext('Save Document'),
- executeButtonText: gettext('Save')
+ executeButtonText: gettext('Save'),
+ cancelButtonText: gettext('Cancel')
});
dialog.on('execute', function(event) {
dialog = Dialog.create({
fields: documentRestoreForm.fields,
title: gettext('Restore Version'),
- executeButtonText: gettext('Restore')
+ executeButtonText: gettext('Restore'),
+ cancelButtonText: gettext('Cancel')
});
dialog.on('execute', function(event) {