Merge "Fixed dependencies for jquery.collapsibleTabs"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderFileModule.php
index ec4a14d..db4c758 100644 (file)
@@ -113,6 +113,8 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        protected $debugRaw = true;
        /** Boolean: Whether mw.loader.state() call should be omitted */
        protected $raw = false;
+       protected $targets = array( 'desktop' );
+
        /**
         * Array: Cache for mtime
         * @par Usage:
@@ -232,6 +234,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                                // Lists of strings
                                case 'dependencies':
                                case 'messages':
+                               case 'targets':
                                        $this->{$member} = (array) $option;
                                        break;
                                // Single strings
@@ -621,7 +624,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                $localPath = $this->getLocalPath( $path );
                if ( !file_exists( $localPath ) ) {
                        $msg = __METHOD__.": style file not found: \"$localPath\"";
-                       wfErrorLog( $msg, 'resourceloader' );
+                       wfDebugLog( 'resourceloader', $msg );
                        throw new MWException( $msg );
                }
                $style = file_get_contents( $localPath );
@@ -670,4 +673,14 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        public function getFlip( $context ) {
                return $context->getDirection() === 'rtl';
        }
+
+       /**
+        * Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']
+        *
+        * @return array of strings
+        */
+       public function getTargets() {
+               return $this->targets;
+       }
+
 }