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

www lon-capa-cvs@mail.lon-capa.org
Fri, 24 May 2002 16:39:23 -0000


www		Fri May 24 12:39:23 2002 EDT

  Modified files:              
    /rat/client	code.html 
  Log:
  Starting to work on groupcopy, which will work with lonsequence and groupsort
  
  
Index: rat/client/code.html
diff -u rat/client/code.html:1.55 rat/client/code.html:1.56
--- rat/client/code.html:1.55	Wed May 15 14:48:53 2002
+++ rat/client/code.html	Fri May 24 12:39:23 2002
@@ -4,7 +4,7 @@
 The LearningOnline Network
 Resource Assembly Tool
 //
-// $Id: code.html,v 1.55 2002/05/15 18:48:53 www Exp $
+// $Id: code.html,v 1.56 2002/05/24 16:39:23 www Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -118,6 +118,12 @@
                  // -1 means never yet opened/defined
 var idxmode='';
 
+var copydx;
+var copydxflag=-1; // 1 means currently open
+                 // 0 means closed (but has been open)
+                 // -1 means never yet opened/defined
+var copydxmode='';
+
 var parm;
 var parmflag=-1; // 1 means currently open
                  // 0 means closed (but has been open)
@@ -1576,6 +1582,10 @@
   idx.document.clear();
 }
 
+// --------------------------------------------------------- Clears copy window
+function copydxclear() {
+  copydx.document.clear();
+}
 // ------------------------------------------------------- Clears search window
 function srchclear() {
   srch.document.clear();
@@ -1594,6 +1604,14 @@
   }
 }
 
+// --------------------------------------------------------- Closes copy window
+function copydxclose() {
+  if (copydx && !copydx.closed) {
+    copydxflag=0;
+    copydx.close();
+  }
+}
+
 // ------------------------------------------------------- Closes search window
 function srchclose() {
   if (srch && !srch.closed) {
@@ -1619,6 +1637,19 @@
    idx.focus();
 }
 
+// ----------------------------------------------------------- Open copy window
+function copydxopen(mode) {
+   var options="scrollbars=1,resizable=1,menubar=0";
+   copydxmode=mode;
+   copydxflag=1;
+   copydx=open("",'copydxout',options);
+   copydx.document.clear('');
+   copydx.document.writeln(
+          '<html><body bgcolor="#FFFFFF"><h1>Group Copy from Map</h1>');
+   copydx.document.writeln('</body></html>');
+   copydx.focus();
+}
+
 // --------------------------------------------------------- Open search window
 function srchopen(mode) {
    var options="scrollbars=1,resizable=1,menubar=0";
@@ -1649,6 +1680,14 @@
    idx.focus();
 }
 
+// -------------------------------------------------------- Do idx status check
+function copydxcheck(mode) {
+   if (!copydx || copydx.closed || copydxmode!=mode) {
+      copydxopen(mode);
+   }
+   copydx.focus();
+}
+
 // ---------------------------------------------------- Handles "click to edit"
 function handler(infostr) {
   var k;
@@ -2631,6 +2670,10 @@
    idxcheck('groupimport');
 }
 
+function groupcopy() {
+   copydxcheck('groupsec');
+}
+
 // -------------------------------------------------------------- Store changes
 function storechange() {
    var k;
@@ -2687,7 +2730,10 @@
       srchclose();
    }
    if (idx && !idx.closed) {
-      srchclose();
+      idxclose();
+   }
+   if (copydx && !copydx.closed) {
+      copydxclose();
    }
 }
 
@@ -2707,6 +2753,7 @@
 <td bgcolor="#ffffcc"><a href="javascript:redo();"><b>R</b>edo</a>&nbsp;</td>
 <td bgcolor="#ffffcc"><a href="javascript:groupsearch();"><b>G</b>roup search</a>&nbsp;</td>
 <td bgcolor="#ffffcc"><a href="javascript:groupimport();"><b>G</b>roup import</a>&nbsp;</td>
+<td bgcolor="#ffffcc"><a href="javascript:groupcopy();"><b>G</b>roup copy</a>&nbsp;</td>
 <td bgcolor="#ffffcc"><a href="javascript:graphdef='no';save();storechange();"><b>S</b>ave map</a>&nbsp;</td>
 <td bgcolor="#ccffcc"><a href="javascript:storechange();"><b>S</b>ave map and layout</a>&nbsp;</td>
 </tr></table>