Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Commit

Permalink
Remove reserved words used as property names; make semicolon use cons…
Browse files Browse the repository at this point in the history
…istent
  • Loading branch information
kevinpet committed Mar 25, 2012
1 parent 78d1f28 commit 99ea95c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions app/assets/javascripts/controllers.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function VaultsCtrl(Blob, Aes) {
this.resource = new Blob();
}
}
Vault.prototype.import = function(data) {
Vault.prototype.importCsv = function(data) {
if (data) {
var lines = data.split('\n');
for (var i = 0; i < lines.length; i++) {
Expand All @@ -84,21 +84,21 @@ function VaultsCtrl(Blob, Aes) {
} else {
this.importing = true;
}
};
}
Vault.prototype.lock = function() {
this.serialize();
this.locked = true;
this.cards = null;
this.progress(null);
};
}
Vault.prototype.locked = true;
Vault.prototype.progress = function (status) {
this.status = status;
self.$eval();
};
}
Vault.prototype.remove = function(card) {
this.cards.splice(this.cards.indexOf(card),1);
};
}
Vault.prototype.serialize = function() {
if (this.locked) {
return;
Expand Down Expand Up @@ -126,15 +126,15 @@ function VaultsCtrl(Blob, Aes) {
this.cards = contents.map(function(c) { return new Card(c); });
this.resource.ctext = null;
this.progress(null);
};
}
Vault.prototype.update = function(info) {
if (!info) {
return;
}
this.resource.name = info.name;
this.resource.crypto = info.crypto;
this.setPassword(info.password);
};
}
var self = this;
Blob.index(function(r, hdrs) {
window._loaded = r;
Expand Down Expand Up @@ -204,7 +204,7 @@ function VaultsCtrl(Blob, Aes) {
}
vault.unlock(ptext);
});
};
}
}
VaultsCtrl.$inject = ['Blob', 'Aes'];

Expand All @@ -231,7 +231,7 @@ function DetailsCtrl() {
}
}
document.getElementById("vaultName").value = args.name;
if (args.new) {
if (args.isNew) {
document.getElementById("createButton").value = "Create";
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/assets/templates/vaults.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<button ng:click="save(selected);lock(selected)">Save and Lock</button>
<button ng:click="save(selected)">Save</button>
<button ng:click="editDetails(selected)">Settings...</button>
<button ng:click="selected.import()">Import...</button>
<button ng:click="selected.importCsv()">Import...</button>
<button ng:click="remove(selected)">Delete...</button>
</div>
<div class="vault-body">
Expand Down Expand Up @@ -81,7 +81,7 @@
Format is: <tt>uuid,group,title,url,user,password,notes</tt><br/>
<textarea name="importData" rows="5" cols="60"/>
<br/>
<button ng:click="selected.import(importData)">Import</button>
<button ng:click="selected.import_csv(Importdata)">Import</button>
</div>
</div>
</div>
Expand Down

0 comments on commit 99ea95c

Please sign in to comment.