Keep state for image size, alignment and url in the uploader and for categories view on the write page, fixes #7520
git-svn-id: https://develop.svn.wordpress.org/trunk@9654 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c0f3c21378
commit
054a6aa047
@ -86,7 +86,11 @@ ul.widget-control-list div.widget-control-actions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.ui-tabs-panel {
|
div.ui-tabs-panel {
|
||||||
border-color: #cee1ef;
|
border-color: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul#category-tabs li.ui-tabs-selected {
|
||||||
|
background-color: #f1f1f1;
|
||||||
}
|
}
|
||||||
|
|
||||||
input.disabled,
|
input.disabled,
|
||||||
@ -138,7 +142,6 @@ strong .post-com-count span {
|
|||||||
background-color: #2583ad;
|
background-color: #2583ad;
|
||||||
}
|
}
|
||||||
|
|
||||||
#post-body ul#category-tabs li.ui-tabs-selected,
|
|
||||||
#login form .submit input, .search-box .button,
|
#login form .submit input, .search-box .button,
|
||||||
#ed_reply_toolbar {
|
#ed_reply_toolbar {
|
||||||
background-color: #cee1ef !important;
|
background-color: #cee1ef !important;
|
||||||
|
@ -773,13 +773,11 @@ function image_link_input_fields($post, $url_type='') {
|
|||||||
elseif ( $url_type == 'post' )
|
elseif ( $url_type == 'post' )
|
||||||
$url = $link;
|
$url = $link;
|
||||||
|
|
||||||
return "<input type='text' name='attachments[$post->ID][url]' value='" . attribute_escape($url) . "' /><br />
|
return "<input type='text' class='urlfield' name='attachments[$post->ID][url]' value='" . attribute_escape($url) . "' /><br />
|
||||||
<button type='button' class='button url-$post->ID' title=''>" . __('None') . "</button>
|
<button type='button' class='button urlnone' title=''>" . __('None') . "</button>
|
||||||
<button type='button' class='button url-$post->ID' title='" . attribute_escape($file) . "'>" . __('File URL') . "</button>
|
<button type='button' class='button urlfile' title='" . attribute_escape($file) . "'>" . __('File URL') . "</button>
|
||||||
<button type='button' class='button url-$post->ID' title='" . attribute_escape($link) . "'>" . __('Post URL') . "</button>
|
<button type='button' class='button urlpost' title='" . attribute_escape($link) . "'>" . __('Post URL') . "</button>
|
||||||
<script type='text/javascript'>
|
";
|
||||||
jQuery('button.url-$post->ID').bind('click', function(){jQuery(this).siblings('input').val(jQuery(this).attr('title'));});
|
|
||||||
</script>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1679,13 +1677,13 @@ function type_form_image() {
|
|||||||
<tr class="align">
|
<tr class="align">
|
||||||
<th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
|
<th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
|
||||||
<td class="field">
|
<td class="field">
|
||||||
<input name="align" id="align-none" value="alignnone" onclick="addExtImage.align=this.value" type="radio"' . ($default_align == 'none' ? ' checked="checked"' : '').' />
|
<input name="align" id="align-none" value="none" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'none' ? ' checked="checked"' : '').' />
|
||||||
<label for="align-none" class="align image-align-none-label">' . __('None') . '</label>
|
<label for="align-none" class="align image-align-none-label">' . __('None') . '</label>
|
||||||
<input name="align" id="align-left" value="alignleft" onclick="addExtImage.align=this.value" type="radio"' . ($default_align == 'left' ? ' checked="checked"' : '').' />
|
<input name="align" id="align-left" value="left" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'left' ? ' checked="checked"' : '').' />
|
||||||
<label for="align-left" class="align image-align-left-label">' . __('Left') . '</label>
|
<label for="align-left" class="align image-align-left-label">' . __('Left') . '</label>
|
||||||
<input name="align" id="align-center" value="aligncenter" onclick="addExtImage.align=this.value" type="radio"' . ($default_align == 'center' ? ' checked="checked"' : '').' />
|
<input name="align" id="align-center" value="center" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'center' ? ' checked="checked"' : '').' />
|
||||||
<label for="align-center" class="align image-align-center-label">' . __('Center') . '</label>
|
<label for="align-center" class="align image-align-center-label">' . __('Center') . '</label>
|
||||||
<input name="align" id="align-right" value="alignright" onclick="addExtImage.align=this.value" type="radio"' . ($default_align == 'right' ? ' checked="checked"' : '').' />
|
<input name="align" id="align-right" value="right" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'right' ? ' checked="checked"' : '').' />
|
||||||
<label for="align-right" class="align image-align-right-label">' . __('Right') . '</label>
|
<label for="align-right" class="align image-align-right-label">' . __('Right') . '</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -190,6 +190,12 @@ jQuery(document).ready( function($) {
|
|||||||
jQuery('#newcat').focus();
|
jQuery('#newcat').focus();
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
$('a[href="#categories-all"]').click(function(){deleteUserSetting('cats');});
|
||||||
|
$('a[href="#categories-pop"]').click(function(){setUserSetting('cats','pop');});
|
||||||
|
if ( 'pop' == getUserSetting('cats') )
|
||||||
|
$('a[href="#categories-pop"]').click();
|
||||||
|
|
||||||
jQuery('.categorychecklist .popular-category :checkbox').change( syncChecks ).filter( ':checked' ).change();
|
jQuery('.categorychecklist .popular-category :checkbox').change( syncChecks ).filter( ':checked' ).change();
|
||||||
var stamp = $('#timestamp').html();
|
var stamp = $('#timestamp').html();
|
||||||
var visibility = $('#post-visibility-display').html();
|
var visibility = $('#post-visibility-display').html();
|
||||||
|
@ -247,3 +247,36 @@ function uploadError(fileObj, error_code, message) {
|
|||||||
wpQueueError(swfuploadL10n.security_error);
|
wpQueueError(swfuploadL10n.security_error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remember the last used image size, alignment and url
|
||||||
|
jQuery(document).ready(function($){
|
||||||
|
var align = getUserSetting('align') || '', imgsize = getUserSetting('imgsize') || '';
|
||||||
|
|
||||||
|
$('tr.align input[type="radio"]').click(function(){
|
||||||
|
setUserSetting('align', $(this).val());
|
||||||
|
}).filter(function(){
|
||||||
|
if ( $(this).val() == align )
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}).attr('checked','checked');
|
||||||
|
|
||||||
|
$('tr.image-size input[type="radio"]').click(function(){
|
||||||
|
setUserSetting('imgsize', $(this).val());
|
||||||
|
}).filter(function(){
|
||||||
|
if ( $(this).attr('disabled') || $(this).val() != imgsize )
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}).attr('checked','checked');
|
||||||
|
|
||||||
|
$('tr.url button').click(function(){
|
||||||
|
var c = this.className || '';
|
||||||
|
c = c.replace(/.*?(url[^ '"]+).*/, '$1');
|
||||||
|
if (c) setUserSetting('urlbutton', c);
|
||||||
|
$(this).siblings('.urlfield').val( $(this).attr('title') );
|
||||||
|
});
|
||||||
|
|
||||||
|
$('tr.url .urlfield').each(function(){
|
||||||
|
var b = getUserSetting('urlbutton');
|
||||||
|
$(this).val( $(this).siblings('button.'+b).attr('title') );
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user