* Made splash page dark and updated description
* Cleaned up unused things * Updated squire which had a comment typo update...thats it * Background color picker has matching colors and styles to text color picker * Added new black theme * Moved search to main page, show it on mobile and added options to push things to notes from search with experimental tag searching * Added active note menu buttons based on cursor location in text * Added more instant updating if app is open in two locations for the same user Scratch Pad and home page update with new notes and new text in real time
This commit is contained in:
1 parent
67b218329b
commit
e87e8513bc
20 files changed
+526
-271
No files matched your search
@@ -4,31 +4,27 @@
|
||||
|
||||
<div class="ui sixteen wide column">
|
||||
<h2 class="ui header">
|
||||
<i class="paper plane outline icon"></i>
|
||||
<i class="sticky note outline icon"></i>
|
||||
<div class="content">
|
||||
Quick
|
||||
<div class="sub header">Rapidly save text</div>
|
||||
The Scratch Pad
|
||||
<div class="sub header">One place to put random junk</div>
|
||||
</div>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="sixteen wide middle aligned column">
|
||||
|
||||
<div class="ui compact basic button"
|
||||
v-on:click="enterToSubmit = !enterToSubmit">
|
||||
<i v-if="enterToSubmit" class="green toggle on icon"></i>
|
||||
<i v-else class="toggle off icon"></i>
|
||||
|
||||
<span v-if="enterToSubmit">Save after Enter press</span>
|
||||
<span v-else>CTRL + Enter to Save</span>
|
||||
|
||||
<div class="ui compact basic right floated button shrinking" v-if="!showNewNoteConfirm" v-on:click="showNewNoteConfirm = true">
|
||||
<i class="sync alternate reload icon"></i>
|
||||
New Quick Note
|
||||
</div>
|
||||
|
||||
<div class="ui compact basic button"
|
||||
v-on:click="pasteToSubmit = !pasteToSubmit">
|
||||
<i v-if="pasteToSubmit" class="green check circle outline icon"></i>
|
||||
<i v-else class="circle outline icon"></i>
|
||||
Save after Pasting
|
||||
<div v-if="showNewNoteConfirm" class="ui compact basic right floated button shrinking" v-on:click="showNewNoteConfirm = false">
|
||||
<i class="close icon"></i>
|
||||
Cancel
|
||||
</div>
|
||||
<div v-if="showNewNoteConfirm" class="ui compact basic right floated button shrinking" v-on:click="newQuickNote()">
|
||||
<i class="green thumbs up icon"></i>
|
||||
Confirm
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,25 +37,28 @@
|
||||
ref="fastInput"
|
||||
v-model="newText"
|
||||
v-on:keydown="checkKeyup"
|
||||
v-on:paste="onPaste"
|
||||
placeholder="Push to the top of the quick note."
|
||||
></textarea>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div v-on:click="appendQuickNote" class="ui green button">Save</div>
|
||||
<div v-on:click="appendQuickNote" class="ui green button">Save (Enter)</div>
|
||||
<div v-if="quickNoteId" class="ui right floated basic button" v-on:click="$router.push('/attachments/note/'+quickNoteId)">
|
||||
<i class="folder open outline icon"></i>
|
||||
Files
|
||||
</div>
|
||||
<div v-if="quickNoteId" v-on:click="openNoteEdit" class="ui right floated basic button">
|
||||
<i class="file outline icon"></i>
|
||||
Edit
|
||||
Open Note
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fun" v-html="savedQuickNoteText"></div>
|
||||
<div class="one wide column"></div>
|
||||
<div class="fourteen wide column">
|
||||
<div class="note-card-text" v-html="savedQuickNoteText"></div>
|
||||
</div>
|
||||
<div class="one wide column"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -79,8 +78,7 @@
|
||||
newText: '',
|
||||
savedQuickNoteText: '',
|
||||
quickNoteId: null,
|
||||
pasteToSubmit: true,
|
||||
enterToSubmit: true,
|
||||
showNewNoteConfirm: false,
|
||||
}
|
||||
},
|
||||
beforeCreate: function(){
|
||||
@@ -89,6 +87,16 @@
|
||||
//
|
||||
this.$parent.loginGateway()
|
||||
},
|
||||
beforeMount(){
|
||||
|
||||
this.$io.on('new_note_created', noteId => {
|
||||
this.getQuickNote()
|
||||
})
|
||||
|
||||
this.$io.on('new_note_text_saved', ({noteId, hash}) => {
|
||||
this.getQuickNote()
|
||||
})
|
||||
},
|
||||
mounted: function(){
|
||||
|
||||
if(this.$refs.fastInput){
|
||||
@@ -107,6 +115,17 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
newQuickNote(){
|
||||
|
||||
this.showNewNoteConfirm = false
|
||||
|
||||
axios.post('/api/quick-note/new')
|
||||
.then( ({data}) => {
|
||||
this.savedQuickNoteText = ''
|
||||
this.quickNoteId = ''
|
||||
})
|
||||
|
||||
},
|
||||
openNoteEdit(){
|
||||
this.$router.push({'path':'/notes/open/'+this.quickNoteId})
|
||||
},
|
||||
@@ -119,17 +138,10 @@
|
||||
element.style.height = (element.scrollHeight + padding) +'px';
|
||||
|
||||
//Enter Key submits by default
|
||||
if(event.keyCode == 13 && this.enterToSubmit == true){
|
||||
if(event.keyCode == 13){
|
||||
this.appendQuickNote()
|
||||
return
|
||||
}
|
||||
|
||||
//Alternate submit
|
||||
//If command+enter or control+enter is pressed, submit
|
||||
if((event.metaKey || event.ctrlKey) && [13].includes(event.keyCode) && this.enterToSubmit == false){
|
||||
this.appendQuickNote()
|
||||
return
|
||||
}
|
||||
},
|
||||
appendQuickNote(){
|
||||
|
||||
@@ -142,28 +154,17 @@
|
||||
this.newText = '' //Clear text area
|
||||
this.$refs.fastInput.style.height = 'auto' //Back to normal size
|
||||
|
||||
this.savedQuickNoteText = results.data.text
|
||||
this.quickNoteId = results.data.id
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Update Quick Note') })
|
||||
},
|
||||
getQuickNote (){
|
||||
getQuickNote(){
|
||||
axios.post('/api/quick-note/get')
|
||||
.then( results => {
|
||||
this.savedQuickNoteText = results.data.text
|
||||
this.quickNoteId = results.data.id
|
||||
.then( ({data}) => {
|
||||
this.savedQuickNoteText = data.text
|
||||
this.quickNoteId = data.id
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Fetch Quick Note') })
|
||||
},
|
||||
onPaste(event){
|
||||
|
||||
if(this.pasteToSubmit == true){
|
||||
setTimeout( () => {
|
||||
this.appendQuickNote()
|
||||
}, 10)
|
||||
}
|
||||
return true
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user