[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm
raeburn
raeburn at source.lon-capa.org
Sat Sep 11 10:59:37 EDT 2021
raeburn Sat Sep 11 14:59:37 2021 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface loncommon.pm
Log:
- For 2.11
Backport 1.1365
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.154 loncom/interface/loncommon.pm:1.1075.2.155
--- loncom/interface/loncommon.pm:1.1075.2.154 Sun Jun 20 17:38:14 2021
+++ loncom/interface/loncommon.pm Sat Sep 11 14:59:37 2021
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1075.2.154 2021/06/20 17:38:14 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.155 2021/09/11 14:59:37 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -8530,7 +8530,15 @@
}
sub modal_adhoc_script {
- my ($funcname,$width,$height,$content)=@_;
+ my ($funcname,$width,$height,$content,$possmathjax)=@_;
+ my $mathjax;
+ if ($possmathjax) {
+ $mathjax = <<'ENDJAX';
+ if (typeof MathJax == 'object') {
+ MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
+ }
+ENDJAX
+ }
return (<<ENDADHOC);
<script type="text/javascript">
// <![CDATA[
@@ -8541,6 +8549,7 @@
modalWindow.height = $height;
modalWindow.content = '$content';
modalWindow.open();
+ $mathjax
};
// ]]>
</script>
@@ -8548,7 +8557,7 @@
}
sub modal_adhoc_inner {
- my ($funcname,$width,$height,$content)=@_;
+ my ($funcname,$width,$height,$content,$possmathjax)=@_;
my $innerwidth=$width-20;
$content=&js_ready(
&start_page('Dialog',undef,{'only_body'=>1,'bgcolor'=>'#FFFFFF'}).
@@ -8557,12 +8566,12 @@
&end_scrollbox().
&end_page()
);
- return &modal_adhoc_script($funcname,$width,$height,$content);
+ return &modal_adhoc_script($funcname,$width,$height,$content,$possmathjax);
}
sub modal_adhoc_window {
- my ($funcname,$width,$height,$content,$linktext)=@_;
- return &modal_adhoc_inner($funcname,$width,$height,$content).
+ my ($funcname,$width,$height,$content,$linktext,$possmathjax)=@_;
+ return &modal_adhoc_inner($funcname,$width,$height,$content,$possmathjax).
"<a href=\"javascript:$funcname();void(0);\">".$linktext."</a>";
}
More information about the LON-CAPA-cvs
mailing list