Make WordPress Core

Changeset 9894


Ignore:
Timestamp:
11/26/2008 02:27:37 AM (18 years ago)
Author:
azaozz
Message:

Move Gallery Settings to the Gallery tab in the uploader, split the Upload tab in "From Computer" and "From URL" tabs

Location:
trunk
Files:
3 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/colors-fresh.css

    r9882 r9894  
    964964}
    965965
    966 .wp-admin .clearlooks2 .mceFocus .mceTop .mceCenter {
    967         background: #444444;
    968         border-bottom: 1px solid #999;
    969         border-top: 1px solid #999;
    970 }
    971 
    972966.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight {
    973967        background: #444444;
     
    10131007
    10141008.wp-admin .clearlooks2 .mceFocus .mceTop span {
    1015         color: #fff;
     1009        color: #e5e5e5;
    10161010}
    10171011/* end TinyMCE */
  • trunk/wp-admin/css/media.css

    r9842 r9894  
    4444
    4545.media-upload-form label.form-help, td.help {
    46         font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
     46        font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
    4747        font-style: italic;
    4848        font-weight: normal;
     
    285285        padding-top: .5em;
    286286        text-align: left;
     287        min-width: 120px;
    287288}
    288289
     
    355356        z-index: -1;
    356357}
     358
     359#gallery-settings th.label {
     360        width: 160px;
     361}
     362
     363#gallery-settings #basic th.label {
     364        padding: 5px 5px 5px 0;
     365}
     366
     367#gallery-settings .title {
     368        clear: both;
     369        padding: 0 0 3px;
     370        border-bottom-style: solid;
     371        border-bottom-width: 1px;
     372        font-family: Georgia,"Times New Roman",Times,serif;
     373        font-size: 1.6em;
     374        border-bottom-color: #DADADA;
     375        color: #5A5A5A;
     376}
     377
     378.media-blank h3 {
     379        color: #5A5A5A;
     380        font-family: Georgia,"Times New Roman",Times,serif;
     381        font-size: 1.6em;
     382        font-weight: normal;
     383}
     384
     385#gallery-settings .describe td {
     386        vertical-align: middle;
     387        height: 3.5em;
     388}
     389
     390#gallery-settings .describe th.label {
     391        padding-top: .5em;
     392        text-align: left;
     393}
     394
     395#gallery-settings .describe {
     396        padding: 5px;
     397        width: 615px;
     398        clear: both;
     399        cursor: default;
     400}
     401
     402#gallery-settings .describe select {
     403        width: 15em;
     404        border: 1px solid #dfdfdf;
     405}
     406
     407#gallery-settings label,
     408#gallery-settings legend {
     409        font-size: 13px;
     410        color: #464646;
     411        margin-right: 15px;
     412}
     413
     414#gallery-settings .align .field label {
     415        margin: 0 1.5em 0 0;
     416}
     417
     418#gallery-settings p.ml-submit {
     419        border-top: 1px solid #dfdfdf;
     420}
     421
     422#gallery-settings select#columns {
     423        width: 6em;
     424}
  • trunk/wp-admin/includes/media.php

    r9746 r9894  
    1616function media_upload_tabs() {
    1717        $_default_tabs = array(
    18                 'type' => __('Choose File'), // handler action suffix => tab text
     18                'type' => __('From Computer'), // handler action suffix => tab text
     19                'type_url' => __('From URL'),
    1920                'gallery' => __('Gallery'),
    20                 'library' => __('Media Library'),
     21                'library' => __('Media Library')
    2122        );
    2223
     
    330331        $context = apply_filters('media_buttons_context', __('Upload %s'));
    331332        $media_upload_iframe_src = "media-upload.php?post_id=$uploading_iframe_ID";
    332         $media_title = __('Upload Media');
     333        $media_title = __('Add Media');
    333334        $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src&type=image");
    334         $image_title = __('Upload an Image');
     335        $image_title = __('Add an Image');
    335336        $video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src&type=video");
    336         $video_title = __('Upload Video');
     337        $video_title = __('Add Video');
    337338        $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&type=audio");
    338         $audio_title = __('Upload Audio');
     339        $audio_title = __('Add Audio');
    339340        $out = <<<EOF
    340341
     
    386387        }
    387388
    388         if ( isset($_POST['insert-gallery']) )
    389                 return media_send_to_editor('[gallery]');
     389        if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?>
     390                <script type="text/javascript">
     391                /* <![CDATA[ */
     392                var win = window.dialogArguments || opener || parent || top;
     393                win.tb_remove();
     394                /* ]]> */
     395                </script>
     396                <?php
     397                exit;
     398        }
    390399
    391400        if ( isset($_POST['send']) ) {
     
    454463                return media_upload_gallery();
    455464        }
     465       
     466        if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' )
     467                return wp_iframe( 'media_upload_type_url_form', 'image', $errors, $id );
    456468
    457469        return wp_iframe( 'media_upload_type_form', 'image', $errors, $id );
     
    543555        }
    544556
     557        if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' )
     558                return wp_iframe( 'media_upload_type_url_form', 'audio', $errors, $id );
     559       
    545560        return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id );
    546561}
     
    593608        }
    594609
     610        if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' )
     611                return wp_iframe( 'media_upload_type_url_form', 'video', $errors, $id );
     612       
    595613        return wp_iframe( 'media_upload_type_form', 'video', $errors, $id );
    596614}
     
    643661        }
    644662
     663        if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' )
     664                return wp_iframe( 'media_upload_type_url_form', 'file', $errors, $id );
     665       
    645666        return wp_iframe( 'media_upload_type_form', 'file', $errors, $id );
    646667}
     
    13011322        $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
    13021323        $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
    1303 
    1304         $callback = "type_form_$type";
    13051324?>
    13061325
     
    13081327<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
    13091328<?php wp_nonce_field('media-form'); ?>
    1310 <h3><?php _e('From Computer'); ?></h3>
     1329
     1330<div class="media-blank">
     1331<h3><?php _e('Add media files from your computer'); ?></h3>
     1332</div>
     1333
    13111334<?php media_upload_form( $errors ); ?>
    13121335
     
    13221345-->
    13231346</script>
    1324 <?php if ( $id && !is_wp_error($id) ) : ?>
     1347<?php if ( $id && !is_wp_error($id) ) { ?>
    13251348<div id="media-items">
    13261349<?php echo get_media_items( $id, $errors ); ?>
    13271350</div>
    13281351<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
    1329 
    1330 <?php elseif ( is_callable($callback) ) : ?>
     1352<?php
     1353        } elseif ( is_wp_error($id) ) {
     1354                echo '<div id="media-upload-error">'.wp_specialchars($id->get_error_message()).'</div>';
     1355                exit;
     1356        }
     1357}
     1358
     1359/**
     1360 * {@internal Missing Short Description}}
     1361 *
     1362 * @since unknown
     1363 *
     1364 * @param unknown_type $type
     1365 * @param unknown_type $errors
     1366 * @param unknown_type $id
     1367 */
     1368function media_upload_type_url_form($type = 'file', $errors = null, $id = null) {
     1369        media_upload_header();
     1370
     1371        $post_id = intval($_REQUEST['post_id']);
     1372
     1373        $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
     1374        $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
     1375
     1376        $callback = "type_url_form_$type";
     1377?>
     1378
     1379<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form">
     1380<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
     1381<?php wp_nonce_field('media-form'); ?>
     1382
     1383<?php if ( is_callable($callback) ) { ?>
    13311384
    13321385<div class="media-blank">
    1333 <p style="text-align:center"><?php _e('&mdash; OR &mdash;'); ?></p>
    1334 <h3><?php _e('From URL'); ?></h3>
     1386<h3><?php _e('Add media file from URL'); ?></h3>
    13351387</div>
    13361388
     
    14151467</div>
    14161468</div>
    1417 <input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
    14181469</form>
    14191470<?php
    1420         endif;
     1471        } else {
     1472                wp_die( __('Unknown action.') );
     1473        }
    14211474}
    14221475
     
    14621515<?php echo get_media_items($post_id, $errors); ?>
    14631516</div>
     1517
    14641518<p class="ml-submit">
    1465 <input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
    1466 <input type="submit" class="button insert-gallery" name="insert-gallery" value="<?php echo attribute_escape( __( 'Insert gallery into post' ) ); ?>" />
     1519<input type="submit" class="button savebutton" style="display:none;" name="save" id="save-all" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
    14671520<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
    14681521<input type="hidden" name="type" value="<?php echo attribute_escape( $GLOBALS['type'] ); ?>" />
    14691522<input type="hidden" name="tab" value="<?php echo attribute_escape( $GLOBALS['tab'] ); ?>" />
    14701523</p>
     1524
     1525<div id="gallery-settings" style="display:none;">
     1526<div class="title"><?php _e('Gallery Settings'); ?></div>
     1527<table id="basic" class="describe"><tbody>
     1528        <tr>
     1529        <th scope="row" class="label">
     1530                <label>
     1531                <span class="alignleft"><?php _e('Link thumbnails to:'); ?></span>
     1532                </label>
     1533        </th>
     1534        <td class="field">
     1535                <input type="radio" name="linkto" id="linkto-file" value="file" />
     1536                <label for="linkto-file" class="radio"><?php _e('Image File'); ?></label>
     1537
     1538                <input type="radio" checked="checked" name="linkto" id="linkto-post" value="post" />
     1539                <label for="linkto-post" class="radio"><?php _e('Attachment Page'); ?></label>
     1540        </td>
     1541        </tr>
     1542
     1543        <tr>
     1544        <th scope="row" class="label">
     1545                <label>
     1546                <span class="alignleft"><?php _e('Order images by:'); ?></span>
     1547                </label>
     1548        </th>
     1549        <td class="field">
     1550                <select id="orderby" name="orderby">
     1551                        <option value="menu_order" selected="selected"><?php _e('Menu order'); ?></option>
     1552                        <option value="post_name"><?php _e('Name'); ?></option>
     1553                        <option value="ID"><?php _e('Date/Time'); ?></option>
     1554                </select>
     1555        </td>
     1556        </tr>
     1557
     1558        <tr>
     1559        <th scope="row" class="label">
     1560                <label>
     1561                <span class="alignleft"><?php _e('Order:'); ?></span>
     1562                </label>
     1563        </th>
     1564        <td class="field">
     1565                <input type="radio" checked="checked" name="order" id="order-asc" value="asc" />
     1566                <label for="order-asc" class="radio"><?php _e('Ascending'); ?></label>
     1567
     1568                <input type="radio" name="order" id="order-desc" value="desc" />
     1569                <label for="order-desc" class="radio"><?php _e('Descending'); ?></label>
     1570        </td>
     1571        </tr>
     1572
     1573        <tr>
     1574        <th scope="row" class="label">
     1575                <label>
     1576                <span class="alignleft"><?php _e('Gallery columns:'); ?></span>
     1577                </label>
     1578        </th>
     1579        <td class="field">
     1580                <select id="columns" name="columns">
     1581                        <option value="2"><?php _e('2'); ?></option>
     1582                        <option value="3" selected="selected"><?php _e('3'); ?></option>
     1583                        <option value="4"><?php _e('4'); ?></option>
     1584                        <option value="5"><?php _e('5'); ?></option>
     1585                        <option value="6"><?php _e('6'); ?></option>
     1586                        <option value="7"><?php _e('7'); ?></option>
     1587                        <option value="8"><?php _e('8'); ?></option>
     1588                        <option value="9"><?php _e('9'); ?></option>
     1589                </select>
     1590        </td>
     1591        </tr>
     1592</tbody></table>
     1593
     1594<p class="ml-submit">
     1595<input type="button" class="button" style="display:none;" onmousedown="wpgallery.update();" name="insert-gallery" id="insert-gallery" value="<?php echo attribute_escape( __( 'Insert gallery' ) ); ?>" />
     1596<input type="button" class="button" style="display:none;" onmousedown="wpgallery.update();" name="update-gallery" id="update-gallery" value="<?php echo attribute_escape( __( 'Update gallery settings' ) ); ?>" />
     1597</p>
     1598</div>
    14711599</form>
    14721600<?php
     
    16351763 * @return unknown
    16361764 */
    1637 function type_form_image() {
     1765function type_url_form_image() {
    16381766
    16391767        if ( apply_filters( 'disable_captions', '' ) ) {
     
    17181846 * @return unknown
    17191847 */
    1720 function type_form_audio() {
     1848function type_url_form_audio() {
    17211849        return '
    17221850        <table class="describe"><tbody>
     
    17531881 * @return unknown
    17541882 */
    1755 function type_form_video() {
     1883function type_url_form_video() {
    17561884        return '
    17571885        <table class="describe"><tbody>
     
    17881916 * @return unknown
    17891917 */
    1790 function type_form_file() {
     1918function type_url_form_file() {
    17911919        return '
    17921920        <table class="describe"><tbody>
  • trunk/wp-admin/js/gallery.js

    r8304 r9894  
    2626                if ( this.value == '0' ) this.value = '';
    2727        });
     28
     29        if ( $('#media-items>*').length > 1 ) {
     30                var w = wpgallery.getWin();
     31
     32                $('#save-all, #gallery-settings').show();
     33                if ( typeof w.tinyMCE != 'undefined' && w.tinyMCE.activeEditor && ! w.tinyMCE.activeEditor.isHidden() ) {
     34                        wpgallery.mcemode = true;
     35                        wpgallery.init();
     36                } else {
     37                        $('#insert-gallery').show();
     38                }
     39        }
    2840});
     41
     42jQuery(window).unload( function () { tinymce = tinyMCE = wpgallery = null; } ); // Cleanup
     43
     44/* gallery settings */
     45var tinymce = null, tinyMCE;
     46
     47var wpgallery = {
     48        mcemode : false,
     49        editor : {},
     50        dom : {},
     51        is_update : false,
     52        el : {},
     53
     54        I : function(e) {
     55                return document.getElementById(e);
     56        },
     57
     58        init: function() {
     59                var t = this, li, q, i, it, w = t.getWin();
     60
     61                if ( ! t.mcemode ) return;
     62
     63                li = ('' + document.location.search).replace(/^\?/, '').split('&');
     64                q = {};
     65                for (i=0; i<li.length; i++) {
     66                        it = li[i].split('=');
     67                        q[unescape(it[0])] = unescape(it[1]);
     68                }
     69
     70                if (q.mce_rdomain)
     71                        document.domain = q.mce_rdomain;
     72
     73                // Find window & API
     74                tinymce = w.tinymce;
     75                tinyMCE = w.tinyMCE;
     76                t.editor = tinymce.EditorManager.activeEditor;
     77
     78                t.setup();
     79        },
     80
     81        getWin : function() {
     82                return window.dialogArguments || opener || parent || top;
     83        },
     84
     85        restoreSelection : function() {
     86                var t = this;
     87
     88                if (tinymce.isIE)
     89                        t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
     90        },
     91
     92        setup : function() {
     93                var t = this, a, f = document.forms[0], ed = t.editor, el, g;
     94                if ( ! t.mcemode ) return;
     95
     96                t.restoreSelection();
     97                t.el = ed.selection.getNode();
     98
     99                if ( t.el.nodeName != 'IMG' || ! ed.dom.hasClass(t.el, 'wpGallery') ) {
     100                        if ( (g = ed.dom.select('img.wpGallery')) && g[0] ) {
     101                                t.el = g[0];
     102                        } else {
     103                                if ( getUserSetting('galfile') == '1' ) t.I('linkto-file').checked = "checked";
     104                                if ( getUserSetting('galdesc') == '1' ) t.I('order-desc').checked = "checked";
     105                                if ( getUserSetting('galcols') ) t.I('columns').value = getUserSetting('galcols');
     106                                if ( getUserSetting('galord') ) t.I('orderby').value = getUserSetting('galord');
     107                                jQuery('#insert-gallery').show();
     108                                return;
     109                        }
     110                }
     111
     112                a = ed.dom.getAttrib(t.el, 'title');
     113                a = ed.dom.decode(a);
     114
     115                if ( a ) {
     116                        jQuery('#update-gallery').show();
     117                        t.is_update = true;
     118
     119                        var columns = a.match(/columns=['"]([0-9]+)['"]/), link = a.match(/link=['"]([^'"]+)['"]/i);
     120                        var order = a.match(/order=['"]([^'"]+)['"]/i), orderby = a.match(/orderby=['"]([^'"]+)['"]/i), all = '';
     121
     122                        if ( link && link[1] ) t.I('linkto-file').checked = "checked";
     123                        if ( order && order[1] ) t.I('order-desc').checked = "checked";
     124                        if ( columns && columns[1] ) t.I('columns').value = ''+columns[1];
     125                        if ( orderby && orderby[1] ) t.I('orderby').value = orderby[1];
     126                } else {
     127                        jQuery('#insert-gallery').show();
     128                }
     129        },
     130
     131        update : function() {
     132                var t = this, ed = t.editor, el, all = '';
     133
     134                if ( ! t.mcemode || ! t.is_update ) {
     135                        var s = '[gallery'+t.getSettings()+']';
     136                        t.getWin().send_to_editor(s);
     137                        return;
     138                }
     139
     140                if (t.el.nodeName != 'IMG') return;
     141
     142                all = ed.dom.decode(ed.dom.getAttrib(t.el, 'title'));
     143                all = all.substr(0, all.lastIndexOf(']'));
     144                all = all.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi, '');
     145                all += t.getSettings();
     146                all += ']';
     147
     148                ed.dom.setAttrib(t.el, 'title', all);
     149                t.getWin().tb_remove();
     150        },
     151
     152        getSettings : function() {
     153                var I = this.I, s = '';
     154
     155                if ( I('linkto-file').checked ) {
     156                        s += ' link="file"';
     157                        setUserSetting('galfile', '1');
     158                }
     159
     160                if ( I('order-desc').checked ) {
     161                        s += ' order="DESC"';
     162                        setUserSetting('galdesc', '1');
     163                }
     164
     165                if ( I('columns').value != 3 ) {
     166                        s += ' columns="'+I('columns').value+'"';
     167                        setUserSetting('galcols', I('columns').value);
     168                }
     169
     170                if ( I('orderby').value != 'menu_order' ) {
     171                        s += ' orderby="'+I('orderby').value+'"';
     172                        setUserSetting('galord', I('orderby').value);
     173                }
     174
     175                return s;
     176        }
     177};
  • trunk/wp-admin/js/media-upload.js

    r9219 r9894  
    66                        ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
    77
    8                 if ( h.indexOf('[caption') != -1 )
    9                         h = ed.plugins.wpeditimage._do_shcode(h);
     8                if ( h.indexOf('[caption') === 0 ) {
     9                        if ( ed.plugins.wpeditimage )
     10                                h = ed.plugins.wpeditimage._do_shcode(h);
     11                } else if ( h.indexOf('[gallery') === 0 ) {
     12                        if ( ed.plugins.wpgallery )
     13                                h = ed.plugins.wpgallery._do_gallery(h);
     14                }
    1015
    1116                ed.execCommand('mceInsertContent', false, h);
    12         } else if ( jQuery.isFunction( 'edInsertContent' ) ) {
     17
     18        } else if ( typeof edInsertContent == 'function' ) {
    1319                edInsertContent(edCanvas, h);
    1420        } else {
  • trunk/wp-admin/media-upload.php

    r9458 r9894  
    103103       
    104104        // let the action code decide how to handle the request
    105         if ( $tab == 'type' )
     105        if ( $tab == 'type' || $tab == 'type_url' )
    106106                do_action("media_upload_$type");
    107107        else
  • trunk/wp-admin/wp-admin.css

    r9852 r9894  
    15411541        font-style: italic;
    15421542        display: block;
    1543         font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
     1543        font-family: "Lucida Grande", "Bitstream Vera Sans", "Lucida Sans", Verdana, Arial, sans-serif;
    15441544}
    15451545
     
    30563056
    30573057.swfupload {
    3058         margin: 0 10px;
     3058        margin: 5px 10px;
    30593059        vertical-align: middle;
    30603060}
  • trunk/wp-includes/js/swfupload/handlers.js

    r9654 r9894  
    5757
    5858        // Also bind toggle to the links
    59         jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150, function(){window.scrollTo(0,this.parentNode.offsetTop);});jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;});
     59        jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150, function(){var o=jQuery(this).offset();window.scrollTo(0,o.top-36);});jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;});
    6060
    6161        // Bind AJAX to the new Delete button
  • trunk/wp-includes/js/tinymce/langs/wp-langs-en.js

    r9847 r9894  
    428428alt:"Edit Alternate Text"
    429429});
    430 
    431 tinyMCE.addI18n("en.gallery",{
    432 settings:"Gallery Settings",
    433 linkto:"Link thumbnails to:",
    434 linktofile:"Image File",
    435 linktopost:"Attachment Page",
    436 orderby:"Order images by:",
    437 menu_order:"Menu order",
    438 byname:"Name",
    439 bydate:"Date/Time",
    440 random:"Random",
    441 order:"Order:",
    442 orderasc:"Ascending",
    443 orderdesc:"Descending",
    444 cols:"Gallery columns:",
    445 two:"two",
    446 three:"three",
    447 four:"four",
    448 five:"five",
    449 six:"six",
    450 seven:"seven",
    451 eight:"eight",
    452 nine:"nine",
    453 imgwidth:"Limit the thumbnails width:",
    454 imgwidthhelp:"Overrides the thumbnail images width. The default can be changed from the Media Settings page."
    455 });
  • trunk/wp-includes/js/tinymce/langs/wp-langs.php

    r9847 r9894  
    451451alt:"' . mce_escape( __('Edit Alternate Text') ) . '"
    452452});
    453 
    454 tinyMCE.addI18n("' . $language . '.gallery",{
    455 settings:"' . mce_escape( __('Gallery Settings') )  . '",
    456 linkto:"' . mce_escape( __('Link thumbnails to:') )  . '",
    457 linktofile:"' . mce_escape( __('Image File') )  . '",
    458 linktopost:"' . mce_escape( __('Attachment Page') )  . '",
    459 orderby:"' . mce_escape( __('Order images by:') ) . '",
    460 menu_order:"' . mce_escape( __('Menu order') ) . '",
    461 byname:"' . mce_escape( __('Name') ) . '",
    462 bydate:"' . mce_escape( __('Date/Time') ) . '",
    463 random:"' . mce_escape( __('Random') ) . '",
    464 order:"' . mce_escape( __('Order:') ) . '",
    465 orderasc:"' . mce_escape( __('Ascending') ) . '",
    466 orderdesc:"' . mce_escape( __('Descending') ) . '",
    467 cols:"' . mce_escape( __('Gallery columns:') )  . '",
    468 two:"' . mce_escape( __('two') ) . '",
    469 three:"' . mce_escape( __('three') ) . '",
    470 four:"' . mce_escape( __('four') ) . '",
    471 five:"' . mce_escape( __('five') ) . '",
    472 six:"' . mce_escape( __('six') )  . '",
    473 seven:"' . mce_escape( __('seven') ) . '",
    474 eight:"' . mce_escape( __('eight') ) . '",
    475 nine:"' . mce_escape( __('nine') ) . '",
    476 imgwidth:"' . mce_escape( __('Limit the thumbnails width:') ) . '",
    477 imgwidthhelp:"' . mce_escape( __('Overrides the thumbnail images width. The default can be changed from the Media Settings page.') ) . '"
    478 });
    479453';
  • trunk/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js

    r9849 r9894  
    1616                                if ( ed.dom.getAttrib(el, 'class').indexOf('wpGallery') == -1 ) return;
    1717
    18                                 tb_show('', url + '/gallery.html?ver=321&TB_iframe=true');
     18                                var post_id = tinymce.DOM.get('post_ID').value;
     19                                tb_show('', tinymce.documentBaseURL + '/media-upload.php?post_id='+post_id+'&tab=gallery&TB_iframe=true');
     20/*
    1921                                tinymce.DOM.setStyles('TB_window', {
    2022                                        'width':( W - 50 )+'px',
     
    3436                                        'height':'400px'
    3537                                });
     38*/
    3639                                tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
    3740                        });
     
    9699                                        return '<p>'+getAttr(im, 'title')+'</p>';
    97100
    98                                 return im;
     101                                return a;
    99102                        });
    100103                },
     
    165168                                var ed = tinyMCE.activeEditor, el = ed.selection.getNode();
    166169
    167                                 if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItemWPgallery') != -1 ) {
     170                                if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('wpGallery') != -1 ) {
    168171                                        ed.dom.remove(el);
    169172
  • trunk/wp-includes/media.php

    r9847 r9894  
    523523 * @param string $size Optional, default is 'thumbnail'.
    524524 * @param bool $icon Optional, default is false. Whether it is an icon.
    525  * @param int $imgwidth Override image width.
    526525 * @return string HTML img element or empty string on failure.
    527526 */
    528 function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $imgwidth = false) {
     527function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false) {
    529528
    530529        $html = '';
     
    532531        if ( $image ) {
    533532                list($src, $width, $height) = $image;
    534                 $hwstring = $imgwidth ? image_hwstring($imgwidth, '') : image_hwstring($width, $height);
     533                $hwstring = image_hwstring($width, $height);
    535534                if ( is_array($size) )
    536535                        $size = join('x', $size);
     
    619618                'captiontag' => 'dd',
    620619                'columns'    => 3,
    621                 'size'       => 'thumbnail',
    622                 'imgwidth'       => ''
     620                'size'       => 'thumbnail'
    623621        ), $attr));
    624622
     
    640638        $columns = intval($columns);
    641639        $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
    642         $imgwidth = isset($imgwidth) && (int) $imgwidth ? $imgwidth : false;
    643640
    644641        $output = apply_filters('gallery_style', "
     
    664661        $i = 0;
    665662        foreach ( $attachments as $id => $attachment ) {
    666                 $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false, $imgwidth) : wp_get_attachment_link($id, $size, true, false, $imgwidth);
     663                $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
    667664
    668665                $output .= "<{$itemtag} class='gallery-item'>";
  • trunk/wp-includes/post-template.php

    r9847 r9894  
    758758 * @return string HTML content.
    759759 */
    760 function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $imgwidth = false) {
     760function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false) {
    761761        $id = intval($id);
    762762        $_post = & get_post( $id );
     
    770770        $post_title = attribute_escape($_post->post_title);
    771771
    772         $link_text = wp_get_attachment_image($id, $size, $icon, $imgwidth);
     772        $link_text = wp_get_attachment_image($id, $size, $icon);
    773773        if ( !$link_text )
    774774                $link_text = $_post->post_title;
  • trunk/wp-includes/script-loader.php

    r9872 r9894  
    6262        // Modify this version when tinyMCE plugins are changed.
    6363        function mce_version() {
    64                 return '20081122';
     64                return '20081125';
    6565        }
    6666        add_filter( 'tiny_mce_version', 'mce_version' );
     
    226226                        'submittedOn' => __('Submitted on:')
    227227                ) );
    228                 $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080709' );
    229                 $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20081031' );
     228                $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20081125' );
     229                $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20081125' );
    230230               
    231231                $scripts->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20081120' );
Note: See TracChangeset for help on using the changeset viewer.