diff options
Diffstat (limited to 'Thanks/modules/ext.thanks.thank.js')
-rw-r--r-- | Thanks/modules/ext.thanks.thank.js | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Thanks/modules/ext.thanks.thank.js b/Thanks/modules/ext.thanks.thank.js index 2a0deb58..ca5c46dd 100644 --- a/Thanks/modules/ext.thanks.thank.js +++ b/Thanks/modules/ext.thanks.thank.js @@ -1,4 +1,4 @@ -( function ( $, mw ) { +( function () { 'use strict'; mw.thanks = { @@ -9,7 +9,7 @@ attrName: 'data-revision-id', load: function () { - var cookie = $.cookie( this.cookieName ); + var cookie = mw.cookie.get( this.cookieName ); if ( cookie === null ) { return []; } @@ -22,16 +22,11 @@ if ( saved.length > this.maxHistory ) { // prevent forever growing saved = saved.slice( saved.length - this.maxHistory ); } - $.cookie( this.cookieName, escape( saved.join( ',' ) ) ); + mw.cookie.set( this.cookieName, escape( saved.join( ',' ) ) ); }, contains: function ( $thankLink ) { - // $.inArray returns the index position or -1 if non-existant - if ( $.inArray( $thankLink.attr( this.attrName ), this.load() ) !== -1 ) { - return true; - } else { - return false; - } + return this.load().indexOf( $thankLink.attr( this.attrName ) ) !== -1; } }, @@ -62,4 +57,4 @@ } }; -}( jQuery, mediaWiki ) ); +}() ); |