Skip to content

Commit

Permalink
reset
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Mar 29, 2012
1 parent 3818e79 commit b5471bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions site/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ <h3>You will run out of money in</h3>
<h3>Enter your own numbers</h3>

<div data-role="controlgroup" data-type="horizontal">
<a href="#income" data-role="button" data-transition="slide" style="width:142px;font-size:0.9em">Income</a>
<a href="#expend" data-role="button" data-transition="slide" style="width:142px;font-size:0.9em">Expenditure</a>
<a href="#income" data-role="button" data-transition="slide" style="width:92px;font-size:0.7em">Income</a>
<a href="#expend" data-role="button" data-transition="slide" style="width:92px;font-size:0.7em">Expend</a>
<a onclick="localStorage.clear();window.location='/'" data-role="button" data-transition="slide" style="width:92px;font-size:0.7em">Reset</a>
</div>
</div>

Expand Down
9 changes: 5 additions & 4 deletions site/public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ bb.init = function() {
},

calcdeath: function(){
//console.log('calcdeath')

var self = this
var death = new Date()
self.sortlist(function(list){
Expand All @@ -78,7 +76,6 @@ bb.init = function() {
balance += (('expend'==entry.type?-1:1) * entry.amount)

if( last_type == entry.type ) {
console.log('last '+(('expend'==last_type?1:-1) * ('expend'==last_type?last_income:last_expend)))
balance += (('expend'==last_type?1:-1) * ('expend'==last_type?last_income:last_expend))
}

Expand All @@ -98,7 +95,7 @@ bb.init = function() {
last_income = entry.amount
}

//console.log('bal='+balance+' e='+JSON.stringify(entry)+' lt='+last_type+' le='+last_expend+' li='+last_income)

}

if( 0 < balance ) {
Expand Down Expand Up @@ -221,6 +218,10 @@ bb.init = function() {
if( err) return console.log(err);

entry.amount = parseInt(input_amount.val(),10)
if( isNaN(entry.amount) ) {
entry.amount = 0
input_amount.val(0)
}

app.dc.save(entry,function(err){
if( err) return console.log(err);
Expand Down
1 change: 0 additions & 1 deletion site/public/js/data-capsule-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ function DataCapsule( opt ) {
store.setItem(version_key,''+self.version)
store.setItem(ids_key,JSON.stringify(self.item_ids))
var out = {down:update_ids,up:change_ids,ids:server_ids,version:self.version}
console.log(out)
cb && cb(out)
}
}
Expand Down

0 comments on commit b5471bb

Please sign in to comment.