Reedy has submitted this change and it was merged.
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, 11 insertions(+), 8 deletions(-)
Approvals:
Reedy: Verified; Looks good to me, approved
diff --git a/SecurePoll.php b/SecurePoll.php
index 2e2e486..70d4d9a 100644
--- a/SecurePoll.php
+++ b/SecurePoll.php
@@ -144,3 +144,11 @@
}
return true;
}
+
+$wgResourceModules['ext.securePoll'] = array(
+ 'localBasePath' => __DIR__ . '/resources',
+ 'remoteExtPath' => 'SecurePoll/resources',
+ 'scripts' => 'ext.securePoll.js',
+ 'styles' => 'ext.securePoll.css',
+ 'position' => 'top',
+);
diff --git a/includes/main/Base.php b/includes/main/Base.php
index 56c99a6..a5c0d86 100644
--- a/includes/main/Base.php
+++ b/includes/main/Base.php
@@ -1,7 +1,7 @@
<?php
/**
- * The page that's initially called by MediaWiki when navigating to
+ * The page that's initially called by MediaWiki when navigating to
* Special:SecurePoll. The actual pages are not actually subclasses of
* this or of SpecialPage, they're subclassed from SecurePoll_Page.
*/
@@ -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: merged
Gerrit-Change-Id: I1631f6124d6b5da56418766442f7a4797bdaf91e
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits