2010-09-04 04:00:09 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
2012-04-30 07:16:10 +00:00
|
|
|
* Abstraction for resource loader modules.
|
|
|
|
|
*
|
2010-09-04 04:00:09 +00:00
|
|
|
* 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
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
2010-09-04 12:53:01 +00:00
|
|
|
*
|
2010-09-05 13:31:34 +00:00
|
|
|
* @file
|
2010-09-04 04:00:09 +00:00
|
|
|
* @author Trevor Parscal
|
|
|
|
|
* @author Roan Kattouw
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2010-09-10 23:28:59 +00:00
|
|
|
* Abstraction for resource loader modules, with name registration and maxage functionality.
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
|
|
|
|
abstract class ResourceLoaderModule {
|
2011-02-04 16:39:17 +00:00
|
|
|
|
|
|
|
|
# Type of resource
|
|
|
|
|
const TYPE_SCRIPTS = 'scripts';
|
|
|
|
|
const TYPE_STYLES = 'styles';
|
|
|
|
|
const TYPE_MESSAGES = 'messages';
|
|
|
|
|
const TYPE_COMBINED = 'combined';
|
|
|
|
|
|
|
|
|
|
# sitewide core module like a skin file or jQuery component
|
|
|
|
|
const ORIGIN_CORE_SITEWIDE = 1;
|
|
|
|
|
|
|
|
|
|
# per-user module generated by the software
|
|
|
|
|
const ORIGIN_CORE_INDIVIDUAL = 2;
|
|
|
|
|
|
|
|
|
|
# sitewide module generated from user-editable files, like MediaWiki:Common.js, or
|
|
|
|
|
# modules accessible to multiple users, such as those generated by the Gadgets extension.
|
|
|
|
|
const ORIGIN_USER_SITEWIDE = 3;
|
|
|
|
|
|
2011-02-04 16:44:07 +00:00
|
|
|
# per-user module generated from user-editable files, like User:Me/vector.js
|
2011-02-04 16:39:17 +00:00
|
|
|
const ORIGIN_USER_INDIVIDUAL = 4;
|
|
|
|
|
|
|
|
|
|
# an access constant; make sure this is kept as the largest number in this group
|
|
|
|
|
const ORIGIN_ALL = 10;
|
|
|
|
|
|
|
|
|
|
# script and style modules form a hierarchy of trustworthiness, with core modules like
|
|
|
|
|
# skins and jQuery as most trustworthy, and user scripts as least trustworthy. We can
|
|
|
|
|
# limit the types of scripts and styles we allow to load on, say, sensitive special
|
|
|
|
|
# pages like Special:UserLogin and Special:Preferences
|
|
|
|
|
protected $origin = self::ORIGIN_CORE_SITEWIDE;
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/* Protected Members */
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
protected $name = null;
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-09-23 21:23:51 +00:00
|
|
|
// In-object cache for file dependencies
|
|
|
|
|
protected $fileDeps = array();
|
|
|
|
|
// In-object cache for message blob mtime
|
|
|
|
|
protected $msgBlobMtime = array();
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/* Methods */
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/**
|
|
|
|
|
* Get this module's name. This is set when the module is registered
|
|
|
|
|
* with ResourceLoader::register()
|
2010-09-05 13:31:34 +00:00
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @return Mixed: Name (string) or null if no name was set
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
|
|
|
|
public function getName() {
|
|
|
|
|
return $this->name;
|
|
|
|
|
}
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/**
|
|
|
|
|
* Set this module's name. This is called by ResourceLodaer::register()
|
|
|
|
|
* when registering the module. Other code should not call this.
|
2010-09-05 13:31:34 +00:00
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @param $name String: Name
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
|
|
|
|
public function setName( $name ) {
|
|
|
|
|
$this->name = $name;
|
|
|
|
|
}
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2011-02-04 16:39:17 +00:00
|
|
|
/**
|
|
|
|
|
* Get this module's origin. This is set when the module is registered
|
|
|
|
|
* with ResourceLoader::register()
|
|
|
|
|
*
|
|
|
|
|
* @return Int ResourceLoaderModule class constant, the subclass default
|
|
|
|
|
* if not set manuall
|
|
|
|
|
*/
|
|
|
|
|
public function getOrigin() {
|
|
|
|
|
return $this->origin;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set this module's origin. This is called by ResourceLodaer::register()
|
|
|
|
|
* when registering the module. Other code should not call this.
|
|
|
|
|
*
|
2011-05-21 17:45:20 +00:00
|
|
|
* @param $origin Int origin
|
2011-02-04 16:39:17 +00:00
|
|
|
*/
|
|
|
|
|
public function setOrigin( $origin ) {
|
|
|
|
|
$this->origin = $origin;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-04 10:53:57 +00:00
|
|
|
/**
|
2011-01-10 04:44:33 +00:00
|
|
|
* @param $context ResourceLoaderContext
|
2011-02-18 00:33:45 +00:00
|
|
|
* @return bool
|
2010-09-04 10:53:57 +00:00
|
|
|
*/
|
|
|
|
|
public function getFlip( $context ) {
|
2011-03-25 11:15:40 +00:00
|
|
|
global $wgContLang;
|
|
|
|
|
|
|
|
|
|
return $wgContLang->getDir() !== $context->getDirection();
|
2010-09-04 10:53:57 +00:00
|
|
|
}
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/**
|
|
|
|
|
* Get all JS for this module for a given language and skin.
|
|
|
|
|
* Includes all relevant JS except loader scripts.
|
2010-09-05 13:31:34 +00:00
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @param $context ResourceLoaderContext: Context object
|
|
|
|
|
* @return String: JavaScript code
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
2010-09-11 03:26:15 +00:00
|
|
|
public function getScript( ResourceLoaderContext $context ) {
|
|
|
|
|
// Stub, override expected
|
|
|
|
|
return '';
|
|
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
/**
|
|
|
|
|
* Get the URL or URLs to load for this module's JS in debug mode.
|
|
|
|
|
* The default behavior is to return a load.php?only=scripts URL for
|
|
|
|
|
* the module, but file-based modules will want to override this to
|
|
|
|
|
* load the files directly.
|
2011-10-14 08:06:54 +00:00
|
|
|
*
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
* This function is called only when 1) we're in debug mode, 2) there
|
|
|
|
|
* is no only= parameter and 3) supportsURLLoading() returns true.
|
|
|
|
|
* #2 is important to prevent an infinite loop, therefore this function
|
|
|
|
|
* MUST return either an only= URL or a non-load.php URL.
|
2011-10-14 08:06:54 +00:00
|
|
|
*
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
* @param $context ResourceLoaderContext: Context object
|
|
|
|
|
* @return Array of URLs
|
|
|
|
|
*/
|
|
|
|
|
public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
|
2011-09-13 20:36:24 +00:00
|
|
|
$url = ResourceLoader::makeLoaderURL(
|
|
|
|
|
array( $this->getName() ),
|
|
|
|
|
$context->getLanguage(),
|
|
|
|
|
$context->getSkin(),
|
|
|
|
|
$context->getUser(),
|
|
|
|
|
$context->getVersion(),
|
|
|
|
|
true, // debug
|
|
|
|
|
'scripts', // only
|
|
|
|
|
$context->getRequest()->getBool( 'printable' ),
|
|
|
|
|
$context->getRequest()->getBool( 'handheld' )
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
);
|
2011-09-13 20:36:24 +00:00
|
|
|
return array( $url );
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
/**
|
|
|
|
|
* Whether this module supports URL loading. If this function returns false,
|
|
|
|
|
* getScript() will be used even in cases (debug mode, no only param) where
|
|
|
|
|
* getScriptURLsForDebug() would normally be used instead.
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function supportsURLLoading() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/**
|
|
|
|
|
* Get all CSS for this module for a given skin.
|
2010-09-05 13:31:34 +00:00
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @param $context ResourceLoaderContext: Context object
|
ResourceLoader: Refactor style loading
Fixes:
* bug 31676: Work around IE stylesheet limit.
* bug 35562: @import styles broken in modules that combine
multiple stylesheets.
* bug 40498: Don't output empty "@media print { }" blocks.
* bug 40500: Don't ignore media-type for urls in debug mode.
Approach:
* Re-use the same <style> tag so that we stay under the 31
stylesheet limit in IE. Unless the to-be-added css text from
the being-loaded module contains @import, in which case we do
create a new <style> tag and then re-use that one from that
point on (bug 31676).
* Return stylesheets as arrays, instead of a concatenated string.
This fixes bug 35562, because @import only works when at the
top of a stylesheet. By not unconditionally concatenating files
within a module on the server side already, @import will work
in e.g. module 'site' that contains 2 wiki pages.
This is normalized in ResourceLoader::makeCombinedStyles(),
so far only ResourceLoaderWikiModule makes use of this.
Misc. clean up and bug fixes:
* Reducing usage of jQuery() and mw.html.element() where
native DOM would be very simple and faster. Aside from
simplicity and speed, this is also working towards a more
stand-alone ResourceLoader.
* Trim server output a little bit more
- Redundant new line after minify-css (it is now an array, so
no need to keep space afterwards)
- Redundant semi-colon after minify-js if it ends in a colon
* Allow space in styleTest.css.php
* Clean up and extend unit tests to cover for these features
and bug fixes.
* Don't set styleEl.rel = 'stylesheet'; that has no business
on a <style> tag.
* Fix bug in mw.loader's addStyleTag(). It turns out IE6
has an odd security measure that does not allow manipulation
of elements (at least style tags) that are created by a
different script (even if that script was served from the same
domain/origin etc.). We didn't ran into this before because
we only created new style tags, never appended to them. Now
that we do, this came up. Took a while to figure out because
it was created by mediawiki.js but it calls jQuery which did
the actual dom insertion. Odd thing is, we load jquery.js and
mediawiki.js in the same request even...
Without this all css-url related mw.loader tests would fail
in IE6.
* mediawiki.js and mediawiki.test.js now pass jshint again.
Tested (and passing qunit/?module=mediawiki; 123 of 123):
* Chrome 14, 21
* Firefox 3.0, 3.6, 4, 7, 14, 15, 16beta
* IE 6, 7, 8, 9
* Safari 4.0, 5.0, 5.1
* Opera 10.0, 11.1, 11.5, 11.6, 12.0, 12.5beta
* iPhone 3GS / iOS 3.0 / Mobile Safari 4.0
iPhone 4 / iOS 4.0.1 / Mobile Safari 4.0.5
iPhone 4S / iOS 6.0 Beta / Mobile Safari 6.0
Change-Id: I3e8227ddb87fd9441071ca935439fc6467751dab
2012-07-25 21:20:21 +00:00
|
|
|
* @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 }' ) );
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
2010-09-11 03:26:15 +00:00
|
|
|
public function getStyles( ResourceLoaderContext $context ) {
|
|
|
|
|
// Stub, override expected
|
2011-03-27 14:13:57 +00:00
|
|
|
return array();
|
2010-09-11 03:26:15 +00:00
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
/**
|
|
|
|
|
* Get the URL or URLs to load for this module's CSS in debug mode.
|
|
|
|
|
* The default behavior is to return a load.php?only=styles URL for
|
|
|
|
|
* the module, but file-based modules will want to override this to
|
|
|
|
|
* load the files directly. See also getScriptURLsForDebug()
|
2011-10-14 08:06:54 +00:00
|
|
|
*
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
* @param $context ResourceLoaderContext: Context object
|
|
|
|
|
* @return Array: array( mediaType => array( URL1, URL2, ... ), ... )
|
|
|
|
|
*/
|
|
|
|
|
public function getStyleURLsForDebug( ResourceLoaderContext $context ) {
|
2011-09-13 20:36:24 +00:00
|
|
|
$url = ResourceLoader::makeLoaderURL(
|
|
|
|
|
array( $this->getName() ),
|
|
|
|
|
$context->getLanguage(),
|
|
|
|
|
$context->getSkin(),
|
|
|
|
|
$context->getUser(),
|
|
|
|
|
$context->getVersion(),
|
|
|
|
|
true, // debug
|
|
|
|
|
'styles', // only
|
|
|
|
|
$context->getRequest()->getBool( 'printable' ),
|
|
|
|
|
$context->getRequest()->getBool( 'handheld' )
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
);
|
2011-09-13 20:36:24 +00:00
|
|
|
return array( 'all' => array( $url ) );
|
Fix the fixme on r88053: dependency handling was broken in debug mode in certain cases. More specifically, if A is a file module that depends on B, B is a wiki module that depends on C and C is a file module, the loading order is CBA (correct) in production mode but was BCA (wrong) in debug mode. Fixed this by URL-ifying scripts and styles for those modules in debug mode, as I said to on CR. What this means is that the initial debug=true request for a module will now always return arrays of URLs, never the JS or CSS itself. This was already the case for file modules (which returned arrays of URLs to the raw files), but not for other modules (which returned the JS and CSS itself). So for non-file modules, load.php?modules=foo&debug=true now returns some JS that instructs the loader to fetch the module's JS from load.php?modules=foo&debug=true&only=scripts and the CSS from ...&only=styles .
* Removed the magic behavior where ResourceLoaderModule::getScripts() and getStyles() could return an array of URLs where the documentation said they should return a JS/CSS string. Because I didn't restructure the calling code too much, the old magical behavior should still work.
* Instead, move this behavior to getScriptURLsForDebug() and getStyleURLsForDebug(). The default implementation constructs a single URL for a load.php request for the module with debug=true&only=scripts (or styles). The URL building code duplicates some things from OutputPage::makeResourceLoaderLink(), I'll clean that up later. ResourceLoaderFileModule overrides this method to return URLs to the raw files, using code that I removed from getScripts()/getStyles()
* Add ResourceLoaderModule::supportsURLLoading(), which returns true by default but may return false to indicate that a module does not support loading via a URL. This is needed to respect $this->debugRaw in ResourceLoaderFileModule (set to true for jquery and mediawiki), and obviously for the startup module as well, because we get bootstrapping problems otherwise (can't call mw.loader.implement() when the code for mw.loader isn't loaded yet)
2011-09-13 17:13:53 +00:00
|
|
|
}
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/**
|
|
|
|
|
* Get the messages needed for this module.
|
|
|
|
|
*
|
|
|
|
|
* To get a JSON blob with messages, use MessageBlobStore::get()
|
2010-09-05 13:31:34 +00:00
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @return Array: List of message keys. Keys may occur more than once
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
2010-09-11 03:26:15 +00:00
|
|
|
public function getMessages() {
|
|
|
|
|
// Stub, override expected
|
|
|
|
|
return array();
|
|
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-09-20 21:23:29 +00:00
|
|
|
/**
|
|
|
|
|
* Get the group this module is in.
|
2011-10-14 08:06:54 +00:00
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @return String: Group name
|
2010-09-20 21:23:29 +00:00
|
|
|
*/
|
|
|
|
|
public function getGroup() {
|
|
|
|
|
// Stub, override expected
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2011-07-26 21:10:34 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the origin of this module. Should only be overridden for foreign modules.
|
2011-10-14 08:06:54 +00:00
|
|
|
*
|
2011-07-26 21:10:34 +00:00
|
|
|
* @return String: Origin name, 'local' for local modules
|
|
|
|
|
*/
|
|
|
|
|
public function getSource() {
|
|
|
|
|
// Stub, override expected
|
|
|
|
|
return 'local';
|
|
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2011-04-07 12:07:25 +00:00
|
|
|
/**
|
|
|
|
|
* Where on the HTML page should this module's JS be loaded?
|
2012-07-10 12:48:06 +00:00
|
|
|
* - 'top': in the "<head>"
|
|
|
|
|
* - 'bottom': at the bottom of the "<body>"
|
2011-05-21 17:45:20 +00:00
|
|
|
*
|
|
|
|
|
* @return string
|
2011-04-07 12:07:25 +00:00
|
|
|
*/
|
|
|
|
|
public function getPosition() {
|
|
|
|
|
return 'bottom';
|
|
|
|
|
}
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2012-05-11 19:16:29 +00:00
|
|
|
/**
|
|
|
|
|
* 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;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/**
|
|
|
|
|
* Get the loader JS for this module, if set.
|
2010-09-05 13:31:34 +00:00
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @return Mixed: JavaScript loader code as a string or boolean false if no custom loader set
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
2010-09-11 03:26:15 +00:00
|
|
|
public function getLoaderScript() {
|
|
|
|
|
// Stub, override expected
|
2010-09-20 21:23:29 +00:00
|
|
|
return false;
|
2010-09-11 03:26:15 +00:00
|
|
|
}
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/**
|
|
|
|
|
* Get a list of modules this module depends on.
|
|
|
|
|
*
|
|
|
|
|
* Dependency information is taken into account when loading a module
|
|
|
|
|
* on the client side. When adding a module on the server side,
|
|
|
|
|
* dependency information is NOT taken into account and YOU are
|
|
|
|
|
* responsible for adding dependent modules as well. If you don't do
|
|
|
|
|
* this, the client side loader will send a second request back to the
|
|
|
|
|
* server to fetch the missing modules, which kind of defeats the
|
|
|
|
|
* purpose of the resource loader.
|
|
|
|
|
*
|
|
|
|
|
* To add dependencies dynamically on the client side, use a custom
|
|
|
|
|
* loader script, see getLoaderScript()
|
2010-11-05 18:33:50 +00:00
|
|
|
* @return Array: List of module names as strings
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
2010-09-11 03:26:15 +00:00
|
|
|
public function getDependencies() {
|
|
|
|
|
// Stub, override expected
|
|
|
|
|
return array();
|
|
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-09-23 21:23:51 +00:00
|
|
|
/**
|
|
|
|
|
* Get the files this module depends on indirectly for a given skin.
|
|
|
|
|
* Currently these are only image files referenced by the module's CSS.
|
|
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @param $skin String: Skin name
|
|
|
|
|
* @return Array: List of files
|
2010-09-23 21:23:51 +00:00
|
|
|
*/
|
|
|
|
|
public function getFileDependencies( $skin ) {
|
|
|
|
|
// Try in-object cache first
|
|
|
|
|
if ( isset( $this->fileDeps[$skin] ) ) {
|
|
|
|
|
return $this->fileDeps[$skin];
|
|
|
|
|
}
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2010-09-23 21:23:51 +00:00
|
|
|
$dbr = wfGetDB( DB_SLAVE );
|
|
|
|
|
$deps = $dbr->selectField( 'module_deps', 'md_deps', array(
|
|
|
|
|
'md_module' => $this->getName(),
|
|
|
|
|
'md_skin' => $skin,
|
|
|
|
|
), __METHOD__
|
|
|
|
|
);
|
|
|
|
|
if ( !is_null( $deps ) ) {
|
2010-11-03 07:58:03 +00:00
|
|
|
$this->fileDeps[$skin] = (array) FormatJson::decode( $deps, true );
|
|
|
|
|
} else {
|
|
|
|
|
$this->fileDeps[$skin] = array();
|
2010-09-23 21:23:51 +00:00
|
|
|
}
|
2010-11-03 07:58:03 +00:00
|
|
|
return $this->fileDeps[$skin];
|
2010-09-23 21:23:51 +00:00
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-09-23 21:23:51 +00:00
|
|
|
/**
|
|
|
|
|
* Set preloaded file dependency information. Used so we can load this
|
|
|
|
|
* information for all modules at once.
|
2010-11-05 18:33:50 +00:00
|
|
|
* @param $skin String: Skin name
|
|
|
|
|
* @param $deps Array: Array of file names
|
2010-09-23 21:23:51 +00:00
|
|
|
*/
|
|
|
|
|
public function setFileDependencies( $skin, $deps ) {
|
|
|
|
|
$this->fileDeps[$skin] = $deps;
|
|
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-09-23 21:23:51 +00:00
|
|
|
/**
|
|
|
|
|
* Get the last modification timestamp of the message blob for this
|
|
|
|
|
* module in a given language.
|
2010-11-05 18:33:50 +00:00
|
|
|
* @param $lang String: Language code
|
2011-02-11 08:07:47 +00:00
|
|
|
* @return Integer: UNIX timestamp, or 0 if the module doesn't have messages
|
2010-09-23 21:23:51 +00:00
|
|
|
*/
|
|
|
|
|
public function getMsgBlobMtime( $lang ) {
|
2010-11-19 06:52:38 +00:00
|
|
|
if ( !isset( $this->msgBlobMtime[$lang] ) ) {
|
2012-09-27 19:36:14 +00:00
|
|
|
if ( !count( $this->getMessages() ) ) {
|
2010-11-19 06:52:38 +00:00
|
|
|
return 0;
|
2012-09-27 19:36:14 +00:00
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-11-19 06:52:38 +00:00
|
|
|
$dbr = wfGetDB( DB_SLAVE );
|
|
|
|
|
$msgBlobMtime = $dbr->selectField( 'msg_resource', 'mr_timestamp', array(
|
|
|
|
|
'mr_resource' => $this->getName(),
|
|
|
|
|
'mr_lang' => $lang
|
|
|
|
|
), __METHOD__
|
|
|
|
|
);
|
2011-02-11 08:07:47 +00:00
|
|
|
// If no blob was found, but the module does have messages, that means we need
|
|
|
|
|
// to regenerate it. Return NOW
|
2011-02-11 08:29:55 +00:00
|
|
|
if ( $msgBlobMtime === false ) {
|
|
|
|
|
$msgBlobMtime = wfTimestampNow();
|
2011-02-11 08:07:47 +00:00
|
|
|
}
|
|
|
|
|
$this->msgBlobMtime[$lang] = wfTimestamp( TS_UNIX, $msgBlobMtime );
|
2010-11-19 06:52:38 +00:00
|
|
|
}
|
2010-09-23 21:23:51 +00:00
|
|
|
return $this->msgBlobMtime[$lang];
|
|
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-09-23 21:23:51 +00:00
|
|
|
/**
|
|
|
|
|
* Set a preloaded message blob last modification timestamp. Used so we
|
|
|
|
|
* can load this information for all modules at once.
|
2010-11-05 18:33:50 +00:00
|
|
|
* @param $lang String: Language code
|
|
|
|
|
* @param $mtime Integer: UNIX timestamp or 0 if there is no such blob
|
2010-09-23 21:23:51 +00:00
|
|
|
*/
|
|
|
|
|
public function setMsgBlobMtime( $lang, $mtime ) {
|
|
|
|
|
$this->msgBlobMtime[$lang] = $mtime;
|
|
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-09-11 03:26:15 +00:00
|
|
|
/* Abstract Methods */
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
/**
|
|
|
|
|
* Get this module's last modification timestamp for a given
|
|
|
|
|
* combination of language, skin and debug mode flag. This is typically
|
|
|
|
|
* the highest of each of the relevant components' modification
|
|
|
|
|
* timestamps. Whenever anything happens that changes the module's
|
|
|
|
|
* contents for these parameters, the mtime should increase.
|
2010-09-05 13:31:34 +00:00
|
|
|
*
|
2012-03-07 19:33:37 +00:00
|
|
|
* NOTE: The mtime of the module's messages is NOT automatically included.
|
|
|
|
|
* If you want this to happen, you'll need to call getMsgBlobMtime()
|
|
|
|
|
* yourself and take its result into consideration.
|
2012-10-19 20:03:05 +00:00
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @param $context ResourceLoaderContext: Context object
|
|
|
|
|
* @return Integer: UNIX timestamp
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
2010-09-29 23:25:07 +00:00
|
|
|
public function getModifiedTime( ResourceLoaderContext $context ) {
|
|
|
|
|
// 0 would mean now
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2011-02-19 17:07:05 +00:00
|
|
|
/**
|
|
|
|
|
* Check whether this module is known to be empty. If a child class
|
|
|
|
|
* has an easy and cheap way to determine that this module is
|
|
|
|
|
* definitely going to be empty, it should override this method to
|
|
|
|
|
* return true in that case. Callers may optimize the request for this
|
|
|
|
|
* module away if this function returns true.
|
|
|
|
|
* @param $context ResourceLoaderContext: Context object
|
|
|
|
|
* @return Boolean
|
|
|
|
|
*/
|
|
|
|
|
public function isKnownEmpty( ResourceLoaderContext $context ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2011-07-06 21:48:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @var JSParser lazy-initialized; use self::javaScriptParser() */
|
|
|
|
|
private static $jsParser;
|
|
|
|
|
private static $parseCacheVersion = 1;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Validate a given script file; if valid returns the original source.
|
|
|
|
|
* If invalid, returns replacement JS source that throws an exception.
|
|
|
|
|
*
|
|
|
|
|
* @param string $fileName
|
|
|
|
|
* @param string $contents
|
|
|
|
|
* @return string JS with the original, or a replacement error
|
|
|
|
|
*/
|
|
|
|
|
protected function validateScriptFile( $fileName, $contents ) {
|
|
|
|
|
global $wgResourceLoaderValidateJS;
|
|
|
|
|
if ( $wgResourceLoaderValidateJS ) {
|
|
|
|
|
// Try for cache hit
|
|
|
|
|
// Use CACHE_ANYTHING since filtering is very slow compared to DB queries
|
|
|
|
|
$key = wfMemcKey( 'resourceloader', 'jsparse', self::$parseCacheVersion, md5( $contents ) );
|
|
|
|
|
$cache = wfGetCache( CACHE_ANYTHING );
|
|
|
|
|
$cacheEntry = $cache->get( $key );
|
|
|
|
|
if ( is_string( $cacheEntry ) ) {
|
|
|
|
|
return $cacheEntry;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$parser = self::javaScriptParser();
|
|
|
|
|
try {
|
|
|
|
|
$parser->parse( $contents, $fileName, 1 );
|
|
|
|
|
$result = $contents;
|
2012-10-01 10:36:15 +00:00
|
|
|
} catch ( Exception $e ) {
|
2011-07-06 21:48:09 +00:00
|
|
|
// We'll save this to cache to avoid having to validate broken JS over and over...
|
|
|
|
|
$err = $e->getMessage();
|
2012-10-01 10:36:15 +00:00
|
|
|
$result = "throw new Error(" . Xml::encodeJsVar( "JavaScript parse error: $err" ) . ");";
|
2011-07-06 21:48:09 +00:00
|
|
|
}
|
2011-10-14 08:06:54 +00:00
|
|
|
|
2011-07-06 21:48:09 +00:00
|
|
|
$cache->set( $key, $result );
|
|
|
|
|
return $result;
|
|
|
|
|
} else {
|
|
|
|
|
return $contents;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-10-14 08:06:54 +00:00
|
|
|
/**
|
|
|
|
|
* @return JSParser
|
|
|
|
|
*/
|
2011-07-06 21:48:09 +00:00
|
|
|
protected static function javaScriptParser() {
|
|
|
|
|
if ( !self::$jsParser ) {
|
|
|
|
|
self::$jsParser = new JSParser();
|
|
|
|
|
}
|
|
|
|
|
return self::$jsParser;
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-11 22:37:59 +00:00
|
|
|
/**
|
|
|
|
|
* Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']
|
|
|
|
|
* Default implementation hardcodes 'desktop'.
|
|
|
|
|
*
|
|
|
|
|
* @return array of strings
|
|
|
|
|
*/
|
|
|
|
|
public function getTargets() {
|
|
|
|
|
return array( 'desktop' );
|
|
|
|
|
}
|
2010-09-04 04:00:09 +00:00
|
|
|
}
|