[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm

raeburn raeburn at source.lon-capa.org
Tue Jan 8 18:40:16 EST 2019


raeburn		Tue Jan  8 23:40:16 2019 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - Bug 6400
    - "View Source" and "Info" links in inline menu functional when resource 
      is accessed via /tiny/<domain>/<uniquekey> 
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.495 loncom/interface/lonmenu.pm:1.496
--- loncom/interface/lonmenu.pm:1.495	Sun Dec 30 19:47:02 2018
+++ loncom/interface/lonmenu.pm	Tue Jan  8 23:40:16 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.495 2018/12/30 19:47:02 raeburn Exp $
+# $Id: lonmenu.pm,v 1.496 2019/01/08 23:40:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1101,7 +1101,7 @@
             unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {
 		if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/}) && ($env{'request.noversionuri'} !~ m{^/uploaded/$match_domain/$match_courseid/docs/}) && ($env{'request.noversionuri'} !~ m{^/adm/.+/ext\.tool$})) {
 		    $menuitems.=(<<ENDREALRES);
-s&6&3&catalog.png&Info&info[_1]&catalog_info('$is_mobile')&Show Metadata
+s&6&3&catalog.png&Info&info[_1]&catalog_info(currentURL,'$is_mobile')&Show Metadata
 ENDREALRES
                 }
                 unless (($env{'request.noversionuri'} =~ m{^/uploaded/$match_domain/$match_courseid/docs/}) ||
@@ -2242,11 +2242,11 @@
 
 
 
-function catalog_info(isMobile) {
+function catalog_info(url,isMobile) {
     if (isMobile == 1) {
-        openMyModal(window.location.pathname+'.meta?modal=1',500,400,'yes');
+        openMyModal(url+'.meta?modal=1',500,400,'yes');
     } else {
-        loncatinfo=window.open(window.location.pathname+'.meta',"LONcatInfo",'height=500,width=400,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
+        loncatinfo=window.open(url+'.meta',"LONcatInfo",'height=500,width=400,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
     }
 }
 
@@ -2290,8 +2290,7 @@
 }
 
 function open_source() {
-   var url = escape(window.location.pathname);
-   sourcewin=window.open('/adm/source?inhibitmenu=yes&viewonly=1&filename='+url,'LONsource',
+   sourcewin=window.open('/adm/source?inhibitmenu=yes&viewonly=1&filename='+currentURL,'LONsource',
                          'height=500,width=600,resizable=yes,location=no,menubar=no,toolbar=no,scrollbars=yes');
 }
 




More information about the LON-CAPA-cvs mailing list