[LON-CAPA-cvs] cvs: loncom(version_1_2_X) /interface lonfeedback.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 27 Jul 2004 14:29:04 -0000


albertel		Tue Jul 27 10:29:04 2004 EDT

  Modified files:              (Branch: version_1_2_X)
    /loncom/interface	lonfeedback.pm 
  Log:
   - remove 1.104 and backport 1.105
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.99.2.1 loncom/interface/lonfeedback.pm:1.99.2.2
--- loncom/interface/lonfeedback.pm:1.99.2.1	Fri Jul 23 16:01:46 2004
+++ loncom/interface/lonfeedback.pm	Tue Jul 27 10:29:03 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.99.2.1 2004/07/23 20:01:46 albertel Exp $
+# $Id: lonfeedback.pm,v 1.99.2.2 2004/07/27 14:29:03 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -552,11 +552,6 @@
   }
   my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();
   my $htmlheader=&Apache::lonhtmlcommon::htmlareaheaders();
-  my $onsubmit='';
-  if ((&Apache::lonhtmlcommon::htmlareabrowser()) &&
-      (!&Apache::lonhtmlcommon::htmlareablocked())) {
-      $onsubmit='document.mailform.onsubmit();';
-  }
   my $send=&mt('Send');
   $r->print(<<ENDDOCUMENT);
 <html>
@@ -600,7 +595,9 @@
         }
 
         if (rec) {
-            $onsubmit
+            if (typeof(document.mailform.onsubmit)!='undefined') {
+		document.mailform.onsubmit();
+	    }
 	    document.mailform.submit();
         } else {
             alert('Please check a feedback type.');
@@ -635,7 +632,7 @@
 </p>
 </form>
 ENDDOCUMENT
-$r->print(&generate_preview_button($onsubmit).
+$r->print(&generate_preview_button().
 &Apache::lonhtmlcommon::htmlareaselectactive('comment').
 '</body></html>');
 }
@@ -1114,14 +1111,13 @@
 }
 
 sub generate_preview_button {
-    my ($onsubmit)=@_;
     my $pre=&mt("Show Preview");
     return(<<ENDPREVIEW);
 <form name="preview" action="/adm/feedback?preview=1" method="post" target="preview">
 <input type="hidden" name="subject">
 <input type="hidden" name="comment" />
 <input type="button" value="$pre"
-onClick="$onsubmit;this.form.comment.value=document.mailform.comment.value;this.form.subject.value=document.mailform.subject.value;this.form.submit();" />
+onClick="if (typeof(document.mailform.onsubmit)!='undefined') {document.mailform.onsubmit();};this.form.comment.value=document.mailform.comment.value;this.form.subject.value=document.mailform.subject.value;this.form.submit();" />
 </form>
 ENDPREVIEW
 }