Skip to content

Commit

Permalink
release notes and minified version
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick Bailey committed Nov 5, 2011
1 parent 24dcb20 commit 2c79be8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backbone.memento.min.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Backbone.Memento v0.4.0
// Backbone.Memento v0.4.1
//
// Copyright (C)2011 Derick Bailey, Muted Solutions, LLC
// Distributed Under MIT Liscene
Expand All @@ -9,6 +9,6 @@
// ----------------------------
// Backbone.Memento
// ----------------------------
Backbone.Memento=function(h,i){var m=function(b){b instanceof h.Model?(this.removeAttr=function(a){b.unset(a)},this.restore=function(a){b.set(a)}):(this.removeAttr=function(a){b.remove(a)},this.restore=function(a){b.reset(a)})},n=function(b,a){function c(a,b){a=i.clone(a);if(b.hasOwnProperty("ignore")&&b.ignore.length>0)for(var c in b.ignore)delete a[b.ignore[c]];return a}var d=new m(b);this.serialize=function(){var g=b.toJSON();return g=c(g,a)};this.deserialize=function(g,l){var e=l=i.extend({},
a,l);oldAttrs=c(g,e);var f=b.toJSON(),f=c(f,e);var e=oldAttrs,j=[];if(e&&f)for(var k in f)f.hasOwnProperty(k)&&(e.hasOwnProperty(k)||j.push(k));for(var h in j)d.removeAttr(j[h]);d.restore(oldAttrs)}},o=function(){var b;this.push=function(a){b.push(a)};this.pop=function(){return b.pop()};this.rewind=function(){var a=b[0];b=[];return a};b=[]};return function(b,a){this.version="0.4.0";var a=i.extend({ignore:[]},a),c=new n(b,a),d=new o(b,a);this.store=function(){var a=c.serialize();d.push(a)};this.restore=
function(a){var b=d.pop();b&&c.deserialize(b,a)};this.restart=function(a){var b=d.rewind();b&&c.deserialize(b,a)}}}(Backbone,_);
Backbone.Memento=function(h,i){var m=function(b){b instanceof h.Model?(this.removeAttr=function(a){b.unset(a)},this.restore=function(a){b.set(a)}):(this.removeAttr=function(a){b.remove(a)},this.restore=function(a){b.reset(a)})},n=function(b,a){function d(a,b){a=i.clone(a);if(b.hasOwnProperty("ignore")&&b.ignore.length>0)for(var c in b.ignore)delete a[b.ignore[c]];return a}var f=new m(b);this.serialize=function(){var g=b.toJSON();return g=d(g,a)};this.deserialize=function(g,l){var c=l=i.extend({},
a,l),j=d(g,c),e=b.toJSON(),e=d(e,c);c=e;e=[];if(j&&c)for(var k in c)c.hasOwnProperty(k)&&(j.hasOwnProperty(k)||e.push(k));for(var h in e)f.removeAttr(e[h]);f.restore(j)}},o=function(){var b;this.push=function(a){b.push(a)};this.pop=function(){return b.pop()};this.rewind=function(){var a=b[0];b=[];return a};b=[]};return function(b,a){this.version="0.4.1";var a=i.extend({ignore:[]},a),d=new n(b,a),f=new o(b,a);this.store=function(){var a=d.serialize();f.push(a)};this.restore=function(a){var b=f.pop();
b&&d.deserialize(b,a)};this.restart=function(a){var b=f.rewind();b&&d.deserialize(b,a)}}}(Backbone,_);
11 changes: 11 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,17 @@ myModel.get("bar"); // => undefined, as the attribute does not exist
# Release Notes
## v0.4.1
* Fixed global scope leak for a variable
## v0.4.0
* **Breaking Change:** Removed the `reset` method in favor of `restart`
* Majore rewrite of the internal code
* Produced screencast showing refacoring of this project: http://watchmecode.net/refactoring-javascript
* Blogged some additional info on refactoring this project: http://lostechies.com/derickbailey/2011/10/25/rebuilding-my-backbone-js-plugins-with-modules-srp-and-more/
## v0.3.0
* changed the public memento API to support collections
Expand Down

0 comments on commit 2c79be8

Please sign in to comment.