/*! Sample Grunt jQuery Plugin - v0.1.0 - 2012-12-10 * https://github.com/gruntjs/grunt-init-jquery-sample * Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ (function($) { // Collection method. $.fn.awesome = function() { return this.each(function(i) { // Do something awesome to each selected element. $(this).html('awesome' + i); }); }; // Static method. $.awesome = function(options) { // Override default options with passed-in options. options = $.extend({}, $.awesome.options, options); // Return something awesome. return 'awesome' + options.punctuation; }; // Static method default options. $.awesome.options = { punctuation: '.' }; // Custom selector. $.expr[':'].awesome = function(elem) { // Is this element awesome? return $(elem).text().indexOf('awesome') !== -1; }; }(jQuery));