nodelist.js revision a6dd1c401b840b62cff0bcd04969e7c6a0022a6b
/**
* The NodeList Utility provides a DOM-like interface for interacting with DOM nodes.
* @module node
* @submodule node-list
*/
/**
* The NodeList class provides a wrapper for manipulating DOM NodeLists.
* Use Y.get() to retrieve NodeList instances.
*
* <strong>NOTE:</strong> NodeList properties are accessed using
* the <code>set</code> and <code>get</code> methods.
*
* @class NodeList
* @constructor
*/
Y.Array._diff = function(a, b) {
var removed = [],
present = false,
present = false;
if (a[i] === b[j]) {
present = true;
continue outer;
}
}
if (!present) {
}
}
return removed;
};
Y.Array.diff = function(a, b) {
return {
};
};
// "globals"
var g_nodelists = {},
UID = '_yuid',
if (typeof nodes === 'string') {
}
Y.stamp(this);
if (config.restricted) {
g_restrict = this[UID];
}
};
// end "globals"
};
NodeList._instances = [];
} else {
}
};
var ret = [],
ctx,
if (!instance) {
}
}
});
// TODO: remove tmp pointer
};
} else {
}
};
if (typeof name === 'string') {
} else {
});
}
};
NodeList._getTempNode = function() {
if (!tmp) {
}
return tmp;
};
// call with instance context
if (!instance) {
}
});
};
// call with instance context
ret = [];
if (!instance) { // reuse tmp instance
}
});
return ret;
};
/**
* Retrieves the Node instance at the given index.
* @method item
*
* @param {Number} index The index of the target Node.
* @return {Node} The Node instance at the given index.
*/
},
/**
* Applies the given function to each Node in the NodeList.
* @method each
* @param {Function} fn The function to apply
* @param {Object} context optional An optional context to apply the function with
* Default context is the NodeList instance
* @return {NodeList} NodeList containing the updated collection
* @chainable
*/
var instance = this;
});
},
/**
* Filters the NodeList instance down to only nodes matching the given selector.
* @method filter
* @param {String} selector The selector to filter against
* @return {NodeList} NodeList containing the updated collection
* @see Selector
*/
},
//if (!this.attrAdded(attr)) {
//this._addAttr(attr);
//return NodeList.DEFAULT_GETTER.call(this, attr);
}
},
}
},
}
},
destructor: function() {
g_nodelists[this[UID]] = [];
},
refresh: function() {
var doc,
diff,
if (this._query) {
if (g_nodelists[this[UID]] &&
}
}
},
/**
* Returns the current number of items in the NodeList.
* @method size
* @return {Int} The number of items in the NodeList.
*/
size: function() {
},
toString: function() {
var str = '',
node;
}
}
}
}
},
getter: function() {
},
}
});
}
}, true);
'addEventListener',
'removeEventListener'
]);
// TODO: propagate restricted to nodes?
});
// zero-length result returns null
return nodeList;
};