Index: trunk/extensions/SemanticForms/SemanticForms.php |
— | — | @@ -234,7 +234,12 @@ |
235 | 235 | 'ext.semanticforms.wikieditor' => $sfgResourceTemplate + array( |
236 | 236 | 'scripts' => 'libs/SF_wikieditor.js', |
237 | 237 | 'styles' => 'skins/SF_wikieditor.css', |
238 | | - 'dependencies' => array('jquery.wikiEditor'), |
| 238 | + 'dependencies' => array( |
| 239 | + 'jquery.wikiEditor', |
| 240 | + 'jquery.wikiEditor.toolbar', |
| 241 | + 'jquery.wikiEditor.toolbar.config', |
| 242 | + |
| 243 | + ), |
239 | 244 | ), |
240 | 245 | ); |
241 | 246 | } |
Index: trunk/extensions/SemanticForms/libs/SF_wikieditor.js |
— | — | @@ -5,26 +5,38 @@ |
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 | this.init = 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 | 26 | jQuery( document ).ready( function() { |
27 | 27 | if ( jQuery.wikiEditor.isSupported( jQuery.wikiEditor.modules.toolbar ) ) { |
28 | | - jQuery( '#' + input_id ).wikiEditor( 'addModule', jQuery.wikiEditor.modules.toolbar.config.getDefaultConfig() ); |
| 28 | + |
| 29 | + if (jQuery.wikiEditor.modules.toolbar.config !== undefined ) { |
| 30 | + jQuery( '#' + input_id ).wikiEditor( 'addModule', jQuery.wikiEditor.modules.toolbar.config.getDefaultConfig() ); |
| 31 | + } else { |
| 32 | + |
| 33 | + // TODO: this is nasty. Take it out if at all possible. |
| 34 | + var timeout = setTimeout(function () { |
| 35 | + if (jQuery.wikiEditor.modules.toolbar.config !== undefined ) { |
| 36 | + jQuery( '#' + input_id ).wikiEditor( 'addModule', jQuery.wikiEditor.modules.toolbar.config.getDefaultConfig() ); |
| 37 | + clearTimeout(timeout); |
| 38 | + } |
| 39 | + }, 1000); |
| 40 | + } |
29 | 41 | } |
30 | 42 | }); |
31 | 43 | } |