http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95703

Revision: 95703
Author:   jeroendedauw
Date:     2011-08-29 21:38:21 +0000 (Mon, 29 Aug 2011)
Log Message:
-----------
work on survey admin

Modified Paths:
--------------
    trunk/extensions/Survey/Survey.php
    trunk/extensions/Survey/resources/ext.survey.special.survey.js

Modified: trunk/extensions/Survey/Survey.php
===================================================================
--- trunk/extensions/Survey/Survey.php  2011-08-29 21:35:17 UTC (rev 95702)
+++ trunk/extensions/Survey/Survey.php  2011-08-29 21:38:21 UTC (rev 95703)
@@ -130,7 +130,7 @@
        'scripts' => array(
                'ext.survey.special.survey.js'
        ),
-       'dependencies' => array( 'ext.survey' ),
+       'dependencies' => array( 'ext.survey', 'jquery.ui.button' ),
        'messages' => array(
                'survey-question-type-text',
                'survey-question-type-number',

Modified: trunk/extensions/Survey/resources/ext.survey.special.survey.js
===================================================================
--- trunk/extensions/Survey/resources/ext.survey.special.survey.js      
2011-08-29 21:35:17 UTC (rev 95702)
+++ trunk/extensions/Survey/resources/ext.survey.special.survey.js      
2011-08-29 21:38:21 UTC (rev 95703)
@@ -43,10 +43,20 @@
                
                var $type = survey.htmlSelect( questionTypes, question.type );
                
+               var $required = $( '<input />' ).attr( {
+                       'type': 'checkbox',
+                       'id': 'survey-required-' + question.id
+               } ).append( $( '<label />' ) ).attr( {
+                       'for': 'survey-required-' + question.id
+               } ).text( mw.msg( 'survey-special-label-required' ) );
+               
                // TODO
                
-               $input.append( $text, $type );
+               $input.append( $text.prepend( $( '<p />' ).text( mw.msg( 
'survey-special-label-text' ) ) ).append( '<br />' ) );
+               $input.append( $type.prepend( $( '<label />' ).text( mw.msg( 
'survey-special-label-type' ) ) ) );
+               $input.append( $required );
                
+               
                return $input;
        };
        
@@ -81,7 +91,7 @@
                        }
                } );
                
-               $( '#survey-add-question-button' ).click( 
_this.onAddQuestionRequest );
+               $( '#survey-add-question-button' ).click( 
_this.onAddQuestionRequest ).button();
                
                $( '.survey-question-data' ).each( function( index, domElement 
) {
                        $this = $( domElement );
@@ -94,6 +104,8 @@
                                'type': $this.attr( 'data-type' ),
                        } );
                } );
+               
+               $( '.mw-htmlform-submit' ).button();
        };
        
        setup();


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to