Fixing quick notes
Updating all the icons making search bar thinner
This commit is contained in:
parent
acf72ca67e
commit
cf3289aac6
@ -105,13 +105,13 @@
|
|||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
<div class="ui small compact basic button" v-on:click="openNote">
|
<div class="ui small compact basic button" v-on:click="openNote">
|
||||||
<i class="file icon"></i>
|
<i class="file outline icon"></i>
|
||||||
Open Note
|
Open Note
|
||||||
</div>
|
</div>
|
||||||
<div class="ui small compact basic button" v-on:click="openEditAttachments"
|
<div class="ui small compact basic button" v-on:click="openEditAttachments"
|
||||||
:class="{ 'disabled':this.searchParams.noteId }">
|
:class="{ 'disabled':this.searchParams.noteId }">
|
||||||
<i class="folder icon"></i>
|
<i class="folder open outline icon"></i>
|
||||||
Note Attachments
|
Note Files
|
||||||
</div>
|
</div>
|
||||||
<div class="ui small compact basic icon button" v-on:click="deleteAttachment">
|
<div class="ui small compact basic icon button" v-on:click="deleteAttachment">
|
||||||
<i v-if="!working" class="trash alternate outline icon"></i>
|
<i v-if="!working" class="trash alternate outline icon"></i>
|
||||||
|
@ -153,7 +153,7 @@
|
|||||||
|
|
||||||
<div class="menu-section" v-if="loggedIn">
|
<div class="menu-section" v-if="loggedIn">
|
||||||
<router-link exact-active-class="active" class="menu-item menu-button" to="/notes" v-on:click.native="emitReloadEvent()">
|
<router-link exact-active-class="active" class="menu-item menu-button" to="/notes" v-on:click.native="emitReloadEvent()">
|
||||||
<i class="file icon"></i>Notes
|
<i class="file outline icon"></i>Notes
|
||||||
</router-link>
|
</router-link>
|
||||||
<div>
|
<div>
|
||||||
<!-- <div class="menu-item sub">Show Only <i class="caret down icon"></i></div> -->
|
<!-- <div class="menu-item sub">Show Only <i class="caret down icon"></i></div> -->
|
||||||
@ -165,25 +165,25 @@
|
|||||||
|
|
||||||
<div class="menu-section" v-if="loggedIn">
|
<div class="menu-section" v-if="loggedIn">
|
||||||
<div v-on:click="updateFastFilters(3)" class="menu-item menu-button">
|
<div v-on:click="updateFastFilters(3)" class="menu-item menu-button">
|
||||||
<i class="mail icon"></i>Inbox
|
<i class="mail outline icon"></i>Inbox
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="menu-section" v-if="loggedIn">
|
<div class="menu-section" v-if="loggedIn">
|
||||||
<div v-on:click="updateFastFilters(2)" class="menu-item menu-button">
|
<div v-on:click="updateFastFilters(2)" class="menu-item menu-button">
|
||||||
<i class="archive icon"></i>Archived
|
<i class="hdd outline icon"></i>Archived
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="menu-section" v-if="loggedIn">
|
<div class="menu-section" v-if="loggedIn">
|
||||||
<router-link class="menu-item menu-button" exact-active-class="active" to="/attachments">
|
<router-link class="menu-item menu-button" exact-active-class="active" to="/attachments">
|
||||||
<i class="folder icon"></i>Files
|
<i class="folder open outline icon"></i>Files
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="menu-section" v-if="loggedIn">
|
<div class="menu-section" v-if="loggedIn">
|
||||||
<router-link v-if="loggedIn" exact-active-class="active" class="menu-item menu-button" to="/quick">
|
<router-link v-if="loggedIn" exact-active-class="active" class="menu-item menu-button" to="/quick">
|
||||||
<i class="coffee icon"></i>Quick
|
<i class="paper plane outline icon"></i>Quick
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -208,7 +208,7 @@
|
|||||||
|
|
||||||
<div class="menu-section" v-if="loggedIn">
|
<div class="menu-section" v-if="loggedIn">
|
||||||
<div v-if="loggedIn" v-on:click="destroyLoginToken" class="menu-item menu-button">
|
<div v-if="loggedIn" v-on:click="destroyLoginToken" class="menu-item menu-button">
|
||||||
<i class="user icon"></i>{{ucWords($store.getters.getUsername)}}
|
<i class="user outline icon"></i>{{ucWords($store.getters.getUsername)}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
<div class="sixteen wide column">
|
<div class="sixteen wide column">
|
||||||
<h3>All Tags</h3>
|
<h3>All Tags</h3>
|
||||||
|
<h4 v-if="allTags.length == 0">No tags yet, add a tag.</h4>
|
||||||
<div v-if="allTags.length > 0">
|
<div v-if="allTags.length > 0">
|
||||||
<div class="ui icon large label clickable" v-for="tag in allTags" :class="{ 'green':isTagOnNote(tag.id) }" v-on:click="toggleTag(tag.text, tag.id, tag.entryId)">
|
<div class="ui icon large label clickable" v-for="tag in allTags" :class="{ 'green':isTagOnNote(tag.id) }" v-on:click="toggleTag(tag.text, tag.id, tag.entryId)">
|
||||||
{{ ucWords(tag.text) }}
|
{{ ucWords(tag.text) }}
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="ui form">
|
<div class="ui form">
|
||||||
<div class="fields">
|
<input v-model="searchTerm" @keyup="searchKeyUp" @:keyup.enter="search" placeholder="Search Notes and Files" />
|
||||||
<div class="sixteen wide field">
|
|
||||||
<input v-model="searchTerm" @keyup="searchKeyUp" @:keyup.enter="search" placeholder="Search Notes and Files" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<div class="ui sixteen wide column">
|
<div class="ui sixteen wide column">
|
||||||
<h2 class="ui header">
|
<h2 class="ui header">
|
||||||
<i class="folder icon"></i>
|
<i class="folder open outline icon"></i>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Files
|
Files
|
||||||
<div class="sub header">Uploaded Files and Websites from notes.</div>
|
<div class="sub header">Uploaded Files and Websites from notes.</div>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
Show All Attachments
|
Show All Attachments
|
||||||
</div>
|
</div>
|
||||||
<div class="ui green button" v-on:click="openNote">
|
<div class="ui green button" v-on:click="openNote">
|
||||||
<i class="file icon"></i>
|
<i class="file outline icon"></i>
|
||||||
Open Note
|
Open Note
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,33 +3,30 @@
|
|||||||
|
|
||||||
<div class="ui grid" :class="{ 'mush-it-up':showOneColumn() }" ref="content">
|
<div class="ui grid" :class="{ 'mush-it-up':showOneColumn() }" ref="content">
|
||||||
|
|
||||||
<!-- Note filter options -->
|
<div v-if="!$store.getters.getIsUserOnMobile"
|
||||||
<div class="row" v-if="!$store.getters.getIsUserOnMobile">
|
:class="{ 'sixteen wide column':showOneColumn(), 'twelve wide column':!showOneColumn() }">
|
||||||
|
|
||||||
<div :class="{ 'sixteen wide column':showOneColumn(), 'eight wide column':!showOneColumn() }">
|
<div class="ui grid">
|
||||||
<div class="ui form">
|
<div class="eight wide column">
|
||||||
<div class="fields">
|
<search-input></search-input>
|
||||||
<div class="ten wide field">
|
</div>
|
||||||
<search-input></search-input>
|
<div class="eight wide column">
|
||||||
</div>
|
<!-- <fast-filters /> -->
|
||||||
<div class="six wide field">
|
<span class="ui fluid green button"
|
||||||
<span class="ui fluid green button"
|
v-if="showClear"
|
||||||
v-if="showClear"
|
@click="reset">
|
||||||
@click="reset">
|
<i class="arrow circle left icon"></i>Back to All Notes
|
||||||
<i class="undo icon"></i>Back to All Notes
|
</span>
|
||||||
</span>
|
|
||||||
<!-- <fast-filters /> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div v-if="$store.getters.getIsUserOnMobile && showClear" class="row">
|
<div v-if="$store.getters.getIsUserOnMobile && showClear" class="row">
|
||||||
<div class="sixteen wide column">
|
<div class="sixteen wide column">
|
||||||
<span class="ui fluid green button"
|
<span class="ui fluid green button" @click="reset">
|
||||||
@click="reset">
|
<i class="arrow circle left icon"></i>Back to All Notes
|
||||||
<i class="undo icon"></i>Reset Filters
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -118,7 +115,7 @@
|
|||||||
|
|
||||||
<!-- found attachments -->
|
<!-- found attachments -->
|
||||||
<div class="sixteen wide column" v-if="foundAttachments.length > 0">
|
<div class="sixteen wide column" v-if="foundAttachments.length > 0">
|
||||||
<h4><i class="green folder icon"></i> Found in Files ({{ foundAttachments.length }})</h4>
|
<h4><i class="folder open outline icon"></i> Found in Files ({{ foundAttachments.length }})</h4>
|
||||||
<attachment-display
|
<attachment-display
|
||||||
v-for="item in foundAttachments"
|
v-for="item in foundAttachments"
|
||||||
:item="item"
|
:item="item"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<div class="ui sixteen wide column">
|
<div class="ui sixteen wide column">
|
||||||
<h2 class="ui header">
|
<h2 class="ui header">
|
||||||
<i class="coffee icon"></i>
|
<i class="paper plane outline icon"></i>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Quick
|
Quick
|
||||||
<div class="sub header">Add new information with great speed</div>
|
<div class="sub header">Add new information with great speed</div>
|
||||||
@ -26,7 +26,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div v-on:click="appendQuickNote" class="ui green button">Save (CRTL + Enter)</div>
|
<div v-on:click="appendQuickNote" class="ui green button">Save (CRTL + Enter)</div>
|
||||||
<div v-if="quickNoteId" v-on:click="openNoteEdit" class="ui right floated basic button">Edit</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>
|
||||||
|
Quick Files + Links
|
||||||
|
</div>
|
||||||
|
<div v-if="quickNoteId" v-on:click="openNoteEdit" class="ui right floated basic button">
|
||||||
|
<i class="file outline icon"></i>
|
||||||
|
Edit
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -98,7 +105,7 @@
|
|||||||
//Don't submit empty note
|
//Don't submit empty note
|
||||||
if(this.newText.trim() == ''){ return }
|
if(this.newText.trim() == ''){ return }
|
||||||
|
|
||||||
axios.post('/api/quick-note/update', { 'pushText':this.newText } )
|
axios.post('/api/quick-note/update', { 'pushText':this.newText.trim() } )
|
||||||
.then( results => {
|
.then( results => {
|
||||||
|
|
||||||
this.newText = '' //Clear text area
|
this.newText = '' //Clear text area
|
||||||
|
@ -105,7 +105,7 @@ Note.create = (userId, noteText, quickNote = 0) => {
|
|||||||
const created = Math.round((+new Date)/1000)
|
const created = Math.round((+new Date)/1000)
|
||||||
|
|
||||||
db.promise()
|
db.promise()
|
||||||
.query(`INSERT INTO note_raw_text (text) VALUE ('')`)
|
.query(`INSERT INTO note_raw_text (text) VALUE (?)`, [noteText])
|
||||||
.then( (rows, fields) => {
|
.then( (rows, fields) => {
|
||||||
|
|
||||||
const rawTextId = rows[0].insertId
|
const rawTextId = rows[0].insertId
|
||||||
|
@ -10,7 +10,9 @@ QuickNote.get = (userId) => {
|
|||||||
|
|
||||||
db.promise()
|
db.promise()
|
||||||
.query(`
|
.query(`
|
||||||
SELECT id, text FROM note WHERE quick_note = 1 AND user_id = ? LIMIT 1
|
SELECT note.id, text FROM note
|
||||||
|
JOIN note_raw_text ON (note_raw_text.id = note.note_raw_text_id)
|
||||||
|
WHERE quick_note = 1 AND user_id = ? LIMIT 1
|
||||||
`, [userId])
|
`, [userId])
|
||||||
.then((rows, fields) => {
|
.then((rows, fields) => {
|
||||||
|
|
||||||
@ -53,8 +55,10 @@ QuickNote.update = (userId, pushText) => {
|
|||||||
|
|
||||||
db.promise()
|
db.promise()
|
||||||
.query(`
|
.query(`
|
||||||
SELECT id, text, color, pinned, archived
|
SELECT note.id, text, color, pinned, archived
|
||||||
FROM note WHERE quick_note = 1 AND user_id = ? LIMIT 1
|
FROM note
|
||||||
|
JOIN note_raw_text ON (note_raw_text.id = note.note_raw_text_id)
|
||||||
|
WHERE quick_note = 1 AND user_id = ? LIMIT 1
|
||||||
`, [userId])
|
`, [userId])
|
||||||
.then((rows, fields) => {
|
.then((rows, fields) => {
|
||||||
|
|
||||||
@ -95,19 +99,3 @@ QuickNote.update = (userId, pushText) => {
|
|||||||
//Note.create(userId, 'Quick Note', 1)
|
//Note.create(userId, 'Quick Note', 1)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QuickNote.create = (userId, noteText) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
|
|
||||||
if(userId == null || userId < 10){ reject('User Id required to create note') }
|
|
||||||
|
|
||||||
const created = Math.round((+new Date)/1000)
|
|
||||||
|
|
||||||
db.promise()
|
|
||||||
.query('INSERT INTO note (user_id, text, created) VALUES (?,?,?)', [userId, noteText, created])
|
|
||||||
.then((rows, fields) => {
|
|
||||||
resolve(rows[0].insertId) //Only return the new note ID when creating a new note
|
|
||||||
})
|
|
||||||
.catch(console.log)
|
|
||||||
})
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user