version 1.98, 2005/12/15 23:20:55
|
version 1.101, 2006/04/18 22:36:23
|
Line 504 sub js_change_detection {
|
Line 504 sub js_change_detection {
|
<script type="text/javascript"> |
<script type="text/javascript"> |
var clean = true; |
var clean = true; |
var is_submit = false; |
var is_submit = false; |
|
var still_ask = false; |
function compareForm(event_) { |
function compareForm(event_) { |
if (!event_ && window.event) { |
if (!event_ && window.event) { |
event_ = window.event; |
event_ = window.event; |
} |
} |
if (!is_submit && !clean) { |
if ((!is_submit || (is_submit && still_ask)) && !clean) { |
|
still_ask = false; |
|
is_submit = false; |
event_.returnValue = "$unsaved"; |
event_.returnValue = "$unsaved"; |
return "$unsaved"; |
return "$unsaved"; |
} |
} |
Line 529 sub element_change_detection {
|
Line 532 sub element_change_detection {
|
return ' onchange="unClean();" '; |
return ' onchange="unClean();" '; |
} |
} |
|
|
|
sub submit_ask_anyway { |
|
return ' onclick="still_ask=true;" '; |
|
} |
|
|
sub textarea_sizes { |
sub textarea_sizes { |
my ($data)=@_; |
my ($data)=@_; |
my $count=0; |
my $count=0; |
Line 570 sub editfield {
|
Line 577 sub editfield {
|
if ($rows < $minheight) { $rows = $minheight; } |
if ($rows < $minheight) { $rows = $minheight; } |
if ($description) { $description="<br />".$description."<br />"; } |
if ($description) { $description="<br />".$description."<br />"; } |
if ($usehtmlarea) { |
if ($usehtmlarea) { |
push @Apache::lonxml::htmlareafields,'homework_edit_'. |
&Apache::lonhtmlcommon::add_htmlareafields('homework_edit_'. |
$Apache::lonxml::curdepth; |
$Apache::lonxml::curdepth); |
} |
} |
return $description."\n".' <textarea style="width:100%" rows="'.$rows. |
return $description."\n".' <textarea style="width:100%" rows="'.$rows. |
'" cols="'.$cols.'" name="homework_edit_'. |
'" cols="'.$cols.'" name="homework_edit_'. |
Line 676 sub checked_arg {
|
Line 683 sub checked_arg {
|
$text=$option; |
$text=$option; |
$value='value="'.$option.'"'; |
$value='value="'.$option.'"'; |
} |
} |
$result.="<nobr><input type='checkbox' $value name='". |
$result.="<nobr><label><input type='checkbox' $value name='". |
&html_element_name($name)."'"; |
&html_element_name($name)."'"; |
foreach my $selected (split(/,/,$allselected)) { |
foreach my $selected (split(/,/,$allselected)) { |
if ( $selected eq $option ) { |
if ( $selected eq $option ) { |
Line 684 sub checked_arg {
|
Line 691 sub checked_arg {
|
last; |
last; |
} |
} |
} |
} |
$result.=&element_change_detection()." />$text</nobr>\n"; |
$result.=&element_change_detection()." />$text</label></nobr>\n"; |
} |
} |
return $result; |
return $result; |
} |
} |