Added privacy policy

Updated marketing
Added some keyboard shortcuts
Added settings page
Added accent theming
Added beta 2FA
This commit is contained in:
Max G
2020-07-07 04:04:55 +00:00
parent cca89a60d8
commit 47fff0e1ee
29 changed files with 1428 additions and 362 deletions

View File

@@ -2,9 +2,8 @@
<!-- change class to .master-note-edit to have it popup on the screen -->
<div
id="InputNotes"
class="master-note-edit full-focus"
@keyup.esc="close()"
:class="[ 'position-'+position ]"
class="master-note-edit full-focus position-0"
@keyup.esc="closeButtonAction()"
>
<!-- Giant Edit Note Menu -->
@@ -14,7 +13,7 @@
<div class="edit-spacer"></div>
<div class="menu-top-half">
<div class="edit-button" v-on:click="close()" data-tooltip="Close" data-position="bottom center" data-inverted>
<div class="edit-button" v-on:click="closeButtonAction()" data-tooltip="Close" data-position="bottom center" data-inverted>
<i class="close icon"></i>
</div>
@@ -61,7 +60,19 @@
</div>
<div class="menu-bottom-half">
<div class="edit-button" v-on:click="$router.push(`/notes/open/${noteid}/menu/table`)" data-tooltip="Insert Table" data-position="bottom center" data-inverted>
<i class="border all icon"></i>
</div>
<div class="edit-button" v-on:click="insertDivide()" data-tooltip="Insert Divide" data-position="bottom center" data-inverted>
<i class="grip lines icon"></i>
</div>
<div class="edit-button" v-on:click="insertTable(4,4)" data-tooltip="Insert Table" data-position="bottom center" data-inverted>
<i class="book dead icon"></i>
</div>
<div class="edit-button" v-on:click="removeFormatting()" data-tooltip="Remove Formatting" data-position="bottom center" data-inverted>
<i class="remove format icon"></i>
</div>
@@ -95,7 +106,8 @@
<div class="edit-divide"></div>
<!-- <div class="edit-button" v-on:click="onToggleArchived()" :data-tooltip="archived == 1?'Move to main list':'Move to Archive'" data-position="bottom center" data-inverted>
<!--
<div class="edit-button" v-on:click="onToggleArchived()" :data-tooltip="archived == 1?'Move to main list':'Move to Archive'" data-position="bottom center" data-inverted>
<span v-if="archived == 1"><i class="green archive icon"></i></span>
<span v-if="archived != 1"><i class="archive icon"></i></span>
</div>
@@ -105,17 +117,13 @@
<span v-if="pinned != 1"><i class="pin icon"></i></span>
</div> -->
<!-- data-tooltip="Files on note" -->
<!-- <div v-if="attachmentCount > 0" class="edit-button" v-on:click="openEditAttachment" data-tooltip="Files" data-position="bottom center" data-inverted>
<i class="folder icon"></i>
{{ attachmentCount }}
</div> -->
<div class="edit-button" v-if="usersOnNote > 1">
<i class="green eye icon"></i> {{ usersOnNote }}
</div>
<!-- <div class="edit-button" v-on:click="simulateTyping()">
<!--
<div class="edit-button" v-on:click="simulateTyping()">
<i class="purple bolt icon"></i>
</div> -->
@@ -132,7 +140,6 @@
</div>
</div>
</div>
<div class="bottom-edit-menu"></div>
@@ -163,7 +170,7 @@
</textarea>
<!-- Squire Box -->
<div id="squire-id" class="squire-box" ref="squirebox" placeholder="Note Text"></div>
<div id="squire-id" class="squire-box" ref="squirebox" placeholder="Type Note Here"></div>
</div>
@@ -224,19 +231,19 @@
<div class="sixteen wide column">
<div class="ui labeled icon fluid basic button" v-on:click="sortList">
<i class="sort amount up icon"></i>
Sort List items (Move checked to bottom)
Sort List
</div>
</div>
<div class="eight wide column">
<div class="ui labeled icon fluid basic button" v-on:click="deleteCompletedListItems">
<i class="trash icon"></i>
Delete Checked Items
Delete Checked
</div>
</div>
<div class="eight wide column">
<div class="ui labeled icon fluid basic button" v-on:click="uncheckAllListItems">
<i class="list ul icon"></i>
Uncheck all Checked items
Uncheck All
</div>
</div>
<div class="eight wide column">
@@ -245,6 +252,15 @@
Simple Math
</div>
</div>
<div class="eight wide column">
<!-- data-tooltip="Files on note" -->
<div v-on:click="openEditAttachment" class="ui labeled icon fluid basic button">
<i class="folder icon"></i>
Note Files
{{ attachmentCount }}
</div>
</div>
<div class="sixteen wide column" v-if="rawTextId > 0">
<h2>Share Note</h2>
<share-note-component
@@ -257,13 +273,20 @@
</div>
</side-slide-menu>
<!-- create table option -->
<side-slide-menu v-if="table" v-on:close="table = false; fetchNoteTags()" name="table" :style-object="styleObject">
<div class="ui basic segment">
Create a table
</div>
</side-slide-menu>
<!-- Show side shades if user is on desktop only -->
<div class="full-focus-shade shade1"
:class="{ 'slide-out-left':sizeDown }"
v-on:click="close()"></div>
v-on:click="closeButtonAction()"></div>
<div class="full-focus-shade shade2"
:class="{ 'slide-out-right':sizeDown }"
v-on:click="close()"></div>
v-on:click="closeButtonAction()"></div>
</div>
</template>
@@ -335,6 +358,7 @@
images: false,
options: false,
colorpicker: false,
table: false,
//Diff text/sync text variables
diffTextTimeout: null,
@@ -355,7 +379,7 @@
//Handle changes in URL to
if(newVal.id == undefined || newVal.id != this.noteid){
this.close()
// this.closeButtonAction()
}
//Reset all note menus on URL change
@@ -364,6 +388,7 @@
this.tags = false
this.options = false
this.images = false
this.table = false
//If a menu value is set, open it
if(newVal.openMenu){
@@ -394,18 +419,20 @@
document.removeEventListener('visibilitychange', this.checkForUpdatedNote)
// if(this.editor){
this.editor.destroy()
// }
//Obliterate squire instance
this.editor.destroy()
this.close()
},
mounted: function() {
//Show loading for a minimum time
setTimeout(()=>{
this.forceShowLoading = false
}, 500)
document.addEventListener('visibilitychange', this.checkForUpdatedNote)
// document.addEventListener('visibilitychange', this.checkForUpdatedNote)
//Init squire as early as possible
this.editor = new Squire( this.$refs.squirebox, {blockTag: 'p' })
@@ -599,6 +626,30 @@
this.editor.addEventListener('keydown', event => {
//Tab to increase quote level, tab + shigt to decrease quote level
const keyCode = event.key
if(keyCode == 'Tab'){
if(event.shiftKey){
this.editor.decreaseQuoteLevel()
} else {
this.editor.increaseQuoteLevel()
}
event.preventDefault()
return false
}
//Save on pressing CTRL/CMD + S
if(keyCode == 's' && (event.ctrlKey || event.metaKey) ){
this.$bus.$emit('notification', 'Note Saved')
this.save()
event.preventDefault()
return false
}
//Prevent new list items from having
this.$nextTick( () => {
//Wait a moment to get item under cursor
@@ -612,10 +663,6 @@
})
})
this.editor.addEventListener('keydown', event => {
})
//Bind event handlers
this.editor.addEventListener('keyup', event => {
@@ -682,7 +729,7 @@
//Block notes you don't have access to from opening
if(response.data === false){
this.$bus.$emit('notification', 'Error opening Note')
this.close(true)
this.close()
return
}
@@ -915,18 +962,21 @@
return hash;
},
close(force = false){
closeButtonAction(){
this.sizeDown = true
//This timeout allows animation to play before closing
setTimeout(() => {
this.$router.push('/notes')
}, 300)
},
close(){
// force = true
// console.log(`Close Note ${this.noteid} -> force: ${force}, modified: ${this.modified}`)
if(force){
this.$bus.$emit('close_active_note', {
noteId: this.noteid, modified: this.modified
})
return
}
//Skip everything if foce close is true. Note will just die.
if(this.currentNoteId == 0){ return }
this.loadingMessage = 'Saving...'
this.loading = true
@@ -938,14 +988,10 @@
axios.post('/api/note/reindex')
}
this.sizeDown = true
//This timeout allows animation to play before closing
setTimeout(() => {
this.$bus.$emit('close_active_note', {
noteId: this.noteid, modified: this.modified
})
return
}, 300)
this.$bus.$emit('close_active_note', {
noteId: this.noteid, modified: this.modified
})
return
})
},
destroyWebSockets(){
@@ -1005,8 +1051,8 @@
let element = this.$refs.titleTextarea
let padding = 0
element.style.height = 'auto';
element.style.height = (element.scrollHeight + padding) +'px';
element.style.height = 'auto'
element.style.height = (element.scrollHeight + padding) +'px'
},
}
}
@@ -1152,7 +1198,7 @@
background-color: var(--menu-accent);
}
.edit-active {
background-color: #21BA45;
background-color: var(--main-accent);
color: white;
}
.edit-divide {