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

www www at source.lon-capa.org
Thu Dec 8 20:04:27 EST 2011


www		Fri Dec  9 01:04:27 2011 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonindexer.pm lonmenu.pm 
                     	lonsearchcat.pm 
  Log:
  Fix wishlist link in lonindexer
  Eliminate some popups in favor of modal windows
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1033 loncom/interface/loncommon.pm:1.1034
--- loncom/interface/loncommon.pm:1.1033	Thu Dec  8 22:42:33 2011
+++ loncom/interface/loncommon.pm	Fri Dec  9 01:04:27 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1033 2011/12/08 22:42:33 www Exp $
+# $Id: loncommon.pm,v 1.1034 2011/12/09 01:04:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6740,6 +6740,14 @@
 	&& !$args->{'frameset'}) {
 	$result .= &help_menu_js();
         $result.=&modal_window();
+        $result.=&wishlist_window();
+    } else {
+        if ($args->{'add_modal'}) {
+           $result.=&modal_window();
+        }
+        if ($args->{'add_wishlist'}) {
+           $result.=&wishlist_window();
+        }
     }
     if (ref($args->{'redirect'})) {
 	my ($time,$url,$inhibit_continue) = @{$args->{'redirect'}};
@@ -6954,6 +6962,28 @@
     return $result;
 }
 
+sub wishlist_window {
+    return(<<'ENDWISHLIST');
+<script type="text/javascript" lang="javascript">
+// <![CDATA[
+// <!-- BEGIN LON-CAPA Internal
+function set_wishlistlink(title, path) {
+    if (!title) {
+        title = document.title;
+        title = title.replace(/^LON-CAPA /,'');
+    }
+    if (!path) {
+        path = location.pathname;
+    }
+    Win = window.open('/adm/wishlist?mode=newLink&setTitle='+title+'&setPath='+path,
+                      'wishlistNewLink','width=560,height=350,scrollbars=0');
+}
+// END LON-CAPA Internal -->
+// ]]>
+</script>
+ENDWISHLIST
+}
+
 sub modal_window {
     return(<<'ENDMODAL');
 <script type="text/javascript" lang="javascript">
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.212 loncom/interface/lonindexer.pm:1.213
--- loncom/interface/lonindexer.pm:1.212	Mon Oct 17 13:12:30 2011
+++ loncom/interface/lonindexer.pm	Fri Dec  9 01:04:27 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.212 2011/10/17 13:12:30 www Exp $
+# $Id: lonindexer.pm,v 1.213 2011/12/09 01:04:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -165,6 +165,8 @@
 ENDSUBM
        $r->print(&Apache::loncommon::start_page(undef,$js,
 						{'only_body'   =>1,
+                                                 'add_modal' => 1,
+                                                 'add_wishlist' => 1,
 						 'add_entries' =>
 						     {'onload' => "load();"},}
 						).
@@ -390,6 +392,7 @@
         }
     }
 }
+
 function openWindow(url, wdwName, w, h, toolbar,scrollbar,locationbar) {
     var xpos = (screen.width-w)/2;
     xpos = (xpos < 0) ? '0' : xpos;
@@ -401,6 +404,7 @@
     var newWin = window.open(url, wdwName, options);
     newWin.focus();
 }
+
 function gothere(val) {
     window.location=val+'?acts='+document.forms.fileattr.acts.value$inhibit_menu;
 }
@@ -413,7 +417,7 @@
         if ($env{'form.catalogmode'}) {
             # "Popup mode"
             $r->print(&Apache::loncommon::start_page('Browse published resources',$js,
-                                                     {'only_body' => 1,
+                                                     {'only_body' => 1, 'add_wishlist'=>1, 'add_modal' =>1, 
                                                       'domain' => $headerdom,}));
         } else {
             # Only display page header and breadcrumbs in non-popup mode
@@ -1089,14 +1093,10 @@
 	$r->print("<img alt=\"\" src='$iconname' class='LC_fileicon' />\n");
 	my $quotable_filelink = &Apache::loncommon::escape_single($filelink);
 
-	$r->print (" <a href=\"javascript:openWindow('".$quotable_filelink.
-		   "?inhibitmenu=yes','previewfile','450','500','no','yes','yes');\"".
-		   " target=\"_self\">$listname</a> ");
+	$r->print (" <a href=\"javascript:openMyModal('".$quotable_filelink."?inhibitmenu=yes',500,500,'yes');\">$listname</a> ");
 	$quotable_filelink = &Apache::loncommon::escape_single($filelink.'.meta');
 	&Apache::loncommon::inhibit_menu_check(\$quotable_filelink);
-	$r->print (" (<a href=\"javascript:openWindow('".$quotable_filelink.
-		   "?inhibitmenu=yes','metadatafile','500','550','no','yes','no');\" ".
-		   " target=\"_self\">".&mt('metadata')."</a>) ");
+	$r->print (" (<a href=\"javascript:openMyModal('".$quotable_filelink."?inhibitmenu=yes',500,500,'yes');\">".&mt('metadata')."</a>) ");
 # Close form to open/close sequence
 	if ($filelink=~/\.(page|sequence)$/) {
 	    $r->print('</form>');
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.364 loncom/interface/lonmenu.pm:1.365
--- loncom/interface/lonmenu.pm:1.364	Wed Nov 30 18:30:32 2011
+++ loncom/interface/lonmenu.pm	Fri Dec  9 01:04:27 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.364 2011/11/30 18:30:32 raeburn Exp $
+# $Id: lonmenu.pm,v 1.365 2011/12/09 01:04:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1230,7 +1230,7 @@
 
 
 function catalog_info() {
-   loncatinfo=window.open(window.location.pathname+'.meta',"LONcatInfo",'height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
+   openMyModal(window.location.pathname+'.meta',500,400,'yes');
 }
 
 function chat_win() {
@@ -1256,18 +1256,6 @@
    annotator.document.close();
 }
 
-function set_wishlistlink(title, path) {
-    if (!title) {
-        title = document.title;
-        title = title.replace(/^LON-CAPA /,'');
-    }
-    if (!path) {
-        path = location.pathname;
-    }
-    Win = window.open('/adm/wishlist?mode=newLink&setTitle='+title+'&setPath='+path,
-                      'wishlistNewLink','width=560,height=350,scrollbars=0');
-}
-
 function open_Wishlist_Import(rat) {
    var newWin;
    if (rat) {
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.330 loncom/interface/lonsearchcat.pm:1.331
--- loncom/interface/lonsearchcat.pm:1.330	Mon Jul  4 09:24:58 2011
+++ loncom/interface/lonsearchcat.pm	Fri Dec  9 01:04:27 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.330 2011/07/04 09:24:58 foxr Exp $
+# $Id: lonsearchcat.pm,v 1.331 2011/12/09 01:04:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3063,22 +3063,9 @@
 </script>
 SCRIPT
 
-
-    # Add JavaScript-function to set link for a ressource to wishlist
-    $js.=<<SCRIPT;
-<script type="text/javascript">
-// <![CDATA[
-function set_wishlistlink(title, path){
-       Win = window.open('/adm/wishlist?mode=newLink&setTitle='+title+'&setPath='+path,
-                            'wishlistNewLink','width=560,height=350,scrollbars=0');
-}
-
-// ]]>
-</script>
-SCRIPT
-
     my $start_page  = &Apache::loncommon::start_page(undef,$js,
-						     {'only_body' =>1});
+						     {'only_body' =>1,
+                                                      'add_wishlist' =>1});
     my $result=<<END;
 $start_page
 <form name="results" method="post" action="/adm/searchcat">




More information about the LON-CAPA-cvs mailing list