[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages/annotator admannotations.pm

schafran schafran@source.lon-capa.org
Thu, 19 Feb 2009 22:05:28 -0000


schafran		Thu Feb 19 22:05:28 2009 EDT

  Modified files:              
    /loncom/html/res/adm/pages/annotator	admannotations.pm 
  Log:
  toggled button name. "Close" if you saved the notice or "Cancel" if you didn't save the notice.
  
  
  
Index: loncom/html/res/adm/pages/annotator/admannotations.pm
diff -u loncom/html/res/adm/pages/annotator/admannotations.pm:1.33 loncom/html/res/adm/pages/annotator/admannotations.pm:1.34
--- loncom/html/res/adm/pages/annotator/admannotations.pm:1.33	Fri Feb 13 20:20:20 2009
+++ loncom/html/res/adm/pages/annotator/admannotations.pm	Thu Feb 19 22:05:28 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # This will take annotations and then plug them into a page.
 #
-# $Id: admannotations.pm,v 1.33 2009/02/13 20:20:20 schafran Exp $
+# $Id: admannotations.pm,v 1.34 2009/02/19 22:05:28 schafran Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -75,6 +75,11 @@
 
     my $get_symb = &js_get_symb();
 
+    my %lt = ( 'close no save' => "Close",
+               'save'          => "Save",
+               'cancel'        => "Cancel",);
+    %lt = &Apache::lonlocal::texthash(%lt);
+
     my $js = <<ENDJS;
 <script type="text/javascript">
 var timeout;
@@ -89,6 +94,11 @@
     }
     timeout=setTimeout('changed();','1000');
 }
+
+function renameButton(){
+    document.getElementById("close").value="$lt{'cancel'}";
+}
+
 </script>
 ENDJS
 
@@ -102,20 +112,17 @@
     my $end_page =
         &Apache::loncommon::end_page();
     
-    my %lt = ( 'close no save' => "Close",
-	       'save'          => "Save",);
-    %lt = &Apache::lonlocal::texthash(%lt);
 	 
     return(<<END_HTML)
 $start_page
  <center>
   <form name="annotInfo" method="post" action="/adm/annotations">
-    <textarea name="annotation" wrap="on" rows="12" cols="36">$annotation</textarea><br />
+    <textarea name="annotation" wrap="on" rows="12" cols="36" onfocus="javascript:renameButton();">$annotation</textarea><br />
     <input type="hidden" name="symbold" value="$symbnew" />
     <input type="hidden" name="symbnew" value="" />
     <input type="button" name="send" value="$lt{'save'}"
            onclick="javascript:this.form.symbnew.value=get_symb();this.form.submit();" />
-    <input type="button" name="close" value="$lt{'close no save'}" 
+    <input type="button" id="close" name="close" value="$lt{'close no save'}" 
            onclick="javascript:window.close();" />
   </form>
  </center>