http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89944
Revision: 89944
Author: yaron
Date: 2011-06-13 02:43:52 +0000 (Mon, 13 Jun 2011)
Log Message:
-----------
Added 'collapsible fieldset' functionality, for use in Special:CreateForm
Modified Paths:
--------------
trunk/extensions/SemanticForms/SemanticForms.php
trunk/extensions/SemanticForms/includes/SF_FormField.php
trunk/extensions/SemanticForms/specials/SF_CreateForm.php
Modified: trunk/extensions/SemanticForms/SemanticForms.php
===================================================================
--- trunk/extensions/SemanticForms/SemanticForms.php 2011-06-13 02:38:46 UTC
(rev 89943)
+++ trunk/extensions/SemanticForms/SemanticForms.php 2011-06-13 02:43:52 UTC
(rev 89944)
@@ -210,6 +210,11 @@
'styles' => 'skins/SF_submit.css',
'dependencies' => array( 'jquery' ),
),
+ 'ext.semanticforms.collapsible' => $sfgResourceTemplate + array(
+ 'scripts' => 'libs/SF_collapsible.js',
+ 'styles' => 'skins/SF_collapsible.css',
+ 'dependencies' => array( 'jquery' ),
+ ),
);
}
Modified: trunk/extensions/SemanticForms/includes/SF_FormField.php
===================================================================
--- trunk/extensions/SemanticForms/includes/SF_FormField.php 2011-06-13
02:38:46 UTC (rev 89943)
+++ trunk/extensions/SemanticForms/includes/SF_FormField.php 2011-06-13
02:43:52 UTC (rev 89944)
@@ -196,7 +196,7 @@
}
}
- $text .= "<fieldset><legend>Other parameters</legend>\n";
+ $text .= "<fieldset
class=\"sfCollapsibleFieldset\"><legend>Other parameters</legend>\n";
$text .= Xml::tags( 'div', array( 'class' => 'otherInputParams'
),
SFCreateForm::showInputTypeOptions( $cur_input_type,
$field_form_text, $paramValues ) ) . "\n";
$text .= "</fieldset>\n";
Modified: trunk/extensions/SemanticForms/specials/SF_CreateForm.php
===================================================================
--- trunk/extensions/SemanticForms/specials/SF_CreateForm.php 2011-06-13
02:38:46 UTC (rev 89943)
+++ trunk/extensions/SemanticForms/specials/SF_CreateForm.php 2011-06-13
02:43:52 UTC (rev 89944)
@@ -62,6 +62,13 @@
$url .= '¶ms[' . Xml::escapeJsString( $param ) . ']=' .
Xml::escapeJsString( $value );
}
+ // Only add 'collapsible' ability if the ResourceLoader exists, i.e.
+ // for MW 1.17 - adding backwards compatibility doesn't seem worth
+ // it for this relatively minor piece of functionality.
+ if ( method_exists( $wgOut, 'addModules' ) ) {
+ $wgOut->addModules( 'ext.semanticforms.collapsible' );
+ }
+
$wgOut->addScript("<script>
jQuery.fn.displayInputParams = function() {
inputParamsDiv = this.closest('.formField').find('.otherInputParams');
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs