Make WordPress Core

Changeset 3469


Ignore:
Timestamp:
01/21/2006 05:41:52 AM (21 years ago)
Author:
ryan
Message:

updateOtherIcon. fixes #2315

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/inline-uploading.php

    r3456 r3469  
    259259                        $icon = get_attachment_icon($ID);
    260260                        $toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>";
    261                         $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$title}</a>';
    262 ab[{$ID}] = '<a id=\"p{$ID}\" href=\"{$filename}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$title}</a>';
     261                        $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
     262ab[{$ID}] = '<a id=\"p{$ID}\" href=\"{$filename}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
    263263title[{$ID}] = '{$title}';
    264264filename[{$ID}] = '{$filename}';
    … …  
    348348}
    349349function toggleOtherLink(n) {
    350         od=document.getElementById('div'+n);
    351350        ol=document.getElementById('L'+n);
    352         oi=document.getElementById('p'+n);
    353         ih=oi.innerHTML;
    354351        if ( ol.innerHTML == htmldecode(linkedtofile) ) {
    355                 od.innerHTML = aa[n];
    356352                ol.innerHTML = linkedtopage;
    357353        } else {
    358                 od.innerHTML = ab[n];
    359354                ol.innerHTML = linkedtofile;
    360355        }
    361         oi=document.getElementById('p'+n);
    362         oi.innerHTML = ih;
     356        updateOtherIcon(n);
    363357}
    364358function toggleImage(n) {
    … …  
    373367function toggleOtherIcon(n) {
    374368        od = document.getElementById('div'+n);
    375         o = document.getElementById('p'+n);
    376369        oi = document.getElementById('I'+n);
    377370        if ( oi.innerHTML == htmldecode(usingtitle) ) {
    378                 o.innerHTML = filename[n];
    379371                oi.innerHTML = usingfilename;
     372                od.className = 'otherwrap usingtext';
    380373        } else if ( oi.innerHTML == htmldecode(usingfilename) && icon[n] != '' ) {
    381                 o.innerHTML = icon[n];
    382374                oi.innerHTML = usingicon;
     375                od.className = 'otherwrap usingicon';
    383376        } else {
    384                 o.innerHTML = title[n];
    385377                oi.innerHTML = usingtitle;
    386         }
    387         if ( oi.innerHTML == usingicon )
    388                 od.className = 'otherwrap usingicon';
    389         else
    390378                od.className = 'otherwrap usingtext';
     379        }
     380        updateOtherIcon(n);
    391381}
    392382function updateImage(n) {
    … …  
    407397        }
    408398}
     399function updateOtherIcon(n) {
     400        od=document.getElementById('div'+n);
     401        ol=document.getElementById('L'+n);
     402        oi=document.getElementById('I'+n);
     403        if ( oi.innerHTML == htmldecode(usingfilename) ) {
     404                txt = filename[n];
     405        } else if ( oi.innerHTML == htmldecode(usingicon) ) {
     406                txt = icon[n];
     407        } else {
     408                txt = title[n];
     409        }
     410        if ( ol.innerHTML == htmldecode(linkedtofile) ) {
     411                od.innerHTML = ab[n]+txt+'</a>';
     412        } else if ( ol.innerHTML == htmldecode(linkedtopage) ) {
     413                od.innerHTML = aa[n]+txt+'</a>';
     414        } else {
     415                od.innerHTML = txt;
     416        }
     417}
     418
    409419var win = window.opener ? window.opener : window.dialogArguments;
    410420if (!win) win = top;
Note: See TracChangeset for help on using the changeset viewer.