Make WordPress Core

Ticket #6811: edit-image-popup3.patch

File edit-image-popup3.patch, 25.2 KB (added by azaozz, 15 years ago)
  • wp-admin/gears-manifest.php

     
    6363?>
    6464{
    6565"betaManifestVersion" : 1,
    66 "version" : "<?php echo $man_version; ?>_20080618",
     66"version" : "<?php echo $man_version; ?>_20080622",
    6767"entries" : [
    6868<?php echo $defaults; ?>
    6969
  • wp-includes/js/tinymce/langs/wp-langs.php

     
    33// escape text only if it needs translating
    44function mce_escape($text) {
    55        global $language;
    6        
     6
    77        if ( 'en' == $language ) return $text;
    88        else return js_escape($text);
    99}
     
    421421height:"' . mce_escape( __('Height') ) . '",
    422422orig_size:"' . mce_escape( __('Original Size') ) . '",
    423423css:"' . mce_escape( __('CSS Class') ) . '",
     424s60:"' . mce_escape( __('60%') ) . '",
     425s70:"' . mce_escape( __('70%') ) . '",
     426s80:"' . mce_escape( __('80%') ) . '",
     427s90:"' . mce_escape( __('90%') ) . '",
     428s100:"' . mce_escape( __('100%') ) . '",
     429s110:"' . mce_escape( __('110%') ) . '",
     430s120:"' . mce_escape( __('120%') ) . '",
     431s130:"' . mce_escape( __('130%') ) . '",
    424432caption:"' . mce_escape( __('Caption') ) . '"
    425433});
    426 '; 
     434';
    427435?>
     436 No newline at end of file
  • wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js

     
    2424                                        t._resizeIframe(ed, tbId, 28);
    2525                                }
    2626                        });
    27                        
     27
    2828                        // Register commands
    2929                        ed.addCommand('WP_More', function() {
    3030                                ed.execCommand('mceInsertContent', 0, moreHTML);
    3131                        });
    32                        
     32
    3333                        ed.addCommand('WP_Page', function() {
    3434                                ed.execCommand('mceInsertContent', 0, nextpageHTML);
    3535                        });
    36                        
     36
    3737                        ed.addCommand('WP_Help', function() {
    3838                                        ed.windowManager.open({
    3939                                                url : tinymce.baseURL + '/wp-mce-help.php',
     
    8080                        ed.addButton('wp_help', {
    8181                                title : 'wordpress.wp_help_desc',
    8282                                image : url + '/img/help.gif',
    83                                 cmd : 'WP_Help' 
     83                                cmd : 'WP_Help'
    8484                        });
    8585
    8686                        ed.addButton('wp_adv', {
     
    9090                        });
    9191
    9292                        // Add class "alignleft", "alignright" and "aligncenter" when selecting align for images.
    93                         ed.onExecCommand.add(function( editor, cmd ) {
    94                                 var node, bl, dom = editor.dom;
     93                        ed.onExecCommand.add(function( ed, cmd ) {
     94                                var n, bl, dom = ed.dom;
    9595
    9696                                if ( 'JustifyCenter' == cmd ) {
    97                                         if ( ( node = editor.selection.getNode() ) && node.nodeName == 'IMG' ) {
    98                                                 if ( ! dom.hasClass( node, "aligncenter" ) && ( bl = editor.forceBlocks.getParentBlock(node) ) && bl.childNodes.length == 1 )
    99                                                         dom.setStyle(bl, 'text-align', '');
    100                                         }
    101                                         editor.execCommand('mceRepaint');
     97                                        tinymce.each(dom.select('img'), function(n) {
     98                                                var v = n.className;
     99
     100                                                if (v.indexOf('aligncenter') == -1) {
     101                                                        dom.getParent(n, function(P) {
     102                                                                if (P && P.style && P.style.textAlign == 'center')
     103                                                                        dom.setStyle(P, 'textAlign', '');
     104                                                        });
     105                                                }
     106                                        });
     107
     108                                        ed.execCommand('mceRepaint');
    102109                                }
    103110                        });
    104111
    105                         ed.onBeforeExecCommand.add(function( editor, cmd ) {
    106                                 var node, dir, xdir, bl, dom = editor.dom;
     112                        ed.onBeforeExecCommand.add(function( ed, cmd ) {
     113                                var n, dir, xdir, bl, dom = ed.dom;
    107114
    108                                 if ( ( cmd.indexOf('Justify') != -1 ) && ( node = editor.selection.getNode() ) ) {
    109                                         if ( 'JustifyFull' == cmd || node.nodeName !== 'IMG' ) return;
     115                                if ( ( cmd.indexOf('Justify') != -1 ) && ( n = ed.selection.getNode() ) ) {
     116                                        if ( 'JustifyFull' == cmd || n.nodeName !== 'IMG' ) return;
    110117                                        dir = cmd.substring(7).toLowerCase();
    111118
    112                                         if (  editor.queryCommandState( cmd ) ) {
    113                                                 dom.removeClass( node, "alignleft" );
    114                                                 dom.removeClass( node, "alignright" );
    115                                                 dom.removeClass( node, "aligncenter" );
     119                                        if (  ed.queryCommandState( cmd ) ) {
     120                                                n.className = n.className.replace(/align[^ '"]+\s?/g, '');
     121                                                dom.addClass( n, "alignnone" );
    116122                                        } else if ( 'JustifyCenter' == cmd ) {
    117                                                 dom.removeClass( node, "alignleft" );
    118                                                 dom.removeClass( node, "alignright" );
     123                                                n.className = n.className.replace(/alignleft\s?|alignright\s?|alignnone\s?/g, '');
     124                                                if ( dom.hasClass( n, "aligncenter" ) ) {
     125                                                        dom.removeClass( n, "aligncenter" );
     126                                                        dom.addClass( n, "alignnone" );
     127                                                } else
     128                                                        dom.addClass( n, "aligncenter" );
    119129
    120                                                 if ( dom.hasClass( node, "aligncenter" ) ) {
    121                                                         dom.removeClass( node, "aligncenter" );
    122                                                         if ( ( bl = editor.forceBlocks.getParentBlock(node) ) && bl.childNodes.length == 1 && tinymce.isGecko )
    123                                                                 editor.selection.select(bl.firstChild);
    124                                                 } else dom.addClass( node, "aligncenter" );
    125 
    126130                                        } else {
    127                                                 xdir = ( dir == 'left' ) ? 'right' : 'left';
    128                                                 dom.removeClass( node, "aligncenter" );
    129                                                 dom.removeClass( node, "align"+xdir );
    130                                                 dom.addClass( node, "align"+dir );
     131                                                n.className = n.className.replace(/align[^ '"]+\s?/g, '');
     132                                                dom.addClass( n, "align"+dir );
    131133                                        }
    132134                                }
    133135                        });
  • wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css

     
    44        right: 0;
    55}
    66
    7 .align .field label {
     7#basic .align .field label {
    88        display: block;
    99        float: right;
    10         padding: 0 25px 0 0;
     10        padding: 0 24px 0 0;
    1111        margin: 5px 3px 5px 5px;
    1212}
    1313
     
    3636        text-align: right;
    3737}
    3838
    39 .alignleft {
    40         float: right;
    41 }
    42 
    4339.show-align,
    44 .alignright {
     40.alignright,
     41#img_size {
    4542        float: left;
    4643}
    4744
     
    5047#img_dim label,
    5148#img_dim input,
    5249#img_prop label,
    53 #img_prop input {
     50#img_prop input,
     51#img_size_div,
     52.alignleft {
    5453        float: right;
    5554}
    5655
     
    6362#img_prop input {
    6463        margin: 0 5px 0 10px;
    6564}
     65
     66#img_size_title {
     67        text-align: left;
     68}
  • wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css

     
    1818        -webkit-border-radius: 3px;
    1919        border-radius: 3px;
    2020        cursor: pointer;
    21         text-decoration: none; 
     21        text-decoration: none;
    2222}
    2323
    2424textarea,
     
    5959}
    6060
    6161th.label {
    62         width: 128px;
     62        width: 107px;
    6363}
    6464
    6565.show-align {
     
    104104#sidemenu,
    105105#sidemenu li {
    106106        list-style: none;
    107        
    108107}
    109108
    110109#sidemenu li {
    111        
    112110        display: inline;
    113111}
    114112
     
    128126}
    129127
    130128#sidemenu a.current {
    131         -moz-border-radius-topleft:4px;
    132         -moz-border-radius-topright:4px;
     129        -moz-border-radius-topleft: 4px;
     130        -khtml-border-top-left-radius: 4px;
     131        -webkit-border-top-left-radius: 4px;
     132        border-top-left-radius: 4px;
     133        -moz-border-radius-topright: 4px;
     134        -khtml-border-top-right-radius: 4px;
     135        -webkit-border-top-right-radius: 4px;
     136        border-top-right-radius: 4px;
    133137        border-style:solid;
    134138        border-width:1px;
    135139        font-weight:normal;
     
    175179        margin-right: 10px;
    176180}
    177181
     182#basic .align .field label {
     183        padding: 0 0 0 24px;
     184}
     185
     186#basic {
     187        padding-top: 2px;
     188}
     189
     190td {
     191        padding: 2px 0;
     192}
     193
     194#img_size {
     195        float: right;
     196        text-align: center;
     197        cursor: pointer;
     198        background-color: #f1f1f1;
     199        padding: 5px 0;
     200        width: 45px;
     201}
     202
     203#img_size div {
     204        font-size: 10px;
     205        padding: 2px;
     206        border: 1px solid #f1f1f1;
     207        line-height: 15px;
     208        height: 15px;
     209        -moz-border-radius: 3px;
     210        -khtml-border-radius: 3px;
     211        -webkit-border-radius: 3px;
     212        border-radius: 3px;
     213        color: #07273E;
     214}
     215
     216#img_size div#s100 {
     217        border-color: #A3A3A3;
     218        background-color: #E5E5E5;
     219}
     220
     221#img_size_div {
     222        width: 100px;
     223        float: left;
     224        cursor: default;
     225}
     226
     227#img_size_title {
     228        margin: 0 7px 5px;
     229        text-align: right;
     230        font-weight: bold;
     231}
     232
     233#img_align_td {
     234        padding: 2px 0 8px;
     235}
  • wp-includes/js/tinymce/plugins/wpeditimage/editimage.html

     
    88<script type="text/javascript" src="../../utils/form_utils.js?ver=3101"></script>
    99
    1010<link rel="stylesheet" href="css/editimage.css?ver=3101" type="text/css" media="all" />
    11 <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-bleeding2" type="text/css" media="all" />
     11<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta1" type="text/css" media="all" />
    1212<script type="text/javascript">
    1313if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
    1414        document.write('<link rel="stylesheet" href="css/editimage-rtl.css?ver=3101" type="text/css" media="all" />');
     
    2626
    2727<div id="img-edit">
    2828<form class="media-upload-form" action="" onsubmit="wpImage.update();">
    29 
    30         <label for="show_align">
    31                 <span id="show_align_sp" class="alignleft">{#preview.preview_desc}</span>
    32         </label>
     29        <div id="img_size_div">
     30                <div id="img_size_title">{#wpeditimage.size}</div>
     31                <div id="img_size" onmouseout="wpImage.showSizeRem()">
     32                        <div id="s130" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s130}</div>
     33                        <div id="s120" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s120}</div>
     34                        <div id="s110" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s110}</div>
     35                        <div id="s100" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s100}</div>
     36                        <div id="s90" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s90}</div>
     37                        <div id="s80" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s80}</div>
     38                        <div id="s70" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s70}</div>
     39                        <div id="s60" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s60}</div>
     40                </div>
     41        </div>
    3342        <div class="show-align" id="show_align">
    3443                <img id="img_demo" src="img/image.png" alt="" />
    3544                <span id="img_demo_txt">
     
    6574                        </td>
    6675                </tr>
    6776
    68                 <tr class="image-size">
    69                         <th valign="top" scope="row" class="label">
    70                                 <label for="img_size">
    71                                 <span class="alignleft">{#wpeditimage.size}</span>
    72                                 </label>
    73                         </th>
    74                         <td class="field" id="img_size">
    75                                 <input onclick="wpImage.imgEditSize('thumbnail')" type="radio" name="img_size" id="thumbnail" value="thumbnail" />
    76                                 <label for="thumbnail" id="lb_sizethumb">{#wpeditimage.thumbnail}</label>
    77 
    78                                 <input onclick="wpImage.imgEditSize('medium')" type="radio" name="img_size" id="medium" value="medium" />
    79                                 <label for="medium" id="lb_sizemedium">{#wpeditimage.medium}</label>
    80 
    81                                 <input onclick="wpImage.imgEditSize('full')" type="radio" name="img_size" id="full" value="full" />
    82                                 <label for="full" id="lb_sizefull">{#wpeditimage.full_size}</label>
    83                         </td>
    84                 </tr>
    85 
    8677                <tr class="">
    8778                        <th valign="top" scope="row" class="label">
    8879                                <label for="img_title">
     
    114105                                </label>
    115106                        </th>
    116107                        <td class="field">
    117                                 <input type="text" id="link_href" name="link_href" value="" /><br />
     108                                <input type="text" id="link_href" name="link_href" value="" size="60" /><br />
    118109                                <input type="button" class="button" onclick="wpImage.I('link_href').value='';" value="{#wpeditimage.none}" />
    119110                                <input type="button" class="button" id="img_url_current" onclick="wpImage.img_seturl('current')" value="{#wpeditimage.current_link}" />
    120111                                <input type="button" class="button" id="img_url_img" onclick="wpImage.img_seturl('link')" value="{#wpeditimage.link_to_img}" />
  • wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js

     
    2525                                });
    2626                        });
    2727
    28                         ed.onExecCommand.add(function(ed, cmd, ui, val) {
    29                         if ( 'mceFullScreen' == cmd )
    30                                         ed.plugins.wpeditimage.hideButtons();
     28                        ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
     29                                ed.plugins.wpeditimage.hideButtons();
    3130                });
    3231
    3332                        ed.onSaveContent.add(function(ed, o) {
     
    4342                                if ( tinymce.isOpera ) return;
    4443                                ed.plugins.wpeditimage.showButtons(e);
    4544                        });
     45/*
     46                        ed.onSetContent.add(function() {
     47                                t._fixCenter(ed.getBody());
     48                        });
     49
     50                        ed.onPreProcess.add(function(ed, o) {
     51                                if (o.set)
     52                                        t._fixCenter(o.node);
     53
     54                                if (o.get)
     55                                        ed.dom.removeClass(ed.dom.select('p', o.node), 'mce_iecenter');
     56                        });
     57*/
    4658                },
    4759
     60                _fixCenter : function(c) {
     61                        var ed = tinyMCE.activeEditor;
     62
     63                        tinymce.each(ed.dom.select('img', c), function(n) {
     64                                if ( ed.dom.hasClass(n, 'aligncenter') ) {
     65                                        var P = ed.dom.getParent(n, 'p');
     66                                        if ( tinymce.isIE )
     67                                                ed.dom.addClass(P, 'mce_iecenter');
     68                                        if ( P.style && P.style.textAlign == 'center' )
     69                                                ed.dom.setStyle(P, 'textAlign', '');
     70                                }
     71                        });
     72                },
     73
    4874                showButtons : function(e) {
    4975                        var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y, el = e.target;
    5076
     
    6995                                t.btnsTout = window.setTimeout( function(){ed.plugins.wpeditimage.hideButtons();}, 5000 );
    7096                        }
    7197                },
    72                
     98
    7399                hideButtons : function() {
    74100                        tinymce.DOM.hide('wp_editbtns');
    75101                        window.clearTimeout(this.btnsTout);
  • wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js

     
    3838        close : function() {
    3939                var t = this, win = t.getWin();
    4040
     41               
    4142                // To avoid domain relaxing issue in Opera
    4243                function close() {
     44                        win.tb_remove();
    4345                        t.editor.execCommand('mceRepaint');
    44                         win.tb_remove();
    4546                        tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
    4647                };
    4748
     
    8081
    8182                for ( i = 0; i < styles.length; i++ ) {
    8283                        var url = styles.item(i).href;
    83                         if ( url && url.indexOf('colors-') != -1 ) {
     84                        if ( url && url.indexOf('colors-') != -1 )
    8485                                document.write( '<link rel="stylesheet" href="'+url+'" type="text/css" media="all" />' );
    85                                 break;
    86                         }
    8786                }
    8887        },
    8988
     
    9594        link : '',
    9695        link_rel : '',
    9796        target_value : '',
     97        current_size_sel : 's100',
     98        width : '',
     99        height : '',
    98100
    99101        setTabs : function(tab) {
    100102                var t = this;
    101                
     103
    102104                if ( 'current' == tab.className ) return false;
    103105                t.I('div_advanced').style.display = ( 'tab_advanced' == tab.id ) ? 'block' : 'none';
    104106                t.I('div_basic').style.display = ( 'tab_basic' == tab.id ) ? 'block' : 'none';
     
    131133                cls += (' ' + v);
    132134                cls = cls.replace( /\s+/g, ' ' ).replace( /^\s/, '' );
    133135
     136                if ( 'aligncenter' == v ) {
     137                        t.I('hspace').value = '';
     138                        t.updateStyle('hspace');
     139                }
     140               
    134141                t.I('img_classes').value = cls;
    135142        },
    136143
    137         imgSizeCls : function(v) {
    138                 var t = this, cls = t.I('img_classes').value;
     144        showSize : function(el) {
     145                var t = this, demo = t.I('img_demo'), w = t.width, h = t.height, id = el.id || 's100', size;
    139146
    140                 if (v) {
    141                         if ( cls.indexOf('size-') != -1 )
    142                                 cls = cls.replace( /size-[^ "']+/i, 'size-' + v );
    143                         else cls += (' size-' + v);
    144                 } else {
    145                         cls = cls.replace( /size-[^ "']+/gi, '' );
    146                         t.demoSetSize();
    147                         t.I('thumbnail').checked = '';
    148                         t.I('medium').checked = '';
    149                         t.I('full').checked = '';
    150                 }
    151                 cls = cls.replace( /\s+/g, ' ' ).replace( /^\s|\s$/, '' );
     147                size = parseInt(id.substring(1)) / 200;
     148                demo.width = Math.round(w * size);
     149                demo.height = Math.round(h * size);
    152150
    153                 t.I('img_classes').value = cls;
     151                t.showSizeClear();
     152                el.style.borderColor = '#A3A3A3';
     153                el.style.backgroundColor = '#E5E5E5';
    154154        },
    155155
    156         imgEditSize : function(size) {
     156        showSizeRem : function() {
     157                var t = this, demo = t.I('img_demo'), f = document.forms[0];
     158
     159                demo.width = Math.round(f.width.value * 0.5);
     160                demo.height = Math.round(f.height.value * 0.5);
     161                t.showSizeClear();
     162                t.I(t.current_size_sel).style.borderColor = '#A3A3A3';
     163                t.I(t.current_size_sel).style.backgroundColor = '#E5E5E5';
     164
     165                return false;
     166        },
     167
     168        showSizeClear : function() {
     169                var divs = this.I('img_size').getElementsByTagName('div');
     170
     171                for ( i = 0; i < divs.length; i++ ) {
     172                        divs[i].style.borderColor = '#f1f1f1';
     173                        divs[i].style.backgroundColor = '#f1f1f1';
     174                }
     175        },
     176
     177        imgEditSize : function(el) {
    157178                var t = this, f = document.forms[0], sz, m = null;
    158179
    159                 var W = parseInt(t.preloadImg.width), H = parseInt(t.preloadImg.height);
     180                var W = parseInt(t.preloadImg.width), H = parseInt(t.preloadImg.height), w = t.width || W, h = t.height || H, id = el.id || 's100';
    160181
    161182                if ( ! t.preloadImg || W == "" || H == "" )
    162183                        return;
    163184
    164                 switch(size) {
    165                         case 'thumbnail':
    166                                 m = 150;
    167                                 t.imgSizeCls('thumbnail');
    168                                 break;
    169                         case 'medium':
    170                                 m = 300;
    171                                 t.imgSizeCls('medium');
    172                                 break;
    173                         case 'full':
    174                                 m = 500;
    175                                 t.imgSizeCls('full');
    176                                 break;
    177                 }
     185                size = parseInt(id.substring(1)) / 100;
    178186
    179                 if (m) {
    180                         if ( W > H ) {
    181                                 m = Math.min(W, m);
    182                                 f.width.value = m;
    183                                 f.height.value = Math.round((m / W) * H);
    184                         } else {
    185                                 m = Math.min(H, m);
    186                                 f.height.value = m;
    187                                 f.width.value = Math.round((m / H) * W);
    188                         }
     187                w = Math.round(w * size);
     188                h = Math.round(h * size);
    189189
    190                         t.width = f.width.value;
    191                         t.height = f.height.value;
    192                 }
     190                f.width.value = Math.min(W, w);
     191                f.height.value = Math.min(H, h);
     192
     193                t.current_size_sel = id;
    193194                t.demoSetSize();
    194195        },
    195196
     
    199200                demo.width = f.width.value ? Math.floor(f.width.value * 0.5) : '';
    200201                demo.height = f.height.value ? Math.floor(f.height.value * 0.5) : '';
    201202        },
    202        
     203
    203204        demoSetStyle : function() {
    204                 var f = document.forms[0], demo = this.I('img_demo');
     205                var f = document.forms[0], demo = this.I('img_demo'), dom = tinyMCEPopup.editor.dom;
    205206
    206                 if (demo)
    207                         tinyMCEPopup.editor.dom.setAttrib(demo, 'style', f.img_style.value);
     207                if (demo) {
     208                        dom.setAttrib(demo, 'style', f.img_style.value);
     209                        dom.setStyle(demo, 'width', '');
     210                        dom.setStyle(demo, 'height', '');
     211                }
    208212        },
    209        
     213
    210214        origSize : function() {
    211                 var t = this, f = document.forms[0];
    212                
    213                 f.width.value = t.preloadImg.width;
    214                 f.height.value = t.preloadImg.height;
     215                var t = this, f = document.forms[0], el = t.I('s100');
     216
     217                f.width.value = t.width = t.preloadImg.width;
     218                f.height.value = t.height = t.preloadImg.height;
    215219                t.demoSetSize();
    216                 t.imgSizeCls();
     220                t.showSize(el);
    217221        },
    218222
    219223        init : function() {
     
    231235
    232236        setup : function() {
    233237                var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom;
    234         document.dir = tinyMCEPopup.editor.getParam('directionality','');
     238                document.dir = tinyMCEPopup.editor.getParam('directionality','');
    235239                tinyMCEPopup.restoreSelection();
    236240                el = ed.selection.getNode();
    237241                if (el.nodeName != 'IMG') return;
    238242
    239243                f.img_src.value = d.src = link = ed.dom.getAttrib(el, 'src');
     244                ed.dom.setStyle(el, 'float', '');
    240245
    241246                f.img_title.value = ed.dom.getAttrib(el, 'title');
    242247                f.img_alt.value = ed.dom.getAttrib(el, 'alt');
     
    248253                f.height.value = t.height = ed.dom.getAttrib(el, 'height');
    249254                f.img_classes.value = c = ed.dom.getAttrib(el, 'class');
    250255                f.img_style.value = ed.dom.getAttrib(el, 'style');
    251                
     256
    252257                // Move attribs to styles
    253                 if (dom.getAttrib(el, 'align'))
    254                         t.updateStyle('align');
    255 
    256258                if (dom.getAttrib(el, 'hspace'))
    257259                        t.updateStyle('hspace');
    258260
     
    272274                }
    273275
    274276                f.link_target.checked = ( t.target_value && t.target_value == '_blank' ) ? 'checked' : '';
    275                
     277
    276278                fname = link.substring( link.lastIndexOf('/') );
    277279                fname = fname.replace(/-[0-9]{2,4}x[0-9]{2,4}/, '' );
    278280                t.link = link.substring( 0, link.lastIndexOf('/') ) + fname;
    279281
    280                 if ( c.indexOf('size-thumbnail') != -1 )
    281                         t.I('thumbnail').checked = "checked";
    282                 else if ( c.indexOf('size-medium') != -1 )
    283                         t.I('medium').checked = "checked";
    284                 else if ( c.indexOf('size-full') != -1 )
    285                         t.I('full').checked = "checked";
    286 
    287282                if ( c.indexOf('alignleft') != -1 ) {
    288283                        t.I('alignleft').checked = "checked";
    289284                        d.className = "alignleft";
     
    298293                        d.className = "alignnone";
    299294                }
    300295
    301                 document.body.style.display = '';
    302296                t.getImageData();
    303                 t.demoSetStyle();
    304297
     298                if ( (t.width * 1.3) > parseInt(t.preloadImg.width) ) {
     299                        var s130 = t.I('s130'), s120 = t.I('s120'), s110 = t.I('s110');
     300
     301                        s130.onclick = s120.onclick = s110.onclick = null;
     302                        s130.onmouseover = s120.onmouseover = s110.onmouseover = null;
     303                        s130.style.color = s120.style.color = s110.style.color = '#aaa';
     304                }
     305
     306                document.body.style.display = '';
     307/*
    305308                // Test if is attachment
    306 //              if ( (id = c.match( /wp-image-([0-9]{1,6})/ )) && id[1] ) {
    307 //                      t.I('tab_attachment').href = tinymce.documentBaseURL + 'media.php?action=edit&attachment_id=' + id[1];
    308 //                      t.I('tab_attachment').style.display = 'inline';
    309 //              }
     309                if ( (id = c.match( /wp-image-([0-9]{1,6})/ )) && id[1] ) {
     310                        t.I('tab_attachment').href = tinymce.documentBaseURL + 'media.php?action=edit&attachment_id=' + id[1];
     311                        t.I('tab_attachment').style.display = 'inline';
     312                }
     313*/
    310314        },
    311315
    312316        remove : function() {
     
    327331        },
    328332
    329333        update : function() {
    330                 var t = this, f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, p, el, b;
     334                var t = this, f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, el, P, v = f.img_classes.value;
    331335
    332336                tinyMCEPopup.restoreSelection();
    333337                el = ed.selection.getNode();
    334338
    335339                if (el.nodeName != 'IMG') return;
    336340                if (f.img_src.value === '') t.remove();
     341                P = ed.dom.getParent(el, 'p');
     342                if ( P && P.style && P.style.textAlign == 'center' )
     343                        ed.dom.setStyle(P, 'textAlign', '');
     344/*
     345                if ( tinymce.isIE ) {
     346                        if ( f.img_classes.value.indexOf('aligncenter') != -1 )
     347                                ed.dom.addClass(P, 'mce_iecenter');
     348                        else ed.dom.removeClass(P, 'mce_iecenter');
     349                }
     350*/
     351                if ( v.indexOf('alignleft') != -1 )
     352                        tinyMCEPopup.execCommand('JustifyLeft');
     353                else if ( v.indexOf('alignright') != -1 )
     354                        tinyMCEPopup.execCommand('JustifyRight');
     355                else if ( v.indexOf('aligncenter') != -1 )
     356                        tinyMCEPopup.execCommand('JustifyCenter');
    337357
    338358                ed.dom.setAttribs(el, {
    339359                        src : f.img_src.value,
     
    392412                tinyMCEPopup.execCommand("mceEndUndoLevel");
    393413                tinyMCEPopup.close();
    394414        },
    395        
     415
    396416        updateStyle : function(ty) {
    397417                var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : f.img_style.value});
    398418
     
    466486        resetImageData : function() {
    467487                var f = document.forms[0];
    468488
    469                 f.width.value = f.height.value = '';   
     489                f.width.value = f.height.value = '';
    470490        },
    471491
    472492        updateImageData : function() {
  • wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css

     
    1111a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;}
    1212img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;}
    1313img {border:0;}
     14table {cursor:default}
     15table td, table th {cursor:text}
     16ins {border-bottom:1px solid green; text-decoration: none; color:green}
     17del {color:red; text-decoration:line-through}
     18cite {border-bottom:1px dashed blue}
     19acronym {border-bottom:1px dotted #CCC; cursor:help}
    1420
    15 /* IE
    16 * html body {
    17 scrollbar-3dlight-color:#F0F0EE;
    18 scrollbar-arrow-color:#676662;
    19 scrollbar-base-color:#F0F0EE;
    20 scrollbar-darkshadow-color:#DDD;
    21 scrollbar-face-color:#E0E0DD;
    22 scrollbar-highlight-color:#F0F0EE;
    23 scrollbar-shadow-color:#F0F0EE;
    24 scrollbar-track-color:#F5F5F5;
     21p.mce_iecenter {
     22        text-align: center;
    2523}
    26 */
    27  No newline at end of file
  • wp-includes/js/tinymce/tiny_mce_config.php

     
    226226// Setup cache info
    227227if ( $disk_cache ) {
    228228
    229         $cacheKey = apply_filters('tiny_mce_version', '20080618');
     229        $cacheKey = apply_filters('tiny_mce_version', '20080622');
    230230
    231231        foreach ( $initArray as $v )
    232232                $cacheKey .= $v;
  • wp-includes/script-loader.php

     
    3535        $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080325' );
    3636
    3737        // Modify this version when tinyMCE plugins are changed.
    38         $mce_version = apply_filters('tiny_mce_version', '20080618');
     38        $mce_version = apply_filters('tiny_mce_version', '20080622');
    3939        $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
    4040
    4141        $scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');