-$addbuttons
function initDocument() {
resize_textarea('$textarea_id','LC_aftertextarea');
}
FULLPAGE
+ if ($filetype eq 'html' || $filetype eq 'tex') {
+ $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');
+ $dragmath_button = &Apache::lonhtmlcommon::dragmath_button('filecont',1);
+ }
}
$add_to_onload = 'initDocument();';
@@ -1508,38 +1630,57 @@ FULLPAGE
$xml_help=&Apache::loncommon::helpLatexCheatsheet();
}
- my $cleanbut = '';
-
my $titledisplay=&display_title();
+ my $wysiwyglink;
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',
'vi' => 'Save and View',
'dv' => 'Discard Edits and View',
'un' => 'undo',
'ed' => 'Edit');
- my $buttons=(<
-
-
-
-BUTTONS
- $buttons.=&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;
+ if ($filetype eq 'html') {
+ $htmlerror=&verify_html($filecontents);
+ if ($htmlerror) {
+ $htmlerror=''.$htmlerror.'';
+ }
+ if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+ if (&Apache::lonhtmlcommon::htmlareablocked()) {
+ $wysiwyglink = &Apache::lonhtmlcommon::enablelink($textarea_id);
+ } else {
+ $wysiwyglink = &Apache::lonhtmlcommon::disablelink($textarea_id);
+ }
+ }
+ }
my $editfooter=(<