Index: trunk/phase3/resources/jquery/images/spinner.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Index: trunk/phase3/resources/jquery/jquery.spinner.css |
— | — | @@ -1,8 +1,8 @@ |
2 | | -.loading-spinner { |
| 2 | +.mw-spinner { |
3 | 3 | /* @embed */ |
4 | | - background: transparent url('images/spinner.gif'); |
5 | | - height: 16px; |
6 | | - width: 16px; |
| 4 | + background: transparent url(images/spinner.gif); |
| 5 | + height: 20px; |
| 6 | + width: 20px; |
7 | 7 | display: inline-block; |
8 | 8 | vertical-align: middle; |
9 | 9 | } |
\ No newline at end of file |
Index: trunk/phase3/resources/jquery/jquery.spinner.js |
— | — | @@ -1,42 +1,45 @@ |
2 | 2 | /** |
3 | | - * Functions to replace injectSpinner which makes img tags with spinners |
| 3 | + * jQuery spinner |
| 4 | + * |
| 5 | + * Simple jQuery plugin to create, inject and remove spinners. |
4 | 6 | */ |
5 | 7 | ( function( $ ) { |
6 | 8 | |
7 | 9 | $.extend( { |
8 | 10 | /** |
9 | | - * Creates a spinner element |
| 11 | + * Creates a spinner element. |
10 | 12 | * |
11 | | - * @param id String id of the spinner |
12 | | - * @return jQuery spinner |
| 13 | + * @param id {String} id of the spinner |
| 14 | + * @return {jQuery} spinner |
13 | 15 | */ |
14 | 16 | createSpinner: function( id ) { |
15 | | - return $( '<div/>' ) |
16 | | - .attr({ |
17 | | - id: 'mw-spinner-' + id, |
18 | | - class: 'loading-spinner', |
19 | | - title: '...', |
20 | | - alt: '...' |
21 | | - }); |
| 17 | + return $( '<div>' ).attr( { |
| 18 | + id: 'mw-spinner-' + id, |
| 19 | + 'class': 'mw-spinner', |
| 20 | + title: '...', |
| 21 | + alt: '...' |
| 22 | + } ); |
22 | 23 | }, |
23 | 24 | |
24 | 25 | /** |
25 | | - * Removes a spinner element |
| 26 | + * Removes a spinner element. |
26 | 27 | * |
27 | | - * @param id |
| 28 | + * @param id {String} |
| 29 | + * @return {jQuery} spinner |
28 | 30 | */ |
29 | 31 | removeSpinner: function( id ) { |
30 | | - $( '#mw-spinner-' + id ).remove(); |
| 32 | + return $( '#mw-spinner-' + id ).remove(); |
31 | 33 | } |
32 | 34 | } ); |
33 | 35 | |
34 | 36 | /** |
35 | | - * Injects a spinner after the given objects |
| 37 | + * Injects a spinner after the elements in the jQuery collection. |
36 | 38 | * |
37 | 39 | * @param id String id of the spinner |
| 40 | + * @return {jQuery} |
38 | 41 | */ |
39 | 42 | $.fn.injectSpinner = function( id ) { |
40 | 43 | return this.after( $.createSpinner( id ) ); |
41 | 44 | }; |
42 | 45 | |
43 | | -} )( jQuery ); |
\ No newline at end of file |
| 46 | +} )( jQuery ); |