X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/288441d605a219ce06595329e62673db39bf557f..3b0a39df2e007f33b027b665f0f42604aecfc8b9:/src/smartxml/smartxml.js
diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js
index b90a042..53eefed 100644
--- a/src/smartxml/smartxml.js
+++ b/src/smartxml/smartxml.js
@@ -189,8 +189,12 @@ $.extend(ElementNode.prototype, DocumentNode.prototype, {
toXML: function() {
var wrapper = $('
');
- wrapper.append(this._$);
+ wrapper.append(this._getXMLDOMToDump());
return wrapper.html();
+ },
+
+ _getXMLDOMToDump: function() {
+ return this._$;
}
});
@@ -205,6 +209,10 @@ $.extend(TextNode.prototype, DocumentNode.prototype, {
return this.nativeNode.data;
},
+ setText: function(text) {
+ this.nativeNode.data = text;
+ },
+
appendText: function(text) {
this.nativeNode.data = this.nativeNode.data + text;
},
@@ -238,10 +246,12 @@ $.extend(Document.prototype, Backbone.Events, {
return new this.TextNodeFactory(nativeNode, this);
},
- loadXML: function(xml) {
+ loadXML: function(xml, options) {
+ options = options || {};
defineDocumentProperties(this, $(parseXML(xml)));
-
- this.trigger('contentSet');
+ if(!options.silent) {
+ this.trigger('contentSet');
+ }
},
toXML: function() {