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:
Andrew Ozz
2008-11-13 03:07:39 +00:00
parent c0f3c21378
commit 054a6aa047
4 changed files with 53 additions and 13 deletions

View File

@@ -247,3 +247,36 @@ function uploadError(fileObj, error_code, message) {
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') );
});
});