mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 18:56:22 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ba49ad294 | ||
|
|
acf8cbfe0e | ||
|
|
f904fd00e5 | ||
|
|
831bec5baf | ||
|
|
f0257b0f87 | ||
|
|
084677cdca | ||
|
|
891cd3124f | ||
|
|
f6208c1324 | ||
|
|
3a117c0f09 | ||
|
|
a0c83f33ca | ||
|
|
99b9fadd74 | ||
|
|
cf023847ad | ||
|
|
59357b274d | ||
|
|
1582184223 | ||
|
|
db9bcafb82 | ||
|
|
50b9838eec | ||
|
|
ff958b7cd6 | ||
|
|
33bc2aa220 | ||
|
|
03b331e5d5 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ node_modules/*
|
|||||||
/dist
|
/dist
|
||||||
/compiled
|
/compiled
|
||||||
/secret
|
/secret
|
||||||
|
*.log
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const sanitizeOpts = {
|
|||||||
'a': ['lineAnchor'],
|
'a': ['lineAnchor'],
|
||||||
'div': ['math'],
|
'div': ['math'],
|
||||||
'pre': ['hljs'],
|
'pre': ['hljs'],
|
||||||
'span': ['math', 'hljs-*'],
|
'span': ['math', 'hljs-*', 'lineNumber'],
|
||||||
'code': ['language-*']
|
'code': ['language-*']
|
||||||
},
|
},
|
||||||
allowedAttributes: {
|
allowedAttributes: {
|
||||||
@@ -91,7 +91,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
fontSize: config['preview-font-size'],
|
fontSize: config['preview-font-size'],
|
||||||
fontFamily: config['preview-font-family']
|
fontFamily: config['preview-font-family'],
|
||||||
|
lineNumber: config['preview-line-number']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
@@ -182,7 +183,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
handleConfigApply (e, config) {
|
handleConfigApply (e, config) {
|
||||||
this.setState({
|
this.setState({
|
||||||
fontSize: config['preview-font-size'],
|
fontSize: config['preview-font-size'],
|
||||||
fontFamily: config['preview-font-family']
|
fontFamily: config['preview-font-family'],
|
||||||
|
lineNumber: config['preview-line-number']
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +198,7 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={'MarkdownPreview' + (this.props.className != null ? ' ' + this.props.className : '') + (isEmpty ? ' empty' : '')}
|
className={'MarkdownPreview' + (this.props.className != null ? ' ' + this.props.className : '') + (isEmpty ? ' empty' : '') + (this.state.lineNumber ? ' lineNumbered' : '')}
|
||||||
onClick={e => this.handleClick(e)}
|
onClick={e => this.handleClick(e)}
|
||||||
onDoubleClick={e => this.handleDoubleClick(e)}
|
onDoubleClick={e => this.handleDoubleClick(e)}
|
||||||
onMouseDown={e => this.handleMouseDown(e)}
|
onMouseDown={e => this.handleMouseDown(e)}
|
||||||
|
|||||||
@@ -3,6 +3,15 @@ import emoji from 'markdown-it-emoji'
|
|||||||
import math from '@rokt33r/markdown-it-math'
|
import math from '@rokt33r/markdown-it-math'
|
||||||
import hljs from 'highlight.js'
|
import hljs from 'highlight.js'
|
||||||
|
|
||||||
|
function createGutter (str) {
|
||||||
|
let lc = (str.match(/\n/g) || []).length
|
||||||
|
let lines = []
|
||||||
|
for (let i = 1; i <= lc; i++) {
|
||||||
|
lines.push('<span>' + i + '</span>')
|
||||||
|
}
|
||||||
|
return '<span class="lineNumber">' + lines.join('') + '</span>'
|
||||||
|
}
|
||||||
|
|
||||||
var md = markdownit({
|
var md = markdownit({
|
||||||
typographer: true,
|
typographer: true,
|
||||||
linkify: true,
|
linkify: true,
|
||||||
@@ -11,12 +20,16 @@ var md = markdownit({
|
|||||||
highlight: function (str, lang) {
|
highlight: function (str, lang) {
|
||||||
if (lang && hljs.getLanguage(lang)) {
|
if (lang && hljs.getLanguage(lang)) {
|
||||||
try {
|
try {
|
||||||
return '<pre class="hljs"><code>' +
|
return '<pre class="hljs">' +
|
||||||
|
createGutter(str) +
|
||||||
|
'<code>' +
|
||||||
hljs.highlight(lang, str).value +
|
hljs.highlight(lang, str).value +
|
||||||
'</code></pre>'
|
'</code></pre>'
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
return '<pre class="hljs"><code>' +
|
return '<pre class="hljs">' +
|
||||||
|
createGutter(str) +
|
||||||
|
'<code>' +
|
||||||
str.replace(/\&/g, '&').replace(/\</g, '<').replace(/\>/g, '>').replace(/\"/g, '"') +
|
str.replace(/\&/g, '&').replace(/\</g, '<').replace(/\>/g, '>').replace(/\"/g, '"') +
|
||||||
'</code></pre>'
|
'</code></pre>'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,9 +81,18 @@ export default class AppSettingTab extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleLineNumberingClick (e) {
|
||||||
|
let config = this.state.config
|
||||||
|
|
||||||
|
config['preview-line-number'] = e.target.checked
|
||||||
|
this.setState({
|
||||||
|
config
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
handleDisableDirectWriteClick (e) {
|
handleDisableDirectWriteClick (e) {
|
||||||
let config = this.state.config
|
let config = this.state.config
|
||||||
config['disable-direct-write'] = !config['disable-direct-write']
|
config['disable-direct-write'] = e.target.checked
|
||||||
this.setState({
|
this.setState({
|
||||||
config
|
config
|
||||||
})
|
})
|
||||||
@@ -174,11 +183,14 @@ export default class AppSettingTab extends React.Component {
|
|||||||
<option value='rightclick'>When Right Clicking</option>
|
<option value='rightclick'>When Right Clicking</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div className='sectionCheck'>
|
||||||
|
<label><input onChange={e => this.handleLineNumberingClick(e)} checked={this.state.config['preview-line-number']} type='checkbox'/>Code block line numbering</label>
|
||||||
|
</div>
|
||||||
{
|
{
|
||||||
global.process.platform === 'win32'
|
global.process.platform === 'win32'
|
||||||
? (
|
? (
|
||||||
<div className='sectionCheck'>
|
<div className='sectionCheck'>
|
||||||
<label><input onClick={e => this.handleDisableDirectWriteClick(e)} checked={this.state.config['disable-direct-write']} disabled={OSX} type='checkbox'/>Disable Direct Write<span className='sectionCheck-warn'>It will be applied after restarting</span></label>
|
<label><input onChange={e => this.handleDisableDirectWriteClick(e)} checked={this.state.config['disable-direct-write']} disabled={OSX} type='checkbox'/>Disable Direct Write<span className='sectionCheck-warn'>It will be applied after restarting</span></label>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
: null
|
: null
|
||||||
@@ -192,7 +204,7 @@ export default class AppSettingTab extends React.Component {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='sectionSelect'>
|
<div className='sectionSelect'>
|
||||||
<label>Code Theme</label>
|
<label>Code block Theme</label>
|
||||||
<select valueLink={this.linkState('config.theme-code')}>
|
<select valueLink={this.linkState('config.theme-code')}>
|
||||||
{
|
{
|
||||||
hljsThemeList.map(function(v, i){
|
hljsThemeList.map(function(v, i){
|
||||||
@@ -202,7 +214,7 @@ export default class AppSettingTab extends React.Component {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='sectionSelect'>
|
<div className='sectionSelect'>
|
||||||
<label>Syntax Theme</label>
|
<label>Editor Theme</label>
|
||||||
<select valueLink={this.linkState('config.theme-syntax')}>
|
<select valueLink={this.linkState('config.theme-syntax')}>
|
||||||
{
|
{
|
||||||
aceThemeList.themes.map(function(v, i){
|
aceThemeList.themes.map(function(v, i){
|
||||||
|
|||||||
@@ -382,6 +382,9 @@ infoButton()
|
|||||||
color lighten(inactiveTextColor, 10%)
|
color lighten(inactiveTextColor, 10%)
|
||||||
user-select none
|
user-select none
|
||||||
font-size 14px
|
font-size 14px
|
||||||
|
&.lineNumbered
|
||||||
|
.lineNumber
|
||||||
|
display block
|
||||||
.CodeEditor
|
.CodeEditor
|
||||||
absolute top left right bottom
|
absolute top left right bottom
|
||||||
border-top solid 1px borderColor
|
border-top solid 1px borderColor
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ articleItemColor = #777
|
|||||||
height 20px
|
height 20px
|
||||||
color articleItemColor
|
color articleItemColor
|
||||||
font-size 11px
|
font-size 11px
|
||||||
|
i
|
||||||
|
margin-right 4px
|
||||||
.folderName
|
.folderName
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
display inline-block
|
display inline-block
|
||||||
|
|||||||
@@ -126,15 +126,25 @@ marked()
|
|||||||
border-radius 5px
|
border-radius 5px
|
||||||
overflow-x auto
|
overflow-x auto
|
||||||
margin 0 0 15px
|
margin 0 0 15px
|
||||||
line-height 1.35em
|
line-height 1.35
|
||||||
&>code
|
code
|
||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
border none
|
border none
|
||||||
border-radius 0
|
border-radius 0
|
||||||
&>pre
|
pre
|
||||||
border none
|
border none
|
||||||
margin -5px
|
margin -5px
|
||||||
|
&>span.lineNumber
|
||||||
|
font-family Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace
|
||||||
|
display none
|
||||||
|
float left
|
||||||
|
margin 0 0.5em 0 -0.5em
|
||||||
|
border-right 1px solid
|
||||||
|
text-align right
|
||||||
|
&>span
|
||||||
|
display block
|
||||||
|
padding 0 .5em 0 1em
|
||||||
table
|
table
|
||||||
width 100%
|
width 100%
|
||||||
margin 15px 0 25px
|
margin 15px 0 25px
|
||||||
|
|||||||
@@ -12,8 +12,16 @@ themeDarkTooltip = rgba(0, 0, 0, 0.7)
|
|||||||
themeDarkFocusText = #FFFFFF
|
themeDarkFocusText = #FFFFFF
|
||||||
themeDarkFocusButton = lighten(themeDarkTopicColor, 30%)
|
themeDarkFocusButton = lighten(themeDarkTopicColor, 30%)
|
||||||
themeDarkBoxShadow = alpha(lighten(themeDarkTopicColor, 10%), 0.4);
|
themeDarkBoxShadow = alpha(lighten(themeDarkTopicColor, 10%), 0.4);
|
||||||
|
themeDarkTableOdd = themeDarkPreview
|
||||||
|
themeDarkTableEven = darken(themeDarkPreview, 10%)
|
||||||
|
themeDarkTableHead = themeDarkTableEven
|
||||||
|
themeDarkTableBorder = themeDarkBorder
|
||||||
|
themeDarkModalButtonDefault = themeDarkPreview
|
||||||
|
themeDarkModalButtonDanger = #BF360C
|
||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
|
background-color themeDarkBackground
|
||||||
|
|
||||||
.Main
|
.Main
|
||||||
.ArticleNavigator .userInfo .settingBtn .tooltip,
|
.ArticleNavigator .userInfo .settingBtn .tooltip,
|
||||||
.ArticleNavigator .ArticleNavigator-folders .ArticleNavigator-folders-header .addBtn .tooltip,
|
.ArticleNavigator .ArticleNavigator-folders .ArticleNavigator-folders-header .addBtn .tooltip,
|
||||||
@@ -122,6 +130,10 @@ body[data-theme="dark"]
|
|||||||
&:hover
|
&:hover
|
||||||
background-color lighten(themeDarkList, 5%)
|
background-color lighten(themeDarkList, 5%)
|
||||||
|
|
||||||
|
.ArticleList-item-top
|
||||||
|
.folderName
|
||||||
|
color darken(themeDarkText, 15%)
|
||||||
|
|
||||||
.divider
|
.divider
|
||||||
border-color themeDarkBorder
|
border-color themeDarkBorder
|
||||||
|
|
||||||
@@ -182,6 +194,7 @@ body[data-theme="dark"]
|
|||||||
.ArticleEditor
|
.ArticleEditor
|
||||||
.CodeEditor
|
.CodeEditor
|
||||||
border-color themeDarkBorder
|
border-color themeDarkBorder
|
||||||
|
border-radius 0
|
||||||
|
|
||||||
&>.ArticleDetail-panel-header .ArticleDetail-panel-header-mode
|
&>.ArticleDetail-panel-header .ArticleDetail-panel-header-mode
|
||||||
transition 0.1s
|
transition 0.1s
|
||||||
@@ -244,6 +257,30 @@ body[data-theme="dark"]
|
|||||||
&:hover
|
&:hover
|
||||||
background-color brandColor
|
background-color brandColor
|
||||||
|
|
||||||
|
.DeleteArticleModal.modal
|
||||||
|
.control
|
||||||
|
button
|
||||||
|
transition 0.1s
|
||||||
|
color themeDarkText
|
||||||
|
border-color lighten(themeDarkModalButtonDefault, 20%)
|
||||||
|
background-color themeDarkModalButtonDefault
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color: lighten(themeDarkModalButtonDefault, 10%)
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
border-color themeDarkTopicColor
|
||||||
|
|
||||||
|
&.danger
|
||||||
|
background-color themeDarkModalButtonDanger
|
||||||
|
border-color lighten(themeDarkModalButtonDanger, 30%)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color: lighten(themeDarkModalButtonDanger, 10%)
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
border-color lighten(themeDarkModalButtonDanger, 50%)
|
||||||
|
|
||||||
.Preferences.modal
|
.Preferences.modal
|
||||||
.sectionInput input,
|
.sectionInput input,
|
||||||
.sectionSelect select
|
.sectionSelect select
|
||||||
@@ -395,3 +432,29 @@ body[data-theme="dark"]
|
|||||||
|
|
||||||
a:hover
|
a:hover
|
||||||
background-color alpha(lighten(brandColor, 30%), 0.2) !important
|
background-color alpha(lighten(brandColor, 30%), 0.2) !important
|
||||||
|
|
||||||
|
code
|
||||||
|
border-color darken(themeDarkBorder, 10%)
|
||||||
|
background-color lighten(themeDarkPreview, 5%)
|
||||||
|
|
||||||
|
pre
|
||||||
|
code
|
||||||
|
background-color transparent
|
||||||
|
|
||||||
|
table
|
||||||
|
thead
|
||||||
|
tr
|
||||||
|
background-color themeDarkTableHead
|
||||||
|
th
|
||||||
|
border-color themeDarkTableBorder
|
||||||
|
&:last-child
|
||||||
|
border-right solid 1px themeDarkTableBorder
|
||||||
|
tbody
|
||||||
|
tr:nth-child(2n + 1)
|
||||||
|
background-color themeDarkTableOdd
|
||||||
|
tr:nth-child(2n)
|
||||||
|
background-color themeDarkTableEven
|
||||||
|
td
|
||||||
|
border-color themeDarkTableBorder
|
||||||
|
&:last-child
|
||||||
|
border-right solid 1px themeDarkTableBorder
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ const defaultConfig = {
|
|||||||
'disable-direct-write': false,
|
'disable-direct-write': false,
|
||||||
'theme-ui': 'light',
|
'theme-ui': 'light',
|
||||||
'theme-code': 'xcode',
|
'theme-code': 'xcode',
|
||||||
'theme-syntax': 'xcode'
|
'theme-syntax': 'xcode',
|
||||||
|
'preview-line-number': false
|
||||||
}
|
}
|
||||||
const configFile = 'config.json'
|
const configFile = 'config.json'
|
||||||
|
|
||||||
|
|||||||
@@ -288,6 +288,14 @@ app.on('ready', function () {
|
|||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 'linux':
|
case 'linux':
|
||||||
|
if (process.env.DESKTOP_SESSION === 'cinnamon') {
|
||||||
|
finderWindow = require('./finder-window')
|
||||||
|
finderWindow.on('close', function (e) {
|
||||||
|
if (appQuit) return true
|
||||||
|
e.preventDefault()
|
||||||
|
finderWindow.hide()
|
||||||
|
})
|
||||||
|
}
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "boost",
|
"name": "boost",
|
||||||
"version": "0.5.10",
|
"version": "0.5.12",
|
||||||
"description": "Boostnote",
|
"description": "Boostnote",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -27,7 +27,8 @@
|
|||||||
"author": "Dick Choi <fluke8259@gmail.com> (https://github.com/Rokt33r)",
|
"author": "Dick Choi <fluke8259@gmail.com> (https://github.com/Rokt33r)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"dojineko (https://github.com/dojineko)",
|
"dojineko (https://github.com/dojineko)",
|
||||||
"Romain Bazile (https://github.com/gromain)"
|
"Romain Bazile (https://github.com/gromain)",
|
||||||
|
"Bruno Paz (https://github.com/brpaz)"
|
||||||
],
|
],
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/BoostIO/Boostnote/issues"
|
"url": "https://github.com/BoostIO/Boostnote/issues"
|
||||||
|
|||||||
@@ -127,8 +127,9 @@ grunt zip:osx
|
|||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
[dojineko](https://github.com/dojineko)
|
- [dojineko](https://github.com/dojineko)
|
||||||
[Romain Bazile](https://github.com/gromain)
|
- [Romain Bazile](https://github.com/gromain)
|
||||||
|
- [Bruno Paz](https://github.com/brpaz)
|
||||||
|
|
||||||
## Copyright & License
|
## Copyright & License
|
||||||
|
|
||||||
|
|||||||
Submodule submodules/ace updated: e94cb3c7ff...8dcfcd6d0d
Reference in New Issue
Block a user