Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -72,6 +72,11 @@ |
73 | 73 | $.articleFeedbackv5.inDialog = false; |
74 | 74 | |
75 | 75 | /** |
| 76 | + * Is form submission enabled? |
| 77 | + */ |
| 78 | + $.articleFeedbackv5.submissionEnabled = false; |
| 79 | + |
| 80 | + /** |
76 | 81 | * The bucket ID is the variation of the Article Feedback form chosen for this |
77 | 82 | * particualar user. It set at load time, but if all else fails, default to |
78 | 83 | * Bucket 6 (no form). |
— | — | @@ -1480,6 +1485,7 @@ |
1481 | 1486 | } else { |
1482 | 1487 | $.articleFeedbackv5.find( '.articleFeedbackv5-pending span' ).hide(); |
1483 | 1488 | } |
| 1489 | + $.articleFeedbackv5.submissionEnabled = state; |
1484 | 1490 | }, |
1485 | 1491 | |
1486 | 1492 | // }}} |
— | — | @@ -2026,6 +2032,7 @@ |
2027 | 2033 | if ( 'enableSubmission' in bucket ) { |
2028 | 2034 | bucket.enableSubmission( state ); |
2029 | 2035 | } |
| 2036 | + $.articleFeedbackv5.submissionEnabled = state; |
2030 | 2037 | }; |
2031 | 2038 | |
2032 | 2039 | // }}} |
— | — | @@ -2145,6 +2152,11 @@ |
2146 | 2153 | */ |
2147 | 2154 | $.articleFeedbackv5.submitForm = function () { |
2148 | 2155 | |
| 2156 | + // Are we allowed to do this? |
| 2157 | + if ( !$.articleFeedbackv5.submissionEnabled ) { |
| 2158 | + return false; |
| 2159 | + } |
| 2160 | + |
2149 | 2161 | // For anonymous users, keep a cookie around so we know they've rated before |
2150 | 2162 | if ( mw.user.anonymous() ) { |
2151 | 2163 | $.cookie( $.articleFeedbackv5.prefix( 'rated' ), 'true', { 'expires': 365, 'path': '/' } ); |