Merge "Convert Special:DeletedContributions to use OOUI."
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderFileModule.php
index 574e535..725bc6a 100644 (file)
@@ -117,9 +117,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /** @var string Name of group to load this module in */
        protected $group;
 
-       /** @var string Position on the page to load this module at */
-       protected $position = 'bottom';
-
        /** @var bool Link to raw files in debug mode */
        protected $debugRaw = true;
 
@@ -128,6 +125,9 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
 
        protected $targets = [ 'desktop' ];
 
+       /** @var bool Whether CSSJanus flipping should be skipped for this module */
+       protected $noflip = false;
+
        /**
         * @var bool Whether getStyleURLsForDebug should return raw file paths,
         * or return load.php urls
@@ -177,32 +177,30 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         *         // Scripts to always include
         *         'scripts' => [file path string or array of file path strings],
         *         // Scripts to include in specific language contexts
-        *         'languageScripts' => array(
+        *         'languageScripts' => [
         *             [language code] => [file path string or array of file path strings],
-        *         ),
+        *         ],
         *         // Scripts to include in specific skin contexts
-        *         'skinScripts' => array(
+        *         'skinScripts' => [
         *             [skin name] => [file path string or array of file path strings],
-        *         ),
+        *         ],
         *         // Scripts to include in debug contexts
         *         'debugScripts' => [file path string or array of file path strings],
         *         // Modules which must be loaded before this module
         *         'dependencies' => [module name string or array of module name strings],
-        *         'templates' => array(
+        *         'templates' => [
         *             [template alias with file.ext] => [file path to a template file],
-        *         ),
+        *         ],
         *         // Styles to always load
         *         'styles' => [file path string or array of file path strings],
         *         // Styles to include in specific skin contexts
-        *         'skinStyles' => array(
+        *         'skinStyles' => [
         *             [skin name] => [file path string or array of file path strings],
-        *         ),
+        *         ],
         *         // Messages to always load
         *         'messages' => [array of message key strings],
         *         // Group which this module should be loaded together with
         *         'group' => [group name string],
-        *         // Position on the page to load this module at
-        *         'position' => ['bottom' (default) or 'top']
         *         // Function that, if it returns true, makes the loader skip this module.
         *         // The file must contain valid JavaScript for execution in a private function.
         *         // The file must not contain the "function () {" and "}" wrapper though.
@@ -269,7 +267,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                                        $this->{$member} = $option;
                                        break;
                                // Single strings
-                               case 'position':
                                case 'group':
                                case 'skipFunction':
                                        $this->{$member} = (string)$option;
@@ -277,6 +274,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                                // Single booleans
                                case 'debugRaw':
                                case 'raw':
+                               case 'noflip':
                                        $this->{$member} = (bool)$option;
                                        break;
                        }
@@ -441,13 +439,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                return $this->group;
        }
 
-       /**
-        * @return string
-        */
-       public function getPosition() {
-               return $this->position;
-       }
-
        /**
         * Gets list of names of modules this module depends on.
         * @param ResourceLoaderContext|null $context
@@ -569,7 +560,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                        // - dependencies (provided via startup module)
                        // - targets
                        // - group (provided via startup module)
-                       // - position (only used by OutputPage)
                        'scripts',
                        'debugScripts',
                        'styles',
@@ -913,7 +903,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * @return bool
         */
        public function getFlip( $context ) {
-               return $context->getDirection() === 'rtl';
+               return $context->getDirection() === 'rtl' && !$this->noflip;
        }
 
        /**