Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/96233
Change subject: doc: Get rid of 'static' property container in jsduck index ...................................................................... doc: Get rid of 'static' property container in jsduck index Us grouping the inheritable static properties that way is an implementation detail that is polluting the index and makes it harder to refer to indivual identifiers. It also causes problems under JSDuck 5 because that version is more strict about defining properties (Foo.static.bar) of which the parent is not defined in the index (Foo.static), we'd have to add a sea of `@static @property {Object} this.static` all over the place. Might as well hide this implementation detail and just consider them static properties (just like we already do for "private" properties). Change-Id: Ibf2ebf7752aabc2b75b6ac6fa00e2284a181a600 --- M CONTRIBUTING.md M modules/oojs-ui/OO.ui.Window.js M modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js M modules/ve/ce/ve.ce.Annotation.js M modules/ve/ce/ve.ce.Node.js M modules/ve/ce/ve.ce.View.js M modules/ve/dm/ve.dm.Annotation.js M modules/ve/dm/ve.dm.MetaItem.js M modules/ve/dm/ve.dm.Model.js M modules/ve/dm/ve.dm.Node.js 10 files changed, 33 insertions(+), 46 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/33/96233/1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95e75bc..0bdef96 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -129,6 +129,7 @@ * @until Text: Optional text. * @source Text * @context {Type} Optional text. +* @inheritable * @param {Type} name Optional text. * @emits name * @returns {Type} Optional text. diff --git a/modules/oojs-ui/OO.ui.Window.js b/modules/oojs-ui/OO.ui.Window.js index c1f098e..bd0cae6 100644 --- a/modules/oojs-ui/OO.ui.Window.js +++ b/modules/oojs-ui/OO.ui.Window.js @@ -157,7 +157,7 @@ /** * Get the title of the window. * - * Use .static.titleMessage to set this unless you need to do something fancy. + * Use #titleMessage to set this unless you need to do something fancy. * @returns {string} Window title */ OO.ui.Window.prototype.getTitle = function () { @@ -187,7 +187,7 @@ /** * Set the title of the window. * - * @param {string} [customTitle] Custom title, override the static.titleMessage + * @param {string} [customTitle] Custom title, override the #titleMessage * @chainable */ OO.ui.Window.prototype.setTitle = function ( customTitle ) { diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js index 60a2ade..8f568da 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js @@ -43,7 +43,7 @@ /** * Name of the extension and the parser tag name. * @static - * @property {string} static.extensionName + * @property {string} * @inheritable */ ve.dm.MWExtensionNode.static.extensionName = null; diff --git a/modules/ve/ce/ve.ce.Annotation.js b/modules/ve/ce/ve.ce.Annotation.js index 24ac88d..ee1908b 100644 --- a/modules/ve/ce/ve.ce.Annotation.js +++ b/modules/ve/ce/ve.ce.Annotation.js @@ -43,8 +43,8 @@ * This should be set to true only for annotations that aren't continued by browsers but are in DM, * or the other way around, or those where behavior is inconsistent between browsers. * - * @property static.forceContinuation * @static + * @property * @inheritable */ ve.ce.Annotation.static.forceContinuation = false; diff --git a/modules/ve/ce/ve.ce.Node.js b/modules/ve/ce/ve.ce.Node.js index 3dac6c3..53764e5 100644 --- a/modules/ve/ce/ve.ce.Node.js +++ b/modules/ve/ce/ve.ce.Node.js @@ -42,7 +42,7 @@ * if splittable, and continue traversing up the tree and stop at the first non-splittable node. * * @static - * @property static.canBeSplit + * @property * @inheritable */ ve.ce.Node.static.canBeSplit = false; @@ -51,11 +51,12 @@ * Whether this node type can be focused. * * If this is set to true on a node, it should implement: + * * setFocused( boolean val ) * boolean isFocused() * * @static - * @property static.isFocusable + * @property * @inheritable */ ve.ce.Node.static.isFocusable = false; @@ -67,7 +68,6 @@ * * This method passes through to the model. * - * @method * @returns {string[]|null} List of node types allowed as children or null if any type is allowed */ ve.ce.Node.prototype.getChildNodeTypes = function () { @@ -79,7 +79,6 @@ * * This method passes through to the model. * - * @method * @returns {string[]|null} List of node types allowed as parents or null if any type is allowed */ ve.ce.Node.prototype.getParentNodeTypes = function () { @@ -91,7 +90,6 @@ * * This method passes through to the model. * - * @method * @returns {boolean} Model node can have children */ ve.ce.Node.prototype.canHaveChildren = function () { @@ -103,7 +101,6 @@ * * This method passes through to the model. * - * @method * @returns {boolean} Model node can have children but not content nor be content */ ve.ce.Node.prototype.canHaveChildrenNotContent = function () { @@ -115,7 +112,6 @@ * * This method passes through to the model. * - * @method * @returns {boolean} Model node is a wrapped element */ ve.ce.Node.prototype.isWrapped = function () { @@ -127,7 +123,6 @@ * * This method passes through to the model. * - * @method * @returns {boolean} Node can contain content */ ve.ce.Node.prototype.canContainContent = function () { @@ -139,7 +134,6 @@ * * This method passes through to the model. * - * @method * @returns {boolean} Node is content */ ve.ce.Node.prototype.isContent = function () { @@ -149,7 +143,7 @@ /** * Check if the node is focusable * - * @see #static.isFocusable + * @see #static-isFocusable * @returns {boolean} Node is focusable */ ve.ce.Node.prototype.isFocusable = function () { @@ -161,7 +155,6 @@ * * TODO: Figure out a way to remove the hard-coding for text nodes here. * - * @static * @method * @returns {boolean} Whether the node can have a slug before it */ @@ -175,7 +168,6 @@ /** * Check if the node can have a slug after it. * - * @static * @method * @returns {boolean} Whether the node can have a slug after it */ @@ -186,7 +178,6 @@ * * This method passes through to the model. * - * @method * @returns {number} Model length */ ve.ce.Node.prototype.getLength = function () { @@ -198,7 +189,6 @@ * * This method passes through to the model. * - * @method * @returns {number} Model outer length */ ve.ce.Node.prototype.getOuterLength = function () { @@ -218,7 +208,6 @@ /** * Check if the node can be split. * - * @method * @returns {boolean} Node can be split */ ve.ce.Node.prototype.canBeSplit = function () { @@ -228,7 +217,6 @@ /** * Get the closest splittable node upstream. * - * @method * @returns {ve.ce.Node} Closest splittable node */ ve.ce.Node.getSplitableNode = function ( node ) { @@ -248,8 +236,6 @@ /** * Release all memory. - * - * @method */ ve.ce.Node.prototype.destroy = function () { this.parent = null; diff --git a/modules/ve/ce/ve.ce.View.js b/modules/ve/ce/ve.ce.View.js index 20fcb80..1c8fa7a 100644 --- a/modules/ve/ce/ve.ce.View.js +++ b/modules/ve/ce/ve.ce.View.js @@ -65,7 +65,7 @@ /* Static members */ /** - * Allowed attributes for DOM elements, in the same format as ve.dm.Model#static.storeHtmlAttributes + * Allowed attributes for DOM elements, in the same format as ve.dm.Model#storeHtmlAttributes * * This list includes attributes that are generally safe to include in HTML loaded from a * foreign source and displaying it inside the browser. It doesn't include any event attributes, @@ -76,7 +76,7 @@ * sense for that view in particular. * * @static - * @property {boolean|string|RegExp|Array|Object} static.renderHtmlAttributes + * @property {boolean|string|RegExp|Array|Object} * @inheritable */ ve.ce.View.static.renderHtmlAttributes = [ diff --git a/modules/ve/dm/ve.dm.Annotation.js b/modules/ve/dm/ve.dm.Annotation.js index 3baeb34..44a8a29 100644 --- a/modules/ve/dm/ve.dm.Annotation.js +++ b/modules/ve/dm/ve.dm.Annotation.js @@ -36,7 +36,7 @@ * About grouping is not supported for annotations; setting this to true has no effect. * * @static - * @property {boolean} static.enableAboutGrouping + * @property {boolean} * @inheritable */ ve.dm.Annotation.static.enableAboutGrouping = false; @@ -44,7 +44,7 @@ /** * Automatically apply annotation to content inserted after it. * - * @type {boolean} + * @property {boolean} */ ve.dm.Annotation.static.applyToAppendedContent = true; diff --git a/modules/ve/dm/ve.dm.MetaItem.js b/modules/ve/dm/ve.dm.MetaItem.js index 82ea8ef..0736902 100644 --- a/modules/ve/dm/ve.dm.MetaItem.js +++ b/modules/ve/dm/ve.dm.MetaItem.js @@ -41,7 +41,7 @@ * Symbolic name for the group this meta item type will be grouped in in ve.dm.MetaList. * * @static - * @property {string} [static.group='misc'] + * @property * @inheritable */ ve.dm.MetaItem.static.group = 'misc'; @@ -77,7 +77,7 @@ /** * Get the group this meta item belongs to. - * @see ve.dm.MetaItem#static.group + * @see #static-group * @returns {string} Group */ ve.dm.MetaItem.prototype.getGroup = function () { diff --git a/modules/ve/dm/ve.dm.Model.js b/modules/ve/dm/ve.dm.Model.js index d12d965..4f778fd 100644 --- a/modules/ve/dm/ve.dm.Model.js +++ b/modules/ve/dm/ve.dm.Model.js @@ -31,7 +31,7 @@ /** * Symbolic name for this model class. Must be set to a unique string by every subclass. * @static - * @property {string} [static.name=null] + * @property {string} * @inheritable */ ve.dm.Model.static.name = null; @@ -41,7 +41,7 @@ * Empty array means none, null means any. * For more information about element matching, see ve.dm.ModelRegistry. * @static - * @property {string[]} static.matchTagNames + * @property {string[]} * @inheritable */ ve.dm.Model.static.matchTagNames = null; @@ -51,7 +51,7 @@ * Empty array means none, null means any. * For more information about element matching, see ve.dm.ModelRegistry. * @static - * @property {Array} static.matchRdfaType Array of strings or regular expressions + * @property {Array} * @inheritable */ ve.dm.Model.static.matchRdfaTypes = null; @@ -68,7 +68,7 @@ * NOTE: This function is NOT a method, within this function "this" will not refer to an instance * of this class (or to anything reasonable, for that matter). * @static - * @property {Function} static.matchFunction + * @property {Function} * @inheritable */ ve.dm.Model.static.matchFunction = null; @@ -168,7 +168,7 @@ * be childless. * * @static - * @property {boolean} static.enableAboutGrouping + * @property {boolean} * @inheritable */ ve.dm.Model.static.enableAboutGrouping = false; @@ -198,7 +198,7 @@ * do not match the blacklist will be preserved. * * @static - * @property {boolean|string|RegExp|Array|Object} static.storeHtmlAttributes + * @property {boolean|string|RegExp|Array|Object} * @inheritable */ ve.dm.Model.static.storeHtmlAttributes = true; @@ -209,7 +209,7 @@ * Determine whether an attribute name matches an attribute specification. * * @param {string} attribute Attribute name - * @param {boolean|string|RegExp|Array|Object} spec Attribute specification, see ve.dm.Model.static.storeHtmlAttributes + * @param {boolean|string|RegExp|Array|Object} spec Attribute specification, see #storeHtmlAttributes * @returns {boolean} Attribute matches spec */ ve.dm.Model.matchesAttributeSpec = function ( attribute, spec ) { diff --git a/modules/ve/dm/ve.dm.Node.js b/modules/ve/dm/ve.dm.Node.js index 14c75d7..a52de15 100644 --- a/modules/ve/dm/ve.dm.Node.js +++ b/modules/ve/dm/ve.dm.Node.js @@ -63,7 +63,7 @@ * If .static.childNodeTypes is set to [], this property is ignored and will be assumed to be true. * * @static - * @property {boolean} static.handlesOwnChildren + * @property {boolean} * @inheritable */ ve.dm.Node.static.handlesOwnChildren = false; @@ -72,7 +72,7 @@ * Whether this node type is internal. Internal node types are ignored by the converter. * * @static - * @property {boolean} static.isInternal + * @property {boolean} * @inheritable */ ve.dm.Node.static.isInternal = false; @@ -82,7 +82,7 @@ * only special node types are not wrapped. * * @static - * @property {boolean} static.isWrapped + * @property {boolean} * @inheritable */ ve.dm.Node.static.isWrapped = true; @@ -93,7 +93,7 @@ * also known as inline nodes. * * @static - * @property {boolean} static.isContent + * @property {boolean} * @inheritable */ ve.dm.Node.static.isContent = false; @@ -103,7 +103,7 @@ * content nodes. * * @static - * @property {boolean} static.canContainContent + * @property {boolean} * @inheritable */ ve.dm.Node.static.canContainContent = false; @@ -116,7 +116,7 @@ * stripping and preservation. * * @static - * @property {boolean} static.hasSignificantWhitespace + * @property {boolean} * @inheritable */ ve.dm.Node.static.hasSignificantWhitespace = false; @@ -127,7 +127,7 @@ * An empty array means no children are allowed. null means any node type is allowed as a child. * * @static - * @property {string[]|null} static.childNodeTypes + * @property {string[]|null} * @inheritable */ ve.dm.Node.static.childNodeTypes = null; @@ -139,7 +139,7 @@ * can be the child of any node type. * * @static - * @property {string[]|null} static.parentNodeTypes + * @property {string[]|null} * @inheritable */ ve.dm.Node.static.parentNodeTypes = null; @@ -153,7 +153,7 @@ * can be the child of any node type. * * @static - * @property {string[]|null} static.suggestedParentNodeTypes + * @property {string[]|null} * @inheritable */ ve.dm.Node.static.suggestedParentNodeTypes = null; @@ -162,7 +162,7 @@ * Array of annotation types which can't be applied to this node * * @static - * @property {string[]} static.blacklistedAnnotationTypes + * @property {string[]} * @inheritable */ ve.dm.Node.static.blacklistedAnnotationTypes = []; @@ -176,7 +176,7 @@ * Attributes may be omitted, in which case they'll simply be undefined. * * @static - * @property {Object} static.defaultAttributes + * @property {Object} * @inheritable */ ve.dm.Node.static.defaultAttributes = {}; -- To view, visit https://gerrit.wikimedia.org/r/96233 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf2ebf7752aabc2b75b6ac6fa00e2284a181a600 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits