Kmenger has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/194942

Change subject: MessageDialog: Add description, example, and mark private 
methods
......................................................................

MessageDialog: Add description, example, and mark private methods

Change-Id: Iecc7f4f77eeb560229a208bcad8ec425c167895c
---
M src/dialogs/MessageDialog.js
1 file changed, 46 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/42/194942/1

diff --git a/src/dialogs/MessageDialog.js b/src/dialogs/MessageDialog.js
index 0f24aeb..4ec1261 100644
--- a/src/dialogs/MessageDialog.js
+++ b/src/dialogs/MessageDialog.js
@@ -1,9 +1,37 @@
 /**
- * Dialog for showing a message.
+ * MessageDialogs display a confirmation or alert message. By default, the 
rendered dialog box
+ * consists of a header that contains the dialog title, a body with the 
message, and a footer that
+ * contains any {@link OO.ui.ActionWidget action widgets}. The MessageDialog 
class is the only type
+ * of {@link OO.ui.Dialog dialog} that is usually instantiated directly.
  *
- * User interface:
- * - Registers two actions by default (safe and primary).
- * - Renders action widgets in the footer.
+ * There are two basic types of message dialogs, confirmation and alert:
+ *
+ * - **confirmation**: the dialog title describes what a progressive action 
will do and the message provides
+ *  more details about the consequences.
+ * - **alert**: the dialog title describes which event occurred and the 
message provides more information
+ *  about why the event occurred.
+ *
+ * The MessageDialog class specifies two actions: ‘accept’, the primary
+ * action (e.g., ‘ok’) and ‘reject,’ the safe action (e.g., ‘cancel’). Both 
will close the window,
+ * passing along the selected action.
+ *
+ * For more information and examples, please see the [OOjs UI documentation on 
MediaWiki][1].
+ *
+ *     @example
+ *     // Example: Creating and opening a message dialog window.
+ *     var messageDialog = new OO.ui.MessageDialog();
+ *
+ *     // Create and append a window manager.
+ *     var windowManager = new OO.ui.WindowManager();
+ *     $( 'body' ).append( windowManager.$element );
+ *     windowManager.addWindows( [ messageDialog ] );
+ *     // Open the window.
+ *     windowManager.openWindow( messageDialog, {
+ *         title: 'Basic message dialog',
+ *         message: 'This is the message'
+ *     } );
+ *
+ * [1]: https://www.mediawiki.org/wiki/OOjs_UI/Windows/Message_Dialogs
  *
  * @class
  * @extends OO.ui.Dialog
@@ -37,21 +65,23 @@
 /**
  * Dialog title.
  *
- * A confirmation dialog's title should describe what the progressive action 
will do. An alert
- * dialog's title should describe what event occurred.
+ * The title of a confirmation dialog describes what a progressive action will 
do. The
+ * title of an alert dialog describes which event occurred.
  *
  * @static
- * inheritable
+ * @inheritable
  * @property {jQuery|string|Function|null}
  */
 OO.ui.MessageDialog.static.title = null;
 
 /**
- * A confirmation dialog's message should describe the consequences of the 
progressive action. An
- * alert dialog's message should describe why the event occurred.
+ * The message displayed in the dialog body.
+ *
+ * A confirmation message describes the consequences of a progressive action. 
An alert
+ * message describes why an event occurred.
  *
  * @static
- * inheritable
+ * @inheritable
  * @property {jQuery|string|Function|null}
  */
 OO.ui.MessageDialog.static.message = null;
@@ -87,6 +117,8 @@
 
 /**
  * Handle window resized events.
+ *
+ * @private
  */
 OO.ui.MessageDialog.prototype.onResize = function () {
        var dialog = this;
@@ -100,6 +132,8 @@
 /**
  * Toggle action layout between vertical and horizontal.
  *
+ *
+ * @private
  * @param {boolean} [value] Layout actions vertically, omit to toggle
  * @chainable
  */
@@ -263,6 +297,8 @@
  * Fit action actions into columns or rows.
  *
  * Columns will be used if all labels can fit without overflow, otherwise rows 
will be used.
+ *
+ * @private
  */
 OO.ui.MessageDialog.prototype.fitActions = function () {
        var i, len, action,

-- 
To view, visit https://gerrit.wikimedia.org/r/194942
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iecc7f4f77eeb560229a208bcad8ec425c167895c
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Kmenger <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to