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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 10 May 2006 22:47:26 -0000


albertel		Wed May 10 18:47:26 2006 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  - sticking elments back in there (not needed in firefox but might be somewhere else)
  - making the 'Edit an anon post then set the type to anon' JS work again
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.202 loncom/interface/lonfeedback.pm:1.203
--- loncom/interface/lonfeedback.pm:1.202	Wed May 10 18:29:57 2006
+++ loncom/interface/lonfeedback.pm	Wed May 10 18:47:22 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.202 2006/05/10 22:29:57 albertel Exp $
+# $Id: lonfeedback.pm,v 1.203 2006/05/10 22:47:22 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1419,18 +1419,17 @@
                   $parentmsg = $contrib{$idx.':replyto'};
               }
               unless (exists($env{'form.origpage'})) {
-                  my $anonflag = 0;
+                  my $anonflag = 'nonanon';
                   if ($contrib{$idx.':anonymous'}) {
-                      $anonflag = 1;
+                      $anonflag = 'anon';
                   }
                   $anonscript = (<<END);
   function setposttype () {
-      var currtype = $anonflag
-      if (currtype == 1) {
-          document.mailform.elements.discuss.value = 'anon'
-      }
-      if (currtype == 0) {
-          document.mailform.elements.discuss.value = 'nonanon'
+      var currtype = "$anonflag";
+      for (var i=0; i<document.mailform.discuss.length; i++) {
+	  if (document.mailform.elements.discuss[i].value == currtype ) {
+	      document.mailform.elements.discuss[i].checked=1;
+	  } 
       }
       return
   }
@@ -1456,20 +1455,20 @@
     function gosubmit() {
         var rec=0;
         if (typeof(document.mailform.elements.discuss)!="undefined") {
-	    if (typeof(document.mailform.discuss.length) == "undefined") {
-		if (document.mailform.discuss.checked ) {
+	    if (typeof(document.mailform.elements.discuss.length) == "undefined") {
+		if (document.mailform.elements.discuss.checked ) {
 		    rec=1;
 		}
 	    } else {
-		for (var i=0; i<document.mailform.discuss.length; i++) {
-		    if (document.mailform.discuss[i].checked ) {
+		for (var i=0; i<document.mailform.elements.discuss.length; i++) {
+		    if (document.mailform.elements.discuss[i].checked ) {
 			rec=1;
 		    } 
 		}
 	    }
 	}
         if (typeof(document.mailform.elements.blog)!="undefined") {
-          if (document.mailform.blog.checked) {
+          if (document.mailform.elements.blog.checked) {
              rec=1;
           } 
         }