X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.suggestions.js;h=4f4edc96b5fe950cbc784d3ac07331198fac32a6;hb=85ac1b5d7c7ca50a93f2d16639cdde2f46bc133e;hp=fdc8a266adf875d8a70b1a8d27a61e2d90bb61eb;hpb=82524dc4da650c8017767a2648ed92dde98b8cae;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/jquery/jquery.suggestions.js b/resources/src/jquery/jquery.suggestions.js index fdc8a266ad..4f4edc96b5 100644 --- a/resources/src/jquery/jquery.suggestions.js +++ b/resources/src/jquery/jquery.suggestions.js @@ -19,7 +19,6 @@ * @class jQuery.plugin.suggestions */ - // jscs:disable checkParamNames /** * @method suggestions * @chainable @@ -94,9 +93,8 @@ * @param {boolean} [options.highlightInput=false] Whether to highlight matched portions of the * input or not. */ - // jscs:enable checkParamNames -( function ( $ ) { +( function ( $, mw ) { var hasOwn = Object.hasOwnProperty; @@ -178,7 +176,7 @@ context.data.prevText = val; // Try cache first if ( context.config.cache && hasOwn.call( cache, val ) ) { - if ( +new Date() - cache[ val ].timestamp < context.config.cacheMaxAge ) { + if ( mw.now() - cache[ val ].timestamp < context.config.cacheMaxAge ) { context.data.$textbox.suggestions( 'suggestions', cache[ val ].suggestions ); if ( typeof context.config.update.after === 'function' ) { context.config.update.after.call( context.data.$textbox, cache[ val ].metadata ); @@ -203,7 +201,7 @@ cache[ val ] = { suggestions: suggestions, metadata: metadata, - timestamp: +new Date() + timestamp: mw.now() }; } }, @@ -755,7 +753,7 @@ 27, // escape 13, // enter 46, // delete - 8 // backspace + 8 // backspace ]; if ( context.data.keypressedCount === 0 && e.which === context.data.keypressed && @@ -786,4 +784,4 @@ * @mixins jQuery.plugin.suggestions */ -}( jQuery ) ); +}( jQuery, mediaWiki ) );