From: Iain Patterson Date: Thu, 7 Nov 2013 13:00:24 +0000 (-0500) Subject: Make textareas dynamically resizable. X-Git-Tag: 2013-11-07~3 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=c0b122f11daeec715462a6819ec46df6733ce61d;p=readifood.git Make textareas dynamically resizable. Use Jack Moore's autosize plugin[1] for jQuery to expand the height of textareas as they are filled. [1] http://www.jacklmoore.com/autosize/ --- diff --git a/lib/forms.php b/lib/forms.php index ae08607..c71c11f 100644 --- a/lib/forms.php +++ b/lib/forms.php @@ -30,10 +30,14 @@ } function textarea($name, $value = null) { - echo ""; + echo ""; } function option($select, $value, $text, $selected = null) { diff --git a/lib/header.php b/lib/header.php index 3c44dd9..e8b89da 100644 --- a/lib/header.php +++ b/lib/header.php @@ -6,6 +6,7 @@ echo "\n"; echo "\n"; ?> + diff --git a/www/jquery.autosize.js b/www/jquery.autosize.js new file mode 100644 index 0000000..0f296d4 --- /dev/null +++ b/www/jquery.autosize.js @@ -0,0 +1,250 @@ +/*! + Autosize v1.18.1 - 2013-11-05 + Automatically adjust textarea height based on user input. + (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize + license: http://www.opensource.org/licenses/mit-license.php +*/ +(function ($) { + var + defaults = { + className: 'autosizejs', + append: '', + callback: false, + resizeDelay: 10 + }, + + // border:0 is unnecessary, but avoids a bug in Firefox on OSX + copy = '