version 1.9, 2016/01/26 14:30:25
|
version 1.13, 2016/11/29 16:03:03
|
Line 259 sub process_changes {
|
Line 259 sub process_changes {
|
sub update_exttool { |
sub update_exttool { |
my ($marker,$cdom,$cnum,$args) = @_; |
my ($marker,$cdom,$cnum,$args) = @_; |
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
my (%newhash,$changed,$errormsg); |
my (%newhash,$changed,@deleted,$errormsg); |
($newhash{'target'},$newhash{'width'},$newhash{'height'}) = split(/:/,$args); |
($newhash{'target'},$newhash{'width'},$newhash{'height'},$newhash{'crslabel'},$newhash{'crstitle'}) = split(/:/,$args); |
|
$newhash{'crslabel'} = &unescape($newhash{'crslabel'}); |
|
$newhash{'crstitle'} = &unescape($newhash{'crstitle'}); |
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
foreach my $item ('target','width','height') { |
foreach my $item ('target','width','height','crslabel','crstitle') { |
$newhash{$item} =~ s/^\s+//; |
$newhash{$item} =~ s/^\s+//; |
$newhash{$item} =~ s/\s+$//; |
$newhash{$item} =~ s/\s+$//; |
unless ($item eq 'target') { |
if (($item eq 'width') || ($item eq 'height')) { |
if ($newhash{'target'} eq 'iframe') { |
if ($newhash{'target'} eq 'iframe') { |
$newhash{$item} = ''; |
$newhash{$item} = ''; |
} |
} |
} |
} |
if ($toolhash{$item} ne $newhash{$item}) { |
if ($toolhash{$item} ne $newhash{$item}) { |
if ($newhash{$item} eq '') { |
if ($newhash{$item} eq '') { |
delete($toolhash{$item}); |
unless (($item eq 'target') || |
|
((($item eq 'width') || ($item eq 'height')) && |
|
(($newhash{'target'} eq 'window') || |
|
(($newhash{'target'} eq '') && ($toolhash{'target'} eq 'window'))))) { |
|
delete($toolhash{$item}); |
|
push(@deleted,$item); |
|
$changed = 1; |
|
} |
} else { |
} else { |
$toolhash{$item} = $newhash{$item}; |
$toolhash{$item} = $newhash{$item}; |
|
$changed = 1; |
} |
} |
$changed = 1; |
|
} |
} |
} |
} |
if ($changed) { |
if ($changed) { |
my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$cdom,$cnum); |
my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$cdom,$cnum); |
unless ($putres eq 'ok') { |
unless ($putres eq 'ok') { |
$errormsg = &mt('Failed to save updated settings.').' '.&mt('Error: [_1].',$putres); |
$errormsg = &mt('Failed to save updated settings.').' '.&mt('Error: [_1].',$putres); |
} |
} |
} |
} |
|
if (@deleted) { |
|
&Apache::lonnet::del('exttool_'.$marker,\@deleted,$cdom,$cnum); |
|
} |
return ($changed,$errormsg); |
return ($changed,$errormsg); |
} |
} |
|
|
sub extedit_form { |
sub extedit_form { |
my ($supplementalflag,$residx,$orig_url,$orig_title,$pathitem,$helpitem,$caller, |
my ($supplementalflag,$residx,$orig_url,$orig_title,$pathitem,$helpitem,$caller, |
$symb,$type,$cdom,$cnum,$ltitools) = @_; |
$symb,$type,$cdom,$cnum,$ltitools,$disabled) = @_; |
if ($type ne 'tool') { |
if ($type ne 'tool') { |
$type = 'ext'; |
$type = 'ext'; |
} |
} |
Line 313 sub extedit_form {
|
Line 325 sub extedit_form {
|
$tabid = 'ee'; |
$tabid = 'ee'; |
} |
} |
my ($formname,$formid,$toggle,$fieldsetid,$urlid,$dispdivstyle,$dimendivstyle, |
my ($formname,$formid,$toggle,$fieldsetid,$urlid,$dispdivstyle,$dimendivstyle, |
$legend,$urlelem,$toolelem,%toolattr); |
$labelstyle,$titlestyle,$legend,$urlelem,$toolelem,%toolattr); |
$formname = 'new'.$type; |
$formname = 'new'.$type; |
$toggle = $type; |
$toggle = $type; |
$fieldsetid = 'upload'.$type.'form'; |
$fieldsetid = 'upload'.$type.'form'; |
$urlid = $type.'url'; |
$urlid = $type.'url'; |
map { $toolattr{$_} = $type.$_; } ('dispdiv','dimendiv','dimenwidth','dimenheight'); |
map { $toolattr{$_} = $type.$_; } ('dispdiv','dimendiv','dimenwidth','dimenheight', |
|
'crstitlediv','crslabeldiv','crstitle','crslabel'); |
$dispdivstyle = 'display:none'; |
$dispdivstyle = 'display:none'; |
$dimendivstyle = 'display:none'; |
$dimendivstyle = 'display:none'; |
|
$labelstyle = 'display:none'; |
|
$titlestyle = 'display:none'; |
if ($supplementalflag) { |
if ($supplementalflag) { |
$formname = 'newsupp'.$type; |
$formname = 'newsupp'.$type; |
$toggle = 'supp'.$type; |
$toggle = 'supp'.$type; |
Line 328 sub extedit_form {
|
Line 343 sub extedit_form {
|
$urlid = 'supp'.$type.'url'; |
$urlid = 'supp'.$type.'url'; |
map { $toolattr{$_} = 'supp'.$toolattr{$_}; } (keys(%toolattr)); |
map { $toolattr{$_} = 'supp'.$toolattr{$_}; } (keys(%toolattr)); |
} |
} |
my ($link,$legend,$active,$srcclass,$extsrc,$preview,$title,$save, |
my ($link,$legend,$active,$srcclass,$extsrc,$preview,$title,$save,$crstitle,$crslabel, |
$fieldsetstyle,$action,$hiddenelem,$form,$width,$height,$tooltarget,%chkstate); |
$fieldsetstyle,$action,$hiddenelem,$form,$width,$height,$tooltarget,%chkstate); |
$fieldsetstyle = 'display: none;'; |
$fieldsetstyle = 'display: none;'; |
$action = '/adm/coursedocs'; |
$action = '/adm/coursedocs'; |
Line 384 sub extedit_form {
|
Line 399 sub extedit_form {
|
$orig_url = 'http://'; |
$orig_url = 'http://'; |
$orig_title = $lt{'ex'}; |
$orig_title = $lt{'ex'}; |
$extsrc = $lt{'ul'}.':<br />'; |
$extsrc = $lt{'ul'}.':<br />'; |
$preview = '<input type="button" name="view" value="'.$lt{'pr'}.'" onclick="javascript:extUrlPreview('."'$urlid'".');" />'; |
$preview = '<input type="button" name="view" value="'.$lt{'pr'}.'" onclick="javascript:extUrlPreview('."'$urlid'".');"'.$disabled.' />'; |
$save = $lt{'al'}; |
$save = $lt{'al'}; |
} else { |
} else { |
$orig_title = $lt{'et'}; |
$orig_title = $lt{'et'}; |
Line 395 sub extedit_form {
|
Line 410 sub extedit_form {
|
} |
} |
$formid = $formname; |
$formid = $formname; |
if ($type eq 'ext') { |
if ($type eq 'ext') { |
$urlelem = '<input type="text" size="'.$size.'" name="exturl" id="'.$urlid.'" value="'.$orig_url.'" />'; |
$urlelem = '<input type="text" size="'.$size.'" name="exturl" id="'.$urlid.'" value="'.$orig_url.'"'.$disabled.' />'; |
} else { |
} else { |
my $class = 'LC_nobreak'; |
my $class = 'LC_nobreak'; |
if ($residx) { |
if ($residx) { |
Line 404 sub extedit_form {
|
Line 419 sub extedit_form {
|
my $marker = $1; |
my $marker = $1; |
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
if ($toolhash{'id'}) { |
if ($toolhash{'id'}) { |
$dispdivstyle = 'display:block'; |
|
if (ref($ltitools) eq 'HASH') { |
if (ref($ltitools) eq 'HASH') { |
if (keys(%{$ltitools})) { |
if (keys(%{$ltitools})) { |
if (ref($ltitools->{$toolhash{'id'}}) eq 'HASH') { |
if (ref($ltitools->{$toolhash{'id'}}) eq 'HASH') { |
Line 423 sub extedit_form {
|
Line 437 sub extedit_form {
|
} |
} |
$width = $toolhash{'width'}; |
$width = $toolhash{'width'}; |
$height = $toolhash{'height'}; |
$height = $toolhash{'height'}; |
|
if (ref($ltitools->{$toolhash{'id'}}->{'crsconf'}) eq 'HASH') { |
|
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'title'}) { |
|
$crstitle = $toolhash{'crstitle'}; |
|
$titlestyle = 'display:inline'; |
|
} |
|
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'label'}) { |
|
$crslabel = $toolhash{'crslabel'}; |
|
$labelstyle = 'display:inline'; |
|
} |
|
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'target'}) { |
|
$dispdivstyle = 'display:block'; |
|
} |
|
} |
$toolelem = '<span class="LC_nobreak">'.$image.' '.$tooltitle.'</span><br />'; |
$toolelem = '<span class="LC_nobreak">'.$image.' '.$tooltitle.'</span><br />'; |
} |
} |
} |
} |
Line 432 sub extedit_form {
|
Line 459 sub extedit_form {
|
} else { |
} else { |
$toolelem = '<span class="LC_docs_ext_edit">'."\n". |
$toolelem = '<span class="LC_docs_ext_edit">'."\n". |
'<select name="exttoolid" id="LC_exttoolid" onchange="javascript:updateExttool(this,'. |
'<select name="exttoolid" id="LC_exttoolid" onchange="javascript:updateExttool(this,'. |
'this.form,'."'$supplementalflag'".');">'."\n". |
'this.form,'."'$supplementalflag'".');"'.$disabled.'>'."\n". |
'<option value="" selected="selected">'.&mt('Select').'</option>'; |
'<option value="" selected="selected">'.&mt('Select').'</option>'; |
my %bynum; |
my %bynum; |
if (ref($ltitools) eq 'HASH') { |
if (ref($ltitools) eq 'HASH') { |
Line 452 sub extedit_form {
|
Line 479 sub extedit_form {
|
} |
} |
} |
} |
} |
} |
$toolelem .= '</select></span>'; |
$toolelem .= '</select></span><br />'; |
|
$crslabel = $env{'course.'.$cdom.'_'.$cnum.'.internal.coursecode'}; |
|
$crstitle = $env{'course.'.$cdom.'_'.$cnum.'.description'}; |
} |
} |
$toolelem .= '<div id="'.$toolattr{'dispdiv'}.'" style="'.$dispdivstyle.'">'. |
$toolelem .= '<div id="'.$toolattr{'dispdiv'}.'" style="'.$dispdivstyle.'">'. |
'<span class="'.$class.'">'.&mt('Display target:').' '. |
'<span class="'.$class.'">'.&mt('Display target:').' '. |
'<label><input type="radio" name="exttooltarget" value="iframe" '.$chkstate{'iframe'}.'onclick="updateTooldim(this.form,'. |
'<label><input type="radio" name="exttooltarget" value="iframe" '.$chkstate{'iframe'}.'onclick="updateTooldim(this.form,'. |
"'$toolattr{dimendiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}'".');">'.&mt('iframe').'</label>'.(' 'x2). |
"'$toolattr{dimendiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}'".');"'.$disabled.'>'.&mt('iframe').'</label>'.(' 'x2). |
'<label><input type="radio" name="exttooltarget" value="window" '.$chkstate{'window'}.'onclick="updateTooldim(this.form,'. |
'<label><input type="radio" name="exttooltarget" value="window" '.$chkstate{'window'}.'onclick="updateTooldim(this.form,'. |
"'$toolattr{dimendiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}'".');">'.&mt('window').'</label>'. |
"'$toolattr{dimendiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}'".');"'.$disabled.'>'.&mt('window').'</label>'. |
'</span><div id="'.$toolattr{'dimendiv'}.'" style="'.$dimendivstyle.'">'. |
'</span><div id="'.$toolattr{'dimendiv'}.'" style="'.$dimendivstyle.'">'. |
'<span class="'.$class.'">'. |
'<span class="'.$class.'">'. |
&mt('Width').'<input type="text" id="'.$toolattr{'dimenwidth'}.'" name="exttoolwidth" value="'.$width.'">'.(' 'x2). |
&mt('Width').'<input type="text" id="'.$toolattr{'dimenwidth'}.'" name="exttoolwidth" value="'.$width.'"'.$disabled.'>'.(' 'x2). |
&mt('Height').'<input type="text" id="'.$toolattr{'dimenheight'}.'" name="exttoolheight" value="'.$height.'"></span>'."\n". |
&mt('Height').'<input type="text" id="'.$toolattr{'dimenheight'}.'" name="exttoolheight" value="'.$height.'"'.$disabled.'></span>'."\n". |
'</div></div>'; |
'</div></div>'. |
|
'<div id="'.$toolattr{'crslabeldiv'}.'" style="'.$labelstyle.'">'. |
|
'<span class="'.$class.'">'.&mt('Course label:').' '. |
|
'<input type="text" id="'.$toolattr{'crslabel'}.'" name="exttoollabel" value="'.$crslabel.'"'.$disabled.'><br />'. |
|
'</div>'. |
|
'<div id="'.$toolattr{'crstitlediv'}.'" style="'.$titlestyle.'">'. |
|
'<span class="'.$class.'">'.&mt('Course title:').' '. |
|
'<input type="text" id="'.$toolattr{'crstitle'}.'" name="exttooltitle" value="'.$crstitle.'"'.$disabled.'><br />'. |
|
'</div>'; |
} |
} |
my $chooser = $toolelem; |
my $chooser = $toolelem; |
if ($type eq 'ext') { |
if ($type eq 'ext') { |
Line 487 $chooser
|
Line 524 $chooser
|
<div> |
<div> |
<span$srcclass> |
<span$srcclass> |
$title |
$title |
<input type="text" size="$size" name="exttitle" value="$orig_title" /> |
<input type="text" size="$size" name="exttitle" value="$orig_title" $disabled /> |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
$pathitem |
$pathitem |
$hiddenelem |
$hiddenelem |
<input type="button" value="$save" onclick="javascript:setExternal(this.form,'$residx','$type','$orig_url');" /> |
<input type="button" value="$save" onclick="javascript:setExternal(this.form,'$residx','$type','$orig_url','$supplementalflag');" $disabled /> |
</span> |
</span> |
</div> |
</div> |
</fieldset> |
</fieldset> |
Line 506 ENDFORM
|
Line 543 ENDFORM
|
|
|
sub display_editor { |
sub display_editor { |
my ($url,$folderpath,$symb,$idx,$type,$cdom,$cnum) = @_; |
my ($url,$folderpath,$symb,$idx,$type,$cdom,$cnum) = @_; |
my ($residx,$supplementalflag,$title,$pathitem,$output,$js); |
my ($residx,$supplementalflag,$title,$pathitem,$output,$js,$navmap); |
if ($folderpath =~ /^supplemental/) { |
if ($folderpath =~ /^supplemental/) { |
$supplementalflag = 1; |
$supplementalflag = 1; |
$residx = $idx; |
$residx = $idx; |
Line 516 sub display_editor {
|
Line 553 sub display_editor {
|
(my $map,$residx,my $res) = |
(my $map,$residx,my $res) = |
&Apache::lonnet::decode_symb($symb); |
&Apache::lonnet::decode_symb($symb); |
$title = &Apache::lonnet::gettitle($symb); |
$title = &Apache::lonnet::gettitle($symb); |
my $path = &Apache::loncommon::symb_to_docspath($symb); |
my $path = &Apache::loncommon::symb_to_docspath($symb,\$navmap); |
$pathitem = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($path,'<>&"').'" />'; |
$pathitem = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($path,'<>&"').'" />'; |
} |
} |
my %ltitools; |
my %ltitools; |
Line 545 sub extedit_javascript {
|
Line 582 sub extedit_javascript {
|
$toolsjs = " var ltitools = new Array($num);\n". |
$toolsjs = " var ltitools = new Array($num);\n". |
" var ltitoolsTarget = new Array($num);\n". |
" var ltitoolsTarget = new Array($num);\n". |
" var ltitoolsWidth = new Array($num);\n". |
" var ltitoolsWidth = new Array($num);\n". |
" var ltitoolsHeight = new Array($num);\n"; |
" var ltitoolsHeight = new Array($num);\n". |
|
" var ltitoolsDisplay = new Array($num);\n". |
|
" var ltitoolsLabel = new Array($num);\n". |
|
" var ltitoolsTitle = new Array($num);\n"; |
my $i = 0; |
my $i = 0; |
foreach my $key (sort { $a <=> $b } keys(%{$toolsref})) { |
foreach my $key (sort { $a <=> $b } keys(%{$toolsref})) { |
if (ref($toolsref->{$key})) { |
if (ref($toolsref->{$key})) { |
Line 556 sub extedit_javascript {
|
Line 596 sub extedit_javascript {
|
' ltitoolsTarget['.$i.'] = '."'$target';\n". |
' ltitoolsTarget['.$i.'] = '."'$target';\n". |
' ltitoolsWidth['.$i.'] = '."'$width';\n". |
' ltitoolsWidth['.$i.'] = '."'$width';\n". |
' ltitoolsHeight['.$i.'] = '."'$height';\n"; |
' ltitoolsHeight['.$i.'] = '."'$height';\n"; |
|
my %courseconfig; |
|
if (ref($toolsref->{$key}->{'crsconf'}) eq 'HASH') { |
|
my $display = $toolsref->{$key}->{'crsconf'}->{'target'}; |
|
$toolsjs .= ' ltitoolsDisplay['.$i.'] = '."'$display';\n"; |
|
my $label = $toolsref->{$key}->{'crsconf'}->{'label'}; |
|
$toolsjs .= ' ltitoolsLabel['.$i.'] = '."'$label';\n"; |
|
my $title = $toolsref->{$key}->{'crsconf'}->{'title'}; |
|
$toolsjs .= ' ltitoolsTitle['.$i.'] = '."'$title';\n"; |
|
} |
$i++; |
$i++; |
} |
} |
} |
} |
Line 575 ENDREGEXP
|
Line 624 ENDREGEXP
|
|
|
var regexp = $urlregexp; |
var regexp = $urlregexp; |
|
|
function setExternal(extform,residx,type,exttoolurl) { |
function setExternal(extform,residx,type,exttoolurl,supplementalflag) { |
var title=extform.exttitle.value; |
var title=extform.exttitle.value; |
if (!String.trim) { |
if (!String.trim) { |
String.prototype.trim = function() {return this.replace(\/^\\s+|\\s+$\/g, "");}; } |
String.prototype.trim = function() {return this.replace(\/^\\s+|\\s+$\/g, "");}; } |
Line 610 function setExternal(extform,residx,type
|
Line 659 function setExternal(extform,residx,type
|
} |
} |
info += ':'+toolid; |
info += ':'+toolid; |
} |
} |
if (extform.exttooltarget.length) { |
var prefix = ''; |
for (var i=0; i<extform.exttooltarget.length; i++) { |
if (supplementalflag == 1) { |
if (extform.exttooltarget[i].checked) { |
prefix = 'supp'; |
if (extform.exttooltarget[i].value == 'window') { |
} |
var width = extform.exttoolwidth.value; |
var dispdiv = prefix+'tooldispdiv'; |
width.trim(); |
if (residx > 0) { |
var height = extform.exttoolheight.value; |
dispdiv += '_'+residx; |
height.trim(); |
} |
info += ':window:'+width+':'+height; |
if (document.getElementById(dispdiv)) { |
} else { |
if (document.getElementById(dispdiv).style.display == 'block') { |
info += ':iframe'; |
if (extform.exttooltarget.length) { |
|
for (var i=0; i<extform.exttooltarget.length; i++) { |
|
if (extform.exttooltarget[i].checked) { |
|
if (extform.exttooltarget[i].value == 'window') { |
|
var width = extform.exttoolwidth.value; |
|
width.trim(); |
|
var height = extform.exttoolheight.value; |
|
height.trim(); |
|
info += ':window:'+width+':'+height; |
|
} else { |
|
info += ':iframe::'; |
|
} |
|
} |
} |
} |
} |
} |
|
} else { |
|
info += ':::'; |
} |
} |
|
} else { |
|
info += ':::'; |
|
} |
|
var labelinput = prefix+'toolcrslabel'; |
|
var titleinput = prefix+'toolcrstitle'; |
|
if (residx > 0) { |
|
labelinput += '_'+residx; |
|
titleinput += '_'+residx; |
|
} |
|
if (document.getElementById(labelinput)) { |
|
var crslabel = document.getElementById(labelinput).value; |
|
crslabel.trim(); |
|
info += ':'+escape(crslabel); |
|
} else { |
|
info += ':'; |
|
} |
|
if (document.getElementById(titleinput)) { |
|
var crstitle = document.getElementById(titleinput).value; |
|
crstitle.trim(); |
|
info += ':'+escape(crstitle); |
|
} else { |
|
info += ':'; |
} |
} |
info=escape(info); |
info=escape(info); |
if (residx > 0) { |
if (residx > 0) { |
Line 668 function updateExttool(caller,form,suppl
|
Line 753 function updateExttool(caller,form,suppl
|
dimendiv = prefix+'tooldimendiv'; |
dimendiv = prefix+'tooldimendiv'; |
widthinput = prefix+'toolwidth'; |
widthinput = prefix+'toolwidth'; |
heightinput = prefix+'toolheight'; |
heightinput = prefix+'toolheight'; |
|
labeldiv = prefix+'toolcrslabeldiv'; |
|
titlediv = prefix+'toolcrstitlediv'; |
|
labelinput = prefix+'toolcrslabel'; |
|
titleinput = prefix+'toolcrstitle'; |
if (document.getElementById(dispdiv)) { |
if (document.getElementById(dispdiv)) { |
var toolpick = caller.options[caller.selectedIndex].value; |
var toolpick = caller.options[caller.selectedIndex].value; |
$toolsjs |
$toolsjs |
Line 678 function updateExttool(caller,form,suppl
|
Line 767 function updateExttool(caller,form,suppl
|
if (document.getElementById(dimendiv)) { |
if (document.getElementById(dimendiv)) { |
document.getElementById(dimendiv).style.display = 'none'; |
document.getElementById(dimendiv).style.display = 'none'; |
} |
} |
} else { |
if (document.getElementById(labeldiv)) { |
if (document.getElementById(dispdiv)) { |
document.getElementById(labeldiv).style.display = 'none'; |
document.getElementById(dispdiv).style.display = 'block'; |
|
} |
} |
|
if (document.getElementById(titlediv)) { |
|
document.getElementById(titlediv).style.display = 'none'; |
|
} |
|
} else { |
if (ltitools.length > 0) { |
if (ltitools.length > 0) { |
for (var j=0; j<ltitools.length; j++) { |
for (var j=0; j<ltitools.length; j++) { |
if (ltitools[j] == toolpick) { |
if (ltitools[j] == toolpick) { |
if (form.exttooltarget.length) { |
if (document.getElementById(dispdiv)) { |
for (var k=0; k<form.exttooltarget.length; k++) { |
if (ltitoolsDisplay[j]) { |
if (form.exttooltarget[k].value == ltitoolsTarget[j]) { |
document.getElementById(dispdiv).style.display = 'block'; |
form.exttooltarget[k].checked = true; |
if (form.exttooltarget.length) { |
break; |
for (var k=0; k<form.exttooltarget.length; k++) { |
|
if (form.exttooltarget[k].value == ltitoolsTarget[j]) { |
|
form.exttooltarget[k].checked = true; |
|
break; |
|
} |
|
} |
|
} |
|
if (ltitoolsTarget[j] == 'window') { |
|
dimen = 'block'; |
|
dimenwidth = ltitoolsWidth[j]; |
|
dimenheight = ltitoolsHeight[j]; |
|
} else { |
|
dimen = 'none'; |
|
dimenwidth = ''; |
|
dimenheight = ''; |
|
} |
|
if (document.getElementById(dimendiv)) { |
|
document.getElementById(dimendiv).style.display = dimen; |
|
} |
|
if (document.getElementById(widthinput)) { |
|
document.getElementById(widthinput).value = dimenwidth; |
|
} |
|
if (document.getElementById(heightinput)) { |
|
document.getElementById(heightinput).value = dimenheight; |
} |
} |
} |
} |
} |
} |
if (ltitoolsTarget[j] == 'window') { |
if (document.getElementById(labeldiv)) { |
dimen = 'block'; |
if (ltitoolsLabel[j]) { |
dimenwidth = ltitoolsWidth[j]; |
document.getElementById(labeldiv).style.display = 'inline'; |
dimenheight = ltitoolsHeight[j]; |
} else { |
} else { |
document.getElementById(labeldiv).style.display = 'none'; |
dimen = 'none'; |
} |
dimenwidth = ''; |
|
dimenheight = ''; |
|
} |
} |
if (document.getElementById(dimendiv)) { |
if (document.getElementById(titlediv)) { |
document.getElementById(dimendiv).style.display = dimen; |
if (ltitoolsTitle[j]) { |
} |
document.getElementById(titlediv).style.display = 'inline'; |
if (document.getElementById(widthinput)) { |
} else { |
document.getElementById(widthinput).value = dimenwidth; |
document.getElementById(titlediv).style.display = 'none'; |
} |
} |
if (document.getElementById(heightinput)) { |
|
document.getElementById(heightinput).value = dimenheight; |
|
} |
} |
|
break; |
} |
} |
break; |
|
} |
} |
} |
} |
} |
} |