mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-24 00:06:49 +00:00
Add a configuration variable for disabling tracking clicks on the toolbar buttons
This commit is contained in:
parent
462c74edd9
commit
f26acc15c7
Notes:
Roan Kattouw
2012-02-23 22:29:37 +00:00
|
@ -29,6 +29,9 @@ class WikiEditorHooks {
|
|||
'modules' => array(
|
||||
'ext.wikiEditor.toolbar',
|
||||
),
|
||||
'configurations' => array(
|
||||
'wgWikiEditorToolbarClickTracking',
|
||||
),
|
||||
),
|
||||
'dialogs' => array(
|
||||
'preferences' => array(
|
||||
|
|
|
@ -46,6 +46,10 @@ $wgWikiEditorFeatures = array(
|
|||
|
||||
);
|
||||
|
||||
// If set to true and the ClickTracking extension is installed, track clicks
|
||||
// on the toolbar buttons
|
||||
$wgWikiEditorToolbarClickTracking = false;
|
||||
|
||||
/* Setup */
|
||||
|
||||
$wgExtensionCredits['other'][] = array(
|
||||
|
|
|
@ -238,7 +238,7 @@ fn: {
|
|||
doAction : function( context, action, source ) {
|
||||
// Verify that this has been called from a source that's within the toolbar
|
||||
// 'trackAction' defined in click tracking
|
||||
if ( $.trackAction !== undefined && source.closest( '.wikiEditor-ui-toolbar' ).size() ) {
|
||||
if ( mw.config.get( 'wgWikiEditorToolbarClickTracking' ) && $.trackAction !== undefined && source.closest( '.wikiEditor-ui-toolbar' ).size() ) {
|
||||
// Build a unique id for this action by tracking the parent rel attributes up to the toolbar level
|
||||
var rels = [];
|
||||
var step = source;
|
||||
|
@ -461,7 +461,7 @@ fn: {
|
|||
{ expires: 30, path: '/' }
|
||||
);
|
||||
// Click tracking
|
||||
if ( $.trackAction !== undefined){
|
||||
if ( mw.config.get( 'wgWikiEditorToolbarClickTracking' ) && $.trackAction !== undefined ) {
|
||||
$.trackAction(section + '.' + $(this).attr('rel'));
|
||||
}
|
||||
context.fn.restoreCursorAndScrollTop();
|
||||
|
@ -640,7 +640,7 @@ fn: {
|
|||
} );
|
||||
}
|
||||
// Click tracking
|
||||
if ( $.trackAction !== undefined ) {
|
||||
if ( mw.config.get( 'wgWikiEditorToolbarClickTracking' ) && $.trackAction !== undefined ) {
|
||||
$.trackAction( $section.attr('rel') + '.' + ( show ? 'show': 'hide' ) );
|
||||
}
|
||||
// Save the currently visible section
|
||||
|
|
Loading…
Reference in a new issue