mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-12-11 15:56:23 +00:00
Convert SimpleCaptcha to OOUI
Change-Id: Ic904b53b2ac489be572f4b6096ddc8c92c482a59
This commit is contained in:
parent
7951ce701e
commit
423234cb77
|
@ -122,21 +122,30 @@ class SimpleCaptcha {
|
|||
$index = $this->storeCaptcha( $captcha );
|
||||
|
||||
return [
|
||||
'html' => "<p><label for=\"wpCaptchaWord\">{$captcha['question']} = </label>" .
|
||||
Xml::element( 'input', [
|
||||
'name' => 'wpCaptchaWord',
|
||||
'class' => 'mw-ui-input',
|
||||
'id' => 'wpCaptchaWord',
|
||||
'size' => 5,
|
||||
'autocomplete' => 'off',
|
||||
// tab in before the edit textarea
|
||||
'tabindex' => $tabIndex ] ) .
|
||||
"</p>\n" .
|
||||
Xml::element( 'input', [
|
||||
'type' => 'hidden',
|
||||
'name' => 'wpCaptchaId',
|
||||
'id' => 'wpCaptchaId',
|
||||
'value' => $index ] )
|
||||
'html' =>
|
||||
new OOUI\FieldLayout(
|
||||
new OOUI\NumberInputWidget( [
|
||||
'name' => 'wpCaptchaWord',
|
||||
'classes' => [ 'simplecaptcha-answer' ],
|
||||
'id' => 'wpCaptchaWord',
|
||||
'autocomplete' => 'off',
|
||||
// tab in before the edit textarea
|
||||
'tabIndex' => $tabIndex
|
||||
] ),
|
||||
[
|
||||
'align' => 'left',
|
||||
'label' => $captcha['question'] . ' = ',
|
||||
'classes' => [ 'simplecaptcha-field' ],
|
||||
]
|
||||
) .
|
||||
new OOUI\HiddenInputWidget( [
|
||||
'name' => 'wpCaptchaId',
|
||||
'id' => 'wpCaptchaId',
|
||||
'value' => $index
|
||||
] ),
|
||||
'modulestyles' => [
|
||||
'ext.confirmEdit.simpleCaptcha'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
|
10
SimpleCaptcha/resources/ext.confirmEdit.simpleCaptcha.css
Normal file
10
SimpleCaptcha/resources/ext.confirmEdit.simpleCaptcha.css
Normal file
|
@ -0,0 +1,10 @@
|
|||
.simplecaptcha-field .oo-ui-fieldLayout-header {
|
||||
/* stylelint-disable declaration-no-important */
|
||||
width: auto !important;
|
||||
padding-right: 1em !important;
|
||||
/* stylelint-enable declaration-no-important */
|
||||
}
|
||||
|
||||
.simplecaptcha-answer.oo-ui-textInputWidget {
|
||||
width: 5em;
|
||||
}
|
|
@ -73,6 +73,9 @@
|
|||
},
|
||||
"ext.confirmEdit.visualEditor": {
|
||||
"scripts": "ve-confirmedit/ve.init.mw.CaptchaSaveErrorHandler.js"
|
||||
},
|
||||
"ext.confirmEdit.simpleCaptcha": {
|
||||
"styles": "../SimpleCaptcha/resources/ext.confirmEdit.simpleCaptcha.css"
|
||||
}
|
||||
},
|
||||
"VisualEditorPluginModules": [
|
||||
|
|
Loading…
Reference in a new issue