Diff for /loncom/interface/lonextresedit.pm between versions 1.18 and 1.19

version 1.18, 2017/05/08 14:20:20 version 1.19, 2017/05/10 13:49:14
Line 272  sub update_exttool { Line 272  sub update_exttool {
         if (($item eq 'width') || ($item eq 'height') || ($item eq 'linktext') || ($item eq 'explanation')) {          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} = '';
               } elsif ($newhash{'target'} eq 'tab') {
                   if (($item eq 'width') || ($item eq 'height')) {
                       $newhash{$item} = '';
                   }
             }              }
         }          }
         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 'linktext') || ($item eq 'explanation')) &&                          ((($item eq 'width') || ($item eq 'height')) &&
                          (($newhash{'target'} eq 'window') ||                            (($newhash{'target'} eq 'window') || 
                           (($newhash{'target'} eq '') && ($toolhash{'target'} eq 'window'))))) {                            (($newhash{'target'} eq '') && ($toolhash{'target'} eq 'window')))) ||
                           ((($item eq 'linktext') || ($item eq 'explanation')) &&
                            ((($newhash{'target'} =~ /^(window|tab)$/)) ||
                            (($newhash{'target'} eq '') && ($toolhash{'target'} =~ /^(window|tab)$/))))) {
                     delete($toolhash{$item});                      delete($toolhash{$item});
                     push(@deleted,$item);                      push(@deleted,$item);
                     $changed = 1;                      $changed = 1;
Line 447  sub extedit_form { Line 454  sub extedit_form {
                                     $dimendivstyle = 'display:block';                                      $dimendivstyle = 'display:block';
                                     $windivstyle = 'display:block';                                      $windivstyle = 'display:block';
                                     $chkstate{'window'} = 'checked="checked" ';                                      $chkstate{'window'} = 'checked="checked" ';
                                   } elsif ($tooltarget eq 'tab') {
                                       $windivstyle = 'display:block';
                                       $chkstate{'tab'} = 'checked="checked" ';
                                 } else {                                  } else {
                                     $chkstate{'iframe'} = 'checked="checked" ';                                      $chkstate{'iframe'} = 'checked="checked" ';
                                 }                                  }
Line 511  sub extedit_form { Line 521  sub extedit_form {
                     '<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{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}',                      "'$toolattr{dimendiv}','$toolattr{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}',
                     '$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('iframe').'</label>'.('&nbsp;'x2).                      '$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('iframe').'</label>'.('&nbsp;'x2).
                       '<label><input type="radio" name="exttooltarget" value="tab" '.$chkstate{'tab'}.'onclick="updateTooldim(this.form,'.
                       "'$toolattr{dimendiv}','$toolattr{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}',
                       '$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('tab').'</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{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}',                      "'$toolattr{dimendiv}','$toolattr{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}',
                     '$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('window').'</label></span>'.                      '$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('window').'</label></span>'.
Line 729  function setExternal(extform,residx,type Line 742  function setExternal(extform,residx,type
                                 var height = extform.exttoolheight.value;                                  var height = extform.exttoolheight.value;
                                 height.trim();                                  height.trim();
                                 info += ':window:'+width+':'+height;                                  info += ':window:'+width+':'+height;
                               } else if (extform.exttooltarget[i].value == 'tab') {
                                   info += ':tab::';
                             } else {                              } else {
                                 info += ':iframe::';                                  info += ':iframe::';
                             }                              }
Line 906  function updateExttool(caller,form,suppl Line 921  function updateExttool(caller,form,suppl
                             }                              }
                         }                          }
                         if (document.getElementById(windiv)) {                          if (document.getElementById(windiv)) {
                             if (ltitoolsTarget[j] == 'window') {                              if ((ltitoolsTarget[j] == 'window') || (ltitoolsTarget[j] == 'tab')) {
                                 document.getElementById(windiv).style.display = 'block';                                  document.getElementById(windiv).style.display = 'block';
                             } else {                              } else {
                                 document.getElementById(windiv).style.display = 'none';                                  document.getElementById(windiv).style.display = 'none';
Line 972  function updateTooldim(form,dimendiv,win Line 987  function updateTooldim(form,dimendiv,win
                     dimen = 'block';                      dimen = 'block';
                     linkconf = 'block';                      linkconf = 'block';
                 } else {                  } else {
                     if (document.getElementById(widthinput)) {                      if (form.exttooltarget[i].value == 'tab') {
                         document.getElementById(widthinput).value = '';                          linkconf = 'block';
                     }                      } else {
                     if (document.getElementById(heightinput)) {                          if (document.getElementById(widthinput)) {
                         document.getElementById(heightinput).value = '';                              document.getElementById(widthinput).value = '';
                     }                          }
                     if (document.getElementById(linkinput)) {                          if (document.getElementById(heightinput)) {
                         document.getElementById(linkinput).value = '';                              document.getElementById(heightinput).value = '';
                     }                          }
                     if (document.getElementById(explaininput)) {                          if (document.getElementById(linkinput)) {
                         document.getElementById(explaininput).value = '';                              document.getElementById(linkinput).value = '';
                           }
                           if (document.getElementById(explaininput)) {
                               document.getElementById(explaininput).value = '';
                           }
                     }                      }
                 }                  }
                 if (document.getElementById(dimendiv)) {                  if (document.getElementById(dimendiv)) {

Removed from v.1.18  
changed lines
  Added in v.1.19


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