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

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 01 Mar 2002 14:58:27 -0000


This is a MIME encoded message

--matthew1014994707
Content-Type: text/plain

matthew		Fri Mar  1 09:58:27 2002 EDT

  Modified files:              
    /rat/client	code.html 
  Log:
  Whitespace cleanup.  There is much, much more cleaning up to do.
  
  
--matthew1014994707
Content-Type: text/plain
Content-Disposition: attachment; filename="matthew-20020301095827.txt"

Index: rat/client/code.html
diff -u rat/client/code.html:1.48 rat/client/code.html:1.49
--- rat/client/code.html:1.48	Thu Nov 29 14:15:37 2001
+++ rat/client/code.html	Fri Mar  1 09:58:27 2002
@@ -4,7 +4,7 @@
 The LearningOnline Network
 Resource Assembly Tool
 //
-// $Id: code.html,v 1.48 2001/11/29 19:15:37 www Exp $
+// $Id: code.html,v 1.49 2002/03/01 14:58:27 matthew Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -44,6 +44,7 @@
 05/31 Scott Harrison
 06/11,06/25,06/27,06/28,06/29,07/04 Gerd Kortemeyer
 07/24,8/6,8/7,10/16 Scott Harrison
+03/01/02 Matthew Hall
 -->
 
 
@@ -129,7 +130,6 @@
 }
 
 // ------------------------------------------------ Insert a row into the table
-
 function insertrow(j,ex1,ex2) {
    var kj;
    stored=0;
@@ -234,7 +234,6 @@
 }
 
 // --------------------------------------------- Creates a new condition object
-
 function newcondition(content,type) {
    var ko;
    stored=0;
@@ -245,7 +244,6 @@
 }
 
 // ---------------------------------------------- Creates a new resource object
-
 function newresource(rid,cid,text,url,ext,type) {
    stored=0;
    objcont[addobj(rid,'b&'+rid+'&'+cid+':0:0:0')]=
@@ -254,7 +252,6 @@
 
 
 // -------------------------------- Insert a condition into a port of an object
-
 function insertcond(obj1,portnr,cond) {
    var k;
    stored=0;
@@ -271,7 +268,6 @@
  
 // --------------------------------------------- Insert a column into the table
 // Inserts a new table column after table column j
-
 function insertcol(j) {
    var kj;
    stored=0;
@@ -284,7 +280,6 @@
 }
      
 // --------------------------------------------------------------- Find the row
-
 function findrow(jid) {
    var j;
    for (j=0;j<=maxrow;j++) { if (row[j]==jid) { return j; } }
@@ -292,7 +287,6 @@
 }
 
 // --------------------------------------------------------------- Find the col
-
 function findcol(jid) {
    var j;
    for (j=0;j<=maxcol;j++) { if (col[j]==jid) { return j; } }
@@ -307,7 +301,6 @@
 //
 // returns middle (col number of middle of obj1)
 // sets colmap (map of cols with object numbers)
-
 function maprow (jid,obj1,ign) {
  var j; var k; var left; var right; var middle;
  middle=-1;
@@ -353,7 +346,6 @@
 // kid: colID, find point close to this
 // dkid: destination colID
 // returns colID
-
 function comingthru (jid,kid,dkid) {
    var k;
    maprow(jid,-1,1);
@@ -399,10 +391,7 @@
 // linkobj: object that the link goes to/comes from
 // sets inrow or outrow
 // return column
-
-
 function insertport (obj1,d,inout,linkobj) {
-
    var k; var port; var revport;
    stored=0;
    data1=obj[obj1].split('&');
@@ -431,7 +420,6 @@
          if ((data3[k]==0) && (colmap[k]==obj1) && (port==-1)) { port=k; } 
       }
    }
-
    if (port==-1) {
       if (colmap[k]==0) {
          revport=findcol(k);
@@ -478,7 +466,6 @@
 
 // ---------------------------- Make a new object and add it to the row content
 // returns object number of generated object
- 
 function addobj(kjid,objs) {
    stored=0;
    expense++;
@@ -492,7 +479,6 @@
 
 // ---------------------------------------- Make horizontal connection for hrid
 // hoffs=-1: this line goes on top of hrid
-
 function horizontal(hrid,hoffs,hfcol,htcol,hdest,hends) {
    hcrid=-1;
    if (hoffs==-1) {
@@ -519,7 +505,6 @@
          }
       }
    }
-
    if (hcrid==-1) {
       insertrow(row[hrid]+hoffs,hfcol,htcol);
       addobj(maxrow,'h&'+maxrow+'&'+hfcol+':'+htcol+'&'+hdest+'&'+hends);
@@ -529,7 +514,6 @@
 }
 
 // --------------------------------------- Deletes all references to object obj
-
 function delobj(obj1) {
    var k;
    stored=0;
@@ -549,7 +533,6 @@
 }
 
 // --------------------------------------------------------- Garbage collection
-
 function cleanup () {
    message("Garbage Collection");
    var j,kj,i;
@@ -603,11 +586,9 @@
       rowtype[maxrow]=2;
       coltype[maxcol]=2;
    }
-
 }
 
 // -------------------------------------------- Delete a condition from a block
-
 function delcond(obj1,colid) {
    var k;
    stored=0;
@@ -627,7 +608,6 @@
 }
     
 // ----------------------------------------- Creates a new condition in a block
-
 function crecond(obj1,colid,condtext,condtype) {
    var k;
    data3=obj[obj1].split('&');
@@ -649,7 +629,6 @@
 // deletes the link linknr
 // h&rowID&incolID:outcolID&inObj:outObj&inupdown:outupdown
 // v&colID&inObj:outObj&updown
-
 function dellink (linknr) {
   var k; var obj1; var obj2;
   stored=0;
@@ -690,7 +669,6 @@
 
 // ----------------------------------------------------------- Join two objects
 // Links obj1 with obj2, creates new objlink, marks all elements with number
-
 function joinres (obj1,obj2,cond) {
    stored=0;
    var minexpense;
@@ -725,7 +703,6 @@
       minexpense=expense;
    }
 
-
    if (best==0) {
       finishload();
       tryjoin(obj1,obj2,cond,1,1);
@@ -738,10 +715,8 @@
       finishload();
       tryjoin(obj1,obj2,cond,-1,1);
    }
-
 }
 
-
 function tryjoin(obj1,obj2,cond,d1,d2) {
    var k; var kr; var outcol; var incol; var d; var dest;
 
@@ -840,7 +815,6 @@
 // ---------------------------------------------------------- Delete a resource
 // Deletes resource obj1
 // Reconnects resources going thru this one if recon=1
-
 function delres (obj1,recon) {
    var infromobj=new Array();
    var inwithcon=new Array();
@@ -964,7 +938,6 @@
 }
 
 // -------------------------------------------------------------- Draw an entry
-
 function drawcell (rtype,ctype,what,cm,obj1,ej,ek,ne) {
  var bgcolor;
  var url='';
@@ -1104,7 +1077,6 @@
 }
 
 // --------------------------------------------------------- Color of resources
-
 function rescolor (ext,typ) {
    var rc; var gc; var bc;
    if (ext=='true') { bc='55'; } else { bc='99'; }
@@ -1115,7 +1087,6 @@
 }
 
 // -------------------------------------------------------- Color of conditions
-
 function condcolor(typ) {
    if (typ=='stop')  { return '#EEAAAA'; }
    if (typ=='force') { return '#AAAAEE'; }
@@ -1123,7 +1094,6 @@
 }
 
 // ----------------------------------------------------------------- Draw a row
-
 function drawrow (jid) {
 var j; var jk; var k;  var ck; var rtype;
 var objd1=new Array();
@@ -1327,13 +1297,11 @@
 }
 
 // -------------------------------------------------------------- Print message
-
 function message(txt) {
    parent.window.status=txt;
 }
 
 // ------------------------------------------------------------- Draw the table
-         
 function draw () {
    var k; var kr;
 
@@ -1382,7 +1350,6 @@
 }
 
 // --------------------------------------------------------- Clears info window
-
 function infoclear() {
  if (notclear!=1) {
   infcheck();
@@ -1430,14 +1397,12 @@
 }
 
 // ------------------------------------------------------------ Open inf window
-
 function infopen() {
    var options="scrollbars=1,resizable=1,menubar=0,width=400,height=300";
    inf=open("","infout",options);
 }
 
 // -------------------------------------------------------- Do inf status check
-
 function infcheck() {
    if (inf.closed) {
       infopen();
@@ -1445,7 +1410,6 @@
 }
 
 // --------------------------------------------------- Prints out resource info
-
 function info(infostr) {
  var mime='';
  var ext;
@@ -1538,7 +1502,6 @@
 }
 
 // ------------------------------------------------ "Escapes" out special chars
-
 function escape(instring) {
    var outstring='';
    var thischar;
@@ -1553,9 +1516,9 @@
    }
    return outstring;
 }
+// There must be a way to get rid of the odd number of "s
 
 // -------------------------------------------------- Insert resource into link
-
 function insertreslink(infostr) {
    var lnr;
    var fobj;
@@ -1588,7 +1551,6 @@
 }
 
 // -------------------------------------------- Insert resource after condition
-
 function insertcondlink(cid,lnr) {
    var fobj;
    var tobj;
@@ -1609,29 +1571,22 @@
    joinres(nobj,tobj,0);
 }
 
-
-
-
 // ------------------------------------------------------ Clears indexer window
-
 function idxclear() {
   idx.document.clear();
 }
 
 // ------------------------------------------------------- Clears search window
-
 function srchclear() {
   srch.document.clear();
 }
 
 // --------------------------------------------------------- Clears parm window
-
 function parmclear() {
   parm.document.clear();
 }
 
 // ------------------------------------------------------ Closes indexer window
-
 function idxclose() {
   if (idx && !idx.closed) {
     idxflag=0;
@@ -1640,7 +1595,6 @@
 }
 
 // ------------------------------------------------------- Closes search window
-
 function srchclose() {
   if (srch && !srch.closed) {
     srchflag=0;
@@ -1649,7 +1603,6 @@
 }
 
 // ------------------------------------------------------- Closes search window
-
 function parmclose() {
   if (parm && !parm.closed) {
     parmflag=0;
@@ -1658,7 +1611,6 @@
 }
 
 // -------------------------------------------------------- Open indexer window
-
 function idxopen(mode) {
    var options="scrollbars=1,resizable=1,menubar=0";
    idxmode=mode;
@@ -1668,7 +1620,6 @@
 }
 
 // --------------------------------------------------------- Open search window
-
 function srchopen(mode) {
    var options="scrollbars=1,resizable=1,menubar=0";
    srchmode=mode;
@@ -1678,13 +1629,11 @@
 }
 
 // -------------------------------------------- Interface function to searching
-
 function search() {
    alert("Searching not yet implemented");
 }
 
 // ------------------------------------------------------- Do srch status check
-
 function srchcheck(mode) {
    if (!srch || srch.closed || srchmode!=mode) {
       srchopen(mode);
@@ -1693,7 +1642,6 @@
 }
 
 // -------------------------------------------------------- Do idx status check
-
 function idxcheck(mode) {
    if (!idx || idx.closed || idxmode!=mode) {
       idxopen(mode);
@@ -1702,7 +1650,6 @@
 }
 
 // ---------------------------------------------------- Handles "click to edit"
-
 function handler(infostr) {
   var k;
   editmode=1;
@@ -1765,8 +1712,6 @@
          'opener.insertcondlink('+data1[1]+','+data1[3]+');'+
          'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw('
                               +');">Insert Resource Into Link</a>');
-
-
 } else {
      if (data1[0]=='r') {
        if (linkmode!=0) {
@@ -1873,7 +1818,6 @@
 }
 
 // ----------------------------------------------------- Clicks on empty fields
-
 function empty(rid,k) {
   var cid=findcol(k);
   var lcol=k-1;
@@ -1943,7 +1887,6 @@
 }
 
 // ---------------------------------------------------- Save into hidden fields
-
 function save() {
   var k;
   if (graphdef=='yes') {
@@ -2002,7 +1945,6 @@
 }
 
 // ----------------------------------------------- Reset all layout information
-
 function graphreset() {
 
    var k;
@@ -2035,7 +1977,6 @@
 }
 
 // --------------------- Compare two resources with each other for "straighten"
-
 function rescompare(a,b) {
    data1=a.split(':');
    data2=b.split(':');
@@ -2052,7 +1993,6 @@
 }
 
 // -------------------------------------------- Draw the table instead of graph
-
 function tabledraw() {
   var objsorted=new Array();
   var robjs=new Array();
@@ -2229,7 +2169,6 @@
 }
 
 // ----------------------------------------------------- Insert Resource Output
-
 function insrestab(irow,be,af,typ) {
   parent.mapout.document.writeln('<tr><td colspan=2>'+
        '<table><tr><td><a href="javascript:parent.code.insertrow('
@@ -2271,8 +2210,8 @@
   }
   parent.mapout.document.writeln('</td></tr></table></tr>');
 }
-// ---------------------------------------- Draw simple table instead of graph
 
+// ---------------------------------------- Draw simple table instead of graph
 function simpletabledraw() {
   var objsorted=new Array();
   var robjs=new Array();
@@ -2377,7 +2316,6 @@
 }
 
 // ---------------------------------- Sort objects to straighten graph or table
-
 function sortobjs() {
    message("Sorting Resources: "+funny);
    var k;
@@ -2450,12 +2388,10 @@
 }
 
 // ----------------------------------------------------------- Straighten graph
-
 function graphopt() {
   var k;
   var kj;
   var ij;
-
   var objsorted=new Array();
   condense(); 
   graphreset();
@@ -2515,7 +2451,6 @@
 }
 
 // ----------------------------------------------------------- Remove e-objects
-
 function condense() {
    message("Condensing");
    var j;
@@ -2536,7 +2471,6 @@
 }
 
 // ---------------------------------------------------- Load from hidden fields
-
 function load() {
    message("Loading");
    schedule('load');
@@ -2589,7 +2523,6 @@
 }
 
 // -------------------------------------------------------------- Parameter set
-
 function setparms(resid) {
    var options="scrollbars=1,resizable=1,menubar=0";
    parmflag=1;
@@ -2600,7 +2533,6 @@
 }
 
 // -------------------------------------------------------------- Undo function
-
 function undo() {
    if (undopointer>1) {
       undopointer--;
@@ -2616,7 +2548,6 @@
 }
 
 // -------------------------------------------------------------- Redo function
-
 function redo() {
    if (undopointer<undostack.length-1) {
       undopointer++;
@@ -2632,7 +2563,6 @@
 }
  
 // ------------------------------------------------------------ Revert function
-
 function revert() {
    if (confirm("Revert to beginning of edit session?")) {
       undopointer=2;
@@ -2641,7 +2571,6 @@
 }
 
 // ---------------------------------------------------------------- Wheelswitch
-
 function wheelswitch() {
    if (funny=='|') { 
       funny='/'; 
@@ -2659,7 +2588,6 @@
 }
 
 // --------------------------------------------- Checks if server frame defined
-
 function checkdef() {
    if (parent.flag==1) {
      srvloaded();
@@ -2668,7 +2596,6 @@
 }
 
 // ---------------------------------------------------------- The wait function
-
 function wait() {
    if ((finishdone==1) || (tim==1)) {
       if (tim==0) {
@@ -2686,7 +2613,6 @@
 }
 
 // ---------------------------------------------------------- Schedule function
-
 function schedule(action) {
    reqaction=action;
    tim=0;
@@ -2697,7 +2623,6 @@
 }
 
 // ----------------------------------------------------- launch indexer browser
-
 function groupsearch() {
    srchcheck('groupsearch');
 }
@@ -2707,7 +2632,6 @@
 }
 
 // -------------------------------------------------------------- Store changes
-
 function storechange() {
    var k;
    parent.flag=0;
@@ -2722,14 +2646,12 @@
 }
 
 // --------------------------------------- Gets called when submission finished
-
 function srvloaded() {
    finishdone=1;
    message("Server replied.");
 }
 
 // ---------------------------------------------------------------- Toggle Mode
-
 function togglemode() {
    if (tablemode==0) { 
       tablemode=1; 
@@ -2746,9 +2668,7 @@
 }
 
 // -------------------------------------------------------- Main program onLoad
-
 function main() {
-
    if (mainrun==0) {
       infopen();
       infoclear();
@@ -2756,11 +2676,9 @@
       stored=1;
       mainrun=1;
    }
-
 }
 
 // ---------------------------------------------------------- Close the window?
-
 function leave() {
    if (!inf.closed) {
       inf.close();

--matthew1014994707--