From: Aleksander Ɓukasz Date: Mon, 7 Oct 2013 14:38:21 +0000 (+0200) Subject: changing wlxml.WLXMLElementNode.getMEtaAttributes api X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/489e6a161f6b03191a325254a7fefa4f8425d575 changing wlxml.WLXMLElementNode.getMEtaAttributes api --- diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index 1619e57..3195efa 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -22,10 +22,10 @@ $.extend(WLXMLElementNode.prototype, smartxml.ElementNode.prototype, { return this.getAttr('class'); }, getMetaAttributes: function() { - var toret = {}; + var toret = []; this.getAttrs().forEach(function(attr) { if(isMetaAttribute(attr.name)) { - toret[attr.name.substr(5)] = attr.value; + toret.push({name: attr.name.substr(5), value: attr.value}); } }); return toret; diff --git a/src/wlxml/wlxml.test.js b/src/wlxml/wlxml.test.js index 804e37e..9bca9f0 100644 --- a/src/wlxml/wlxml.test.js +++ b/src/wlxml/wlxml.test.js @@ -24,7 +24,7 @@ describe('WLXMLDocument', function() { it('returns its attributes as dict', function() { var node = nodeFromXML(''); - expect(node.getMetaAttributes()).to.eql({attr1: 'val1', attr2: 'val2'}); + expect(node.getMetaAttributes()).to.eql([{name: 'attr1', value: 'val1'}, {name: 'attr2', value: 'val2'}]); }); it('returns attributes other than class and meta-* as other attributes', function() {