mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-13 17:53:22 +00:00
Remove redundant 'position', 'top', and getPosition() code
Unused as of bc374082fa in MediaWiki core (T109837). Change-Id: Idcec3c4fa2bc3bc05ac417062139794880040a6d
This commit is contained in:
parent
906aaeeb82
commit
846b979578
|
@ -35,7 +35,6 @@ class Gadget {
|
|||
$targets = array( 'desktop' ),
|
||||
$onByDefault = false,
|
||||
$hidden = false,
|
||||
$position = 'bottom',
|
||||
$type = '',
|
||||
$category;
|
||||
|
||||
|
@ -53,7 +52,6 @@ class Gadget {
|
|||
case 'requiredSkins':
|
||||
case 'targets':
|
||||
case 'onByDefault':
|
||||
case 'position':
|
||||
case 'type':
|
||||
case 'hidden':
|
||||
case 'category':
|
||||
|
@ -89,7 +87,6 @@ class Gadget {
|
|||
'styles' => array_map( $prefixGadgetNs, $data['module']['styles'] ),
|
||||
'dependencies' => $data['module']['dependencies'],
|
||||
'messages' => $data['module']['messages'],
|
||||
'position' => $data['module']['position'],
|
||||
'type' => $data['module']['type'],
|
||||
);
|
||||
|
||||
|
@ -282,14 +279,6 @@ class Gadget {
|
|||
return $this->requiredSkins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the position of this Gadget's ResourceLoader module
|
||||
* @return String: 'bottom' or 'top'
|
||||
*/
|
||||
public function getPosition() {
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the load type of this Gadget's ResourceLoader module
|
||||
* @return string 'styles', 'general' or ''
|
||||
|
|
|
@ -71,14 +71,6 @@ class GadgetResourceLoaderModule extends ResourceLoaderWikiModule {
|
|||
return $this->getGadget()->getDependencies();
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides ResourceLoaderModule::getPosition()
|
||||
* @return String: 'bottom' or 'top'
|
||||
*/
|
||||
public function getPosition() {
|
||||
return $this->getGadget()->getPosition();
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides ResourceLoaderWikiModule::getType()
|
||||
* @return string ResourceLoaderModule::LOAD_STYLES or ResourceLoaderModule::LOAD_GENERAL
|
||||
|
|
|
@ -211,9 +211,6 @@ class MediaWikiGadgetsDefinitionRepo extends GadgetRepo {
|
|||
case 'targets':
|
||||
$info['targets'] = $params;
|
||||
break;
|
||||
case 'top':
|
||||
$info['position'] = 'top';
|
||||
break;
|
||||
case 'type':
|
||||
// Single value, not a list
|
||||
$info['type'] = isset( $params[0] ) ? $params[0] : '';
|
||||
|
|
|
@ -56,7 +56,6 @@ class GadgetDefinitionContentHandler extends JsonContentHandler {
|
|||
'styles' => array(),
|
||||
'dependencies' => array(),
|
||||
'messages' => array(),
|
||||
'position' => 'bottom',
|
||||
'type' => '',
|
||||
),
|
||||
);
|
||||
|
|
|
@ -22,7 +22,6 @@ class GadgetDefinitionValidator {
|
|||
'module.styles' => array( 'is_array', 'array', 'is_string', 'string' ),
|
||||
'module.dependencies' => array( 'is_array', 'array', 'is_string', 'string' ),
|
||||
'module.messages' => array( 'is_array', 'array', 'is_string', 'string' ),
|
||||
'module.position' => array( 'is_string', 'string' ),
|
||||
'module.type' => array( 'is_string', 'string' ),
|
||||
);
|
||||
|
||||
|
|
|
@ -58,15 +58,6 @@
|
|||
"messages": {
|
||||
"type": "array",
|
||||
"description": "Messages this gadget depends upon"
|
||||
},
|
||||
"position": {
|
||||
"type": "string",
|
||||
"description": "Whether this module should be loaded asynchronously after the page loads (bottom) or synchronously before the page is rendered (top)",
|
||||
"enum": [
|
||||
"top",
|
||||
"bottom"
|
||||
],
|
||||
"default": "bottom"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,14 +56,6 @@ class GadgetsTest extends MediaWikiTestCase {
|
|||
$this->assertEquals( array( 'jquery.ui' ), $g->getDependencies() );
|
||||
}
|
||||
|
||||
public function testPosition() {
|
||||
$g = $this->create( '* foo[ResourceLoader]|bar.js' );
|
||||
$this->assertEquals( 'bottom', $g->getPosition(), 'Default position' );
|
||||
|
||||
$g = $this->create( '* foo[ResourceLoader|top]|bar.js' );
|
||||
$this->assertEquals( 'top', $g->getPosition(), 'Position top' );
|
||||
}
|
||||
|
||||
public static function provideGetType() {
|
||||
return array(
|
||||
array(
|
||||
|
|
Loading…
Reference in a new issue