Index: trunk/extensions/Contest/resources/contest.special.contest.js |
— | — | @@ -1,15 +1,15 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | 10 | (function( $, mw ) { $( document ).ready( function() { |
11 | | - |
| 11 | + |
12 | 12 | var _this = this; |
13 | | - |
| 13 | + |
14 | 14 | this.sendReminder = function( callback ) { |
15 | 15 | var requestArgs = { |
16 | 16 | 'action': 'mailcontestants', |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | 'token': $( '#send-reminder' ).attr( 'data-token' ), |
19 | 19 | 'contestids': $( '#send-reminder' ).attr( 'data-contest-id' ) |
20 | 20 | }; |
21 | | - |
| 21 | + |
22 | 22 | $.post( |
23 | 23 | wgScriptPath + '/api.php', |
24 | 24 | requestArgs, |
— | — | @@ -26,10 +26,10 @@ |
27 | 27 | } |
28 | 28 | ); |
29 | 29 | }; |
30 | | - |
| 30 | + |
31 | 31 | this.showReminderDialog = function() { |
32 | 32 | var $dialog = null; |
33 | | - |
| 33 | + |
34 | 34 | $dialog = $( '<div />' ).html( '' ).dialog( { |
35 | 35 | 'title': mw.msg( 'contest-contest-reminder-title' ), |
36 | 36 | 'minWidth': 550, |
— | — | @@ -40,10 +40,10 @@ |
41 | 41 | 'click': function() { |
42 | 42 | var $send = $( '#reminder-send-button' ); |
43 | 43 | var $cancel = $( '#reminder-cancel-button' ); |
44 | | - |
| 44 | + |
45 | 45 | $send.button( 'option', 'disabled', true ); |
46 | 46 | $send.button( 'option', 'label', mw.msg( 'contest-contest-reminder-sending' ) ); |
47 | | - |
| 47 | + |
48 | 48 | _this.sendReminder( function( data ) { |
49 | 49 | if ( data.success ) { |
50 | 50 | $dialog.text( mw.msg( 'contest-contest-reminder-success', data.contestantcount ) ); |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | else { |
55 | 55 | $send.button( 'option', 'label', mw.msg( 'contest-contest-reminder-retry' ) ); |
56 | 56 | $send.button( 'option', 'disabled', false ); |
57 | | - |
| 57 | + |
58 | 58 | alert( mw.msg( 'contest-contest-reminder-failed' ) ); |
59 | 59 | } |
60 | 60 | } ); |
— | — | @@ -68,18 +68,18 @@ |
69 | 69 | } |
70 | 70 | ] |
71 | 71 | } ); |
72 | | - |
| 72 | + |
73 | 73 | $dialog.append( $( '<p />' ).text( mw.msg( 'contest-contest-reminder-preview' ) ) ).append( '<hr />' ); |
74 | | - |
| 74 | + |
75 | 75 | $dialog.append( $( '<p />' ) |
76 | 76 | .html( $( '<b />' ) |
77 | 77 | .text( mw.msg( 'contest-contest-reminder-subject' ) ) ) |
78 | 78 | .append( ' ' + $( '#send-reminder' ).attr( 'data-reminder-subject' ) ) ) |
79 | 79 | .append( '<hr />' ); |
80 | | - |
81 | | - $dialog.append( $( '#reminder-content' ).html() ); |
| 80 | + |
| 81 | + $dialog.append( $( '#reminder-content' ).html() ); |
82 | 82 | }; |
83 | | - |
| 83 | + |
84 | 84 | $( '#send-reminder' ).button().click( this.showReminderDialog ); |
85 | | - |
86 | | -} ); })( window.jQuery, window.mediaWiki ); |
\ No newline at end of file |
| 85 | + |
| 86 | +} ); })( window.jQuery, window.mediaWiki ); |