Page MenuHomePhabricator

Update SecurePoll to use ResourceLoader
Closed, ResolvedPublic

Description

Originally:

		$wgOut->addLink( [
			'rel' => 'stylesheet',
			'href' => "$wgScriptPath/extensions/SecurePoll/resources/SecurePoll.css",
			'type' => 'text/css'
		] );
		$wgOut->addScriptFile( "$wgScriptPath/extensions/SecurePoll/resources/SecurePoll.js" );

The CSS has been moved to RL, the JS is harder though (see comments below)

Current state of affairs:

		$out->addModuleStyles( 'ext.securepoll.special' );
		$out->addScriptFile( "$wgExtensionAssetsPath/SecurePoll/resources/SecurePoll.js" );

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:43 AM
bzimport set Reference to bz48976.
bzimport added a subscriber: Unknown Object (MLST).

Related URL: https://gerrit.wikimedia.org/r/66121 (Gerrit Change I1631f6124d6b5da56418766442f7a4797bdaf91e)

Reverted, shizz broken

Be interesting to know what was broken. Thanks 2013 me

Change 554992 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/SecurePoll@master] Revert "Revert "ResourceLoader-ify SecurePoll""

https://gerrit.wikimedia.org/r/554992

Change 554992 abandoned by Reedy:
Revert "Revert "ResourceLoader-ify SecurePoll""

https://gerrit.wikimedia.org/r/554992

this formerly global function becomes a local function when loaded with RL because every file becomes closure scoped.
Presumably it is references from somewhere in a way that assumes it to be global, possibly outside this file. This kind of UI code generally is hard to port and requires more than just packaging.

Change 554992 restored by Reedy:
Revert "Revert "ResourceLoader-ify SecurePoll""

https://gerrit.wikimedia.org/r/554992

Change 554992 merged by jenkins-bot:
[mediawiki/extensions/SecurePoll@master] RL-ify Special page CSS

https://gerrit.wikimedia.org/r/554992

  NODES
Bugs 1
Note 3
Project 6