Removing old visualEditor module leftovers
[fnpeditor.git] / modules / documentCanvas / documentCanvas.js
index 7e7fdf0..ea44955 100644 (file)
@@ -92,7 +92,7 @@ return function(sandbox) {
                 anchor.before(newNode)\r
             else\r
                 anchor.after(newNode);\r
                 anchor.before(newNode)\r
             else\r
                 anchor.after(newNode);\r
-            mediator.nodeCreated(newNode);\r
+            this.selectNode(newNode);\r
             //isDirty = true;\r
             sandbox.publish('contentChanged');\r
         },\r
             //isDirty = true;\r
             sandbox.publish('contentChanged');\r
         },\r
@@ -115,7 +115,8 @@ return function(sandbox) {
                 $(node).replaceWith(newNode);\r
                 newNode.before(prefix);\r
                 newNode.after(suffix);\r
                 $(node).replaceWith(newNode);\r
                 newNode.before(prefix);\r
                 newNode.after(suffix);\r
-                mediator.nodeCreated(newNode);\r
+                \r
+                this.selectNode(newNode);\r
                 //isDirty = true;\r
                 sandbox.publish('contentChanged');\r
             }\r
                 //isDirty = true;\r
                 sandbox.publish('contentChanged');\r
             }\r
@@ -141,7 +142,8 @@ return function(sandbox) {
                 node.replaceWith(newNode);\r
                 newNode.before(prefixNode);\r
                 newNode.after(suffixNode);\r
                 node.replaceWith(newNode);\r
                 newNode.before(prefixNode);\r
                 newNode.after(suffixNode);\r
-                mediator.nodeCreated(newNode);\r
+                \r
+                this.selectNode(newNode);\r
                 //isDirty = true;\r
                 sandbox.publish('contentChanged');\r
             }\r
                 //isDirty = true;\r
                 sandbox.publish('contentChanged');\r
             }\r
@@ -155,9 +157,9 @@ return function(sandbox) {
         _markSelected: function(node) {\r
             this.dimNode(node);\r
             \r
         _markSelected: function(node) {\r
             this.dimNode(node);\r
             \r
-            this.node.find('.rng-current').removeClass('rng-current');\r
+            this.node.find('.rng-module-documentCanvas-currentNode').removeClass('rng-module-documentCanvas-currentNode');\r
             \r
             \r
-            node.addClass('rng-current');\r
+            node.addClass('rng-module-documentCanvas-currentNode');\r
 \r
             this.currentNode = node;\r
             sandbox.publish('nodeSelected', node);\r
 \r
             this.currentNode = node;\r
             sandbox.publish('nodeSelected', node);\r
@@ -180,18 +182,18 @@ return function(sandbox) {
         },\r
         highlightNode: function(node) {\r
             if(!this.gridToggled) {\r
         },\r
         highlightNode: function(node) {\r
             if(!this.gridToggled) {\r
-                node.addClass('rng-hover');\r
+                node.addClass('rng-common-hoveredNode');\r
                 var label = node.attr('wlxml-tag');\r
                 if(node.attr('wlxml-class'))\r
                     label += ' / ' + node.attr('wlxml-class');\r
                 var label = node.attr('wlxml-tag');\r
                 if(node.attr('wlxml-class'))\r
                     label += ' / ' + node.attr('wlxml-class');\r
-                var tag = $('<div>').addClass('rng-visualEditor-nodeHoverTag').text(label);\r
+                var tag = $('<div>').addClass('rng-module-documentCanvas-hoveredNodeTag').text(label);\r
                 node.append(tag);\r
             }\r
         },\r
         dimNode: function(node) {\r
             if(!this.gridToggled) {\r
                 node.append(tag);\r
             }\r
         },\r
         dimNode: function(node) {\r
             if(!this.gridToggled) {\r
-                node.removeClass('rng-hover');\r
-                node.find('.rng-visualEditor-nodeHoverTag').remove();\r
+                node.removeClass('rng-common-hoveredNode');\r
+                node.find('.rng-module-documentCanvas-hoveredNodeTag').remove();\r
             }\r
         },\r
         highlightNodeById: function(id) {\r
             }\r
         },\r
         highlightNodeById: function(id) {\r
@@ -217,7 +219,7 @@ return function(sandbox) {
             this.selectNode(node);\r
         },\r
         toggleGrid: function(toggle) {\r
             this.selectNode(node);\r
         },\r
         toggleGrid: function(toggle) {\r
-            this.node.find('[wlxml-tag]').toggleClass('rng-hover', toggle);\r
+            this.node.find('[wlxml-tag]').toggleClass('rng-common-hoveredNode', toggle);\r
             this.gridToggled = toggle;\r
         }\r
     };\r
             this.gridToggled = toggle;\r
         }\r
     };\r
@@ -246,8 +248,16 @@ return function(sandbox) {
         },\r
         selectNode: function(id) {\r
             view.selectNodeById(id);\r
         },\r
         selectNode: function(id) {\r
             view.selectNodeById(id);\r
+        },\r
+        toggleGrid: function(toggle) {\r
+            view.toggleGrid(toggle);\r
+        },\r
+        insertNewNode: function(wlxmlTag, wlxmlClass) {\r
+            view.insertNewNode(wlxmlTag, wlxmlClass);\r
+        },\r
+        wrapSelectionWithNewNode: function(wlxmlTag, wlxmlClass) {\r
+            view.wrapSelectionWithNewNode(wlxmlTag, wlxmlClass);\r
         }\r
         }\r
-        \r
     }\r
     \r
 };\r
     }\r
     \r
 };\r