mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be1a5b09da | ||
|
|
3de2db4459 | ||
|
|
f2405a5b34 | ||
|
|
94abb8f959 | ||
|
|
2e30db05bc | ||
|
|
c93f3cc5dd | ||
|
|
068f8f2ba9 | ||
|
|
0980c3b012 | ||
|
|
5288d6768f | ||
|
|
34491f4ea4 | ||
|
|
8c73ca8854 | ||
|
|
0786d8eab6 | ||
|
|
209518c815 | ||
|
|
b2753b6457 | ||
|
|
4775a920c0 | ||
|
|
0e94dc8740 | ||
|
|
cf68d202d5 | ||
|
|
d29ba2bf16 | ||
|
|
720686cef5 | ||
|
|
0625c65cf0 | ||
|
|
acaefe22d1 | ||
|
|
df1f083ebf | ||
|
|
5a1dfc2ca9 | ||
|
|
d84894f1bf | ||
|
|
0fdc444c4c | ||
|
|
4d216c6f13 | ||
|
|
1c0af8eede | ||
|
|
f443f9264a | ||
|
|
d9b2981327 | ||
|
|
68e36d2a6d | ||
|
|
68b91bf98c | ||
|
|
b91ddfad05 | ||
|
|
a110cbfb5d | ||
|
|
d69f45b0c9 | ||
|
|
07df26d5c4 | ||
|
|
d24bcb7f86 | ||
|
|
9f383ba491 | ||
|
|
c38a76d587 | ||
|
|
994ca5dd02 | ||
|
|
9281f8f6cb | ||
|
|
324f579474 | ||
|
|
95e7f4f645 |
5
Backers.md
Normal file
5
Backers.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Become a [backer](https://salt.bountysource.com/teams/boostnote) and support Boostnote!
|
||||
You can support Boostnote from $ 5 a month!
|
||||
|
||||
# Backers
|
||||
[Kazu Yokomizo](https://twitter.com/kazup_bot)
|
||||
@@ -84,7 +84,13 @@ export default class CodeEditor extends React.Component {
|
||||
'Cmd-T': function (cm) {
|
||||
// Do nothing
|
||||
},
|
||||
Enter: 'newlineAndIndentContinueMarkdownList'
|
||||
Enter: 'newlineAndIndentContinueMarkdownList',
|
||||
'Ctrl-C': (cm) => {
|
||||
if (cm.getOption('keyMap').substr(0, 3) === 'vim') {
|
||||
document.execCommand('copy')
|
||||
}
|
||||
return CodeMirror.Pass
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
.control-fullScreenButton
|
||||
float right
|
||||
padding 7px
|
||||
topBarButtonLight()
|
||||
|
||||
.body
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
|
||||
.control-fullScreenButton
|
||||
float right
|
||||
padding 7px
|
||||
topBarButtonLight()
|
||||
|
||||
body[data-theme="dark"]
|
||||
|
||||
@@ -12,7 +12,7 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import modal from 'browser/main/lib/modal'
|
||||
import InitModal from 'browser/main/modals/InitModal'
|
||||
import mixpanel from 'browser/main/lib/mixpanel'
|
||||
import mobileAnalytics from 'browser/main/lib/awsMobileAnalyticsConfig'
|
||||
import mobileAnalytics from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||
|
||||
function focused () {
|
||||
@@ -160,26 +160,29 @@ class Main extends React.Component {
|
||||
handleFullScreenButton (e) {
|
||||
this.setState({ fullScreen: !this.state.fullScreen }, () => {
|
||||
const noteDetail = document.querySelector('.NoteDetail')
|
||||
const noteList = document.querySelector('.NoteList')
|
||||
const mainBody = document.querySelector('#main-body')
|
||||
|
||||
if (this.state.fullScreen) {
|
||||
this.hideLeftLists(noteDetail, mainBody)
|
||||
this.hideLeftLists(noteDetail, noteList, mainBody)
|
||||
} else {
|
||||
this.showLeftLists(noteDetail, mainBody)
|
||||
this.showLeftLists(noteDetail, noteList, mainBody)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
hideLeftLists (noteDetail, mainBody) {
|
||||
hideLeftLists (noteDetail, noteList, mainBody) {
|
||||
this.state.noteDetailWidth = noteDetail.style.left
|
||||
this.state.mainBodyWidth = mainBody.style.left
|
||||
noteDetail.style.left = '0px'
|
||||
mainBody.style.left = '0px'
|
||||
noteList.style.display = 'none'
|
||||
}
|
||||
|
||||
showLeftLists (noteDetail, mainBody) {
|
||||
showLeftLists (noteDetail, noteList, mainBody) {
|
||||
noteDetail.style.left = this.state.noteDetailWidth
|
||||
mainBody.style.left = this.state.mainBodyWidth
|
||||
noteList.style.display = 'inline'
|
||||
}
|
||||
|
||||
render () {
|
||||
|
||||
@@ -9,6 +9,10 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import NoteItem from 'browser/components/NoteItem'
|
||||
import NoteItemSimple from 'browser/components/NoteItemSimple'
|
||||
import searchFromNotes from 'browser/lib/search'
|
||||
import fs from 'fs'
|
||||
import { hashHistory } from 'react-router'
|
||||
import markdown from 'browser/lib/markdown'
|
||||
import { findNoteTitle } from 'browser/lib/findNoteTitle'
|
||||
|
||||
const { remote } = require('electron')
|
||||
const { Menu, MenuItem, dialog } = remote
|
||||
@@ -42,6 +46,7 @@ class NoteList extends React.Component {
|
||||
this.alertIfSnippetHandler = () => {
|
||||
this.alertIfSnippet()
|
||||
}
|
||||
this.importFromFileHandler = this.importFromFile.bind(this)
|
||||
|
||||
this.jumpToTopHandler = () => {
|
||||
this.jumpToTop()
|
||||
@@ -59,6 +64,7 @@ class NoteList extends React.Component {
|
||||
ee.on('list:isMarkdownNote', this.alertIfSnippetHandler)
|
||||
ee.on('list:top', this.jumpToTopHandler)
|
||||
ee.on('list:jumpToTop', this.jumpToTopHandler)
|
||||
ee.on('import:file', this.importFromFileHandler)
|
||||
}
|
||||
|
||||
componentWillReceiveProps (nextProps) {
|
||||
@@ -80,6 +86,7 @@ class NoteList extends React.Component {
|
||||
ee.off('list:isMarkdownNote', this.alertIfSnippetHandler)
|
||||
ee.off('list:top', this.jumpToTopHandler)
|
||||
ee.off('list:jumpToTop', this.jumpToTopHandler)
|
||||
ee.off('import:file', this.importFromFileHandler)
|
||||
}
|
||||
|
||||
componentDidUpdate (prevProps) {
|
||||
@@ -365,6 +372,51 @@ class NoteList extends React.Component {
|
||||
e.dataTransfer.setData('note', noteData)
|
||||
}
|
||||
|
||||
importFromFile () {
|
||||
const { dispatch, location } = this.props
|
||||
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'Documents', extensions: ['md', 'txt'] }
|
||||
],
|
||||
properties: ['openFile', 'multiSelections']
|
||||
}
|
||||
|
||||
const targetIndex = _.findIndex(this.notes, (note) => {
|
||||
return note !== null && `${note.storage}-${note.key}` === location.query.key
|
||||
})
|
||||
|
||||
const storageKey = this.notes[targetIndex].storage
|
||||
const folderKey = this.notes[targetIndex].folder
|
||||
|
||||
dialog.showOpenDialog(remote.getCurrentWindow(), options, (filepaths) => {
|
||||
if (filepaths === undefined) return
|
||||
filepaths.forEach((filepath) => {
|
||||
fs.readFile(filepath, (err, data) => {
|
||||
if (err) throw Error('File reading error: ', err)
|
||||
const content = data.toString()
|
||||
const newNote = {
|
||||
content: content,
|
||||
folder: folderKey,
|
||||
title: markdown.strip(findNoteTitle(content)),
|
||||
type: 'MARKDOWN_NOTE'
|
||||
}
|
||||
dataApi.createNote(storageKey, newNote)
|
||||
.then((note) => {
|
||||
dispatch({
|
||||
type: 'UPDATE_NOTE',
|
||||
note: note
|
||||
})
|
||||
hashHistory.push({
|
||||
pathname: location.pathname,
|
||||
query: {key: `${note.storage}-${note.key}`}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
render () {
|
||||
let { location, notes, config, dispatch } = this.props
|
||||
let sortFunc = config.sortBy === 'CREATED_AT'
|
||||
|
||||
@@ -2,17 +2,17 @@ const AWS = require('aws-sdk')
|
||||
const AMA = require('aws-sdk-mobile-analytics')
|
||||
const ConfigManager = require('browser/main/lib/ConfigManager')
|
||||
|
||||
AWS.config.region = 'us-east-1'
|
||||
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
||||
IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||
})
|
||||
|
||||
const mobileAnalyticsClient = new AMA.Manager({
|
||||
appId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||
appTitle: 'xxxxxxxxxx'
|
||||
})
|
||||
|
||||
function initAwsMobileAnalytics () {
|
||||
AWS.config.region = 'us-east-1'
|
||||
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
||||
IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||
})
|
||||
|
||||
AWS.config.credentials.get((err) => {
|
||||
if (!err) {
|
||||
console.log('Cognito Identity ID: ' + AWS.config.credentials.identityId)
|
||||
|
||||
@@ -41,7 +41,7 @@ function init () {
|
||||
.then((notes) => {
|
||||
let unknownCount = 0
|
||||
notes.forEach((note) => {
|
||||
if (!storage.folders.some((folder) => note.folder === folder.key)) {
|
||||
if (note && !storage.folders.some((folder) => note.folder === folder.key)) {
|
||||
unknownCount++
|
||||
storage.folders.push({
|
||||
key: note.folder,
|
||||
|
||||
@@ -28,7 +28,6 @@ function resolveStorageNotes (storage) {
|
||||
return data
|
||||
} catch (err) {
|
||||
console.error(notePath)
|
||||
throw err
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ function data (state = defaultDataMap(), action) {
|
||||
state.storageMap.set(storage.key, storage)
|
||||
})
|
||||
|
||||
action.notes.forEach((note) => {
|
||||
action.notes.some((note) => {
|
||||
if (note === undefined) return true
|
||||
let uniqueKey = note.storage + '-' + note.key
|
||||
let folderKey = note.storage + '-' + note.folder
|
||||
state.noteMap.set(uniqueKey, note)
|
||||
|
||||
@@ -1,33 +1,51 @@
|
||||
# Contributing to Boostnote
|
||||
# Contributing to Boostnote (English)
|
||||
|
||||
## When you open an issue of a bug report
|
||||
### When you open an issue of a bug report
|
||||
There are no issue template. But there is a request.
|
||||
|
||||
**Please paste screenshots of Boostnote with developer tool open**
|
||||
|
||||
Thank you for your help in advance.
|
||||
|
||||
## About copyright of Pull Request
|
||||
### About copyright of Pull Request
|
||||
|
||||
If you make a pull request, It means you agree to transfer the copyright of the code changes to MAISIN&CO.
|
||||
If you make a pull request, It means you agree to transfer the copyright of the code changes to Maisin&Co.
|
||||
|
||||
It doesn't mean Boostnote will become a paid app. If we want to earn some money, We will try other way, which is some kind of cloud storage, Mobile app integration or some SPECIAL features.
|
||||
Because GPL v3 is too strict to be compatible with any other License, We thought this is needed to replace the license with much freer one(like BSD, MIT) somewhen.
|
||||
|
||||
---
|
||||
|
||||
# Contributing to Boostnote (Russian)
|
||||
|
||||
### Когда у вас появляется сообщение об ошибке
|
||||
У нас нет шаблона, по которому вы должны описать ошибку. Просто расскажите, как вы получили ее
|
||||
|
||||
**Вставьте скриншот Boostnote с открытым инструментом разработчика (dev tools)**
|
||||
|
||||
Благодарим Вас за помощь!
|
||||
|
||||
### Об авторских правах Pull Request
|
||||
|
||||
Если вы делаете pull request, значит вы согласны передать авторские права на изменения кода в Maisin&Co.
|
||||
|
||||
Это не означает, что Boostnote станет платным приложением. Если мы захотим заработать немного денег, мы найдем другой способ. Например, использование облачного хранилища, интеграцией мобильных приложений или другими специальными функциями.
|
||||
Так как лицензия GPL v3 слишком строгая, чтобы быть совместимой с любой другой лицензией, мы думаем, что нужно заменить лицензию на более свободную (например, BSD, MIT).
|
||||
|
||||
---
|
||||
|
||||
# Contributing to Boostnote (Korean)
|
||||
|
||||
## 버그 리포트를 보고할 때
|
||||
### 버그 리포트를 보고할 때
|
||||
이슈의 양식은 없습니다. 하지만 부탁이 있습니다.
|
||||
|
||||
**개발자 도구를 연 상태의 Boostnote 스크린샷을 첨부해주세요**
|
||||
|
||||
도움을 주셔서 감사합니다.
|
||||
|
||||
## Pull Request의 저작권에 관하여
|
||||
### Pull Request의 저작권에 관하여
|
||||
|
||||
당신이 pull request를 요청하면, 코드 변경에 대한 저작권을 MAISIN&CO에 양도한다는 것에 동의한다는 의미입니다.
|
||||
당신이 pull request를 요청하면, 코드 변경에 대한 저작권을 Maisin&Co에 양도한다는 것에 동의한다는 의미입니다.
|
||||
|
||||
이것은 Boostnote가 유료화가 되는 것을 의미하는 건 아닙니다. 만약 우리가 자금이 필요하다면, 우리는 클라우드 연동, 모바일 앱 통합 혹은 특수한 기능 같은 것을 사용해 수입 창출을 시도할 것입니다.
|
||||
GPL v3 라이센스는 다른 라이센스와 혼합해 사용하기엔 너무 엄격하므로, 우리는 BSD, MIT 라이센스와 같은 더 자유로운 라이센스로 교체하는 것을 생각하고 있습니다.
|
||||
@@ -36,16 +54,16 @@ GPL v3 라이센스는 다른 라이센스와 혼합해 사용하기엔 너무
|
||||
|
||||
# Contributing to Boostnote (Japanese)
|
||||
|
||||
## バグレポートに関してのissueを立てる時
|
||||
### バグレポートに関してのissueを立てる時
|
||||
イシューテンプレートはありませんが、1つお願いがあります。
|
||||
|
||||
**開発者ツールを開いた状態のBoostnoteのスクリーンショットを貼ってください**
|
||||
|
||||
よろしくお願いします。
|
||||
|
||||
## Pull requestの著作権について
|
||||
### Pull requestの著作権について
|
||||
|
||||
Pull requestをすることはその変化分のコードの著作権をMAISIN&CO.に譲渡することに同意することになります。
|
||||
Pull requestをすることはその変化分のコードの著作権をMaisin&Co.に譲渡することに同意することになります。
|
||||
|
||||
アプリケーションのLicenseをいつでも変える選択肢を残したいと思うからです。
|
||||
これはいずれかBoostnoteが有料の商用アプリになる可能性がある話ではありません。
|
||||
|
||||
57
docs/ru/build.md
Normal file
57
docs/ru/build.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# Сборка
|
||||
|
||||
## Используемые инструменты
|
||||
* npm: 4.x
|
||||
* node: 7.x
|
||||
|
||||
Вы должны использовать `npm v4.x`, так как `$ grand pre-build` не работает в `v5.x`.
|
||||
|
||||
## Разработка
|
||||
|
||||
Мы используем Webpack HMR при разработке Boostnote.
|
||||
Выполнение следующих команд в корне проекта запустит Boostnote с настройками по умолчанию.
|
||||
|
||||
Установите необходимые пакеты с помощью yarn.
|
||||
|
||||
```
|
||||
$ yarn
|
||||
```
|
||||
|
||||
Соберите и запустите.
|
||||
|
||||
```
|
||||
$ yarn run dev-start
|
||||
```
|
||||
|
||||
Эта команда выполняет `yarn run webpack` и `yarn run hot` параллельно. Результат будет такой же, если вы выполните эти две команды раздельно.
|
||||
|
||||
`Webpack` будет следить за изменениями в коде и будет применять их автоматически.
|
||||
|
||||
Если возникает следующая ошибка: `Failed to load resource: net::ERR_CONNECTION_REFUSED`, пожалуйста, перезапустите Boostnote.
|
||||
|
||||

|
||||
|
||||
> ### Примечание
|
||||
> В некоторых случаях вам необходимо обновить приложение вручную.
|
||||
> 1. При редактировании метода конструктора компонента
|
||||
> 2. При добавлении нового класса CSS (аналогично 1: Класс CSS перезаписывается каждым компонентом. Этот процесс выполняется в методе Constructor.)
|
||||
|
||||
## Деплой
|
||||
|
||||
Мы используем Grunt для автоматического деплоя.
|
||||
Вы можете создать задачу, используя `grunt`. Однако мы не рекомендуем этого делать, так как задача по умолчанию включает в себя код и аутентификацию.
|
||||
|
||||
Мы подготовили отдельный скрипт, который просто создает исполняемый файл:
|
||||
|
||||
```
|
||||
grunt pre-build
|
||||
```
|
||||
|
||||
Вы найдете исполняемый файл в папке `dist`. Обратите внимание: автоматическое обновление не будет работать, потому что приложение не подписано.
|
||||
|
||||
Если вам необходимо, вы можете использовать код или аутентификацию с помощью этого исполняемого файла.
|
||||
|
||||
---
|
||||
|
||||
Special thanks:
|
||||
Translated by @AlexanderBelkevich
|
||||
25
docs/ru/debug.md
Normal file
25
docs/ru/debug.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Как отладить Boostnote (приложение Electron)
|
||||
Boostnote - это программа, сделанная с помощью Electron, поэтому она базируется на Chromium. Разработчики могут использовать `Developer Tools` в Google Chrome для отладки.
|
||||
|
||||
Вы можете переключиться в `Developer Tools` следующим образом:
|
||||

|
||||
|
||||
`Developer Tools` будет выглядеть следующим образом:
|
||||

|
||||
|
||||
Возможные ошибки отображаются во вкладке `console`.
|
||||
|
||||
## Отладка
|
||||
Например, вы можете использовать `debugger`, чтобы установить точку остановы следующим образом:
|
||||
|
||||

|
||||
|
||||
Это всего лишь пример. Вы можете использовать любой свой способ отладки. Тот, который вам будет удобен.
|
||||
|
||||
## Рекомендации
|
||||
* [Официальная документация Google Chrome об отладке](https://developer.chrome.com/devtools)
|
||||
|
||||
---
|
||||
|
||||
Special thanks:
|
||||
Translated by @AlexanderBelkevich
|
||||
20
docs/ru/testing.md
Normal file
20
docs/ru/testing.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Тестирование для Boostnote
|
||||
## Тестирование e2e
|
||||
Существуют тесты e2e для Boostnote, написанные на [ava](https://github.com/avajs/ava) и [spectron](https://github.com/electron/spectron).
|
||||
|
||||
### Как запустить
|
||||
Для тестирование e2e существует команда:
|
||||
|
||||
```
|
||||
$ yarn run test:e2e
|
||||
```
|
||||
|
||||
Причина, по которой я использую другую команду тестирования - это удобство travisCI.
|
||||
|
||||
### TravisCI
|
||||
Я установил тесты e2e, запущенные на travisCI, только в ветке master. Если вас это интересует, ознакомьтесь с файлом .travis.yml
|
||||
|
||||
---
|
||||
|
||||
Special thanks:
|
||||
Translated by @AlexanderBelkevich
|
||||
@@ -92,6 +92,20 @@ const file = {
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Import from',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Plain Text, MarkDown (.txt, .md)',
|
||||
click () {
|
||||
mainWindow.webContents.send('import:file')
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Delete Note',
|
||||
accelerator: macOS ? 'Control+Backspace' : 'Control+Delete',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "boost",
|
||||
"version": "0.8.10",
|
||||
"version": "0.8.11",
|
||||
"main": "index.js",
|
||||
"description": "Boostnote",
|
||||
"license": "GPL-3.0",
|
||||
@@ -77,7 +77,6 @@
|
||||
"react-redux": "^4.4.5",
|
||||
"redux": "^3.5.2",
|
||||
"sander": "^0.5.1",
|
||||
"spectron": "^3.6.2",
|
||||
"superagent": "^1.2.0",
|
||||
"superagent-promise": "^1.0.3"
|
||||
},
|
||||
@@ -114,6 +113,7 @@
|
||||
"react-input-autosize": "^1.1.0",
|
||||
"react-router": "^2.4.0",
|
||||
"react-router-redux": "^4.0.4",
|
||||
"spectron": "^3.6.2",
|
||||
"standard": "^8.4.0",
|
||||
"style-loader": "^0.12.4",
|
||||
"stylus": "^0.52.4",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
## slack group
|
||||
私たちにはslack groupもあります!世界中のプログラマー達と、Boostnoteについてディスカッションをしましょう! <br>
|
||||
[こちらから](https://join.slack.com/boostnote-group/shared_invite/MTkwOTg2NjAzNTUyLTE0OTYzODQ3ODgtMGI4NDZlY2E5OQ)
|
||||
[こちらから](https://join.slack.com/boostnote-group/shared_invite/MjAwNTAwNzc4MDM0LTE0OTc5NjIzMDItZjcyOWIyOWY5YQ)
|
||||
|
||||
## More Information
|
||||
* Website: http://boostnote.io/
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
## Slack Group
|
||||
Let's talk about Boostnote's great features, new feature requests and things like Japanese gourmet. 🍣 <br>
|
||||
[Join us](https://join.slack.com/boostnote-group/shared_invite/MTkwOTg2NjAzNTUyLTE0OTYzODQ3ODgtMGI4NDZlY2E5OQ)
|
||||
[Join us](https://join.slack.com/boostnote-group/shared_invite/MjAwNTAwNzc4MDM0LTE0OTc5NjIzMDItZjcyOWIyOWY5YQ)
|
||||
|
||||
## More Information
|
||||
* [Website](https://boostnote.io)
|
||||
|
||||
Reference in New Issue
Block a user