Index: trunk/extensions/SemanticForms/SemanticForms.php |
— | — | @@ -231,7 +231,7 @@ |
232 | 232 | ), |
233 | 233 | 'ext.semanticforms.wikieditor' => $sfgResourceTemplate + array( |
234 | 234 | 'scripts' => 'libs/SF_wikieditor.js', |
235 | | -// 'styles' => 'skins/SF_wikieditor.css', // no styles necessary? |
| 235 | + 'styles' => 'skins/SF_wikieditor.css', |
236 | 236 | 'dependencies' => array('jquery.wikiEditor'), |
237 | 237 | ), |
238 | 238 | ); |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextAreaWithAutocompleteInput.php |
— | — | @@ -29,6 +29,9 @@ |
30 | 30 | } |
31 | 31 | |
32 | 32 | public static function getHTML( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) { |
| 33 | + |
| 34 | + global $wgOut; |
| 35 | + |
33 | 36 | // If 'no autocomplete' was specified, print a regular |
34 | 37 | // textarea instead. |
35 | 38 | if ( array_key_exists( 'no autocomplete', $other_args ) && |
— | — | @@ -41,11 +44,29 @@ |
42 | 45 | |
43 | 46 | list( $autocompleteSettings, $remoteDataType, $delimiter ) = SFTextWithAutocompleteInput::setAutocompleteValues( $other_args ); |
44 | 47 | |
45 | | - $className = ( $is_mandatory ) ? 'autocompleteInput mandatoryField' : 'autocompleteInput createboxInput'; |
| 48 | + $input_id = 'input_' . $sfgFieldNum; |
| 49 | + |
| 50 | + if ( array_key_exists( 'wikieditor', $other_args ) && |
| 51 | + in_array( 'jquery.wikiEditor', $wgOut->getResourceLoader()->getModuleNames() ) ) { |
| 52 | + |
| 53 | + $wgOut->addModules( 'ext.semanticforms.wikieditor' ); |
| 54 | + |
| 55 | + $jstext = <<<JAVASCRIPT |
| 56 | +jQuery(function(){ jQuery('#$input_id').SemanticForms_registerInputInit( ext.wikieditor.init, null ); }); |
| 57 | +JAVASCRIPT; |
| 58 | + |
| 59 | + // write JS code directly to the page's code |
| 60 | + $wgOut->addScript( '<script type="text/javascript">' . $jstext . '</script>' ); |
| 61 | + |
| 62 | + $className = "wikieditor "; |
| 63 | + } else { |
| 64 | + $className = ""; |
| 65 | + } |
| 66 | + |
| 67 | + $className .= ( $is_mandatory ) ? 'autocompleteInput mandatoryField' : 'autocompleteInput createboxInput'; |
46 | 68 | if ( array_key_exists( 'class', $other_args ) ) { |
47 | 69 | $className .= ' ' . $other_args['class']; |
48 | 70 | } |
49 | | - $input_id = 'input_' . $sfgFieldNum; |
50 | 71 | |
51 | 72 | if ( array_key_exists( 'rows', $other_args ) ) { |
52 | 73 | $rows = $other_args['rows']; |
— | — | @@ -117,20 +138,6 @@ |
118 | 139 | } |
119 | 140 | $text = "\n" . Xml::tags( 'span', array( 'class' => $spanClass ), $text ); |
120 | 141 | |
121 | | - |
122 | | - if ( array_key_exists( 'wikieditor', $other_args ) && |
123 | | - array_search( 'jquery.wikiEditor', $wgOut->getResourceLoader()->getModuleNames() ) !== FALSE ) { |
124 | | - |
125 | | - $wgOut->addModules( 'ext.semanticforms.wikieditor' ); |
126 | | - |
127 | | - $jstext = <<<JAVASCRIPT |
128 | | -jQuery(function(){ jQuery('#input_$sfgFieldNum').SemanticForms_registerInputInit( ext.wikieditor.init, null ); }); |
129 | | -JAVASCRIPT; |
130 | | - |
131 | | - // write JS code directly to the page's code |
132 | | - $wgOut->addScript( '<script type="text/javascript">' . $jstext . '</script>' ); |
133 | | - } |
134 | | - |
135 | 142 | return $text; |
136 | 143 | } |
137 | 144 | |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextAreaInput.php |
— | — | @@ -29,15 +29,34 @@ |
30 | 30 | } |
31 | 31 | |
32 | 32 | public static function getHTML( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) { |
| 33 | + |
33 | 34 | global $wgOut; |
34 | 35 | global $sfgTabIndex, $sfgFieldNum; |
35 | 36 | |
36 | | - $className = ( $is_mandatory ) ? 'mandatoryField' : 'createboxInput'; |
| 37 | + // Use a special ID for the free text field, for FCK's needs. |
| 38 | + $input_id = $input_name == 'free_text' ? 'free_text' : "input_$sfgFieldNum"; |
| 39 | + |
| 40 | + if ( array_key_exists( 'wikieditor', $other_args ) && |
| 41 | + in_array( 'jquery.wikiEditor', $wgOut->getResourceLoader()->getModuleNames() ) ) { |
| 42 | + |
| 43 | + $wgOut->addModules( 'ext.semanticforms.wikieditor' ); |
| 44 | + |
| 45 | + $jstext = <<<JAVASCRIPT |
| 46 | +jQuery(function(){ jQuery('#$input_id').SemanticForms_registerInputInit( ext.wikieditor.init, null ); }); |
| 47 | +JAVASCRIPT; |
| 48 | + |
| 49 | + // write JS code directly to the page's code |
| 50 | + $wgOut->addScript( '<script type="text/javascript">' . $jstext . '</script>' ); |
| 51 | + |
| 52 | + $className = "wikieditor "; |
| 53 | + } else { |
| 54 | + $className = ""; |
| 55 | + } |
| 56 | + |
| 57 | + $className .= ( $is_mandatory ) ? 'mandatoryField' : 'createboxInput'; |
37 | 58 | if ( array_key_exists( 'class', $other_args ) ) { |
38 | 59 | $className .= " " . $other_args['class']; |
39 | 60 | } |
40 | | - // Use a special ID for the free text field, for FCK's needs. |
41 | | - $input_id = $input_name == 'free_text' ? 'free_text' : "input_$sfgFieldNum"; |
42 | 61 | |
43 | 62 | if ( array_key_exists( 'rows', $other_args ) ) { |
44 | 63 | $rows = $other_args['rows']; |
— | — | @@ -101,19 +120,6 @@ |
102 | 121 | } |
103 | 122 | $text = Xml::tags( 'span', array( 'class' => $spanClass ), $text ); |
104 | 123 | |
105 | | - if ( array_key_exists( 'wikieditor', $other_args ) && |
106 | | - array_search( 'jquery.wikiEditor', $wgOut->getResourceLoader()->getModuleNames() ) !== FALSE ) { |
107 | | - |
108 | | - $wgOut->addModules( 'ext.semanticforms.wikieditor' ); |
109 | | - |
110 | | - $jstext = <<<JAVASCRIPT |
111 | | -jQuery(function(){ jQuery('#input_$sfgFieldNum').SemanticForms_registerInputInit( ext.wikieditor.init, null ); }); |
112 | | -JAVASCRIPT; |
113 | | - |
114 | | - // write JS code directly to the page's code |
115 | | - $wgOut->addScript( '<script type="text/javascript">' . $jstext . '</script>' ); |
116 | | - } |
117 | | - |
118 | 124 | return $text; |
119 | 125 | } |
120 | 126 | |
Index: trunk/extensions/SemanticForms/skins/SemanticForms.css |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | |
6 | 6 | /* Override "width: 100%" setting in standard MediaWiki skins */ |
7 | 7 | textarea.createboxInput { |
8 | | - width: auto; |
| 8 | +/* width: auto;*/ |
9 | 9 | } |
10 | 10 | textarea.mandatoryField { |
11 | 11 | width: auto; |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | .autoGrow { |
136 | 136 | overflow: hidden; |
137 | 137 | height: auto; |
138 | | - width: 326px; |
| 138 | +/* width: 326px;*/ |
139 | 139 | } |
140 | 140 | |
141 | 141 | /* Override some jQuery UI settings */ |