Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/images/star-new.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/images/star-empty.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/images/star-new-down.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/images/star-new-down.png |
___________________________________________________________________ |
Added: svn:mime-type |
1 | 1 | + application/octet-stream |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/images/star-full.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/images/trash.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/images/star-new-hover.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/images/star-new-hover.png |
___________________________________________________________________ |
Added: svn:mime-type |
2 | 2 | + application/octet-stream |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/ext.articleFeedback-beta.css |
— | — | @@ -39,6 +39,7 @@ |
40 | 40 | .articleFeedback-tabs { |
41 | 41 | width: 8em; |
42 | 42 | height: 15em; |
| 43 | + /* @embed */ |
43 | 44 | background-image: url(images/tab-break.png); |
44 | 45 | background-position: right top; |
45 | 46 | background-repeat: repeat-y; |
— | — | @@ -52,12 +53,14 @@ |
53 | 54 | height: 7.5em; |
54 | 55 | cursor: pointer; |
55 | 56 | background-color: #ffffff; |
| 57 | + /* @embed */ |
56 | 58 | background-image: url(images/tab-edge.png); |
57 | 59 | background-position: right top; |
58 | 60 | background-repeat: repeat-y; |
59 | 61 | } |
60 | 62 | |
61 | 63 | .articleFeedback-tabs .articleFeedback-tab-current { |
| 64 | + /* @embed */ |
62 | 65 | background-image: url(images/tab-fade.png); |
63 | 66 | } |
64 | 67 | |
— | — | @@ -79,10 +82,12 @@ |
80 | 83 | } |
81 | 84 | |
82 | 85 | .articleFeedback-tab-form .articleFeedback-buffer { |
| 86 | + /* @embed */ |
83 | 87 | background-image: url(images/form-icon.png); |
84 | 88 | } |
85 | 89 | |
86 | 90 | .articleFeedback-tab-report .articleFeedback-buffer { |
| 91 | + /* @embed */ |
87 | 92 | background-image: url(images/report-icon.png); |
88 | 93 | } |
89 | 94 | |
— | — | @@ -115,26 +120,50 @@ |
116 | 121 | padding-left: 1em; |
117 | 122 | } |
118 | 123 | |
119 | | -.articleFeedback-rating-labels label { |
| 124 | +.articleFeedback-rating-labels label, .articleFeedback-rating-clear { |
120 | 125 | float: left; |
121 | 126 | height: 2em; |
122 | 127 | width: 2em; |
123 | 128 | margin: 0; |
124 | 129 | padding: 0; |
| 130 | + /* @embed */ |
125 | 131 | background-image: url(images/star-empty.png); |
126 | 132 | background-repeat: no-repeat; |
127 | 133 | background-position: center center; |
128 | 134 | cursor: pointer; |
129 | 135 | } |
130 | 136 | |
| 137 | +.articleFeedback-rating-clear { |
| 138 | + /* @embed */ |
| 139 | + background-image: url(images/trash.png); |
| 140 | + display: none; |
| 141 | +} |
| 142 | + |
| 143 | +.articleFeedback-rating-labels:hover .articleFeedback-rating-clear { |
| 144 | + /* @embed */ |
| 145 | + background-image: url(images/trash-hover.png); |
| 146 | +} |
| 147 | + |
131 | 148 | .articleFeedback-rating-labels label.articleFeedback-rating-label-full { |
| 149 | + /* @embed */ |
132 | 150 | background-image: url(images/star-full.png); |
133 | 151 | } |
134 | 152 | |
135 | | -.articleFeedback-rating-labels label.articleFeedback-rating-label-new { |
| 153 | +.articleFeedback-rating-new .articleFeedback-rating-labels label.articleFeedback-rating-label-full { |
| 154 | + /* @embed */ |
136 | 155 | background-image: url(images/star-new.png); |
137 | 156 | } |
138 | 157 | |
| 158 | +.articleFeedback-rating-new .articleFeedback-rating-labels label.articleFeedback-rating-label-hover { |
| 159 | + /* @embed */ |
| 160 | + background-image: url(images/star-new-hover.png); |
| 161 | +} |
| 162 | + |
| 163 | +.articleFeedback-rating-new .articleFeedback-rating-labels label.articleFeedback-rating-label-down { |
| 164 | + /* @embed */ |
| 165 | + background-image: url(images/star-new-down.png); |
| 166 | +} |
| 167 | + |
139 | 168 | .articleFeedback-rating { |
140 | 169 | float: left; |
141 | 170 | width: 50%; |
— | — | @@ -145,12 +174,14 @@ |
146 | 175 | .articleFeedback-label { |
147 | 176 | cursor: pointer; |
148 | 177 | padding-left: 20px; |
| 178 | + /* @embed */ |
149 | 179 | background-image: url(images/question.png); |
150 | 180 | background-repeat: no-repeat; |
151 | 181 | background-position: center left; |
152 | 182 | } |
153 | 183 | |
154 | 184 | .articleFeedback-label:hover { |
| 185 | + /* @embed */ |
155 | 186 | background-image: url(images/question-hover.png); |
156 | 187 | } |
157 | 188 | |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/ext.articleFeedback-beta.js |
— | — | @@ -7,21 +7,21 @@ |
8 | 8 | $.articleFeedback = { |
9 | 9 | 'fn': { |
10 | 10 | 'updateRating': function() { |
11 | | - $(this) |
12 | | - .find( 'label' ) |
13 | | - .removeClass( 'articleFeedback-rating-label-new' ) |
14 | | - .each( function() { |
15 | | - if ( $( 'input#' + $(this).attr( 'for' ) + ':checked' ).length ) { |
16 | | - $(this) |
17 | | - .prevAll( 'label' ) |
18 | | - .andSelf() |
19 | | - .addClass( 'articleFeedback-rating-label-full' ) |
20 | | - .end() |
21 | | - .end() |
22 | | - .nextAll( 'label' ) |
23 | | - .removeClass( 'articleFeedback-rating-label-full' ); |
24 | | - } |
25 | | - } ); |
| 11 | + $(this).find( 'label' ).removeClass( 'articleFeedback-rating-label-full' ); |
| 12 | + var $label = $(this).find( 'label[for=' + $(this).find( 'input:radio:checked' ).attr( 'id' ) + ']' ) |
| 13 | + if ( $label.length ) { |
| 14 | + $label |
| 15 | + .prevAll( 'label' ) |
| 16 | + .add( $label ) |
| 17 | + .addClass( 'articleFeedback-rating-label-full' ) |
| 18 | + .end() |
| 19 | + .end() |
| 20 | + .nextAll( 'label' ) |
| 21 | + .removeClass( 'articleFeedback-rating-label-full' ); |
| 22 | + $(this).find( '.articleFeedback-rating-clear' ).show(); |
| 23 | + } else { |
| 24 | + $(this).find( '.articleFeedback-rating-clear' ).hide(); |
| 25 | + } |
26 | 26 | }, |
27 | 27 | 'build': function( context ) { |
28 | 28 | context.$ui |
— | — | @@ -44,25 +44,25 @@ |
45 | 45 | <div class="articleFeedback-description articleFeedback-report"><msg key="report-panel-description" /></div>\ |
46 | 46 | <div style="clear:both;"></div>\ |
47 | 47 | <div class="articleFeedback-ratings">\ |
48 | | - <div class="articleFeedback-rating" rel="wellsourced">\ |
| 48 | + <div class="articleFeedback-rating articleFeedback-rating-new" rel="wellsourced">\ |
49 | 49 | <span class="articleFeedback-label" title-msg="field-wellsourced-tip"><msg key="field-wellsourced-label" /></span>\ |
50 | 50 | <div class="articleFeedback-rating-fields articleFeedback-form"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\ |
51 | | - <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label></div>\ |
| 51 | + <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label><div class="articleFeedback-rating-clear"></div></div>\ |
52 | 52 | </div>\ |
53 | | - <div class="articleFeedback-rating" rel="neutral">\ |
| 53 | + <div class="articleFeedback-rating articleFeedback-rating-new" rel="neutral">\ |
54 | 54 | <span class="articleFeedback-label" title-msg="field-neutral-tip"><msg key="field-neutral-label" /></span>\ |
55 | 55 | <div class="articleFeedback-rating-fields articleFeedback-form"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\ |
56 | | - <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label></div>\ |
| 56 | + <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label><div class="articleFeedback-rating-clear"></div></div>\ |
57 | 57 | </div>\ |
58 | | - <div class="articleFeedback-rating" rel="complete">\ |
| 58 | + <div class="articleFeedback-rating articleFeedback-rating-new" rel="complete">\ |
59 | 59 | <span class="articleFeedback-label" title-msg="field-complete-tip"><msg key="field-complete-label" /></span>\ |
60 | 60 | <div class="articleFeedback-rating-fields articleFeedback-form"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\ |
61 | | - <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label></div>\ |
| 61 | + <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label><div class="articleFeedback-rating-clear"></div></div>\ |
62 | 62 | </div>\ |
63 | | - <div class="articleFeedback-rating" rel="readable">\ |
| 63 | + <div class="articleFeedback-rating articleFeedback-rating-new" rel="readable">\ |
64 | 64 | <span class="articleFeedback-label" title-msg="field-readable-tip"><msg key="field-readable-label" /></span>\ |
65 | 65 | <div class="articleFeedback-rating-fields articleFeedback-form"><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /><input type="radio" /></div>\ |
66 | | - <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label></div>\ |
| 66 | + <div class="articleFeedback-rating-labels articleFeedback-form"><label></label><label></label><label></label><label></label><label></label><div class="articleFeedback-rating-clear"></div></div>\ |
67 | 67 | </div>\ |
68 | 68 | <div style="clear:both;"></div>\ |
69 | 69 | </div>\ |
— | — | @@ -110,13 +110,19 @@ |
111 | 111 | .each( function( i ) { |
112 | 112 | $(this) |
113 | 113 | .val( i + 1 ) |
114 | | - .attr( 'id', 'articleFeedback-rating-field-' + rel + '-' + ( i + 1 ) ); |
| 114 | + .attr( |
| 115 | + 'id', |
| 116 | + 'articleFeedback-rating-field-' + rel + '-' + ( i + 1 ) |
| 117 | + ); |
115 | 118 | } ) |
116 | 119 | .end() |
117 | 120 | .find( '.articleFeedback-rating-labels label' ) |
118 | 121 | .each( function( i ) { |
119 | 122 | $(this) |
120 | | - .attr( 'for', 'articleFeedback-rating-field-' + rel + '-' + ( i + 1 ) ); |
| 123 | + .attr( |
| 124 | + 'for', |
| 125 | + 'articleFeedback-rating-field-' + rel + '-' + ( i + 1 ) |
| 126 | + ); |
121 | 127 | } ); |
122 | 128 | } ) |
123 | 129 | .end() |
— | — | @@ -144,15 +150,40 @@ |
145 | 151 | .find( '.articleFeedback-rating-labels label' ) |
146 | 152 | .hover( |
147 | 153 | function() { |
148 | | - $(this).prevAll( 'label' ).andSelf() |
149 | | - .addClass( 'articleFeedback-rating-label-new' ); |
| 154 | + $(this) |
| 155 | + .addClass( 'articleFeedback-rating-label-hover' ) |
| 156 | + .prevAll( 'label' ) |
| 157 | + .andSelf() |
| 158 | + .addClass( 'articleFeedback-rating-label-full' ); |
150 | 159 | }, |
151 | 160 | function() { |
| 161 | + $(this).removeClass( 'articleFeedback-rating-label-hover' ); |
152 | 162 | $.articleFeedback.fn.updateRating.call( |
153 | 163 | $(this).closest( '.articleFeedback-rating' ) |
154 | 164 | ); |
155 | 165 | } |
156 | | - ); |
| 166 | + ) |
| 167 | + .mousedown( function() { |
| 168 | + $(this) |
| 169 | + .addClass( 'articleFeedback-rating-label-down' ) |
| 170 | + .nextAll() |
| 171 | + .removeClass( 'articleFeedback-rating-label-full' ) |
| 172 | + .end() |
| 173 | + .parent() |
| 174 | + .find( '.articleFeedback-rating-clear' ) |
| 175 | + .show(); |
| 176 | + } ) |
| 177 | + .mouseup( function() { |
| 178 | + $(this).removeClass( 'articleFeedback-rating-label-down' ); |
| 179 | + } ) |
| 180 | + .end() |
| 181 | + .find( '.articleFeedback-rating-clear' ) |
| 182 | + .click( function() { |
| 183 | + $(this).hide(); |
| 184 | + var $rating = $(this).closest( '.articleFeedback-rating' ); |
| 185 | + $rating.find( 'input:radio' ).attr( 'checked', false ); |
| 186 | + $.articleFeedback.fn.updateRating.call( $rating ); |
| 187 | + } ); |
157 | 188 | } |
158 | 189 | } |
159 | 190 | }; |