r112255 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112254‎ | r112255 | r112256 >
Date:22:29, 23 February 2012
Author:catrope
Status:ok
Tags:
Comment:
Add a configuration variable for disabling tracking clicks on the toolbar buttons
Modified paths:
  • /trunk/extensions/WikiEditor/WikiEditor.hooks.php (modified) (history)
  • /trunk/extensions/WikiEditor/WikiEditor.php (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiEditor/WikiEditor.php
@@ -46,6 +46,10 @@
4747
4848 );
4949
 50+// If set to true and the ClickTracking extension is installed, track clicks
 51+// on the toolbar buttons
 52+$wgWikiEditorToolbarClickTracking = false;
 53+
5054 /* Setup */
5155
5256 $wgExtensionCredits['other'][] = array(
Index: trunk/extensions/WikiEditor/WikiEditor.hooks.php
@@ -29,6 +29,9 @@
3030 'modules' => array(
3131 'ext.wikiEditor.toolbar',
3232 ),
 33+ 'configurations' => array(
 34+ 'wgWikiEditorToolbarClickTracking',
 35+ ),
3336 ),
3437 'dialogs' => array(
3538 'preferences' => array(
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js
@@ -238,7 +238,7 @@
239239 doAction : function( context, action, source ) {
240240 // Verify that this has been called from a source that's within the toolbar
241241 // 'trackAction' defined in click tracking
242 - if ( $.trackAction !== undefined && source.closest( '.wikiEditor-ui-toolbar' ).size() ) {
 242+ if ( mw.config.get( 'wgWikiEditorToolbarClickTracking' ) && $.trackAction !== undefined && source.closest( '.wikiEditor-ui-toolbar' ).size() ) {
243243 // Build a unique id for this action by tracking the parent rel attributes up to the toolbar level
244244 var rels = [];
245245 var step = source;
@@ -461,7 +461,7 @@
462462 { expires: 30, path: '/' }
463463 );
464464 // Click tracking
465 - if ( $.trackAction !== undefined){
 465+ if ( mw.config.get( 'wgWikiEditorToolbarClickTracking' ) && $.trackAction !== undefined ) {
466466 $.trackAction(section + '.' + $(this).attr('rel'));
467467 }
468468 context.fn.restoreCursorAndScrollTop();
@@ -640,7 +640,7 @@
641641 } );
642642 }
643643 // Click tracking
644 - if ( $.trackAction !== undefined ) {
 644+ if ( mw.config.get( 'wgWikiEditorToolbarClickTracking' ) && $.trackAction !== undefined ) {
645645 $.trackAction( $section.attr('rel') + '.' + ( show ? 'show': 'hide' ) );
646646 }
647647 // Save the currently visible section

Follow-up revisions

RevisionCommit summaryAuthorDate
r1122611.18wmf1: MFT r112254, r112255catrope23:10, 23 February 2012
r1122631.19wmf1: MFT r112254, r112255catrope23:10, 23 February 2012

Status & tagging log