mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 18:56:22 +00:00
Merge branch 'master' into tags
This commit is contained in:
16
.editorconfig
Normal file
16
.editorconfig
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# EditorConfig is awesome: http://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Space indentation
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
# The indent size used in the `package.json` file cannot be changed
|
||||||
|
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
|
||||||
|
[{*.yml,*.yaml,package.json}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
@@ -24,7 +24,6 @@ export default class CodeEditor extends React.Component {
|
|||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.state = { isReady: false }
|
|
||||||
this.scrollHandler = _.debounce(this.handleScroll.bind(this), 100, {
|
this.scrollHandler = _.debounce(this.handleScroll.bind(this), 100, {
|
||||||
leading: false,
|
leading: false,
|
||||||
trailing: true
|
trailing: true
|
||||||
@@ -215,7 +214,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
CodeMirror.Vim.defineEx('wq', 'wq', this.quitEditor)
|
CodeMirror.Vim.defineEx('wq', 'wq', this.quitEditor)
|
||||||
CodeMirror.Vim.defineEx('qw', 'qw', this.quitEditor)
|
CodeMirror.Vim.defineEx('qw', 'qw', this.quitEditor)
|
||||||
CodeMirror.Vim.map('ZZ', ':q', 'normal')
|
CodeMirror.Vim.map('ZZ', ':q', 'normal')
|
||||||
this.setState({ isReady: true })
|
|
||||||
this.tableEditor = new TableEditor(new TextEditorInterface(this.editor))
|
this.tableEditor = new TableEditor(new TextEditorInterface(this.editor))
|
||||||
eventEmitter.on('code:format-table', this.formatTable)
|
eventEmitter.on('code:format-table', this.formatTable)
|
||||||
}
|
}
|
||||||
@@ -582,8 +581,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
style={{
|
style={{
|
||||||
fontFamily,
|
fontFamily,
|
||||||
fontSize: fontSize,
|
fontSize: fontSize,
|
||||||
width: width,
|
width: width
|
||||||
opacity: this.state.isReady ? '1' : '0'
|
|
||||||
}}
|
}}
|
||||||
onDrop={e => this.handleDropImage(e)}
|
onDrop={e => this.handleDropImage(e)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import CodeEditor from 'browser/components/CodeEditor'
|
|||||||
import MarkdownPreview from 'browser/components/MarkdownPreview'
|
import MarkdownPreview from 'browser/components/MarkdownPreview'
|
||||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
import { findStorage } from 'browser/lib/findStorage'
|
import { findStorage } from 'browser/lib/findStorage'
|
||||||
import debounceRender from 'react-debounce-render'
|
|
||||||
|
|
||||||
class MarkdownEditor extends React.Component {
|
class MarkdownEditor extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -313,4 +312,4 @@ MarkdownEditor.propTypes = {
|
|||||||
ignorePreviewPointerEvents: PropTypes.bool
|
ignorePreviewPointerEvents: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
export default debounceRender(CSSModules(MarkdownEditor, styles))
|
export default CSSModules(MarkdownEditor, styles)
|
||||||
|
|||||||
@@ -180,9 +180,7 @@ const defaultCodeBlockFontFamily = [
|
|||||||
export default class MarkdownPreview extends React.Component {
|
export default class MarkdownPreview extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
|
||||||
isReady: false
|
|
||||||
}
|
|
||||||
this.contextMenuHandler = e => this.handleContextMenu(e)
|
this.contextMenuHandler = e => this.handleContextMenu(e)
|
||||||
this.mouseDownHandler = e => this.handleMouseDown(e)
|
this.mouseDownHandler = e => this.handleMouseDown(e)
|
||||||
this.mouseUpHandler = e => this.handleMouseUp(e)
|
this.mouseUpHandler = e => this.handleMouseUp(e)
|
||||||
@@ -457,7 +455,6 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
eventEmitter.on('export:save-md', this.saveAsMdHandler)
|
eventEmitter.on('export:save-md', this.saveAsMdHandler)
|
||||||
eventEmitter.on('export:save-html', this.saveAsHtmlHandler)
|
eventEmitter.on('export:save-html', this.saveAsHtmlHandler)
|
||||||
eventEmitter.on('print', this.printHandler)
|
eventEmitter.on('print', this.printHandler)
|
||||||
setTimeout(() => this.setState({ isReady: true }))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
@@ -850,11 +847,7 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
className={
|
className={
|
||||||
className != null ? 'MarkdownPreview ' + className : 'MarkdownPreview'
|
className != null ? 'MarkdownPreview ' + className : 'MarkdownPreview'
|
||||||
}
|
}
|
||||||
style={
|
style={style}
|
||||||
this.state.isReady
|
|
||||||
? Object.assign(style, { opacity: '1' })
|
|
||||||
: Object.assign(style, { opacity: '0' })
|
|
||||||
}
|
|
||||||
tabIndex={tabIndex}
|
tabIndex={tabIndex}
|
||||||
ref='root'
|
ref='root'
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -136,4 +136,48 @@ body[data-theme="solarized-dark"]
|
|||||||
color $ui-solarized-dark-text-color
|
color $ui-solarized-dark-text-color
|
||||||
|
|
||||||
.deleteButton
|
.deleteButton
|
||||||
color alpha($ui-solarized-dark-text-color, 30%)
|
color alpha($ui-solarized-dark-text-color, 30%)
|
||||||
|
|
||||||
|
body[data-theme="monokai"]
|
||||||
|
.root
|
||||||
|
color $ui-monokai-text-color
|
||||||
|
border-color $ui-dark-borderColor
|
||||||
|
&:hover
|
||||||
|
background-color $ui-monokai-noteDetail-backgroundColor
|
||||||
|
.deleteButton
|
||||||
|
color $ui-monokai-text-color
|
||||||
|
&:hover
|
||||||
|
background-color darken($ui-monokai-noteDetail-backgroundColor, 15%)
|
||||||
|
&:active
|
||||||
|
color $ui-monokai-text-color
|
||||||
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
|
|
||||||
|
.root--active
|
||||||
|
color $ui-monokai-text-color
|
||||||
|
border-color $ui-monokai-borderColor
|
||||||
|
&:hover
|
||||||
|
background-color $ui-monokai-noteDetail-backgroundColor
|
||||||
|
.deleteButton
|
||||||
|
color $ui-monokai-text-color
|
||||||
|
&:hover
|
||||||
|
background-color darken($ui-monokai-noteDetail-backgroundColor, 15%)
|
||||||
|
&:active
|
||||||
|
color $ui-monokai-text-color
|
||||||
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
|
|
||||||
|
.button
|
||||||
|
border none
|
||||||
|
color $ui-monokai-text-color
|
||||||
|
background-color transparent
|
||||||
|
transition color background-color 0.15s
|
||||||
|
border-left 4px solid transparent
|
||||||
|
&:hover
|
||||||
|
color $ui-monokai-text-color
|
||||||
|
background-color $ui-monokai-noteDetail-backgroundColor
|
||||||
|
|
||||||
|
.input
|
||||||
|
background-color $ui-monokai-noteDetail-backgroundColor
|
||||||
|
color $ui-monokai-text-color
|
||||||
|
|
||||||
|
.deleteButton
|
||||||
|
color alpha($ui-monokai-text-color, 30%)
|
||||||
@@ -257,6 +257,7 @@ table
|
|||||||
display block
|
display block
|
||||||
width 100%
|
width 100%
|
||||||
margin 0 0 1em
|
margin 0 0 1em
|
||||||
|
overflow-x auto
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
background-color tableHeadBgColor
|
background-color tableHeadBgColor
|
||||||
|
|||||||
@@ -573,11 +573,12 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addSnippet () {
|
addSnippet () {
|
||||||
|
const { config } = this.props
|
||||||
const { note } = this.state
|
const { note } = this.state
|
||||||
|
|
||||||
note.snippets = note.snippets.concat([{
|
note.snippets = note.snippets.concat([{
|
||||||
name: '',
|
name: '',
|
||||||
mode: 'Plain Text',
|
mode: config.editor.snippetDefaultLanguage || 'text',
|
||||||
content: ''
|
content: ''
|
||||||
}])
|
}])
|
||||||
const snippetIndex = note.snippets.length - 1
|
const snippetIndex = note.snippets.length - 1
|
||||||
|
|||||||
@@ -34,14 +34,15 @@ class NewNoteButton extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleNewNoteButtonClick (e) {
|
handleNewNoteButtonClick (e) {
|
||||||
const { location, dispatch } = this.props
|
const { location, dispatch, config } = this.props
|
||||||
const { storage, folder } = this.resolveTargetFolder()
|
const { storage, folder } = this.resolveTargetFolder()
|
||||||
|
|
||||||
modal.open(NewNoteModal, {
|
modal.open(NewNoteModal, {
|
||||||
storage: storage.key,
|
storage: storage.key,
|
||||||
folder: folder.key,
|
folder: folder.key,
|
||||||
dispatch,
|
dispatch,
|
||||||
location
|
location,
|
||||||
|
config
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class NewNoteModal extends React.Component {
|
|||||||
handleSnippetNoteButtonClick (e) {
|
handleSnippetNoteButtonClick (e) {
|
||||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_SNIPPET')
|
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_SNIPPET')
|
||||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE')
|
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE')
|
||||||
const { storage, folder, dispatch, location } = this.props
|
const { storage, folder, dispatch, location, config } = this.props
|
||||||
|
|
||||||
dataApi
|
dataApi
|
||||||
.createNote(storage, {
|
.createNote(storage, {
|
||||||
@@ -72,7 +72,7 @@ class NewNoteModal extends React.Component {
|
|||||||
snippets: [
|
snippets: [
|
||||||
{
|
{
|
||||||
name: '',
|
name: '',
|
||||||
mode: 'text',
|
mode: config.editor.snippetDefaultLanguage || 'text',
|
||||||
content: ''
|
content: ''
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
line-height 30px
|
line-height 30px
|
||||||
|
|
||||||
.group-section-label
|
.group-section-label
|
||||||
width 150px
|
width 200px
|
||||||
text-align left
|
text-align left
|
||||||
margin-right 10px
|
margin-right 10px
|
||||||
font-size 14px
|
font-size 14px
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ class UiTab extends React.Component {
|
|||||||
displayLineNumbers: this.refs.editorDisplayLineNumbers.checked,
|
displayLineNumbers: this.refs.editorDisplayLineNumbers.checked,
|
||||||
switchPreview: this.refs.editorSwitchPreview.value,
|
switchPreview: this.refs.editorSwitchPreview.value,
|
||||||
keyMap: this.refs.editorKeyMap.value,
|
keyMap: this.refs.editorKeyMap.value,
|
||||||
|
snippetDefaultLanguage: this.refs.editorSnippetDefaultLanguage.value,
|
||||||
scrollPastEnd: this.refs.scrollPastEnd.checked,
|
scrollPastEnd: this.refs.scrollPastEnd.checked,
|
||||||
fetchUrlTitle: this.refs.editorFetchUrlTitle.checked
|
fetchUrlTitle: this.refs.editorFetchUrlTitle.checked
|
||||||
},
|
},
|
||||||
@@ -430,6 +431,22 @@ class UiTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>
|
||||||
|
{i18n.__('Snippet Default Language')}
|
||||||
|
</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<select value={config.editor.snippetDefaultLanguage}
|
||||||
|
ref='editorSnippetDefaultLanguage'
|
||||||
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
|
>
|
||||||
|
{
|
||||||
|
_.sortBy(CodeMirror.modeInfo.map(mode => mode.name)).map(name => (<option key={name} value={name}>{name}</option>))
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div styleName='group-checkBoxSection'>
|
<div styleName='group-checkBoxSection'>
|
||||||
<label>
|
<label>
|
||||||
<input onChange={(e) => this.handleUIChange(e)}
|
<input onChange={(e) => this.handleUIChange(e)}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ $danger-color = #c9302c
|
|||||||
$danger-lighten-color = lighten(#c9302c, 5%)
|
$danger-lighten-color = lighten(#c9302c, 5%)
|
||||||
|
|
||||||
// Layouts
|
// Layouts
|
||||||
$statusBar-height = 22px
|
$statusBar-height = 28px
|
||||||
$sideNav-width = 200px
|
$sideNav-width = 200px
|
||||||
$sideNav--folded-width = 44px
|
$sideNav--folded-width = 44px
|
||||||
$topBar-height = 60px
|
$topBar-height = 60px
|
||||||
@@ -377,7 +377,7 @@ $ui-monokai-button--active-backgroundColor = #f92672
|
|||||||
$ui-monokai-button--hover-backgroundColor = lighten($ui-dark-backgroundColor, 10%)
|
$ui-monokai-button--hover-backgroundColor = lighten($ui-dark-backgroundColor, 10%)
|
||||||
$ui-monokai-button--focus-borderColor = lighten(#369DCD, 25%)
|
$ui-monokai-button--focus-borderColor = lighten(#369DCD, 25%)
|
||||||
|
|
||||||
modalmonokai()
|
modalMonokai()
|
||||||
position relative
|
position relative
|
||||||
z-index $modal-z-index
|
z-index $modal-z-index
|
||||||
width 100%
|
width 100%
|
||||||
|
|||||||
@@ -178,5 +178,6 @@
|
|||||||
"⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠",
|
"⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠",
|
||||||
"Save tags of a note in alphabetical order": "Save tags of a note in alphabetical order",
|
"Save tags of a note in alphabetical order": "Save tags of a note in alphabetical order",
|
||||||
"Show tags of a note in alphabetical order": "Show tags of a note in alphabetical order",
|
"Show tags of a note in alphabetical order": "Show tags of a note in alphabetical order",
|
||||||
"Enable live count of notes": "Enable live count of notes"
|
"Enable live count of notes": "Enable live count of notes",
|
||||||
|
"Snippet Default Language": "Snippet Default Language"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,5 +155,6 @@
|
|||||||
"⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ Vous avez collé un lien qui référence une pièce-jointe qui n'a pas pu être récupéré dans le dossier de stockage de la note. Coller des liens qui font référence à des pièces-jointes ne fonctionne que si la source et la destination et la même. Veuillez plutôt utiliser du Drag & Drop ! ⚠",
|
"⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ Vous avez collé un lien qui référence une pièce-jointe qui n'a pas pu être récupéré dans le dossier de stockage de la note. Coller des liens qui font référence à des pièces-jointes ne fonctionne que si la source et la destination et la même. Veuillez plutôt utiliser du Drag & Drop ! ⚠",
|
||||||
"Save tags of a note in alphabetical order": "Sauvegarder les tags d'une note en ordre alphabétique",
|
"Save tags of a note in alphabetical order": "Sauvegarder les tags d'une note en ordre alphabétique",
|
||||||
"Show tags of a note in alphabetical order": "Afficher les tags d'une note par ordre alphabétique",
|
"Show tags of a note in alphabetical order": "Afficher les tags d'une note par ordre alphabétique",
|
||||||
"Enable live count of notes": "Activer le comptage live des notes"
|
"Enable live count of notes": "Activer le comptage live des notes",
|
||||||
|
"Snippet Default Language": "Langage par défaut d'un snippet"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "boost",
|
"name": "boost",
|
||||||
"productName": "Boostnote",
|
"productName": "Boostnote",
|
||||||
"version": "0.11.8",
|
"version": "0.11.9",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"description": "Boostnote",
|
"description": "Boostnote",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user