fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wlxml node: setClass
[fnpeditor.git]
/
src
/
wlxml
/
wlxml.js
diff --git
a/src/wlxml/wlxml.js
b/src/wlxml/wlxml.js
index
1995a8b
..
7dfbd99
100644
(file)
--- a/
src/wlxml/wlxml.js
+++ b/
src/wlxml/wlxml.js
@@
-12,8
+12,8
@@
var isMetaAttribute = function(attrName) {
//
//
-var WLXMLElementNode = function(nativeNode) {
- smartxml.ElementNode.call(this, nativeNode);
+var WLXMLElementNode = function(nativeNode
, document
) {
+ smartxml.ElementNode.call(this, nativeNode
, document
);
};
WLXMLElementNode.prototype = Object.create(smartxml.ElementNode.prototype);
};
WLXMLElementNode.prototype = Object.create(smartxml.ElementNode.prototype);
@@
-21,19
+21,24
@@
$.extend(WLXMLElementNode.prototype, smartxml.ElementNode.prototype, {
getClass: function() {
return this.getAttr('class');
},
getClass: function() {
return this.getAttr('class');
},
+ setClass: function(klass) {
+ return this.setAttr('class', klass);
+ },
getMetaAttributes: function() {
getMetaAttributes: function() {
- var toret =
{}
;
+ var toret =
[]
;
this.getAttrs().forEach(function(attr) {
this.getAttrs().forEach(function(attr) {
- if(isMetaAttribute(attr.name))
- toret[attr.name.substr(5)] = attr.value;
+ if(isMetaAttribute(attr.name)) {
+ toret.push({name: attr.name.substr(5), value: attr.value});
+ }
});
return toret;
},
getOtherAttributes: function() {
var toret = {};
this.getAttrs().forEach(function(attr) {
});
return toret;
},
getOtherAttributes: function() {
var toret = {};
this.getAttrs().forEach(function(attr) {
- if(attr.name !=
'class' && !isMetaAttribute(attr.name))
+ if(attr.name !=
= 'class' && !isMetaAttribute(attr.name)) {
toret[attr.name] = attr.value;
toret[attr.name] = attr.value;
+ }
});
return toret;
}
});
return toret;
}