Add styling changes and beginnings of adding notes
Zoom set to 85% since components can't be resized. Added start of functionality to add notes.
This commit is contained in:
parent
6912567122
commit
cfeb438af2
5 changed files with 118 additions and 43 deletions
|
|
@ -1,10 +1,52 @@
|
|||
import path from 'path-extra'
|
||||
import uuid from 'node-uuid'
|
||||
|
||||
import * as utils from 'utils'
|
||||
import glob from 'glob'
|
||||
|
||||
import fs from 'fs'
|
||||
import mkdirp from 'mkdirp'
|
||||
import jsfile from 'jsonfile'
|
||||
import rmdir from 'rimraf'
|
||||
|
||||
|
||||
export function getAppDataPath(){
|
||||
return path.datadir(APP_NAME)
|
||||
}
|
||||
|
||||
export function getNotebookPath(notebook){
|
||||
export function getNotePath(notebook, note){
|
||||
var notePath = getAppDataPath()
|
||||
return path.join(notePath, notebook.uuid+'.qvnotebook')
|
||||
var notebookPath = getNotebookPath(notebook)
|
||||
return path.join(notebookPath, note.uuid+'.qvnote')
|
||||
}
|
||||
|
||||
export function getNotebookPath(notebook){
|
||||
var noteBookPath = getAppDataPath()
|
||||
return path.join(noteBookPath, notebook.uuid+'.qvnotebook')
|
||||
}
|
||||
|
||||
export function loadNotebookByName(nameOrUUID){
|
||||
var dataPath = getAppDataPath()
|
||||
var notebookPath = path.join(dataPath, nameOrUUID+'.qvnotebook')
|
||||
var obj = jsfile.readFileSync(path.join(notebookPath, 'meta.json'))
|
||||
var notes = glob.sync(path.join(notebookPath, '*.qvnote'))
|
||||
|
||||
var nb = {
|
||||
'title': obj.name,
|
||||
'uuid': obj.uuid,
|
||||
'notes': notes.length,
|
||||
'path': notebookPath
|
||||
}
|
||||
|
||||
if(nb.title == ''){
|
||||
nb.state = 'editing'
|
||||
}
|
||||
else{
|
||||
nb.state = 'displaying'
|
||||
}
|
||||
return nb
|
||||
}
|
||||
|
||||
export function getNotebookPathFromUUID(uuid){
|
||||
return getNotebookPath({uuid: uuid})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue