r96907 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96906‎ | r96907 | r96908 >
Date:21:16, 12 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
style tweaks
Modified paths:
  • /trunk/extensions/Survey/resources/jquery.survey.css (modified) (history)
  • /trunk/extensions/Survey/resources/jquery.survey.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Survey/resources/jquery.survey.css
@@ -2,4 +2,9 @@
33
44 .survey-textarea {
55 width: 80%
6 -}
\ No newline at end of file
 6+}
 7+
 8+div .survey-question {
 9+ padding-bottom: 7px;
 10+ font-size: 10pt;
 11+}
Index: trunk/extensions/Survey/resources/jquery.survey.js
@@ -54,19 +54,19 @@
5555 var type = survey.question.type;
5656
5757 var $input;
58 - var id = 'survey-question-' + question.id;
 58+ var id = 'question-input-' + question.id;
5959
6060 switch ( question.type ) {
6161 case type.TEXT: default:
6262 $input = $( '<input />' ).attr( {
6363 'id': id,
64 - 'class': 'survey-question survey-text'
 64+ 'class': 'question-input survey-text'
6565 } );
6666 break;
6767 case type.NUMBER:
6868 $input = $( '<input />' ).numeric().attr( {
6969 'id': id,
70 - 'class': 'survey-question survey-number',
 70+ 'class': 'question-input survey-number',
7171 'size': 7
7272 } );
7373 break;
@@ -79,7 +79,7 @@
8080
8181 $input = survey.htmlSelect( answers, 0, {
8282 'id': id,
83 - 'class': 'survey-question survey-select'
 83+ 'class': 'question-input survey-select'
8484 } );
8585 break;
8686 case type.RADIO:
@@ -95,14 +95,14 @@
9696 id,
9797 {
9898 'id': id,
99 - 'class': 'survey-question survey-radio'
 99+ 'class': 'question-input survey-radio'
100100 }
101101 );
102102 break;
103103 case type.TEXTAREA:
104104 $input = $( '<textarea />' ).attr( {
105105 'id': id,
106 - 'class': 'survey-question survey-textarea',
 106+ 'class': 'question-input survey-textarea',
107107 'cols': 80,
108108 'rows': 2
109109 } );
@@ -111,7 +111,7 @@
112112 $input = $( '<input />' ).attr( {
113113 'id': id,
114114 'type': 'checkbox',
115 - 'class': 'survey-question survey-check',
 115+ 'class': 'question-input survey-check',
116116 } );
117117 break;
118118 }
@@ -120,13 +120,13 @@
121121
122122 this.inputs.push( { 'input': $input, 'type': question.type } );
123123
124 - $q = $( '<div />' ).html( $input );
 124+ $q = $( '<div />' ).attr( 'class', 'survey-question' ).html( $input );
125125
126126 if ( question.type === type.CHECK ) {
127127 $q.prepend( $( '<label />' ).text( question.text ).attr( 'for', id ) );
128128 }
129129 else {
130 - $q.prepend( $( '<p />' ).text( question.text ) );
 130+ $q.prepend( $( '<p />' ).text( question.text ).attr( 'class', 'question-text' ) );
131131 }
132132
133133 return $q;
@@ -161,7 +161,7 @@
162162 var id = $input.data( 'question-id' );
163163
164164 if ( this.inputs[i].type === survey.question.type.RADIO ) {
165 - var value = $( 'input:radio[name=survey-question-' + id + ']:checked' ).val();
 165+ var value = $( 'input:radio[name=question-input-' + id + ']:checked' ).val();
166166 }
167167 else {
168168 var value = $input.val();

Status & tagging log