//>>excludeStart("exclude", pragmas.exclude); define([ "shoestring" ], function(){ //>>excludeEnd("exclude"); /** * Add a class to each DOM element in the set of elements. * * @param {string} className The name of the class to be added. * @return shoestring * @this shoestring */ shoestring.fn.addClass = function( className ){ var classes = className.replace(/^\s+|\s+$/g, '').split( " " ); return this.each(function(){ for( var i = 0, il = classes.length; i < il; i++ ){ if( this.className !== undefined && (this.className === "" || !this.className.match( new RegExp( "(^|\\s)" + classes[ i ] + "($|\\s)"))) ){ this.className += " " + classes[ i ]; } } }); }; //>>excludeStart("exclude", pragmas.exclude); }); //>>excludeEnd("exclude");