jenkins-bot has submitted this change and it was merged.

Change subject: dm.ModelRegistry: Fix documentation for #addType
......................................................................


dm.ModelRegistry: Fix documentation for #addType

* Method is private.
* Code example and bullet list were rendered badly due to a
  single line break having no meaning in markdown (this makes
  80-char linebreaks easier). Need an empty line to separate block
  elements (e.g. paragraph from list, and list from next paragraph).
* Fixed #register reference to be a doc link instead. The invocation
  parenthesis look confusing (imply it needs no arguments).

Change-Id: Ib6cab4599ec3e310ec4355bdb1d60b1e53429c69
---
M modules/ve/dm/ve.dm.ModelRegistry.js
1 file changed, 22 insertions(+), 14 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve/dm/ve.dm.ModelRegistry.js 
b/modules/ve/dm/ve.dm.ModelRegistry.js
index 6550a8a..e63bdb0 100644
--- a/modules/ve/dm/ve.dm.ModelRegistry.js
+++ b/modules/ve/dm/ve.dm.ModelRegistry.js
@@ -9,7 +9,7 @@
 /**
  * Registry for models.
  *
- * To register a new model type, call ve.dm.modelRegistry.register()
+ * To register a new model type, call #register.
  *
  * @extends OO.Registry
  * @constructor
@@ -45,13 +45,17 @@
  * Objects and arrays are created if needed. You can specify one or more keys 
and a value.
  *
  * Specifically:
- * addType( obj, keyA, value ) does obj[keyA].unshift( value );
- * addType( obj, keyA, keyB, value ) does obj[keyA][keyB].unshift( value );
- * etc.
  *
- * @param {Object} obj Object to add to
+ * - `addType( obj, keyA, value )` does `obj[keyA].unshift( value );`
+ * - `addType( obj, keyA, keyB, value )` does `obj[keyA][keyB].unshift( value 
)`;
+ * - etc.
+ *
+ * @private
+ * @param {Object} obj Object the array resides in
+ * @param {string...} keys
+ * @param {Mixed} value
  */
-function addType( obj /*, ...*/ ) {
+function addType( obj ) {
        var i, len, o = obj;
        for ( i = 1, len = arguments.length - 2; i < len; i++ ) {
                if ( o[arguments[i]] === undefined ) {
@@ -160,16 +164,20 @@
  * Determine which model best matches the given element
  *
  * Model matching works as follows:
+ *
  * Get all models whose tag and rdfaType rules match
+ *
  * Rank them in order of specificity:
- * * tag, rdfaType and func specified
- * * rdfaType and func specified
- * * tag and func specified
- * * func specified
- * * tag and rdfaType specified
- * * rdfaType specified
- * * tag specified
- * * nothing specified
+ *
+ * - tag, rdfaType and func specified
+ * - rdfaType and func specified
+ * - tag and func specified
+ * - func specified
+ * - tag and rdfaType specified
+ * - rdfaType specified
+ * - tag specified
+ * - nothing specified
+ *
  * If there are multiple candidates with the same specificity, they are ranked 
in reverse order of
  * registration (i.e. if A was registered before B, B will rank above A).
  * The highest-ranking model whose test function does not return false, wins.

-- 
To view, visit https://gerrit.wikimedia.org/r/92820
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6cab4599ec3e310ec4355bdb1d60b1e53429c69
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to