r110324 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110323‎ | r110324 | r110325 >
Date:20:18, 30 January 2012
Author:foxtrott
Status:deferred
Tags:
Comment:
followup r110262: move left-behind function
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
@@ -527,45 +527,6 @@
528528 return $parser->insertStripItem( $output, $parser->mStripState );
529529 }
530530
531 - static function loadScriptsForPopupForm( &$parser ) {
532 - global $sfgScriptPath;
533 -
534 - if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
535 -
536 - // on MW 1.17+ just request the ResourceLoader to include modules
537 -
538 - $parser->getOutput()->addModules( 'ext.semanticforms.popupformedit' );
539 -
540 - } else {
541 -
542 - // on MW pre1.17 insert the necessary headers into the page head
543 - static $loaded = false;
544 -
545 - // load JavaScript and CSS files only once
546 - if ( !$loaded ) {
547 -
548 - // load extensions JavaScript
549 - $parser->getOutput()->addHeadItem(
550 - '<script type="text/javascript" src="' . $sfgScriptPath
551 - . '/libs/SF_popupform.js"></script> ' . "\n",
552 - 'sf_popup_script'
553 - );
554 -
555 - // load extensions style sheet
556 - $parser->getOutput()->addHeadItem(
557 - '<link rel="stylesheet" href="' . $sfgScriptPath
558 - . '/skins/SF_popupform.css"/> ' . "\n",
559 - 'sf_popup_style'
560 - );
561 -
562 - $loaded = true;
563 - }
564 -
565 - }
566 -
567 - return true;
568 - }
569 -
570531 /**
571532 * Load scripts and style files for AutoEdit
572533 */
Index: trunk/extensions/SemanticForms/includes/SF_Utils.php
@@ -1006,4 +1006,42 @@
10071007 return $str;
10081008 }
10091009
 1010+ static function loadScriptsForPopupForm( &$parser ) {
 1011+ global $sfgScriptPath;
 1012+
 1013+ if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
 1014+
 1015+ // on MW 1.17+ just request the ResourceLoader to include modules
 1016+
 1017+ $parser->getOutput()->addModules( 'ext.semanticforms.popupformedit' );
 1018+
 1019+ } else {
 1020+
 1021+ // on MW pre1.17 insert the necessary headers into the page head
 1022+ static $loaded = false;
 1023+
 1024+ // load JavaScript and CSS files only once
 1025+ if ( !$loaded ) {
 1026+
 1027+ // load extensions JavaScript
 1028+ $parser->getOutput()->addHeadItem(
 1029+ '<script type="text/javascript" src="' . $sfgScriptPath
 1030+ . '/libs/SF_popupform.js"></script> ' . "\n",
 1031+ 'sf_popup_script'
 1032+ );
 1033+
 1034+ // load extensions style sheet
 1035+ $parser->getOutput()->addHeadItem(
 1036+ '<link rel="stylesheet" href="' . $sfgScriptPath
 1037+ . '/skins/SF_popupform.css"/> ' . "\n",
 1038+ 'sf_popup_style'
 1039+ );
 1040+
 1041+ $loaded = true;
 1042+ }
 1043+
 1044+ }
 1045+
 1046+ return true;
 1047+ }
10101048 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110262- Open up SFAutoeditAPI to better access it from outside...foxtrott23:12, 29 January 2012