[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm lonspeller.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 21 Mar 2006 20:19:42 -0000
albertel Tue Mar 21 15:19:42 2006 EDT
Modified files:
/loncom/interface lonhtmlcommon.pm lonspeller.pm
Log:
- start_page speller windows
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.122 loncom/interface/lonhtmlcommon.pm:1.123
--- loncom/interface/lonhtmlcommon.pm:1.122 Tue Mar 21 13:39:02 2006
+++ loncom/interface/lonhtmlcommon.pm Tue Mar 21 15:19:41 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.122 2006/03/21 18:39:02 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.123 2006/03/21 20:19:41 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -979,7 +979,14 @@
# --------------------- A function that generates a window for the spellchecker
sub spellheader {
- my $html=&Apache::lonxml::xmlbegin();
+ my $start_page=
+ &Apache::loncommon::start_page('Speller Suggestions',undef,
+ {'only_body' => 1,
+ 'js_ready' => 1,
+ 'bgcolor' => '#DDDDDD',});
+ my $end_page=
+ &Apache::loncommon::end_page({'js_ready' => 1});
+
my $nothing=&javascript_nothing();
return (<<ENDCHECK);
<script type="text/javascript">
@@ -988,7 +995,7 @@
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<head></head><body bgcolor="#DDDDDD"><form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /></form></body></html>');
+ checkwin.document.writeln('$start_page<form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /></form>$end_page');
checkwin.document.close();
}
// END LON-CAPA Internal -->
Index: loncom/interface/lonspeller.pm
diff -u loncom/interface/lonspeller.pm:1.12 loncom/interface/lonspeller.pm:1.13
--- loncom/interface/lonspeller.pm:1.12 Wed Mar 15 14:41:26 2006
+++ loncom/interface/lonspeller.pm Tue Mar 21 15:19:41 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Interface routines for Aspell
#
-# $Id: lonspeller.pm,v 1.12 2006/03/15 19:41:26 albertel Exp $
+# $Id: lonspeller.pm,v 1.13 2006/03/21 20:19:41 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -66,12 +66,18 @@
my $suggestions=join(' ',$speller->suggest($word));
$suggestions=~s/\'/\\\'/gs;
if (($suggestions) && (!$insidelink)) {
- my $html=&Apache::lonxml::xmlbegin('encode');
+ my $start_page=
+ &Apache::loncommon::start_page('Speller Suggestions',undef,
+ {'only_body' => 1,
+ 'js_ready' => 1,
+ 'bgcolor' => '#FFFFFF'});
+ my $end_page=
+ &Apache::loncommon::end_page({'js_ready' => 1});
$output.='<a href="javascript:spellwin=window.open('.
&Apache::lonhtmlcommon::javascript_nothing().
',\'spellwin\',\'height=140,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no\');'.
- 'spellwin.'.&Apache::lonhtmlcommon::javascript_docopen().';spellwin.document.writeln(\''.$html.'<head></head><body><h3>'.$word.
- '</h3>'.$suggestions.'</body></html>\');spellwin.document.close();spellwin.focus()">';
+ 'spellwin.'.&Apache::lonhtmlcommon::javascript_docopen().';spellwin.document.writeln(\''.$start_page.'<h3>'.$word.
+ '</h3>'.$suggestions.$end_page.'\');spellwin.document.close();spellwin.focus()">';
}
$output.='<font color="red">'.$word.'</font>';
if (($suggestions) && (!$insidelink)) { $output.='</a>'; }