Remove redundant 'position', 'top', and getPosition() code

Unused as of bc374082fa in MediaWiki core (T109837).

Change-Id: Idcec3c4fa2bc3bc05ac417062139794880040a6d
This commit is contained in:
Timo Tijhof 2016-11-18 13:55:30 -08:00
parent 906aaeeb82
commit 846b979578
7 changed files with 0 additions and 41 deletions

View file

@ -35,7 +35,6 @@ class Gadget {
$targets = array( 'desktop' ), $targets = array( 'desktop' ),
$onByDefault = false, $onByDefault = false,
$hidden = false, $hidden = false,
$position = 'bottom',
$type = '', $type = '',
$category; $category;
@ -53,7 +52,6 @@ class Gadget {
case 'requiredSkins': case 'requiredSkins':
case 'targets': case 'targets':
case 'onByDefault': case 'onByDefault':
case 'position':
case 'type': case 'type':
case 'hidden': case 'hidden':
case 'category': case 'category':
@ -89,7 +87,6 @@ class Gadget {
'styles' => array_map( $prefixGadgetNs, $data['module']['styles'] ), 'styles' => array_map( $prefixGadgetNs, $data['module']['styles'] ),
'dependencies' => $data['module']['dependencies'], 'dependencies' => $data['module']['dependencies'],
'messages' => $data['module']['messages'], 'messages' => $data['module']['messages'],
'position' => $data['module']['position'],
'type' => $data['module']['type'], 'type' => $data['module']['type'],
); );
@ -282,14 +279,6 @@ class Gadget {
return $this->requiredSkins; 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 * Returns the load type of this Gadget's ResourceLoader module
* @return string 'styles', 'general' or '' * @return string 'styles', 'general' or ''

View file

@ -71,14 +71,6 @@ class GadgetResourceLoaderModule extends ResourceLoaderWikiModule {
return $this->getGadget()->getDependencies(); return $this->getGadget()->getDependencies();
} }
/**
* Overrides ResourceLoaderModule::getPosition()
* @return String: 'bottom' or 'top'
*/
public function getPosition() {
return $this->getGadget()->getPosition();
}
/** /**
* Overrides ResourceLoaderWikiModule::getType() * Overrides ResourceLoaderWikiModule::getType()
* @return string ResourceLoaderModule::LOAD_STYLES or ResourceLoaderModule::LOAD_GENERAL * @return string ResourceLoaderModule::LOAD_STYLES or ResourceLoaderModule::LOAD_GENERAL

View file

@ -211,9 +211,6 @@ class MediaWikiGadgetsDefinitionRepo extends GadgetRepo {
case 'targets': case 'targets':
$info['targets'] = $params; $info['targets'] = $params;
break; break;
case 'top':
$info['position'] = 'top';
break;
case 'type': case 'type':
// Single value, not a list // Single value, not a list
$info['type'] = isset( $params[0] ) ? $params[0] : ''; $info['type'] = isset( $params[0] ) ? $params[0] : '';

View file

@ -56,7 +56,6 @@ class GadgetDefinitionContentHandler extends JsonContentHandler {
'styles' => array(), 'styles' => array(),
'dependencies' => array(), 'dependencies' => array(),
'messages' => array(), 'messages' => array(),
'position' => 'bottom',
'type' => '', 'type' => '',
), ),
); );

View file

@ -22,7 +22,6 @@ class GadgetDefinitionValidator {
'module.styles' => array( 'is_array', 'array', 'is_string', 'string' ), 'module.styles' => array( 'is_array', 'array', 'is_string', 'string' ),
'module.dependencies' => 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.messages' => array( 'is_array', 'array', 'is_string', 'string' ),
'module.position' => array( 'is_string', 'string' ),
'module.type' => array( 'is_string', 'string' ), 'module.type' => array( 'is_string', 'string' ),
); );

View file

@ -58,15 +58,6 @@
"messages": { "messages": {
"type": "array", "type": "array",
"description": "Messages this gadget depends upon" "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"
} }
} }
} }

View file

@ -56,14 +56,6 @@ class GadgetsTest extends MediaWikiTestCase {
$this->assertEquals( array( 'jquery.ui' ), $g->getDependencies() ); $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() { public static function provideGetType() {
return array( return array(
array( array(