Make WordPress Core

Changeset 8083


Ignore:
Timestamp:
06/14/2008 04:38:08 PM (18 years ago)
Author:
ryan
Message:

Image popup improvements from azaozz. Added translation strings, RTL support, several layout improvements, image border, hspace and vspace can be used as shortcuts to add css styles, the preview is visible on both tabs, etc. see #6811

Location:
trunk
Files:
8 edited

Legend:

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

    r8066 r8083  
    8888{
    8989"betaManifestVersion" : 1,
    90 "version" : "<?php echo $man_version; ?>_20080606",
     90"version" : "<?php echo $man_version; ?>_20080613",
    9191"entries" : [
    9292<?php echo $defaults; ?>
     
    178178{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=3091" },
    179179{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=3091" },
     180{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=3091" },
    180181{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=3091" },
    181182
  • trunk/wp-includes/js/thickbox/thickbox.css

    r7961 r8083  
    117117        position: fixed;
    118118        display:none;
    119         height:13px;
    120         width:208px;
    121119        z-index:103;
    122120        top: 50%;
    123121        left: 50%;
    124         margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */
     122        background-color: #E8E8E8;
     123        border: 4px solid #525252;
     124        margin: -45px 0pt 0pt -125px;
     125        padding: 40px 15px 15px;
    125126}
    126127
  • trunk/wp-includes/js/tinymce/langs/wp-langs.php

    r7380 r8083  
    398398wp_page_alt:"' . mce_escape( __('Next page...') ) . '"
    399399});
     400
     401tinyMCE.addI18n("' . $language . '.wpeditimage",{
     402edit_img:"' . mce_escape( __('Edit Image') )  . '",
     403adv_settings:"' . mce_escape( __('Advanced Settings') )  . '",
     404none:"' . mce_escape( __('None') )  . '",
     405size:"' . mce_escape( __('Size') ) . '",
     406thumbnail:"' . mce_escape( __('Thumbnail') ) . '",
     407medium:"' . mce_escape( __('Medium') ) . '",
     408full_size:"' . mce_escape( __('Full Size') ) . '",
     409alt_help:"' . js_escape( __('Alternate text, e.g. "The Mona Lisa"') )  . '",
     410current_link:"' . mce_escape( __('Current Link') ) . '",
     411link_to_img:"' . mce_escape( __('Link to Image') ) . '",
     412link_help:"' . mce_escape( __('Enter a link URL or click above for presets.') ) . '",
     413adv_img_settings:"' . mce_escape( __('Advanced Image Settings') ) . '",
     414source:"' . mce_escape( __('Source') )  . '",
     415width:"' . mce_escape( __('Width') ) . '",
     416height:"' . mce_escape( __('Height') ) . '",
     417orig_size:"' . mce_escape( __('Original Size') ) . '",
     418css:"' . mce_escape( __('CSS Class') ) . '",
     419adv_link_settings:"' . mce_escape( __('Advanced Link Settings') )  . '",
     420link_rel:"' . mce_escape( __('Link Rel') ) . '",
     421height:"' . mce_escape( __('Height') ) . '",
     422orig_size:"' . mce_escape( __('Original Size') ) . '",
     423css:"' . mce_escape( __('CSS Class') ) . '",
     424caption:"' . mce_escape( __('Caption') ) . '"
     425});
    400426';
    401427?>
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css

    r8066 r8083  
    3939}
    4040
     41img.alignright,
    4142.alignright {
    4243        float: right;
    4344}
    4445
     46img.alignleft,
    4547.alignleft {
    4648        float: left;
    4749}
    4850
    49 .aligncenter {
     51img.aligncenter {
    5052        display: block;
    5153        margin-left: auto;
     
    6264
    6365.show-align {
    64         padding: 8px;
    6566        height: 200px;
     67        width: 480px;
     68        float: right;
    6669        background-color: #f1f1f1;
    6770        cursor: default;
     
    7477        border: 1px solid #c0c0c0;
    7578        width: 623px;
    76         margin: 20px auto auto;
     79        margin: 15px auto;
    7780}
    7881
     
    9194
    9295#img_demo {
    93         padding: 0 5px 4px;
     96        padding: 0;
    9497}
    9598
     
    138141
    139142#media-upload h3 {
    140         clear:both;
    141         padding:0pt 0pt 3px;
    142         border-bottom-style:solid;
    143         border-bottom-width:1px;
    144         font-family:Georgia,"Times New Roman",Times,serif;
    145         font-size:20px;
    146         font-weight:normal;
    147         line-height:normal;
    148         margin:20px 0 15px -4px;
    149         padding:0 0 3px 0;
    150         border-bottom-color:#DADADA;
    151         color:#5A5A5A;
     143        clear: both;
     144        padding: 0pt 0pt 3px;
     145        border-bottom-style: solid;
     146        border-bottom-width: 1px;
     147        font-family: Georgia,"Times New Roman",Times,serif;
     148        font-size: 20px;
     149        font-weight: normal;
     150        line-height: normal;
     151        margin: 0 0 10px -4px;
     152        padding: 15px 0 3px;
     153        border-bottom-color: #DADADA;
     154        color: #5A5A5A;
    152155}
    153156
    154157#img_dim #width,
    155 #img_dim #height {
    156         width:40px;
     158#img_dim #height,
     159#img_prop #border,
     160#img_prop #vspace,
     161#img_prop #hspace {
     162        width: 36px;
    157163}
    158164
     
    161167}
    162168
    163 #basic .align .field label {
    164         margin: 0 10px 0 0;
    165         padding: 0 0 0 25px;
     169#show_align_sp {
     170        width: 115px;
    166171}
    167172
     173#img_dim input,
     174#img_prop input {
     175        margin-right: 10px;
     176}
     177
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html

    r8066 r8083  
    11<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2 <html xmlns="http://www.w3.org/1999/xhtml"  dir="ltr" lang="en-US">
     2<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
    33<head>
    44<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     
    1010<link rel="stylesheet" href="css/editimage.css?ver=3091" type="text/css" media="all" />
    1111<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-bleeding2" type="text/css" media="all" />
     12<script type="text/javascript">
     13if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
     14        document.write('<link rel="stylesheet" href="css/editimage-rtl.css?ver=3091" type="text/css" media="all" />');
     15</script>
    1216<base target="_self" />
    1317</head>
     
    1620<div id="media-upload-header">
    1721        <ul id="sidemenu">
    18         <li><a href="javascript:;" id="tab_basic" class="current" onclick="wpImage.setTabs(this);">Edit image</a></li>
    19         <li><a href="javascript:;" id="tab_advanced" onclick="wpImage.setTabs(this);">Advanced settings</a></li>
    20         <li><a href="javascript:;" id="tab_attachment" style="display:none" target="_blanc" onclick="tinyMCEPopup.close();">Edit Attachment</a></li>
     22        <li><a href="javascript:;" id="tab_basic" class="current" onclick="wpImage.setTabs(this);">{#wpeditimage.edit_img}</a></li>
     23        <li><a href="javascript:;" id="tab_advanced" onclick="wpImage.setTabs(this);">{#wpeditimage.adv_settings}</a></li>
    2124        </ul>
    2225</div>
    2326
    2427<div id="img-edit">
    25         <form class="media-upload-form" action="" onsubmit="wpImage.update();">
    26         <div id="div_basic">
    27 
    28         <div class="show-align">
     28<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>
     33        <div class="show-align" id="show_align">
    2934                <img id="img_demo" src="img/image.png" alt="" />
    3035                <span id="img_demo_txt">
     
    3237                Ut lorem In penatibus libero id ipsum sagittis nec elit Sed. Condimentum eget Vivamus vel consectetuer lorem molestie turpis amet tellus id. Condimentum vel ridiculus Fusce sed pede Nam nunc sodales eros tempor. Sit lacus magna dictumst Curabitur fringilla auctor id vitae wisi facilisi. Fermentum eget turpis felis velit leo Nunc Proin orci molestie Praesent. Curabitur tellus scelerisque suscipit ut sem amet cursus mi Morbi eu. Donec libero Vestibulum augue et mollis accumsan ornare condimentum In enim. Leo eget ac consectetuer quis condimentum malesuada.
    3338                Condimentum commodo et Lorem fringilla malesuada libero volutpat sem tellus enim. Tincidunt sed at Aenean nec nonummy porttitor Nam Sed Nulla ut. Auctor leo In aliquet Curabitur eros et velit Quisque justo morbi. Et vel mauris sit nulla semper vitae et quis at dui. Id at elit laoreet justo eu mauris Quisque et interdum pharetra. Nullam accumsan interdum Maecenas condimentum quis quis Fusce a sollicitudin Sed. Non Quisque Vivamus congue porttitor non semper ipsum porttitor quis vel. Donec eros lacus volutpat et tincidunt sem convallis id venenatis sit. Consectetuer odio.
    34                 Semper faucibus Morbi nulla convallis orci Aliquam Sed porttitor et Pellentesque. Venenatis laoreet lorem id a a Morbi augue turpis id semper. Arcu volutpat ac mauris Vestibulum fringilla Aenean condimentum nibh sed id. Sagittis eu lacus orci urna tellus tellus pretium Curabitur dui nunc. Et nibh eu eu nibh adipiscing at lorem Vestibulum adipiscing augue. Magna convallis Phasellus dolor malesuada Curabitur ornare adipiscing tellus Aliquam tempus. Id Aliquam Integer augue Nulla consectetuer ac Donec Curabitur tincidunt et. Id vel Nunc amet lacus dui magna ridiculus penatibus laoreet Duis. Enim sagittis nibh quis Nulla nec laoreet vel Maecenas mattis vel. Nullam velit est Curabitur gravida Vestibulum justo.
     39                Semper faucibus Morbi nulla convallis orci Aliquam Sed porttitor et Pellentesque. Venenatis laoreet lorem id a a Morbi augue turpis id semper. Arcu volutpat ac mauris Vestibulum fringilla Aenean condimentum nibh sed id. Sagittis eu lacus orci urna tellus tellus pretium Curabitur dui nunc. Et nibh eu eu nibh adipiscing at lorem Vestibulum adipiscing augue. Magna convallis Phasellus dolor malesuada Curabitur ornare adipiscing tellus Aliquam tempus. Id Aliquam Integer augue Nulla consectetuer ac Donec Curabitur tincidunt et. Id vel Nunc amet lacus dui magna ridiculus penatibus laoreet Duis. Enim sagittis nibh quis Nulla nec laoreet vel Maecenas mattis vel.
    3540                </span>
    3641        </div>
    3742
    38         <table id="basic" class="describe">     
     43        <div id="div_basic">
     44        <table id="basic" class="describe">
    3945                <tbody>
    40                 <tr class="">
    41                         <th valign="top" scope="row" class="label">
    42                                 <label for="img_title">
    43                                 <span class="alignleft">Title</span>
    44                                 <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    45                                 </label>
    46                         </th>
    47                         <td class="field">
    48                                 <input type="text" id="img_title" name="img_title" value="" aria-required="true" size="60" />
    49                         </td>
    50                 </tr>
    51 
    52                 <tr class="post_excerpt">
    53                         <th valign="top" scope="row" class="label">
    54                                 <label for="img_alt">
    55                                 <span class="alignleft">Caption</span>
    56                                 </label>
    57                         </th>
    58                         <td class="field">
    59                                 <input type="text" id="img_alt" name="img_alt" value="" size="60" />
    60                                 <p class="help">Alternate text, e.g. "The Mona Lisa"</p>
    61                         </td>
    62                 </tr>
    63 
    64                 <tr class="url">
    65                         <th valign="top" scope="row" class="label">
    66                                 <label for="link_href">
    67                                 <span class="alignleft" id="lb_link_href">Link URL</span>
    68                                 </label>
    69                         </th>
    70                         <td class="field">
    71                                 <input type="text" id="link_href" name="link_href" value="" /><br />
    72                                 <input type="button" class="button" onclick="wpImage.I('link_href').value='';" value="None" />
    73                                 <input type="button" class="button" id="img_url_current" onclick="wpImage.img_seturl('current')" value="Current Link" />
    74                                 <input type="button" class="button" id="img_url_img" onclick="wpImage.img_seturl('link')" value="Link to Image" />
    75                                 <p class="help">Enter a link URL or click above for presets.</p>
    76                         </td>
    77                 </tr>
    7846
    7947                <tr class="align">
    8048                        <th valign="top" scope="row" class="label">
    8149                                <label for="img_align_td">
    82                                 <span class="alignleft">{#advanced_dlg.image_align}</span>
     50                                <span class="alignleft">{#contextmenu.align}</span>
    8351                                </label>
    8452                        </th>
    8553                        <td class="field" id="img_align_td">
    8654                                <input type="radio" onclick="wpImage.imgAlignCls('alignnone')" name="img_align" id="alignnone" value="alignnone" />
    87                                 <label for="alignnone" class="align image-align-none-label">None</label>
     55                                <label for="alignnone" class="align image-align-none-label">{#wpeditimage.none}</label>
    8856
    8957                                <input type="radio" onclick="wpImage.imgAlignCls('alignleft')" name="img_align" id="alignleft" value="alignleft" />
    90                                 <label for="alignleft" class="align image-align-left-label">{#advanced_dlg.image_align_left}</label>
     58                                <label for="alignleft" class="align image-align-left-label">{#contextmenu.left}</label>
    9159
    9260                                <input type="radio" onclick="wpImage.imgAlignCls('aligncenter')" name="img_align" id="aligncenter" value="aligncenter" />
    93                                 <label for="aligncenter" class="align image-align-center-label">Center</label>
     61                                <label for="aligncenter" class="align image-align-center-label">{#contextmenu.center}</label>
    9462
    9563                                <input type="radio" onclick="wpImage.imgAlignCls('alignright')" name="img_align" id="alignright" value="alignright" />
    96                                 <label for="alignright" class="align image-align-right-label">{#advanced_dlg.image_align_right}</label>
     64                                <label for="alignright" class="align image-align-right-label">{#contextmenu.right}</label>
    9765                        </td>
    9866                </tr>
     
    10169                        <th valign="top" scope="row" class="label">
    10270                                <label for="img_size">
    103                                 <span class="alignleft">Size</span>
     71                                <span class="alignleft">{#wpeditimage.size}</span>
    10472                                </label>
    10573                        </th>
    10674                        <td class="field" id="img_size">
    10775                                <input onclick="wpImage.imgEditSize('thumbnail')" type="radio" name="img_size" id="thumbnail" value="thumbnail" />
    108                                 <label for="thumbnail" id="lb_sizethumb">Thumbnail</label>
     76                                <label for="thumbnail" id="lb_sizethumb">{#wpeditimage.thumbnail}</label>
    10977
    11078                                <input onclick="wpImage.imgEditSize('medium')" type="radio" name="img_size" id="medium" value="medium" />
    111                                 <label for="medium" id="lb_sizemedium">Medium</label>
     79                                <label for="medium" id="lb_sizemedium">{#wpeditimage.medium}</label>
    11280
    11381                                <input onclick="wpImage.imgEditSize('full')" type="radio" name="img_size" id="full" value="full" />
    114                                 <label for="full" id="lb_sizefull">Full_size</label>
     82                                <label for="full" id="lb_sizefull">{#wpeditimage.full_size}</label>
     83                        </td>
     84                </tr>
     85
     86                <tr class="">
     87                        <th valign="top" scope="row" class="label">
     88                                <label for="img_title">
     89                                <span class="alignleft">{#advanced_dlg.link_titlefield}</span>
     90                                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
     91                                </label>
     92                        </th>
     93                        <td class="field">
     94                                <input type="text" id="img_title" name="img_title" value="" aria-required="true" size="60" />
     95                        </td>
     96                </tr>
     97
     98                <tr class="post_excerpt">
     99                        <th valign="top" scope="row" class="label">
     100                                <label for="img_alt">
     101                                <span class="alignleft">{#wpeditimage.caption}</span>
     102                                </label>
     103                        </th>
     104                        <td class="field">
     105                                <input type="text" id="img_alt" name="img_alt" value="" size="60" />
     106                                <p class="help">{#wpeditimage.alt_help}</p>
     107                        </td>
     108                </tr>
     109
     110                <tr class="url">
     111                        <th valign="top" scope="row" class="label">
     112                                <label for="link_href">
     113                                <span class="alignleft" id="lb_link_href">{#advanced_dlg.link_url}</span>
     114                                </label>
     115                        </th>
     116                        <td class="field">
     117                                <input type="text" id="link_href" name="link_href" value="" /><br />
     118                                <input type="button" class="button" onclick="wpImage.I('link_href').value='';" value="{#wpeditimage.none}" />
     119                                <input type="button" class="button" id="img_url_current" onclick="wpImage.img_seturl('current')" value="{#wpeditimage.current_link}" />
     120                                <input type="button" class="button" id="img_url_img" onclick="wpImage.img_seturl('link')" value="{#wpeditimage.link_to_img}" />
     121                                <p class="help">{#wpeditimage.link_help}</p>
    115122                        </td>
    116123                </tr>
     
    119126
    120127        <div id="div_advanced" style="display:none;">
    121         <h3>Advanced Image Settings</h3>
    122         <table id="adv_settings_img" class="describe"> 
     128        <h3>{#wpeditimage.adv_img_settings}</h3>
     129        <table id="adv_settings_img" class="describe">
    123130                <tbody>
    124131                <tr>
    125132                        <th valign="top" scope="row" class="label">
    126133                                <label for="img_src">
    127                                 <span class="alignleft">Source</span>
     134                                <span class="alignleft">{#wpeditimage.source}</span>
    128135                                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    129136                                </label>
    130137                        </th>
    131138                        <td class="field">
    132                                 <input type="text" id="img_src" name="img_src" value="" onblur="wpImage.checkVal(this)" size="60" />
    133                         </td>
    134                 </tr>
    135 
    136                 <tr>
    137                         <th valign="top" scope="row" class="label">
    138                                 <label for="img_dim">
    139                                 <span class="alignleft">Size</span>
    140                                 <span class="alignright"></span>
    141                                 </label>
    142                         </th>
    143                         <td class="field" id="img_dim">
    144                                 <label for="width">Width</label>
    145                                 <input type="text" id="width" name="width" value="" />
    146                                
    147                                 <label for="height">Height</label>
    148                                 <input type="text" id="height" name="height" value="" />
    149                                 <input type="button" class="button" id="orig_size" name="orig_size" value="Original Size" onclick="wpImage.origSize();" />
    150                                
     139                                <input type="text" id="img_src" name="img_src" value="" onblur="wpImage.checkVal(this)" aria-required="true" size="60" />
     140                        </td>
     141                </tr>
     142
     143                <tr id="img_dim">
     144                        <th valign="top" scope="row" class="label">
     145                                <label>
     146                                <span class="alignleft">{#wpeditimage.size}</span>
     147                                </label>
     148                        </th>
     149                        <td class="field">
     150                                <label for="width">{#wpeditimage.width}</label>
     151                                <input type="text" maxlength="5" id="width" name="width"  value="" />
     152
     153                                <label for="height">{#wpeditimage.height}</label>
     154                                <input type="text" maxlength="5" id="height" name="height" value="" />
     155
     156                                <input type="button" class="button" id="orig_size" name="orig_size" value="{#wpeditimage.orig_size}" onclick="wpImage.origSize();" />
    151157                        </td>
    152158                </tr>
     
    155161                        <th valign="top" scope="row" class="label">
    156162                                <label for="img_classes">
    157                                 <span class="alignleft">CSS Class</span>
     163                                <span class="alignleft">{#wpeditimage.css}</span>
    158164                                </label>
    159165                        </th>
     
    166172                        <th valign="top" scope="row" class="label">
    167173                                <label for="img_style">
    168                                 <span class="alignleft">Style</span>
    169                                 </label>
    170                         </th>
    171                         <td class="field">
    172                                 <input type="text" id="img_style" name="img_style" value="" size="60" />
     174                                <span class="alignleft">{#advanced.style_select}</span>
     175                                </label>
     176                        </th>
     177                        <td class="field">
     178                                <input type="text" id="img_style" name="img_style" value="" size="60" onblur="wpImage.demoSetStyle();" />
     179                        </td>
     180                </tr>
     181
     182                <tr id="img_prop">
     183                        <th valign="top" scope="row" class="label">
     184                                <label for="img_prop">
     185                                        <span class="alignleft">{#advanced.image_props_desc}</span>
     186                                </label>
     187                        </th>
     188                        <td class="field">
     189                                <label for="border">{#advanced_dlg.image_border}</label>
     190                                <input type="text" maxlength="5" id="border" name="border" value="" onblur="wpImage.updateStyle('border')" />
     191
     192                                <label for="vspace">{#advanced_dlg.image_vspace}</label>
     193                                <input type="text" maxlength="5" id="vspace" name="vspace" value="" onblur="wpImage.updateStyle('vspace')" />
     194
     195                                <label for="hspace">{#advanced_dlg.image_hspace}</label>
     196                                <input type="text" maxlength="5" id="hspace" name="hspace" value="" onblur="wpImage.updateStyle('hspace')" />
    173197                        </td>
    174198                </tr>
     
    176200        </table>
    177201
    178         <h3>Advanced Link Settings</h3>
    179         <table id="adv_settings_img" class="describe"> 
     202        <h3>{#wpeditimage.adv_link_settings}</h3>
     203        <table id="adv_settings_link" class="describe">
    180204                <tbody>
    181205                <tr>
    182206                        <th valign="top" scope="row" class="label">
    183207                                <label for="link_title">
    184                                 <span class="alignleft">Link Title</span>
     208                                <span class="alignleft">{#advanced_dlg.link_titlefield}</span>
    185209                                </label>
    186210                        </th>
     
    193217                        <th valign="top" scope="row" class="label">
    194218                                <label for="link_rel">
    195                                 <span class="alignleft">Link Rel</span>
     219                                <span class="alignleft">{#wpeditimage.link_rel}</span>
    196220                                </label>
    197221                        </th>
     
    203227                <tr>
    204228                        <th valign="top" scope="row" class="label">
    205                                 <label for="link_rev">
    206                                 <span class="alignleft">Link Rev</span>
    207                                 </label>
    208                         </th>
    209                         <td class="field">
    210                                 <input type="text" id="link_rev" name="link_rev" value="" size="60" />
    211                         </td>
    212                 </tr>
    213 
    214                 <tr>
    215                         <th valign="top" scope="row" class="label">
    216229                                <label for="link_classes">
    217                                 <span class="alignleft">CSS Class</span>
     230                                <span class="alignleft">{#wpeditimage.css}</span>
    218231                                </label>
    219232                        </th>
     
    226239                        <th valign="top" scope="row" class="label">
    227240                                <label for="link_style">
    228                                 <span class="alignleft">Style</span>
     241                                <span class="alignleft">{#advanced.style_select}</span>
    229242                                </label>
    230243                        </th>
     
    236249                <tr>
    237250                        <th valign="top" scope="row" class="label">
     251                                <label>
     252                                <span class="alignleft">{#advanced_dlg.link_target}</span>
     253                                </label>
     254                        </th>
     255                        <td class="field">
    238256                                <label for="link_target">
    239                                 <span class="alignleft">Target</span>
    240                                 </label>
    241                         </th>
    242                         <td class="field">
    243                                 <input type="text" id="link_target" name="link_target" value="" size="60" />
     257                                {#advanced_dlg.link_target_blank}
     258                                </label>
     259                                <input type="checkbox" id="link_target" name="link_target" value="_blank" />
    244260                        </td>
    245261                </tr>
     
    248264
    249265        <div id="saveeditimg">
    250                 <input type="hidden" id="border" name="border" value="" />
    251                 <input type="hidden" id="hspace" name="hspace" value="" />
    252                 <input type="hidden" id="vspace" name="vspace" value="" />
    253266                <input type="hidden" id="align" name="align" value="" />
    254267
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js

    r8066 r8083  
    9595        link : '',
    9696        link_rel : '',
     97        target_value : '',
    9798
    9899        setTabs : function(tab) {
     
    180181                                m = Math.min(W, m);
    181182                                f.width.value = m;
    182                                 f.height.value = Math.floor((m / W) * H);
     183                                f.height.value = Math.round((m / W) * H);
    183184                        } else {
    184185                                m = Math.min(H, m);
    185186                                f.height.value = m;
    186                                 f.width.value = Math.floor((m / H) * W);
     187                                f.width.value = Math.round((m / H) * W);
    187188                        }
    188189
     
    196197                var demo = this.I('img_demo'), f = document.forms[0];
    197198
    198                 demo.style.width = f.width.value ? Math.floor(f.width.value * 0.6) + 'px' : '';
    199                 demo.style.height = f.height.value ? Math.floor(f.height.value * 0.6) + 'px' : '60%';
     199                demo.width = f.width.value ? Math.floor(f.width.value * 0.5) : '';
     200                demo.height = f.height.value ? Math.floor(f.height.value * 0.5) : '';
     201        },
     202       
     203        demoSetStyle : function() {
     204                var f = document.forms[0], demo = this.I('img_demo');
     205
     206                if (demo)
     207                        tinyMCEPopup.editor.dom.setAttrib(demo, 'style', f.img_style.value);
    200208        },
    201209       
     
    218226                        h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
    219227
    220                 document.dir = ed.getParam('directionality','');
    221228                document.body.innerHTML = ed.translate(h);
    222229                window.setTimeout( function(){wpImage.setup();}, 100 );
     
    224231
    225232        setup : function() {
    226                 var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), tr = ed.translate;
    227 
     233                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','');
    228235                tinyMCEPopup.restoreSelection();
    229236                el = ed.selection.getNode();
     
    242249                f.img_classes.value = c = ed.dom.getAttrib(el, 'class');
    243250                f.img_style.value = ed.dom.getAttrib(el, 'style');
    244                 this.updateStyle();
     251               
     252                // Move attribs to styles
     253                if (dom.getAttrib(el, 'align'))
     254                        t.updateStyle('align');
     255
     256                if (dom.getAttrib(el, 'hspace'))
     257                        t.updateStyle('hspace');
     258
     259                if (dom.getAttrib(el, 'border'))
     260                        t.updateStyle('border');
     261
     262                if (dom.getAttrib(el, 'vspace'))
     263                        t.updateStyle('vspace');
    245264
    246265                if (pa = ed.dom.getParent(el, 'A')) {
     
    248267                        f.link_title.value = ed.dom.getAttrib(pa, 'title');
    249268                        f.link_rel.value = t.link_rel = ed.dom.getAttrib(pa, 'rel');
    250                         f.link_rev.value = ed.dom.getAttrib(pa, 'rev');
    251269                        f.link_style.value = ed.dom.getAttrib(pa, 'style');
    252                         f.link_target.value = ed.dom.getAttrib(pa, 'target');
     270                        t.target_value = ed.dom.getAttrib(pa, 'target');
    253271                        f.link_classes.value = ed.dom.getAttrib(pa, 'class');
    254272                }
    255273
     274                f.link_target.checked = ( t.target_value && t.target_value == '_blank' ) ? 'checked' : '';
     275               
    256276                fname = link.substring( link.lastIndexOf('/') );
    257277                fname = fname.replace(/-[0-9]{2,4}x[0-9]{2,4}/, '' );
     
    281301                document.body.style.display = '';
    282302                t.getImageData();
    283 
    284                 if ( (id = c.match( /wp-image-([0-9]{1,6})/ )) && id[1] ) {
    285                         t.I('tab_attachment').href = tinymce.documentBaseURL + 'media.php?action=edit&attachment_id=' + id[1];
    286                         t.I('tab_attachment').style.display = 'inline';
    287                 }
     303                t.demoSetStyle();
     304
     305                // 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//              }
    288310        },
    289311
     
    351373                                                title : f.link_title.value,
    352374                                                rel : f.link_rel.value,
    353                                                 rev : f.link_rev.value,
    354                                                 target : f.link_target.value,
     375                                                target : (f.link_target.checked == true) ? '_blank' : '',
    355376                                                'class' : f.link_classes.value,
    356377                                                style : f.link_style.value
     
    363384                                title : f.link_title.value,
    364385                                rel : f.link_rel.value,
    365                                 rev : f.link_rev.value,
    366                                 target : f.link_target.value,
     386                                target : (f.link_target.checked == true) ? '_blank' : '',
    367387                                'class' : f.link_classes.value,
    368388                                style : f.link_style.value
     
    373393                tinyMCEPopup.close();
    374394        },
    375 
    376         updateStyle : function() {
    377                 var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];
     395       
     396        updateStyle : function(ty) {
     397                var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : f.img_style.value});
    378398
    379399                if (tinyMCEPopup.editor.settings.inline_styles) {
    380                         st = tinyMCEPopup.dom.parseStyle(f.img_style.value);
    381 
    382400                        // Handle align
    383                         v = f.align.value;
    384                         if (v) {
    385                                 if (v == 'left' || v == 'right') {
    386                                         st['float'] = v;
    387                                         delete st['vertical-align'];
    388                                 } else {
    389                                         st['vertical-align'] = v;
    390                                         delete st['float'];
     401                        if (ty == 'align') {
     402                                dom.setStyle(img, 'float', '');
     403                                dom.setStyle(img, 'vertical-align', '');
     404
     405                                v = f.align.value;
     406                                if (v) {
     407                                        if (v == 'left' || v == 'right')
     408                                                dom.setStyle(img, 'float', v);
     409                                        else
     410                                                img.style.verticalAlign = v;
    391411                                }
    392                         } else {
    393                                 delete st['float'];
    394                                 delete st['vertical-align'];
    395412                        }
    396413
    397414                        // Handle border
    398                         v = f.border.value;
    399                         if (v || v == '0') {
    400                                 if (v == '0')
    401                                         st['border'] = '0';
    402                                 else
    403                                         st['border'] = v + 'px solid black';
    404                         } else
    405                                 delete st['border'];
     415                        if (ty == 'border') {
     416                                dom.setStyle(img, 'border', '');
     417
     418                                v = f.border.value;
     419                                if (v || v == '0') {
     420                                        if (v == '0')
     421                                                img.style.border = '0';
     422                                        else
     423                                                img.style.border = v + 'px solid black';
     424                                }
     425                        }
    406426
    407427                        // Handle hspace
    408                         v = f.hspace.value;
    409                         if (v) {
    410                                 delete st['margin'];
    411                                 st['margin-left'] = v + 'px';
    412                                 st['margin-right'] = v + 'px';
    413                         } else {
    414                                 delete st['margin-left'];
    415                                 delete st['margin-right'];
     428                        if (ty == 'hspace') {
     429                                dom.setStyle(img, 'marginLeft', '');
     430                                dom.setStyle(img, 'marginRight', '');
     431
     432                                v = f.hspace.value;
     433                                if (v) {
     434                                        img.style.marginLeft = v + 'px';
     435                                        img.style.marginRight = v + 'px';
     436                                }
    416437                        }
    417438
    418439                        // Handle vspace
    419                         v = f.vspace.value;
    420                         if (v) {
    421                                 delete st['margin'];
    422                                 st['margin-top'] = v + 'px';
    423                                 st['margin-bottom'] = v + 'px';
    424                         } else {
    425                                 delete st['margin-top'];
    426                                 delete st['margin-bottom'];
     440                        if (ty == 'vspace') {
     441                                dom.setStyle(img, 'marginTop', '');
     442                                dom.setStyle(img, 'marginBottom', '');
     443
     444                                v = f.vspace.value;
     445                                if (v) {
     446                                        img.style.marginTop = v + 'px';
     447                                        img.style.marginBottom = v + 'px';
     448                                }
    427449                        }
    428450
    429451                        // Merge
    430                         st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st));
    431                         f.img_style.value = dom.serializeStyle(st);
     452                        f.img_style.value = dom.serializeStyle(dom.parseStyle(img.style.cssText));
     453                        this.demoSetStyle();
    432454                }
    433455        },
     
    445467                var f = document.forms[0];
    446468
    447                 f.width.value = f.height.value = "";   
     469                f.width.value = f.height.value = '';   
    448470        },
    449471
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r8066 r8083  
    227227if ( $disk_cache ) {
    228228
    229         $cacheKey = apply_filters('tiny_mce_version', '20080606');
     229        $cacheKey = apply_filters('tiny_mce_version', '20080613');
    230230
    231231        foreach ( $initArray as $v )
  • trunk/wp-includes/script-loader.php

    r8066 r8083  
    3636
    3737        // Modify this version when tinyMCE plugins are changed.
    38         $mce_version = apply_filters('tiny_mce_version', '20080606');
     38        $mce_version = apply_filters('tiny_mce_version', '20080613');
    3939        $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
    4040
     
    227227        $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' );
    228228        $styles->add( 'press-this', '/wp-admin/css/press-this.css' );
    229         $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css' );
     229        $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20080613' );
    230230        $styles->add( 'login', '/wp-admin/css/login.css' );
    231231
Note: See TracChangeset for help on using the changeset viewer.