PluginProbe
bbPress / 2.6.6
bbPress v2.6.6
trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.2.2 All 71 releases
bbpress / templates / default / js / editor.js

editor.js in bbPress 2.6.6, at templates/default/js/editor.js

53 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* global edButtons, QTags, tinymce */
2 jQuery(document).ready( function() {
3
4 /* Use backticks instead of <code> for the Code button in the editor */
5 if ( typeof( edButtons ) !== 'undefined' ) {
6 edButtons[110] = new QTags.TagButton( 'code', 'code', '`', '`', 'c' );
7 QTags._buttonsInit();
8 }
9
10 /* Tab from topic title */
11 jQuery( '#bbp_topic_title' ).bind( 'keydown.editor-focus', function(e) {
12 if ( e.which !== 9 ) {
13 return;
14 }
15
16 if ( !e.ctrlKey && !e.altKey && !e.shiftKey ) {
17 if ( typeof( tinymce ) !== 'undefined' ) {
18 if ( ! tinymce.activeEditor.isHidden() ) {
19 var editor = tinymce.activeEditor.editorContainer;
20 jQuery( '#' + editor + ' td.mceToolbar > a' ).focus();
21 } else {
22 jQuery( 'textarea.bbp-the-content' ).focus();
23 }
24 } else {
25 jQuery( 'textarea.bbp-the-content' ).focus();
26 }
27
28 e.preventDefault();
29 }
30 });
31
32 /* Shift + tab from topic tags */
33 jQuery( '#bbp_topic_tags' ).bind( 'keydown.editor-focus', function(e) {
34 if ( e.which !== 9 ) {
35 return;
36 }
37
38 if ( e.shiftKey && !e.ctrlKey && !e.altKey ) {
39 if ( typeof( tinymce ) !== 'undefined' ) {
40 if ( ! tinymce.activeEditor.isHidden() ) {
41 var editor = tinymce.activeEditor.editorContainer;
42 jQuery( '#' + editor + ' td.mceToolbar > a' ).focus();
43 } else {
44 jQuery( 'textarea.bbp-the-content' ).focus();
45 }
46 } else {
47 jQuery( 'textarea.bbp-the-content' ).focus();
48 }
49
50 e.preventDefault();
51 }
52 });
53 });