cosmetic cleanup, mostly in encryption

This commit is contained in:
azivner
2017-11-08 22:33:08 -05:00
parent cd5f742a7b
commit 4efa00f36b
12 changed files with 74 additions and 80 deletions

View File

@@ -16,7 +16,7 @@ const eventLog = (function() {
const result = await $.ajax({
url: baseApiUrl + 'event-log',
type: 'GET',
error: () => error("Error getting event log.")
error: () => showError("Error getting event log.")
});
listEl.html('');

View File

@@ -27,7 +27,7 @@ const noteHistory = (function() {
historyItems = await $.ajax({
url: baseApiUrl + 'notes-history/' + noteId,
type: 'GET',
error: () => error("Error getting note history.")
error: () => showError("Error getting note history.")
});
for (const item of historyItems) {

View File

@@ -15,7 +15,7 @@ const recentChanges = (function() {
const result = await $.ajax({
url: baseApiUrl + 'recent-changes/',
type: 'GET',
error: () => error("Error getting recent changes.")
error: () => showError("Error getting recent changes.")
});
dialogEl.html('');

View File

@@ -11,7 +11,7 @@ const recentNotes = (function() {
$.ajax({
url: baseApiUrl + 'recent-notes',
type: 'GET',
error: () => error("Error getting recent notes.")
error: () => showError("Error getting recent notes.")
}).then(result => {
list = result.map(r => r.note_id);
});
@@ -23,7 +23,7 @@ const recentNotes = (function() {
$.ajax({
url: baseApiUrl + 'recent-notes/' + noteTreeId,
type: 'PUT',
error: () => error("Error setting recent notes.")
error: () => showError("Error setting recent notes.")
}).then(result => {
list = result.map(r => r.note_id);
});
@@ -35,7 +35,7 @@ const recentNotes = (function() {
$.ajax({
url: baseApiUrl + 'recent-notes/' + noteIdToRemove,
type: 'DELETE',
error: () => error("Error removing note from recent notes.")
error: () => showError("Error removing note from recent notes.")
}).then(result => {
list = result.map(r => r.note_id);
});

View File

@@ -16,7 +16,7 @@ const settings = (function() {
const settings = await $.ajax({
url: baseApiUrl + 'settings',
type: 'GET',
error: () => error("Error getting settings.")
error: () => showError("Error getting settings.")
});
dialogEl.dialog({
@@ -41,7 +41,7 @@ const settings = (function() {
}),
contentType: "application/json",
success: () => {
message("Settings change have been saved.");
showMessage("Settings change have been saved.");
},
error: () => alert("Error occurred during saving settings change.")
});
@@ -95,10 +95,10 @@ settings.addModule((function() {
encryption.setEncryptedDataKey(result.new_encrypted_data_key);
}
else {
error(result.message);
showError(result.message);
}
},
error: () => error("Error occurred during changing password.")
error: () => showError("Error occurred during changing password.")
});
return false;