r95703 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95702‎ | r95703 | r95704 >
Date:21:38, 29 August 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
work on survey admin
Modified paths:
  • /trunk/extensions/Survey/Survey.php (modified) (history)
  • /trunk/extensions/Survey/resources/ext.survey.special.survey.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Survey/Survey.php
@@ -130,7 +130,7 @@
131131 'scripts' => array(
132132 'ext.survey.special.survey.js'
133133 ),
134 - 'dependencies' => array( 'ext.survey' ),
 134+ 'dependencies' => array( 'ext.survey', 'jquery.ui.button' ),
135135 'messages' => array(
136136 'survey-question-type-text',
137137 'survey-question-type-number',
Index: trunk/extensions/Survey/resources/ext.survey.special.survey.js
@@ -43,10 +43,20 @@
4444
4545 var $type = survey.htmlSelect( questionTypes, question.type );
4646
 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+
4754 // TODO
4855
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 );
5059
 60+
5161 return $input;
5262 };
5363
@@ -81,7 +91,7 @@
8292 }
8393 } );
8494
85 - $( '#survey-add-question-button' ).click( _this.onAddQuestionRequest );
 95+ $( '#survey-add-question-button' ).click( _this.onAddQuestionRequest ).button();
8696
8797 $( '.survey-question-data' ).each( function( index, domElement ) {
8898 $this = $( domElement );
@@ -94,6 +104,8 @@
95105 'type': $this.attr( 'data-type' ),
96106 } );
97107 } );
 108+
 109+ $( '.mw-htmlform-submit' ).button();
98110 };
99111
100112 setup();

Status & tagging log