##// END OF EJS Templates
Merge pull request #937 from minrk/readline...
Merge pull request #937 from minrk/readline Add dirty trick for readline import on OSX to more aggressively detect the presence of libedit masquerading as true GNU readline. Also made the libedit warning extremely loud, so people don't miss it. See the original PR page for the gory details; short version: 1. remove lib-dynload from sys.path before trying to import readline the first time 2. after import, restore lib-dynload to its place in sys.path 3. if import failed without lib-dynload, try it one more time, to get the default module

File last commit:

r4316:68db752a
r5211:90b01394 merge
Show More
jquery.autogrow.js
42 lines | 1.1 KiB | application/javascript | JavascriptLexer
Brian Granger
Initial draft of HTML5/JS/CSS3 notebook.
r4292 /*
* Auto Grow Textarea Plugin
* by Jevin 5/11/2010
* http://www.technoreply.com/autogrow-textarea-plugin/
*
* Modified by Rob G (aka Fudgey/Mottie)
* - Converted into a plugin
* - Added ability to calculate approximate # cols when textarea is set to 100%
Brian Granger
Initial latex printing for sympy and fixes to autogrow.
r4316 *
* Simplified by Brian Granger on 5/2/2011
Brian Granger
Initial draft of HTML5/JS/CSS3 notebook.
r4292 */
Brian Granger
Initial latex printing for sympy and fixes to autogrow.
r4316 (function($) {
$.fn.autogrow = function() {
Brian Granger
Initial draft of HTML5/JS/CSS3 notebook.
r4292
Brian Granger
Initial latex printing for sympy and fixes to autogrow.
r4316 var grow = function(d) {
var linesCount = 0;
// modified split rule from
// http://stackoverflow.com/questions/2035910/how-to-get-the-number-of-lines-in-a-textarea/2036424#2036424
var lines = d.txt.value.split(/\r|\r\n|\n/);
linesCount = lines.length;
if (linesCount >= d.rowsDefault) {
d.txt.rows = linesCount;
} else {
d.txt.rows = d.rowsDefault;
}
};
Brian Granger
Initial draft of HTML5/JS/CSS3 notebook.
r4292
Brian Granger
Initial latex printing for sympy and fixes to autogrow.
r4316 return this.each(function() {
var d = {
colsDefault : 0,
rowsDefault : 1,
txt : this,
$txt : $(this)
};
d.txt.onkeyup = function() {
grow(d);
};
grow(d);
Brian Granger
Initial draft of HTML5/JS/CSS3 notebook.
r4292 });
Brian Granger
Initial latex printing for sympy and fixes to autogrow.
r4316 };
})(jQuery);