Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js |
— | — | @@ -249,10 +249,12 @@ |
250 | 250 | 'edit': { |
251 | 251 | 'condition': function() { |
252 | 252 | // An empty restrictions array means anyone can edit |
253 | | - if ( wgRestrictionEdit.length ) { |
| 253 | + var restrictions = mediaWiki.config.get( 'wgRestrictionEdit' ); |
| 254 | + var groups = mediaWiki.config.get( 'wgUserGroups' ); |
| 255 | + if ( restrictions.length ) { |
254 | 256 | // Verify that each restriction exists in the user's groups |
255 | | - for ( var i = 0; i < wgRestrictionEdit.length; i++ ) { |
256 | | - if ( !$.inArray( wgRestrictionEdit[i], wgUserGroups ) ) { |
| 257 | + for ( var i = 0; i < restrictions.length; i++ ) { |
| 258 | + if ( !$.inArray( restrictions[i], groups ) ) { |
257 | 259 | return false; |
258 | 260 | } |
259 | 261 | } |
— | — | @@ -288,6 +290,10 @@ |
289 | 291 | .find( '#t-articlefeedback a' ) |
290 | 292 | .text( mw.msg( 'articlefeedback-form-switch-label' ) ) |
291 | 293 | .click( function() { |
| 294 | + // Track the click so we can figure out how useful this is |
| 295 | + if ( typeof $.trackActionWithInfo == 'function' ) { |
| 296 | + $.trackActionWithInfo( 'articlefeedback-toolbox-link', mediaWiki.config.get( 'wgTitle' ) ) |
| 297 | + } |
292 | 298 | // Get the image, set the count and an interval. |
293 | 299 | var $box = $( '#mw-articlefeedback' ); |
294 | 300 | var count = 0; |