Dialog = require('views/dialog/dialog'),
canvasElements = require('plugins/core/canvasElements'),
metadataEditor = require('plugins/core/metadataEditor/metadataEditor'),
- edumed = require('plugins/core/edumed/edumed');
+ edumed = require('plugins/core/edumed/edumed'),
+ attachments = require('views/attachments/attachments');
+
+
var exerciseFix = function(newNodes) {
}
});
return toret;
+ },
+ insertNewNode: function () {
+ var node = this;
+ var newElement = this.document.createDocumentNode({tagName: 'div', attrs: {class: 'p'}});
+ node.after(newElement);
+ newElement.append({text: ''});
+ return newElement;
}
};
};
+
var createLinkFromSelection = function(callback, params) {
var doc = params.fragment.document,
dialog = Dialog.create({
{label: gettext('Link'), name: 'href', type: 'input',
prePasteHandler: function(text) {
return params.fragment.document.getLinkForUrl(text);
- }.bind(this)
+ }.bind(this),
+ description: '<a href="#-" class="attachment-library">' + gettext('attachment library') + '</a>'
}
]
}),
});
});
dialog.show();
+ $(".attachment-library", dialog.$el).on('click', function() {
+ attachments.select(function(v) {$("input", dialog.$el).val(v);});
+ });
};
var editLink = function(callback, params) {
}
};
+
var metadataParams = {};
plugin.actions = [