-define([
-
-], function() {
+define(function(require) {
'use strict';
+/* globals Node */
+
+var _ = require('libs/underscore'),
+ TEXT_NODE = Node.TEXT_NODE;
var INSERTION = function(implementation) {
this.prev().appendText(next.getText());
next.detach();
}
- return DocumentNode.prototype.detach.call(this);
+ return this.__super__.detach();
},
setTag: function(tagName) {
node.setData(this.getData());
if(this.sameNode(this.document.root)) {
- defineDocumentProperties(this.document, node._$);
+ this.document._defineDocumentProperties(node._$);
}
this._$.replaceWith(node._$);
this._setNativeNode(node._$[0]);
var textNodeTransformations = {
setText: function(text) {
- //console.log('smartxml: ' + text);
this.nativeNode.data = text;
this.triggerTextChangeEvent();
},
_with: {tagName: desc.tagName, attrs: desc.attrs}
});
} else {
- return DocumentNode.prototype.wrapWith.call(this, desc);
+ return this.__super__.wrapWith.call(this, desc);
}
},
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;
}
-}
+};
return {
document: {