[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm /interface loncommon.pm

www www at source.lon-capa.org
Wed Dec 7 20:34:50 EST 2011


www		Thu Dec  8 01:34:50 2011 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
    /loncom/interface	loncommon.pm 
  Log:
  "Harmless" first usage of modal windows: examples for problem templates
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.331 loncom/homework/lonhomework.pm:1.332
--- loncom/homework/lonhomework.pm:1.331	Tue Nov 29 13:24:38 2011
+++ loncom/homework/lonhomework.pm	Thu Dec  8 01:34:47 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.331 2011/11/29 13:24:38 raeburn Exp $
+# $Id: lonhomework.pm,v 1.332 2011/12/08 01:34:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1125,7 +1125,7 @@
         my $filename=$file->[0];
         $filename=~s{^\Q$londocroot\E}{};
         $result.=' <span class="LC_fontsize_small">'
-                .'<a href="'.$filename.'?inhibitmenu=yes" target="sample">'.&mt('Example').'</a>'
+                .&Apache::loncommon::modal_link($filename.'?inhibitmenu=yes',&mt('Example'),600,420,'sample')
                 .'</span><br />'."\n";
         $count ++;
     }
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1030 loncom/interface/loncommon.pm:1.1031
--- loncom/interface/loncommon.pm:1.1030	Thu Dec  8 01:16:14 2011
+++ loncom/interface/loncommon.pm	Thu Dec  8 01:34:50 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1030 2011/12/08 01:16:14 www Exp $
+# $Id: loncommon.pm,v 1.1031 2011/12/08 01:34:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6985,12 +6985,12 @@
 		$(".LCmodal-overlay").click(function(){modalWindow.close();});
 	}
 };
-	var openMyModal = function(source,width,height)
+	var openMyModal = function(source,width,height,scrolling)
 	{
 		modalWindow.windowId = "myModal";
 		modalWindow.width = width;
 		modalWindow.height = height;
-		modalWindow.content = "<iframe width='"+width+"' height='"+height+"' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'>&lt/iframe>";
+		modalWindow.content = "<iframe width='"+width+"' height='"+height+"' frameborder='0' scrolling='"+scrolling+"' allowtransparency='true' src='" + source + "'>&lt/iframe>";
 		modalWindow.open();
 	};	
 // END LON-CAPA Internal -->
@@ -7000,10 +7000,12 @@
 }
 
 sub modal_link {
-    my ($link,$linktext,$width,$height,$target)=@_;
+    my ($link,$linktext,$width,$height,$target,$scrolling)=@_;
     unless ($width) { $width=480; }
     unless ($height) { $height=400; }
-    return '<a href="'.$link.'" target="'.$target.'" onclick="openMyModal(\''.$link.'\','.$width.','.$height.'); return false;">'.$linktext.'</a>';
+    unless ($scrolling) { $scrolling='yes'; }
+    return '<a href="'.$link.'" target="'.$target.'" onclick="openMyModal(\''.$link.'\','.$width.','.$height.',\''.$scrolling.'\'); return false;">'.
+           $linktext.'</a>';
 }
 
 sub html_encode {




More information about the LON-CAPA-cvs mailing list