Diff for /loncom/interface/lonextresedit.pm between versions 1.15 and 1.16

version 1.15, 2017/03/08 02:51:08 version 1.16, 2017/04/25 22:18:59
Line 260  sub update_exttool { Line 260  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,@deleted,$errormsg);      my (%newhash,$changed,@deleted,$errormsg);
     ($newhash{'target'},$newhash{'width'},$newhash{'height'},$newhash{'crslabel'},$newhash{'crstitle'}) = split(/:/,$args);      ($newhash{'target'},$newhash{'width'},$newhash{'height'},$newhash{'linktext'},$newhash{'explanation'},
     $newhash{'crslabel'} = &unescape($newhash{'crslabel'});       $newhash{'crslabel'},$newhash{'crstitle'}) = split(/:/,$args);
     $newhash{'crstitle'} = &unescape($newhash{'crstitle'});      foreach my $item ('linktext','explanation','crslabel','crstitle') {
           $newhash{$item} = &unescape($newhash{$item});
       }
     my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum);      my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum);
     foreach my $item ('target','width','height','crslabel','crstitle') {      foreach my $item ('target','width','height','linktext','explanation','crslabel','crstitle') {
         $newhash{$item} =~ s/^\s+//;          $newhash{$item} =~ s/^\s+//;
         $newhash{$item} =~ s/\s+$//;          $newhash{$item} =~ s/\s+$//;
         if (($item eq 'width') || ($item eq 'height')) {          if (($item eq 'width') || ($item eq 'height') || ($item eq 'linktext') || ($item eq 'explanation')) {
             if ($newhash{'target'} eq 'iframe') {              if ($newhash{'target'} eq 'iframe') {
                 $newhash{$item} = '';                  $newhash{$item} = '';
             }              }
Line 275  sub update_exttool { Line 277  sub update_exttool {
         if ($toolhash{$item} ne $newhash{$item}) {          if ($toolhash{$item} ne $newhash{$item}) {
             if ($newhash{$item} eq '') {              if ($newhash{$item} eq '') {
                 unless (($item eq 'target') ||                  unless (($item eq 'target') ||
                         ((($item eq 'width') || ($item eq 'height')) &&                          ((($item eq 'width') || ($item eq 'height') || ($item eq 'linktext') || ($item eq 'explanation')) &&
                          (($newhash{'target'} eq 'window') ||                            (($newhash{'target'} eq 'window') || 
                           (($newhash{'target'} eq '') && ($toolhash{'target'} eq 'window'))))) {                            (($newhash{'target'} eq '') && ($toolhash{'target'} eq 'window'))))) {
                     delete($toolhash{$item});                      delete($toolhash{$item});
Line 325  sub extedit_form { Line 327  sub extedit_form {
         $tabid = 'ee';          $tabid = 'ee';
     }      }
     my ($formname,$formid,$toggle,$fieldsetid,$urlid,$dispdivstyle,$dimendivstyle,      my ($formname,$formid,$toggle,$fieldsetid,$urlid,$dispdivstyle,$dimendivstyle,
         $labelstyle,$titlestyle,$legend,$urlelem,$toolelem,%toolattr);          $windivstyle,$linktextstyle,$explanationstyle,$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');                                         'crstitlediv','crslabeldiv','crstitle','crslabel',
                                          'windiv','linktextdiv','explanationdiv','linktext', 
                                          'explanation');
     $dispdivstyle = 'display:none';      $dispdivstyle = 'display:none';
     $dimendivstyle = 'display:none';      $dimendivstyle = 'display:none';
       $windivstyle = 'display:none';
       $linktextstyle = 'display:none';
       $explanationstyle = 'display:none';
     $labelstyle = 'display:none';      $labelstyle = 'display:none';
     $titlestyle = 'display:none';      $titlestyle = 'display:none';
     if ($supplementalflag) {      if ($supplementalflag) {
Line 344  sub extedit_form { Line 352  sub extedit_form {
         map { $toolattr{$_} = 'supp'.$toolattr{$_}; } (keys(%toolattr));          map { $toolattr{$_} = 'supp'.$toolattr{$_}; } (keys(%toolattr));
     }      }
     my ($link,$legend,$active,$srcclass,$extsrc,$preview,$title,$save,$crstitle,$crslabel,      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,
           $linktext,$explanation,%chkstate);
     $fieldsetstyle = 'display: none;';      $fieldsetstyle = 'display: none;';
     $action = '/adm/coursedocs';      $action = '/adm/coursedocs';
     my $protocol = ($ENV{'SERVER_PORT'} == 443?'https':'http');      my $protocol = ($ENV{'SERVER_PORT'} == 443?'https':'http');
       my $rows = 2;
       my $cols = 20;
     if ($residx) {      if ($residx) {
         if ($caller eq 'direct') {          if ($caller eq 'direct') {
             $fieldsetstyle = 'display: block;';              $fieldsetstyle = 'display: block;';
             $action = '/adm/extresedit';              $action = '/adm/extresedit';
               $rows = 10;
               $cols = 45;
             if ($type eq 'tool') {              if ($type eq 'tool') {
                 $legend = $lt{'ee'};                  $legend = $lt{'ee'};
             } else {              } else {
Line 432  sub extedit_form { Line 445  sub extedit_form {
                                 $tooltarget = $toolhash{'target'};                                  $tooltarget = $toolhash{'target'};
                                 if ($tooltarget eq 'window') {                                  if ($tooltarget eq 'window') {
                                     $dimendivstyle = 'display:block';                                      $dimendivstyle = 'display:block';
                                       $windivstyle = 'display:block';
                                     $chkstate{'window'} = 'checked="checked" ';                                      $chkstate{'window'} = 'checked="checked" ';
                                 } else {                                  } else {
                                     $chkstate{'iframe'} = 'checked="checked" ';                                      $chkstate{'iframe'} = 'checked="checked" ';
                                 }                                  }
                                 $width = $toolhash{'width'};                                  $width = $toolhash{'width'};
                                 $height = $toolhash{'height'};                                  $height = $toolhash{'height'};
                                   $linktext = $toolhash{'linktext'};
                                   $explanation = $toolhash{'explanation'};
                                 if (ref($ltitools->{$toolhash{'id'}}->{'crsconf'}) eq 'HASH') {                                  if (ref($ltitools->{$toolhash{'id'}}->{'crsconf'}) eq 'HASH') {
                                     if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'title'}) {                                      if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'title'}) {
                                         $crstitle = $toolhash{'crstitle'};                                          $crstitle = $toolhash{'crstitle'};
Line 450  sub extedit_form { Line 466  sub extedit_form {
                                     if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'target'}) {                                      if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'target'}) {
                                         $dispdivstyle = 'display:block';                                          $dispdivstyle = 'display:block';
                                     }                                      }
                                       if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'linktext'}) {
                                           $linktextstyle = 'padding:0;display:inline';
                                       }
                                       if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'explanation'}) {
                                           $explanationstyle = 'padding:0;display:inline';
                                       }
                                 }                                  }
                                 $toolelem = '<span class="LC_nobreak">'.$image.'&nbsp;'.$tooltitle.'</span><br />';                                  $toolelem = '<span class="LC_nobreak">'.$image.'&nbsp;'.$tooltitle.'</span><br />';
                             }                              }
Line 487  sub extedit_form { Line 509  sub extedit_form {
         $toolelem .= '<div id="'.$toolattr{'dispdiv'}.'" style="'.$dispdivstyle.'">'.          $toolelem .= '<div id="'.$toolattr{'dispdiv'}.'" style="'.$dispdivstyle.'">'.
                     '<span class="'.$class.'">'.&mt('Display target:').'&nbsp;'.                      '<span class="'.$class.'">'.&mt('Display target:').'&nbsp;'.
                     '<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}'".');"'.$disabled.'>'.&mt('iframe').'</label>'.('&nbsp;'x2).                      "'$toolattr{dimendiv}','$toolattr{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}',
                       '$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('iframe').'</label>'.('&nbsp;'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}'".');"'.$disabled.'>'.&mt('window').'</label>'.                      "'$toolattr{dimendiv}','$toolattr{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}',
                     '</span><div id="'.$toolattr{'dimendiv'}.'" style="'.$dimendivstyle.'">'.                       '$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('window').'</label></span>'.
                     '<span class="'.$class.'">'.                      '<div id="'.$toolattr{'dimendiv'}.'" style="'.$dimendivstyle.'"><span class="'.$class.'">'.
                     &mt('Width').'<input type="text" id="'.$toolattr{'dimenwidth'}.'" name="exttoolwidth" value="'.$width.'"'.$disabled.'>'.('&nbsp;'x2).                      &mt('Width').':&nbsp;<input type="text" size="4" id="'.$toolattr{'dimenwidth'}.'" name="exttoolwidth" value="'.$width.'"'.$disabled.' />'.('&nbsp;'x2).
                     &mt('Height').'<input type="text" id="'.$toolattr{'dimenheight'}.'" name="exttoolheight" value="'.$height.'"'.$disabled.'></span>'."\n".                      &mt('Height').':&nbsp;<input type="text" size="4" id="'.$toolattr{'dimenheight'}.'" name="exttoolheight" value="'.$height.'"'.$disabled.' /></span>'."\n".
                     '</div></div>'.                      '</div></div>';
                     '<div id="'.$toolattr{'crslabeldiv'}.'" style="'.$labelstyle.'">'.          $toolelem .= '<div id="'.$toolattr{'windiv'}.'" style="'.$windivstyle.'">'.
                        '<div id="'.$toolattr{'linktextdiv'}.'" class="LC_left_float" style="'.$linktextstyle.'">'.
                        '<span class="'.$class.'">'.&mt('Link Text').'</span><br /><input type="text" size="25" id="'.$toolattr{'linktext'}.
                        '" name="exttoollinktext" value="'.$linktext.'"'.$disabled.' />'.
                        '</div><div id="'.$toolattr{'explanationdiv'}.'" class="LC_left_float" style="'.$explanationstyle.'">'.
                        '<span class="'.$class.'">'.&mt('Explanation').'</span><br />'.
                        '<textarea rows="'.$rows.'" cols="'.$cols.'" id="'.$toolattr{'explanation'}.'" name="exttoolexplanation" '.$disabled.'>'.
                        $explanation.'</textarea></div><div style="padding:0;clear:both;margin:0;border:0"></div>'.
                        '</div>';
           $toolelem .= '<div id="'.$toolattr{'crslabeldiv'}.'" style="'.$labelstyle.'">'.
                     '<span class="'.$class.'">'.&mt('Course label:').'&nbsp;'.                      '<span class="'.$class.'">'.&mt('Course label:').'&nbsp;'.
                     '<input type="text" id="'.$toolattr{'crslabel'}.'" name="exttoollabel" value="'.$crslabel.'"'.$disabled.'><br />'.                      '<input type="text" id="'.$toolattr{'crslabel'}.'" name="exttoollabel" value="'.$crslabel.'"'.$disabled.' /></span><br />'.
                     '</div>'.                      '</div>'.
                     '<div id="'.$toolattr{'crstitlediv'}.'" style="'.$titlestyle.'">'.                      '<div id="'.$toolattr{'crstitlediv'}.'" style="'.$titlestyle.'">'.
                     '<span class="'.$class.'">'.&mt('Course title:').'&nbsp;'.                      '<span class="'.$class.'">'.&mt('Course title:').'&nbsp;'.
                     '<input type="text" id="'.$toolattr{'crstitle'}.'" name="exttooltitle" value="'.$crstitle.'"'.$disabled.'><br />'.                      '<input type="text" id="'.$toolattr{'crstitle'}.'" name="exttooltitle" value="'.$crstitle.'"'.$disabled.' /></span><br />'.
                     '</div>';                      '</div>';
     }      }
     my $chooser = $toolelem;      my $chooser = $toolelem;
Line 587  sub extedit_javascript { Line 619  sub extedit_javascript {
                    "        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 ltitoolsLinkDef = new Array($num);\n".
                      "        var ltitoolsExplainDef = new Array($num);\n".
                    "        var ltitoolsDisplay = new Array($num);\n".                     "        var ltitoolsDisplay = new Array($num);\n".
                      "        var ltitoolsLink = new Array($num);\n".
                      "        var ltitoolsExplain = new Array($num);\n".
                    "        var ltitoolsLabel = new Array($num);\n".                     "        var ltitoolsLabel = new Array($num);\n".
                    "        var ltitoolsTitle = 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}) eq 'HASH') {
                 my $target = $toolsref->{$key}->{'target'};                  if (ref($toolsref->{$key}->{'display'}) eq 'HASH') {
                 my $width = $toolsref->{$key}->{'width'};                      my $target = $toolsref->{$key}->{'display'}->{'target'};
                 my $height = $toolsref->{$key}->{'height'};                      my $width = $toolsref->{$key}->{'display'}->{'width'};
                 $toolsjs .= '        ltitools['.$i.'] = '."'$key';\n".                      my $height = $toolsref->{$key}->{'display'}->{'height'};
                             '        ltitoolsTarget['.$i.'] = '."'$target';\n".                      my $linkdef = $toolsref->{$key}->{'display'}->{'linktext'};
                             '        ltitoolsWidth['.$i.'] = '."'$width';\n".                      my $explaindef = $toolsref->{$key}->{'display'}->{'explanation'};
                             '        ltitoolsHeight['.$i.'] = '."'$height';\n";                      $toolsjs .= '        ltitools['.$i.'] = '."'$key';\n".
                 my %courseconfig;                                  '        ltitoolsTarget['.$i.'] = '."'$target';\n".
                                   '        ltitoolsWidth['.$i.'] = '."'$width';\n".
                                   '        ltitoolsHeight['.$i.'] = '."'$height';\n".
                                   '        ltitoolsLinkDef['.$i.'] = '."'$linkdef';\n".
                                   '        ltitoolsExplainDef['.$i.'] = '."'$explaindef';\n";
                   }
                 if (ref($toolsref->{$key}->{'crsconf'}) eq 'HASH') {                  if (ref($toolsref->{$key}->{'crsconf'}) eq 'HASH') {
                     my $display = $toolsref->{$key}->{'crsconf'}->{'target'};                      my $display = $toolsref->{$key}->{'crsconf'}->{'target'};
                     $toolsjs .= '         ltitoolsDisplay['.$i.'] = '."'$display';\n";                      $toolsjs .= '         ltitoolsDisplay['.$i.'] = '."'$display';\n";
                       my $linktext = $toolsref->{$key}->{'crsconf'}->{'linktext'};
                       $toolsjs .= '         ltitoolsLink['.$i.'] = '."'$linktext';\n";
                       my $explanation = $toolsref->{$key}->{'crsconf'}->{'explanation'};
                       $toolsjs .= '         ltitoolsExplain['.$i.'] = '."'$explanation';\n";
                     my $label = $toolsref->{$key}->{'crsconf'}->{'label'};                      my $label = $toolsref->{$key}->{'crsconf'}->{'label'};
                     $toolsjs .= '         ltitoolsLabel['.$i.'] = '."'$label';\n";                      $toolsjs .= '         ltitoolsLabel['.$i.'] = '."'$label';\n";
                     my $title = $toolsref->{$key}->{'crsconf'}->{'title'};                      my $title = $toolsref->{$key}->{'crsconf'}->{'title'};
Line 668  function setExternal(extform,residx,type Line 713  function setExternal(extform,residx,type
            prefix = 'supp';             prefix = 'supp';
         }          }
         var dispdiv = prefix+'tooldispdiv';          var dispdiv = prefix+'tooldispdiv';
           var windiv = prefix+'toolwindiv';
         if (residx > 0) {          if (residx > 0) {
             dispdiv += '_'+residx;              dispdiv += '_'+residx;
               windiv += '_'+residx;
         }          }
         if (document.getElementById(dispdiv)) {          if (document.getElementById(dispdiv)) {
             if (document.getElementById(dispdiv).style.display == 'block') {              if (document.getElementById(dispdiv).style.display == 'block') {
Line 681  function setExternal(extform,residx,type Line 728  function setExternal(extform,residx,type
                                 width.trim();                                  width.trim();
                                 var height = extform.exttoolheight.value;                                  var height = extform.exttoolheight.value;
                                 height.trim();                                  height.trim();
                                 info += ':window:'+width+':'+height;                                    info += ':window:'+width+':'+height;
                             } else {                              } else {
                                 info += ':iframe::';                                  info += ':iframe::';
                             }                              }
Line 694  function setExternal(extform,residx,type Line 741  function setExternal(extform,residx,type
         } else {          } else {
             info += ':::';              info += ':::';
         }          }
           if (document.getElementById(windiv)) {
               if (document.getElementById(windiv).style.display == 'block') {
                   var linktextdiv = prefix+'toollinktextdiv';
                   var explanationdiv = prefix+'toolexplanationdiv';
                   if (residx > 0) {
                       linktextdiv += '_'+residx;
                       explanationdiv += '_'+residx;
                   }
                   if (document.getElementById(linktextdiv).style.display == 'inline') {
                       var linktext = extform.exttoollinktext.value;
                       linktext.trim();
                       info += ':'+escape(linktext);
                   } else {
                       info += ':';
                   }
                   if (document.getElementById(explanationdiv).style.display == 'inline') {
                       var explaintext = extform.exttoolexplanation.value;
                       explaintext.trim();
                       info += ':'+escape(explaintext);
                   } else {
                       info += ':';
                   }
               } else {
                   info += '::';
               }
           } else {
               info += '::';
           }
         var labelinput = prefix+'toolcrslabel';          var labelinput = prefix+'toolcrslabel';
         var titleinput = prefix+'toolcrstitle';          var titleinput = prefix+'toolcrstitle';
         if (residx > 0) {          if (residx > 0) {
Line 760  function updateExttool(caller,form,suppl Line 835  function updateExttool(caller,form,suppl
     }      }
     dispdiv = prefix+'tooldispdiv';      dispdiv = prefix+'tooldispdiv';
     dimendiv = prefix+'tooldimendiv';      dimendiv = prefix+'tooldimendiv';
     widthinput = prefix+'toolwidth';      widthinput = prefix+'tooldimenwidth';
     heightinput = prefix+'toolheight';      heightinput = prefix+'tooldimenheight';
     labeldiv = prefix+'toolcrslabeldiv';      labeldiv = prefix+'toolcrslabeldiv';
     titlediv = prefix+'toolcrstitlediv';      titlediv = prefix+'toolcrstitlediv';
     labelinput = prefix+'toolcrslabel';      labelinput = prefix+'toolcrslabel';
     titleinput = prefix+'toolcrstitle';      titleinput = prefix+'toolcrstitle';
       windiv = prefix+'toolwindiv';  
       linktextdiv = prefix+'toollinktextdiv';
       linktextinput = prefix+'toollinktext';
       explanationdiv = prefix+'toolexplanationdiv';
       explanationinput = prefix+'toolexplanation';
     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 776  function updateExttool(caller,form,suppl Line 856  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';
             }              }
               if (document.getElementById(windiv)) {
                   document.getElementById(windiv).style.display = 'none';
               }
               if (document.getElementById(linktextdiv)) {
                   document.getElementById(linktextdiv).style.display = 'none';
               }
               if (document.getElementById(explanationdiv)) {
                   document.getElementById(explanationdiv).style.display = 'none';
               }
             if (document.getElementById(labeldiv)) {              if (document.getElementById(labeldiv)) {
                 document.getElementById(labeldiv).style.display = 'none';                  document.getElementById(labeldiv).style.display = 'none';
             }              }
Line 797  function updateExttool(caller,form,suppl Line 886  function updateExttool(caller,form,suppl
                                         }                                          }
                                     }                                      }
                                 }                                  }
                                 if (ltitoolsTarget[j] == 'window') {                              }
                                     dimen = 'block';                              var dimen = 'none';
                                     dimenwidth = ltitoolsWidth[j];                              var dimenwidth = '';
                                     dimenheight = ltitoolsHeight[j];                                                  var dimenheight = '';
                               if ((ltitoolsDisplay[j]) && (ltitoolsTarget[j] == 'window')) {
                                   dimen = 'block';
                                   dimenwidth = ltitoolsWidth[j];
                                   dimenheight = ltitoolsHeight[j];                    
                               }
                               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 (document.getElementById(windiv)) {
                               if (ltitoolsTarget[j] == 'window') {
                                   document.getElementById(windiv).style.display = 'block';
                               } else {
                                   document.getElementById(windiv).style.display = 'none';
                               }
                               if (document.getElementById(linktextdiv)) {
                                   if ((ltitoolsLink[j]) && (ltitoolsTarget[j] == 'window')) {
                                       document.getElementById(linktextdiv).style.display = 'inline';
                                 } else {                                  } else {
                                     dimen = 'none';                                      document.getElementById(linktextdiv).style.display = 'none';
                                     dimenwidth = '';  
                                     dimenheight = '';  
                                 }                                  }
                                 if (document.getElementById(dimendiv)) {                              }
                                     document.getElementById(dimendiv).style.display = dimen;                              if (document.getElementById(linktextinput)) {
                                   if ((ltitoolsLink[j]) && (ltitoolsTarget[j] == 'window')) {
                                       document.getElementById(linktextinput).value = ltitoolsLinkDef[j]; 
                                   } else {
                                       document.getElementById(linktextinput).value = '';
                                 }                                  }
                                 if (document.getElementById(widthinput)) {                              }
                                     document.getElementById(widthinput).value = dimenwidth;                              if (document.getElementById(explanationdiv)) {
                                   if ((ltitoolsExplain[j]) && (ltitoolsTarget[j] == 'window')) {
                                       document.getElementById(explanationdiv).style.display = 'inline';
                                   } else {
                                       document.getElementById(explanationdiv).style.display = 'none';
                                 }                                  }
                                 if (document.getElementById(heightinput)) {                              }
                                     document.getElementById(heightinput).value = dimenheight;                              if (document.getElementById(explanationinput)) {
                                   if ((ltitoolsExplain[j]) && (ltitoolsTarget[j] == 'window')) {
                                       document.getElementById(explanationinput).value = ltitoolsExplainDef[j];
                                   } else {
                                       document.getElementById(explananationinput).value = '';
                                 }                                  }
                             }                              }
                         }                          }
Line 839  function updateExttool(caller,form,suppl Line 962  function updateExttool(caller,form,suppl
     }      }
 }  }
   
 function updateTooldim(form,dimendiv,widthinput,heightinput) {  function updateTooldim(form,dimendiv,windiv,widthinput,heightinput,linkinput,explaininput) {
     if (form.exttooltarget.length) {      if (form.exttooltarget.length) {
         for (var i=0; i<form.exttooltarget.length; i++) {          for (var i=0; i<form.exttooltarget.length; i++) {
             if (form.exttooltarget[i].checked) {              if (form.exttooltarget[i].checked) {
                 var dimen = 'none';                  var dimen = 'none';
                   var linkconf = 'none'; 
                 if (form.exttooltarget[i].value == 'window') {                  if (form.exttooltarget[i].value == 'window') {
                     dimen = 'block';                      dimen = 'block';
                       linkconf = 'block';
                 } else {                  } else {
                     if (document.getElementById(widthinput)) {                      if (document.getElementById(widthinput)) {
                         document.getElementById(widthinput).value = '';                          document.getElementById(widthinput).value = '';
Line 853  function updateTooldim(form,dimendiv,wid Line 978  function updateTooldim(form,dimendiv,wid
                     if (document.getElementById(heightinput)) {                      if (document.getElementById(heightinput)) {
                         document.getElementById(heightinput).value = '';                          document.getElementById(heightinput).value = '';
                     }                      }
                       if (document.getElementById(linkinput)) {
                           document.getElementById(linkinput).value = '';
                       }
                       if (document.getElementById(explaininput)) {
                           document.getElementById(explaininput).value = '';
                       }
                 }                  }
                 if (document.getElementById(dimendiv)) {                  if (document.getElementById(dimendiv)) {
                     document.getElementById(dimendiv).style.display = dimen;                      document.getElementById(dimendiv).style.display = dimen;
                 }                  }
                   if (document.getElementById(windiv)) {
                       document.getElementById(windiv).style.display = linkconf;
                   }  
                 break;                  break;
             }              }
         }          }

Removed from v.1.15  
changed lines
  Added in v.1.16


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>