Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextAreaWithAutocompleteInput.php |
— | — | @@ -64,7 +64,14 @@ |
65 | 65 | } |
66 | 66 | |
67 | 67 | $jstext = <<<JAVASCRIPT |
68 | | -mediaWiki.loader.using( 'ext.semanticforms.wikieditor', function(){ jQuery('#$input_id').SemanticForms_registerInputInit( ext.wikieditor.init, null ); }); |
| 68 | +if ( window.mediaWiki ) { |
| 69 | + mediaWiki.loader.using( |
| 70 | + [ 'ext.semanticforms.wikieditor', 'jquery.wikiEditor.toolbar.config' ], |
| 71 | + function(){ |
| 72 | + jQuery('#$input_id').SemanticForms_registerInputInit( ext.wikieditor.init, null ); |
| 73 | + } |
| 74 | + ); |
| 75 | +} |
69 | 76 | JAVASCRIPT; |
70 | 77 | |
71 | 78 | // write JS code directly to the page's code |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextAreaInput.php |
— | — | @@ -53,7 +53,12 @@ |
54 | 54 | |
55 | 55 | $jstext = <<<JAVASCRIPT |
56 | 56 | if ( window.mediaWiki ) { |
57 | | - mediaWiki.loader.using( 'ext.semanticforms.wikieditor', function(){ jQuery('#$input_id').SemanticForms_registerInputInit( ext.wikieditor.init, null ); }); |
| 57 | + mediaWiki.loader.using( |
| 58 | + [ 'ext.semanticforms.wikieditor', 'jquery.wikiEditor.toolbar.config' ], |
| 59 | + function(){ |
| 60 | + jQuery('#$input_id').SemanticForms_registerInputInit( ext.wikieditor.init, null ); |
| 61 | + } |
| 62 | + ); |
58 | 63 | } |
59 | 64 | JAVASCRIPT; |
60 | 65 | |
Index: trunk/extensions/SemanticForms/libs/SF_wikieditor.js |
— | — | @@ -5,29 +5,34 @@ |
6 | 6 | |
7 | 7 | window.ext.wikieditor = new function(){ |
8 | 8 | |
9 | | - var config; |
10 | | - var isSetUp = false; |
11 | | - |
12 | | - // common setup for all editor instances |
13 | | - function setup () { |
14 | | - config = jQuery.wikiEditor.modules.toolbar.config.getDefaultConfig(); |
15 | | - config.toolbar.advanced.groups.insert.tools.table.filters = ['textarea:not(#wpTextbox1):not(.toolbar-dialogs)']; |
16 | | - } |
| 9 | +// var config; |
| 10 | +// var isSetUp = false; |
| 11 | +// |
| 12 | +// // common setup for all editor instances |
| 13 | +// function setup () { |
| 14 | +// config = jQuery.wikiEditor.modules.toolbar.config.getDefaultConfig(); |
| 15 | +// config.toolbar.advanced.groups.insert.tools.table.filters = ['textarea:not(#wpTextbox1):not(.toolbar-dialogs)']; |
| 16 | +// } |
17 | 17 | |
18 | 18 | // initialize the wikieditor on the specified element |
19 | 19 | function init ( input_id, params ) { |
20 | 20 | |
21 | | - if ( !isSetUp ) { |
22 | | - isSetUp = true; |
23 | | - setup(); |
24 | | - } |
| 21 | +// if ( !isSetUp ) { |
| 22 | +// isSetUp = true; |
| 23 | +// setup(); |
| 24 | +// } |
25 | 25 | |
26 | | - var input = jQuery( '#' + input_id ); |
27 | | - input.wikiEditor( 'addModule', config ); |
| 26 | +// jQuery( document ).ready( function() { |
| 27 | + if ( !jQuery.wikiEditor.isSupported( jQuery.wikiEditor.modules.toolbar ) ) { |
| 28 | + return; |
| 29 | + } |
| 30 | + var input = jQuery( '#' + input_id ); |
| 31 | + input.wikiEditor( 'addModule', jQuery.wikiEditor.modules.toolbar.config.getDefaultConfig() ); |
| 32 | +// }); |
28 | 33 | } |
29 | 34 | |
30 | 35 | // export public funcitons |
31 | | - this.setup = setup; |
| 36 | +// this.setup = setup; |
32 | 37 | this.init = init; |
33 | 38 | |
34 | 39 | }; |