Refactors most controllers and directives into classes for more organized and maintainable code

This commit is contained in:
Mo Bitar
2020-01-30 13:37:16 -06:00
parent badadba8f8
commit 3c8c43ac7e
144 changed files with 87972 additions and 5613 deletions

View File

@@ -0,0 +1,20 @@
import { SFItemHistoryEntry } from 'snjs';
export class NoteHistoryEntry extends SFItemHistoryEntry {
previewTitle() {
return this.item.updated_at.toLocaleString();
}
previewSubTitle() {
if(!this.hasPreviousEntry) {
return `${this.textCharDiffLength} characters loaded`
} else if(this.textCharDiffLength < 0) {
return `${this.textCharDiffLength * -1} characters removed`
} else if(this.textCharDiffLength > 0) {
return `${this.textCharDiffLength} characters added`
} else {
return "Title or metadata changed"
}
}
}