- currentDate = new Date();
- dt = pad(currentDate.getDate()) + '-' +
- pad((currentDate.getMonth() + 1)) + '-' +
- pad(currentDate.getFullYear()) + ' ' +
- pad(currentDate.getHours()) + ':' +
- pad(currentDate.getMinutes()) + ':' +
- pad(currentDate.getSeconds());
-
- metadata = node.getMetadata();
- metadata.add({key: 'creator', value: creator});
- metadata.add({key: 'date', value: dt});
+ metadata = node.getMetadata();
+ metadata.add({key: 'creator', value: creator});
+ metadata.add({key: 'date', value: datetime.currentStrfmt()});
+ });
+ execCallback(node);
+ } else if(params.wlxmlClass === 'link') {
+ dialog = Dialog.create({
+ title: gettext('Create link'),
+ executeButtonText: gettext('Apply'),
+ cancelButtonText: gettext('Cancel'),
+ fields: [
+ {label: gettext('Link'), name: 'href', type: 'input'}
+ ]
+ });
+ dialog.on('execute', function(event) {
+ doc.transaction(function() {
+ node = insertion();
+ node.setAttr('href', event.formData.href);
+ event.success();
+ });
+ execCallback(node);
+ });
+ dialog.show();
+ } else {
+ doc.transaction(function() {
+ node = insertion();
+ });
+ execCallback(node);