[LON-CAPA-cvs] cvs: loncom /html/adm/help/tex Authoring_Output_Tags.tex /xml scripttag.pm
www
www at source.lon-capa.org
Fri Dec 23 14:38:02 EST 2011
www Fri Dec 23 19:38:02 2011 EDT
Modified files:
/loncom/html/adm/help/tex Authoring_Output_Tags.tex
/loncom/xml scripttag.pm
Log:
Bug #5324: alternative text for window when printing
Index: loncom/html/adm/help/tex/Authoring_Output_Tags.tex
diff -u loncom/html/adm/help/tex/Authoring_Output_Tags.tex:1.15 loncom/html/adm/help/tex/Authoring_Output_Tags.tex:1.16
--- loncom/html/adm/help/tex/Authoring_Output_Tags.tex:1.15 Fri Dec 23 18:34:06 2011
+++ loncom/html/adm/help/tex/Authoring_Output_Tags.tex Fri Dec 23 19:37:57 2011
@@ -114,6 +114,7 @@
\item \textbf{width} controls the starting width of the popup window
\item \textbf{height} controls the starting height of the popup window
\item \textbf{linktext} the text that should appear as the link that causes the creation of the window
+\item \textbf{printtext} the text that should appear instead of a footnote when printed
\end{itemize}
When printing, the included text will get turned into a real footnote.
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.163 loncom/xml/scripttag.pm:1.164
--- loncom/xml/scripttag.pm:1.163 Fri Dec 23 18:34:11 2011
+++ loncom/xml/scripttag.pm Fri Dec 23 19:38:01 2011
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# <script> definiton
#
-# $Id: scripttag.pm,v 1.163 2011/12/23 18:34:11 www Exp $
+# $Id: scripttag.pm,v 1.164 2011/12/23 19:38:01 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -287,12 +287,19 @@
if ($target eq 'web' || $target eq 'webgrade') {
&Apache::lonxml::startredirection;
} elsif ($target eq 'tex') {
- $result = '\unskip\footnote{';
+ my $printtext=&Apache::lonxml::get_param('printtext',$parstack,$safeeval);
+ if ($printtext=~/\w/) {
+# If printtext is given, do not output any intervening information
+ &Apache::lonxml::startredirection;
+ } else {
+ $result = '\unskip\footnote{';
+ }
} elsif ($target eq 'edit') {
$result.=&Apache::edit::tag_start($target,$token);
$result.=&Apache::edit::text_arg('Text of Link:','linktext',$token,70);
$result.=&Apache::edit::text_arg('Height:','height',$token,5);
$result.=&Apache::edit::text_arg('Width:','width',$token,5);
+ $result.=&Apache::edit::text_arg('Printed text (optional):','printtext',$token,20);
$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
} elsif ($target eq 'modified') {
my $constructtag=&Apache::edit::get_new_args($token,$parstack,
@@ -317,7 +324,15 @@
$result=&Apache::loncommon::modal_adhoc_window
("LONCAPA_newwindow_$Apache::lonxml::curdepth",$width,$height,$output,$linktext);
} elsif ($target eq 'tex') {
- $result = '}';
+ my $printtext=&Apache::lonxml::get_param('printtext',$parstack,$safeeval);
+ if ($printtext=~/\w/) {
+# If a "printtext" is given, proceed to retrieve all intervening information and trash it
+ my $output=&Apache::lonxml::endredirection;
+# Use printtext instead
+ $result=$printtext;
+ } else {
+ $result='}';
+ }
} else {
$result = '';
}
More information about the LON-CAPA-cvs
mailing list