Linting, cleanup, removing unused code
[fnpeditor.git] / src / smartxml / core.js
index bab584e..40fd9b8 100644 (file)
@@ -1,8 +1,10 @@
-define([
-
-], function() {
+define(function(require) {
     
 'use strict';
     
 'use strict';
+/* globals Node */
+
+var _ = require('libs/underscore'),
+    TEXT_NODE = Node.TEXT_NODE;
 
 
 var INSERTION = function(implementation) {
 
 
 var INSERTION = function(implementation) {
@@ -81,7 +83,7 @@ var elementNodeTransformations = {
             this.prev().appendText(next.getText());
             next.detach();
         }
             this.prev().appendText(next.getText());
             next.detach();
         }
-        return DocumentNode.prototype.detach.call(this);
+        return this.__super__.detach();
     },
 
     setTag: function(tagName) {
     },
 
     setTag: function(tagName) {
@@ -185,7 +187,6 @@ var elementNodeTransformations = {
 
 var textNodeTransformations = {
     setText: function(text) {
 
 var textNodeTransformations = {
     setText: function(text) {
-        //console.log('smartxml: ' + text);
         this.nativeNode.data = text;
         this.triggerTextChangeEvent();
     },
         this.nativeNode.data = text;
         this.triggerTextChangeEvent();
     },
@@ -210,7 +211,7 @@ var textNodeTransformations = {
                 _with: {tagName: desc.tagName, attrs: desc.attrs}
             });
         } else {
                 _with: {tagName: desc.tagName, attrs: desc.attrs}
             });
         } else {
-            return DocumentNode.prototype.wrapWith.call(this, desc);
+            return this.__super__.wrapWith.call(this, desc);
         }
     },
 
         }
     },
 
@@ -342,11 +343,11 @@ var documentTransformations = {
     replaceRoot: function(node) {
         var insertion = this.getNodeInsertion(node);
         this.root.detach();
     replaceRoot: function(node) {
         var insertion = this.getNodeInsertion(node);
         this.root.detach();
-        defineDocumentProperties(this, insertion.ofNode._$);
+        this._defineDocumentProperties(insertion.ofNode._$);
         insertion.ofNode.triggerChangeEvent('nodeAdded');
         return insertion.ofNode;
     }
         insertion.ofNode.triggerChangeEvent('nodeAdded');
         return insertion.ofNode;
     }
-}
+};
 
 return {
     document: {
 
 return {
     document: {