mediawiki.Title: Fix typo "add" in documentation
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 4 Feb 2016 20:04:23 +0000 (21:04 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 4 Feb 2016 20:55:16 +0000 (21:55 +0100)
Follows-up 3d14628237.

* Put @class after the description for consistency with other
  classes and methods.
* Remove jscs:disable rule which was there for the illegal
  @constructor use (descriptions must go before a tag, not after).
  However JSDuck doesn't support descriptions before @constructor.
  It supports it with all other tags, however.

  It turns out, that @constructor doesn't support this because
  it is deprecated and predates that feature in JSDuck. Upstream
  documentation encourages authors to use @method instead.

Change-Id: Iba9fa5ae1fc8ece9ddff4aef8a3b4b59768fcaf0

resources/src/mediawiki/mediawiki.Title.js

index ec2a4b1..ffb3041 100644 (file)
@@ -6,17 +6,15 @@
 ( function ( mw, $ ) {
        /*jshint latedef:false */
 
-       // jscs:disable jsDoc
        /**
-        * @class mw.Title
-        *
         * Parse titles into an object structure. Note that when using the constructor
         * directly, passing invalid titles will result in an exception. Use #newFromText to use the
         * logic directly and get null for invalid titles which is easier to work with.
         *
-        * @constructor
-        *
-        * Note that in the constructor amd #newFromText method, `namespace` is the **default** namespace
+        * @class mw.Title
+        */
+       /**
+        * Note that in the constructor and #newFromText method, `namespace` is the **default** namespace
         * only, and can be overridden by a namespace prefix in `title`. If you do not want this behavior,
         * use #makeTitle. Compare:
         *
@@ -32,6 +30,7 @@
         *     mw.Title.newFromText( 'Template:Foo', NS_TEMPLATE ).getPrefixedText(); // => 'Template:Foo'
         *     mw.Title.makeTitle( NS_TEMPLATE, 'Template:Foo' ).getPrefixedText();   // => 'Template:Template:Foo'
         *
+        * @method constructor
         * @param {string} title Title of the page. If no second argument given,
         *  this will be searched for a namespace
         * @param {number} [namespace=NS_MAIN] If given, will used as default namespace for the given title
@@ -50,7 +49,6 @@
 
                return this;
        }
-       // jscs:enable jsDoc
 
        /* Private members */