1 $(document).ready( function(){
3 var $form = $('form#eval');
5 $form.find('textarea').each( function() {
6 console.debug('grow',this);
9 console.debug( 'textarea_grow', rows, this );
10 var grow = function(ta) {
11 var lines = ta.value.split('\n').length;
12 if ( lines != rows ) {
15 console.debug('keyup', lines, rows, ta );
19 this.onkeyup = function() { grow(this) };
22 if ( $form.is(':visible') ) {
23 $('body').css({ 'margin-bottom': $form.height() });
26 $('input#close').click( function(){
27 console.debug( 'close console' );
28 $.post( document.location, { code: '' } );
29 $(this).parent().hide();
32 var $out = $('pre#out');
33 if ( $out.height() > ( $(window).height() / 3 * 2 ) ) {
34 $out.height( $(window).height() / 3 * 2 ).css({ overflow: 'auto' });
37 $('a#console').click( function() {
38 console.debug('open console');
39 var $f = $('form#eval');
40 if ( $f.is(':visible') ) {
42 $('body').css({ 'margin-bottom': 0 });
45 $('body').css({ 'margin-bottom': $form.height() });