jqueryMsg: Add missing '$' prefix to jQuery collection variables
authorEd Sanders <esanders@wikimedia.org>
Thu, 14 Jun 2018 18:41:29 +0000 (19:41 +0100)
committerNikerabbit <niklas.laxstrom@gmail.com>
Thu, 14 Jun 2018 19:00:51 +0000 (19:00 +0000)
Change-Id: Ic39ca379c373e43d885f6ac9df746e25f744f9d9

resources/src/mediawiki.jqueryMsg/mediawiki.jqueryMsg.js

index d81df65..4f9e43a 100644 (file)
         * e.g.
         *
         *        $.fn.msg = mediaWiki.jqueryMsg.getPlugin( options );
-        *        var userlink = $( '<a>' ).click( function () { alert( "hello!!" ) } );
-        *        $( 'p#headline' ).msg( 'hello-user', userlink );
+        *        var $userlink = $( '<a>' ).click( function () { alert( "hello!!" ) } );
+        *        $( 'p#headline' ).msg( 'hello-user', $userlink );
         *
         * N.B. replacements are variadic arguments or an array in second parameter. In other words:
         *    somefunction( a, b, c, d )
         * @return {jQuery}
         */
        mw.Message.prototype.parseDom = ( function () {
-               var reusableParent = $( '<div>' );
+               var $wrapper = $( '<div>' );
                return function () {
-                       return reusableParent.msg( this.key, this.parameters ).contents().detach();
+                       return $wrapper.msg( this.key, this.parameters ).contents().detach();
                };
        }() );