r89944 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89943‎ | r89944 | r89945 >
Date:02:43, 13 June 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added 'collapsible fieldset' functionality, for use in Special:CreateForm
Modified paths:
  • /trunk/extensions/SemanticForms/SemanticForms.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_FormField.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/SemanticForms.php
@@ -210,6 +210,11 @@
211211 'styles' => 'skins/SF_submit.css',
212212 'dependencies' => array( 'jquery' ),
213213 ),
 214+ 'ext.semanticforms.collapsible' => $sfgResourceTemplate + array(
 215+ 'scripts' => 'libs/SF_collapsible.js',
 216+ 'styles' => 'skins/SF_collapsible.css',
 217+ 'dependencies' => array( 'jquery' ),
 218+ ),
214219 );
215220 }
216221
Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php
@@ -62,6 +62,13 @@
6363 $url .= '&params[' . Xml::escapeJsString( $param ) . ']=' . Xml::escapeJsString( $value );
6464 }
6565
 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+
6673 $wgOut->addScript("<script>
6774 jQuery.fn.displayInputParams = function() {
6875 inputParamsDiv = this.closest('.formField').find('.otherInputParams');
Index: trunk/extensions/SemanticForms/includes/SF_FormField.php
@@ -196,7 +196,7 @@
197197 }
198198 }
199199
200 - $text .= "<fieldset><legend>Other parameters</legend>\n";
 200+ $text .= "<fieldset class=\"sfCollapsibleFieldset\"><legend>Other parameters</legend>\n";
201201 $text .= Xml::tags( 'div', array( 'class' => 'otherInputParams' ),
202202 SFCreateForm::showInputTypeOptions( $cur_input_type, $field_form_text, $paramValues ) ) . "\n";
203203 $text .= "</fieldset>\n";