From d137689b34f1cca1fdc634db7161833787aaa0e3 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Tue, 29 Apr 2014 11:31:16 -0700 Subject: [PATCH] Fix for jsduck 5.x, rearrange categories Should make for a nicer documentation experience. Change-Id: I935cbab2b06c8cf482d3987905d2257d09bea3a3 --- docs/categories.json | 97 +++++++++++++++++++ docs/jsduck-config.json | 1 + resources/mmv/model/mmv.model.License.js | 8 +- .../mmv.provider.GuessedThumbnailInfo.js | 2 +- resources/mmv/ui/mmv.ui.canvas.js | 4 +- 5 files changed, 105 insertions(+), 7 deletions(-) create mode 100644 docs/categories.json diff --git a/docs/categories.json b/docs/categories.json new file mode 100644 index 000000000..eeecc2557 --- /dev/null +++ b/docs/categories.json @@ -0,0 +1,97 @@ +[ + { + "name": "Media Viewer classes", + "groups": [ + { + "name": "Base", + "classes": [ + "mw.mmv.Api", + "mw.mmv.EmbedFileFormatter", + "mw.mmv.HtmlUtils", + "mw.mmv.LightboxImage", + "mw.mmv.LightboxInterface", + "mw.mmv.Logger", + "mw.mmv.MultimediaViewer", + "mw.mmv.MultimediaViewerBootstrap", + "mw.mmv.Performance", + "mw.mmv.ThumbnailWidthCalculator" + ] + }, + { + "name": "Models", + "classes": [ + "mw.mmv.model.*" + ] + }, + { + "name": "Providers", + "classes": [ + "mw.mmv.provider.*" + ] + }, + { + "name": "Routers", + "classes": [ + "mw.mmv.routing.*" + ] + }, + { + "name": "Interface", + "classes": [ + "mw.mmv.ui.*" + ] + } + ] + }, + + { + "name": "External", + "groups": [ + { + "name": "jQuery", + "classes": [ + "jQuery", + "jQuery.Promise", + "jQuery.Deferred", + "jQuery.Event", + "jqXHR" + ] + }, + { + "name": "JavaScript natives", + "classes": [ + "Array", + "Boolean", + "Date", + "Function", + "Number", + "Object", + "RegExp", + "String" + ] + }, + { + "name": "OOUI", + "classes": [ + "OO.ui.*" + ] + }, + { + "name": "MediaWiki", + "classes": [ + "mw", + "mw.Api", + "mw.Title" + ] + }, + { + "name": "Browser native classes", + "classes": [ + "HTMLElement", + "HTMLImageElement", + "XMLHttpRequest" + ] + } + ] + } +] diff --git a/docs/jsduck-config.json b/docs/jsduck-config.json index 32d795c0a..e078f3d75 100644 --- a/docs/jsduck-config.json +++ b/docs/jsduck-config.json @@ -1,5 +1,6 @@ { "--title": "MultimediaViewer extension documentation", + "--categories": "./categories.json", "--footer": "Documentation for MultimediaViewer, an extension to MediaWiki. Generated on {DATE} by {JSDUCK} {VERSION}.", "--builtin-classes": true, "--output": "./js", diff --git a/resources/mmv/model/mmv.model.License.js b/resources/mmv/model/mmv.model.License.js index 7db9ee8a3..abe651f41 100644 --- a/resources/mmv/model/mmv.model.License.js +++ b/resources/mmv/model/mmv.model.License.js @@ -22,10 +22,10 @@ * Class for storing license information about an image. For available fields, see * TemplateParser::$licenseFieldClasses in the CommonsMetadata extension. * @class mw.mmv.model.License - * @param {string} shortName see {@link License#shortName} - * @param {string} [internalName] see {@link License#internalName} - * @param {string} [longName] see {@link License#longName} - * @param {string} [deedUrl] see {@link License#deedUrl} + * @param {string} shortName see {@link #shortName} + * @param {string} [internalName] see {@link #internalName} + * @param {string} [longName] see {@link #longName} + * @param {string} [deedUrl] see {@link #deedUrl} * @constructor */ function License( diff --git a/resources/mmv/provider/mmv.provider.GuessedThumbnailInfo.js b/resources/mmv/provider/mmv.provider.GuessedThumbnailInfo.js index 9756864a7..d5b929a49 100644 --- a/resources/mmv/provider/mmv.provider.GuessedThumbnailInfo.js +++ b/resources/mmv/provider/mmv.provider.GuessedThumbnailInfo.js @@ -17,7 +17,7 @@ ( function( mw, $ ) { /** - * @class mw.mmv.proivder.GuessedThumbnailInfo + * @class mw.mmv.provider.GuessedThumbnailInfo * This provider is similar to mw.mmv.provider.ThumbnailInfo, but instead of making an API call * to get the thumbnail URL, it tries to guess it. There are two failure modes: * - known failure: in the given situation it does not seem possible or safe to guess the URL. diff --git a/resources/mmv/ui/mmv.ui.canvas.js b/resources/mmv/ui/mmv.ui.canvas.js index e08f5ec4f..9793b02d9 100644 --- a/resources/mmv/ui/mmv.ui.canvas.js +++ b/resources/mmv/ui/mmv.ui.canvas.js @@ -74,14 +74,14 @@ /** * Maximum blownup factor tolerated - * @property mw.mmv.ui.Canvas.MAX_BLOWUP_FACTOR + * @property MAX_BLOWUP_FACTOR * @static */ Canvas.MAX_BLOWUP_FACTOR = 11; /** * Blowup factor threshold at which blurring kicks in - * @property mw.mmv.ui.Canvas.BLUR_BLOWUP_FACTOR_THRESHOLD + * @property BLUR_BLOWUP_FACTOR_THRESHOLD * @static */ Canvas.BLUR_BLOWUP_FACTOR_THRESHOLD = 2;