+Manager.prototype.command = function(command, meta) {\r
+ var pos = getCursorPosition();\r
+ \r
+ if(command === 'createList') {\r
+ var node = new wlxmlNode.Node(pos.parentNode);\r
+ if(window.getSelection().getRangeAt().collapsed && this.canvas.insideList({pointer: node})) {\r
+ this.canvas.removeList({pointer: node});\r
+ this.selectNode(node, {movecaret: 'end'});\r
+ this.sandbox.publish('contentChanged');\r
+ }\r
+ else {\r
+ if(!this.canvas.insideList({pointer: node})) {\r
+ this.canvas.createList({start: new wlxmlNode.Node(pos.parentNode), end: new wlxmlNode.Node(pos.focusNode)});\r
+ this.selectNode(new wlxmlNode.Node(pos.parentNode), {movecaret: 'end'});\r
+ this.sandbox.publish('contentChanged');\r
+ }\r
+ }\r
+ }\r
+\r
+}\r