dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "ApiSandbox: Move labels outside progress bars"
[lhc/web/wiklou.git]
/
resources
/
src
/
mediawiki.special.apisandbox
/
apisandbox.js
diff --git
a/resources/src/mediawiki.special.apisandbox/apisandbox.js
b/resources/src/mediawiki.special.apisandbox/apisandbox.js
index
f56c0db
..
631a5c6
100644
(file)
--- a/
resources/src/mediawiki.special.apisandbox/apisandbox.js
+++ b/
resources/src/mediawiki.special.apisandbox/apisandbox.js
@@
-724,37
+724,32
@@
* @return {OO.ui.MenuOptionWidget[]} Each item's data should be an OO.ui.FieldLayout
*/
formatRequest: function ( displayParams, rawParams ) {
* @return {OO.ui.MenuOptionWidget[]} Each item's data should be an OO.ui.FieldLayout
*/
formatRequest: function ( displayParams, rawParams ) {
- var json
Inp
ut,
+ var json
Layo
ut,
items = [
new OO.ui.MenuOptionWidget( {
label: Util.parseMsg( 'apisandbox-request-format-url-label' ),
items = [
new OO.ui.MenuOptionWidget( {
label: Util.parseMsg( 'apisandbox-request-format-url-label' ),
- data: new OO.ui.FieldLayout(
- new OO.ui.TextInputWidget( {
- readOnly: true,
- value: mw.util.wikiScript( 'api' ) + '?' + $.param( displayParams )
- } ), {
- label: Util.parseMsg( 'apisandbox-request-url-label' )
- }
- )
+ data: new mw.widgets.CopyTextLayout( {
+ label: Util.parseMsg( 'apisandbox-request-url-label' ),
+ copyText: mw.util.wikiScript( 'api' ) + '?' + $.param( displayParams )
+ } )
} ),
new OO.ui.MenuOptionWidget( {
label: Util.parseMsg( 'apisandbox-request-format-json-label' ),
} ),
new OO.ui.MenuOptionWidget( {
label: Util.parseMsg( 'apisandbox-request-format-json-label' ),
- data: new OO.ui.FieldLayout(
- jsonInput = new OO.ui.MultilineTextInputWidget( {
+ data: jsonLayout = new mw.widgets.CopyTextLayout( {
+ label: Util.parseMsg( 'apisandbox-request-json-label' ),
+ copyText: JSON.stringify( displayParams, null, '\t' ),
+ multiline: true,
+ textInput: {
classes: [ 'mw-apisandbox-textInputCode' ],
classes: [ 'mw-apisandbox-textInputCode' ],
- readOnly: true,
autosize: true,
autosize: true,
- maxRows: 6,
- value: JSON.stringify( displayParams, null, '\t' )
- } ), {
- label: Util.parseMsg( 'apisandbox-request-json-label' )
+ maxRows: 6
}
}
- ).on( 'toggle', function ( visible ) {
+
}
).on( 'toggle', function ( visible ) {
if ( visible ) {
// Call updatePosition instead of adjustSize
// because the latter has weird caching
// behavior and the former bypasses it.
if ( visible ) {
// Call updatePosition instead of adjustSize
// because the latter has weird caching
// behavior and the former bypasses it.
- jsonInput.updatePosition();
+ json
Layout.text
Input.updatePosition();
}
} )
} )
}
} )
} )