JSDuck-ify /resources/mediawiki.special/*
authorTimo Tijhof <krinklemail@gmail.com>
Sun, 27 Apr 2014 15:40:18 +0000 (17:40 +0200)
committerJames D. Forrester <jforrester@wikimedia.org>
Sun, 4 May 2014 04:16:18 +0000 (21:16 -0700)
- Adds mw.special.recentchanges to the index.
- Adds mw.special.upload to the index.
- Register File as valid value type. Relates to the
  "File" interface (from HTML5 File APIs; http://dev.w3.org/2006/webapi/FileAPI/#dfn-file)
- Sort directories in jsduck/config.json alphabetically.

Change-Id: I282cbeeec60b9f527879aedd90ba824a833438b7

25 files changed:
maintenance/jsduck/categories.json
maintenance/jsduck/config.json
resources/src/mediawiki.special/mediawiki.special.block.css
resources/src/mediawiki.special/mediawiki.special.block.js
resources/src/mediawiki.special/mediawiki.special.changeemail.css
resources/src/mediawiki.special/mediawiki.special.changeemail.js
resources/src/mediawiki.special/mediawiki.special.changeslist.css
resources/src/mediawiki.special/mediawiki.special.changeslist.enhanced.css
resources/src/mediawiki.special/mediawiki.special.changeslist.legend.css
resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
resources/src/mediawiki.special/mediawiki.special.css
resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js
resources/src/mediawiki.special/mediawiki.special.js
resources/src/mediawiki.special/mediawiki.special.movePage.js
resources/src/mediawiki.special/mediawiki.special.preferences.css
resources/src/mediawiki.special/mediawiki.special.preferences.js
resources/src/mediawiki.special/mediawiki.special.recentchanges.js
resources/src/mediawiki.special/mediawiki.special.search.css
resources/src/mediawiki.special/mediawiki.special.search.js
resources/src/mediawiki.special/mediawiki.special.undelete.js
resources/src/mediawiki.special/mediawiki.special.upload.js
resources/src/mediawiki.special/mediawiki.special.userlogin.common.css
resources/src/mediawiki.special/mediawiki.special.userlogin.common.js
resources/src/mediawiki.special/mediawiki.special.userlogin.signup.js
resources/src/mediawiki.special/mediawiki.special.version.css

index 2d45645..69b04ce 100644 (file)
                                        "mw.Feedback"
                                ]
                        },
+                       {
+                               "name": "Special",
+                               "classes": [
+                                       "mw.special*"
+                               ]
+                       },
                        {
                                "name": "Development",
                                "classes": [
index 65ead02..eed76b6 100644 (file)
@@ -6,16 +6,17 @@
        "--warnings": ["-nodoc(class,public)"],
        "--builtin-classes": true,
        "--warnings-exit-nonzero": true,
-       "--external": "HTMLElement,HTMLDocument,Window",
+       "--external": "HTMLElement,HTMLDocument,Window,File",
        "--footer": "Documentation for MediaWiki core. Generated on {DATE} by {JSDUCK} {VERSION}.",
        "--output": "../../docs/js",
        "--": [
                "./external.js",
                "../../resources/src/mediawiki",
                "../../resources/src/mediawiki.action",
-               "../../resources/src/mediawiki.page",
                "../../resources/src/mediawiki.api",
                "../../resources/src/mediawiki.language",
+               "../../resources/src/mediawiki.page",
+               "../../resources/src/mediawiki.special",
                "../../resources/src/jquery/jquery.accessKeyLabel.js",
                "../../resources/src/jquery/jquery.arrowSteps.js",
                "../../resources/src/jquery/jquery.autoEllipsis.js",
index 9461fbd..92983df 100644 (file)
@@ -6,7 +6,7 @@
        border-top-right-radius: 0.8em;
 }
 
-/** colors also used in mediawiki.special.preferences.css */
+/* Colors also used in mediawiki.special.preferences.css */
 #mw-emailaddress-validity.valid {
        border: 1px solid #80FF80;
        background-color: #C0FFC0;
index bc2a0a2..67531f7 100644 (file)
@@ -1,9 +1,10 @@
-/**
+/*!
  * JavaScript for Special:ChangeEmail
  */
 ( function ( mw, $ ) {
        /**
         * Given an email validity status (true, false, null) update the label CSS class
+        * @ignore
         */
        function updateMailValidityLabel( mail ) {
                var isValid = mw.util.validateEmail( mail ),
index 446e1f9..0e026af 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*!
  * Styling for Special:Watchlist and Special:RecentChanges when preference 'usenewrc'
  * a.k.a. Enhanced Recent Changes is enabled.
  */
index ea00960..4ec5ffa 100644 (file)
@@ -1,4 +1,4 @@
-/**** Special:AllMessages ****/
+/* Special:AllMessages */
 #mw-allmessagestable .allmessages-customised td.am_default {
        background-color: #fcffc4;
 }
@@ -15,7 +15,7 @@
        background-color: #b1ffb1;
 }
 
-/**** Special:Allpages ****/
+/* Special:Allpages */
 table.mw-allpages-table-form, table.mw-allpages-table-chunk {
        width: 100%;
 }
@@ -30,30 +30,30 @@ table.mw-allpages-table-form tr {
        vertical-align: top;
 }
 
-/**** Special:Block ****/
+/* Special:Block */
 tr.mw-block-hideuser {
        font-weight: bold;
 }
 
-/**** Special:BlockList ****/
+/* Special:BlockList */
 table.mw-blocklist span.mw-usertoollinks,
 span.mw-blocklist-actions {
        white-space: nowrap;
        font-size: 90%;
 }
 
-/**** Special:Contributions ****/
+/* Special:Contributions */
 .mw-uctop {
        font-weight: bold;
 }
 
-/**** Special:EmailUser ****/
+/* Special:EmailUser */
 td#mw-emailuser-sender,
 td#mw-emailuser-recipient {
        font-weight: bold;
 }
 
-/**** Special:ListGroupRights ****/
+/* Special:ListGroupRights */
 table.mw-listgrouprights-table tr {
        vertical-align: top;
 }
@@ -61,7 +61,7 @@ table.mw-listgrouprights-table tr {
        text-decoration: line-through;
 }
 
-/**** Special:Prefixindex ****/
+/* Special:Prefixindex */
 table.mw-prefixindex-list-table,
 table#mw-prefixindex-nav-table {
        width: 100%;
@@ -75,7 +75,7 @@ td#mw-prefixindex-nav-form {
 }
 
 
-/**** Special:Search ****/
+/* Special:Search */
 .searchresults {
 }
 
@@ -241,7 +241,7 @@ form#powersearch {
        clear: both;
 }
 
-/**** Special:Specialpages ****/
+/* Special:Specialpages */
 .mw-specialpagerestricted {
        font-weight: bold;
 }
@@ -255,12 +255,12 @@ form#powersearch {
        vertical-align: top;
 }
 
-/**** Special:Statistics ****/
+/* Special:Statistics */
 td.mw-statistics-numbers {
        text-align: right;
 }
 
-/**** Special:ProtectedPages ****/
+/* Special:ProtectedPages */
 table.mw-protectedpages span.mw-usertoollinks,
 span.mw-protectedpages-length,
 span.mw-protectedpages-actions {
@@ -272,7 +272,7 @@ span.mw-protectedpages-unknown {
        font-size: 90%;
 }
 
-/**** Special:UserRights ****/
+/* Special:UserRights */
 .mw-userrights-disabled {
        color: #888;
 }
index 8edb1cb..630d162 100644 (file)
@@ -1,5 +1,9 @@
-/*
+/*!
  * Namespace for mediawiki.special.* modules
  */
 
+/**
+ * @class mw.special
+ * @singleton
+ */
 mediaWiki.special = {};
index 75ae5ca..afb0905 100644 (file)
@@ -1,16 +1,16 @@
-/** Reuses colors from mediawiki.special.changeemail.css */
+/* Reuses colors from mediawiki.special.changeemail.css */
 .mw-email-not-authenticated .mw-input,
 .mw-email-none .mw-input{
        border: 1px solid #FF8080;
        background-color: #FFC0C0;
        color: black;
 }
-/** Authenticated email field has its own class too. Unstyled by default */
+/* Authenticated email field has its own class too. Unstyled by default */
 /*
 .mw-email-authenticated .mw-input { }
 */
 
-/**
+/*
  * Hide, but keep accessible for screen-readers.
  * Like .mw-jump, #jump-to-nav from skins/common/shared.css
  */
index 2cd27af..d0569bd 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*!
  * JavaScript for Special:Preferences
  */
 jQuery( function ( $ ) {
@@ -46,9 +46,10 @@ jQuery( function ( $ ) {
        /**
         * It uses document.getElementById for security reasons (HTML injections in $()).
         *
+        * @ignore
         * @param String name: the name of a tab without the prefix ("mw-prefsection-")
         * @param String mode: [optional] A hash will be set according to the current
-        * open section. Set mode 'noHash' to surpress this.
+        *  open section. Set mode 'noHash' to surpress this.
         */
        function switchPrefTab( name, mode ) {
                var $tab, scrollTop;
@@ -159,10 +160,8 @@ jQuery( function ( $ ) {
                } );
        }
 
-       /**
-       * Timezone functions.
-       * Guesses Timezone from browser and updates fields onchange
-       */
+       // Timezone functions.
+       // Guesses Timezone from browser and updates fields onchange.
 
        $tzSelect = $( '#mw-input-wptimecorrection' );
        $tzTextbox = $( '#mw-input-wptimecorrection-other' );
index 79d793a..d43b62b 100644 (file)
@@ -1,9 +1,13 @@
-/**
+/*!
  * JavaScript for Special:RecentChanges
  */
 ( function ( mw, $ ) {
        var rc, $checkboxes, $select;
 
+       /**
+        * @class mw.special.recentchanges
+        * @singleton
+        */
        rc = {
                /**
                 * Handler to disable/enable the namespace selector checkboxes when the
@@ -17,6 +21,7 @@
                        $checkboxes.prop( 'disabled', isAllNS );
                },
 
+               /** */
                init: function () {
                        $select = $( '#namespace' );
                        $checkboxes = $( '#nsassociated, #nsinvert' );
index 914e47e..f6ed82c 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Fixes sister projects box moving down the extract
  * of the first result (bug #16886).
  * It only happens when the window is small and
index 8a5ff59..3c7ad52 100644 (file)
@@ -1,11 +1,14 @@
 /**
  * JavaScript for Special:Upload
+ *
  * Note that additional code still lives in skins/common/upload.js
+ *
+ * @private
+ * @class mw.special.upload
+ * @singleton
  */
 ( function ( mw, $ ) {
-       /**
-        * Add a preview to the upload form
-        */
+       // Add a preview to the upload form
        $( function () {
                /**
                 * Is the FileAPI available with sufficient functionality?
@@ -18,8 +21,9 @@
                 * Check if this is a recognizable image type...
                 * Also excludes files over 10M to avoid going insane on memory usage.
                 *
-                * @todo is there a way we can ask the browser what's supported in <img>s?
-                * @todo put SVG back after working around Firefox 7 bug <https://bugzilla.wikimedia.org/show_bug.cgi?id=31643>
+                * TODO: Is there a way we can ask the browser what's supported in `<img>`s?
+                *
+                * TODO: Put SVG back after working around Firefox 7 bug <https://bugzilla.wikimedia.org/show_bug.cgi?id=31643>
                 *
                 * @param {File} file
                 * @return boolean
                 * in browsers supporting HTML5 FileAPI.
                 *
                 * As of this writing, known good:
+                *
                 * - Firefox 3.6+
                 * - Chrome 7.something
                 *
-                * @todo check file size limits and warn of likely failures
+                * TODO: Check file size limits and warn of likely failures
                 *
                 * @param {File} file
                 */
                 * to do preprocessing on the binary data first.
                 *
                 * @param {File} file
-                * @param {function} callback
-                * @param {function} callbackBinary
+                * @param {Function} callback
+                * @param {Function} callbackBinary
                 */
                function fetchPreview( file, callback, callbackBinary ) {
                        var reader = new FileReader();
 
                /**
                 * Format a file size attractively.
-                * @todo match numeric formatting
+                *
+                * TODO: Match numeric formatting
                 *
                 * @param {number} s
-                * @return string
+                * @return {string}
                 */
                function prettySize( s ) {
                        var sizeMsgs = ['size-bytes', 'size-kilobytes', 'size-megabytes', 'size-gigabytes'];
                        return true;
                }
 
-               /**
-                * Initialization
-                */
+               /* Initialization */
                if ( hasFileAPI() ) {
                        // Update thumbnail when the file selection control is updated.
                        $( '#wpUploadFile' ).change( function () {
                }
        } );
 
-       /**
-        * Disable all upload source fields except the selected one
-        */
+       // Disable all upload source fields except the selected one
        $( function () {
                var i, $row,
                        $rows = $( '.mw-htmlform-field-UploadSourceField' );
 
+               /**
+                * @param {jQuery} $currentRow
+                * @return {Function} Handler
+                * @return {jQuery.Event} return.e
+                */
                function createHandler( $currentRow ) {
-                       /**
-                        * @param {jQuery.Event}
-                        */
                        return function () {
                                $( '.mw-upload-source-error' ).remove();
                                if ( this.checked ) {
index d5fd2b8..b66f20e 100644 (file)
@@ -33,7 +33,7 @@ section.mw-form-header {
        margin-bottom: 10px;
 }
 
-/**** shuffled CAPTCHA ****/
+/* shuffled CAPTCHA */
 #wpCaptchaWord {
        margin-top: 6px;
 }
index c3d0238..764e377 100644 (file)
@@ -1,6 +1,6 @@
-/**
- * Adds additional styling to the extension title/version list
-**/
+/*!
+ * Styling for Special:Version
+ */
 .mw-version-ext-name {
        font-weight: bold;
 }