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

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 15 May 2002 20:44:24 -0000


matthew		Wed May 15 16:44:24 2002 EDT

  Modified files:              
    /loncom/html/res/adm/pages	menu.html 
  Log:
  Bug 227.   Again.  Handled this time by splitting the url at '.'s and 
  checking for a number near the end.  Thanks Gerd.
  
  
Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.51 loncom/html/res/adm/pages/menu.html:1.52
--- loncom/html/res/adm/pages/menu.html:1.51	Mon May 13 15:18:29 2002
+++ loncom/html/res/adm/pages/menu.html	Wed May 15 16:44:24 2002
@@ -4,7 +4,7 @@
 Remote Control
 
 //
-// $Id: menu.html,v 1.51 2002/05/13 19:18:29 matthew Exp $
+// $Id: menu.html,v 1.52 2002/05/15 20:44:24 matthew Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -206,10 +206,21 @@
    endsend();
 }
 
+function is_editable_resource (url) {
+   var Chunks = url.split('.');
+   var tmp = Chunks[Chunks.length-1];
+   if ((Chunks.length > 1) && (Math.floor(tmp) == tmp)) {
+       return true;
+   } 
+   return false;
+}
+
 function cstrgo(currenturl,defaulturl) {
    windowcheck();
    var url;
-   if (currenturl == null || currenturl == '') {
+   if ((currenturl == null) || 
+       (currenturl == '')   || 
+       (! is_editable_resource(currenturl))) {
       url = defaulturl;
    } else {
       url = currenturl;