DFW: change width resizing to use hotkeys only: Alt (Win, Linux) or Ctrl (Mac) 0/reset, +/wider, -/narrower, see #17136

git-svn-id: http://svn.automattic.com/wordpress/trunk@17838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-05-08 06:32:44 +00:00
parent 8267ff9aae
commit a2fcf40bd8
6 changed files with 23 additions and 31 deletions

File diff suppressed because one or more lines are too long

View File

@ -794,15 +794,6 @@ form.upgrade .hint {
display: none;
}
#wp-fullscreen-plus,
#wp-fullscreen-minus,
#wp-fullscreen-reset {
font-size: 14px;
border: 1px solid #aaa;
padding: 0 4px;
cursor: default;
}
/* =Thickbox Adjustments
-------------------------------------------------------------- */
.fullscreen-active #TB_overlay {

View File

@ -1813,9 +1813,6 @@ function wp_fullscreen_html() {
</div></div>
<div id="wp-fullscreen-count">
<span title="<?php _e('Wider'); ?>" id="wp-fullscreen-plus">+</span>
<span title="<?php _e('Narrower'); ?>" id="wp-fullscreen-minus">&ndash;</span>
<span title="<?php _e('Reset width'); ?>" id="wp-fullscreen-reset">&times;</span> &nbsp;
<?php _e('Word Count:'); ?> <span class="word-count">0</span>
</div>
</div>

View File

@ -462,28 +462,32 @@ PubSub.prototype.publish = function( topic, args ) {
if ( wptitlehint )
wptitlehint('wp-fullscreen-title');
$(document).keypress(function(e){
if ( 27 != e.keyCode )
$(document).keyup(function(e){
var c = e.charCode || e.keyCode, a;
if ( !fullscreen.settings.visible )
return true;
if ( fullscreen.settings.visible )
if ( navigator.platform && navigator.platform.indexOf('Mac') != -1 )
a = e.ctrlKey; // Ctrl key for Mac
else
a = e.altKey; // Alt key for Win & Linux
if ( 27 == c ) // Esc
fullscreen.off();
if ( a && (61 == c || 187 == c) ) // +
api.dfw_width(25);
if ( a && (45 == c || 189 == c) ) // -
api.dfw_width(-25);
if ( a && 48 == c ) // 0
api.dfw_width(0);
return true;
});
$('#wp-fullscreen-plus').click(function(){
fullscreen.dfw_width(25);
});
$('#wp-fullscreen-minus').click(function(){
fullscreen.dfw_width(-25);
});
$('#wp-fullscreen-reset').click(function(){
fullscreen.dfw_width(0);
});
topbar.mouseenter(function(e){
$('#fullscreen-topbar').addClass('fullscreen-make-sticky');
$( document ).unbind( '.fullscreen' );

File diff suppressed because one or more lines are too long

View File

@ -96,7 +96,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), '20110411' );
$scripts->add_data( 'editor', 'group', 1 );
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110507' );
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110507a' );
$scripts->add_data( 'wp-fullscreen', 'group', 1 );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6.1');
@ -487,7 +487,7 @@ function wp_default_styles( &$styles ) {
// Any rtl stylesheets that don't have a .dev version for ltr
$no_suffix = array( 'farbtastic' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20110507c' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20110507d' );
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20101102' );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' );