Index: trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js |
— | — | @@ -65,7 +65,9 @@ |
66 | 66 | .find('.mw-ac-interstitial') |
67 | 67 | .hide(); |
68 | 68 | |
69 | | - if ( ! $(this).parent().find('.mw-ac-interstitial').length ) { |
| 69 | + if ( ! $(this).parent().find('.mw-ac-interstitial').length || |
| 70 | + ac.isInterstitialDisabled($(this).data('ac-button')) |
| 71 | + ) { |
70 | 72 | ac.executeAction( $(this).data('ac-button' ) ); |
71 | 73 | return; |
72 | 74 | } |
— | — | @@ -121,6 +123,10 @@ |
122 | 124 | }, |
123 | 125 | |
124 | 126 | executeAction : function( action ) { |
| 127 | + if ( $('#mw-ac-create-dismiss').is(':checked') ) { |
| 128 | + ac.disableInterstitial( action ); |
| 129 | + } |
| 130 | + |
125 | 131 | var article = wgPageName.substr( wgPageName.indexOf('/') + 1 ); |
126 | 132 | var urlTemplate = ac.config['action-url'][action]; |
127 | 133 | |
— | — | @@ -129,6 +135,19 @@ |
130 | 136 | urlTemplate = urlTemplate.replace( '{{SCRIPT}}', wgScript ); |
131 | 137 | |
132 | 138 | window.location.href = urlTemplate; |
| 139 | + }, |
| 140 | + |
| 141 | + disableInterstitial : function(button) { |
| 142 | + $.cookie( 'mw:ac:disabled-interstitial:'+button, 1, |
| 143 | + { expires : 365, path : '/' } ); |
| 144 | + }, |
| 145 | + |
| 146 | + isInterstitialDisabled : function(button) { |
| 147 | + if ( $.cookie('mw:ac:disabled-interstitial:'+button) ) { |
| 148 | + return true; |
| 149 | + } |
| 150 | + |
| 151 | + return false; |
133 | 152 | } |
134 | 153 | |
135 | 154 | }); |