diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:15:42 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:44:51 +0100 |
commit | a1789ddde42033f1b05cc4929491214ee6e79383 (patch) | |
tree | 63615735c4ddffaaabf2428946bb26f90899f7bf /resources/src/mediawiki.page/mediawiki.page.image.pagination.js | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.26.0
Diffstat (limited to 'resources/src/mediawiki.page/mediawiki.page.image.pagination.js')
-rw-r--r-- | resources/src/mediawiki.page/mediawiki.page.image.pagination.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/resources/src/mediawiki.page/mediawiki.page.image.pagination.js b/resources/src/mediawiki.page/mediawiki.page.image.pagination.js index 9ad9c30a..49a51dfc 100644 --- a/resources/src/mediawiki.page/mediawiki.page.image.pagination.js +++ b/resources/src/mediawiki.page/mediawiki.page.image.pagination.js @@ -2,6 +2,7 @@ * Implement AJAX navigation for multi-page images so the user may browse without a full page reload. */ ( function ( mw, $ ) { + /*jshint latedef:false */ var jqXhr, $multipageimage, $spinner, cache = {}, cacheOrder = []; @@ -18,11 +19,11 @@ jqXhr = undefined; // Try the cache - if ( cache[url] ) { + if ( cache[ url ] ) { // Update access freshness cacheOrder.splice( $.inArray( url, cacheOrder ), 1 ); cacheOrder.push( url ); - return $.Deferred().resolve( cache[url] ).promise(); + return $.Deferred().resolve( cache[ url ] ).promise(); } // @todo Don't fetch the entire page. Ideally we'd only fetch the content portion or the data @@ -36,12 +37,12 @@ jqXhr = undefined; // Cache the newly loaded page - cache[url] = $contents; + cache[ url ] = $contents; cacheOrder.push( url ); // Remove the oldest entry if we're over the limit if ( cacheOrder.length > 10 ) { - delete cache[ cacheOrder[0] ]; + delete cache[ cacheOrder[ 0 ] ]; cacheOrder = cacheOrder.slice( 1 ); } } ); |