Skip to content

Commit

Permalink
added function to update pre-backbone templates
Browse files Browse the repository at this point in the history
  • Loading branch information
llad committed May 16, 2011
1 parent a189fd5 commit d7c00a2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions code.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,34 @@ $(function(){
}
});
});

//update any pre-Backbone plts
(function updateOld() {
if (!localStorage.versionEmpltz || localStorage.versionEmpltz === '0.8') {
for (var j = 0; j < localStorage.length; j++) {
var key = localStorage.key(j);

if (key.indexOf('empltz.') !== -1) {
var p = {};
p = JSON.parse(localStorage.getItem(localStorage.key(j)));
if (p.type === undefined) {
p.type = 'mailto';
}
p.to = p.To;
delete p.To;
p.subject = p.Subject;
delete p.Subject;
p.body = p.Body;
delete p.Body;
p.order = Pltz.nextOrder();
Pltz.create(p);
localStorage.versionEmpltz = '0.9';
}
}
}

})();


// Finally, we kick things off by creating the **App**.
window.App = new AppView();
Expand Down

0 comments on commit d7c00a2

Please sign in to comment.