Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/197900
Change subject: Fix code style in @examples
......................................................................
Fix code style in @examples
Change-Id: Ibda6774bb5a7fe74fccf779d7b1c0aaaed9ea0b3
---
M src/ActionSet.js
M src/dialogs/ProcessDialog.js
M src/elements/FlaggedElement.js
M src/elements/TabIndexedElement.js
M src/elements/TitledElement.js
M src/widgets/ButtonGroupWidget.js
M src/widgets/ButtonSelectWidget.js
M src/widgets/ButtonWidget.js
M src/widgets/CheckboxInputWidget.js
M src/widgets/ComboBoxWidget.js
M src/widgets/DecoratedOptionWidget.js
M src/widgets/DropdownInputWidget.js
M src/widgets/DropdownWidget.js
M src/widgets/IconWidget.js
M src/widgets/IndicatorWidget.js
M src/widgets/LabelWidget.js
M src/widgets/PopupWidget.js
M src/widgets/ProgressBarWidget.js
M src/widgets/RadioInputWidget.js
M src/widgets/RadioSelectWidget.js
M src/widgets/SelectWidget.js
M src/widgets/TextInputWidget.js
M src/widgets/ToggleSwitchWidget.js
23 files changed, 141 insertions(+), 139 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/00/197900/1
diff --git a/src/ActionSet.js b/src/ActionSet.js
index a011cbe..875ca60 100644
--- a/src/ActionSet.js
+++ b/src/ActionSet.js
@@ -12,60 +12,61 @@
*
* @example
* // Example: An action set used in a process dialog
- * function ProcessDialog( config ) {
- * ProcessDialog.super.call( this, config );
+ * function MyProcessDialog( config ) {
+ * MyProcessDialog.super.call( this, config );
* }
- * OO.inheritClass( ProcessDialog, OO.ui.ProcessDialog );
- * ProcessDialog.static.title = 'An action set in a process dialog';
+ * OO.inheritClass( MyProcessDialog, OO.ui.ProcessDialog );
+ * MyProcessDialog.static.title = 'An action set in a process dialog';
* // An action set that uses modes ('edit' and 'help' mode, in this
example).
- * ProcessDialog.static.actions = [
- * { action: 'continue', modes: 'edit', label: 'Continue', flags: [
'primary', 'constructive' ] },
- * { action: 'help', modes: 'edit', label: 'Help' },
- * { modes: 'edit', label: 'Cancel', flags: 'safe' },
- * { action: 'back', modes: 'help', label: 'Back', flags: 'safe' }
+ * MyProcessDialog.static.actions = [
+ * { action: 'continue', modes: 'edit', label: 'Continue', flags: [
'primary', 'constructive' ] },
+ * { action: 'help', modes: 'edit', label: 'Help' },
+ * { modes: 'edit', label: 'Cancel', flags: 'safe' },
+ * { action: 'back', modes: 'help', label: 'Back', flags: 'safe' }
* ];
*
- * ProcessDialog.prototype.initialize = function () {
- * ProcessDialog.super.prototype.initialize.apply( this, arguments );
+ * MyProcessDialog.prototype.initialize = function () {
+ * MyProcessDialog.super.prototype.initialize.apply( this, arguments );
* this.panel1 = new OO.ui.PanelLayout( { padded: true, expanded:
false } );
- * this.panel1.$element.append( '<p>This dialog uses an action set
(continue, help, cancel, back) configured with modes. This is edit mode. Click
\'help\' to see help mode. </p>' );
+ * this.panel1.$element.append( '<p>This dialog uses an action set
(continue, help, cancel, back) configured with modes. This is edit mode. Click
\'help\' to see help mode.</p>' );
* this.panel2 = new OO.ui.PanelLayout( { padded: true, expanded:
false } );
- * this.panel2.$element.append( '<p>This is help mode. Only the
\'back\' action widget is configured to be visible here. Click \'back\' to
return to \'edit\' mode</p>' );
- * this.stackLayout= new OO.ui.StackLayout( {
+ * this.panel2.$element.append( '<p>This is help mode. Only the
\'back\' action widget is configured to be visible here. Click \'back\' to
return to \'edit\' mode.</p>' );
+ * this.stackLayout = new OO.ui.StackLayout( {
* items: [ this.panel1, this.panel2 ]
- * });
+ * } );
* this.$body.append( this.stackLayout.$element );
* };
- * ProcessDialog.prototype.getSetupProcess = function ( data ) {
- * return ProcessDialog.super.prototype.getSetupProcess.call( this,
data )
- * .next( function () {
- * this.actions.setMode('edit');
- * }, this );
+ * MyProcessDialog.prototype.getSetupProcess = function ( data ) {
+ * return MyProcessDialog.super.prototype.getSetupProcess.call( this,
data )
+ * .next( function () {
+ * this.actions.setMode( 'edit' );
+ * }, this );
* };
- * ProcessDialog.prototype.getActionProcess = function ( action ) {
+ * MyProcessDialog.prototype.getActionProcess = function ( action ) {
* if ( action === 'help' ) {
* this.actions.setMode( 'help' );
* this.stackLayout.setItem( this.panel2 );
- * } else if ( action === 'back' ) {
+ * } else if ( action === 'back' ) {
* this.actions.setMode( 'edit' );
* this.stackLayout.setItem( this.panel1 );
- * } else if ( action === 'continue' ) {
+ * } else if ( action === 'continue' ) {
* var dialog = this;
* return new OO.ui.Process( function () {
* dialog.close();
* } );
* }
- * return ProcessDialog.super.prototype.getActionProcess.call( this,
action );
+ * return MyProcessDialog.super.prototype.getActionProcess.call( this,
action );
* };
- * ProcessDialog.prototype.getBodyHeight = function () {
+ * MyProcessDialog.prototype.getBodyHeight = function () {
* return this.panel1.$element.outerHeight( true );
* };
* var windowManager = new OO.ui.WindowManager();
* $( 'body' ).append( windowManager.$element );
- * var processDialog = new ProcessDialog({
- * size: 'medium'});
- * windowManager.addWindows( [ processDialog ] );
- * windowManager.openWindow( processDialog );
+ * var dialog = new MyProcessDialog( {
+ * size: 'medium'
+ * } );
+ * windowManager.addWindows( [ dialog ] );
+ * windowManager.openWindow( dialog );
*
* [1]:
https://www.mediawiki.org/wiki/OOjs_UI/Windows/Process_Dialogs#Action_sets
*
diff --git a/src/dialogs/ProcessDialog.js b/src/dialogs/ProcessDialog.js
index 787ccbe..65ad2b5 100644
--- a/src/dialogs/ProcessDialog.js
+++ b/src/dialogs/ProcessDialog.js
@@ -15,39 +15,39 @@
*
* @example
* // Example: Creating and opening a process dialog window.
- * function ProcessDialog( config ) {
- * ProcessDialog.super.call( this, config );
+ * function MyProcessDialog( config ) {
+ * MyProcessDialog.super.call( this, config );
* }
- * OO.inheritClass( ProcessDialog, OO.ui.ProcessDialog );
+ * OO.inheritClass( MyProcessDialog, OO.ui.ProcessDialog );
*
- * ProcessDialog.static.title = 'Process dialog';
- * ProcessDialog.static.actions = [
+ * MyProcessDialog.static.title = 'Process dialog';
+ * MyProcessDialog.static.actions = [
* { action: 'save', label: 'Done', flags: 'primary' },
* { label: 'Cancel', flags: 'safe' }
* ];
*
- * ProcessDialog.prototype.initialize = function () {
- * ProcessDialog.super.prototype.initialize.apply( this, arguments );
+ * MyProcessDialog.prototype.initialize = function () {
+ * MyProcessDialog.super.prototype.initialize.apply( this, arguments );
* this.content = new OO.ui.PanelLayout( { $: this.$, padded: true,
expanded: false } );
- * this.content.$element.append( '<p>This is a process dialog window.
The header contains the title and two buttons: \'Cancel\' (a safe action) on
the left and \'Done\' (a primary action) on the right. </p>' );
+ * this.content.$element.append( '<p>This is a process dialog window.
The header contains the title and two buttons: \'Cancel\' (a safe action) on
the left and \'Done\' (a primary action) on the right.</p>' );
* this.$body.append( this.content.$element );
* };
- * ProcessDialog.prototype.getActionProcess = function ( action ) {
+ * MyProcessDialog.prototype.getActionProcess = function ( action ) {
* var dialog = this;
* if ( action ) {
* return new OO.ui.Process( function () {
- * dialog.close( { action: action } );
- * } );
- * }
- * return ProcessDialog.super.prototype.getActionProcess.call( this,
action );
+ * dialog.close( { action: action } );
+ * } );
+ * }
+ * return MyProcessDialog.super.prototype.getActionProcess.call( this,
action );
* };
*
* var windowManager = new OO.ui.WindowManager();
* $( 'body' ).append( windowManager.$element );
*
- * var processDialog = new ProcessDialog();
- * windowManager.addWindows( [ processDialog ] );
- * windowManager.openWindow( processDialog );
+ * var dialog = new MyProcessDialog();
+ * windowManager.addWindows( [ dialog ] );
+ * windowManager.openWindow( dialog );
*
* [1]: https://www.mediawiki.org/wiki/OOjs_UI/Windows/Process_Dialogs
*
diff --git a/src/elements/FlaggedElement.js b/src/elements/FlaggedElement.js
index 241ba0e..7050f69 100644
--- a/src/elements/FlaggedElement.js
+++ b/src/elements/FlaggedElement.js
@@ -16,16 +16,16 @@
* @example
* // FlaggedElement is mixed into ButtonWidget to provide styling flags
* var button1 = new OO.ui.ButtonWidget( {
- * label : 'Constructive',
- * flags :'constructive'
+ * label: 'Constructive',
+ * flags: 'constructive'
* } );
* var button2 = new OO.ui.ButtonWidget( {
- * label : 'Destructive',
- * flags :'destructive'
+ * label: 'Destructive',
+ * flags: 'destructive'
* } );
* var button3 = new OO.ui.ButtonWidget( {
- * label : 'Progressive',
- * flags :'progressive'
+ * label: 'Progressive',
+ * flags: 'progressive'
* } );
* $( 'body' ).append( button1.$element, button2.$element,
button3.$element );
*
diff --git a/src/elements/TabIndexedElement.js
b/src/elements/TabIndexedElement.js
index 96d4aa7..2f7f093 100644
--- a/src/elements/TabIndexedElement.js
+++ b/src/elements/TabIndexedElement.js
@@ -7,20 +7,20 @@
* // TabIndexedElement is mixed into the ButtonWidget class
* // to provide a tabIndex property.
* var button1 = new OO.ui.ButtonWidget( {
- * label : 'fourth',
- * tabIndex : 4
+ * label: 'fourth',
+ * tabIndex: 4
* } );
* var button2 = new OO.ui.ButtonWidget( {
- * label : 'second',
- * tabIndex : 2
+ * label: 'second',
+ * tabIndex: 2
* } );
* var button3 = new OO.ui.ButtonWidget( {
- * label : 'third',
- * tabIndex : 3
+ * label: 'third',
+ * tabIndex: 3
* } );
* var button4 = new OO.ui.ButtonWidget( {
- * label : 'first',
- * tabIndex : 1
+ * label: 'first',
+ * tabIndex: 1
* } );
* $( 'body' ).append( button1.$element, button2.$element,
button3.$element, button4.$element );
*
diff --git a/src/elements/TitledElement.js b/src/elements/TitledElement.js
index 8b69d63..905ec01 100644
--- a/src/elements/TitledElement.js
+++ b/src/elements/TitledElement.js
@@ -7,8 +7,8 @@
* // TitledElement provides a 'title' attribute to the
* // ButtonWidget class
* var button = new OO.ui.ButtonWidget( {
- * label : 'Button with Title',
- * title : 'I am a button'
+ * label: 'Button with Title',
+ * title: 'I am a button'
* } );
* $( 'body' ).append( button.$element );
*
diff --git a/src/widgets/ButtonGroupWidget.js b/src/widgets/ButtonGroupWidget.js
index eda2541..f1388ab 100644
--- a/src/widgets/ButtonGroupWidget.js
+++ b/src/widgets/ButtonGroupWidget.js
@@ -6,21 +6,21 @@
* @example
* // Example: A ButtonGroupWidget with two buttons
* var button1 = new OO.ui.PopupButtonWidget( {
- * label : 'Select a category',
- * icon : 'menu',
- * popup : {
+ * label: 'Select a category',
+ * icon: 'menu',
+ * popup: {
* $content: $( '<p>List of categories...</p>' ),
* padded: true,
* align: 'left'
* }
* } );
* var button2 = new OO.ui.ButtonWidget( {
- * label : 'Add item'
+ * label: 'Add item'
* });
* var buttonGroup = new OO.ui.ButtonGroupWidget( {
* items: [button1, button2]
* } );
- * $('body').append(buttonGroup.$element);
+ * $( 'body' ).append( buttonGroup.$element );
*
* @class
* @extends OO.ui.Widget
diff --git a/src/widgets/ButtonSelectWidget.js
b/src/widgets/ButtonSelectWidget.js
index 6c1a2e6..1817776 100644
--- a/src/widgets/ButtonSelectWidget.js
+++ b/src/widgets/ButtonSelectWidget.js
@@ -10,25 +10,25 @@
* var option1 = new OO.ui.ButtonOptionWidget( {
* data: 1,
* label: 'Option 1',
- * title:'Button option 1'
+ * title: 'Button option 1'
* } );
*
* var option2 = new OO.ui.ButtonOptionWidget( {
* data: 2,
* label: 'Option 2',
- * title:'Button option 2'
+ * title: 'Button option 2'
* } );
*
* var option3 = new OO.ui.ButtonOptionWidget( {
* data: 3,
* label: 'Option 3',
- * title:'Button option 3'
+ * title: 'Button option 3'
* } );
*
* var buttonSelect=new OO.ui.ButtonSelectWidget( {
- * items: [option1, option2, option3]
+ * items: [ option1, option2, option3 ]
* } );
- * $('body').append(buttonSelect.$element);
+ * $( 'body' ).append( buttonSelect.$element );
*
* [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Selects_and_Options
*
diff --git a/src/widgets/ButtonWidget.js b/src/widgets/ButtonWidget.js
index b607c48..f909dd4 100644
--- a/src/widgets/ButtonWidget.js
+++ b/src/widgets/ButtonWidget.js
@@ -9,9 +9,9 @@
* @example
* // A button widget
* var button = new OO.ui.ButtonWidget( {
- * label : 'Button with Icon',
- * icon : 'remove',
- * iconTitle : 'Remove'
+ * label: 'Button with Icon',
+ * icon: 'remove',
+ * iconTitle: 'Remove'
* } );
* $( 'body' ).append( button.$element );
*
diff --git a/src/widgets/CheckboxInputWidget.js
b/src/widgets/CheckboxInputWidget.js
index 176083a..81ac7b1 100644
--- a/src/widgets/CheckboxInputWidget.js
+++ b/src/widgets/CheckboxInputWidget.js
@@ -6,13 +6,13 @@
*
* @example
* // An example of selected, unselected, and disabled checkbox inputs
- * var checkbox1=new OO.ui.CheckboxInputWidget({
+ * var checkbox1=new OO.ui.CheckboxInputWidget( {
* value: 'a',
* selected: true
- * });
- * var checkbox2=new OO.ui.CheckboxInputWidget({
+ * } );
+ * var checkbox2=new OO.ui.CheckboxInputWidget( {
* value: 'b'
- * });
+ * } );
* var checkbox3=new OO.ui.CheckboxInputWidget( {
* value:'c',
* disabled: true
@@ -22,9 +22,9 @@
* label: 'Checkboxes'
* } );
* fieldset.addItems( [
- * new OO.ui.FieldLayout( checkbox1, {label : 'Selected checkbox',
align : 'inline'}),
- * new OO.ui.FieldLayout( checkbox2, {label : 'Unselected checkbox',
align : 'inline'}),
- * new OO.ui.FieldLayout( checkbox3, {label : 'Disabled checkbox',
align : 'inline'}),
+ * new OO.ui.FieldLayout( checkbox1, { label: 'Selected checkbox',
align: 'inline' } ),
+ * new OO.ui.FieldLayout( checkbox2, { label: 'Unselected checkbox',
align: 'inline' } ),
+ * new OO.ui.FieldLayout( checkbox3, { label: 'Disabled checkbox',
align: 'inline' } ),
* ] );
* $( 'body' ).append( fieldset.$element );
*
diff --git a/src/widgets/ComboBoxWidget.js b/src/widgets/ComboBoxWidget.js
index 9e4fe1e..c2a689f 100644
--- a/src/widgets/ComboBoxWidget.js
+++ b/src/widgets/ComboBoxWidget.js
@@ -12,30 +12,35 @@
*
* @example
* // Example: A ComboBoxWidget.
- * var comboBox=new OO.ui.ComboBoxWidget( {
+ * var comboBox = new OO.ui.ComboBoxWidget( {
* label: 'ComboBoxWidget',
* input: { value: 'Option One' },
* menu: {
* items: [
* new OO.ui.MenuOptionWidget( {
* data: 'Option 1',
- * label: 'Option One' } ),
+ * label: 'Option One'
+ * } ),
* new OO.ui.MenuOptionWidget( {
* data: 'Option 2',
- * label: 'Option Two' } ),
+ * label: 'Option Two'
+ * } ),
* new OO.ui.MenuOptionWidget( {
* data: 'Option 3',
- * label: 'Option Three'} ),
+ * label: 'Option Three'
+ * } ),
* new OO.ui.MenuOptionWidget( {
* data: 'Option 4',
- * label: 'Option Four' } ),
+ * label: 'Option Four'
+ * } ),
* new OO.ui.MenuOptionWidget( {
* data: 'Option 5',
- * label: 'Option Five' } )
+ * label: 'Option Five'
+ * } )
* ]
* }
* } );
- * $('body').append(comboBox.$element);
+ * $( 'body' ).append( comboBox.$element );
*
* [1]:
https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Selects_and_Options#Menu_selects_and_options
*
diff --git a/src/widgets/DecoratedOptionWidget.js
b/src/widgets/DecoratedOptionWidget.js
index ca5acb6..e39ebca 100644
--- a/src/widgets/DecoratedOptionWidget.js
+++ b/src/widgets/DecoratedOptionWidget.js
@@ -7,7 +7,7 @@
*
* @example
* // Decorated options in a select widget
- * var select=new OO.ui.SelectWidget( {
+ * var select = new OO.ui.SelectWidget( {
* items: [
* new OO.ui.DecoratedOptionWidget( {
* data: 'a',
@@ -21,7 +21,7 @@
* } )
* ]
* } );
- * $('body').append(select.$element);
+ * $( 'body' ).append( select.$element );
*
* [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Selects_and_Options
*
diff --git a/src/widgets/DropdownInputWidget.js
b/src/widgets/DropdownInputWidget.js
index 3ed83ed..1be6e55 100644
--- a/src/widgets/DropdownInputWidget.js
+++ b/src/widgets/DropdownInputWidget.js
@@ -6,7 +6,7 @@
*
* @example
* // Example: A DropdownInputWidget with three options
- * var dropDown=new OO.ui.DropdownInputWidget( {
+ * var dropDown = new OO.ui.DropdownInputWidget( {
* label: 'Dropdown menu: Select a menu option',
* options: [
* { data: 'a', label: 'First' } ,
@@ -14,7 +14,7 @@
* { data: 'c', label: 'Third' }
* ]
* } );
- * $('body').append(dropDown.$element);
+ * $( 'body' ).append( dropDown.$element );
*
* [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Inputs
*
diff --git a/src/widgets/DropdownWidget.js b/src/widgets/DropdownWidget.js
index ceaf0f4..f6c592e 100644
--- a/src/widgets/DropdownWidget.js
+++ b/src/widgets/DropdownWidget.js
@@ -5,7 +5,7 @@
*
* @example
* // Example: A DropdownWidget with a menu that contains three options
- * var dropDown=new OO.ui.DropdownWidget( {
+ * var dropDown = new OO.ui.DropdownWidget( {
* label: 'Dropdown menu: Select a menu option',
* menu: {
* items: [
@@ -25,7 +25,7 @@
* }
* } );
*
- * $('body').append(dropDown.$element);
+ * $( 'body' ).append( dropDown.$element );
*
* For more information, please see the [OOjs UI documentation on MediaWiki]
[1].
*
diff --git a/src/widgets/IconWidget.js b/src/widgets/IconWidget.js
index 359edc7..17b62af 100644
--- a/src/widgets/IconWidget.js
+++ b/src/widgets/IconWidget.js
@@ -5,15 +5,15 @@
*
* @example
* // An icon widget with a label
- * var myIcon = new OO.ui.IconWidget({
+ * var myIcon = new OO.ui.IconWidget( {
* icon: 'help',
* iconTitle: 'Help'
- * });
+ * } );
* // Create a label.
- * var iconLabel = new OO.ui.LabelWidget({
+ * var iconLabel = new OO.ui.LabelWidget( {
* label: 'Help'
- * });
- * $('body').append(myIcon.$element, iconLabel.$element);
+ * } );
+ * $( 'body' ).append( myIcon.$element, iconLabel.$element );
*
* [1]:
https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Icons,_Indicators,_and_Labels#Icons
*
diff --git a/src/widgets/IndicatorWidget.js b/src/widgets/IndicatorWidget.js
index 265f8dd..e6ecddf 100644
--- a/src/widgets/IndicatorWidget.js
+++ b/src/widgets/IndicatorWidget.js
@@ -7,12 +7,12 @@
* // Example of an indicator widget
* var indicator1 = new OO.ui.IndicatorWidget( {
* indicator: 'alert'
- * });
+ * } );
*
* // Create a fieldset layout to add a label
- * var fieldset = new OO.ui.FieldsetLayout( );
+ * var fieldset = new OO.ui.FieldsetLayout();
* fieldset.addItems( [
- * new OO.ui.FieldLayout( indicator1, {label: 'An alert indicator:'} )
+ * new OO.ui.FieldLayout( indicator1, { label: 'An alert indicator:' }
)
* ] );
* $( 'body' ).append( fieldset.$element );
*
diff --git a/src/widgets/LabelWidget.js b/src/widgets/LabelWidget.js
index 7844a65..e00990b 100644
--- a/src/widgets/LabelWidget.js
+++ b/src/widgets/LabelWidget.js
@@ -13,14 +13,14 @@
*
* @example
* // Examples of LabelWidgets
- * var label1 = new OO.ui.LabelWidget({
+ * var label1 = new OO.ui.LabelWidget( {
* label: 'plaintext label'
- * });
- * var label2 = new OO.ui.LabelWidget({
- * label: $( '<a href="default.html">jQuery label</a>' )
- * });
+ * } );
+ * var label2 = new OO.ui.LabelWidget( {
+ * label: $( '<a href="default.html">jQuery label</a>' )
+ * } );
* // Create a fieldset layout with fields for each example
- * var fieldset = new OO.ui.FieldsetLayout( );
+ * var fieldset = new OO.ui.FieldsetLayout();
* fieldset.addItems( [
* new OO.ui.FieldLayout( label1 ),
* new OO.ui.FieldLayout( label2 )
diff --git a/src/widgets/PopupWidget.js b/src/widgets/PopupWidget.js
index feaad35..59d7035 100644
--- a/src/widgets/PopupWidget.js
+++ b/src/widgets/PopupWidget.js
@@ -5,15 +5,15 @@
*
* @example
* // A popup widget.
- * var popup=new OO.ui.PopupWidget({
+ * var popup = new OO.ui.PopupWidget( {
* $content: $( '<p>Hi there!</p>' ),
* padded: true,
* width: 300
* } );
*
- * $('body').append(popup.$element);
+ * $( 'body' ).append( popup.$element );
* // To display the popup, toggle the visibility to 'true'.
- * popup.toggle(true);
+ * popup.toggle( true );
*
* [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Popups
*
diff --git a/src/widgets/ProgressBarWidget.js b/src/widgets/ProgressBarWidget.js
index 1755437..a467628 100644
--- a/src/widgets/ProgressBarWidget.js
+++ b/src/widgets/ProgressBarWidget.js
@@ -12,18 +12,16 @@
*
* @example
* // Examples of determinate and indeterminate progress bars.
- * var progressBar1=new OO.ui.ProgressBarWidget( {
+ * var progressBar1 = new OO.ui.ProgressBarWidget( {
* progress: 33
* } );
+ * var progressBar2 = new OO.ui.ProgressBarWidget();
*
- * var progressBar2=new OO.ui.ProgressBarWidget( {
- * progress: false
- * } );
* // Create a FieldsetLayout to layout progress bars
* var fieldset = new OO.ui.FieldsetLayout;
* fieldset.addItems( [
- * new OO.ui.FieldLayout( progressBar1, {label : 'Determinate', align :
'top'}),
- * new OO.ui.FieldLayout( progressBar2, {label : 'Indeterminate', align
: 'top'})
+ * new OO.ui.FieldLayout( progressBar1, {label: 'Determinate', align:
'top'}),
+ * new OO.ui.FieldLayout( progressBar2, {label: 'Indeterminate', align:
'top'})
* ] );
* $( 'body' ).append( fieldset.$element );
*
diff --git a/src/widgets/RadioInputWidget.js b/src/widgets/RadioInputWidget.js
index 7ce5dd2..8c001c1 100644
--- a/src/widgets/RadioInputWidget.js
+++ b/src/widgets/RadioInputWidget.js
@@ -6,15 +6,15 @@
*
* @example
* // An example of selected, unselected, and disabled radio inputs
- * var radio1=new OO.ui.RadioInputWidget({
+ * var radio1 = new OO.ui.RadioInputWidget( {
* value: 'a',
* selected: true
- * });
- * var radio2=new OO.ui.RadioInputWidget({
+ * } );
+ * var radio2 = new OO.ui.RadioInputWidget( {
* value: 'b'
- * });
- * var radio3=new OO.ui.RadioInputWidget( {
- * value:'c',
+ * } );
+ * var radio3 = new OO.ui.RadioInputWidget( {
+ * value: 'c',
* disabled: true
* } );
* // Create a fieldset layout with fields for each radio button.
@@ -22,9 +22,9 @@
* label: 'Radio inputs'
* } );
* fieldset.addItems( [
- * new OO.ui.FieldLayout( radio1, {label : 'Selected', align :
'inline'}),
- * new OO.ui.FieldLayout( radio2, {label : 'Unselected', align :
'inline'}),
- * new OO.ui.FieldLayout( radio3, {label : 'Disabled', align :
'inline'}),
+ * new OO.ui.FieldLayout( radio1, { label: 'Selected', align: 'inline'
} ),
+ * new OO.ui.FieldLayout( radio2, { label: 'Unselected', align:
'inline' } ),
+ * new OO.ui.FieldLayout( radio3, { label: 'Disabled', align: 'inline'
} ),
* ] );
* $( 'body' ).append( fieldset.$element );
*
diff --git a/src/widgets/RadioSelectWidget.js b/src/widgets/RadioSelectWidget.js
index e6cab86..3859205 100644
--- a/src/widgets/RadioSelectWidget.js
+++ b/src/widgets/RadioSelectWidget.js
@@ -17,13 +17,13 @@
* } );
*
* var radioSelect=new OO.ui.RadioSelectWidget( {
- * items: [option1, option2]
+ * items: [ option1, option2 ]
* } );
*
* // Select 'option 1' using the RadioSelectWidget's selectItem() method.
* radioSelect.selectItem( option1 );
*
- * $('body').append(radioSelect.$element);
+ * $( 'body' ).append( radioSelect.$element );
*
* [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Selects_and_Options
diff --git a/src/widgets/SelectWidget.js b/src/widgets/SelectWidget.js
index 4238089..28ebcb6 100644
--- a/src/widgets/SelectWidget.js
+++ b/src/widgets/SelectWidget.js
@@ -9,7 +9,7 @@
*
* @example
* // Example of a select widget with three options
- * var select=new OO.ui.SelectWidget( {
+ * var select = new OO.ui.SelectWidget( {
* items: [
* new OO.ui.OptionWidget( {
* data: 'a',
@@ -22,10 +22,10 @@
* new OO.ui.OptionWidget( {
* data: 'c',
* label: 'Option Three',
- * } ),
+ * } )
* ]
* } );
- * $('body').append(select.$element);
+ * $( 'body' ).append( select.$element );
*
* [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Selects_and_Options
*
diff --git a/src/widgets/TextInputWidget.js b/src/widgets/TextInputWidget.js
index bfe41be..39b8dd7 100644
--- a/src/widgets/TextInputWidget.js
+++ b/src/widgets/TextInputWidget.js
@@ -8,10 +8,10 @@
*
* @example
* // Example of a text input widget
- * var textInput=new OO.ui.TextInputWidget( {
+ * var textInput = new OO.ui.TextInputWidget( {
* value: 'Text input'
* } )
- * $('body').append(textInput.$element);
+ * $( 'body' ).append( textInput.$element );
*
* [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Inputs
*
diff --git a/src/widgets/ToggleSwitchWidget.js
b/src/widgets/ToggleSwitchWidget.js
index 8517dd4..ab0f5c0 100644
--- a/src/widgets/ToggleSwitchWidget.js
+++ b/src/widgets/ToggleSwitchWidget.js
@@ -5,10 +5,8 @@
*
* @example
* // Toggle switches in the 'off' and 'on' position.
- * var toggleSwitch1 = new OO.ui.ToggleSwitchWidget({
- * value: false
- * } );
- * var toggleSwitch2 = new OO.ui.ToggleSwitchWidget({
+ * var toggleSwitch1 = new OO.ui.ToggleSwitchWidget();
+ * var toggleSwitch2 = new OO.ui.ToggleSwitchWidget( {
* value: true
* } );
*
@@ -17,8 +15,8 @@
* label: 'Toggle switches'
* } );
* fieldset.addItems( [
- * new OO.ui.FieldLayout( toggleSwitch1, {label : 'Off', align :
'top'}),
- * new OO.ui.FieldLayout( toggleSwitch2, {label : 'On', align : 'top'})
+ * new OO.ui.FieldLayout( toggleSwitch1, { label: 'Off', align: 'top'
} ),
+ * new OO.ui.FieldLayout( toggleSwitch2, { label: 'On', align: 'top' }
)
* ] );
* $( 'body' ).append( fieldset.$element );
*
--
To view, visit https://gerrit.wikimedia.org/r/197900
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibda6774bb5a7fe74fccf779d7b1c0aaaed9ea0b3
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits