[LON-CAPA-cvs] cvs: loncom /xml scripttag.pm
www
www at source.lon-capa.org
Sun Dec 18 20:49:32 EST 2011
www Mon Dec 19 01:49:32 2011 EDT
Modified files:
/loncom/xml scripttag.pm
Log:
Switch <window> to modal window.
Eliminate undocumented mimetex attribute
- not clear how that would have ever worked.
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.159 loncom/xml/scripttag.pm:1.160
--- loncom/xml/scripttag.pm:1.159 Sat Dec 10 18:11:05 2011
+++ loncom/xml/scripttag.pm Mon Dec 19 01:49:32 2011
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# <script> definiton
#
-# $Id: scripttag.pm,v 1.159 2011/12/10 18:11:05 www Exp $
+# $Id: scripttag.pm,v 1.160 2011/12/19 01:49:32 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -293,7 +293,6 @@
$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('Mime Type:','mimetype',$token,5);
$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
} elsif ($target eq 'modified') {
my $constructtag=&Apache::edit::get_new_args($token,$parstack,
@@ -310,39 +309,16 @@
my $result;
if ($target eq 'web' || $target eq 'webgrade') {
my $output=&Apache::lonxml::endredirection;
- $output =~ s/[\n\r]/ /g;
-# $output = &HTML::Entities::encode($output,'<>&"\'');
- $output =~ s/\'/\\\'/g;
my $linktext= &Apache::lonxml::get_param('linktext',$parstack,$safeeval);
if (!$linktext) { $linktext='<sup>*</sup>'; }
my $width= &Apache::lonxml::get_param('width',$parstack,$safeeval);
if (!$width) { $width='500'; }
my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);
if (!$height) { $height='200'; }
- my $mimetype= &Apache::lonxml::get_param('mimetype',$parstack,$safeeval)
- || 'text/html';
my ($start_page,$end_page);
- if ($mimetype eq 'text/html') {
- $start_page =
- &Apache::loncommon::start_page($linktext, undef,
- {'only_body' => 1,
- 'bgcolor' => '#FFFFFF',
- 'js_ready' => 1,});
- $end_page =
- &Apache::loncommon::end_page({'js_ready' => 1,});
- }
- $result = "<script type=\"text/javascript\">
-//<!--
- function LONCAPA_newwindow_$Apache::lonxml::curdepth() {
-newWindow=open(".&Apache::lonhtmlcommon::javascript_nothing().",'new_W');
-newWindow.close();
-newWindow=open(".&Apache::lonhtmlcommon::javascript_nothing().",'new_W','width=$width,height=$height,scrollbars=1');
-newWindow.".&Apache::lonhtmlcommon::javascript_docopen($mimetype).";
-newWindow.document.writeln('$start_page $output $end_page');
-newWindow.document.close();}
-//-->
-</script><a href=\"javascript:LONCAPA_newwindow_$Apache::lonxml::curdepth();void(0);\">$linktext</a>";
+ $result=&Apache::loncommon::modal_adhoc_window
+ ("LONCAPA_newwindow_$Apache::lonxml::curdepth",$width,$height,$output,$linktext);
} elsif ($target eq 'tex') {
$result = '}';
} else {
More information about the LON-CAPA-cvs
mailing list