[LON-CAPA-cvs] cvs: modules /matthew/newrat DisplayManager.js Resource.js Sequence.js s_rat_canvas.html s_rat_file.html s_rat_info.html s_rat_menu.html

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 25 Mar 2002 15:11:41 -0000


This is a MIME encoded message

--matthew1017069101
Content-Type: text/plain

matthew		Mon Mar 25 10:11:41 2002 EDT

  Modified files:              
    /modules/matthew/newrat	DisplayManager.js Resource.js Sequence.js 
                           	s_rat_canvas.html s_rat_file.html 
                           	s_rat_info.html s_rat_menu.html 
  Log:
  Moved most of the frame source back into DisplayManager.  DisplayManager now
  tries to be an object instead of just a fuzzy idea.
  
  
--matthew1017069101
Content-Type: text/plain
Content-Disposition: attachment; filename="matthew-20020325101141.txt"

Index: modules/matthew/newrat/DisplayManager.js
diff -u modules/matthew/newrat/DisplayManager.js:1.3 modules/matthew/newrat/DisplayManager.js:1.4
--- modules/matthew/newrat/DisplayManager.js:1.3	Thu Mar 21 17:30:10 2002
+++ modules/matthew/newrat/DisplayManager.js	Mon Mar 25 10:11:40 2002
@@ -1,11 +1,11 @@
 // First attempt at getting these damned objects to display themselves
 //
-// $Id: DisplayManager.js,v 1.3 2002/03/21 22:30:10 matthew Exp $
+// $Id: DisplayManager.js,v 1.4 2002/03/25 15:11:40 matthew Exp $
 //
 // Open debugging window
 //
 
-var mainwin = window;
+var DM = window;
 
 var debugging = true;
 if (debugging) {
@@ -18,23 +18,71 @@
     }
 }   
 
-var canvas;
 output("Number of frames: "+window.frames.length);
+output("<html><head><title>Debugging Window</title></head>");
+output("<body><hr /><pre>");
 
-function redisplay(mode) {
-    canvas.open();
-    display_container(Seq,mode);
-    canvas.close();
+function DM_redisplay(mode) {
+    this.canvas.open();
+    this.display_container(Seq,mode);
+    this.canvas.close();
 }
 
-function display_container(container,mode) {
+function DM_display_container(container,mode) {
     var Results = container.draw_contents(mode);
-    canvas.writeln("<html><head></head><body><form>");
-    canvas.writeln(Results.join("\n"));
-    canvas.writeln("</form></body></html>");
+    DM.canvas.writeln("<html><head></head><body><form>");
+    DM.canvas.writeln(Results.join("\n"));
+    DM.canvas.writeln("</form></body></html>");
 }
 
-output("<html><head><title>Debugging Window</title></head>");
-output("<body><hr /><pre>");
+DM.display_container = DM_display_container;
+DM.redisplay = DM_redisplay;
+
+function DM_initcanvas() {
+    var result='';
+    result+='<head><title>Canvas Window</title></head>';
+    result+='<body>Canvas Window</body>';
+    this.canvas.writeln(result);
+}
+DM.initcanvas = DM_initcanvas;
 
+function DM_initmenu() {
+    var result='';
+    result+='<head><title>Menu Frame</title></head>';
+    result+='<body>';
+    result+='<a href="javascript:parent.DM.redisplay(\'normal\');">Normal</a>';
+    result+=' ';
+    result+='<a href="javascript:parent.DM.redisplay(\'brief\');" >Brief</a>';
+    result+=' ';
+    result+='<a href="javascript:parent.DM.redisplay(\'full\');"  >Full</a>';
+    result+=' ';
+    result+='<a href="javascript:parent.DM.redisplay(\'edit\');"  >Edit</a>';
+    result+='</body>';
+    result+='</html>';
+    this.menu.writeln(result);
+}
+DM.initmenu = DM_initmenu;
 
+function DM_initfile() {
+    var result='';
+    result+='<head>';
+    result+='<title>File Frame</title>';
+    result+='</head>';
+    result+='<body>';
+    result+='File Frame';
+    result+='</body>';
+    result+='</html>';
+    this.file.writeln(result);
+}
+DM.initfile = DM_initfile;
+
+function DM_initinfo() {
+    var result='';
+    result+='<head><title>Info Frame</title></head>';
+    result+='<body>';
+    result+='Info Frame';
+    result+='</body>';
+    result+='</html>';
+    this.info.writeln(result);
+}
+DM.initinfo = DM_initinfo;
Index: modules/matthew/newrat/Resource.js
diff -u modules/matthew/newrat/Resource.js:1.4 modules/matthew/newrat/Resource.js:1.5
--- modules/matthew/newrat/Resource.js:1.4	Thu Mar 21 17:30:10 2002
+++ modules/matthew/newrat/Resource.js	Mon Mar 25 10:11:41 2002
@@ -1,7 +1,7 @@
 // 
 // Resource.js
 //
-// $Id: Resource.js,v 1.4 2002/03/21 22:30:10 matthew Exp $
+// $Id: Resource.js,v 1.5 2002/03/25 15:11:41 matthew Exp $
 //
 // Child of Item.js
 // A Resource is a file in the lon-capa system.
@@ -29,7 +29,7 @@
         result+='<tr><td>URL:</td><td>'+this.url+'</td></tr>';
         result+='<tr><td>use:</td><td>'+this.use+'</td></tr>';
         result+='<tr><td>icon:</td><td>'+this.icon+'</td></tr>';
-        result+='</table><br \>';
+        result+='</table>';
     } else if (mode == 'full') {
         result+='<table bgcolor="'+this.get_color()+'" width="100%" >';
         result+='<tr><td><b>Resource</b></td>';
@@ -45,7 +45,7 @@
             }
         }
         result+='</td></tr>';
-        result+='</table><br \>';
+        result+='</table>';
     } else if (mode == 'edit') {
         result+='<table bgcolor="'+this.get_color()+'" width="100%" >';
         result+='<tr><td><b>Resource</b></td>';
@@ -63,7 +63,7 @@
         result+=this.owner.checkbox(this.id,'External',this.external);
         result+='</td></tr>';
         result+='<tr><td>icon:</td><td>'+this.icon+'</td></tr>';
-        result+='</table><br \>';
+        result+='</table>';
     } else {
     }
     return result;
Index: modules/matthew/newrat/Sequence.js
diff -u modules/matthew/newrat/Sequence.js:1.3 modules/matthew/newrat/Sequence.js:1.4
--- modules/matthew/newrat/Sequence.js:1.3	Thu Mar 21 17:30:10 2002
+++ modules/matthew/newrat/Sequence.js	Mon Mar 25 10:11:41 2002
@@ -1,7 +1,7 @@
 //
 // Sequence.js
 //
-// $Id: Sequence.js,v 1.3 2002/03/21 22:30:10 matthew Exp $
+// $Id: Sequence.js,v 1.4 2002/03/25 15:11:41 matthew Exp $
 //
 // Child of Container.js
 // A Sequence is a file in the lon-capa system.  A Sequence contains items.
@@ -30,24 +30,24 @@
     if (mode == 'icon') {
     } else if (mode == 'brief') {
         result+='<table width="100%">';
-        result+='<td width="1%"><img src="'+IconPath+item.icon+'" /></td>';
+        result+='<td width="1%" ><img src="'+IconPath+item.icon+'" /></td>';
         result+='<td>'+item.draw(mode)+'</td></tr>';
         result+='</table>';
     } else if (mode == 'normal') {
         result+='<table width="100%">';
-        result+='<td><img src="'+IconPath+item.icon+'" /><br />';
+        result+='<td width="1%" ><img src="'+IconPath+item.icon+'" /><br />';
         result+='<img src="'+IconPath+'meta.gif" /></td>';
         result+='<td>'+item.draw(mode)+'</td></tr>';
         result+='</table>';
     } else if (mode == 'full') {
         result+='<table width="100%">';
-        result+='<td><img src="'+IconPath+item.icon+'" /><br />';
+        result+='<td width="1%" ><img src="'+IconPath+item.icon+'" /><br />';
         result+='<img src="'+IconPath+'meta.gif" /></td>';
         result+='<td>'+item.draw(mode)+'</td></tr>';
         result+='</table>';
     } else if (mode == 'edit') {
         result+='<table width="100%">';
-        result+='<td><img src="'+IconPath+item.icon+'" /><br />';
+        result+='<td width="1%" ><img src="'+IconPath+item.icon+'" /><br />';
         result+='<img src="'+IconPath+'meta.gif" /></td>';
         result+='<td>'+item.draw(mode)+'</td></tr>';
         result+='</table>';
Index: modules/matthew/newrat/s_rat_canvas.html
diff -u modules/matthew/newrat/s_rat_canvas.html:1.1 modules/matthew/newrat/s_rat_canvas.html:1.2
--- modules/matthew/newrat/s_rat_canvas.html:1.1	Thu Mar 21 17:30:10 2002
+++ modules/matthew/newrat/s_rat_canvas.html	Mon Mar 25 10:11:41 2002
@@ -1,12 +1,6 @@
 <html>
 <script type="text/javascript" language="JavaScript">
-parent.parent.canvas = this.document;
+parent.parent.DM.canvas = this.document;
+parent.parent.DM.initcanvas();
 </script>
-<head>
-<title>Canvas Window</title>
-</head>
-<body>
-Canvas Window
-</body>
-</html>
 
Index: modules/matthew/newrat/s_rat_file.html
diff -u modules/matthew/newrat/s_rat_file.html:1.1 modules/matthew/newrat/s_rat_file.html:1.2
--- modules/matthew/newrat/s_rat_file.html:1.1	Thu Mar 21 17:30:10 2002
+++ modules/matthew/newrat/s_rat_file.html	Mon Mar 25 10:11:41 2002
@@ -1,9 +1,6 @@
 <html>
-<head>
-<title>File Frame</title>
-</head>
-<body>
-File Frame
-</body>
-</html>
+<script type="text/javascript" language="JavaScript">
+parent.parent.parent.DM.file = this.document;
+parent.parent.DM.initfile();
+</script>
 
Index: modules/matthew/newrat/s_rat_info.html
diff -u modules/matthew/newrat/s_rat_info.html:1.1 modules/matthew/newrat/s_rat_info.html:1.2
--- modules/matthew/newrat/s_rat_info.html:1.1	Thu Mar 21 17:30:10 2002
+++ modules/matthew/newrat/s_rat_info.html	Mon Mar 25 10:11:41 2002
@@ -1,7 +1,6 @@
 <html>
-<head><title>Info Frame</title></head>
-<body>
-Info Frame
-</body>
-</html>
+<script type="text/javascript" language="JavaScript">
+parent.parent.DM.info = this.document;
+parent.parent.DM.initinfo();
+</script>
 
Index: modules/matthew/newrat/s_rat_menu.html
diff -u modules/matthew/newrat/s_rat_menu.html:1.1 modules/matthew/newrat/s_rat_menu.html:1.2
--- modules/matthew/newrat/s_rat_menu.html:1.1	Thu Mar 21 17:30:10 2002
+++ modules/matthew/newrat/s_rat_menu.html	Mon Mar 25 10:11:41 2002
@@ -1,9 +1,13 @@
 <html>
-<head><title>Menu Frame</title></head>
-<body>
-<a href="javascript:parent.redisplay('normal');">Normal</a> 
-<a href="javascript:parent.redisplay('brief');" >Brief</a> 
-<a href="javascript:parent.redisplay('full');"  >Full</a> 
-<a href="javascript:parent.redisplay('edit');"  >Edit</a> 
-</body>
-</html>
+<script type="text/javascript" language="JavaScript">
+parent.parent.DM.menu = this.document;
+parent.parent.DM.initmenu();
+</script>
+
+
+
+
+
+
+
+

--matthew1017069101--