From b6bb8c6d9ab4fb830c94392c196b51ca0bcd2b01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 4 Jan 2017 16:13:54 +0000 Subject: [PATCH] Revert "ApiSandbox: Display params as JSON on request page" This reverts commit 8bc0e7ca17699daae3ec95b9bbb783a0ffe6156a. Change-Id: Ie60b7718161db483ff391f3b5dcc117af83fe2e4 --- languages/i18n/en.json | 1 - languages/i18n/qqq.json | 1 - resources/Resources.php | 1 - .../mediawiki.special.apisandbox.css | 8 -------- .../mediawiki.special.apisandbox.js | 17 ----------------- 5 files changed, 28 deletions(-) diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 4b25a20f75..02831fcb80 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1919,7 +1919,6 @@ "apisandbox-sending-request": "Sending API request...", "apisandbox-loading-results": "Receiving API results...", "apisandbox-results-error": "An error occurred while loading the API query response: $1.", - "apisandbox-request-params-json": "JSON parameters:", "apisandbox-request-url-label": "Request URL:", "apisandbox-request-time": "Request time: {{PLURAL:$1|$1 ms}}", "apisandbox-results-fixtoken": "Correct token and resubmit", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index f5b28792b0..95e6983f61 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2103,7 +2103,6 @@ "apisandbox-sending-request": "JavaScript message displayed while the request is being sent.", "apisandbox-loading-results": "JavaScript message displayed while the response is being read.", "apisandbox-results-error": "Displayed as an error message from JavaScript when the request failed.\n\nParameters:\n* $1 - Error message", - "apisandbox-request-params-json": "Label for text field display the request parameters as JSON.", "apisandbox-request-url-label": "Label for the text field displaying the URL used to make this request.", "apisandbox-request-time": "Label and value for displaying the time taken by the request.\n\nParameters:\n* $1 - Time taken in milliseconds", "apisandbox-results-fixtoken": "JavaScript button label", diff --git a/resources/Resources.php b/resources/Resources.php index 5423d5486b..e8be528889 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1826,7 +1826,6 @@ return [ 'apisandbox-sending-request', 'apisandbox-loading-results', 'apisandbox-results-error', - 'apisandbox-request-params-json', 'apisandbox-request-url-label', 'apisandbox-request-time', 'apisandbox-results-fixtoken', diff --git a/resources/src/mediawiki.special/mediawiki.special.apisandbox.css b/resources/src/mediawiki.special/mediawiki.special.apisandbox.css index 707a579932..99f6c132a2 100644 --- a/resources/src/mediawiki.special/mediawiki.special.apisandbox.css +++ b/resources/src/mediawiki.special/mediawiki.special.apisandbox.css @@ -85,11 +85,3 @@ .oo-ui-textInputWidget.oo-ui-widget-enabled > .oo-ui-indicatorElement-indicator.mw-apisandbox-clickable-indicator { cursor: pointer; } - -.mw-apisandbox-textInputCode .oo-ui-inputWidget-input { - font-family: monospace, 'Courier'; - font-size: 0.8125em; - -moz-tab-size: 4; - -o-tab-size: 4; - tab-size: 4; -} diff --git a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js index f108e50afd..43321fe236 100644 --- a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js +++ b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js @@ -916,8 +916,6 @@ } $.when.apply( $, deferreds ).done( function () { - var jsonInput; - if ( $.inArray( false, arguments ) !== -1 ) { windowManager.openWindow( 'errorAlert', { title: Util.parseMsg( 'apisandbox-submit-invalid-fields-title' ), @@ -969,26 +967,11 @@ label: Util.parseMsg( 'apisandbox-request-url-label' ) } ).$element, - new OO.ui.FieldLayout( - jsonInput = new OO.ui.TextInputWidget( { - classes: [ 'mw-apisandbox-textInputCode' ], - readOnly: true, - multiline: true, - autosize: true, - maxRows: 6, - value: JSON.stringify( displayParams, null, '\t' ) - } ), { - label: Util.parseMsg( 'apisandbox-request-params-json' ) - } - ).$element, $result ); ApiSandbox.updateUI(); booklet.setPage( '|results|' ); - // Resize the multiline input once visible - jsonInput.adjustSize(); - location.href = oldhash = '#' + query; api.post( params, { -- 2.20.1