fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
smartxml: setting text on text node
[fnpeditor.git]
/
src
/
smartxml
/
smartxml.js
diff --git
a/src/smartxml/smartxml.js
b/src/smartxml/smartxml.js
index
b90a042
..
53eefed
100644
(file)
--- a/
src/smartxml/smartxml.js
+++ b/
src/smartxml/smartxml.js
@@
-189,8
+189,12
@@
$.extend(ElementNode.prototype, DocumentNode.prototype, {
toXML: function() {
var wrapper = $('<div>');
toXML: function() {
var wrapper = $('<div>');
- wrapper.append(this._
$
);
+ wrapper.append(this._
getXMLDOMToDump()
);
return wrapper.html();
return wrapper.html();
+ },
+
+ _getXMLDOMToDump: function() {
+ return this._$;
}
});
}
});
@@
-205,6
+209,10
@@
$.extend(TextNode.prototype, DocumentNode.prototype, {
return this.nativeNode.data;
},
return this.nativeNode.data;
},
+ setText: function(text) {
+ this.nativeNode.data = text;
+ },
+
appendText: function(text) {
this.nativeNode.data = 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);
},
return new this.TextNodeFactory(nativeNode, this);
},
- loadXML: function(xml) {
+ loadXML: function(xml, options) {
+ options = options || {};
defineDocumentProperties(this, $(parseXML(xml)));
defineDocumentProperties(this, $(parseXML(xml)));
-
- this.trigger('contentSet');
+ if(!options.silent) {
+ this.trigger('contentSet');
+ }
},
toXML: function() {
},
toXML: function() {