-define(function(require) {
+define(function() {
'use strict';
+var extension = {document: {transformations: {}}, wlxmlClass: {list: {methods: {}}}};
-var wlxml = require('wlxml/wlxml'),
- extension = {documentTransformations: [], classMethods: {}};
-
-extension.classMethods['list'] = {
+extension.wlxmlClass.list.methods = {
itemIndex: function(listItem) {
var toret = -1;
this.contents('.item').some(function(item, index) {
}
}
-extension.documentTransformations.push({
- name: 'createList',
+
+
+extension.document.transformations.createList = {
impl: function(params) {
var parent = params.node1.parent(),
parentContents = parent.contents(),
isAllowed: function() {
return this.args.node1.parent().sameNode(this.args.node2.parent());
}
-});
+};
-extension.documentTransformations.push({
- name: 'extractItems',
+extension.document.transformations.extractItems = {
impl: function(params) {
params = _.extend({}, {merge: true}, params);
var list = params.item1.parent(),
var parent = this.args.nodel1.parent();
return parent.is('list') && parent.sameNode(this.args.node2.parent());
}
-});
+};
+
+return extension;
-wlxml.registerExtension(extension);
});
\ No newline at end of file