Make WordPress Core

Changeset 9847


Ignore:
Timestamp:
11/23/2008 06:37:15 AM (16 years ago)
Author:
azaozz
Message:

Gallery settings for TinyMCE

Location:
trunk
Files:
12 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r9836 r9847  
    4040    }
    4141
    42     if ( typeof o === 'object' ) {
    43         for (var v in o)
    44             o[v] = c(o[v]);
    45         return o;
    46     } else if ( typeof o === 'string' )
     42    if ( typeof o === 'string' )
    4743        return c(o);
     44    else if ( typeof o === 'object' )
     45        for (var v in o) {
     46            if ( typeof o[v] === 'string' )
     47                o[v] = c(o[v]);
     48        }
     49    return o;
    4850};
    4951//]]>
  • trunk/wp-admin/css/colors-classic.css

    r9837 r9847  
    14501450}
    14511451
    1452 #wp_editimgbtn, #wp_delimgbtn {
     1452#wp_editimgbtn,
     1453#wp_delimgbtn,
     1454#wp_editgallery,
     1455#wp_delgallery {
    14531456    border-color: #999;
    14541457    background-color: #eee;
    14551458}
    14561459
    1457 #wp_editimgbtn:hover, #wp_delimgbtn:hover {
     1460#wp_editimgbtn:hover,
     1461#wp_delimgbtn:hover,
     1462#wp_editgallery:hover,
     1463#wp_delgallery:hover {
    14581464    border-color: #555;
    14591465    background-color: #ccc;
  • trunk/wp-admin/css/colors-fresh.css

    r9842 r9847  
    14531453}
    14541454
    1455 #wp_editimgbtn, #wp_delimgbtn {
     1455#wp_editimgbtn,
     1456#wp_delimgbtn,
     1457#wp_editgallery,
     1458#wp_delgallery {
    14561459    border-color: #999;
    14571460    background-color: #eee;
    14581461}
    14591462
    1460 #wp_editimgbtn:hover, #wp_delimgbtn:hover {
     1463#wp_editimgbtn:hover,
     1464#wp_delimgbtn:hover,
     1465#wp_editgallery:hover,
     1466#wp_delgallery:hover {
    14611467    border-color: #555;
    14621468    background-color: #ccc;
  • trunk/wp-admin/includes/post.php

    r9716 r9847  
    11251125        $ext_plugins = '';
    11261126    } else {
    1127         $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage' );
     1127        $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage', 'wpgallery' );
    11281128
    11291129        /*
  • trunk/wp-admin/wp-admin.css

    r9842 r9847  
    21842184}
    21852185
    2186 #wp_editbtns {
     2186#wp_editbtns,
     2187#wp_gallerybtns {
    21872188    padding: 2px;
    21882189    position: absolute;
     
    21912192}
    21922193
    2193 #wp_editimgbtn, #wp_delimgbtn {
     2194#wp_editimgbtn,
     2195#wp_delimgbtn,
     2196#wp_editgallery,
     2197#wp_delgallery {
    21942198    margin: 2px;
    21952199    padding: 2px;
  • trunk/wp-includes/js/tinymce/langs/wp-langs-en.js

    r9375 r9847  
    428428alt:"Edit Alternate Text"
    429429});
     430
     431tinyMCE.addI18n("en.gallery",{
     432settings:"Gallery Settings",
     433linkto:"Link thumbnails to:",
     434linktofile:"Image File",
     435linktopost:"Attachment Page",
     436orderby:"Order images by:",
     437menu_order:"Menu order",
     438byname:"Name",
     439bydate:"Date/Time",
     440random:"Random",
     441order:"Order:",
     442orderasc:"Ascending",
     443orderdesc:"Descending",
     444cols:"Gallery columns:",
     445two:"two",
     446three:"three",
     447four:"four",
     448five:"five",
     449six:"six",
     450seven:"seven",
     451eight:"eight",
     452nine:"nine",
     453imgwidth:"Limit the thumbnails width:",
     454imgwidthhelp:"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

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

    r9674 r9847  
    8989}
    9090
    91 #media-upload #img-edit {
     91#img-edit {
    9292    border: 1px solid #dfdfdf;
    9393    width: 623px;
     
    101101
    102102#img_demo_txt {
    103     font-size: 6px;
    104     line-height: 10px;
    105     font-family: "Courier New",Courier,monotype;
    106     color: #ccc;
    107     background-color: #ccc;
     103    font-size: 9px;
     104    line-height: 13px;
     105    font-family: Monaco,"Courier New",Courier,monospace;
     106    color: #888;
    108107}
    109108
     
    133132    display: block;
    134133    float: left;
     134    height: 28px;
    135135    line-height: 28px;
    136136    text-decoration: none;
     
    333333    font-weight: bold;
    334334}
     335
     336* html #sidemenu li {
     337    zoom: 100%;
     338}
     339
     340* html #sidemenu a {
     341    height: 27px;
     342    line-height: 26px;
     343}
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js

    r9730 r9847  
    1212            ed.addCommand('WP_EditImage', function() {
    1313                var el = ed.selection.getNode(), vp = tinymce.DOM.getViewPort(), H = vp.h, W = ( 720 < vp.w ) ? 720 : vp.w;
    14 
    15                 if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' )
     14                var cls = ed.dom.getAttrib(el, 'class');
     15
     16                if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 || el.nodeName != 'IMG' )
    1617                    return;
    1718
     
    143144        showButtons : function(n) {
    144145            var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y;
    145 
    146             if (ed.dom.getAttrib(n, 'class').indexOf('mceItem') != -1)
     146            var cls = ed.dom.getAttrib(n, 'class');
     147
     148            if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 )
    147149                return;
    148150
  • trunk/wp-includes/js/tinymce/wordpress.css

    r8614 r9847  
    4141}
    4242
     43img.wpGallery {
     44    border: 1px dotted #cc0000;
     45    background: #ffffcc url("plugins/wpgallery/img/gallery.png") no-repeat scroll center center;
     46    width: 99%;
     47    height: 250px;
     48}
     49
    4350body.mceContentBody {
    4451    background: #fff;
  • trunk/wp-includes/media.php

    r9688 r9847  
    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.
    525526 * @return string HTML img element or empty string on failure.
    526527 */
    527 function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false) {
     528function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $imgwidth = false) {
    528529
    529530    $html = '';
     
    531532    if ( $image ) {
    532533        list($src, $width, $height) = $image;
    533         $hwstring = image_hwstring($width, $height);
     534        $hwstring = $imgwidth ? image_hwstring($imgwidth, '') : image_hwstring($width, $height);
    534535        if ( is_array($size) )
    535536            $size = join('x', $size);
     
    619620        'columns'    => 3,
    620621        'size'       => 'thumbnail',
     622        'imgwidth'   => ''
    621623    ), $attr));
    622624
     
    638640    $columns = intval($columns);
    639641    $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
     642    $imgwidth = isset($imgwidth) && (int) $imgwidth ? $imgwidth : false;
    640643
    641644    $output = apply_filters('gallery_style', "
     
    661664    $i = 0;
    662665    foreach ( $attachments as $id => $attachment ) {
    663         $link = wp_get_attachment_link($id, $size, true);
     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);
     667
    664668        $output .= "<{$itemtag} class='gallery-item'>";
    665669        $output .= "
  • trunk/wp-includes/post-template.php

    r9844 r9847  
    758758 * @return string HTML content.
    759759 */
    760 function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false) {
     760function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $imgwidth = 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);
     772    $link_text = wp_get_attachment_image($id, $size, $icon, $imgwidth);
    773773    if ( !$link_text )
    774774        $link_text = $_post->post_title;
  • trunk/wp-includes/script-loader.php

    r9827 r9847  
    6262    // Modify this version when tinyMCE plugins are changed.
    6363    function mce_version() {
    64         return '20081116';
     64        return '20081122';
    6565    }
    6666    add_filter( 'tiny_mce_version', 'mce_version' );
Note: See TracChangeset for help on using the changeset viewer.