mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-11 16:49:43 +00:00
Gadgets should default to mobile and desktop targets
The targets system is being deprecated. Bug: T127268 Bug: T340046 Change-Id: I69d11d52238ac852534cb9a4555208a0b0bb5fd7
This commit is contained in:
parent
8fe6e40cd4
commit
58463ce97c
|
@ -67,7 +67,7 @@ class GadgetDefinitionContentHandler extends JsonContentHandler {
|
|||
'requiresES6' => false,
|
||||
'hidden' => false,
|
||||
'skins' => [],
|
||||
'targets' => [ 'desktop' ],
|
||||
'targets' => [ 'desktop', 'mobile' ],
|
||||
'actions' => [],
|
||||
'category' => '',
|
||||
'supportsUrlLoad' => false,
|
||||
|
|
|
@ -59,7 +59,7 @@ class Gadget {
|
|||
/** @var string[] */
|
||||
private $requiredSkins = [];
|
||||
/** @var string[] */
|
||||
private $targets = [ 'desktop' ];
|
||||
private $targets = [ 'desktop', 'mobile' ];
|
||||
/** @var bool */
|
||||
private $onByDefault = false;
|
||||
/** @var bool */
|
||||
|
|
|
@ -143,7 +143,7 @@ class GadgetTest extends MediaWikiUnitTestCase {
|
|||
public function testTargets() {
|
||||
$g = GadgetTestUtils::makeGadget( '*foo[ResourceLoader]|foo.js' );
|
||||
$g2 = GadgetTestUtils::makeGadget( '*bar[ResourceLoader|targets=desktop,mobile]|bar.js' );
|
||||
$this->assertEquals( [ 'desktop' ], $g->getTargets() );
|
||||
$this->assertEquals( [ 'desktop', 'mobile' ], $g->getTargets() );
|
||||
$this->assertEquals( [ 'desktop', 'mobile' ], $g2->getTargets() );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue