1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 18:56:22 +00:00

Merge pull request #681 from BoostIO/edit-initial-files

Edit initial files
This commit is contained in:
SuenagaRyota
2017-07-07 20:59:50 +09:00
committed by GitHub
2 changed files with 18 additions and 18 deletions

View File

@@ -24,7 +24,7 @@ export const DEFAULT_CONFIG = {
defaultNote: 'ALWAYS_ASK' // 'ALWAYS_ASK', 'SNIPPET_NOTE', 'MARKDOWN_NOTE' defaultNote: 'ALWAYS_ASK' // 'ALWAYS_ASK', 'SNIPPET_NOTE', 'MARKDOWN_NOTE'
}, },
editor: { editor: {
theme: 'default', theme: 'base16-light',
keyMap: 'sublime', keyMap: 'sublime',
fontSize: '14', fontSize: '14',
fontFamily: 'Monaco, Consolas', fontFamily: 'Monaco, Consolas',
@@ -35,7 +35,7 @@ export const DEFAULT_CONFIG = {
preview: { preview: {
fontSize: '14', fontSize: '14',
fontFamily: 'Lato', fontFamily: 'Lato',
codeBlockTheme: 'elegant', codeBlockTheme: 'dracula',
lineNumber: true lineNumber: true
} }
} }

View File

@@ -103,7 +103,7 @@ class InitModal extends React.Component {
} else { } else {
return dataApi return dataApi
.createFolder(data.storage.key, { .createFolder(data.storage.key, {
color: '#6AA5E9', color: '#1278BD',
name: 'Default' name: 'Default'
}) })
.then((_data) => { .then((_data) => {
@@ -122,19 +122,6 @@ class InitModal extends React.Component {
notes: data.notes notes: data.notes
}) })
let defaultMarkdownNote = dataApi
.createNote(data.storage.key, {
type: 'MARKDOWN_NOTE',
folder: data.storage.folders[0].key,
title: 'Welcome to Boostnote :)',
content: '# Welcome to Boostnote :)\nThis is a markdown note.\n\nClick to edit this note.'
})
.then((note) => {
store.dispatch({
type: 'UPDATE_NOTE',
note: note
})
})
let defaultSnippetNote = dataApi let defaultSnippetNote = dataApi
.createNote(data.storage.key, { .createNote(data.storage.key, {
type: 'SNIPPET_NOTE', type: 'SNIPPET_NOTE',
@@ -145,12 +132,12 @@ class InitModal extends React.Component {
{ {
name: 'example.html', name: 'example.html',
mode: 'html', mode: 'html',
content: '<html>\n<body>\n<h1 id=\'hello\'>Hello World</h1>\n</body>\n</html>' content: '<html>\n<body>\n<h1 id=\'hello\'>Enjoy Boostnote!</h1>\n</body>\n</html>'
}, },
{ {
name: 'example.js', name: 'example.js',
mode: 'javascript', mode: 'javascript',
content: 'var html = document.getElementById(\'hello\').innerHTML\n\nconsole.log(html)' content: 'var boostnote = document.getElementById(\'enjoy\').innerHTML\n\nconsole.log(boostnote)'
} }
] ]
}) })
@@ -160,6 +147,19 @@ class InitModal extends React.Component {
note: note note: note
}) })
}) })
let defaultMarkdownNote = dataApi
.createNote(data.storage.key, {
type: 'MARKDOWN_NOTE',
folder: data.storage.folders[0].key,
title: 'Welcome to Boostnote!',
content: '# Welcome to Boostnote! \n### _Click to edit this note._\n\n---\n\nBoostnote is an *open source* note-taking app. \nRepository is published on [GitHub](https://github.com/BoostIO/Boostnote), and tweeting everyday on [@Boostnoteapp](https://twitter.com/boostnoteapp)!\n\n## Features \n- [x] No Internet and Registration Required. \n- [ ] Quick search and copy the content of note. `macOS: Cmd + Alt + S / windows: Ctrl + Alt + S` \n- [ ] Markdown & Snippet note. \n- [ ] Available for `vim` and `emacs` mode. \n- [ ] Choose your favorite theme on UI, Editor and Code Block! \n--- \n\n- Copy Codeblock on Makrdown Preview.\n```javascript\nvar boostnote = document.getElementById(\'enjoy\').innerHTML\n\nconsole.log(boostnote)\n```'
})
.then((note) => {
store.dispatch({
type: 'UPDATE_NOTE',
note: note
})
})
return Promise.resolve(defaultSnippetNote) return Promise.resolve(defaultSnippetNote)
.then(defaultMarkdownNote) .then(defaultMarkdownNote)