renamed db columns to camelCase

This commit is contained in:
azivner
2018-01-28 19:30:14 -05:00
parent 55d8ef7e81
commit 3b1f928fbc
58 changed files with 778 additions and 778 deletions

View File

@@ -19,7 +19,7 @@ const attributesDialog = (function() {
this.addNewRow = function() {
self.attributes.push({
attribute_id: '',
attributeId: '',
name: '',
value: ''
});

View File

@@ -18,11 +18,11 @@ const editTreePrefix = (function() {
const currentNode = noteTree.getCurrentNode();
noteTreeId = currentNode.data.note_tree_id;
noteTreeId = currentNode.data.noteTreeId;
treePrefixInputEl.val(currentNode.data.prefix).focus();
const noteTitle = noteTree.getNoteTitle(currentNode.data.note_id);
const noteTitle = noteTree.getNoteTitle(currentNode.data.noteId);
noteTitleEl.html(noteTitle);
}

View File

@@ -18,10 +18,10 @@ const eventLog = (function() {
listEl.html('');
for (const event of result) {
const dateTime = formatDateTime(parseDate(event.date_added));
const dateTime = formatDateTime(parseDate(event.dateAdded));
if (event.note_id) {
const noteLink = link.createNoteLink(event.note_id).prop('outerHTML');
if (event.noteId) {
const noteLink = link.createNoteLink(event.noteId).prop('outerHTML');
event.comment = event.comment.replace('<note>', noteLink);
}

View File

@@ -27,10 +27,10 @@ const noteHistory = (function() {
historyItems = await server.get('notes-history/' + noteId);
for (const item of historyItems) {
const dateModified = parseDate(item.date_modified_from);
const dateModified = parseDate(item.dateModifiedFrom);
listEl.append($('<option>', {
value: item.note_history_id,
value: item.noteHistoryId,
text: formatDateTime(dateModified)
}));
}
@@ -56,10 +56,10 @@ const noteHistory = (function() {
listEl.on('change', () => {
const optVal = listEl.find(":selected").val();
const historyItem = historyItems.find(r => r.note_history_id === optVal);
const historyItem = historyItems.find(r => r.noteHistoryId === optVal);
titleEl.html(historyItem.note_title);
contentEl.html(historyItem.note_text);
titleEl.html(historyItem.title);
contentEl.html(historyItem.content);
});
$(document).on('click', "a[action='note-history']", event => {

View File

@@ -13,7 +13,7 @@ const noteSource = (function() {
height: 500
});
const noteText = noteEditor.getCurrentNote().detail.note_text;
const noteText = noteEditor.getCurrentNote().detail.content;
noteSourceEl.text(formatHtml(noteText));
}

View File

@@ -24,22 +24,22 @@ const recentChanges = (function() {
const dayEl = $('<div>').append($('<b>').html(formatDate(dateDay))).append(changesListEl);
for (const change of dayChanges) {
const formattedTime = formatTime(parseDate(change.date_modified_to));
const formattedTime = formatTime(parseDate(change.dateModifiedTo));
const revLink = $("<a>", {
href: 'javascript:',
text: 'rev'
}).attr('action', 'note-history')
.attr('note-path', change.note_id)
.attr('note-history-id', change.note_history_id);
.attr('note-path', change.noteId)
.attr('note-history-id', change.noteHistoryId);
let noteLink;
if (change.current_is_deleted) {
noteLink = change.current_note_title;
if (change.current_isDeleted) {
noteLink = change.current_title;
}
else {
noteLink = link.createNoteLink(change.note_id, change.note_title);
noteLink = link.createNoteLink(change.noteId, change.title);
}
changesListEl.append($('<li>')
@@ -57,7 +57,7 @@ const recentChanges = (function() {
const dayCache = {};
for (const row of result) {
let dateDay = parseDate(row.date_modified_to);
let dateDay = parseDate(row.dateModifiedTo);
dateDay.setHours(0);
dateDay.setMinutes(0);
dateDay.setSeconds(0);

View File

@@ -14,7 +14,7 @@ const recentNotes = (function() {
async function reload() {
const result = await server.get('recent-notes');
list = result.map(r => r.note_path);
list = result.map(r => r.notePath);
}
function addRecentNote(noteTreeId, notePath) {
@@ -23,7 +23,7 @@ const recentNotes = (function() {
if (notePath && notePath === noteTree.getCurrentNotePath()) {
const result = await server.put('recent-notes/' + noteTreeId + '/' + encodeURIComponent(notePath));
list = result.map(r => r.note_path);
list = result.map(r => r.notePath);
}
}, 1500);
}