Added paste button and touched up some styles
This commit is contained in:
@@ -442,6 +442,10 @@ Note.update = (userId, noteId, noteText, noteTitle, color, pinned, archived, has
|
||||
})
|
||||
.then((rows, fields) => {
|
||||
|
||||
if(!rows[0] || !rows[0][0] || !rows[0][0]['note_raw_text_id']){
|
||||
return reject(false)
|
||||
}
|
||||
|
||||
const textId = rows[0][0]['note_raw_text_id']
|
||||
let salt = rows[0][0]['salt']
|
||||
let snippetSalt = rows[0][0]['snippet_salt']
|
||||
@@ -658,6 +662,9 @@ Note.delete = (userId, noteId, masterKey = null) => {
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
// Returns noteData
|
||||
//
|
||||
Note.get = (userId, noteId, masterKey) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
|
@@ -13,11 +13,14 @@ QuickNote.get = (userId, masterKey) => {
|
||||
SELECT note.id FROM note WHERE quick_note = 1 AND user_id = ? LIMIT 1`, [userId])
|
||||
.then((rows, fields) => {
|
||||
|
||||
//Quick Note is set, return note text
|
||||
//Quick Note is set, return note object
|
||||
if(rows[0][0] != undefined){
|
||||
|
||||
let noteId = rows[0][0].id
|
||||
return resolve({'noteId':noteId})
|
||||
const note = Note.get(userId, noteId, masterKey)
|
||||
.then(noteData => {
|
||||
return resolve(noteData)
|
||||
})
|
||||
|
||||
} else {
|
||||
//Or create a new note and get the id
|
||||
@@ -81,7 +84,7 @@ QuickNote.update = (userId, pushText, masterKey) => {
|
||||
.replace(/&[#A-Za-z0-9]+;/g,'') //Rip out all HTML entities
|
||||
.replace(/<[^>]+>/g, '') //Rip out all HTML tags
|
||||
|
||||
//Turn links into actual linx
|
||||
//Turn links into actual link
|
||||
clean = QuickNote.makeUrlLink(clean)
|
||||
|
||||
if(clean == ''){ clean = ' ' }
|
||||
@@ -114,7 +117,7 @@ QuickNote.update = (userId, pushText, masterKey) => {
|
||||
}
|
||||
})
|
||||
.then( saveResults => {
|
||||
return resolve(true)
|
||||
return resolve(saveResults)
|
||||
})
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user