http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96666
Revision: 96666
Author: jeroendedauw
Date: 2011-09-09 15:01:50 +0000 (Fri, 09 Sep 2011)
Log Message:
-----------
layout tweak: have the add question control be below the questions
Modified Paths:
--------------
trunk/extensions/Survey/resources/ext.survey.special.survey.js
trunk/extensions/Survey/specials/SpecialSurvey.php
Modified: trunk/extensions/Survey/resources/ext.survey.special.survey.js
===================================================================
--- trunk/extensions/Survey/resources/ext.survey.special.survey.js
2011-09-09 14:49:43 UTC (rev 96665)
+++ trunk/extensions/Survey/resources/ext.survey.special.survey.js
2011-09-09 15:01:50 UTC (rev 96666)
@@ -26,8 +26,7 @@
$tr.append( $( '<td />' ).attr( { 'class': 'mw-input' } ).html(
getQuestionInput( { 'id': 'new' } )
- ).append( $( '<button />' ).button()
- .text( mw.msg( 'survey-special-label-button' ) )
+ ).append( $( '<button />' ).button( { 'label': mw.msg(
'survey-special-label-button' ) } )
.click( function() { onAddQuestionRequest(); return
false; } )
) );
@@ -44,8 +43,6 @@
'class': 'mw-htmlform-field-SurveyQuestionField'
} );
- // TODO: defaulting
-
$tr.append( $( '<td />' ).attr( { 'class': 'mw-label
question-label' } ).html(
$( '<label />' ).text( mw.msg(
'survey-question-label-nr', ++questionNr ) )
) );
@@ -53,8 +50,7 @@
$tr.append( $( '<td />' ).attr( { 'class': 'mw-input' } ).html(
getQuestionInput( question )
.append( '<br />' )
- .append( $( '<button />' ).button()
- .text( mw.msg( 'survey-special-remove'
) )
+ .append( $( '<button />' ).button( { 'label':
mw.msg( 'survey-special-remove' ) } )
.click( function() {
if ( confirm( mw.msg(
'survey-special-remove-confirm' ) ) ) {
removeQuestion(
question );
@@ -65,7 +61,7 @@
)
) );
- $table.append( $tr );
+ $table.find( '.add-question' ).before( $tr );
};
function getQuestionInput( question ) {
@@ -129,6 +125,7 @@
'id': 'new-' + newQuestionNr++
} );
$( '#survey-question-text-new' ).focus().select();
+ $( 'html' ).animate( { scrollTop: $( document ).height() },
'fast' );
};
function setup() {
Modified: trunk/extensions/Survey/specials/SpecialSurvey.php
===================================================================
--- trunk/extensions/Survey/specials/SpecialSurvey.php 2011-09-09 14:49:43 UTC
(rev 96665)
+++ trunk/extensions/Survey/specials/SpecialSurvey.php 2011-09-09 15:01:50 UTC
(rev 96666)
@@ -171,6 +171,7 @@
'label-message' => 'survey-special-label-name',
'id' => 'survey-name',
'name' => 'survey-name',
+ //'disabled' => true
);
$fields[] = array(
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs