[MediaWiki-commits] [Gerrit] Introduce ButtonInputWidget - change (oojs/ui)

2014-10-17 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Introduce ButtonInputWidget
..


Introduce ButtonInputWidget

A button that is an input widget. Intended to be used within FormLayouts.

Compared to ButtonWidget:
* ButtonInputWidget is a  or  HTML tag and can behave
  like a form submission button
* ButtonWidget is a  HTML tag (unless overridden) and can behave
  like a hyperlink
* ButtonInputWidget's element can have 'name' and 'value' attributes
* ButtonWidget's element can have 'href' and 'target' attributes
* Both fire a single event, 'click'
* Both use a ButtonElement mixin
* Both have icons, indicators, titles, flags and labels that all work the same

 is the default HTML tag.  is made available to make
it possible to support forms with multiple submit buttons on IE 6,
which handles  elements badly. (Of course it comes with the
usual caveats, notably sacrificing icons and indicators.)

Change-Id: I2f5a4aa02485e9a27a5e9a354b29cb68a905472b
---
M build/modules.json
M demos/pages/widgets.js
M demos/widgets.php
A php/widgets/OoUiButtonInputWidget.php
M src/themes/apex/elements.less
M src/themes/mediawiki/elements.less
A src/widgets/ButtonInputWidget.js
7 files changed, 265 insertions(+), 6 deletions(-)

Approvals:
  Trevor Parscal: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/build/modules.json b/build/modules.json
index ca68cc0..581ce08 100644
--- a/build/modules.json
+++ b/build/modules.json
@@ -67,6 +67,7 @@
"src/widgets/IndicatorWidget.js",
"src/widgets/InlineMenuWidget.js",
"src/widgets/InputWidget.js",
+   "src/widgets/ButtonInputWidget.js",
"src/widgets/CheckboxInputWidget.js",
"src/widgets/TextInputWidget.js",
"src/widgets/ComboBoxWidget.js",
diff --git a/demos/pages/widgets.js b/demos/pages/widgets.js
index 7ce8b24..534fe0c 100644
--- a/demos/pages/widgets.js
+++ b/demos/pages/widgets.js
@@ -409,6 +409,27 @@
}
),
new OO.ui.FieldLayout(
+   new OO.ui.ButtonInputWidget( {
+   label: 'Submit the form',
+   type: 'submit'
+   } ),
+   {
+   align: 'top',
+   label: 'ButtonInputWidget (type: 
submit)'
+   }
+   ),
+   new OO.ui.FieldLayout(
+   new OO.ui.ButtonInputWidget( {
+   label: 'Submit the form',
+   type: 'submit',
+   useInputTag: true
+   } ),
+   {
+   align: 'top',
+   label: 'ButtonInputWidget (type: 
submit, using )'
+   }
+   ),
+   new OO.ui.FieldLayout(
new OO.ui.CheckboxInputWidget( {
value: true
} ),
diff --git a/demos/widgets.php b/demos/widgets.php
index 52b9af0..3b2f064 100644
--- a/demos/widgets.php
+++ b/demos/widgets.php
@@ -28,6 +28,7 @@
require_once 
'../php/widgets/OoUiIndicatorWidget.php';
require_once 
'../php/widgets/OoUiLabelWidget.php';
require_once 
'../php/widgets/OoUiInputWidget.php';
+   require_once 
'../php/widgets/OoUiButtonInputWidget.php';
require_once 
'../php/widgets/OoUiCheckboxInputWidget.php';
require_once 
'../php/widgets/OoUiTextInputWidget.php';
require_once '../php/OoUiTheme.php';
@@ -239,6 +240,27 @@
)
),
new OoUiFieldLayout(
+   new 
OoUiButtonInputWidget( array(
+   'label' => 
'Submit the form',
+   'type' => 
'submit'
+   ) ),
+   array(
+   'align' => 
'top',
+   'label' => 
'ButtonI

[MediaWiki-commits] [Gerrit] Introduce ButtonInputWidget - change (oojs/ui)

2014-10-17 Thread Code Review
Bartosz DziewoƄski has uploaded a new change for review.

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

Change subject: Introduce ButtonInputWidget
..

Introduce ButtonInputWidget

A button that is an input widget. Intended to be used within FormLayouts.

Compared to ButtonWidget:
* ButtonInputWidget is a  or  HTML tag and can behave
  like a form submission button
* ButtonWidget is a  HTML tag (unless overridden) and can behave
  like a hyperlink
* ButtonInputWidget's element can have 'name' and 'value' attributes
* ButtonWidget's element can have 'href' and 'target' attributes
* Both fire a single event, 'click'
* Both use a ButtonElement mixin
* Both have icons, indicators, titles, flags and labels that all work the same

 is the default HTML tag.  is made available to make
it possible to support forms with multiple submit buttons on IE 6,
which handles  elements badly. (Of course it comes with the
usual caveats, notably sacrificing icons and indicators.)

Change-Id: I2f5a4aa02485e9a27a5e9a354b29cb68a905472b
---
M build/modules.json
M demos/pages/widgets.js
M demos/widgets.php
A php/widgets/OoUiButtonInputWidget.php
M src/themes/apex/elements.less
M src/themes/mediawiki/elements.less
A src/widgets/ButtonInputWidget.js
7 files changed, 265 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/06/167306/1

diff --git a/build/modules.json b/build/modules.json
index ca68cc0..581ce08 100644
--- a/build/modules.json
+++ b/build/modules.json
@@ -67,6 +67,7 @@
"src/widgets/IndicatorWidget.js",
"src/widgets/InlineMenuWidget.js",
"src/widgets/InputWidget.js",
+   "src/widgets/ButtonInputWidget.js",
"src/widgets/CheckboxInputWidget.js",
"src/widgets/TextInputWidget.js",
"src/widgets/ComboBoxWidget.js",
diff --git a/demos/pages/widgets.js b/demos/pages/widgets.js
index 7ce8b24..534fe0c 100644
--- a/demos/pages/widgets.js
+++ b/demos/pages/widgets.js
@@ -409,6 +409,27 @@
}
),
new OO.ui.FieldLayout(
+   new OO.ui.ButtonInputWidget( {
+   label: 'Submit the form',
+   type: 'submit'
+   } ),
+   {
+   align: 'top',
+   label: 'ButtonInputWidget (type: 
submit)'
+   }
+   ),
+   new OO.ui.FieldLayout(
+   new OO.ui.ButtonInputWidget( {
+   label: 'Submit the form',
+   type: 'submit',
+   useInputTag: true
+   } ),
+   {
+   align: 'top',
+   label: 'ButtonInputWidget (type: 
submit, using )'
+   }
+   ),
+   new OO.ui.FieldLayout(
new OO.ui.CheckboxInputWidget( {
value: true
} ),
diff --git a/demos/widgets.php b/demos/widgets.php
index 52b9af0..3b2f064 100644
--- a/demos/widgets.php
+++ b/demos/widgets.php
@@ -28,6 +28,7 @@
require_once 
'../php/widgets/OoUiIndicatorWidget.php';
require_once 
'../php/widgets/OoUiLabelWidget.php';
require_once 
'../php/widgets/OoUiInputWidget.php';
+   require_once 
'../php/widgets/OoUiButtonInputWidget.php';
require_once 
'../php/widgets/OoUiCheckboxInputWidget.php';
require_once 
'../php/widgets/OoUiTextInputWidget.php';
require_once '../php/OoUiTheme.php';
@@ -239,6 +240,27 @@
)
),
new OoUiFieldLayout(
+   new 
OoUiButtonInputWidget( array(
+   'label' => 
'Submit the form',
+   'type' => 
'submit'
+   ) ),
+   array(
+   'align' => 
'top',
+