r81044 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81043‎ | r81044 | r81045 >
Date:18:38, 26 January 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
fixes and improvements
* formlink, forminput parse wikitest in params
* Special:RunQuery includes HeadItems the intended way now (addParserOutputNoText)
* formlink popup now reacts on the link itself, not on the original target of an event (e.g. an image used as link text)
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php (modified) (history)
  • /trunk/extensions/SemanticForms/libs/SF_popupform.js (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_RunQuery.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php
@@ -130,16 +130,8 @@
131131 if ( $embedded ) {
132132 $wgParser->getOutput()->addHeadItem( $script );
133133 } else {
134 - // method was added in MW 1.16
135 - if ( method_exists( $wgParser->getOutput(), 'getHeadItems' ) ) {
136 - $wgOut->addScript( $script . implode($wgParser->getOutput()->getHeadItems() ) );
137 - } else {
138 - $wgOut->addScript( $script . implode($wgParser->getOutput()->mHeadItems ) );
139 - }
140 - // include modules registered with the ResourceLoader
141 - if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
142 - $wgOut->addModules( $wgParser->getOutput()->getModules() );
143 - }
 134+ $wgOut->addScript( $script );
 135+ $wgOut->addParserOutputNoText( $wgParser->getOutput() );
144136 }
145137 }
146138 }
Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
@@ -149,7 +149,7 @@
150150 $value = trim( $param );
151151 if ( count( $elements ) > 1 ) {
152152 $param_name = trim( $elements[0] );
153 - $value = trim( $elements[1] );
 153+ $value = trim( $parser->recursiveTagParse( $elements[1] ) );
154154 }
155155 if ( $param_name == 'form' )
156156 $inFormName = $value;
@@ -238,7 +238,7 @@
239239 $value = trim( $param );
240240 if ( count( $elements ) > 1 ) {
241241 $param_name = trim( $elements[0] );
242 - $value = trim( $elements[1] );
 242+ $value = trim( $parser->recursiveTagParse( $elements[1] ) );
243243 }
244244 if ( $param_name == 'form' )
245245 $inFormName = $value;
@@ -522,13 +522,15 @@
523523 // load extensions JavaScript
524524 $parser->getOutput()->addHeadItem(
525525 '<script type="text/javascript" src="' . $sfgScriptPath
526 - . '/libs/SF_popupform.js"></script> ' . "\n"
 526+ . '/libs/SF_popupform.js"></script> ' . "\n",
 527+ 'sf_poup_script'
527528 );
528529
529530 // load extensions style sheet
530531 $parser->getOutput()->addHeadItem(
531532 '<link rel="stylesheet" href="' . $sfgScriptPath
532 - . '/skins/SF_popupform.css"/> ' . "\n"
 533+ . '/skins/SF_popupform.css"/> ' . "\n",
 534+ 'sf_poup_style'
533535 );
534536
535537 $loaded = true;
Index: trunk/extensions/SemanticForms/libs/SF_popupform.js
@@ -12,7 +12,7 @@
1313
1414 // register formlink with link
1515 jQuery('a.popupformlink').click(function(evt){
16 - return ext.popupform.handlePopupFormLink( evt.target.getAttribute('href'), this );
 16+ return ext.popupform.handlePopupFormLink( this.getAttribute('href'), this );
1717 });
1818
1919 // register formlink with button