wlxml: lists - list.extractAllItems
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 1 Apr 2014 21:16:28 +0000 (23:16 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 1 Apr 2014 21:16:28 +0000 (23:16 +0200)
src/wlxml/extensions/list/list.js

index 1404259..2487107 100644 (file)
@@ -22,6 +22,13 @@ extension.wlxmlClass.list.methods = {
     }
 };
 
+extension.wlxmlClass.list.transformations = {
+    extractAllItems: function() {
+        var contents = this.contents();
+        return this.document.extractItems({item1: contents[0], item2: _.last(contents)});
+    }
+};
+
 extension.document.methods = {
     areItemsOfSameList: function(params) {
         return params.node1.parent().sameNode(params.node2.parent()) && params.node2.parent().is('list');