Compare commits

..

No commits in common. "282cbfe7bcf80f68fad99e04c71dc08c51c16a26" and "984ac6ccff6eeb36fd4dc79e7df3c288843d6e78" have entirely different histories.

7 changed files with 15 additions and 120 deletions

View File

@ -198,7 +198,7 @@
<div class="menu-section" v-if="loggedIn" data-tooltip="Click to log out" data-inverted="" data-position="right center">
<div v-if="loggedIn" v-on:click="destroyLoginToken" class="menu-item menu-button">
<i v-if="userIcon" class="user outline icon"></i>{{ usernameDisplay }}
<i class="user outline icon"></i>{{ucWords($store.getters.getUsername)}}
</div>
</div>
@ -225,7 +225,6 @@
mobile: false,
disableNewNote: false,
menuOpen: true,
userIcon: true,
}
},
beforeCreate: function(){
@ -247,19 +246,7 @@
loggedIn () {
//Map logged in from state
return this.$store.getters.getLoggedIn
},
usernameDisplay() {
//Remove Emails from username, limit length to 16 chars
let name = this.$store.getters.getUsername
let splitName = name.split('@')
if(splitName.length > 1){
name = splitName.shift()
this.userIcon = false
}
return this.ucWords(name.substring(0, 16))
},
},
methods: {
menuClicked(){

View File

@ -1,7 +1,7 @@
<template>
<span>
<span class="clickable" @click="confirmDelete()" v-if="click == 0" data-tooltip="Delete" data-inverted="" data-position="top right">
<i class="trash alternate icon"></i>
<i class="grey trash alternate icon"></i>
</span>
<span class="clickable" @click="actuallyDelete()" @mouseleave="reset" v-if="click == 1" data-tooltip="Click again to delete." data-position="top right" data-inverted="">
<i class="red trash alternate icon"></i>

View File

@ -144,7 +144,7 @@
//Enter - 13 - Execute addTag() function
if(code == 13){
//If an item from list is selected, make that the text
if(this.selection > -1 && this.suggestions[vm.selection]){
if(this.selection > -1){
this.newTagInput = this.suggestions[vm.selection].text
}
this.addTag()

View File

@ -61,13 +61,12 @@
<!-- Toolbar on the bottom -->
<div class="tool-bar" @click.self="cardClicked">
<div class="icon-bar">
<!-- {{$helpers.timeAgo(note.updated)}} -->
<div class="icon-bar" @click="cardClicked">
<!-- {{$helpers.timeAgo(note.updated)}} -->
<span v-if="note.tags">
<span v-for="tag in (note.tags.split(','))" class="little-tag">{{ tag }}</span>
</span>
<span v-if="note.pinned == 1" data-position="top right" data-tooltip="Pinned" data-inverted="">
<i class="green pin icon"></i>
</span>
@ -75,24 +74,7 @@
<i class="green archive icon"></i>
</span>
<!-- :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }" -->
<span class="float-right" :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }">
<!-- <span class="teeny-button" data-tooltip="Archive" data-inverted>
<i class="archive icon"></i>
</span> -->
<i class="teeny-button" data-tooltip="Tags" data-inverted v-on:click="toggleTags(true)">
<i class="tags icon"></i>
</i>
<i class="teeny-button" data-tooltip="Pin" data-inverted v-on:click="pinNote">
<i class="pin icon"></i>
</i>
<delete-button class="teeny-button" :note-id="note.id" />
</span>
<delete-button class="float-right" :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }" :note-id="note.id" />
</div>
<div v-if="getThumbs.length > 0">
@ -103,31 +85,18 @@
</div>
<side-slide-menu v-if="showTagSlideMenu" v-on:close="toggleTags(false)">
<div class="ui basic segment">
<note-tag-edit :noteId="note.id" :key="'display-tags-for-note-'+note.id"/>
</div>
</side-slide-menu>
</div>
</div>
</template>
<script>
import axios from 'axios'
export default {
name: 'NoteTitleDisplayCard',
props: [ 'onClick', 'data', 'currentlyOpen', 'textResults', 'attachmentResults', 'tagResults' ],
components: {
'delete-button': require('@/components/NoteDeleteButtonComponent.vue').default,
'note-tag-edit': require('@/components/NoteTagEdit.vue').default,
'side-slide-menu': require('@/components/SideSlideMenuComponent.vue').default,
},
methods:{
cardClicked(){
@ -154,22 +123,6 @@
openEditAttachment(){
this.$router.push('/attachments/note/'+this.note.id)
},
pinNote(){
let postData = {'pinned': !this.note.pinned, 'noteId':this.note.id}
axios.post('/api/note/setpinned', postData)
.then(data => {
this.$bus.$emit('update_single_note', this.note.id)
})
},
toggleTags(state){
this.showTagSlideMenu = state
if(state == false){
this.$bus.$emit('update_single_note', this.note.id)
}
},
},
data () {
return {
@ -179,7 +132,6 @@
noteIcon: null,
iconColor: null,
beenClicked: false,
showTagSlideMenu: false,
}
},
computed: {
@ -238,18 +190,6 @@
</script>
<style type="text/css">
.teeny-button {
border: 1px solid var(--border_color);
border-radius: 5px;
padding: 0px 0px 0px 4px;
text-align: center;
margin: 0 0 0 5px;
display: inline-block;
min-width: 30px;
color: var(--text_color);
background-color: var(--background_color);
}
/*Strict font sizes for card display*/
.small-text, .small-text > p, .small-text > h1, .small-text > h2 {
/*font-size: 1.0em !important;*/
@ -258,12 +198,10 @@
.small-text > p, , .small-text > h1, .small-text > h2 {
margin-bottom: 0.5em;
}
.big-text > p:first-child,
.big-text > h1, .big-text > h2 {
.big-text, .big-text > p, .big-text > h1, .big-text > h2 {
/*font-size: 1.3em !important;*/
font-size: 17px !important;
font-weight: bold;
margin-bottom: 0.5em;
}
.big-text > p, .big-text > h1, .big-text > h2 {
margin-bottom: 0.3em;
@ -331,15 +269,14 @@
font-size: 0.7em;
padding: 5px 5px;
border: 1px solid var(--border_color);
margin: 0 3px 5px 0;
margin: 5px 3px 0 0;
border-radius: 3px;
white-space: nowrap;
max-width: 175px;
max-width: 100px;
overflow: hidden;
display: inline-block;
line-height: 0.8em;
text-overflow: ellipsis;
float: left;
}
.tiny-thumb-box {
max-height: 70px;

View File

@ -69,7 +69,7 @@
<div class="sixteen wide column">
<h3 v-if="$store.getters.totals && $store.getters.totals['totalNotes'] == 0">
No Notes Yet. Thats ok. Create one when you feel ready.
No Notes Yet. Create one when you feel ready.
</h3>
<!-- Go to one wide column, do not do this on mobile interface -->
@ -205,15 +205,11 @@
if(modified){
this.updateSingleNote(noteId)
}
})
this.$bus.$on('update_single_note', (noteId) => {
this.updateSingleNote(noteId)
})
this.$bus.$on('note_deleted', (noteId) => {
//Remove deleted note from set, its deleted
this.fetchUserTags()
Object.keys(this.noteSections).forEach( key => {
this.noteSections[key].forEach( (note, index) => {
if(note.id == noteId){
@ -464,7 +460,7 @@
//Don't move notes that were not changed
if(note.updated == newNote.updated){
// return
return
}
//Compare note tags, if they changed, reload tags

View File

@ -202,21 +202,6 @@ Note.update = (io, userId, noteId, noteText, color, pinned, archived) => {
})
}
Note.setPinned = (userId, noteId, pinnedBoolean) => {
return new Promise((resolve, reject) => {
const pinned = pinnedBoolean ? 1:0
//Update other note attributes
return db.promise()
.query('UPDATE note SET pinned = ? WHERE id = ? AND user_id = ? LIMIT 1',
[pinned, noteId, userId])
.then((rows, fields) => {
resolve(true)
})
})
}
//
// Delete a note and all its remaining parts
//

View File

@ -62,16 +62,6 @@ router.post('/difftext', function (req, res) {
})
})
//
// Update single note attributes
//
router.post('/setpinned', function (req, res) {
Notes.setPinned(userId, req.body.noteId, req.body.pinned)
.then( results => {
res.send(results)
})
})
//
// Share Note Actions
//