X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.localize.js;h=f5932b246fd446b62c66aba0d53058b7410f7615;hb=d409c2cd661fefd9724fc480e5505865359c0dbb;hp=f499e109834d61e60b18d4cd39d5a052ba937672;hpb=a8304d4c73fd04c338ae23f3028fc475921cc0fa;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/jquery/jquery.localize.js b/resources/src/jquery/jquery.localize.js index f499e10983..f5932b246f 100644 --- a/resources/src/jquery/jquery.localize.js +++ b/resources/src/jquery/jquery.localize.js @@ -5,16 +5,16 @@ /** * Gets a localized message, using parameters from options if present. - * @ignore * + * @ignore * @param {Object} options * @param {string} key * @return {string} Localized message */ function msg( options, key ) { - var args = options.params[key] || []; + var args = options.params[ key ] || []; // Format: mw.msg( key [, p1, p2, ...] ) - args.unshift( options.prefix + ( options.keys[key] || key ) ); + args.unshift( options.prefix + ( options.keys[ key ] || key ) ); return mw.msg.apply( mw, args ); } @@ -108,7 +108,7 @@ function msg( options, key ) { */ $.fn.localize = function ( options ) { var $target = this, - attributes = ['title', 'alt', 'placeholder']; + attributes = [ 'title', 'alt', 'placeholder' ]; // Extend options options = $.extend( { @@ -123,7 +123,7 @@ $.fn.localize = function ( options ) { // for 'html:msg' turns up the 'html:msg', but searching for 'msg' doesn't. So searching for // both 'msg' and 'html:msg' seems to get the job done. This feels pretty icky, though. $target.find( 'msg,html\\:msg' ).each( function () { - var $el = $(this); + var $el = $( this ); // Escape by default if ( $el.attr( 'raw' ) ) { $el.html( msg( options, $el.attr( 'key' ) ) ); @@ -140,7 +140,7 @@ $.fn.localize = function ( options ) { $.each( attributes, function ( i, attr ) { var msgAttr = attr + '-msg'; $target.find( '[' + msgAttr + ']' ).each( function () { - var $el = $(this); + var $el = $( this ); $el.attr( attr, msg( options, $el.attr( msgAttr ) ) ).removeAttr( msgAttr ); } ); } );