eventlogger module for ULS
Separating event logging out of ULS functionality. Event logging is now loosely coupled with ULS. ULS core modules can emit an event whenever EventLogging is required. The eventlogger module will act on the event if configured. Change-Id: I59dfcfb25c1acb85376b56239f2355ee7c4aff1e
This commit is contained in:
committed by
Amir E. Aharoni
parent
8defd1f4a8
commit
117cc5bf46
@@ -159,18 +159,17 @@
|
||||
new mw.Api().parse( $.i18n( 'ext-uls-display-settings-anon-log-in-cta' ) )
|
||||
.done( function ( parsedCta ) {
|
||||
$loginCta.html( parsedCta );
|
||||
// Because browsers navigate away when clicking a link,
|
||||
// we are are overriding the normal click behavior to
|
||||
// allow the event be logged first - currently there is no
|
||||
// local queue for events. The timeout is there to make sure
|
||||
// the user gets to the new page even if event logging is slow
|
||||
// or fails.
|
||||
$loginCta.find( 'a' ).click( function ( event ) {
|
||||
event.preventDefault();
|
||||
mw.uls.logEvent( { action: 'login-click' }, 500 )
|
||||
.always( function () {
|
||||
window.location.href = event.target.href;
|
||||
} );
|
||||
// Because browsers navigate away when clicking a link,
|
||||
// we are are overriding the normal click behavior to
|
||||
// allow the event be logged first - currently there is no
|
||||
// local queue for events. The timeout is there to make sure
|
||||
// the user gets to the new page even if event logging is slow
|
||||
// or fails.
|
||||
mw.hook( 'mw.uls.login.click' ).fire( function () {
|
||||
window.location.href = event.target.href;
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
@@ -323,10 +322,7 @@
|
||||
|
||||
$moreLanguagesButton.on( 'click', function () {
|
||||
displaySettings.$parent.hide();
|
||||
mw.uls.logEvent( {
|
||||
action: 'more-languages-access',
|
||||
context: 'interface'
|
||||
} );
|
||||
mw.hook( 'mw.uls.interface.morelanguages' ).fire();
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user