jenkins-bot has submitted this change and it was merged.

Change subject: Move GadgetResourceLoaderModule class to separate file
......................................................................


Move GadgetResourceLoaderModule class to separate file

Change-Id: Ic7dde135168a04fc5916e5f44acd6b8639c8ce1a
---
M Gadgets_body.php
M extension.json
A includes/GadgetResourceLoaderModule.php
3 files changed, 56 insertions(+), 54 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Gadgets_body.php b/Gadgets_body.php
index ebead09..ed861e4 100755
--- a/Gadgets_body.php
+++ b/Gadgets_body.php
@@ -249,56 +249,3 @@
        }
 }
 
-/**
- * Class representing a list of resources for one gadget
- */
-class GadgetResourceLoaderModule extends ResourceLoaderWikiModule {
-       private $pages, $dependencies;
-
-       /**
-        * Creates an instance of this class
-        *
-        * @param $pages Array: Associative array of pages in 
ResourceLoaderWikiModule-compatible
-        * format, for example:
-        * array(
-        *        'MediaWiki:Gadget-foo.js'  => array( 'type' => 'script' ),
-        *        'MediaWiki:Gadget-foo.css' => array( 'type' => 'style' ),
-        * )
-        * @param $dependencies Array: Names of resources this module depends on
-        * @param $targets Array: List of targets this module support
-        * @param $position String: 'bottom' or 'top'
-        */
-       public function __construct( $pages, $dependencies, $targets, $position 
) {
-               $this->pages = $pages;
-               $this->dependencies = $dependencies;
-               $this->targets = $targets;
-               $this->position = $position;
-               $this->isPositionDefined = true;
-       }
-
-       /**
-        * Overrides the abstract function from ResourceLoaderWikiModule class
-        * @param $context ResourceLoaderContext
-        * @return Array: $pages passed to __construct()
-        */
-       protected function getPages( ResourceLoaderContext $context ) {
-               return $this->pages;
-       }
-
-       /**
-        * Overrides ResourceLoaderModule::getDependencies()
-        * @param $context ResourceLoaderContext
-        * @return Array: Names of resources this module depends on
-        */
-       public function getDependencies( ResourceLoaderContext $context = null 
) {
-               return $this->dependencies;
-       }
-
-       /**
-        * Overrides ResourceLoaderModule::getPosition()
-        * @return String: 'bottom' or 'top'
-        */
-       public function getPosition() {
-               return $this->position;
-       }
-}
diff --git a/extension.json b/extension.json
index ca1258f..50978a2 100755
--- a/extension.json
+++ b/extension.json
@@ -28,7 +28,7 @@
                "ApiQueryGadgets": "api/ApiQueryGadgets.php",
                "Gadget": "Gadgets_body.php",
                "GadgetHooks": "GadgetHooks.php",
-               "GadgetResourceLoaderModule": "Gadgets_body.php",
+               "GadgetResourceLoaderModule": 
"includes/GadgetResourceLoaderModule.php",
                "SpecialGadgets": "SpecialGadgets.php",
                "GadgetRepo": "includes/GadgetRepo.php",
                "MediaWikiGadgetsDefinitionRepo": 
"includes/MediaWikiGadgetsDefinitionRepo.php"
diff --git a/includes/GadgetResourceLoaderModule.php 
b/includes/GadgetResourceLoaderModule.php
new file mode 100644
index 0000000..471e642
--- /dev/null
+++ b/includes/GadgetResourceLoaderModule.php
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * Class representing a list of resources for one gadget
+ */
+class GadgetResourceLoaderModule extends ResourceLoaderWikiModule {
+       private $pages, $dependencies;
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param $pages Array: Associative array of pages in 
ResourceLoaderWikiModule-compatible
+        * format, for example:
+        * array(
+        *        'MediaWiki:Gadget-foo.js'  => array( 'type' => 'script' ),
+        *        'MediaWiki:Gadget-foo.css' => array( 'type' => 'style' ),
+        * )
+        * @param $dependencies Array: Names of resources this module depends on
+        * @param $targets Array: List of targets this module support
+        * @param $position String: 'bottom' or 'top'
+        */
+       public function __construct( $pages, $dependencies, $targets, $position 
) {
+               $this->pages = $pages;
+               $this->dependencies = $dependencies;
+               $this->targets = $targets;
+               $this->position = $position;
+               $this->isPositionDefined = true;
+       }
+
+       /**
+        * Overrides the abstract function from ResourceLoaderWikiModule class
+        * @param $context ResourceLoaderContext
+        * @return Array: $pages passed to __construct()
+        */
+       protected function getPages( ResourceLoaderContext $context ) {
+               return $this->pages;
+       }
+
+       /**
+        * Overrides ResourceLoaderModule::getDependencies()
+        * @param $context ResourceLoaderContext
+        * @return Array: Names of resources this module depends on
+        */
+       public function getDependencies( ResourceLoaderContext $context = null 
) {
+               return $this->dependencies;
+       }
+
+       /**
+        * Overrides ResourceLoaderModule::getPosition()
+        * @return String: 'bottom' or 'top'
+        */
+       public function getPosition() {
+               return $this->position;
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/228442
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7dde135168a04fc5916e5f44acd6b8639c8ce1a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Gadgets
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to