--- loncom/xml/lonxml.pm 2023/11/28 02:39:01 1.566 +++ loncom/xml/lonxml.pm 2024/04/17 13:37:37 1.571 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.566 2023/11/28 02:39:01 raeburn Exp $ +# $Id: lonxml.pm,v 1.571 2024/04/17 13:37:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1613,8 +1613,9 @@ FULLPAGE my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit', 'vi' => 'Save and View', 'dv' => 'Discard Edits and View', - 'un' => 'undo', - 'ed' => 'Edit'); + 'un' => 'Undo', + 'ed' => 'Edit', + 'ew' => 'Edit with Daxe'); my $spelllink = &Apache::lonhtmlcommon::spelllink('xmledit','filecont'); my $textarea_events = &Apache::edit::element_change_detection(); my $form_events = &Apache::edit::form_change_detection(); @@ -1622,7 +1623,7 @@ FULLPAGE if ($filetype eq 'html') { $htmlerror=&verify_html($filecontents); if ($htmlerror) { - $htmlerror=''.$htmlerror.''; + $htmlerror=(' 'x3).' '.$htmlerror.''; } if (&Apache::lonhtmlcommon::htmlareabrowser()) { unless ($textareaclass) { @@ -1630,8 +1631,8 @@ FULLPAGE } } } - my ($undo,%onclick); - foreach my $item ('discard','undo') { + my ($undo,$daxebutton,%onclick); + foreach my $item ('discard','undo','daxe') { $onclick{$item} = 'onclick="still_ask=true;setmode(this.form,'."'$item'".')"'; } foreach my $item ('saveedit','saveview') { @@ -1642,6 +1643,13 @@ FULLPAGE $onclick{'undo'}.' />'."\n"; } $initialize .= &setmode_javascript(); + if ($filetype eq 'html') { + my %editors = &Apache::loncommon::permitted_editors(); + if ($editors{'daxe'}) { + $daxebutton = ''."\n"; + } + } my $editfooter=(< @@ -1660,7 +1668,7 @@ $initialize
- $undo $htmlerror $deps_button $dragmath_button + $undo $deps_button $daxebutton $dragmath_button $htmlerror

$spelllink @@ -1694,15 +1702,67 @@ ENDSCRIPT } sub seteditor_javascript { + my ($is_course_doc,$is_supp,$supp_path,$supp_title) = @_; + my $symb; + if ($is_course_doc) { + if (!$is_supp) { + ($symb) = &Apache::lonnet::whichuser(); + if ($symb) { + $symb = &escape($symb); + } + } + } return <<"ENDSCRIPT";