WordPress.org

Make WordPress Core

Changeset 3407


Ignore:
Timestamp:
01/05/2006 11:33:50 PM (14 years ago)
Author:
ryan
Message:

Send to editor fix ups. fixes #2199

File:
1 edited

Legend:

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

    r3398 r3407  
    335335}
    336336function toggleLink(n) {
    337     od=document.getElementById('div'+n);
    338337    ol=document.getElementById('L'+n);
    339     oi=document.getElementById('I'+n);
    340     if ( oi.innerHTML == usingthumbnail ) {
    341         img = imga[n];
    342     } else {
    343         img = imgb[n];
    344     }
    345338    if ( ol.innerHTML == htmldecode(notlinked) ) {
    346         od.innerHTML = ab[n]+img+'</a>';
    347339        ol.innerHTML = linkedtoimage;
    348340    } else if ( ol.innerHTML == htmldecode(linkedtoimage) ) {
    349         od.innerHTML = aa[n]+img+'</a>';
    350341        ol.innerHTML = linkedtopage;
    351342    } else {
    352         od.innerHTML = img;
    353343        ol.innerHTML = notlinked;
    354344    }
     345    updateImage(n);
    355346}
    356347function toggleOtherLink(n) {
     
    370361}
    371362function toggleImage(n) {
    372     o = document.getElementById('image'+n);
    373363    oi = document.getElementById('I'+n);
    374364    if ( oi.innerHTML == htmldecode(usingthumbnail) ) {
    375         o.src = srcb[n];
    376365        oi.innerHTML = usingoriginal;
    377366    } else {
    378         o.src = srca[n];
    379367        oi.innerHTML = usingthumbnail;
    380368    }
     369    updateImage(n);
    381370}
    382371function toggleOtherIcon(n) {
     
    399388        od.className = 'otherwrap usingtext';
    400389}
    401 
     390function updateImage(n) {
     391    od=document.getElementById('div'+n);
     392    ol=document.getElementById('L'+n);
     393    oi=document.getElementById('I'+n);
     394    if ( oi.innerHTML == htmldecode(usingthumbnail) ) {
     395        img = imga[n];
     396    } else {
     397        img = imgb[n];
     398    }
     399    if ( ol.innerHTML == htmldecode(linkedtoimage) ) {
     400        od.innerHTML = ab[n]+img+'</a>';
     401    } else if ( ol.innerHTML == htmldecode(linkedtopage) ) {
     402        od.innerHTML = aa[n]+img+'</a>';
     403    } else {
     404        od.innerHTML = img;
     405    }
     406}
    402407var win = window.opener ? window.opener : window.dialogArguments;
    403408if (!win) win = top;
     
    408413    h = o.innerHTML.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // Trim
    409414    h = h.replace(new RegExp(' (class|title|width|height|id|onclick|onmousedown)=([^\'"][^ ]*)( |/|>)', 'g'), ' $1="$2"$3'); // Enclose attribs in quotes
     415    h = h.replace(new RegExp(' (width|height)=".*?"', 'g'), ''); // Drop size constraints
    410416    h = h.replace(new RegExp(' on(click|mousedown)="[^"]*"', 'g'), ''); // Drop menu events
    411417    h = h.replace(new RegExp('<(/?)A', 'g'), '<$1a'); // Lowercase tagnames
Note: See TracChangeset for help on using the changeset viewer.