[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages/bookmarkmenu admbookmarks.pm bookmarklib.js

www lon-capa-cvs@mail.lon-capa.org
Mon, 23 Jun 2003 19:03:34 -0000


www		Mon Jun 23 15:03:34 2003 EDT

  Modified files:              
    /loncom/html/res/adm/pages/bookmarkmenu	admbookmarks.pm 
                                           	bookmarklib.js 
  Log:
  Various small problems with
  * starting with empty screen (not good)
  * moving foldes/files (threw exception)
  
  
Index: loncom/html/res/adm/pages/bookmarkmenu/admbookmarks.pm
diff -u loncom/html/res/adm/pages/bookmarkmenu/admbookmarks.pm:1.28 loncom/html/res/adm/pages/bookmarkmenu/admbookmarks.pm:1.29
--- loncom/html/res/adm/pages/bookmarkmenu/admbookmarks.pm:1.28	Wed Dec 19 12:17:46 2001
+++ loncom/html/res/adm/pages/bookmarkmenu/admbookmarks.pm	Mon Jun 23 15:03:33 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The bookmarks handler
 #
-# $Id: admbookmarks.pm,v 1.28 2001/12/19 17:17:46 albertel Exp $
+# $Id: admbookmarks.pm,v 1.29 2003/06/23 19:03:33 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -195,7 +195,7 @@
 	      $page=add_bookmark($ENV{'form.address'},$ENV{'form.title'},$marks{'bookmarks'});
 	  } else {
 	      if ($marks{'bookmarks'} eq "") {
-		  #$marks{'bookmarks'}=defaultmarks();
+		  $marks{'bookmarks'}=defaultmarks();
 	      }
 	      $page = construct_editor($marks{'bookmarks'});
 	  }
@@ -212,19 +212,10 @@
 sub recovermarks {
     return(<<END_MARKS);
 window.tree.bookmarks.addFolder("Default Bookmarks",true);
-window.tree.bookmarks.p[0].addFolder("Michigan State University",true);
-window.tree.bookmarks.p[0].p[0].addLink("Main Website","http://www.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("College of Natural Science","http://www.ns.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("College of Engineering","http://www.egr.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("Dept. of Mathematics","http://www.math.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("Lite Lab","http://www.lite.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("Physics and Astronomy","http://www.pa.msu.edu");
-window.tree.bookmarks.p[0].addFolder("Lon-Capa",false);
-window.tree.bookmarks.p[0].p[1].addLink("Lon-Capa org","http://lon-capa.org");
-window.tree.bookmarks.p[0].p[1].addLink("Lite Lab","http://www.lite.msu.edu");
-lwindow.tree.bookmarks.p[0].addLink("Redhat","http://redhat.com");
-window.tree.bookmarks.p[0].addLink("Debian","http://debian.org");
-window.tree.bookmarks.addLink("Other Bookmarks","http://kirk.lite.msu.edu");
+window.tree.bookmarks.p[0].addFolder("LON-CAPA",true);
+window.tree.bookmarks.p[0].p[0].addLink("Main","http://www.lon-capa.org/");
+window.tree.bookmarks.p[0].p[0].addLink("Help","http://help.lon-capa.org/");
+window.tree.bookmarks.p[0].p[0].addLink("Bugs","http://bugs.lon-capa.org/");
 END_MARKS
 }
 #
@@ -239,19 +230,10 @@
 sub defaultmarks {
     return(<<END_MARKS);
 window.tree.bookmarks.addFolder("Default Bookmarks",true);
-window.tree.bookmarks.p[0].addFolder("Michigan State University",true);
-window.tree.bookmarks.p[0].p[0].addLink("Main Website","http://www.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("College of Natural Science","http://www.ns.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("College of Engineering","http://www.egr.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("Dept. of Mathematics","http://www.math.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("Lite Lab","http://www.lite.msu.edu");
-window.tree.bookmarks.p[0].p[0].addLink("Physics and Astronomy","http://www.pa.msu.edu");
-window.tree.bookmarks.p[0].addFolder("Lon-Capa",false);
-window.tree.bookmarks.p[0].p[1].addLink("Lon-Capa org","http://lon-capa.org");
-window.tree.bookmarks.p[0].p[1].addLink("Lite Lab","http://www.lite.msu.edu");
-window.tree.bookmarks.p[0].addLink("Redhat","http://redhat.com");
-window.tree.bookmarks.p[0].addLink("Debian","http://debian.org");
-window.tree.bookmarks.addLink("Other Bookmarks","http://kirk.lite.msu.edu");
+window.tree.bookmarks.p[0].addFolder("LON-CAPA",true);
+window.tree.bookmarks.p[0].p[0].addLink("Main","http://www.lon-capa.org/");
+window.tree.bookmarks.p[0].p[0].addLink("Help","http://help.lon-capa.org/");
+window.tree.bookmarks.p[0].p[0].addLink("Bugs","http://bugs.lon-capa.org/");
 END_MARKS
 }
 
Index: loncom/html/res/adm/pages/bookmarkmenu/bookmarklib.js
diff -u loncom/html/res/adm/pages/bookmarkmenu/bookmarklib.js:1.19 loncom/html/res/adm/pages/bookmarkmenu/bookmarklib.js:1.20
--- loncom/html/res/adm/pages/bookmarkmenu/bookmarklib.js:1.19	Wed Dec 19 12:21:28 2001
+++ loncom/html/res/adm/pages/bookmarkmenu/bookmarklib.js	Mon Jun 23 15:03:33 2003
@@ -1,7 +1,7 @@
 // The LearningOnline Network with CAPA
 // bookmarklib.js
 // 
-// $Id: bookmarklib.js,v 1.19 2001/12/19 17:21:28 albertel Exp $
+// $Id: bookmarklib.js,v 1.20 2003/06/23 19:03:33 www Exp $
 // 
 // Copyright Michigan State University Board of Trustees
 // 
@@ -348,7 +348,11 @@
       if (window.tree.cache.lastImg==-2) {
 	frames[7].document.images[1].src='/res/adm/pages/bookmarkmenu/folder_trash.gif';
       } else {
-	frames[4].document.images[window.tree.cache.lastImg].src=window.tree.cache.icon;
+          if (typeof(window.tree.cache.lastImg)!='undefined') {
+             if (window.tree.cache.lastImg>=0) {
+                frames[4].document.images[window.tree.cache.lastImg].src=window.tree.cache.icon;
+             }
+          }
       }
       window.tree.cache.lastImg=image_num;
       window.tree.cache.icon=this.icon;
@@ -447,7 +451,11 @@
       if (window.tree.cache.lastImg==-2) {
          frames[7].document.images[1].src='/res/adm/pages/bookmarkmenu/folder_trash.gif';
       } else {
+         if (typeof(window.tree.cache.lastImg)!='undefined') {
+            if (window.tree.cache.lastImg>=0) {
 	 frames[4].document.images[window.tree.cache.lastImg].src=window.tree.cache.icon;
+            }
+         }
       }
       window.tree.cache.lastImg=img_num;
       window.tree.cache.icon=this.icon;
@@ -528,8 +536,12 @@
 }
 
 function hoverTrash() {
-   if (window.tree.cache.isLoaded) {
-      frames[4].document.images[window.tree.cache.lastImg].src=window.tree.cache.icon;
+   if (window.tree.cache.isLoaded) {         
+      if (typeof(window.tree.cache.lastImg)!='undefined') {
+         if (window.tree.cache.lastImg>=0) {
+            frames[4].document.images[window.tree.cache.lastImg].src=window.tree.cache.icon;
+         }
+      }
       window.tree.cache.lastImg=-2;
       window.tree.cache.icon='/res/adm/pages/bookmarkmenu/folder_trash.gif';
       frames[7].document.images[1].src = '/res/adm/pages/bookmarkmenu/folder_trash_hover.gif';