[LON-CAPA-cvs] cvs: rat /client parameter.html

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 25 Mar 2002 21:01:13 -0000


matthew		Mon Mar 25 16:01:13 2002 EDT

  Modified files:              
    /rat/client	parameter.html 
  Log:
  Removed a few javascript warnings by renaming the second and third versions
  of 'result' 'result1' and 'result2'.  
  Simply close the window on cancel instead of invoking buggy code...
  
  
Index: rat/client/parameter.html
diff -u rat/client/parameter.html:1.16 rat/client/parameter.html:1.17
--- rat/client/parameter.html:1.16	Wed Dec 19 12:22:29 2001
+++ rat/client/parameter.html	Mon Mar 25 16:01:12 2002
@@ -3,7 +3,7 @@
 The LearningOnline Network with CAPA
 Parameter Input Window
 //
-// $Id: parameter.html,v 1.16 2001/12/19 17:22:29 albertel Exp $
+// $Id: parameter.html,v 1.17 2002/03/25 21:01:12 matthew Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -349,16 +349,16 @@
          tablestart('Percentage error, asymmetric around value');
          valline('Upper percentage',2,3);
          valline('Lower percentage',4,5);
-         var range=new Array;
+         var range1=new Array;
          if ((svalue!='') && (typeof(svalue)!="undefined")) {
-            range=svalue.split(',');
-            if (typeof(range[1])=='undefined') { range[1]=range[0]; }
-            choices.document.forms.sch.val2.value=parseFloat(range[0]);
-            if (range[0].indexOf('+')!=-1) {
+            range1=svalue.split(',');
+            if (typeof(range1[1])=='undefined') { range1[1]=range1[0]; }
+            choices.document.forms.sch.val2.value=parseFloat(range1[0]);
+            if (range1[0].indexOf('+')!=-1) {
                choices.document.forms.sch.val3.checked=true;
             }
-            choices.document.forms.sch.val4.value=parseFloat(range[1]);
-            if (range[1].indexOf('+')!=-1) {
+            choices.document.forms.sch.val4.value=parseFloat(range1[1]);
+            if (range1[1].indexOf('+')!=-1) {
                choices.document.forms.sch.val5.checked=true;
             }
          }
@@ -377,16 +377,16 @@
          tablestart('Absolute error, asymmetric around value');
          valline('Upper value',2,3);
          valline('Lower value',4,5);
-         var range=new Array;
+         var range2=new Array;
          if ((svalue!='') && (typeof(svalue)!="undefined")) {
             range=svalue.split(',');
-            if (typeof(range[1])=='undefined') { range[1]=range[0]; }
-            choices.document.forms.sch.val2.value=parseFloat(range[0]);
-            if (range[0].indexOf('+')!=-1) {
+            if (typeof(range2[1])=='undefined') { range2[1]=range2[0]; }
+            choices.document.forms.sch.val2.value=parseFloat(range2[0]);
+            if (range2[0].indexOf('+')!=-1) {
                choices.document.forms.sch.val3.checked=true;
             }
-            choices.document.forms.sch.val4.value=parseFloat(range[1]);
-            if (range[1].indexOf('+')!=-1) {
+            choices.document.forms.sch.val4.value=parseFloat(range2[1]);
+            if (range2[1].indexOf('+')!=-1) {
                choices.document.forms.sch.val5.checked=true;
             }
          }
@@ -708,16 +708,24 @@
   selwrite('">Delete</a>&nbsp;&nbsp;');
  
   selwrite('<a href="javascript:');
-  if (preturn!='') {
-     selwrite('parent.opener.document.'+preturn+'_value.value='+"'';");
-     selwrite('parent.opener.document.'+preturn+'_type.value='+"'';");
-  }
-  if (pmarker!='') {
-     selwrite('parent.opener.document.'+preturn+'_marker.value='+"'';");
-  }
-  if (pcode!='') {
-     selwrite('parent.opener.'+pcode+'();');
-  }
+// Old code :
+//----------------------------------------------------------------------
+//  if (preturn!='') {
+//     selwrite('parent.opener.document.'+preturn+'_value.value='+"'';");
+//     selwrite('parent.opener.document.'+preturn+'_type.value='+"'';");
+// }
+//  if (pmarker!='') {
+//     selwrite('parent.opener.document.'+preturn+'_marker.value='+"'';");
+//  }
+//  if (pcode!='') {
+//     selwrite('parent.opener.'+pcode+'();');
+//  }
+//----------------------------------------------------------------------
+// Just close the window to 'cancel' the operation.  There are javascript
+// errors in the above commented out code that I have not been able to 
+// track down.  I think they reside in 'parent.opener.'+pcode+'();'
+//
+  selwrite('this.parent.close();');
   selwrite('">Cancel</a>'); 
  
   selwrite('</body></html>');