mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-19 21:15:23 +00:00
git-svn-id: http://svn.automattic.com/wordpress/trunk@19977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f62dac2756
commit
151b1088cc
@ -10,30 +10,21 @@
|
|||||||
|
|
||||||
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
|
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
|
||||||
ed.addCommand('WP_EditImage', function() {
|
ed.addCommand('WP_EditImage', function() {
|
||||||
var el = ed.selection.getNode(), vp = tinymce.DOM.getViewPort(), H = vp.h, W = ( 720 < vp.w ) ? 720 : vp.w, cls = ed.dom.getAttrib(el, 'class');
|
var el = ed.selection.getNode(), vp, H, W, cls = ed.dom.getAttrib(el, 'class');
|
||||||
|
|
||||||
if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 || el.nodeName != 'IMG' )
|
if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 || el.nodeName != 'IMG' )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tb_show('', url + '/editimage.html?ver=321&TB_iframe=true');
|
vp = tinymce.DOM.getViewPort();
|
||||||
tinymce.DOM.setStyles('TB_window', {
|
H = 680 < (vp.h - 70) ? 680 : vp.h - 70;
|
||||||
'width':( W - 50 )+'px',
|
W = 650 < vp.w ? 650 : vp.w;
|
||||||
'height':( H - 45 )+'px',
|
|
||||||
'margin-left':'-'+parseInt((( W - 50 ) / 2),10) + 'px'
|
|
||||||
});
|
|
||||||
|
|
||||||
if ( ! tinymce.isIE6 ) {
|
ed.windowManager.open({
|
||||||
tinymce.DOM.setStyles('TB_window', {
|
file: url + '/editimage.html',
|
||||||
'top':'20px',
|
width: W+'px',
|
||||||
'marginTop':'0'
|
height: H+'px',
|
||||||
});
|
inline: true
|
||||||
}
|
|
||||||
|
|
||||||
tinymce.DOM.setStyles('TB_iframeContent', {
|
|
||||||
'width':( W - 50 )+'px',
|
|
||||||
'height':( H - 75 )+'px'
|
|
||||||
});
|
});
|
||||||
tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.onInit.add(function(ed) {
|
ed.onInit.add(function(ed) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user