mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-17 03:31:52 +00:00
Merge branch 'master' into linux
* master: configuring zoomfactor with Ctrl + Wheelscroll only works on windows and linux fix style bug of TagSelect bump up electron version to 0.36.11 fix again(never break long tag) tags in ArticleList will be wrapped properly fix emacs key binding ctrl + wheel to change zoom factor set Editor fontFamily to Title input add Link of Trello Kanban to readme.md Update contributing Focus to search box, when hotkey pushed
This commit is contained in:
@@ -40,11 +40,22 @@ export default class CodeEditor extends React.Component {
|
|||||||
this.execHandler = (e) => {
|
this.execHandler = (e) => {
|
||||||
console.log(e.command.name)
|
console.log(e.command.name)
|
||||||
switch (e.command.name) {
|
switch (e.command.name) {
|
||||||
|
case 'gotolinestart':
|
||||||
|
e.preventDefault()
|
||||||
|
{
|
||||||
|
let position = this.editor.getCursorPosition()
|
||||||
|
this.editor.navigateTo(position.row, 0)
|
||||||
|
}
|
||||||
|
break
|
||||||
case 'gotolineend':
|
case 'gotolineend':
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
let position = this.editor.getCursorPosition()
|
let position = this.editor.getCursorPosition()
|
||||||
this.editor.navigateTo(position.row, this.editor.getSession().getLine(position.row).length)
|
this.editor.navigateTo(position.row, this.editor.getSession().getLine(position.row).length)
|
||||||
break
|
break
|
||||||
|
case 'jumptomatching':
|
||||||
|
e.preventDefault()
|
||||||
|
this.editor.navigateUp()
|
||||||
|
break
|
||||||
case 'removetolineend':
|
case 'removetolineend':
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
let range = this.editor.getSelectionRange()
|
let range = this.editor.getSelectionRange()
|
||||||
|
|||||||
@@ -15,6 +15,12 @@ import DeleteArticleModal from '../../modal/DeleteArticleModal'
|
|||||||
import ArticleEditor from './ArticleEditor'
|
import ArticleEditor from './ArticleEditor'
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const ipc = electron.ipcRenderer
|
const ipc = electron.ipcRenderer
|
||||||
|
import fetchConfig from 'browser/lib/fetchConfig'
|
||||||
|
|
||||||
|
let config = fetchConfig()
|
||||||
|
ipc.on('config-apply', function (e, newConfig) {
|
||||||
|
config = newConfig
|
||||||
|
})
|
||||||
|
|
||||||
const BRAND_COLOR = '#18AF90'
|
const BRAND_COLOR = '#18AF90'
|
||||||
const OSX = global.process.platform === 'darwin'
|
const OSX = global.process.platform === 'darwin'
|
||||||
@@ -83,10 +89,12 @@ export default class ArticleDetail extends React.Component {
|
|||||||
if (isModalOpen()) return true
|
if (isModalOpen()) return true
|
||||||
if (this.refs.editor) this.refs.editor.switchPreviewMode()
|
if (this.refs.editor) this.refs.editor.switchPreviewMode()
|
||||||
}
|
}
|
||||||
|
this.configApplyHandler = (e, config) => this.handleConfigApply(e, config)
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
article: Object.assign({content: ''}, props.activeArticle),
|
article: Object.assign({content: ''}, props.activeArticle),
|
||||||
openShareDropdown: false
|
openShareDropdown: false,
|
||||||
|
fontFamily: config['editor-font-family']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,6 +109,7 @@ export default class ArticleDetail extends React.Component {
|
|||||||
ipc.on('detail-title', this.titleHandler)
|
ipc.on('detail-title', this.titleHandler)
|
||||||
ipc.on('detail-edit', this.editHandler)
|
ipc.on('detail-edit', this.editHandler)
|
||||||
ipc.on('detail-preview', this.previewHandler)
|
ipc.on('detail-preview', this.previewHandler)
|
||||||
|
ipc.on('config-apply', this.configApplyHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
@@ -123,6 +132,12 @@ export default class ArticleDetail extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleConfigApply (e, config) {
|
||||||
|
this.setState({
|
||||||
|
fontFamily: config['editor-font-family']
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
renderEmpty () {
|
renderEmpty () {
|
||||||
return (
|
return (
|
||||||
<div className='ArticleDetail empty'>
|
<div className='ArticleDetail empty'>
|
||||||
@@ -309,6 +324,9 @@ export default class ArticleDetail extends React.Component {
|
|||||||
ref='title'
|
ref='title'
|
||||||
value={activeArticle.title}
|
value={activeArticle.title}
|
||||||
onChange={e => this.handleTitleChange(e)}
|
onChange={e => this.handleTitleChange(e)}
|
||||||
|
style={{
|
||||||
|
fontFamily: this.state.fontFamily
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<ModeSelect
|
<ModeSelect
|
||||||
|
|||||||
@@ -19,9 +19,27 @@ export default class MainContainer extends React.Component {
|
|||||||
ipc.send('update-app', 'Deal with it.')
|
ipc.send('update-app', 'Deal with it.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleWheel (e) {
|
||||||
|
if (e.ctrlKey && global.process.platform !== 'darwin') {
|
||||||
|
if (window.document.body.style.zoom == null) {
|
||||||
|
window.document.body.style.zoom = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
let zoom = Number(window.document.body.style.zoom)
|
||||||
|
if (e.deltaY > 0 && zoom < 4) {
|
||||||
|
document.body.style.zoom = zoom + 0.05
|
||||||
|
} else if (e.deltaY < 0 && zoom > 0.5) {
|
||||||
|
document.body.style.zoom = zoom - 0.05
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<div className='Main'>
|
<div
|
||||||
|
className='Main'
|
||||||
|
onWheel={(e) => this.handleWheel(e)}
|
||||||
|
>
|
||||||
{this.state.updateAvailable ? (
|
{this.state.updateAvailable ? (
|
||||||
<button onClick={this.updateApp} className='appUpdateButton'><i className='fa fa-cloud-download'/> Update available!</button>
|
<button onClick={this.updateApp} className='appUpdateButton'><i className='fa fa-cloud-download'/> Update available!</button>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -257,9 +257,10 @@ infoButton()
|
|||||||
width 150px
|
width 150px
|
||||||
max-height 150px
|
max-height 150px
|
||||||
background-color white
|
background-color white
|
||||||
z-index 5
|
z-index 50
|
||||||
border 1px solid borderColor
|
border 1px solid borderColor
|
||||||
border-radius 5px
|
border-radius 5px
|
||||||
|
overflow-y auto
|
||||||
&>button
|
&>button
|
||||||
width 100%
|
width 100%
|
||||||
display block
|
display block
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ articleItemColor = #777
|
|||||||
.ArticleList-item
|
.ArticleList-item
|
||||||
border solid 2px transparent
|
border solid 2px transparent
|
||||||
position relative
|
position relative
|
||||||
height 110px
|
min-height 110px
|
||||||
width 100%
|
width 100%
|
||||||
cursor pointer
|
cursor pointer
|
||||||
transition 0.1s
|
transition 0.1s
|
||||||
@@ -68,18 +68,27 @@ articleItemColor = #777
|
|||||||
code
|
code
|
||||||
font-family Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace
|
font-family Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace
|
||||||
.ArticleList-item-bottom
|
.ArticleList-item-bottom
|
||||||
overflow-x auto
|
padding-bottom 5px
|
||||||
white-space nowrap
|
|
||||||
padding-top 6px
|
|
||||||
.tags
|
.tags
|
||||||
color articleItemColor
|
color articleItemColor
|
||||||
|
line-height 18px
|
||||||
|
word-wrap break-word
|
||||||
|
clearfix()
|
||||||
|
i.fa-tags
|
||||||
|
display inline
|
||||||
|
float left
|
||||||
|
padding 2px 2px 0 0
|
||||||
height 14px
|
height 14px
|
||||||
|
line-height 13px
|
||||||
a
|
a
|
||||||
background-color brandColor
|
background-color brandColor
|
||||||
|
float left
|
||||||
color white
|
color white
|
||||||
border-radius 2px
|
border-radius 2px
|
||||||
padding 1px 5px
|
padding 1px 5px
|
||||||
margin 2px
|
margin 2px
|
||||||
|
height 14px
|
||||||
|
line-height 13px
|
||||||
font-size 10px
|
font-size 10px
|
||||||
opacity 0.8
|
opacity 0.8
|
||||||
&:hover
|
&:hover
|
||||||
|
|||||||
@@ -1,16 +1,35 @@
|
|||||||
# Contributing to Boostnote
|
# Contributing to Boostnote
|
||||||
|
|
||||||
> This is a temporary document.
|
> English below.
|
||||||
|
|
||||||
It is first time to maintain OSS project for me(Rokt33r). So, I want to watch what's going on here.
|
## About Pull Request
|
||||||
|
|
||||||
**This means you can do whatever you want until I ask to stop it.**
|
### やり方
|
||||||
|
|
||||||
But I want to make only one thing sure.
|
現状特に`dev`ブランチを用意しないつもりなので、最新VersionのブランチにPullrequestを送ってください。
|
||||||
|
|
||||||
**If you make a pull request, It means you agree to transfer the copyright of the code changes to MAISIN&CO.**
|
### Pull requsetの著作権
|
||||||
|
|
||||||
This is because our team want to have an option to change LICENSE of this app.
|
Pull requestをすることはその変化分のコードの著作権を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 or Mobile app integration.
|
|
||||||
> We thought this is needed to replace the license with much freer one(like BSD, MIT).
|
|
||||||
|
|
||||||
|
アプリケーションのLicenseのをいつでも変える選択肢を残したいからです。
|
||||||
|
しかし、これはいずれかBoostnoteが有料の商用アプリになる可能性がある話ではありません。
|
||||||
|
もし、このアプリケーションで金を稼ごうとするならBoostnote専用のCloud storageの提供やMobile appとの連動、何か特殊なプレミアム機能の提供など形になると思います。
|
||||||
|
現在考えられているのは、GPL v3の場合、他のライセンスとの互換が不可能であるため、もしより自由なLicense(BSD, MIT)に変える時に改めて著作権者としてライセンスし直す選択肢を残したいぐらいのイメージです。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Contributing to Boostnote(ENG)
|
||||||
|
|
||||||
|
## About Pull Request
|
||||||
|
|
||||||
|
### How to
|
||||||
|
|
||||||
|
Make a new PR to the branch named latest version. This is because there is no `dev` branch currently.
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ function toggleMain () {
|
|||||||
mainWindow.minimize()
|
mainWindow.minimize()
|
||||||
mainWindow.restore()
|
mainWindow.restore()
|
||||||
}
|
}
|
||||||
mainWindow.webContents.send('list-focus')
|
mainWindow.webContents.send('top-focus-search')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,4 +114,3 @@ ipc.on('hotkeyUpdated', function (event, newKeymap) {
|
|||||||
globalShortcut.unregisterAll()
|
globalShortcut.unregisterAll()
|
||||||
registerAllKeys()
|
registerAllKeys()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js"
|
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"electron-version": "0.36.10"
|
"electron-version": "0.36.11"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
"babel-preset-react-hmre": "^1.0.1",
|
"babel-preset-react-hmre": "^1.0.1",
|
||||||
"css-loader": "^0.19.0",
|
"css-loader": "^0.19.0",
|
||||||
"electron-packager": "^5.1.0",
|
"electron-packager": "^5.1.0",
|
||||||
"electron-prebuilt": "^0.36.10",
|
"electron-prebuilt": "^0.36.11",
|
||||||
"electron-release": "^2.2.0",
|
"electron-release": "^2.2.0",
|
||||||
"grunt": "^0.4.5",
|
"grunt": "^0.4.5",
|
||||||
"grunt-electron-installer": "^1.2.0",
|
"grunt-electron-installer": "^1.2.0",
|
||||||
|
|||||||
@@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
Simple note app
|
Simple note app
|
||||||
|
|
||||||
|
## Progress Kanban
|
||||||
|
|
||||||
|
https://trello.com/b/wJlinZJx/boostnote-todo-list
|
||||||
|
|
||||||
|
This is a public Kanban board. Also everyone can comment here.
|
||||||
|
|
||||||
|
If you want to join us, ask me to add you.
|
||||||
|
|
||||||
## Develop
|
## Develop
|
||||||
|
|
||||||
1. turn on HMR server
|
1. turn on HMR server
|
||||||
|
|||||||
Reference in New Issue
Block a user