From 7962ba87a500ae41ef57025e80c7eb508ddae8f7 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Mon, 20 Aug 2018 16:40:40 -0700 Subject: [PATCH] Docs: Present classes rather than modules Use classes rather than modules for the various Views inside Minerva. Change-Id: I849ae50e48c01012ba6713ec3bf5f1c836ef22bc --- .../BackToTopOverlay.js | 7 +++++- resources/skins.minerva.mainMenu/MainMenu.js | 14 ++++++++++-- .../skins.minerva.newusers/PointerOverlay.js | 11 ++++++++-- .../NotificationBadge.js | 22 +++++++++++++++---- .../skins.minerva.scripts/DownloadIcon.js | 10 ++++++++- 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/resources/skins.minerva.backtotop/BackToTopOverlay.js b/resources/skins.minerva.backtotop/BackToTopOverlay.js index ca6f756..9d2cd6e 100644 --- a/resources/skins.minerva.backtotop/BackToTopOverlay.js +++ b/resources/skins.minerva.backtotop/BackToTopOverlay.js @@ -6,7 +6,6 @@ * Displays a little arrow at the bottom right of the viewport. * @class BackToTopOverlay * @extends View - * @module skins.minerva.backtotop/BackToTopOverlay */ function BackToTopOverlay() { View.apply( this, arguments ); @@ -21,6 +20,8 @@ /** * Show the back to top element, if it's not visible already. + * @memberof BackToTopOverlay + * @instance */ show: function () { this.$el.css( 'visibility', 'visible' ).addClass( 'visible' ); @@ -28,6 +29,8 @@ /** * Hide the back to top element, if it's visible. + * @memberof BackToTopOverlay + * @instance */ hide: function () { this.$el.removeClass( 'visible' ); @@ -36,6 +39,8 @@ /** * Handles the click on the "Back to top" element and scrolls back * to the top smoothly. + * @memberof BackToTopOverlay + * @instance */ onBackToTopClick: function () { $( 'html, body' ).animate( { scrollTop: 0 }, 400 ); diff --git a/resources/skins.minerva.mainMenu/MainMenu.js b/resources/skins.minerva.mainMenu/MainMenu.js index bbb881c..83a2b23 100644 --- a/resources/skins.minerva.mainMenu/MainMenu.js +++ b/resources/skins.minerva.mainMenu/MainMenu.js @@ -7,9 +7,7 @@ * * @class MainMenu * @extends View - * @constructor * @param {Object} options Configuration options - * @module skins.minerva.mainMenu/MainMenu */ function MainMenu( options ) { this.activator = options.activator; @@ -34,6 +32,8 @@ /** * Turn on event logging on the existing main menu by reading `event-name` data * attributes on elements. + * @memberof MainMenu + * @instance */ enableLogging: function () { // Load the EventLogging module inside MobileFrontend if available @@ -51,6 +51,8 @@ }, /** * Remove the nearby menu entry if the browser doesn't support geo location + * @memberof MainMenu + * @instance */ postRender: function () { if ( !browser.supportsGeoLocation() ) { @@ -62,6 +64,8 @@ /** * Registers events for opening and closing the main menu + * @memberof MainMenu + * @instance */ registerClickEvents: function () { var self = this; @@ -83,6 +87,8 @@ /** * Check whether the navigation drawer is open + * @memberof MainMenu + * @instance * @return {boolean} */ isOpen: function () { @@ -92,6 +98,8 @@ /** * Close all open navigation drawers + * @memberof MainMenu + * @instance */ closeNavigationDrawers: function () { // FIXME: We should be moving away from applying classes to the body @@ -105,6 +113,8 @@ * @param {string} [drawerType] A name that identifies the navigation drawer that * should be toggled open. Defaults to 'primary'. * @fires MainMenu#open + * @memberof MainMenu + * @instance */ openNavigationDrawer: function ( drawerType ) { // close any existing ones first. diff --git a/resources/skins.minerva.newusers/PointerOverlay.js b/resources/skins.minerva.newusers/PointerOverlay.js index 8f7b794..b5b29eb 100644 --- a/resources/skins.minerva.newusers/PointerOverlay.js +++ b/resources/skins.minerva.newusers/PointerOverlay.js @@ -6,7 +6,6 @@ /** * Page overlay prompting a user for given action * @class PointerOverlay - * @module skins.minerva.newusers/PointerOverlay */ function PointerOverlay() { Overlay.apply( this, arguments ); @@ -30,6 +29,8 @@ * @cfg {string} defaults.target jQuery selector to point tutorial at * @cfg {string} [defaults.alignment] Determines where the pointer should point to. Valid values 'left' or 'center' * @cfg {string} [defaults.confirmMsg] Label for a confirm message. + * @memberof PointerOverlay + * @instance */ defaults: $.extend( {}, Overlay.prototype.defaults, { summary: undefined, @@ -74,6 +75,8 @@ * Refreshes the pointer arrow. * @method * @param {string} target jQuery selector + * @memberof PointerOverlay + * @instance */ refreshPointerArrow: function ( target ) { this.$pointer.remove(); @@ -82,6 +85,8 @@ /** * Position the overlay under a specified element * @private + * @memberof PointerOverlay + * @instance * @param {JQuery.Object} $pa An element that should be pointed at by the overlay */ _position: function ( $pa ) { @@ -98,7 +103,9 @@ }, /** * Position overlay and add pointer arrow that points at specified element - * @method + * + * @memberof PointerOverlay + * @instance * @param {JQuery.Object} $pa An element that should be pointed at by the overlay */ addPointerArrow: function ( $pa ) { diff --git a/resources/skins.minerva.notifications.badge/NotificationBadge.js b/resources/skins.minerva.notifications.badge/NotificationBadge.js index 5fe5b3e..7b2ca7b 100644 --- a/resources/skins.minerva.notifications.badge/NotificationBadge.js +++ b/resources/skins.minerva.notifications.badge/NotificationBadge.js @@ -11,10 +11,7 @@ * A notification button for communicating with an NotificationOverlay * @class NotificationButton * @extends View - * - * @constructor * @param {Object} options Configuration options - * @module skins.minerva.notifications/NotificationBadge */ function NotificationBadge( options ) { var $el, @@ -46,7 +43,9 @@ * @cfg {string} defaults.loadingIconHtml for spinner * @cfg {boolean} defaults.hasUnseenNotifications whether the user has unseen notifications * @cfg {number} defaults.notificationCountRaw number of unread notifications - */ + * @memberof NotificationBadge + * @instance + */ defaults: { notificationIconClass: notificationIcon.getClassName(), loadingIconHtml: icons.spinner().toHtmlString(), @@ -59,6 +58,8 @@ * Loads a ResourceLoader module script. Shows ajax loader whilst loading. * @method * @private + * @memberof NotificationBadge + * @instance * @param {string} moduleName Name of a module to fetch * @return {JQuery.Deferred} */ @@ -75,6 +76,8 @@ * Load the notification overlay. * @method * @private + * @memberof NotificationBadge + * @instance * @uses NotificationsOverlay * @return {JQuery.Deferred} with an instance of NotificationsOverlay */ @@ -92,6 +95,8 @@ /** * Sets up routes in overlay manager and click behaviour for NotificationBadge * This is not unit tested as it's behaviour is covered by browser tests. + * @memberof NotificationBadge + * @instance * @private */ _bindOverlayManager: function () { @@ -116,6 +121,8 @@ template: mw.template.get( 'skins.minerva.notifications.badge', 'badge.hogan' ), /** * Click handler for clicking on the badge + * @memberof NotificationBadge + * @instance * @return {boolean} */ onClickBadge: function () { @@ -126,6 +133,8 @@ }, /** * Return the URL for the full non-overlay notification view + * @memberof NotificationBadge + * @instance * @return {string} url */ getNotificationURL: function () { @@ -133,6 +142,8 @@ }, /** * Update the notification count + * @memberof NotificationBadge + * @instance * @param {number} count */ setCount: function ( count ) { @@ -148,6 +159,9 @@ }, /** * Marks all notifications as seen + * + * @memberof NotificationBadge + * @instance */ markAsSeen: function () { this.options.hasUnseenNotifications = false; diff --git a/resources/skins.minerva.scripts/DownloadIcon.js b/resources/skins.minerva.scripts/DownloadIcon.js index 060ee84..863b814 100644 --- a/resources/skins.minerva.scripts/DownloadIcon.js +++ b/resources/skins.minerva.scripts/DownloadIcon.js @@ -36,7 +36,6 @@ * @param {number[]} [supportedNamespaces] * @param {Window} [windowObj] window object * @constructor - * @module skins.minerva.scripts/DownloadIcon */ function DownloadIcon( skin, supportedNamespaces, windowObj ) { var options = {}; @@ -53,6 +52,9 @@ OO.mfExtend( DownloadIcon, Icon, { /** * Checks whether DownloadIcon is available for given user agent + * + * @memberof DownloadIcon + * @instance * @param {string} userAgent User agent * @return {boolean} */ @@ -83,6 +85,8 @@ /** * Replace download icon with a spinner + * @memberof DownloadIcon + * @instance */ showSpinner: function () { // FIXME: There is no spinner icon in Minerva, only in MobileFrontend @@ -94,6 +98,8 @@ }, /** * Restore download icon from spinner state + * @memberof DownloadIcon + * @instance */ hideSpinner: function () { this.options.glyphPrefix = 'minerva'; @@ -103,6 +109,8 @@ isTemplateMode: false, /** * onClick handler for button that invokes print function + * @memberof DownloadIcon + * @instance */ onClick: function () { var self = this,