This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Adapted from Autogrow Textarea Plugin | |
* @see http://www.technoreply.com/autogrow-textarea-plugin/ | |
*/ | |
(function($) { | |
$.fn.autoGrow = function() { | |
return this.each(function() { | |
var txtArea = $(this); | |
var colsDefault = txtArea.attr('cols'); | |
var rowsDefault = txtArea.attr('rows'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by http://bit.ly/juSAWl | |
// Augment String.prototype to allow for easier formatting. This implementation | |
// doesn't completely destroy any existing String.prototype.format functions, | |
// and will stringify objects/arrays. | |
String.prototype.format = function(i, safe, arg) { | |
function format() { | |
var str = this, len = arguments.length+1; | |
// For each {0} {1} {n...} replace with the argument in that position. If |