+define(['libs/jquery-1.9.1.min'], function($) {\r
+ \r
+'use strict';\r
+\r
+var tagSelector = '[wlxml-tag]';\r
+\r
+var Node = function(domNode) {\r
+ \r
+ return {\r
+ id: domNode.attr('id'),\r
+ tag: domNode.attr('wlxml-tag'),\r
+ klass: domNode.attr('wlxml-class'),\r
+ parent: function() {\r
+ var node = domNode.parent(tagSelector);\r
+ if(node.length)\r
+ return new Node(node);\r
+ return null;\r
+ },\r
+ children: function() {\r
+ var list = [];\r
+ domNode.children(tagSelector).each(function() {\r
+ list.push(new Node($(this)));\r
+ });\r
+ return $(list);\r
+ },\r
+ parents: function() {\r
+ var list = [];\r
+ domNode.parents(tagSelector).each(function() {\r
+ list.push(new Node($(this)));\r
+ });\r
+ return $(list);\r
+ }\r
+ }\r
+\r
+};\r
+\r
+return { Node: Node}\r
+\r
+});
\ No newline at end of file