Make WordPress Core

Changeset 19977


Ignore:
Timestamp:
02/22/2012 03:05:25 AM (15 years ago)
Author:
azaozz
Message:

Use native TinyMCE popup for the image properties dialog, fixes #20096, see #20094

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js

    r19945 r19977  
    1111                        // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
    1212                        ed.addCommand('WP_EditImage', function() {
    13                                 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');
     13                                var el = ed.selection.getNode(), vp, H, W, cls = ed.dom.getAttrib(el, 'class');
    1414
    1515                                if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 || el.nodeName != 'IMG' )
    1616                                        return;
    1717
    18                                 tb_show('', url + '/editimage.html?ver=321&TB_iframe=true');
    19                                 tinymce.DOM.setStyles('TB_window', {
    20                                         'width':( W - 50 )+'px',
    21                                         'height':( H - 45 )+'px',
    22                                         'margin-left':'-'+parseInt((( W - 50 ) / 2),10) + 'px'
     18                                vp = tinymce.DOM.getViewPort();
     19                                H = 680 < (vp.h - 70) ? 680 : vp.h - 70;
     20                                W = 650 < vp.w ? 650 : vp.w;
     21
     22                                ed.windowManager.open({
     23                                        file: url + '/editimage.html',
     24                                        width: W+'px',
     25                                        height: H+'px',
     26                                        inline: true
    2327                                });
    24 
    25                                 if ( ! tinymce.isIE6 ) {
    26                                         tinymce.DOM.setStyles('TB_window', {
    27                                                 'top':'20px',
    28                                                 'marginTop':'0'
    29                                         });
    30                                 }
    31 
    32                                 tinymce.DOM.setStyles('TB_iframeContent', {
    33                                         'width':( W - 50 )+'px',
    34                                         'height':( H - 75 )+'px'
    35                                 });
    36                                 tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
    3728                        });
    3829
Note: See TracChangeset for help on using the changeset viewer.