From c0b122f11daeec715462a6819ec46df6733ce61d Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 7 Nov 2013 08:00:24 -0500 Subject: [PATCH] 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/ --- lib/forms.php | 6 +- lib/header.php | 1 + www/jquery.autosize.js | 250 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 www/jquery.autosize.js 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 = '