Send to editor fix ups. fixes #2199
git-svn-id: http://svn.automattic.com/wordpress/trunk@3407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0b1e3030b3
commit
63e1963e19
|
@ -334,24 +334,15 @@ function selectLink(n) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function toggleLink(n) {
|
function toggleLink(n) {
|
||||||
od=document.getElementById('div'+n);
|
|
||||||
ol=document.getElementById('L'+n);
|
ol=document.getElementById('L'+n);
|
||||||
oi=document.getElementById('I'+n);
|
|
||||||
if ( oi.innerHTML == usingthumbnail ) {
|
|
||||||
img = imga[n];
|
|
||||||
} else {
|
|
||||||
img = imgb[n];
|
|
||||||
}
|
|
||||||
if ( ol.innerHTML == htmldecode(notlinked) ) {
|
if ( ol.innerHTML == htmldecode(notlinked) ) {
|
||||||
od.innerHTML = ab[n]+img+'</a>';
|
|
||||||
ol.innerHTML = linkedtoimage;
|
ol.innerHTML = linkedtoimage;
|
||||||
} else if ( ol.innerHTML == htmldecode(linkedtoimage) ) {
|
} else if ( ol.innerHTML == htmldecode(linkedtoimage) ) {
|
||||||
od.innerHTML = aa[n]+img+'</a>';
|
|
||||||
ol.innerHTML = linkedtopage;
|
ol.innerHTML = linkedtopage;
|
||||||
} else {
|
} else {
|
||||||
od.innerHTML = img;
|
|
||||||
ol.innerHTML = notlinked;
|
ol.innerHTML = notlinked;
|
||||||
}
|
}
|
||||||
|
updateImage(n);
|
||||||
}
|
}
|
||||||
function toggleOtherLink(n) {
|
function toggleOtherLink(n) {
|
||||||
od=document.getElementById('div'+n);
|
od=document.getElementById('div'+n);
|
||||||
|
@ -369,15 +360,13 @@ function toggleOtherLink(n) {
|
||||||
oi.innerHTML = ih;
|
oi.innerHTML = ih;
|
||||||
}
|
}
|
||||||
function toggleImage(n) {
|
function toggleImage(n) {
|
||||||
o = document.getElementById('image'+n);
|
|
||||||
oi = document.getElementById('I'+n);
|
oi = document.getElementById('I'+n);
|
||||||
if ( oi.innerHTML == htmldecode(usingthumbnail) ) {
|
if ( oi.innerHTML == htmldecode(usingthumbnail) ) {
|
||||||
o.src = srcb[n];
|
|
||||||
oi.innerHTML = usingoriginal;
|
oi.innerHTML = usingoriginal;
|
||||||
} else {
|
} else {
|
||||||
o.src = srca[n];
|
|
||||||
oi.innerHTML = usingthumbnail;
|
oi.innerHTML = usingthumbnail;
|
||||||
}
|
}
|
||||||
|
updateImage(n);
|
||||||
}
|
}
|
||||||
function toggleOtherIcon(n) {
|
function toggleOtherIcon(n) {
|
||||||
od = document.getElementById('div'+n);
|
od = document.getElementById('div'+n);
|
||||||
|
@ -398,7 +387,23 @@ function toggleOtherIcon(n) {
|
||||||
else
|
else
|
||||||
od.className = 'otherwrap usingtext';
|
od.className = 'otherwrap usingtext';
|
||||||
}
|
}
|
||||||
|
function updateImage(n) {
|
||||||
|
od=document.getElementById('div'+n);
|
||||||
|
ol=document.getElementById('L'+n);
|
||||||
|
oi=document.getElementById('I'+n);
|
||||||
|
if ( oi.innerHTML == htmldecode(usingthumbnail) ) {
|
||||||
|
img = imga[n];
|
||||||
|
} else {
|
||||||
|
img = imgb[n];
|
||||||
|
}
|
||||||
|
if ( ol.innerHTML == htmldecode(linkedtoimage) ) {
|
||||||
|
od.innerHTML = ab[n]+img+'</a>';
|
||||||
|
} else if ( ol.innerHTML == htmldecode(linkedtopage) ) {
|
||||||
|
od.innerHTML = aa[n]+img+'</a>';
|
||||||
|
} else {
|
||||||
|
od.innerHTML = img;
|
||||||
|
}
|
||||||
|
}
|
||||||
var win = window.opener ? window.opener : window.dialogArguments;
|
var win = window.opener ? window.opener : window.dialogArguments;
|
||||||
if (!win) win = top;
|
if (!win) win = top;
|
||||||
tinyMCE = win.tinyMCE;
|
tinyMCE = win.tinyMCE;
|
||||||
|
@ -407,6 +412,7 @@ function sendToEditor(n) {
|
||||||
o = document.getElementById('div'+n);
|
o = document.getElementById('div'+n);
|
||||||
h = o.innerHTML.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // Trim
|
h = o.innerHTML.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // Trim
|
||||||
h = h.replace(new RegExp(' (class|title|width|height|id|onclick|onmousedown)=([^\'"][^ ]*)( |/|>)', 'g'), ' $1="$2"$3'); // Enclose attribs in quotes
|
h = h.replace(new RegExp(' (class|title|width|height|id|onclick|onmousedown)=([^\'"][^ ]*)( |/|>)', 'g'), ' $1="$2"$3'); // Enclose attribs in quotes
|
||||||
|
h = h.replace(new RegExp(' (width|height)=".*?"', 'g'), ''); // Drop size constraints
|
||||||
h = h.replace(new RegExp(' on(click|mousedown)="[^"]*"', 'g'), ''); // Drop menu events
|
h = h.replace(new RegExp(' on(click|mousedown)="[^"]*"', 'g'), ''); // Drop menu events
|
||||||
h = h.replace(new RegExp('<(/?)A', 'g'), '<$1a'); // Lowercase tagnames
|
h = h.replace(new RegExp('<(/?)A', 'g'), '<$1a'); // Lowercase tagnames
|
||||||
h = h.replace(new RegExp('<IMG', 'g'), '<img'); // Lowercase again
|
h = h.replace(new RegExp('<IMG', 'g'), '<img'); // Lowercase again
|
||||||
|
|
Loading…
Reference in New Issue