--- loncom/interface/lonhtmlcommon.pm 2004/11/23 16:04:33 1.99 +++ loncom/interface/lonhtmlcommon.pm 2005/02/17 08:29:42 1.103 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.99 2004/11/23 16:04:33 matthew Exp $ +# $Id: lonhtmlcommon.pm,v 1.103 2005/02/17 08:29:42 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -80,7 +80,7 @@ sub authorbombs { foreach (keys %bombs) { if ($_=~/^$udom\/$uname\//) { return '<a href="/adm/bombs/'.$url. - '"><img src="/adm/lonMisc/bomb.gif" border="0" /></a>'. + '"><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/bomb.gif').'" border="0" /></a>'. &Apache::loncommon::help_open_topic('About_Bombs'); } } @@ -759,13 +759,14 @@ sub Create_PrgWin { $prog_state{'type'}=$type; if ($type eq 'popup') { $prog_state{'window'}='popwin'; + my $html=&Apache::lonxml::xmlbegin(); #the whole function called through timeout is due to issues #in mozilla Read BUG #2665 if you want to know the whole story &r_print($r,'<script>'. "var popwin; function openpopwin () { popwin=open(\'\',\'popwin\',\'width=400,height=100\');". - "popwin.document.writeln(\'<html><head><title>$title</title></head>". + "popwin.document.writeln(\'".$html."<head><title>$title</title></head>". "<body bgcolor=\"#88DDFF\">". "<h4>$heading</h4>". "<form name=popremain>". @@ -899,6 +900,10 @@ sub crumbs { if (! defined($size)) { $size = '+2'; } + if ($target) { + $target = ' target="'. + &Apache::loncommon::escape_single($target).'"'; + } my $output=''; unless ($noformat) { $output.='<br /><tt><b>'; } $output.='<font size="'.$size.'">'.$prefix.'/'; @@ -913,10 +918,6 @@ sub crumbs { $linkpath= qq{javascript:$form.action='$linkpath';$form.submit();}; } - if ($target) { - $target = ' target="'. - &Apache::loncommon::escape_single($target).'"'; - } $output.=qq{<a href="$linkpath" $target>$dir</a>/}; } } else { @@ -929,15 +930,15 @@ sub crumbs { # --------------------- A function that generates a window for the spellchecker sub spellheader { - my $nothing = &javascript_nothing(); + my $html=&Apache::lonxml::xmlbegin(); return (<<ENDCHECK); <script type="text/javascript"> //<!-- BEGIN LON-CAPA Internal var checkwin; function spellcheckerwindow() { - checkwin=window.open($nothing,'spellcheckwin','height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'); - checkwin.document.writeln('<html><body bgcolor="#DDDDDD"><form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /></form></body></html>'); + checkwin=window.open('/adm/rat/empty.html','spellcheckwin','height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'); + checkwin.document.writeln('$html<head></head><body bgcolor="#DDDDDD"><form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /></form></body></html>'); checkwin.document.close(); } // END LON-CAPA Internal -->