From cd8c352d2e7c33939f35f096561c2f4a30f984d2 Mon Sep 17 00:00:00 2001 From: Ingmar Hergst Date: Wed, 29 Apr 2015 00:13:26 +0200 Subject: [PATCH] Increment version number and update minified file --- backbone.viewcache.js | 2 +- backbone.viewcache.min.js | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backbone.viewcache.js b/backbone.viewcache.js index a66096b..4eb627a 100644 --- a/backbone.viewcache.js +++ b/backbone.viewcache.js @@ -1,5 +1,5 @@ /*! - * backbone.viewcache.js v1.1.0 + * backbone.viewcache.js v1.1.1 * Copyright 2015, Ingmar Hergst * backbone.viewcache.js may be freely distributed under the MIT license. */ diff --git a/backbone.viewcache.min.js b/backbone.viewcache.min.js index 6804656..fb6536f 100644 --- a/backbone.viewcache.min.js +++ b/backbone.viewcache.min.js @@ -1,6 +1,6 @@ /*! - * backbone.viewcache.js v1.1.0 + * backbone.viewcache.js v1.1.1 * Copyright 2015, Ingmar Hergst * backbone.viewcache.js may be freely distributed under the MIT license. */ -!function(e,o){if("function"==typeof define&&define.amd)define(["backbone","underscore","jquery"],o);else if("object"==typeof exports){var n=require("backbone"),r=require("underscore");n.$=n.$||require("jquery"),module.exports=o(n,r,n.$)}else o(e.Backbone,e._,e.Backbone.$)}(this,function(e,o,n,r){function i(){var e=h.checkExpireds||h.cacheExpiry;e&&(f=o.now()+1e3*e)}function c(o,n){var r;h.retainScrollPosition&&(r=e.ViewCache.get(n),r&&r[o+"ScrollPosition"]())}function t(e){delete d[e]}function s(e){var n=d[e],r=n&&n._cacheExpiry;r&&o.now()>r&&t(e)}function l(e){var o,n=e?s:t;for(o in d)d.hasOwnProperty(o)&&n(o)}function a(n){return o.isUndefined(n)?e.history.fragment:n}var u,f,p={retainScrollPosition:!0,scrollElement:window,cacheExpiry:r,checkExpireds:r,scrollToTopByDefault:!0},h=p,d={},y=!1;return o.extend(e.View.prototype,{saveScrollPosition:function(){this._scrollPosition=n(h.scrollElement).scrollTop()},restoreScrollPosition:function(){this._scrollPosition?n(h.scrollElement).scrollTop(this._scrollPosition):h.scrollToTopByDefault&&n(h.scrollElement).scrollTop(0)},setCacheExpiry:function(e){e&&(this._cacheExpiry=o.now()+1e3*e,y=!0)}}),e.ViewCache={config:function(e){return e&&(e.checkExpireds||(e.checkExpireds=e.cacheExpiry||p.cacheExpiry),h=o.defaults(e,p)),h},get:function(e){return e=a(e),s(e),d[e]},set:function(e,o){return o=a(o),e.setCacheExpiry(h.cacheExpiry),y&&i(),d[o]=e,e},remove:function(e){e=a(e),t(e)},clear:l,clearExpireds:function(){l(!0)},beforeRoute:function(){o.isUndefined(u)||(c("save",u),this.lastUrlFragment=u,y&&o.now()>f&&(l(!0),i()))},afterRoute:function(){var e=a();c("restore",e),u=e}},e.ViewCache}); \ No newline at end of file +!function(e,o){if("function"==typeof define&&define.amd)define(["backbone","underscore","jquery"],o);else if("object"==typeof exports){var r=require("backbone"),n=require("underscore");r.$=r.$||require("jquery"),module.exports=o(r,n,r.$)}else o(e.Backbone,e._,e.Backbone.$)}(this,function(e,o,r,n){function i(){var e=h.checkExpireds||h.cacheExpiry;e&&(f=o.now()+1e3*e)}function c(o,r){var n;h.retainScrollPosition&&(n=e.ViewCache.get(r),n&&n[o+"ScrollPosition"]())}function t(e){delete y[e]}function s(e){var r=y[e],n=r&&r._cacheExpiry;n&&o.now()>n&&t(e)}function l(e){var o,r=e?s:t;for(o in y)y.hasOwnProperty(o)&&r(o)}function a(r){return o.isString(r)?r:e.history.fragment}var u,f,p={retainScrollPosition:!0,scrollElement:window,cacheExpiry:n,checkExpireds:n,scrollToTopByDefault:!0},h=p,y={};return o.extend(e.View.prototype,{saveScrollPosition:function(){this._scrollPosition=r(h.scrollElement).scrollTop()},restoreScrollPosition:function(){this._scrollPosition?r(h.scrollElement).scrollTop(this._scrollPosition):h.scrollToTopByDefault&&r(h.scrollElement).scrollTop(0)},setCacheExpiry:function(e){e&&(this._cacheExpiry=o.now()+1e3*e)}}),e.ViewCache={config:function(e){return e&&(e.checkExpireds||(e.checkExpireds=e.cacheExpiry||p.cacheExpiry),h=o.defaults(e,p)),h},get:function(e){return e=a(e),s(e),y[e]},set:function(e,r,n){return o.isBoolean(r)&&(n=r),r=a(r),(!e._cacheExpiry||n)&&e.setCacheExpiry(h.cacheExpiry),!f&&e._cacheExpiry&&i(),y[r]=e,e},remove:function(e){e=a(e),t(e)},clear:function(){l()},clearExpireds:function(){l(!0)},beforeRoute:function(){o.isUndefined(u)||(c("save",u),this.lastUrlFragment=u,f&&o.now()>f&&(l(!0),i()))},afterRoute:function(){var e=a();c("restore",e),u=e}},e.ViewCache}); \ No newline at end of file diff --git a/package.json b/package.json index 7d21051..423bde1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "backbone.viewcache", "description": "Maintains a simple cache of Backbone views, retaining the view’s scroll position by default.", - "version": "1.1.0", + "version": "1.1.1", "author": "Ingmar Hergst", "license": "MIT", "main": "backbone.viewcache.js",