[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages menu.html

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 05 Apr 2002 18:47:42 -0000


matthew		Fri Apr  5 13:47:42 2002 EDT

  Modified files:              
    /loncom/html/res/adm/pages	menu.html 
  Log:
  Minor logic cleanup.
  
  
Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.47 loncom/html/res/adm/pages/menu.html:1.48
--- loncom/html/res/adm/pages/menu.html:1.47	Thu Apr  4 12:35:57 2002
+++ loncom/html/res/adm/pages/menu.html	Fri Apr  5 13:47:42 2002
@@ -4,7 +4,7 @@
 Remote Control
 
 //
-// $Id: menu.html,v 1.47 2002/04/04 17:35:57 matthew Exp $
+// $Id: menu.html,v 1.48 2002/04/05 18:47:42 matthew Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -201,18 +201,17 @@
 function cstrgo(currenturl,defaulturl) {
    windowcheck();
    var url;
-   if (currenturl != null && currenturl != '') {
+   if (currenturl == null || currenturl == '') {
+      url = defaulturl;
+   } else {
       url = currenturl;
-      var priv_pattern  = /^\/priv/;
-      var tilda_pattern = /^\/~/;
-      if (priv_pattern.test(url) || tilda_pattern.test(url)) {
-         url = defaulturl;
-      } else {
-         // map /res/103/turtle -> /priv/turtle
+      var res_pattern     = /^\/res\/[A-z0-p]+\//;
+      if (res_pattern.test(url)) {
+         // map /res/103/turtle to /priv/turtle
          url = url.replace(/^\/res\/[A-z0-9]+\//,'/priv/');
+      } else {
+         url = defaulturl;
       }
-   } else {
-      url = defaulturl;
    }
    this.document['led'].src="ledsend.gif";
    if (url != '') {