diff --git a/wp-admin/inline-uploading.php b/wp-admin/inline-uploading.php index eabc9dd0b..c2334cd99 100644 --- a/wp-admin/inline-uploading.php +++ b/wp-admin/inline-uploading.php @@ -258,8 +258,8 @@ imgb[{$ID}] = '\"{$title}\"$__using_title"; - $script .= "aa[{$ID}] = '{$title}'; -ab[{$ID}] = '{$title}'; + $script .= "aa[{$ID}] = ''; +ab[{$ID}] = ''; title[{$ID}] = '{$title}'; filename[{$ID}] = '{$filename}'; icon[{$ID}] = '{$icon}'; @@ -347,19 +347,13 @@ function toggleLink(n) { updateImage(n); } function toggleOtherLink(n) { - od=document.getElementById('div'+n); ol=document.getElementById('L'+n); - oi=document.getElementById('p'+n); - ih=oi.innerHTML; if ( ol.innerHTML == htmldecode(linkedtofile) ) { - od.innerHTML = aa[n]; ol.innerHTML = linkedtopage; } else { - od.innerHTML = ab[n]; ol.innerHTML = linkedtofile; } - oi=document.getElementById('p'+n); - oi.innerHTML = ih; + updateOtherIcon(n); } function toggleImage(n) { oi = document.getElementById('I'+n); @@ -372,22 +366,18 @@ function toggleImage(n) { } function toggleOtherIcon(n) { od = document.getElementById('div'+n); - o = document.getElementById('p'+n); oi = document.getElementById('I'+n); if ( oi.innerHTML == htmldecode(usingtitle) ) { - o.innerHTML = filename[n]; oi.innerHTML = usingfilename; - } else if ( oi.innerHTML == htmldecode(usingfilename) && icon[n] != '' ) { - o.innerHTML = icon[n]; - oi.innerHTML = usingicon; - } else { - o.innerHTML = title[n]; - oi.innerHTML = usingtitle; - } - if ( oi.innerHTML == usingicon ) - od.className = 'otherwrap usingicon'; - else od.className = 'otherwrap usingtext'; + } else if ( oi.innerHTML == htmldecode(usingfilename) && icon[n] != '' ) { + oi.innerHTML = usingicon; + od.className = 'otherwrap usingicon'; + } else { + oi.innerHTML = usingtitle; + od.className = 'otherwrap usingtext'; + } + updateOtherIcon(n); } function updateImage(n) { od=document.getElementById('div'+n); @@ -406,6 +396,26 @@ function updateImage(n) { od.innerHTML = img; } } +function updateOtherIcon(n) { + od=document.getElementById('div'+n); + ol=document.getElementById('L'+n); + oi=document.getElementById('I'+n); + if ( oi.innerHTML == htmldecode(usingfilename) ) { + txt = filename[n]; + } else if ( oi.innerHTML == htmldecode(usingicon) ) { + txt = icon[n]; + } else { + txt = title[n]; + } + if ( ol.innerHTML == htmldecode(linkedtofile) ) { + od.innerHTML = ab[n]+txt+''; + } else if ( ol.innerHTML == htmldecode(linkedtopage) ) { + od.innerHTML = aa[n]+txt+''; + } else { + od.innerHTML = txt; + } +} + var win = window.opener ? window.opener : window.dialogArguments; if (!win) win = top; tinyMCE = win.tinyMCE;