--- loncom/xml/lonxml.pm 2010/05/30 02:57:01 1.505.2.1 +++ loncom/xml/lonxml.pm 2010/08/16 17:29:11 1.505.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.505.2.1 2010/05/30 02:57:01 raeburn Exp $ +# $Id: lonxml.pm,v 1.505.2.2 2010/08/16 17:29:11 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -572,6 +572,10 @@ sub inner_xmlparse { if (($ENV{'QUERY_STRING'}) && ($target eq 'web')) { $finaloutput=&afterburn($finaloutput); } + if ($target eq 'modified') { +# if modfied, handle startpart and endpart + $finaloutput=~s/\]*\>(.*)\]*\>/$1<\/part>/gs; + } return $finaloutput; } @@ -1555,7 +1559,7 @@ sub renderingoptions { &Apache::loncommon::select_form( $env{'form.languages'}, 'languages', - &Apache::lonlocal::texthash(%langchoices)). + {&Apache::lonlocal::texthash(%langchoices)}). ''; } $output .= @@ -1564,11 +1568,11 @@ sub renderingoptions { &Apache::loncommon::select_form( $env{'form.texengine'}, 'texengine', - &Apache::lonlocal::texthash + {&Apache::lonlocal::texthash ('' => '', 'tth' => 'tth (TeX to HTML)', 'jsMath' => 'jsMath', - 'mimetex' => 'mimetex (Convert to Images)')). + 'mimetex' => 'mimetex (Convert to Images)')}). ''; return $output; } @@ -1582,47 +1586,27 @@ sub inserteditinfo { my $dragmath_button; my ($add_to_onload, $add_to_onresize); $initialize=&Apache::lonhtmlcommon::spellheader(); - if ($filetype eq 'html' - && (!&Apache::lonhtmlcommon::htmlareablocked() && - &Apache::lonhtmlcommon::htmlareabrowser())) { - $textarea_id .= '___Frame'; - my $lang = &Apache::lonhtmlcommon::htmlarea_lang(); - $initialize.=(< -lonca - function initDocument() { - var oFCKeditor = new FCKeditor('filecont'); - oFCKeditor.Config['CustomConfigurationsPath'] = '/fckeditor/loncapaconfig.js' ; - oFCKeditor.Config['FullPage'] = true - oFCKeditor.Config['AutoDetectLanguage'] = false; - oFCKeditor.Config['DefaultLanguage'] = "$lang"; - oFCKeditor.ReplaceTextarea(); - } - function check_if_dirty(editor) { - if (editor.IsDirty()) { - unClean(); - } - } - function FCKeditor_OnComplete(editor) { - editor.Events.AttachEvent("OnSelectionChange",check_if_dirty); - resize_textarea('$textarea_id','LC_aftertextarea'); - } - -FULLPAGE - } else { - $initialize.=(< 'true', + dragmath => 'math', + ); + $initialize .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); + } + $initialize .= (< +// FULLPAGE - if ($filetype eq 'html' || $filetype eq 'tex') { - $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup'); - $dragmath_button = &Apache::lonhtmlcommon::dragmath_button('filecont',1); - } + if ($filetype eq 'html') { + $dragmath_button = ''.&Apache::lonhtmlcommon::dragmath_button('filecont',1).''; + $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup'); } - $add_to_onload = 'initDocument();'; $add_to_onresize = "resize_textarea('$textarea_id','LC_aftertextarea');"; @@ -1631,13 +1615,13 @@ FULLPAGE } my $titledisplay=&display_title(); - my $wysiwyglink; + my $textareaclass; my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit', 'vi' => 'Save and View', 'dv' => 'Discard Edits and View', 'un' => 'undo', 'ed' => 'Edit'); - my $spelllink .=&Apache::lonhtmlcommon::spelllink('xmledit','filecont'); + my $spelllink = &Apache::lonhtmlcommon::spelllink('xmledit','filecont'); my $textarea_events = &Apache::edit::element_change_detection(); my $form_events = &Apache::edit::form_change_detection(); my $htmlerror; @@ -1647,11 +1631,7 @@ FULLPAGE $htmlerror=''.$htmlerror.''; } if (&Apache::lonhtmlcommon::htmlareabrowser()) { - if (&Apache::lonhtmlcommon::htmlareablocked()) { - $wysiwyglink = &Apache::lonhtmlcommon::enablelink($textarea_id); - } else { - $wysiwyglink = &Apache::lonhtmlcommon::disablelink($textarea_id); - } + $textareaclass = 'class="LC_richDetectHtml"'; } } my $editfooter=(< - $dragmath_button $spelllink $htmlerror + $htmlerror $dragmath_button
- +
$spelllink
- $wysiwyglink
$titledisplay