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

www lon-capa-cvs@mail.lon-capa.org
Fri, 18 Apr 2003 20:21:38 -0000


www		Fri Apr 18 16:21:38 2003 EDT

  Modified files:              
    /rat/client	parameter.html 
  Log:
  Make love not color war!
  
  
Index: rat/client/parameter.html
diff -u rat/client/parameter.html:1.20 rat/client/parameter.html:1.21
--- rat/client/parameter.html:1.20	Mon Feb  3 13:03:54 2003
+++ rat/client/parameter.html	Fri Apr 18 16:21:38 2003
@@ -3,7 +3,7 @@
 The LearningOnline Network with CAPA
 Parameter Input Window
 //
-// $Id: parameter.html,v 1.20 2003/02/03 18:03:54 harris41 Exp $
+// $Id: parameter.html,v 1.21 2003/04/18 20:21:38 www Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -315,7 +315,23 @@
     choicewrite(cdays+' days '+chours+' hours '
                +cmins+' mins '+csecs+' secs');
 }
-    
+
+function pickcolor(picked) {
+  svalue=picked;
+  draw();
+}
+
+function colorfield(ir,ig,ib) {
+   var col=new Array;
+   col=["00","11","22","33","44","55","66","77","88","99","AA","BB","CC","DD","EE","FF"];
+   var color='#'+col[ir]+col[ig]+col[ib];
+   var selection="   ";
+   if (color==svalue) { selection="X"; }
+   choicewrite('<td bgcolor="'+color+'"><a href="javascript:parent.pickcolor('+"'"+
+               color+"'"+')">'+selection+'</a></td>');
+               
+}    
+
 function draw() {
    choicestart();
    choicewrite('<form name=sch');
@@ -512,6 +528,25 @@
                     '" name=stringval onChange="parent.stringeval()">');
         choicewrite('</td></table>');
       }
+   }
+   
+   if (ptype=='color') {
+      tablestart('Choose a Color');
+      choicewrite('<table>');
+      if (svalue) {
+         choicewrite('<tr><td colspan="10">Current choice:</td><td bgcolor="'+
+                     svalue+'" colspan="6">&nbsp;</td></tr>');
+      }
+      for (var ir=1; ir<=15; ir++) {
+          for (var ig=1; ig<=15; ig++) {
+              choicewrite('<tr>');
+              for (var ib=1; ib<=15; ib++) {
+                  colorfield(ir,ig,ib);
+	      }
+              choicewrite('</tr>');
+	  }	      
+      }
+      choicewrite('</table></td></table>');
    }
 
    choicewrite('</table></form>');