Index: trunk/extensions/ApiSandbox/SpecialApiSandbox.php |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | $out->addModules( 'ext.apiSandbox' ); |
32 | 32 | |
33 | 33 | $out->addHTML( '<noscript>' . wfMessage( 'apisb-no-js' )->parse() . '</noscript> |
34 | | -<div id="api-sandbox-content" style="display: none">' ); |
| 34 | +<div id="api-sandbox-content" style="display: none;">' ); |
35 | 35 | $out->addWikiMsg( 'apisb-intro' ); |
36 | 36 | $out->addHTML( '<form id="api-sandbox-form">' |
37 | 37 | . $this->openFieldset( 'parameters' ) |
— | — | @@ -82,9 +82,9 @@ |
83 | 83 | $this->getQueryModules( 'meta' ) |
84 | 84 | ); |
85 | 85 | |
86 | | - $s = '<div id="api-sandbox-buttons"></div>'; |
87 | | - $s .= '<div id="api-sandbox-examples" style="display: none;"></div>'; |
88 | | - $s .= ' |
| 86 | + #$s = '<div id="api-sandbox-buttons"></div>'; |
| 87 | + #$s .= '<div id="api-sandbox-examples" style="display: none;"></div>'; |
| 88 | + $s = ' |
89 | 89 | <table class="api-sandbox-options"> |
90 | 90 | <tbody> |
91 | 91 | <tr> |
— | — | @@ -101,7 +101,9 @@ |
102 | 102 | </div> |
103 | 103 | </td> |
104 | 104 | <td class="api-sandbox-docs-col"> |
| 105 | + <div id="api-sandbox-buttons"></div> |
105 | 106 | <span id="api-sandbox-help"></span> |
| 107 | + <div id="api-sandbox-examples" style="display: none;"></div> |
106 | 108 | </td> |
107 | 109 | </tr> |
108 | 110 | </tbody> |
Index: trunk/extensions/ApiSandbox/ext.apiSandbox.js |
— | — | @@ -124,27 +124,27 @@ |
125 | 125 | } else { |
126 | 126 | key = pieces[0]; |
127 | 127 | value = decodeURIComponent( pieces.slice( 1 ).join( '=' ) ); |
128 | | - if ( [ 'action', 'format', 'list', 'prop', 'meta' ].indexOf( key ) !== -1 ) { |
| 128 | + if ( $.inArray( key, [ 'action', 'format', 'list', 'prop', 'meta' ] ) !== -1 ) { |
129 | 129 | continue; |
130 | 130 | } |
131 | 131 | $el = $( '#param-' + key ); |
132 | 132 | if ( !$el.length ) { |
133 | 133 | continue; |
134 | 134 | } |
135 | | - switch ( $el[0].nodeName ) { |
136 | | - case 'SELECT': |
| 135 | + switch ( $el[0].nodeName.toLowerCase() ) { |
| 136 | + case 'select': |
137 | 137 | if ( $el.attr( 'multiple' ) ) { |
138 | 138 | splitted = value.split( '|' ); |
139 | 139 | for ( j = 0; j < splitted.length; j++ ) { |
140 | | - $el.children( 'option[value=' + mw.html.escape( splitted[j] ) + ']' ) |
| 140 | + $el.children( 'option[value="' + mw.html.escape( splitted[j] ) + '"]' ) |
141 | 141 | .prop( 'selected', true ); |
142 | 142 | } |
143 | 143 | } else { |
144 | | - $el.children( 'option[value=' + mw.html.escape( value ) + ']' ) |
| 144 | + $el.children( 'option[value="' + mw.html.escape( value ) + '"]' ) |
145 | 145 | .prop( 'selected', true ); |
146 | 146 | } |
147 | 147 | break; |
148 | | - case 'INPUT': |
| 148 | + case 'input': |
149 | 149 | if ( $el.attr( 'type' ) === 'checkbox' ) { |
150 | 150 | $( '#param-' + key ).prop( 'checked', true ); |
151 | 151 | } else { |
— | — | @@ -508,6 +508,7 @@ |
509 | 509 | $pageScroll = $( getScrollableElement( 'body', 'html' ) ); |
510 | 510 | $form = $( '#api-sandbox-form' ); |
511 | 511 | $submit = $( '<button>' ) |
| 512 | + .attr( 'type', 'submit' ) |
512 | 513 | .text( mw.msg( 'apisb-submit' ) ) |
513 | 514 | .appendTo( $buttonsContainer ); |
514 | 515 | $submit = $submit.clone( /*dataAndEvents=*/true, /*deep=*/true ) |
— | — | @@ -521,6 +522,7 @@ |
522 | 523 | .button({ disabled: true }); |
523 | 524 | |
524 | 525 | $examplesButton = $( '<button>' ) |
| 526 | + .attr( 'type', 'button' ) |
525 | 527 | .text( mw.msg( 'apisb-examples' ) ) |
526 | 528 | .click( function ( e ) { |
527 | 529 | $examplesContent.slideToggle(); |
— | — | @@ -530,6 +532,7 @@ |
531 | 533 | .appendTo( $buttonsContainer ); |
532 | 534 | |
533 | 535 | $( '<button>' ) |
| 536 | + .attr( 'type', 'button' ) |
534 | 537 | .text( mw.msg( 'apisb-clear' ) ) |
535 | 538 | .click( function ( e ) { |
536 | 539 | resetUI(); |
Index: trunk/extensions/ApiSandbox/ext.apiSandbox.css |
— | — | @@ -22,11 +22,12 @@ |
23 | 23 | .api-sandbox-options td, |
24 | 24 | .api-sandbox-options th { |
25 | 25 | vertical-align: top; |
26 | | - width: 13em; |
| 26 | + padding: 3px 5px; |
| 27 | + width: 160px; |
27 | 28 | } |
28 | 29 | |
29 | 30 | .api-sandbox-options select { |
30 | | - width: 12em; |
| 31 | + width: 140px; |
31 | 32 | } |
32 | 33 | |
33 | 34 | .api-sandbox-options .api-sandbox-docs-col { |
— | — | @@ -42,25 +43,23 @@ |
43 | 44 | |
44 | 45 | .api-sandbox-params td, |
45 | 46 | .api-sandbox-params th { |
46 | | - padding: 5px 7px; |
| 47 | + vertical-align: top; |
| 48 | + padding: 5px 10px; |
47 | 49 | } |
48 | 50 | |
49 | 51 | .api-sandbox-params-label { |
50 | | - vertical-align: top; |
51 | | - width: 12em; |
| 52 | + width: 150px; |
52 | 53 | text-align: right; |
53 | 54 | } |
54 | 55 | |
55 | 56 | .api-sandbox-params-value { |
56 | | - width: 20em; |
57 | | - vertical-align: top; |
58 | | - overflow: auto; |
| 57 | + width: 260px; |
59 | 58 | } |
60 | 59 | |
61 | 60 | .api-sandbox-params input[type="text"], |
62 | 61 | .api-sandbox-params select { |
63 | | - padding: 2px 3px; |
64 | | - width: 18em; |
| 62 | + padding: 3px 5px; |
| 63 | + width: 225px; |
65 | 64 | } |
66 | 65 | |
67 | 66 | th.api-sandbox-params-label, |