Skip to content

Commit eda547b

Browse files
committed
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
2 parents 07291d7 + f75e872 commit eda547b

9 files changed

Lines changed: 103 additions & 20 deletions

File tree

browser/components/CodeEditor.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,22 @@ export default class CodeEditor extends React.Component {
4040
this.execHandler = (e) => {
4141
console.log(e.command.name)
4242
switch (e.command.name) {
43+
case 'gotolinestart':
44+
e.preventDefault()
45+
{
46+
let position = this.editor.getCursorPosition()
47+
this.editor.navigateTo(position.row, 0)
48+
}
49+
break
4350
case 'gotolineend':
4451
e.preventDefault()
4552
let position = this.editor.getCursorPosition()
4653
this.editor.navigateTo(position.row, this.editor.getSession().getLine(position.row).length)
4754
break
55+
case 'jumptomatching':
56+
e.preventDefault()
57+
this.editor.navigateUp()
58+
break
4859
case 'removetolineend':
4960
e.preventDefault()
5061
let range = this.editor.getSelectionRange()

browser/main/HomePage/ArticleDetail/index.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ import DeleteArticleModal from '../../modal/DeleteArticleModal'
1515
import ArticleEditor from './ArticleEditor'
1616
const electron = require('electron')
1717
const ipc = electron.ipcRenderer
18+
import fetchConfig from 'browser/lib/fetchConfig'
19+
20+
let config = fetchConfig()
21+
ipc.on('config-apply', function (e, newConfig) {
22+
config = newConfig
23+
})
1824

1925
const BRAND_COLOR = '#18AF90'
2026
const OSX = global.process.platform === 'darwin'
@@ -83,10 +89,12 @@ export default class ArticleDetail extends React.Component {
8389
if (isModalOpen()) return true
8490
if (this.refs.editor) this.refs.editor.switchPreviewMode()
8591
}
92+
this.configApplyHandler = (e, config) => this.handleConfigApply(e, config)
8693

8794
this.state = {
8895
article: Object.assign({content: ''}, props.activeArticle),
89-
openShareDropdown: false
96+
openShareDropdown: false,
97+
fontFamily: config['editor-font-family']
9098
}
9199
}
92100

@@ -101,6 +109,7 @@ export default class ArticleDetail extends React.Component {
101109
ipc.on('detail-title', this.titleHandler)
102110
ipc.on('detail-edit', this.editHandler)
103111
ipc.on('detail-preview', this.previewHandler)
112+
ipc.on('config-apply', this.configApplyHandler)
104113
}
105114

106115
componentWillUnmount () {
@@ -123,6 +132,12 @@ export default class ArticleDetail extends React.Component {
123132
}
124133
}
125134

135+
handleConfigApply (e, config) {
136+
this.setState({
137+
fontFamily: config['editor-font-family']
138+
})
139+
}
140+
126141
renderEmpty () {
127142
return (
128143
<div className='ArticleDetail empty'>
@@ -309,6 +324,9 @@ export default class ArticleDetail extends React.Component {
309324
ref='title'
310325
value={activeArticle.title}
311326
onChange={e => this.handleTitleChange(e)}
327+
style={{
328+
fontFamily: this.state.fontFamily
329+
}}
312330
/>
313331
</div>
314332
<ModeSelect

browser/main/MainPage.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,27 @@ export default class MainContainer extends React.Component {
1919
ipc.send('update-app', 'Deal with it.')
2020
}
2121

22+
handleWheel (e) {
23+
if (e.ctrlKey && global.process.platform !== 'darwin') {
24+
if (window.document.body.style.zoom == null) {
25+
window.document.body.style.zoom = 1
26+
}
27+
28+
let zoom = Number(window.document.body.style.zoom)
29+
if (e.deltaY > 0 && zoom < 4) {
30+
document.body.style.zoom = zoom + 0.05
31+
} else if (e.deltaY < 0 && zoom > 0.5) {
32+
document.body.style.zoom = zoom - 0.05
33+
}
34+
}
35+
}
36+
2237
render () {
2338
return (
24-
<div className='Main'>
39+
<div
40+
className='Main'
41+
onWheel={(e) => this.handleWheel(e)}
42+
>
2543
{this.state.updateAvailable ? (
2644
<button onClick={this.updateApp} className='appUpdateButton'><i className='fa fa-cloud-download'/> Update available!</button>
2745
) : null}

browser/styles/main/ArticleDetail.styl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,10 @@ infoButton()
257257
width 150px
258258
max-height 150px
259259
background-color white
260-
z-index 5
260+
z-index 50
261261
border 1px solid borderColor
262262
border-radius 5px
263+
overflow-y auto
263264
&>button
264265
width 100%
265266
display block

browser/styles/main/ArticleList.styl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ articleItemColor = #777
1616
.ArticleList-item
1717
border solid 2px transparent
1818
position relative
19-
height 110px
19+
min-height 110px
2020
width 100%
2121
cursor pointer
2222
transition 0.1s
@@ -68,18 +68,27 @@ articleItemColor = #777
6868
code
6969
font-family Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace
7070
.ArticleList-item-bottom
71-
overflow-x auto
72-
white-space nowrap
73-
padding-top 6px
71+
padding-bottom 5px
7472
.tags
7573
color articleItemColor
76-
height 14px
74+
line-height 18px
75+
word-wrap break-word
76+
clearfix()
77+
i.fa-tags
78+
display inline
79+
float left
80+
padding 2px 2px 0 0
81+
height 14px
82+
line-height 13px
7783
a
7884
background-color brandColor
85+
float left
7986
color white
8087
border-radius 2px
8188
padding 1px 5px
8289
margin 2px
90+
height 14px
91+
line-height 13px
8392
font-size 10px
8493
opacity 0.8
8594
&:hover

contributing.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
# Contributing to Boostnote
22

3-
> This is a temporary document.
3+
> English below.
44
5-
It is first time to maintain OSS project for me(Rokt33r). So, I want to watch what's going on here.
5+
## About Pull Request
66

7-
**This means you can do whatever you want until I ask to stop it.**
7+
### やり方
88

9-
But I want to make only one thing sure.
9+
現状特に`dev`ブランチを用意しないつもりなので、最新VersionのブランチにPullrequestを送ってください。
1010

11-
**If you make a pull request, It means you agree to transfer the copyright of the code changes to MAISIN&CO.**
11+
### Pull requsetの著作権
1212

13-
This is because our team want to have an option to change LICENSE of this app.
14-
> 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.
15-
> We thought this is needed to replace the license with much freer one(like BSD, MIT).
13+
Pull requestをすることはその変化分のコードの著作権をMAISIN&CO.に譲渡することに同意することになります。
1614

15+
アプリケーションのLicenseのをいつでも変える選択肢を残したいからです。
16+
しかし、これはいずれかBoostnoteが有料の商用アプリになる可能性がある話ではありません。
17+
もし、このアプリケーションで金を稼ごうとするならBoostnote専用のCloud storageの提供やMobile appとの連動、何か特殊なプレミアム機能の提供など形になると思います。
18+
現在考えられているのは、GPL v3の場合、他のライセンスとの互換が不可能であるため、もしより自由なLicense(BSD, MIT)に変える時に改めて著作権者としてライセンスし直す選択肢を残したいぐらいのイメージです。
19+
20+
---
21+
22+
# Contributing to Boostnote(ENG)
23+
24+
## About Pull Request
25+
26+
### How to
27+
28+
Make a new PR to the branch named latest version. This is because there is no `dev` branch currently.
29+
30+
### Copyright of Pull Request
31+
32+
If you make a pull request, It means you agree to transfer the copyright of the code changes to MAISIN&CO.
33+
34+
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.
35+
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.

lib/hotkey.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function toggleMain () {
6767
mainWindow.minimize()
6868
mainWindow.restore()
6969
}
70-
mainWindow.webContents.send('list-focus')
70+
mainWindow.webContents.send('top-focus-search')
7171
}
7272
}
7373

@@ -114,4 +114,3 @@ ipc.on('hotkeyUpdated', function (event, newKeymap) {
114114
globalShortcut.unregisterAll()
115115
registerAllKeys()
116116
})
117-

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js"
1010
},
1111
"config": {
12-
"electron-version": "0.36.10"
12+
"electron-version": "0.36.11"
1313
},
1414
"repository": {
1515
"type": "git",
@@ -56,7 +56,7 @@
5656
"babel-preset-react-hmre": "^1.0.1",
5757
"css-loader": "^0.19.0",
5858
"electron-packager": "^5.1.0",
59-
"electron-prebuilt": "^0.36.10",
59+
"electron-prebuilt": "^0.36.11",
6060
"electron-release": "^2.2.0",
6161
"grunt": "^0.4.5",
6262
"grunt-electron-installer": "^1.2.0",

readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Simple note app
44

5+
## Progress Kanban
6+
7+
https://trello.com/b/wJlinZJx/boostnote-todo-list
8+
9+
This is a public Kanban board. Also everyone can comment here.
10+
11+
If you want to join us, ask me to add you.
12+
513
## Develop
614

715
1. turn on HMR server

0 commit comments

Comments
 (0)