Index: trunk/extensions/Survey/Survey.php |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | 'scripts' => array( |
132 | 132 | 'ext.survey.special.survey.js' |
133 | 133 | ), |
134 | | - 'dependencies' => array( 'ext.survey' ), |
| 134 | + 'dependencies' => array( 'ext.survey', 'jquery.ui.button' ), |
135 | 135 | 'messages' => array( |
136 | 136 | 'survey-question-type-text', |
137 | 137 | 'survey-question-type-number', |
Index: trunk/extensions/Survey/resources/ext.survey.special.survey.js |
— | — | @@ -43,10 +43,20 @@ |
44 | 44 | |
45 | 45 | var $type = survey.htmlSelect( questionTypes, question.type ); |
46 | 46 | |
| 47 | + var $required = $( '<input />' ).attr( { |
| 48 | + 'type': 'checkbox', |
| 49 | + 'id': 'survey-required-' + question.id |
| 50 | + } ).append( $( '<label />' ) ).attr( { |
| 51 | + 'for': 'survey-required-' + question.id |
| 52 | + } ).text( mw.msg( 'survey-special-label-required' ) ); |
| 53 | + |
47 | 54 | // TODO |
48 | 55 | |
49 | | - $input.append( $text, $type ); |
| 56 | + $input.append( $text.prepend( $( '<p />' ).text( mw.msg( 'survey-special-label-text' ) ) ).append( '<br />' ) ); |
| 57 | + $input.append( $type.prepend( $( '<label />' ).text( mw.msg( 'survey-special-label-type' ) ) ) ); |
| 58 | + $input.append( $required ); |
50 | 59 | |
| 60 | + |
51 | 61 | return $input; |
52 | 62 | }; |
53 | 63 | |
— | — | @@ -81,7 +91,7 @@ |
82 | 92 | } |
83 | 93 | } ); |
84 | 94 | |
85 | | - $( '#survey-add-question-button' ).click( _this.onAddQuestionRequest ); |
| 95 | + $( '#survey-add-question-button' ).click( _this.onAddQuestionRequest ).button(); |
86 | 96 | |
87 | 97 | $( '.survey-question-data' ).each( function( index, domElement ) { |
88 | 98 | $this = $( domElement ); |
— | — | @@ -94,6 +104,8 @@ |
95 | 105 | 'type': $this.attr( 'data-type' ), |
96 | 106 | } ); |
97 | 107 | } ); |
| 108 | + |
| 109 | + $( '.mw-htmlform-submit' ).button(); |
98 | 110 | }; |
99 | 111 | |
100 | 112 | setup(); |