version 1.531.2.24.2.1, 2023/12/29 23:40:37
|
version 1.531.2.24.2.2, 2024/02/28 18:33:00
|
Line 1708 FULLPAGE
|
Line 1708 FULLPAGE
|
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit', |
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit', |
'vi' => 'Save and View', |
'vi' => 'Save and View', |
'dv' => 'Discard Edits and View', |
'dv' => 'Discard Edits and View', |
'un' => 'undo', |
'un' => 'Undo', |
'ed' => 'Edit'); |
'ed' => 'Edit', |
|
'ew' => 'Edit with Daxe'); |
my $spelllink = &Apache::lonhtmlcommon::spelllink('xmledit','filecont'); |
my $spelllink = &Apache::lonhtmlcommon::spelllink('xmledit','filecont'); |
my $textarea_events = &Apache::edit::element_change_detection(); |
my $textarea_events = &Apache::edit::element_change_detection(); |
my $form_events = &Apache::edit::form_change_detection(); |
my $form_events = &Apache::edit::form_change_detection(); |
Line 1717 FULLPAGE
|
Line 1718 FULLPAGE
|
if ($filetype eq 'html') { |
if ($filetype eq 'html') { |
$htmlerror=&verify_html($filecontents); |
$htmlerror=&verify_html($filecontents); |
if ($htmlerror) { |
if ($htmlerror) { |
$htmlerror='<span class="LC_error">'.$htmlerror.'</span>'; |
$htmlerror=(' 'x3).' <span class="LC_error">'.$htmlerror.'</span>'; |
} |
} |
if (&Apache::lonhtmlcommon::htmlareabrowser()) { |
if (&Apache::lonhtmlcommon::htmlareabrowser()) { |
unless ($textareaclass) { |
unless ($textareaclass) { |
Line 1725 FULLPAGE
|
Line 1726 FULLPAGE
|
} |
} |
} |
} |
} |
} |
my ($undo,%onclick); |
my ($undo,$daxebutton,%onclick); |
foreach my $item ('discard','undo','daxe') { |
foreach my $item ('discard','undo','daxe') { |
$onclick{$item} = 'onclick="still_ask=true;setmode(this.form,'."'$item'".')"'; |
$onclick{$item} = 'onclick="still_ask=true;setmode(this.form,'."'$item'".')"'; |
} |
} |
Line 1737 FULLPAGE
|
Line 1738 FULLPAGE
|
$onclick{'undo'}.' />'."\n"; |
$onclick{'undo'}.' />'."\n"; |
} |
} |
$initialize .= &setmode_javascript(); |
$initialize .= &setmode_javascript(); |
|
if ($filetype eq 'html') { |
|
my %editors = &Apache::loncommon::permitted_editors(); |
|
if ($editors{'daxe'}) { |
|
$daxebutton = '<input type="button" name="editwithdaxe" accesskey="w" value="'.$lt{'ew'}.'" '. |
|
$onclick{'daxe'}.' />'."\n"; |
|
} |
|
} |
my $editfooter=(<<ENDFOOTER); |
my $editfooter=(<<ENDFOOTER); |
$initialize |
$initialize |
<a name="editsection" /> |
<a name="editsection" /> |
Line 1755 $initialize
|
Line 1763 $initialize
|
</div> |
</div> |
<div> |
<div> |
<input type="button" name="discardview" accesskey="d" value="$lt{'dv'}" $onclick{'discard'} /> |
<input type="button" name="discardview" accesskey="d" value="$lt{'dv'}" $onclick{'discard'} /> |
$undo $htmlerror $deps_button $dragmath_button |
$undo $deps_button $daxebutton $dragmath_button $htmlerror |
</div> |
</div> |
</div> |
</div> |
<textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont" $textareaclass>$filecontents</textarea><br />$spelllink |
<textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont" $textareaclass>$filecontents</textarea><br />$spelllink |
Line 1773 sub setmode_javascript {
|
Line 1781 sub setmode_javascript {
|
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
function setmode(form,probmode) { |
function setmode(form,probmode) { |
var initial = form.problemmode.value; |
if (probmode == 'daxe') { |
form.problemmode.value = probmode; |
var url = new URL(document.location.href); |
form.submit(); |
window.location = url.protocol+'//'+url.hostname+'/daxepage'+url.pathname; |
form.problemmode.value = initial; |
} else { |
|
var initial = form.problemmode.value; |
|
form.problemmode.value = probmode; |
|
form.submit(); |
|
form.problemmode.value = initial; |
|
} |
} |
} |
// ]]> |
// ]]> |
</script> |
</script> |
Line 1788 sub seteditor_javascript {
|
Line 1801 sub seteditor_javascript {
|
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
function seteditmode(form,editor) { |
function seteditmode(form,editor) { |
form.editmode.value = editor; |
if (editor == 'daxe') { |
form.submit(); |
var url = new URL(document.location.href); |
|
window.location = url.protocol+'//'+url.hostname+'/daxepage'+url.pathname; |
|
} else { |
|
form.editmode.value = editor; |
|
form.submit(); |
|
} |
} |
} |
// ]]> |
// ]]> |
</script> |
</script> |