-var extension = {document: {transformations: {}}, wlxmlClass: {list: {methods: {}}}};
+var _ = require('libs/underscore'),
+ extension = {document: {transformations: {}}, wlxmlClass: {list: {methods: {}}}};
extension.documentMethods = {
areItemsOfSameList: function(params) {
return params.node1.parent().sameNode(params.node2.parent()) && params.node2.parent().is('list');
}
extension.documentMethods = {
areItemsOfSameList: function(params) {
return params.node1.parent().sameNode(params.node2.parent()) && params.node2.parent().is('list');
}
var parent = params.node1.parent(),
parentContents = parent.contents(),
nodeIndexes = [params.node1.getIndex(), params.node2.getIndex()].sort(),
var parent = params.node1.parent(),
parentContents = parent.contents(),
nodeIndexes = [params.node1.getIndex(), params.node2.getIndex()].sort(),
for(i = nodeIndexes[0]; i <= nodeIndexes[1]; i++) {
node = parentContents[i];
if(node.nodeType === Node.TEXT_NODE) {
for(i = nodeIndexes[0]; i <= nodeIndexes[1]; i++) {
node = parentContents[i];
if(node.nodeType === Node.TEXT_NODE) {
var toInsert;
if(parent.is('list') && parent.object.itemIndex(nodesToWrap[0]) > 0) { // object api
// var prevItem = parent.object.getItem(parent.object.itemIndex(nodesToWrap[0])-1); // object api
var toInsert;
if(parent.is('list') && parent.object.itemIndex(nodesToWrap[0]) > 0) { // object api
// var prevItem = parent.object.getItem(parent.object.itemIndex(nodesToWrap[0])-1); // object api
- items = list.contents(), // lub list.object.items()
- listIsNested = list.parent().is('item'),
- i;
+ items = list.contents(),
+ listIsNested = list.parent().is('item');
+
if(succeedingItems.length === 0) {
var reference_orig = reference;
extractedItems.forEach(function(item) {
if(succeedingItems.length === 0) {
var reference_orig = reference;
extractedItems.forEach(function(item) {
reference = item;
});
var secondList = params.item1.document.createDocumentNode({tagName: 'div', attrs: {'class':'list'}}),
reference = item;
});
var secondList = params.item1.document.createDocumentNode({tagName: 'div', attrs: {'class':'list'}}),
- var parent = this.args.nodel1.parent();
- return parent.is('list') && parent.sameNode(this.args.node2.parent());
+ var parent = this.args[0].nodel1.parent();
+ return parent.is('list') && parent.sameNode(this.args[0].node2.parent());