WordPress.org

Make WordPress Core

Changeset 9654


Ignore:
Timestamp:
11/13/2008 03:07:39 AM (10 years ago)
Author:
azaozz
Message:

Keep state for image size, alignment and url in the uploader and for categories view on the write page, fixes #7520

Location:
trunk
Files:
4 edited

Legend:

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

    r9644 r9654  
    8787
    8888div.ui-tabs-panel {
    89     border-color: #cee1ef;
     89    border-color: #f1f1f1;
     90}
     91
     92ul#category-tabs li.ui-tabs-selected {
     93    background-color: #f1f1f1;
    9094}
    9195
     
    139143}
    140144
    141 #post-body ul#category-tabs li.ui-tabs-selected,
    142145#login form .submit input, .search-box .button,
    143146#ed_reply_toolbar {
  • trunk/wp-admin/includes/media.php

    r9578 r9654  
    774774        $url = $link;
    775775   
    776     return "<input type='text' name='attachments[$post->ID][url]' value='" . attribute_escape($url) . "' /><br />
    777                 <button type='button' class='button url-$post->ID' title=''>" . __('None') . "</button>
    778                 <button type='button' class='button url-$post->ID' title='" . attribute_escape($file) . "'>" . __('File URL') . "</button>
    779                 <button type='button' class='button url-$post->ID' title='" . attribute_escape($link) . "'>" . __('Post URL') . "</button>
    780                 <script type='text/javascript'>
    781                 jQuery('button.url-$post->ID').bind('click', function(){jQuery(this).siblings('input').val(jQuery(this).attr('title'));});
    782                 </script>\n";
     776    return "<input type='text' class='urlfield' name='attachments[$post->ID][url]' value='" . attribute_escape($url) . "' /><br />
     777                <button type='button' class='button urlnone' title=''>" . __('None') . "</button>
     778                <button type='button' class='button urlfile' title='" . attribute_escape($file) . "'>" . __('File URL') . "</button>
     779                <button type='button' class='button urlpost' title='" . attribute_escape($link) . "'>" . __('Post URL') . "</button>
     780";
    783781}
    784782
     
    16801678            <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
    16811679            <td class="field">
    1682                 <input name="align" id="align-none" value="alignnone" onclick="addExtImage.align=this.value" type="radio"' . ($default_align == 'none' ? ' checked="checked"' : '').' />
     1680                <input name="align" id="align-none" value="none" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'none' ? ' checked="checked"' : '').' />
    16831681                <label for="align-none" class="align image-align-none-label">' . __('None') . '</label>
    1684                 <input name="align" id="align-left" value="alignleft" onclick="addExtImage.align=this.value" type="radio"' . ($default_align == 'left' ? ' checked="checked"' : '').' />
     1682                <input name="align" id="align-left" value="left" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'left' ? ' checked="checked"' : '').' />
    16851683                <label for="align-left" class="align image-align-left-label">' . __('Left') . '</label>
    1686                 <input name="align" id="align-center" value="aligncenter" onclick="addExtImage.align=this.value" type="radio"' . ($default_align == 'center' ? ' checked="checked"' : '').' />
     1684                <input name="align" id="align-center" value="center" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'center' ? ' checked="checked"' : '').' />
    16871685                <label for="align-center" class="align image-align-center-label">' . __('Center') . '</label>
    1688                 <input name="align" id="align-right" value="alignright" onclick="addExtImage.align=this.value" type="radio"' . ($default_align == 'right' ? ' checked="checked"' : '').' />
     1686                <input name="align" id="align-right" value="right" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'right' ? ' checked="checked"' : '').' />
    16891687                <label for="align-right" class="align image-align-right-label">' . __('Right') . '</label>
    16901688            </td>
  • trunk/wp-admin/js/post.js

    r9639 r9654  
    191191        return false;
    192192    } );
     193
     194    $('a[href="#categories-all"]').click(function(){deleteUserSetting('cats');});
     195    $('a[href="#categories-pop"]').click(function(){setUserSetting('cats','pop');});
     196    if ( 'pop' == getUserSetting('cats') )
     197        $('a[href="#categories-pop"]').click();
     198
    193199    jQuery('.categorychecklist .popular-category :checkbox').change( syncChecks ).filter( ':checked' ).change();
    194200    var stamp = $('#timestamp').html();
  • trunk/wp-includes/js/swfupload/handlers.js

    r9465 r9654  
    248248    }
    249249}
     250
     251// remember the last used image size, alignment and url
     252jQuery(document).ready(function($){
     253    var align = getUserSetting('align') || '', imgsize = getUserSetting('imgsize') || '';
     254
     255    $('tr.align input[type="radio"]').click(function(){
     256        setUserSetting('align', $(this).val());
     257    }).filter(function(){
     258        if ( $(this).val() == align )
     259            return true;
     260        return false;
     261    }).attr('checked','checked');
     262
     263    $('tr.image-size input[type="radio"]').click(function(){
     264        setUserSetting('imgsize', $(this).val());
     265    }).filter(function(){
     266        if ( $(this).attr('disabled') || $(this).val() != imgsize )
     267            return false;
     268        return true;
     269    }).attr('checked','checked');
     270
     271    $('tr.url button').click(function(){
     272        var c = this.className || '';
     273        c = c.replace(/.*?(url[^ '"]+).*/, '$1');
     274        if (c) setUserSetting('urlbutton', c);
     275        $(this).siblings('.urlfield').val( $(this).attr('title') );
     276    });
     277
     278    $('tr.url .urlfield').each(function(){
     279        var b = getUserSetting('urlbutton');
     280        $(this).val( $(this).siblings('button.'+b).attr('title') );
     281    });
     282});
Note: See TracChangeset for help on using the changeset viewer.