--- loncom/interface/lonhtmlcommon.pm 2004/08/17 19:09:33 1.84.2.1
+++ loncom/interface/lonhtmlcommon.pm 2004/09/10 17:58:01 1.89
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.84.2.1 2004/08/17 19:09:33 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.89 2004/09/10 17:58:01 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -117,6 +117,12 @@ sub store_recent {
time.'&'.&Apache::lonnet::escape($value) });
}
+sub remove_recent {
+ my ($area,$names)=@_;
+ my $file=&recent_filename($area);
+ return &Apache::lonnet::del($file,$names);
+}
+
sub select_recent {
my ($area,$fieldname,$event)=@_;
my %recent=&Apache::lonnet::dump(&recent_filename($area));
@@ -869,6 +875,35 @@ sub crumbs {
return $output.''.($noformat?'':'
');
}
+# --------------------- A function that generates a window for the spellchecker
+
+sub spellheader {
+ my $nothing = &javascript_nothing();
+ return (<
+// 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('');
+ checkwin.document.close();
+}
+// END LON-CAPA Internal
+
+ENDCHECK
+}
+
+# ---------------------------------- Generate link to spell checker for a field
+
+sub spelllink {
+ my ($form,$field)=@_;
+ my $linktext=&mt('Check Spelling');
+ return (<$linktext
+ENDLINK
+}
+
# ------------------------------------------------- Output headers for HTMLArea
sub htmlareaheaders {
@@ -897,14 +932,14 @@ sub htmlareaaddbuttons {
config.registerButton('ed_math','LaTeX Inline',
'/htmlarea/images/ed_math.gif',false,
function(editor,id) {
- editor.surroundHTML('\$','\$');
+ editor.surroundHTML(' \$','\$ ');
}
);
config.registerButton('ed_math_eqn','LaTeX Equation',
'/htmlarea/images/ed_math_eqn.gif',false,
function(editor,id) {
editor.surroundHTML(
- '\\\\[','\\\\]');
+ ' \\n\\\\[','\\\\]\\n ');
}
);
config.toolbar.push(['ed_math','ed_math_eqn']);