Ticket #21414: 21414.patch
File 21414.patch, 15.1 KB (added by , 12 years ago) |
---|
-
wp-admin/user-edit.php
217 217 if ( !( IS_PROFILE_PAGE && !$user_can_edit ) ) : ?> 218 218 <tr> 219 219 <th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th> 220 <td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( !empty($profileuser->comment_shortcuts) ) checked('true', $profileuser->comment_shortcuts); ?> /> <?php _e('Enable keyboard shortcuts for comment moderation.'); ?></label> <?php _e('<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>'); ?></td>220 <td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( !empty($profileuser->comment_shortcuts) ) checked('true', $profileuser->comment_shortcuts); ?> /> <?php _e('Enable keyboard shortcuts.'); ?></label> <?php _e('<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>'); ?></td> 221 221 </tr> 222 222 <?php endif; ?> 223 223 <tr class="show-admin-bar"> -
wp-includes/class-wp-editor.php
10 10 11 11 final class _WP_Editors { 12 12 public static $mce_locale; 13 public static $custom_shortcuts = false; 13 14 14 15 private static $mce_settings = array(); 15 16 private static $qt_settings = array(); … … 45 46 46 47 self::$this_tinymce = ( $set['tinymce'] && user_can_richedit() ); 47 48 self::$this_quicktags = (bool) $set['quicktags']; 49 self::$custom_shortcuts = 'true' == get_user_option( 'comment_shortcuts' ); 48 50 49 51 if ( self::$this_tinymce ) 50 52 self::$has_tinymce = true; … … 317 319 'paste_remove_spans' => true, 318 320 'paste_strip_class_attributes' => 'all', 319 321 'paste_text_use_dialog' => true, 322 'wpCustomShortcuts' => self::$custom_shortcuts, 320 323 'spellchecker_rpc_url' => self::$baseurl . '/plugins/spellchecker/rpc.php', 321 324 'extended_valid_elements' => 'article[*],aside[*],audio[*],canvas[*],command[*],datalist[*],details[*],embed[*],figcaption[*],figure[*],footer[*],header[*],hgroup[*],keygen[*],mark[*],meter[*],nav[*],output[*],progress[*],section[*],source[*],summary,time[*],video[*],wbr', 322 325 'wpeditimage_disable_captions' => $no_captions, … … 515 518 $ref = array( 516 519 'plugins' => implode( ',', self::$plugins ), 517 520 'theme' => 'advanced', 518 'language' => self::$mce_locale 521 'language' => self::$mce_locale, 522 'wpCustomShortcuts' => self::$custom_shortcuts 519 523 ); 520 524 521 525 $suffix = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '_src' : ''; -
wp-includes/js/tinymce/langs/wp-langs-en.js
1 (function(){ 2 var shortcuts = typeof(tinyMCEPreInit) != 'undefined' ? tinyMCEPreInit.ref.wpCustomShortcuts : false; 3 1 4 tinyMCE.addI18n({en:{ 2 5 common:{ 3 6 edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", … … 170 173 unload_msg:"The changes you made will be lost if you navigate away from this page." 171 174 }, 172 175 fullscreen:{ 173 desc: "Toggle fullscreen mode (Alt + Shift + G)"176 desc: shortcuts ? "Toggle fullscreen mode (Alt + Shift + G)" : "Toggle fullscreen mode" 174 177 }, 175 178 media:{ 176 179 desc:"Insert / edit embedded media", … … 186 189 desc:"Visual control characters on/off." 187 190 }, 188 191 spellchecker:{ 189 desc: "Toggle spellchecker (Alt + Shift + N)",192 desc: shortcuts ? "Toggle spellchecker (Alt + Shift + N)" : "Toggle spellchecker", 190 193 menu:"Spellchecker settings", 191 194 ignore_word:"Ignore word", 192 195 ignore_words:"Ignore all", … … 243 246 bold_desc:"Bold (Ctrl + B)", 244 247 italic_desc:"Italic (Ctrl + I)", 245 248 underline_desc:"Underline", 246 striketrough_desc: "Strikethrough (Alt + Shift + D)",247 justifyleft_desc: "Align Left (Alt + Shift + L)",248 justifycenter_desc: "Align Center (Alt + Shift + C)",249 justifyright_desc: "Align Right (Alt + Shift + R)",250 justifyfull_desc: "Align Full (Alt + Shift + J)",251 bullist_desc: "Unordered list (Alt + Shift + U)",252 numlist_desc: "Ordered list (Alt + Shift + O)",249 striketrough_desc: shortcuts ? "Strikethrough (Alt + Shift + D)" : "Strikethrough", 250 justifyleft_desc: shortcuts ? "Align Left (Alt + Shift + L)" : "Align Left", 251 justifycenter_desc: shortcuts ? "Align Center (Alt + Shift + C)" : "Align Center", 252 justifyright_desc: shortcuts ? "Align Right (Alt + Shift + R)" : "Align Right", 253 justifyfull_desc: shortcuts ? "Align Full (Alt + Shift + J)" : "Align Full", 254 bullist_desc: shortcuts ? "Unordered list (Alt + Shift + U)" : "Unordered list", 255 numlist_desc: shortcuts ? "Ordered list (Alt + Shift + O)" : "Ordered list", 253 256 outdent_desc:"Outdent", 254 257 indent_desc:"Indent", 255 258 undo_desc:"Undo (Ctrl + Z)", 256 259 redo_desc:"Redo (Ctrl + Y)", 257 link_desc: "Insert/edit link (Alt + Shift + A)",258 unlink_desc: "Unlink (Alt + Shift + S)",259 image_desc: "Insert/edit image (Alt + Shift + M)",260 link_desc: shortcuts ? "Insert/edit link (Alt + Shift + A)" : "Insert/edit link", 261 unlink_desc: shortcuts ? "Unlink (Alt + Shift + S)" : "Unlink", 262 image_desc: shortcuts ? "Insert/edit image (Alt + Shift + M)" : "Insert/edit image", 260 263 cleanup_desc:"Cleanup messy code", 261 264 code_desc:"Edit HTML Source", 262 265 sub_desc:"Subscript", … … 274 277 image_props_desc:"Image properties", 275 278 newdocument_desc:"New document", 276 279 help_desc:"Help", 277 blockquote_desc: "Blockquote (Alt + Shift + Q)",280 blockquote_desc: shortcuts ? "Blockquote (Alt + Shift + Q)" : "Blockquote", 278 281 clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.", 279 282 path:"Path", 280 283 newdocument:"Are you sure you want to clear all contents?", … … 452 455 }); 453 456 454 457 tinyMCE.addI18n("en.wordpress",{ 455 wp_adv_desc: "Show/Hide Kitchen Sink (Alt + Shift + Z)",456 wp_more_desc: "Insert More Tag (Alt + Shift + T)",457 wp_page_desc: "Insert Page break (Alt + Shift + P)",458 wp_help_desc: "Help (Alt + Shift + H)",458 wp_adv_desc: shortcuts ? "Show/Hide Kitchen Sink (Alt + Shift + Z)" : "Show/Hide Kitchen Sink", 459 wp_more_desc: shortcuts ? "Insert More Tag (Alt + Shift + T)" : "Insert More Tag", 460 wp_page_desc: shortcuts ? "Insert Page break (Alt + Shift + P)" : "Insert Page break", 461 wp_help_desc: shortcuts ? "Help (Alt + Shift + H)" : "Help", 459 462 wp_more_alt:"More...", 460 463 wp_page_alt:"Next page...", 461 464 add_media:"Add Media", … … 464 467 add_audio:"Add Audio", 465 468 editgallery:"Edit Gallery", 466 469 delgallery:"Delete Gallery", 467 wp_fullscreen_desc: "Distraction Free Writing mode (Alt + Shift + W)"470 wp_fullscreen_desc: shortcuts ? "Distraction Free Writing mode (Alt + Shift + W)" : "Distraction Free Writing mode" 468 471 }); 469 472 470 473 tinyMCE.addI18n("en.wpeditimage",{ … … 502 505 caption:"Caption", 503 506 alt:"Alternate Text" 504 507 }); 508 })(); -
wp-includes/js/tinymce/langs/wp-langs.php
12 12 } 13 13 14 14 function wp_mce_translation() { 15 $shortcuts = _WP_Editors::$custom_shortcuts; 15 16 16 17 $default = array( 17 18 'common' => array( … … 207 208 ), 208 209 209 210 'fullscreen' => array( 210 'desc' => __('Toggle fullscreen mode (Alt + Shift + G)')211 'desc' => $shortcuts ? __('Toggle fullscreen mode (Alt + Shift + G)') : __('Toggle fullscreen mode') 211 212 ), 212 213 213 214 'media' => array( … … 228 229 ), 229 230 230 231 'spellchecker' => array( 231 'desc' => __('Toggle spellchecker (Alt + Shift + N)'),232 'desc' => $shortcuts ? __('Toggle spellchecker (Alt + Shift + N)') : __('Toggle spellchecker'), 232 233 'menu' => __('Spellchecker settings'), 233 234 'ignore_word' => __('Ignore word'), 234 235 'ignore_words' => __('Ignore all'), … … 289 290 'bold_desc' => __('Bold (Ctrl + B)'), 290 291 'italic_desc' => __('Italic (Ctrl + I)'), 291 292 'underline_desc' => __('Underline'), 292 'striketrough_desc' => __('Strikethrough (Alt + Shift + D)'),293 'justifyleft_desc' => __('Align Left (Alt + Shift + L)'),294 'justifycenter_desc' => __('Align Center (Alt + Shift + C)'),295 'justifyright_desc' => __('Align Right (Alt + Shift + R)'),296 'justifyfull_desc' => __('Align Full (Alt + Shift + J)'),297 'bullist_desc' => __('Unordered list (Alt + Shift + U)'),298 'numlist_desc' => __('Ordered list (Alt + Shift + O)'),293 'striketrough_desc' => $shortcuts ? __('Strikethrough (Alt + Shift + D)') : __('Strikethrough'), 294 'justifyleft_desc' => $shortcuts ? __('Align Left (Alt + Shift + L)') : __('Align Left'), 295 'justifycenter_desc' => $shortcuts ? __('Align Center (Alt + Shift + C)') : __('Align Center'), 296 'justifyright_desc' => $shortcuts ? __('Align Right (Alt + Shift + R)') : __('Align Right'), 297 'justifyfull_desc' => $shortcuts ? __('Align Full (Alt + Shift + J)') : __('Align Full'), 298 'bullist_desc' => $shortcuts ? __('Unordered list (Alt + Shift + U)') : __('Unordered list'), 299 'numlist_desc' => $shortcuts ? __('Ordered list (Alt + Shift + O)') : __('Ordered list'), 299 300 'outdent_desc' => __('Outdent'), 300 301 'indent_desc' => __('Indent'), 301 302 'undo_desc' => __('Undo (Ctrl + Z)'), 302 303 'redo_desc' => __('Redo (Ctrl + Y)'), 303 'link_desc' => __('Insert/edit link (Alt + Shift + A)'),304 'unlink_desc' => __('Unlink (Alt + Shift + S)'),305 'image_desc' => __('Insert/edit image (Alt + Shift + M)'),304 'link_desc' => $shortcuts ? __('Insert/edit link (Alt + Shift + A)') : __('Insert/edit link'), 305 'unlink_desc' => $shortcuts ? __('Unlink (Alt + Shift + S)') : __('Unlink'), 306 'image_desc' => $shortcuts ? __('Insert/edit image (Alt + Shift + M)') : __('Insert/edit image'), 306 307 'cleanup_desc' => __('Cleanup messy code'), 307 308 'code_desc' => __('Edit HTML Source'), 308 309 'sub_desc' => __('Subscript'), … … 320 321 'image_props_desc' => __('Image properties'), 321 322 'newdocument_desc' => __('New document'), 322 323 'help_desc' => __('Help'), 323 'blockquote_desc' => __('Blockquote (Alt + Shift + Q)'),324 'blockquote_desc' => $shortcuts ? __('Blockquote (Alt + Shift + Q)') : __('Blockquote'), 324 325 'clipboard_msg' => __('Copy/Cut/Paste is not available in Mozilla and Firefox.'), 325 326 'path' => __('Path'), 326 327 'newdocument' => __('Are you sure you want to clear all contents?'), … … 498 499 ); 499 500 500 501 $wordpress = array( 501 'wp_adv_desc' => __('Show/Hide Kitchen Sink (Alt + Shift + Z)'),502 'wp_more_desc' => __('Insert More Tag (Alt + Shift + T)'),503 'wp_page_desc' => __('Insert Page break (Alt + Shift + P)'),504 'wp_help_desc' => __('Help (Alt + Shift + H)'),502 'wp_adv_desc' => $shortcuts ? __('Show/Hide Kitchen Sink (Alt + Shift + Z)') : __('Show/Hide Kitchen Sink'), 503 'wp_more_desc' => $shortcuts ? __('Insert More Tag (Alt + Shift + T)') : __('Insert More Tag'), 504 'wp_page_desc' => $shortcuts ? __('Insert Page break (Alt + Shift + P)') : __('Insert Page break'), 505 'wp_help_desc' => $shortcuts ? __('Help (Alt + Shift + H)') : __('Help'), 505 506 'wp_more_alt' => __('More...'), 506 507 'wp_page_alt' => __('Next page...'), 507 508 'add_media' => __('Add Media'), … … 510 511 'add_audio' => __('Add Audio'), 511 512 'editgallery' => __('Edit Gallery'), 512 513 'delgallery' => __('Delete Gallery'), 513 'wp_fullscreen_desc' => __('Distraction Free Writing mode (Alt + Shift + W)')514 'wp_fullscreen_desc' => $shortcuts ? __('Distraction Free Writing mode (Alt + Shift + W)') : __('Distraction Free Writing mode') 514 515 ); 515 516 516 517 $wpeditimage = array( -
wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
249 249 t._handleMoreBreak(ed, url); 250 250 251 251 // Add custom shortcuts 252 mod_key = 'alt+shift'; 252 if ( ed.getParam('wpCustomShortcuts') ) { 253 mod_key = ed.getParam('wpCustomShortcutsModKeys', 'alt+shift'); 253 254 254 // if ( tinymce.isGecko ) // disable for mow, too many shortcuts conflicts 255 // mod_key = 'ctrl+alt'; 255 ed.addShortcut(mod_key + '+c', 'justifycenter_desc', 'JustifyCenter'); 256 ed.addShortcut(mod_key + '+r', 'justifyright_desc', 'JustifyRight'); 257 ed.addShortcut(mod_key + '+l', 'justifyleft_desc', 'JustifyLeft'); 258 ed.addShortcut(mod_key + '+j', 'justifyfull_desc', 'JustifyFull'); 259 ed.addShortcut(mod_key + '+q', 'blockquote_desc', 'mceBlockQuote'); 260 ed.addShortcut(mod_key + '+u', 'bullist_desc', 'InsertUnorderedList'); 261 ed.addShortcut(mod_key + '+o', 'numlist_desc', 'InsertOrderedList'); 262 ed.addShortcut(mod_key + '+n', 'spellchecker.desc', 'mceSpellCheck'); 263 ed.addShortcut(mod_key + '+a', 'link_desc', 'WP_Link'); 264 ed.addShortcut(mod_key + '+s', 'unlink_desc', 'unlink'); 265 ed.addShortcut(mod_key + '+m', 'image_desc', 'WP_Medialib'); 266 ed.addShortcut(mod_key + '+z', 'wordpress.wp_adv_desc', 'WP_Adv'); 267 ed.addShortcut(mod_key + '+t', 'wordpress.wp_more_desc', 'WP_More'); 268 ed.addShortcut(mod_key + '+d', 'striketrough_desc', 'Strikethrough'); 269 ed.addShortcut(mod_key + '+h', 'help_desc', 'WP_Help'); 270 ed.addShortcut(mod_key + '+p', 'wordpress.wp_page_desc', 'WP_Page'); 271 ed.addShortcut('ctrl+s', 'save_desc', function(){if('function'==typeof autosave)autosave();}); 256 272 257 ed.addShortcut(mod_key + '+c', 'justifycenter_desc', 'JustifyCenter'); 258 ed.addShortcut(mod_key + '+r', 'justifyright_desc', 'JustifyRight'); 259 ed.addShortcut(mod_key + '+l', 'justifyleft_desc', 'JustifyLeft'); 260 ed.addShortcut(mod_key + '+j', 'justifyfull_desc', 'JustifyFull'); 261 ed.addShortcut(mod_key + '+q', 'blockquote_desc', 'mceBlockQuote'); 262 ed.addShortcut(mod_key + '+u', 'bullist_desc', 'InsertUnorderedList'); 263 ed.addShortcut(mod_key + '+o', 'numlist_desc', 'InsertOrderedList'); 264 ed.addShortcut(mod_key + '+n', 'spellchecker.desc', 'mceSpellCheck'); 265 ed.addShortcut(mod_key + '+a', 'link_desc', 'WP_Link'); 266 ed.addShortcut(mod_key + '+s', 'unlink_desc', 'unlink'); 267 ed.addShortcut(mod_key + '+m', 'image_desc', 'WP_Medialib'); 268 ed.addShortcut(mod_key + '+z', 'wordpress.wp_adv_desc', 'WP_Adv'); 269 ed.addShortcut(mod_key + '+t', 'wordpress.wp_more_desc', 'WP_More'); 270 ed.addShortcut(mod_key + '+d', 'striketrough_desc', 'Strikethrough'); 271 ed.addShortcut(mod_key + '+h', 'help_desc', 'WP_Help'); 272 ed.addShortcut(mod_key + '+p', 'wordpress.wp_page_desc', 'WP_Page'); 273 ed.addShortcut('ctrl+s', 'save_desc', function(){if('function'==typeof autosave)autosave();}); 273 if ( /\bwpfullscreen\b/.test(ed.settings.plugins) ) 274 ed.addShortcut(mod_key + '+w', 'wordpress.wp_fullscreen_desc', 'wpFullScreen'); 275 else if ( /\bfullscreen\b/.test(ed.settings.plugins) ) 276 ed.addShortcut(mod_key + '+g', 'fullscreen.desc', 'mceFullScreen'); 277 } 274 278 275 if ( /\bwpfullscreen\b/.test(ed.settings.plugins) )276 ed.addShortcut(mod_key + '+w', 'wordpress.wp_fullscreen_desc', 'wpFullScreen');277 else if ( /\bfullscreen\b/.test(ed.settings.plugins) )278 ed.addShortcut(mod_key + '+g', 'fullscreen.desc', 'mceFullScreen');279 280 279 // popup buttons for images and the gallery 281 280 ed.onInit.add(function(ed) { 282 281 tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) {