--- loncom/xml/lonxml.pm 2007/08/17 20:34:31 1.450
+++ loncom/xml/lonxml.pm 2007/09/11 23:53:13 1.459
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.450 2007/08/17 20:34:31 albertel Exp $
+# $Id: lonxml.pm,v 1.459 2007/09/11 23:53:13 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -800,6 +800,7 @@ sub init_safespace {
$safehole->wrap(\&Math::Random::random_set_seed_from_phrase,$safeeval,'&random_set_seed_from_phrase');
$safehole->wrap(\&Math::Random::random_get_seed,$safeeval,'&random_get_seed');
$safehole->wrap(\&Math::Random::random_set_seed,$safeeval,'&random_set_seed');
+ $safehole->wrap(\&Apache::loncommon::languages,$safeeval,'&languages');
$safehole->wrap(\&Apache::lonxml::error,$safeeval,'&LONCAPA_INTERNAL_ERROR');
$safehole->wrap(\&Apache::lonxml::debug,$safeeval,'&LONCAPA_INTERNAL_DEBUG');
$safehole->wrap(\&Apache::lonnet::logthis,$safeeval,'&LONCAPA_INTERNAL_LOGTHIS');
@@ -908,6 +909,9 @@ sub endredirection {
}
pop @Apache::lonxml::outputstack;
}
+sub in_redirection {
+ return ($Apache::lonxml::redirection > 0)
+}
sub end_tag {
my ($tagstack,$parstack,$token)=@_;
@@ -1355,13 +1359,15 @@ sub inserteditinfo {
# my $editheader='Edit below
';
my $xml_help = '';
my $initialize='';
- my $add_to_onload;
- if ($filetype eq 'html') {
- my $addbuttons=&Apache::lonhtmlcommon::htmlareaaddbuttons();
- $initialize=&Apache::lonhtmlcommon::spellheader();
- if (!&Apache::lonhtmlcommon::htmlareablocked() &&
- &Apache::lonhtmlcommon::htmlareabrowser()) {
- $initialize.=(<
$addbuttons
@@ -1371,21 +1377,34 @@ $addbuttons
var editor=new HTMLArea("filecont",config);
editor.registerPlugin(FullPage);
editor.generate();
+ setTimeout(
+ function () {
+ HTMLArea._addEvents(editor._doc,
+ ["keypress","mousedown"], unClean);
+ editor._iframe.id = '$textarea_id';
+ resize_textarea('$textarea_id','LC_aftertextarea');
+ },300);
}
FULLPAGE
- } else {
- $initialize.=(<
$addbuttons
function initDocument() {
+ resize_textarea('$textarea_id','LC_aftertextarea');
}
FULLPAGE
- }
- $add_to_onload = 'initDocument();';
+ }
+
+ $add_to_onload = 'initDocument();';
+ $add_to_onresize = "resize_textarea('$textarea_id','LC_aftertextarea');";
+
+ if ($filetype eq 'html') {
$xml_help=&Apache::loncommon::helpLatexCheatsheet();
}
+
my $cleanbut = '';
my $titledisplay=&display_title();
@@ -1397,27 +1416,31 @@ FULLPAGE
my $buttons=(<
-
+
BUTTONS
$buttons.=&Apache::lonhtmlcommon::spelllink('xmledit','filecont');
+ my $textarea_events = &Apache::edit::element_change_detection();
+ my $form_events = &Apache::edit::form_change_detection();
my $editfooter=(<
-