Index: trunk/extensions/SemanticForms/SemanticForms.php |
— | — | @@ -210,6 +210,11 @@ |
211 | 211 | 'styles' => 'skins/SF_submit.css', |
212 | 212 | 'dependencies' => array( 'jquery' ), |
213 | 213 | ), |
| 214 | + 'ext.semanticforms.collapsible' => $sfgResourceTemplate + array( |
| 215 | + 'scripts' => 'libs/SF_collapsible.js', |
| 216 | + 'styles' => 'skins/SF_collapsible.css', |
| 217 | + 'dependencies' => array( 'jquery' ), |
| 218 | + ), |
214 | 219 | ); |
215 | 220 | } |
216 | 221 | |
Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php |
— | — | @@ -62,6 +62,13 @@ |
63 | 63 | $url .= '¶ms[' . Xml::escapeJsString( $param ) . ']=' . Xml::escapeJsString( $value ); |
64 | 64 | } |
65 | 65 | |
| 66 | + // Only add 'collapsible' ability if the ResourceLoader exists, i.e. |
| 67 | + // for MW 1.17 - adding backwards compatibility doesn't seem worth |
| 68 | + // it for this relatively minor piece of functionality. |
| 69 | + if ( method_exists( $wgOut, 'addModules' ) ) { |
| 70 | + $wgOut->addModules( 'ext.semanticforms.collapsible' ); |
| 71 | + } |
| 72 | + |
66 | 73 | $wgOut->addScript("<script> |
67 | 74 | jQuery.fn.displayInputParams = function() { |
68 | 75 | inputParamsDiv = this.closest('.formField').find('.otherInputParams'); |
Index: trunk/extensions/SemanticForms/includes/SF_FormField.php |
— | — | @@ -196,7 +196,7 @@ |
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | | - $text .= "<fieldset><legend>Other parameters</legend>\n"; |
| 200 | + $text .= "<fieldset class=\"sfCollapsibleFieldset\"><legend>Other parameters</legend>\n"; |
201 | 201 | $text .= Xml::tags( 'div', array( 'class' => 'otherInputParams' ), |
202 | 202 | SFCreateForm::showInputTypeOptions( $cur_input_type, $field_form_text, $paramValues ) ) . "\n"; |
203 | 203 | $text .= "</fieldset>\n"; |