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