* Removed arrows from notification

* Added trash can function
* Tweaked status text to always be the same
* Removed some open second note code
* Edior always focuses on text now
* Added some extra loading note messages
* Notes are now removed from search index when deleted
* Lots more things happen and update in real time on multiple machines
* Shared notes can be reverted
* WAY more tests
* Note Categories are much more reliable
* Lots of code is much cleaner
This commit is contained in:
Max G
2020-05-18 07:45:35 +00:00
parent b0eee636b5
commit 9c4fff7913
18 changed files with 644 additions and 368 deletions

View File

@@ -265,7 +265,7 @@
updated: '',
shareUsername: null,
diffNoteText: '',
statusText: 'Saved',
statusText: 'Saved.',
lastNoteHash: null,
saveDebounce: null, //Prevent save from being called numerous times quickly
updated: 'Never',
@@ -306,16 +306,16 @@
watch: {
noteid:function(newVal, oldVal){
if(newVal == this.currentNoteId){
return
}
// if(newVal == this.currentNoteId){
// return
// }
if(newVal == oldVal){
return
}
// if(newVal == oldVal){
// return
// }
this.currentNoteId = newVal
this.loadNote(this.currentNoteId)
// this.currentNoteId = newVal
// this.loadNote(this.currentNoteId)
},
urlData(newVal, oldVal){
@@ -388,17 +388,10 @@
this.lastNoteHash = this.hashString(this.getText())
// console.log('hash on load', this.lastNoteHash)
//focus on open, not on mobile, thats annoying
//focus on open, not on mobile, it causes the keyboard to pop up, thats annoying
if(!this.$store.getters.getIsUserOnMobile){
// this.editor.focus()
if(this.noteTitle.length == 0){
this.$refs.titleTextarea.focus()
} else {
this.editor.focus()
this.editor.moveCursorToEnd()
}
this.editor.focus()
this.editor.moveCursorToEnd()
}
//Change button states on editor when element is active
@@ -812,11 +805,14 @@
loadNote(noteId){
//Generate a random loading message
let mod = ['Gently','Calmly','Lovingly','Quickly','','','','','','','','','','','','','']
let doing = ['Loading','Loading','Getting','Fetching','Grabbing','Sequencing','Organizing','Untangling','Processing','Refining','Extracting','Fusing','Pruning','Expanding','Enlarging','Transfiguring','Quantizing','Ingratiating','Lumping']
let thing = ['Note','Note','Note','Note','Data','Text','Document','Algorithm','Buffer','Client','Download','File','Frame','Graphics','Hardware','HTML','Interface','Logic','Mainframe','Memory','Media','Nodes','Network','Chaos']
let p1 = doing[Math.floor(Math.random() * doing.length)]
let p2 = thing[Math.floor(Math.random() * thing.length)]
this.loadingMessage = p1 + ' ' + p2
let p1 = mod[Math.floor(Math.random() * mod.length)]
let p2 = doing[Math.floor(Math.random() * doing.length)]
let p3 = thing[Math.floor(Math.random() * thing.length)]
this.loadingMessage = `${p1} ${p2} ${p3}`
//Component is activated with NoteId in place, lookup text with associated ID
if(this.$store.getters.getLoggedIn){
@@ -1039,7 +1035,7 @@
},
onKeyup(){
this.statusText = ''
this.statusText = 'Modded'
// this.diffText()
@@ -1067,7 +1063,7 @@
const currentNoteText = this.getText()
const currentHash = this.hashString( currentNoteText )
if( this.lastNoteHash == currentHash){
this.statusText = 'Saved'
this.statusText = 'Saved.'
return resolve(true)
}
@@ -1090,7 +1086,7 @@
this.statusText = 'Saving'
axios.post('/api/note/update', postData).then( response => {
this.statusText = 'Saved'
this.statusText = 'Saved.'
this.updated = Math.round((+new Date)/1000)
this.modified = true