Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created September 29, 2010 19:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsmith/603391 to your computer and use it in GitHub Desktop.
Save lsmith/603391 to your computer and use it in GitHub Desktop.
YUI.add('node++', function (Y) {
// define a function that will run in the context of a
// Node instance:
function doSomethingAwesome() {
Y.log("Do something awesome here.");
}
// use addMethod to add doAwesomeThing to the Node prototype:
Y.Node.addMethod("doAwesomeThing", doSomethingAwesome);
// add this functionality to NodeLists:
Y.NodeList.importMethod(Y.Node.prototype, "doAwesomeThing");
}, '0.0.1', { requires: ['node'] });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment