Reedy has uploaded a new change for review.
https://gerrit.wikimedia.org/r/66121
Change subject: ResourceLoader-ify SecurePoll
......................................................................
ResourceLoader-ify SecurePoll
Bug: 48976
Change-Id: I1631f6124d6b5da56418766442f7a4797bdaf91e
---
M SecurePoll.php
M includes/main/Base.php
R resources/ext.securepoll.css
R resources/ext.securepoll.js
4 files changed, 16 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll
refs/changes/21/66121/1
diff --git a/SecurePoll.php b/SecurePoll.php
index 2e2e486..fdc8558 100644
--- a/SecurePoll.php
+++ b/SecurePoll.php
@@ -144,3 +144,17 @@
}
return true;
}
+
+$commonModuleInfo = array(
+ 'localBasePath' => dirname( __FILE__ ) . '/resources',
+ 'remoteExtPath' => 'SecurePoll/resources',
+);
+
+// Styles and any code common to all Special:Code subviews:
+$wgResourceModules['ext.securepoll'] = array(
+ 'scripts' => 'ext.securepoll.js',
+ 'styles' => 'ext.securepoll.css',
+ 'position' => 'top',
+) + $commonModuleInfo;
+
+unset( $commonModuleInfo );
diff --git a/includes/main/Base.php b/includes/main/Base.php
index 288c4d8..f928d6e 100644
--- a/includes/main/Base.php
+++ b/includes/main/Base.php
@@ -34,15 +34,10 @@
* @param $paramString Mixed: parameter passed to the page or null
*/
public function execute( $paramString ) {
- global $wgOut, $wgRequest, $wgScriptPath;
+ global $wgOut, $wgRequest;
$this->setHeaders();
- $wgOut->addLink( array(
- 'rel' => 'stylesheet',
- 'href' =>
"$wgScriptPath/extensions/SecurePoll/resources/SecurePoll.css",
- 'type' => 'text/css'
- ) );
- $wgOut->addScriptFile(
"$wgScriptPath/extensions/SecurePoll/resources/SecurePoll.js" );
+ $wgOut->addModules( 'ext.securepoll' );
$this->request = $wgRequest;
diff --git a/resources/SecurePoll.css b/resources/ext.securepoll.css
similarity index 100%
rename from resources/SecurePoll.css
rename to resources/ext.securepoll.css
diff --git a/resources/SecurePoll.js b/resources/ext.securepoll.js
similarity index 100%
rename from resources/SecurePoll.js
rename to resources/ext.securepoll.js
--
To view, visit https://gerrit.wikimedia.org/r/66121
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1631f6124d6b5da56418766442f7a4797bdaf91e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits