r96666 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96665‎ | r96666 | r96667 >
Date:15:01, 9 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
layout tweak: have the add question control be below the questions
Modified paths:
  • /trunk/extensions/Survey/resources/ext.survey.special.survey.js (modified) (history)
  • /trunk/extensions/Survey/specials/SpecialSurvey.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Survey/specials/SpecialSurvey.php
@@ -171,6 +171,7 @@
172172 'label-message' => 'survey-special-label-name',
173173 'id' => 'survey-name',
174174 'name' => 'survey-name',
 175+ //'disabled' => true
175176 );
176177
177178 $fields[] = array(
Index: trunk/extensions/Survey/resources/ext.survey.special.survey.js
@@ -26,8 +26,7 @@
2727
2828 $tr.append( $( '<td />' ).attr( { 'class': 'mw-input' } ).html(
2929 getQuestionInput( { 'id': 'new' } )
30 - ).append( $( '<button />' ).button()
31 - .text( mw.msg( 'survey-special-label-button' ) )
 30+ ).append( $( '<button />' ).button( { 'label': mw.msg( 'survey-special-label-button' ) } )
3231 .click( function() { onAddQuestionRequest(); return false; } )
3332 ) );
3433
@@ -44,8 +43,6 @@
4544 'class': 'mw-htmlform-field-SurveyQuestionField'
4645 } );
4746
48 - // TODO: defaulting
49 -
5047 $tr.append( $( '<td />' ).attr( { 'class': 'mw-label question-label' } ).html(
5148 $( '<label />' ).text( mw.msg( 'survey-question-label-nr', ++questionNr ) )
5249 ) );
@@ -53,8 +50,7 @@
5451 $tr.append( $( '<td />' ).attr( { 'class': 'mw-input' } ).html(
5552 getQuestionInput( question )
5653 .append( '<br />' )
57 - .append( $( '<button />' ).button()
58 - .text( mw.msg( 'survey-special-remove' ) )
 54+ .append( $( '<button />' ).button( { 'label': mw.msg( 'survey-special-remove' ) } )
5955 .click( function() {
6056 if ( confirm( mw.msg( 'survey-special-remove-confirm' ) ) ) {
6157 removeQuestion( question );
@@ -65,7 +61,7 @@
6662 )
6763 ) );
6864
69 - $table.append( $tr );
 65+ $table.find( '.add-question' ).before( $tr );
7066 };
7167
7268 function getQuestionInput( question ) {
@@ -129,6 +125,7 @@
130126 'id': 'new-' + newQuestionNr++
131127 } );
132128 $( '#survey-question-text-new' ).focus().select();
 129+ $( 'html' ).animate( { scrollTop: $( document ).height() }, 'fast' );
133130 };
134131
135132 function setup() {

Status & tagging log