summaryrefslogtreecommitdiff
path: root/includes/resourceloader/ResourceLoaderModule.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/resourceloader/ResourceLoaderModule.php')
-rw-r--r--includes/resourceloader/ResourceLoaderModule.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php
index 1a232ec2..9c49c45f 100644
--- a/includes/resourceloader/ResourceLoaderModule.php
+++ b/includes/resourceloader/ResourceLoaderModule.php
@@ -1,5 +1,7 @@
<?php
/**
+ * Abstraction for resource loader modules.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -170,7 +172,9 @@ abstract class ResourceLoaderModule {
* Get all CSS for this module for a given skin.
*
* @param $context ResourceLoaderContext: Context object
- * @return Array: List of CSS strings keyed by media type
+ * @return Array: List of CSS strings or array of CSS strings keyed by media type.
+ * like array( 'screen' => '.foo { width: 0 }' );
+ * or array( 'screen' => array( '.foo { width: 0 }' ) );
*/
public function getStyles( ResourceLoaderContext $context ) {
// Stub, override expected
@@ -235,8 +239,8 @@ abstract class ResourceLoaderModule {
/**
* Where on the HTML page should this module's JS be loaded?
- * 'top': in the <head>
- * 'bottom': at the bottom of the <body>
+ * - 'top': in the "<head>"
+ * - 'bottom': at the bottom of the "<body>"
*
* @return string
*/
@@ -245,6 +249,17 @@ abstract class ResourceLoaderModule {
}
/**
+ * Whether this module's JS expects to work without the client-side ResourceLoader module.
+ * Returning true from this function will prevent mw.loader.state() call from being
+ * appended to the bottom of the script.
+ *
+ * @return bool
+ */
+ public function isRaw() {
+ return false;
+ }
+
+ /**
* Get the loader JS for this module, if set.
*
* @return Mixed: JavaScript loader code as a string or boolean false if no custom loader set