From 1f66cb22bc36986ad3c3acb504a595f6eecec88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 16 Jul 2013 12:02:31 +0000 Subject: [PATCH] Log no-search-results event Change-Id: Ia272a6783d56c75ba775d71195104aad21214121 --- resources/js/ext.uls.eventlogger.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/resources/js/ext.uls.eventlogger.js b/resources/js/ext.uls.eventlogger.js index 8a65935b..abb0afb2 100644 --- a/resources/js/ext.uls.eventlogger.js +++ b/resources/js/ext.uls.eventlogger.js @@ -92,16 +92,19 @@ mw.hook( 'mw.uls.interface.morelanguages' ).add( $.proxy( this.interfaceMoreLanguages, this ) ); mw.hook( 'mw.uls.interface.language.change' ).add( $.proxy( this.interfaceLanguageChange, this ) ); mw.hook( 'mw.uls.font.change' ).add( $.proxy( this.fontChange, this ) ); + $( 'body' ).on( 'noresults.uls', '.uls-menu .languagefilter', + $.proxy( this.noSearchResults, this ) + ); }, /** * Log language settings open - * @param {Array} args + * @param {string} context Where it was opened from */ - ulsSettingsOpen: function ( args ) { + ulsSettingsOpen: function ( context ) { this.log( { action: 'settings-open', - context: args + context: context } ); }, @@ -179,7 +182,7 @@ /** * Log font preference changes * - * @param {Object} context Either 'interface' or 'content' + * @param {string} context Either 'interface' or 'content' * @param {string} language * @param {string} font */ @@ -200,6 +203,18 @@ } this.log( logParams ); + }, + + /** + * Log search strings which produce no search results. + * @param {jQuery.event} event The orignal event + * @param {string} context The query string + */ + noSearchResults: function ( event, context ) { + this.log( { + action: 'no-search-results', + context: context + } ); } };