Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextAreaWithAutocompleteInput.php |
— | — | @@ -30,6 +30,8 @@ |
31 | 31 | |
32 | 32 | public static function getHTML( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) { |
33 | 33 | |
| 34 | + // TODO: Lots of duplication of code in the parent class. Needs refactoring! |
| 35 | + |
34 | 36 | global $wgOut; |
35 | 37 | |
36 | 38 | // If 'no autocomplete' was specified, print a regular |
— | — | @@ -49,10 +51,14 @@ |
50 | 52 | static $hasRun = false; |
51 | 53 | |
52 | 54 | if ( array_key_exists( 'wikieditor', $other_args ) && |
| 55 | + method_exists($wgOut, 'getResourceLoader') && |
53 | 56 | in_array( 'jquery.wikiEditor', $wgOut->getResourceLoader()->getModuleNames() ) ) { |
54 | 57 | |
55 | 58 | if ( !$hasRun ) { |
| 59 | + |
56 | 60 | $hasRun = true; |
| 61 | + |
| 62 | + // one time initialization |
57 | 63 | WikiEditorHooks::editPageShowEditFormInitial( $this ); |
58 | 64 | $wgOut->addModules( 'ext.semanticforms.wikieditor' ); |
59 | 65 | } |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextAreaInput.php |
— | — | @@ -39,10 +39,14 @@ |
40 | 40 | static $hasRun = false; |
41 | 41 | |
42 | 42 | if ( array_key_exists( 'wikieditor', $other_args ) && |
| 43 | + method_exists($wgOut, 'getResourceLoader') && |
43 | 44 | in_array( 'jquery.wikiEditor', $wgOut->getResourceLoader()->getModuleNames() ) ) { |
44 | 45 | |
45 | 46 | if ( !$hasRun ) { |
| 47 | + |
46 | 48 | $hasRun = true; |
| 49 | + |
| 50 | + // one time initialization |
47 | 51 | WikiEditorHooks::editPageShowEditFormInitial( $this ); |
48 | 52 | $wgOut->addModules( 'ext.semanticforms.wikieditor' ); |
49 | 53 | } |