* Adjusted theme colors to add more contrast on white theme while making black more OLED friendly
* Links now get an underline on hover * Cleaned up CSS variable names, added another theme color for more control * Cleaned up unused CSS, removed scrollbars popping up, tons of other little UI tweaks * Renamed shared notes to inbox * Tweaked form display, seperated login and create accouts * Put login/sign up form on home page * Created more legitimate marketing for home page * Tons up updates to note page and note input panel * Better support for two users editing a note * MUCH better diff handling, web sockets restore notes with unsaved diffs * Moved all squire text modifier functions into a mixin class * It now says saving when closing a note * Lots of cleanup and better handiling of events on mount and destroy * Scroll behavior modified to load notes when closer to bottom of page * Pretty decent shared notes and sharable link support * Updated help text * Search now includes tag suggestions and attachment suggestions * Cleaned up scratch pad a ton, allow for users to create new scratch pads * Created a 404 Page and a Shared note page * So many other small improvements. Oh my god, what is wrong with me, not doing commits!?
This commit is contained in:
1 parent
8e5e06be9b
commit
6bb856689d
31 files changed
+1605
-1095
No files matched your search
+14
-15
@@ -19,15 +19,6 @@ User.login = (username, password) => {
|
||||
.query('SELECT * FROM user WHERE username = ? LIMIT 1', [lowerName])
|
||||
.then((rows, fields) => {
|
||||
|
||||
// Create New Account
|
||||
//
|
||||
if(rows[0].length == 0){
|
||||
User.create(lowerName, password)
|
||||
.then( ({token, userId}) => {
|
||||
return resolve({ token, userId })
|
||||
})
|
||||
}
|
||||
|
||||
// Login User
|
||||
//
|
||||
if(rows[0].length == 1){
|
||||
@@ -60,6 +51,8 @@ User.login = (username, password) => {
|
||||
reject('Password does not match database')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return reject('Incorrect Username or Password')
|
||||
}
|
||||
})
|
||||
.catch(console.log)
|
||||
@@ -69,7 +62,7 @@ User.login = (username, password) => {
|
||||
|
||||
//Create user account
|
||||
//Issues login token
|
||||
User.create = (username, password) => {
|
||||
User.register = (username, password) => {
|
||||
|
||||
//For some reason, username won't get into the promise. But password will @TODO figure this out
|
||||
const lowerName = username.toLowerCase().trim()
|
||||
@@ -152,8 +145,8 @@ User.getCounts = (userId) => {
|
||||
SUM(archived = 1 && share_user_id IS NULL && trashed = 0) AS archivedNotes,
|
||||
SUM(trashed = 1) AS trashedNotes,
|
||||
SUM(share_user_id IS NULL && trashed = 0) AS totalNotes,
|
||||
SUM(share_user_id != ? && trashed = 0) AS sharedToNotes,
|
||||
SUM( (share_user_id != ? && opened IS null && trashed = 0) || (share_user_id != ? && note_raw_text.updated > opened && trashed = 0) ) AS unreadNotes
|
||||
SUM(share_user_id IS NOT null && opened IS null && trashed = 0) AS youGotMailCount,
|
||||
SUM(share_user_id != ? && trashed = 0) AS sharedToNotes
|
||||
FROM note
|
||||
LEFT JOIN note_raw_text ON (note_raw_text.id = note.note_raw_text_id)
|
||||
WHERE user_id = ?`, [userId, userId, userId, userId])
|
||||
@@ -406,12 +399,12 @@ User.keyPairTest = (testUserName = 'genMan', password = '1', printResults) => {
|
||||
|
||||
const randomUsername = Math.random().toString(36).substring(2, 15);
|
||||
const randomPassword = '1'
|
||||
|
||||
User.login(testUserName, password)
|
||||
|
||||
User.register(testUserName, password)
|
||||
.then( ({ token, userId }) => {
|
||||
testUserId = userId
|
||||
|
||||
if(printResults) console.log('Test: Create/Login User '+testUserName+' - Pass')
|
||||
if(printResults) console.log('Test: Register User '+testUserName+' - Pass')
|
||||
|
||||
return User.getMasterKey(testUserId, password)
|
||||
})
|
||||
@@ -439,6 +432,12 @@ User.keyPairTest = (testUserName = 'genMan', password = '1', printResults) => {
|
||||
//Convert it back to string
|
||||
if(printResults) console.log(publicDeccryptMessage.toString('utf8'))
|
||||
|
||||
return User.login(testUserName, password)
|
||||
})
|
||||
.then( ({token, userId}) => {
|
||||
|
||||
if(printResults) console.log('Test: Login New User - Pass')
|
||||
|
||||
resolve({testUserId, masterKey})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user