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

raeburn raeburn at source.lon-capa.org
Thu Aug 4 16:59:22 EDT 2016


raeburn		Thu Aug  4 20:59:22 2016 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm lonsearchcat.pm 
  Log:
  - Modification to change in lonsearchcat.pm rev. 1.347
    - display_url() passes onclick action in call to &lonhtmlcommon::crumbs() 
      (which now accepts an additional arg).
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.372 loncom/interface/lonhtmlcommon.pm:1.373
--- loncom/interface/lonhtmlcommon.pm:1.372	Fri Jun 10 22:31:27 2016
+++ loncom/interface/lonhtmlcommon.pm	Thu Aug  4 20:59:22 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.372 2016/06/10 22:31:27 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.373 2016/08/04 20:59:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1194,7 +1194,7 @@
 # ------------------------------------------------------- Puts directory header
 
 sub crumbs {
-    my ($uri,$target,$prefix,$form,$skiplast)=@_;
+    my ($uri,$target,$prefix,$form,$skiplast,$onclick)=@_;
 # You cannot crumbnify uploaded or adm resources
     if ($uri=~/^\/*(uploaded|adm)\//) { return &mt('(Internal Course/Group Content)'); }
     if ($target) {
@@ -1220,9 +1220,9 @@
             &Apache::loncommon::inhibit_menu_check(\$href_path);
             if ($form) {
                 my $href = 'javascript:'.$form.".action='".$href_path."';".$form.'.submit();';
-                $output.=qq{<a href="$href"$target>$dir</a>/};
+                $output.=qq{<a href="$href"$onclick$target>$dir</a>/};
             } else {
-                $output.=qq{<a href="$href_path"$target>$dir</a>/};
+                $output.=qq{<a href="$href_path"$onclick$target>$dir</a>/};
             }
         }
     } else {
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.348 loncom/interface/lonsearchcat.pm:1.349
--- loncom/interface/lonsearchcat.pm:1.348	Fri Apr 22 17:22:29 2016
+++ loncom/interface/lonsearchcat.pm	Thu Aug  4 20:59:22 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.348 2016/04/22 17:22:29 musolffc Exp $
+# $Id: lonsearchcat.pm,v 1.349 2016/08/04 20:59:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3528,17 +3528,17 @@
     } elsif ($url=~m{^(http://|/uploaded/)}) {
 	$link='<span class="LC_filename">'.$url.'</span>';
     } else {
+        # replace the links to open in a new window
+        # (because the search opens in a new window, it gets
+        # confusing when the links open a tab in the
+        # parent window; ideally we should not force windows)
+        my $onclick = " onclick=\"window.open(this.href, '_blank', 'toolbar=1,location=1,menubar=0');return false;\""; 
         $link=&Apache::lonhtmlcommon::crumbs(
                   $url,
                   'preview',
                   '',
                   '',
-                  $skiplast).' ';
-        # replace the links to open in a new window
-        # (because the search opens in a new window, it gets
-        # confusing when the links open a tab in the
-        # parent window; ideally we should not force windows)
-        $link =~ s/(href="[^"]*")/\1 onclick="window.open(this.href, '_blank', 'toolbar=1,location=1,menubar=0');return false;"/g;
+                  $skiplast,$onclick).' ';
     }
     return $link;
 }




More information about the LON-CAPA-cvs mailing list