[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet lonspreadsheet.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Sat, 18 Aug 2007 00:04:41 -0000


albertel		Fri Aug 17 20:04:41 2007 EDT

  Modified files:              
    /loncom/interface/spreadsheet	lonspreadsheet.pm 
  Log:
  - BUG#5347 use the auto resizing textarea code in the spreadsheet popup editor window
  
  
Index: loncom/interface/spreadsheet/lonspreadsheet.pm
diff -u loncom/interface/spreadsheet/lonspreadsheet.pm:1.50 loncom/interface/spreadsheet/lonspreadsheet.pm:1.51
--- loncom/interface/spreadsheet/lonspreadsheet.pm:1.50	Wed Mar  7 11:03:07 2007
+++ loncom/interface/spreadsheet/lonspreadsheet.pm	Fri Aug 17 20:04:41 2007
@@ -1,5 +1,5 @@
 #
-# $Id: lonspreadsheet.pm,v 1.50 2007/03/07 16:03:07 raeburn Exp $
+# $Id: lonspreadsheet.pm,v 1.51 2007/08/18 00:04:41 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -339,10 +339,15 @@
         my $extra_javascript = 
             &Apache::loncommon::browser_and_searcher_javascript();
 	
+	my $cell_extra_js   = &Apache::loncommon::resize_textarea_js();
 	my $cell_edit_start = 
-	    &Apache::loncommon::start_page('Cell Edit Window',undef,
+	    &Apache::loncommon::start_page('Cell Edit Window',$cell_extra_js,
 					   {'only_body' => 1,
-					    'js_ready'  => 1,});
+					    'js_ready'  => 1,
+					    'add_entries'  => {
+						'onresize' => "resize_textarea('LC_newformula','LC_aftertextarea')",
+						'onload'   => "resize_textarea('LC_newformula','LC_aftertextarea')",
+					    }});
 	my $cell_edit_end = 
 	    &Apache::loncommon::end_page({'js_ready'  => 1,});
 
@@ -360,9 +365,10 @@
         edit_text +='$cell_edit_start';
         edit_text += '<form name="editwinform">';
         edit_text += '<center><h3>$lt{'ce'} '+cellname+'</h3>';
-        edit_text += '<textarea name="newformula" cols="60" rows="12"';
-        edit_text += ' wrap="off" >'+cellformula+'</textarea>';
-        edit_text += '</br>';
+        edit_text += '<textarea id="LC_newformula" name="newformula" ';
+        edit_text += ' cols="60" rows="12"; wrap="off" style="width:100%">';
+	edit_text += cellformula+'</textarea>';
+        edit_text += '<div id="LC_aftertextarea"><br />';
         edit_text += '<input type="button" name="accept" value="$lt{'ac'}"';
         edit_text += ' onClick=\\\'javascript:';
         edit_text += 'opener.document.sheet.cell.value=';
@@ -375,7 +381,7 @@
         edit_text += '<input type="button" name="abort" ';
         edit_text +=     'value="$lt{'dc'}"';
         edit_text += ' onClick="javascript:self.close()" />';
-        edit_text += '</center>$cell_edit_end';
+        edit_text += '</center></div></form>$cell_edit_end';
 
         if (editwin != null && !(editwin.closed) ) {
             editwin.close();