Krinkle has uploaded a new change for review.
https://gerrit.wikimedia.org/r/81111
Change subject: doc: Restore and clean up documentation for Platform subclasses
......................................................................
doc: Restore and clean up documentation for Platform subclasses
- Added missing @inheritdoc so that generated documentation is
not empty.
- Fixed type of mw.Platform#getMessage from (implied) @property
back to @method.
- Removed notes from mw methods. They are prepended instead of
appended, thus overriding the useful single-line summary
of the method with this random note. Description should either
be replaced entirely (e.g. no @inheritdoc) or inherited.
- Rephrased a few description to be consistent with the others
(e.g. "Get .." and "Add .." instead of "Gets .." or "Adds..").
Follows-up cbe35632f1.
Change-Id: Ie55bb9e18f1524b706f0e195300170e4d552bf73
---
M modules/ve-mw/init/ve.init.mw.Platform.js
M modules/ve/init/sa/ve.init.sa.Platform.js
M modules/ve/init/ve.init.Platform.js
3 files changed, 21 insertions(+), 31 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/11/81111/1
diff --git a/modules/ve-mw/init/ve.init.mw.Platform.js
b/modules/ve-mw/init/ve.init.mw.Platform.js
index 1f216ef..088fafc 100644
--- a/modules/ve-mw/init/ve.init.mw.Platform.js
+++ b/modules/ve-mw/init/ve.init.mw.Platform.js
@@ -35,46 +35,35 @@
/* Methods */
-/**
- * Uses the mw.config wgUrlProtocols variable.
- * @inheritdoc
- */
+/** @inheritdoc */
ve.init.mw.Platform.prototype.getExternalLinkUrlProtocolsRegExp = function () {
return this.externalLinkUrlProtocolsRegExp;
};
-/**
- * Uses MediaWiki's {wgExtensionAssetsPath} variable.
- * @inheritdoc
- */
+/** @inheritdoc */
ve.init.mw.Platform.prototype.getModulesUrl = function () {
return this.modulesUrl;
};
-/**
- * Wrapper for mw.msg system.
- * @inheritdoc
- */
+/** @inheritdoc */
ve.init.mw.Platform.prototype.addMessages = function ( messages ) {
return mw.messages.set( messages );
};
/**
- * Wrapper for mw.msg system.
+ * @method
+ * @inheritdoc
*/
ve.init.mw.Platform.prototype.getMessage = ve.bind( mw.msg, mw );
-/** */
+/** @inheritdoc */
ve.init.mw.Platform.prototype.addParsedMessages = function ( messages ) {
for ( var key in messages ) {
this.parsedMessages[key] = messages[key];
}
};
-/**
- * Falls back to mw.messsage with .escaped().
- * @inheritdoc
- */
+/** @inheritdoc */
ve.init.mw.Platform.prototype.getParsedMessage = function ( key ) {
if ( key in this.parsedMessages ) {
// Prefer parsed results from VisualEditorMessagesModule.php if
available.
@@ -84,12 +73,12 @@
return mw.message( key ).escaped();
};
-/** */
+/** @inheritdoc */
ve.init.mw.Platform.prototype.getSystemPlatform = function () {
return $.client.profile().platform;
};
-/** */
+/** @inheritdoc */
ve.init.mw.Platform.prototype.getUserLanguages = function () {
var lang = mw.config.get( 'wgUserLanguage' ),
langParts = lang.split( '-' ),
diff --git a/modules/ve/init/sa/ve.init.sa.Platform.js
b/modules/ve/init/sa/ve.init.sa.Platform.js
index c8dc1f8..9fa9258 100644
--- a/modules/ve/init/sa/ve.init.sa.Platform.js
+++ b/modules/ve/init/sa/ve.init.sa.Platform.js
@@ -30,7 +30,7 @@
/* Methods */
-/** */
+/** @inheritdoc */
ve.init.sa.Platform.prototype.getExternalLinkUrlProtocolsRegExp = function () {
return this.externalLinkUrlProtocolsRegExp;
};
@@ -38,26 +38,26 @@
/**
* Set the remotely accessible URL to the modules directory.
*
- * @method
* @param {string} url Remote modules URL
*/
ve.init.sa.Platform.prototype.setModulesUrl = function ( url ) {
this.modulesUrl = url;
};
-/** */
+/** @inheritdoc */
ve.init.sa.Platform.prototype.getModulesUrl = function () {
return this.modulesUrl;
};
-/** */
+
+/** @inheritdoc */
ve.init.sa.Platform.prototype.addMessages = function ( messages ) {
for ( var key in messages ) {
this.messages[key] = messages[key];
}
};
-/** */
+/** @inheritdoc */
ve.init.sa.Platform.prototype.getMessage = function ( key ) {
if ( key in this.messages ) {
// Simple message parser, does $N replacement and nothing else.
@@ -70,14 +70,14 @@
return '<' + key + '>';
};
-/** */
+/** @inheritdoc */
ve.init.sa.Platform.prototype.addParsedMessages = function ( messages ) {
for ( var key in messages ) {
this.parsedMessages[key] = messages[key];
}
};
-/** */
+/** @inheritdoc */
ve.init.sa.Platform.prototype.getParsedMessage = function ( key ) {
if ( key in this.parsedMessages ) {
// Prefer parsed results from VisualEditorMessagesModule.php if
available.
@@ -100,7 +100,7 @@
} );
};
-/** */
+/** @inheritdoc */
ve.init.sa.Platform.prototype.getSystemPlatform = function () {
var platforms = ['win', 'mac', 'linux', 'sunos', 'solaris', 'iphone'],
match = new RegExp( '(' + platforms.join( '|' ) + ')' ).exec(
window.navigator.platform.toLowerCase() );
@@ -109,7 +109,7 @@
}
};
-/** */
+/** @inheritdoc */
ve.init.sa.Platform.prototype.getUserLanguages = function () {
// IE or Firefox Safari Opera
var lang = window.navigator.userLanguage || window.navigator.language,
diff --git a/modules/ve/init/ve.init.Platform.js
b/modules/ve/init/ve.init.Platform.js
index b9eba73..f443b5c 100644
--- a/modules/ve/init/ve.init.Platform.js
+++ b/modules/ve/init/ve.init.Platform.js
@@ -83,6 +83,7 @@
/**
* Get a parsed message as HTML string.
+ *
* Does not support $# replacements.
*
* @method
@@ -95,7 +96,7 @@
};
/**
- * Gets client platform string from browser.
+ * Get client platform string from browser.
*
* @method
* @abstract
@@ -106,7 +107,7 @@
};
/**
- * Gets the user language and any fallback languages.
+ * Get the user language and any fallback languages.
*
* @method
* @abstract
--
To view, visit https://gerrit.wikimedia.org/r/81111
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie55bb9e18f1524b706f0e195300170e4d552bf73
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits