Ticket #19813: keyshortcuts.diff
File keyshortcuts.diff, 5.8 KB (added by , 12 years ago) |
---|
-
wp-admin/js/utils.dev.js
142 142 143 143 return wpCookies.getHash('wp-settings-' + userSettings.uid) || {}; 144 144 } 145 function dayincrement(e,field) { 146 var keynum 147 148 if(window.event) {// IE 149 keynum = e.keyCode 150 } else if(e.which) {// Netscape/Firefox/Opera 151 keynum = e.which 152 } 153 if (keynum == 38) { 154 if(field.value >= 31) { 155 return false 156 } 157 field.value = parseInt(field.value)+ 1; 158 } else if (keynum == 40) { 159 if(field.value <= 1) { 160 return false 161 } 162 field.value = parseInt(field.value) - 1; 163 } 164 return false; 165 } 166 function yearincrement(e,field) { 167 var keynum 168 169 if(window.event) {// IE 170 keynum = e.keyCode 171 } else if(e.which) {// Netscape/Firefox/Opera 172 keynum = e.which 173 } 174 if (keynum == 38) { 175 field.value = parseInt(field.value)+ 1; 176 } else if (keynum == 40) { 177 if(field.value <= 1900) { 178 return false 179 } 180 field.value = parseInt(field.value) - 1; 181 } 182 return false; 183 } 184 function hourincrement(e,field) { 185 var keynum 186 187 if(window.event) {// IE 188 keynum = e.keyCode 189 } else if(e.which) {// Netscape/Firefox/Opera 190 keynum = e.which 191 } 192 if (keynum == 38) { 193 if(field.value >= 23) { 194 return false 195 } 196 field.value = parseInt(field.value)+ 1; 197 } else if (keynum == 40) { 198 if(field.value <= 0) { 199 return false 200 } 201 field.value = parseInt(field.value) - 1; 202 } 203 return false; 204 } 205 function minuteincrement(e,field) { 206 var keynum 207 208 if(window.event) {// IE 209 keynum = e.keyCode 210 } else if(e.which) {// Netscape/Firefox/Opera 211 keynum = e.which 212 } 213 if (keynum == 38) { 214 if(field.value >= 59) { 215 return false 216 } 217 field.value = parseInt(field.value)+ 1; 218 } else if (keynum == 40) { 219 if(field.value <= 0) { 220 return false 221 } 222 field.value = parseInt(field.value) - 1; 223 } 224 return false; 225 } 226 No newline at end of file -
wp-admin/includes/template.php
593 593 } 594 594 $month .= '</select>'; 595 595 596 $day = '<input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';597 $year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';598 $hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';599 $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';596 $day = '<input type="text" onkeydown="dayincrement(event, this)" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; 597 $year = '<input type="text" onkeydown="yearincrement(event, this)" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />'; 598 $hour = '<input type="text" onkeydown="hourincrement(event, this)" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; 599 $minute = '<input type="text" onkeydown="minuteincrement(event, this)" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; 600 600 601 601 echo '<div class="timestamp-wrap">'; 602 602 /* translators: 1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input */ … … 1380 1380 wp_enqueue_style( 'colors' ); 1381 1381 ?> 1382 1382 <script type="text/javascript"> 1383 //<![CDATA[1384 1383 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 1385 1384 function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();} 1386 1385 var userSettings = { … … 1395 1394 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', 1396 1395 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>', 1397 1396 isRtl = <?php echo (int) is_rtl(); ?>; 1398 //]]>1399 1397 </script> 1400 1398 <?php 1401 1399 do_action('admin_enqueue_scripts', $hook_suffix); … … 1409 1407 </head> 1410 1408 <body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin no-js iframe <?php echo apply_filters( 'admin_body_class', '' ) . ' ' . $admin_body_class; ?>"> 1411 1409 <script type="text/javascript"> 1412 //<![CDATA[1413 1410 (function(){ 1414 1411 var c = document.body.className; 1415 1412 c = c.replace(/no-js/, 'js'); 1416 1413 document.body.className = c; 1417 1414 })(); 1418 //]]>1419 1415 </script> 1420 1416 <?php 1421 1417 } … … 1518 1514 function compression_test() { 1519 1515 ?> 1520 1516 <script type="text/javascript"> 1521 /* <![CDATA[ */1522 1517 var testCompression = { 1523 1518 get : function(test) { 1524 1519 var x; … … 1565 1560 } 1566 1561 }; 1567 1562 testCompression.check(); 1568 /* ]]> */1569 1563 </script> 1570 1564 <?php 1571 1565 } … … 1735 1729 1736 1730 ?> 1737 1731 <script type="text/javascript"> 1738 //<![CDATA[1739 1732 jQuery(document).ready( function($) { 1740 1733 var options = <?php echo json_encode( $args ); ?>; 1741 1734 … … 1753 1746 1754 1747 $('<?php echo $selector; ?>').pointer( options ).pointer('open'); 1755 1748 }); 1756 //]]>1757 1749 </script> 1758 1750 <?php 1759 1751 }