+ var access = tinymce.Env.mac ? __( 'Ctrl + Alt + letter:' ) : __( 'Shift + Alt + letter:' ),
+ meta = tinymce.Env.mac ? __( 'Cmd + letter:' ) : __( 'Ctrl + letter:' ),
+ table1 = [],
+ table2 = [],
+ header, html, dialog, $wrap;
+
+ each( [
+ { c: 'Copy', x: 'Cut' },
+ { v: 'Paste', a: 'Select all' },
+ { z: 'Undo', y: 'Redo' },
+ { b: 'Bold', i: 'Italic' },
+ { u: 'Underline', k: 'Insert/edit link' }
+ ], function( row ) {
+ table1.push( tr( row ) );
+ } );
+
+ each( [
+ { 1: 'Heading 1', 2: 'Heading 2' },
+ { 3: 'Heading 3', 4: 'Heading 4' },
+ { 5: 'Heading 5', 6: 'Heading 6' },
+ { l: 'Align left', c: 'Align center' },
+ { r: 'Align right', j: 'Justify' },
+ { d: 'Strikethrough', q: 'Blockquote' },
+ { u: 'Bullet list', o: 'Numbered list' },
+ { a: 'Insert/edit link', s: 'Remove link' },
+ { m: 'Insert/edit image', t: 'Insert Read More tag' },
+ { h: 'Keyboard Shortcuts', x: 'Code' },
+ { p: 'Insert Page Break tag', w: 'Distraction-free writing mode' }
+ ], function( row ) {
+ table2.push( tr( row ) );
+ } );
+
+ function tr( row ) {
+ var out = '<tr>';
+
+ each( row, function( text, key ) {
+ if ( ! text ) {
+ out += '<td></td><td></td>';
+ } else {
+ out += '<td><kbd>' + key + '</kbd></td><td>' + __( text ) + '</td>';
+ }
+ });
+
+ return out + '</tr>';
+ }
+
+ header = [ __( 'Letter' ), __( 'Action' ), __( 'Letter' ), __( 'Action' ) ];
+ header = '<tr><th>' + header.join( '</th><th>' ) + '</th></tr>';
+
+ html = '<div class="wp-editor-help">';
+
+ // Main section, default and additional shortcuts
+ html = html +
+ '<h2>' + __( 'Default shortcuts,' ) + ' ' + meta + '</h2>' +
+ '<table class="wp-help-th-center">' +
+ header +
+ table1.join('') +
+ '</table>' +
+ '<h2>' + __( 'Additional shortcuts,' ) + ' ' + access + '</h2>' +
+ '<table class="wp-help-th-center">' +
+ header +
+ table2.join('') +
+ '</table>';
+
+ if ( editor.plugins.wptextpattern ) {
+ // Text pattern section
+ html = html +
+ '<h2>' + __( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ) + '</h2>' +
+ '<table>' +
+ tr({ '*': 'Bullet list' }) +
+ tr({ '-': 'Bullet list' }) +
+ tr({ '1.': 'Numbered list' }) +
+ tr({ '1)': 'Numbered list' }) +
+ '</table>';
+
+ html = html +
+ '<h2>' + __( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ) + '</h2>' +
+ '<table>' +
+ tr({ '>': 'Blockquote' }) +
+ tr({ '##': 'Heading 2' }) +
+ tr({ '###': 'Heading 3' }) +
+ tr({ '####': 'Heading 4' }) +
+ tr({ '#####': 'Heading 5' }) +
+ tr({ '######': 'Heading 6' }) +
+ '</table>';
+ }
+
+ // Focus management section
+ html = html +
+ '<h2>' + __( 'Focus shortcuts:' ) + '</h2>' +
+ '<table>' +
+ tr({ 'Alt + F8': 'Inline toolbar (when an image, link or preview is selected)' }) +
+ tr({ 'Alt + F9': 'Editor menu (when enabled)' }) +
+ tr({ 'Alt + F10': 'Editor toolbar' }) +
+ tr({ 'Alt + F11': 'Elements path' }) +
+ '</table>' +
+ '<p>' + __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ) + '</p>';
+
+ html += '</div>';
+
+ dialog = editor.windowManager.open( {