]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
Wordpress 2.7.1
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / wpeditimage / editor_plugin.js
index d0ca4ed5a954dd094ac5025ed859f6f9e02d8ef1..f24d0bafae768e88baec9874c27bcaff445147bb 100644 (file)
 
                        // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
                        ed.addCommand('WP_EditImage', function() {
-                               var el = ed.selection.getNode();
+                               var el = ed.selection.getNode(), vp = tinymce.DOM.getViewPort(), H = vp.h, W = ( 720 < vp.w ) ? 720 : vp.w;
+                               var cls = ed.dom.getAttrib(el, 'class');
 
-                               if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' )
+                               if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 || el.nodeName != 'IMG' )
                                        return;
 
-                               tb_show('', url + '/editimage.html?ver=311g&TB_iframe=true');
+                               tb_show('', url + '/editimage.html?ver=321&TB_iframe=true');
+                               tinymce.DOM.setStyles('TB_window', {
+                                       'width':( W - 50 )+'px',
+                                       'height':( H - 45 )+'px',
+                                       'margin-left':'-'+parseInt((( W - 50 ) / 2),10) + 'px'
+                               });
+
+                               if ( ! tinymce.isIE6 ) {
+                                       tinymce.DOM.setStyles('TB_window', {
+                                               'top':'20px',
+                                               'marginTop':'0'
+                                       });
+                               }
+
+                               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' );
                        });
 
 
                showButtons : function(n) {
                        var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y;
+                       var cls = ed.dom.getAttrib(n, 'class');
 
-                       if (ed.dom.getAttrib(n, 'class').indexOf('mceItem') != -1)
+                       if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 )
                                return;
 
                        vp = ed.dom.getViewPort(ed.getWin());