WordPress.org

Make WordPress Core

Changeset 8307


Ignore:
Timestamp:
07/10/08 16:39:14 (6 years ago)
Author:
ryan
Message:

Fix image resizing inside captions, add edit alt field to the advanced tab. Props azaozz. see #6812

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/gears-manifest.php

    r8304 r8307  
    6565{ 
    6666"betaManifestVersion" : 1, 
    67 "version" : "<?php echo $man_version; ?>_20080709", 
     67"version" : "<?php echo $man_version; ?>_20080710", 
    6868"entries" : [ 
    6969<?php echo $defaults; ?> 
     
    132132{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" }, 
    133133{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" }, 
    134 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311" }, 
     134{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311c" }, 
    135135{ "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" }, 
    136136{ "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" }, 
     
    149149{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, 
    150150{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, 
    151 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311b" }, 
     151{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311c" }, 
    152152{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, 
    153153 
     
    162162{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, 
    163163{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, 
    164 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311b" }, 
     164{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311c" }, 
    165165{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, 
    166166{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, 
  • trunk/wp-includes/js/tinymce/langs/wp-langs.php

    r8290 r8307  
    412412medium:"' . mce_escape( __('Medium') ) . '", 
    413413full_size:"' . mce_escape( __('Full Size') ) . '", 
    414 alt_help:"' . js_escape( __('Alternate text, e.g. "The Mona Lisa"') )  . '", 
    415414current_link:"' . mce_escape( __('Current Link') ) . '", 
    416415link_to_img:"' . mce_escape( __('Link to Image') ) . '", 
     
    436435s130:"' . mce_escape( __('130%') ) . '", 
    437436img_title:"' . mce_escape( __('Edit Image Title') ) . '", 
    438 caption:"' . mce_escape( __('Edit Image Caption') ) . '" 
     437caption:"' . mce_escape( __('Edit Image Caption') ) . '", 
     438alt:"' . mce_escape( __('Edit Alternate Text') ) . '" 
    439439}); 
    440440'; 
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html

    r8290 r8307  
    55<title></title> 
    66 
    7 <script type="text/javascript" src="js/editimage.js?ver=311"></script> 
     7<script type="text/javascript" src="js/editimage.js?ver=311c"></script> 
    88<script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script> 
    99 
    10 <link rel="stylesheet" href="css/editimage.css?ver=311b" type="text/css" media="all" /> 
    11 <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta1" type="text/css" media="all" /> 
     10<link rel="stylesheet" href="css/editimage.css?ver=311c" type="text/css" media="all" /> 
     11<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta3" type="text/css" media="all" /> 
    1212<script type="text/javascript"> 
    1313if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) 
     
    7575        </tr> 
    7676 
    77         <tr class=""> 
     77        <tr> 
    7878            <th valign="top" scope="row" class="label"> 
    7979                <label for="img_title"> 
     
    8686        </tr> 
    8787 
    88         <tr class="post_excerpt"> 
    89             <th valign="top" scope="row" class="label"> 
    90                 <label for="img_alt"> 
     88        <tr> 
     89            <th valign="top" scope="row" class="label"> 
     90                <label for="img_cap"> 
    9191                <span class="alignleft">{#wpeditimage.caption}</span> 
    9292                </label> 
    9393            </th> 
    9494            <td class="field"> 
    95                 <input type="text" id="img_alt" name="img_alt" value="" size="60" /> 
    96                 <p class="help">{#wpeditimage.alt_help}</p> 
    97             </td> 
    98         </tr> 
    99  
    100         <tr class="url"> 
     95                <input type="text" id="img_cap" name="img_cap" value="" size="60" /> 
     96            </td> 
     97        </tr> 
     98 
     99        <tr> 
    101100            <th valign="top" scope="row" class="label"> 
    102101                <label for="link_href"> 
     
    130129            </td> 
    131130        </tr> 
     131         
     132        <tr> 
     133            <th valign="top" scope="row" class="label"> 
     134                <label for="img_alt"> 
     135                <span class="alignleft">{#wpeditimage.alt}</span> 
     136                </label> 
     137            </th> 
     138            <td class="field"> 
     139                <input type="text" id="img_alt" name="img_alt" value="" size="60" /> 
     140            </td> 
     141        </tr> 
    132142 
    133143        <tr id="img_dim"> 
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js

    r8290 r8307  
    1616                    return; 
    1717 
    18                 tb_show('', url + '/editimage.html?ver=311b&TB_iframe=true'); 
     18                tb_show('', url + '/editimage.html?ver=311c&TB_iframe=true'); 
    1919                tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); 
    2020            }); 
     
    3535 
    3636            ed.onMouseUp.add(function(ed, e) { 
    37                 if ( ! tinymce.isOpera ) return; 
    38                 if ( e.target.nodeName == 'IMG' ) 
    39                     ed.plugins.wpeditimage.showButtons(e.target); 
     37                if ( tinymce.isOpera ) { 
     38                    if ( e.target.nodeName == 'IMG' ) 
     39                        ed.plugins.wpeditimage.showButtons(e.target); 
     40                } else if ( ! tinymce.isWebKit ) { 
     41                    var n = ed.selection.getNode(), DL; 
     42                     
     43                    if ( n.nodeName == 'IMG' && (DL = ed.dom.getParent(n, 'DL')) ) {                     
     44                        window.setTimeout(function(){ 
     45                            var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'DL'); 
     46                         
     47                            if ( n.width != (parseInt(ed.dom.getStyle(DL, 'width')) - 10) ) { 
     48                                ed.dom.setStyle(DL, 'width', parseInt(n.width)+10); 
     49                                ed.execCommand('mceRepaint'); 
     50                            } 
     51                        }, 100); 
     52                    } 
     53                } 
    4054            }); 
    4155 
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js

    r8260 r8307  
    246246 
    247247    setup : function() { 
    248         var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom, DL, caption; 
     248        var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom, DL, caption = null; 
    249249        document.dir = tinyMCEPopup.editor.getParam('directionality',''); 
    250250        tinyMCEPopup.restoreSelection(); 
     
    256256        t.getImageData(); 
    257257        c = ed.dom.getAttrib(el, 'class'); 
    258         caption = t.img_alt = ed.dom.getAttrib(el, 'alt'); 
    259258 
    260259        if ( DL = dom.getParent(el, 'dl') ) { 
    261260            var dlc = ed.dom.getAttrib(DL, 'class'); 
    262261            dlc = dlc.match(/align[^ "']+/i); 
    263             if ( dlc && ! dom.hasClass(el, dlc) ) 
     262            if ( dlc && ! dom.hasClass(el, dlc) ) { 
    264263                c += ' '+dlc; 
     264                tinymce.trim(c); 
     265            } 
    265266 
    266267            tinymce.each(DL.childNodes, function(e) { 
     
    272273        } 
    273274 
     275        f.img_cap.value = caption; 
    274276        f.img_title.value = ed.dom.getAttrib(el, 'title'); 
    275         f.img_alt.value = caption; 
     277        f.img_alt.value = ed.dom.getAttrib(el, 'alt'); 
    276278        f.border.value = ed.dom.getAttrib(el, 'border'); 
    277279        f.vspace.value = ed.dom.getAttrib(el, 'vspace'); 
     
    356358        } 
    357359 
    358         if ( f.img_alt.value != '' && f.width.value != '' ) { 
     360        if ( f.img_cap.value != '' && f.width.value != '' ) { 
    359361            do_caption = 1; 
    360362            img_class = img_class.replace( /align[^ "']+\s?/gi, '' ); 
     
    371373            src : f.img_src.value, 
    372374            title : f.img_title.value, 
    373             alt : t.img_alt, 
     375            alt : f.img_alt.value, 
    374376            width : f.width.value, 
    375377            height : f.height.value, 
     
    430432 
    431433                if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp_caption_dd') ) 
    432                     ed.dom.setHTML(DD, f.img_alt.value); 
     434                    ed.dom.setHTML(DD, f.img_cap.value); 
    433435 
    434436            } else { 
     
    448450 
    449451                html = '<dl id="'+cap_id+'" class="wp_caption '+t.align+'" style="width: '+cap_width+ 
    450                 'px"><dt class="wp_caption_dt">'+html+'</dt><dd class="wp_caption_dd">'+f.img_alt.value+'</dd></dl>'; 
     452                'px"><dt class="wp_caption_dt">'+html+'</dt><dd class="wp_caption_dd">'+f.img_cap.value+'</dd></dl>'; 
    451453 
    452454                cap = ed.dom.create('div', {'class': div_cls}, html); 
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r8290 r8307  
    223223if ( $disk_cache ) { 
    224224 
    225     $cacheKey = apply_filters('tiny_mce_version', '20080708'); 
     225    $cacheKey = apply_filters('tiny_mce_version', '20080709'); 
    226226 
    227227    foreach ( $initArray as $v ) 
  • trunk/wp-includes/script-loader.php

    r8304 r8307  
    3838 
    3939    // Modify this version when tinyMCE plugins are changed. 
    40     $mce_version = apply_filters('tiny_mce_version', '20080708'); 
     40    $mce_version = apply_filters('tiny_mce_version', '20080709'); 
    4141    $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); 
    4242 
Note: See TracChangeset for help on using the changeset viewer.