jenkins-bot has submitted this change and it was merged.
Change subject: Hygiene: Documentation updates
......................................................................
Hygiene: Documentation updates
* Point QUnit command line tool to only run Mantle tests
* Update ResourceLoaderTemplateModule with documentation recently added in
mobile
* Update documentation of eventemitter to reflect change in MobileFrontend
* Update view to refer to Mantle
Change-Id: If582ecbff2327e3e41548d2c8fc8d6137cf2f073
---
M Makefile
M includes/ResourceLoaderTemplateModule.php
M javascripts/common/eventemitter.js
M tests/javascripts/common/test_View.js
4 files changed, 28 insertions(+), 14 deletions(-)
Approvals:
Kaldari: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Makefile b/Makefile
index 4ba1bdf..4f90b45 100644
--- a/Makefile
+++ b/Makefile
@@ -13,4 +13,4 @@
cd ${MW_INSTALL_PATH}/tests/phpunit && php phpunit.php --configuration
${MW_INSTALL_PATH}/extensions/Mantle/tests/suite.xml --group=Mantle
qunit:
- @scripts/qunit.sh
+ @scripts/qunit.sh Mantle
diff --git a/includes/ResourceLoaderTemplateModule.php
b/includes/ResourceLoaderTemplateModule.php
index a7de734..c1c3c86 100644
--- a/includes/ResourceLoaderTemplateModule.php
+++ b/includes/ResourceLoaderTemplateModule.php
@@ -1,30 +1,41 @@
<?php
/**
* ResourceLoaderModule subclass which supports templates
+ */
+
+/**
+ * ResourceLoaderModule subclass for mobile
* Allows basic parsing of messages without arguments
*/
class ResourceLoaderTemplateModule extends ResourceLoaderFileModule {
+ /** @var array Saves a list of names of modules this module depends on.
*/
protected $dependencies = array();
+ /** @var array Saves a list of messages which have been marked as
needing parsing. */
protected $parsedMessages = array();
+ /** @var array Saves a list of message keys used by this module. */
protected $messages = array();
+ /** @var array Saves a list of the templates named by the modules. */
protected $templates = array();
+ /** @var string Base path to prepend to all local paths in $options.
Defaults to $IP. */
protected $localBasePath;
- /** String: The local path to where templates are located, see
__construct() */
+ /** @var array Saves the target for the module (e.g. desktop and
mobile). */
+ protected $targets = array( 'mobile', 'desktop' );
+ /** @var string The local path to where templates are located, see
__construct() */
protected $localTemplateBasePath = '';
+ /** @var boolean Whether the module has parsed messages or not. */
private $hasParsedMessages = false;
+ /** @var boolean Whether the module has templates or not. */
private $hasTemplates = false;
/**
- * Array: Cache for mtime of templates
- * @par Usage:
- * @code
- * array( [hash] => [mtime], [hash] => [mtime], ... )
- * @endcode
+ * @var array Cache for mtime of templates
+ * @example array( [hash] => [mtime], [hash] => [mtime], ... )
*/
protected $templateModifiedTime = array();
/**
* Registers core modules and runs registration hooks.
+ * @param $options List of options; if not given or empty, an empty
module will be constructed
*/
public function __construct( $options ) {
foreach ( $options as $member => $option ) {
@@ -60,18 +71,19 @@
/**
* Returns the templates named by the modules
* Each template has a corresponding html file in includes/templates/
- *
+ * @return array List of template names
*/
function getTemplateNames() {
return $this->templates;
}
/**
- * Returns name of template. Defaults to .html when no extension present
- * @param string $name of template
+ * Get the path to load templates from.
+ * @param string $name name of template including file extension
* @return string
*/
protected function getLocalTemplatePath( $name ) {
+ // @FIXME: Deprecate usage of template without file extension.
$ext = pathinfo( $name, PATHINFO_EXTENSION);
if ( $ext !== '' ) {
return "{$this->localTemplateBasePath}/$name";
@@ -118,7 +130,7 @@
/**
* Separates messages which have been marked as needing parsing from
standard messages
- *
+ * @param array $messages Array of messages to process
*/
public function processMessages( $messages ) {
foreach( $messages as $key => $value ) {
@@ -155,8 +167,10 @@
}
/**
+ * Get the URL or URLs to load for this module's JS in debug mode.
* @param ResourceLoaderContext $context
- * @return array
+ * @return array list of urls
+ * @see ResourceLoaderModule::getScriptURLsForDebug
*/
public function getScriptURLsForDebug( ResourceLoaderContext $context )
{
if ( $this->hasParsedMessages || $this->hasTemplates ) {
diff --git a/javascripts/common/eventemitter.js
b/javascripts/common/eventemitter.js
index bdb1bef..9e7f37e 100644
--- a/javascripts/common/eventemitter.js
+++ b/javascripts/common/eventemitter.js
@@ -58,7 +58,7 @@
* Remove a callback.
*
* @name EventEmitter.prototype.off
- * @function
+ * @method
* @param {string} event Event name.
*/
off: function( event ) {
diff --git a/tests/javascripts/common/test_View.js
b/tests/javascripts/common/test_View.js
index bc9b779..f9e9c73 100644
--- a/tests/javascripts/common/test_View.js
+++ b/tests/javascripts/common/test_View.js
@@ -2,7 +2,7 @@
var View = M.require( 'View' );
-QUnit.module( 'MobileFrontend view', {
+QUnit.module( 'Mantle view', {
setup: function() {
var compiler = {
compile: function() {
--
To view, visit https://gerrit.wikimedia.org/r/142281
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If582ecbff2327e3e41548d2c8fc8d6137cf2f073
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Mantle
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits