- getMetaAttributes: function() {
- var toret = new AttributesList(),
- classParts = [''].concat(this.getClass().split('.')),
- classCurrent, classDesc;
-
- classParts.forEach(function(part) {
- classCurrent = classCurrent ? classCurrent + '.' + part : part;
- classDesc = this.document.options.wlxmlClasses[classCurrent];
- if(classDesc) {
- _.keys(classDesc.attrs).forEach(function(attrName) {
- toret[attrName] = _.extend({value: this.getAttr(attrName)}, classDesc.attrs[attrName]);
- }.bind(this));
- }
- }.bind(this));
- return toret;
- },
- setMetaAttribute: function(key, value) {
- this.setAttr(key, value);
- },
- getOtherAttributes: function() {
- var toret = {},
- node = this;
- this.getAttrs().forEach(function(attr) {
- if(attr.name !== 'class' && !node.isMetaAttribute(attr.name)) {
- toret[attr.name] = {value: attr.value};
- }
- });
- return toret;
- },
- isMetaAttribute: function(attrName) {
- return attrName !== 'class' &&_.contains(_.keys(this.getMetaAttributes()), attrName);
+ find: function(query) {
+ var doc = this.document;
+ return this._$.find('*')
+ .map(function() {
+ return doc.createDocumentNode(this);
+ })
+ .filter(function() {
+ return this.is(query);
+ });