turbolinks-js 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 1.3.3
2
2
  (function() {
3
- var anchoredLink, browserSupportsPushState, cacheCurrentPage, changePage, createDocument, crossOriginLink, currentState, extractLink, extractTitleAndBody, fetchHistory, fetchReplacement, garbageCollectCache, handleClick, ignoreClick, initialized, newTabClick, noTurbolink, nonHtmlLink, pageCache, recallScrollPosition, reflectNewUrl, rememberCurrentState, rememberCurrentUrl, rememberInitialPage, samePageLink, triggerEvent, visit;
3
+ var anchoredLink, browserSupportsPushState, cacheCurrentPage, changePage, constrainPageCacheTo, createDocument, crossOriginLink, currentState, extractLink, extractTitleAndBody, fetchHistory, fetchReplacement, handleClick, ignoreClick, initialized, newTabClick, noTurbolink, nonHtmlLink, pageCache, recallScrollPosition, reflectNewUrl, rememberCurrentState, rememberCurrentUrl, rememberInitialPage, samePageLink, triggerEvent, visit;
4
4
 
5
5
  pageCache = [];
6
6
 
@@ -52,12 +52,12 @@
52
52
  positionY: window.pageYOffset,
53
53
  positionX: window.pageXOffset
54
54
  };
55
- return garbageCollectCache();
55
+ return constrainPageCacheTo(10);
56
56
  };
57
57
 
58
- garbageCollectCache = function() {
59
- if (currentState.position === window.history.length - 1 && pageCache[currentState.position - 10] !== void 0) {
60
- return delete pageCache[currentState.position - 10];
58
+ constrainPageCacheTo = function(limit) {
59
+ if (currentState.position === window.history.length - 1) {
60
+ return delete pageCache[currentState.position - limit];
61
61
  }
62
62
  };
63
63
 
@@ -157,7 +157,7 @@
157
157
  };
158
158
 
159
159
  nonHtmlLink = function(link) {
160
- return link.href.match(/\.[a-z]+$/g) && !link.href.match(/\.html?$/g);
160
+ return link.href.match(/\.[a-z]+(\?.*)?$/g) && !link.href.match(/\.html?(\?.*)?$/g);
161
161
  };
162
162
 
163
163
  noTurbolink = function(link) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbolinks-js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: