mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
@@ -273,7 +273,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
const { rulers, enableRulers, enableMarkdownLint } = this.props
|
const { rulers, enableRulers, enableMarkdownLint, RTL } = this.props
|
||||||
eventEmitter.on('line:jump', this.scrollToLineHandeler)
|
eventEmitter.on('line:jump', this.scrollToLineHandeler)
|
||||||
|
|
||||||
snippetManager.init()
|
snippetManager.init()
|
||||||
@@ -294,6 +294,8 @@ export default class CodeEditor extends React.Component {
|
|||||||
scrollPastEnd: this.props.scrollPastEnd,
|
scrollPastEnd: this.props.scrollPastEnd,
|
||||||
inputStyle: 'textarea',
|
inputStyle: 'textarea',
|
||||||
dragDrop: false,
|
dragDrop: false,
|
||||||
|
direction: RTL ? 'rtl' : 'ltr',
|
||||||
|
rtlMoveVisually: RTL,
|
||||||
foldGutter: true,
|
foldGutter: true,
|
||||||
lint: enableMarkdownLint ? this.getCodeEditorLintConfig() : false,
|
lint: enableMarkdownLint ? this.getCodeEditorLintConfig() : false,
|
||||||
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'CodeMirror-lint-markers'],
|
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'CodeMirror-lint-markers'],
|
||||||
@@ -555,6 +557,10 @@ export default class CodeEditor extends React.Component {
|
|||||||
if (prevProps.keyMap !== this.props.keyMap) {
|
if (prevProps.keyMap !== this.props.keyMap) {
|
||||||
needRefresh = true
|
needRefresh = true
|
||||||
}
|
}
|
||||||
|
if (prevProps.RTL !== this.props.RTL) {
|
||||||
|
this.editor.setOption('direction', this.props.RTL ? 'rtl' : 'ltr')
|
||||||
|
this.editor.setOption('rtlMoveVisually', this.props.RTL)
|
||||||
|
}
|
||||||
if (prevProps.enableMarkdownLint !== enableMarkdownLint || prevProps.customMarkdownLintConfig !== customMarkdownLintConfig) {
|
if (prevProps.enableMarkdownLint !== enableMarkdownLint || prevProps.customMarkdownLintConfig !== customMarkdownLintConfig) {
|
||||||
if (!enableMarkdownLint) {
|
if (!enableMarkdownLint) {
|
||||||
this.editor.setOption('lint', {default: false})
|
this.editor.setOption('lint', {default: false})
|
||||||
@@ -1219,7 +1225,8 @@ CodeEditor.propTypes = {
|
|||||||
spellCheck: PropTypes.bool,
|
spellCheck: PropTypes.bool,
|
||||||
enableMarkdownLint: PropTypes.bool,
|
enableMarkdownLint: PropTypes.bool,
|
||||||
customMarkdownLintConfig: PropTypes.string,
|
customMarkdownLintConfig: PropTypes.string,
|
||||||
deleteUnusedAttachments: PropTypes.bool
|
deleteUnusedAttachments: PropTypes.bool,
|
||||||
|
RTL: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeEditor.defaultProps = {
|
CodeEditor.defaultProps = {
|
||||||
@@ -1235,5 +1242,6 @@ CodeEditor.defaultProps = {
|
|||||||
enableMarkdownLint: DEFAULT_CONFIG.editor.enableMarkdownLint,
|
enableMarkdownLint: DEFAULT_CONFIG.editor.enableMarkdownLint,
|
||||||
customMarkdownLintConfig: DEFAULT_CONFIG.editor.customMarkdownLintConfig,
|
customMarkdownLintConfig: DEFAULT_CONFIG.editor.customMarkdownLintConfig,
|
||||||
prettierConfig: DEFAULT_CONFIG.editor.prettierConfig,
|
prettierConfig: DEFAULT_CONFIG.editor.prettierConfig,
|
||||||
deleteUnusedAttachments: DEFAULT_CONFIG.editor.deleteUnusedAttachments
|
deleteUnusedAttachments: DEFAULT_CONFIG.editor.deleteUnusedAttachments,
|
||||||
|
RTL: false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {className, value, config, storageKey, noteKey, linesHighlighted} = this.props
|
const {className, value, config, storageKey, noteKey, linesHighlighted, RTL} = this.props
|
||||||
|
|
||||||
let editorFontSize = parseInt(config.editor.fontSize, 10)
|
let editorFontSize = parseInt(config.editor.fontSize, 10)
|
||||||
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
|
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
|
||||||
@@ -325,6 +325,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
|
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
|
||||||
prettierConfig={config.editor.prettierConfig}
|
prettierConfig={config.editor.prettierConfig}
|
||||||
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
|
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
|
||||||
|
RTL={RTL}
|
||||||
/>
|
/>
|
||||||
<MarkdownPreview styleName={this.state.status === 'PREVIEW'
|
<MarkdownPreview styleName={this.state.status === 'PREVIEW'
|
||||||
? 'preview'
|
? 'preview'
|
||||||
@@ -360,6 +361,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
allowCustomCSS={config.preview.allowCustomCSS}
|
allowCustomCSS={config.preview.allowCustomCSS}
|
||||||
lineThroughCheckbox={config.preview.lineThroughCheckbox}
|
lineThroughCheckbox={config.preview.lineThroughCheckbox}
|
||||||
onDrop={(e) => this.handleDropImage(e)}
|
onDrop={(e) => this.handleDropImage(e)}
|
||||||
|
RTL={RTL}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ function buildStyle (opts) {
|
|||||||
scrollPastEnd,
|
scrollPastEnd,
|
||||||
theme,
|
theme,
|
||||||
allowCustomCSS,
|
allowCustomCSS,
|
||||||
customCSS
|
customCSS,
|
||||||
|
RTL
|
||||||
} = opts
|
} = opts
|
||||||
return `
|
return `
|
||||||
@font-face {
|
@font-face {
|
||||||
@@ -101,11 +102,14 @@ ${markdownStyle}
|
|||||||
body {
|
body {
|
||||||
font-family: '${fontFamily.join("','")}';
|
font-family: '${fontFamily.join("','")}';
|
||||||
font-size: ${fontSize}px;
|
font-size: ${fontSize}px;
|
||||||
|
|
||||||
${scrollPastEnd ? `
|
${scrollPastEnd ? `
|
||||||
padding-bottom: 90vh;
|
padding-bottom: 90vh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
`
|
`
|
||||||
: ''}
|
: ''}
|
||||||
|
${RTL ? 'direction: rtl;' : ''}
|
||||||
|
${RTL ? 'text-align: right;' : ''}
|
||||||
}
|
}
|
||||||
@media print {
|
@media print {
|
||||||
body {
|
body {
|
||||||
@@ -115,6 +119,8 @@ body {
|
|||||||
code {
|
code {
|
||||||
font-family: '${codeBlockFontFamily.join("','")}';
|
font-family: '${codeBlockFontFamily.join("','")}';
|
||||||
background-color: rgba(0,0,0,0.04);
|
background-color: rgba(0,0,0,0.04);
|
||||||
|
text-align: left;
|
||||||
|
direction: ltr;
|
||||||
}
|
}
|
||||||
.lineNumber {
|
.lineNumber {
|
||||||
${lineNumber && 'display: block !important;'}
|
${lineNumber && 'display: block !important;'}
|
||||||
@@ -337,7 +343,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
scrollPastEnd,
|
scrollPastEnd,
|
||||||
theme,
|
theme,
|
||||||
allowCustomCSS,
|
allowCustomCSS,
|
||||||
customCSS
|
customCSS,
|
||||||
|
RTL
|
||||||
} = this.getStyleParams()
|
} = this.getStyleParams()
|
||||||
|
|
||||||
const inlineStyles = buildStyle({
|
const inlineStyles = buildStyle({
|
||||||
@@ -348,7 +355,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
scrollPastEnd,
|
scrollPastEnd,
|
||||||
theme,
|
theme,
|
||||||
allowCustomCSS,
|
allowCustomCSS,
|
||||||
customCSS
|
customCSS,
|
||||||
|
RTL
|
||||||
})
|
})
|
||||||
let body = this.refs.root.contentWindow.document.body.innerHTML
|
let body = this.refs.root.contentWindow.document.body.innerHTML
|
||||||
body = attachmentManagement.fixLocalURLS(
|
body = attachmentManagement.fixLocalURLS(
|
||||||
@@ -619,7 +627,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
prevProps.theme !== this.props.theme ||
|
prevProps.theme !== this.props.theme ||
|
||||||
prevProps.scrollPastEnd !== this.props.scrollPastEnd ||
|
prevProps.scrollPastEnd !== this.props.scrollPastEnd ||
|
||||||
prevProps.allowCustomCSS !== this.props.allowCustomCSS ||
|
prevProps.allowCustomCSS !== this.props.allowCustomCSS ||
|
||||||
prevProps.customCSS !== this.props.customCSS
|
prevProps.customCSS !== this.props.customCSS ||
|
||||||
|
prevProps.RTL !== this.props.RTL
|
||||||
) {
|
) {
|
||||||
this.applyStyle()
|
this.applyStyle()
|
||||||
needsRewriteIframe = true
|
needsRewriteIframe = true
|
||||||
@@ -643,7 +652,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
scrollPastEnd,
|
scrollPastEnd,
|
||||||
theme,
|
theme,
|
||||||
allowCustomCSS,
|
allowCustomCSS,
|
||||||
customCSS
|
customCSS,
|
||||||
|
RTL
|
||||||
} = this.props
|
} = this.props
|
||||||
let { fontFamily, codeBlockFontFamily } = this.props
|
let { fontFamily, codeBlockFontFamily } = this.props
|
||||||
fontFamily = _.isString(fontFamily) && fontFamily.trim().length > 0
|
fontFamily = _.isString(fontFamily) && fontFamily.trim().length > 0
|
||||||
@@ -669,7 +679,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
scrollPastEnd,
|
scrollPastEnd,
|
||||||
theme,
|
theme,
|
||||||
allowCustomCSS,
|
allowCustomCSS,
|
||||||
customCSS
|
customCSS,
|
||||||
|
RTL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -683,7 +694,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
scrollPastEnd,
|
scrollPastEnd,
|
||||||
theme,
|
theme,
|
||||||
allowCustomCSS,
|
allowCustomCSS,
|
||||||
customCSS
|
customCSS,
|
||||||
|
RTL
|
||||||
} = this.getStyleParams()
|
} = this.getStyleParams()
|
||||||
|
|
||||||
this.getWindow().document.getElementById(
|
this.getWindow().document.getElementById(
|
||||||
@@ -697,7 +709,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
scrollPastEnd,
|
scrollPastEnd,
|
||||||
theme,
|
theme,
|
||||||
allowCustomCSS,
|
allowCustomCSS,
|
||||||
customCSS
|
customCSS,
|
||||||
|
RTL
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class MarkdownSplitEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {config, value, storageKey, noteKey, linesHighlighted} = this.props
|
const {config, value, storageKey, noteKey, linesHighlighted, RTL} = this.props
|
||||||
const storage = findStorage(storageKey)
|
const storage = findStorage(storageKey)
|
||||||
let editorFontSize = parseInt(config.editor.fontSize, 10)
|
let editorFontSize = parseInt(config.editor.fontSize, 10)
|
||||||
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
|
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
|
||||||
@@ -183,6 +183,7 @@ class MarkdownSplitEditor extends React.Component {
|
|||||||
enableMarkdownLint={config.editor.enableMarkdownLint}
|
enableMarkdownLint={config.editor.enableMarkdownLint}
|
||||||
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
|
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
|
||||||
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
|
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
|
||||||
|
RTL={RTL}
|
||||||
/>
|
/>
|
||||||
<div styleName='slider' style={{left: this.state.codeEditorWidthInPercent + '%'}} onMouseDown={e => this.handleMouseDown(e)} >
|
<div styleName='slider' style={{left: this.state.codeEditorWidthInPercent + '%'}} onMouseDown={e => this.handleMouseDown(e)} >
|
||||||
<div styleName='slider-hitbox' />
|
<div styleName='slider-hitbox' />
|
||||||
@@ -213,6 +214,7 @@ class MarkdownSplitEditor extends React.Component {
|
|||||||
customCSS={config.preview.customCSS}
|
customCSS={config.preview.customCSS}
|
||||||
allowCustomCSS={config.preview.allowCustomCSS}
|
allowCustomCSS={config.preview.allowCustomCSS}
|
||||||
lineThroughCheckbox={config.preview.lineThroughCheckbox}
|
lineThroughCheckbox={config.preview.lineThroughCheckbox}
|
||||||
|
RTL={RTL}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { confirmDeleteNote } from 'browser/lib/confirmDeleteNote'
|
|||||||
import markdownToc from 'browser/lib/markdown-toc-generator'
|
import markdownToc from 'browser/lib/markdown-toc-generator'
|
||||||
import queryString from 'query-string'
|
import queryString from 'query-string'
|
||||||
import { replace } from 'connected-react-router'
|
import { replace } from 'connected-react-router'
|
||||||
|
import ToggleDirectionButton from 'browser/main/Detail/ToggleDirectionButton'
|
||||||
|
|
||||||
class MarkdownNoteDetail extends React.Component {
|
class MarkdownNoteDetail extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -46,7 +47,8 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
isLockButtonShown: props.config.editor.type !== 'SPLIT',
|
isLockButtonShown: props.config.editor.type !== 'SPLIT',
|
||||||
isLocked: false,
|
isLocked: false,
|
||||||
editorType: props.config.editor.type,
|
editorType: props.config.editor.type,
|
||||||
switchPreview: props.config.editor.switchPreview
|
switchPreview: props.config.editor.switchPreview,
|
||||||
|
RTL: false
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dispatchTimer = null
|
this.dispatchTimer = null
|
||||||
@@ -61,6 +63,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
ee.on('topbar:togglelockbutton', this.toggleLockButton)
|
ee.on('topbar:togglelockbutton', this.toggleLockButton)
|
||||||
|
ee.on('topbar:toggledirectionbutton', () => this.handleSwitchDirection())
|
||||||
ee.on('topbar:togglemodebutton', () => {
|
ee.on('topbar:togglemodebutton', () => {
|
||||||
const reversedType = this.state.editorType === 'SPLIT' ? 'EDITOR_PREVIEW' : 'SPLIT'
|
const reversedType = this.state.editorType === 'SPLIT' ? 'EDITOR_PREVIEW' : 'SPLIT'
|
||||||
this.handleSwitchMode(reversedType)
|
this.handleSwitchMode(reversedType)
|
||||||
@@ -99,6 +102,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
ee.off('topbar:togglelockbutton', this.toggleLockButton)
|
ee.off('topbar:togglelockbutton', this.toggleLockButton)
|
||||||
|
ee.on('topbar:toggledirectionbutton', this.handleSwitchDirection)
|
||||||
ee.off('code:generate-toc', this.generateToc)
|
ee.off('code:generate-toc', this.generateToc)
|
||||||
if (this.saveQueue != null) this.saveNow()
|
if (this.saveQueue != null) this.saveNow()
|
||||||
}
|
}
|
||||||
@@ -354,6 +358,12 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleSwitchDirection () {
|
||||||
|
// If in split mode, hide the lock button
|
||||||
|
const direction = this.state.RTL
|
||||||
|
this.setState({ RTL: !direction })
|
||||||
|
}
|
||||||
|
|
||||||
handleDeleteNote () {
|
handleDeleteNote () {
|
||||||
this.handleTrashButtonClick()
|
this.handleTrashButtonClick()
|
||||||
}
|
}
|
||||||
@@ -393,6 +403,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
onChange={this.handleUpdateContent.bind(this)}
|
onChange={this.handleUpdateContent.bind(this)}
|
||||||
isLocked={this.state.isLocked}
|
isLocked={this.state.isLocked}
|
||||||
ignorePreviewPointerEvents={ignorePreviewPointerEvents}
|
ignorePreviewPointerEvents={ignorePreviewPointerEvents}
|
||||||
|
RTL={this.state.RTL}
|
||||||
/>
|
/>
|
||||||
} else {
|
} else {
|
||||||
return <MarkdownSplitEditor
|
return <MarkdownSplitEditor
|
||||||
@@ -404,6 +415,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
linesHighlighted={note.linesHighlighted}
|
linesHighlighted={note.linesHighlighted}
|
||||||
onChange={this.handleUpdateContent.bind(this)}
|
onChange={this.handleUpdateContent.bind(this)}
|
||||||
ignorePreviewPointerEvents={ignorePreviewPointerEvents}
|
ignorePreviewPointerEvents={ignorePreviewPointerEvents}
|
||||||
|
RTL={this.state.RTL}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -472,7 +484,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div styleName='info-right'>
|
<div styleName='info-right'>
|
||||||
<ToggleModeButton onClick={(e) => this.handleSwitchMode(e)} editorType={editorType} />
|
<ToggleModeButton onClick={(e) => this.handleSwitchMode(e)} editorType={editorType} />
|
||||||
|
<ToggleDirectionButton onClick={(e) => this.handleSwitchDirection(e)} isRTL={this.state.RTL} />
|
||||||
<StarButton
|
<StarButton
|
||||||
onClick={(e) => this.handleStarButtonClick(e)}
|
onClick={(e) => this.handleStarButtonClick(e)}
|
||||||
isActive={note.isStarred}
|
isActive={note.isStarred}
|
||||||
@@ -518,6 +530,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
print={this.print}
|
print={this.print}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
.control-lockButton
|
.control-lockButton
|
||||||
topBarButtonRight()
|
topBarButtonRight()
|
||||||
position absolute
|
position absolute
|
||||||
right 225px
|
right 265px
|
||||||
&:hover .tooltip
|
&:hover .tooltip
|
||||||
opacity 1
|
opacity 1
|
||||||
|
|
||||||
|
|||||||
26
browser/main/Detail/ToggleDirectionButton.js
Normal file
26
browser/main/Detail/ToggleDirectionButton.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import PropTypes from 'prop-types'
|
||||||
|
import React from 'react'
|
||||||
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
|
import styles from './ToggleDirectionButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
|
const ToggleDirectionButton = ({
|
||||||
|
onClick, isRTL
|
||||||
|
}) => (
|
||||||
|
<div styleName='control-toggleModeButton'>
|
||||||
|
<div styleName={isRTL ? 'active' : undefined} onClick={() => onClick()}>
|
||||||
|
<img src={!isRTL ? '../resources/icon/icon-left-to-right.svg' : ''} />
|
||||||
|
</div>
|
||||||
|
<div styleName={!isRTL ? 'active' : undefined} onClick={() => onClick()}>
|
||||||
|
<img src={!isRTL ? '' : '../resources/icon/icon-right-to-left.svg'} />
|
||||||
|
</div>
|
||||||
|
<span lang={i18n.locale} styleName='tooltip'>{i18n.__('Toggle Direction')}</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
ToggleDirectionButton.propTypes = {
|
||||||
|
onClick: PropTypes.func.isRequired,
|
||||||
|
isRTL: PropTypes.string.isRequired
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CSSModules(ToggleDirectionButton, styles)
|
||||||
85
browser/main/Detail/ToggleDirectionButton.styl
Normal file
85
browser/main/Detail/ToggleDirectionButton.styl
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
.control-toggleModeButton
|
||||||
|
height 25px
|
||||||
|
border-radius 50px
|
||||||
|
background-color #F4F4F4
|
||||||
|
width 52px
|
||||||
|
display flex
|
||||||
|
align-items center
|
||||||
|
position: relative
|
||||||
|
top 2px
|
||||||
|
margin-left 5px
|
||||||
|
.active
|
||||||
|
background-color #1EC38B
|
||||||
|
width 33px
|
||||||
|
height 24px
|
||||||
|
box-shadow 2px 0px 7px #eee
|
||||||
|
z-index 1
|
||||||
|
|
||||||
|
div
|
||||||
|
width 40px
|
||||||
|
height 100%
|
||||||
|
border-radius 50%
|
||||||
|
display flex
|
||||||
|
align-items center
|
||||||
|
justify-content center
|
||||||
|
cursor pointer
|
||||||
|
|
||||||
|
&:hover .tooltip
|
||||||
|
opacity 1
|
||||||
|
|
||||||
|
.tooltip
|
||||||
|
tooltip()
|
||||||
|
position absolute
|
||||||
|
pointer-events none
|
||||||
|
top 33px
|
||||||
|
left -10px
|
||||||
|
z-index 200
|
||||||
|
width 80px
|
||||||
|
padding 5px
|
||||||
|
line-height normal
|
||||||
|
border-radius 2px
|
||||||
|
opacity 0
|
||||||
|
transition 0.1s
|
||||||
|
|
||||||
|
.tooltip:lang(ja)
|
||||||
|
@extend .tooltip
|
||||||
|
left -8px
|
||||||
|
width 70px
|
||||||
|
|
||||||
|
body[data-theme="dark"]
|
||||||
|
.control-fullScreenButton
|
||||||
|
topBarButtonDark()
|
||||||
|
|
||||||
|
.control-toggleModeButton
|
||||||
|
background-color #3A404C
|
||||||
|
.active
|
||||||
|
background-color #1EC38B
|
||||||
|
box-shadow 2px 0px 7px #444444
|
||||||
|
|
||||||
|
body[data-theme="solarized-dark"]
|
||||||
|
.control-toggleModeButton
|
||||||
|
background-color #002B36
|
||||||
|
.active
|
||||||
|
background-color #1EC38B
|
||||||
|
box-shadow 2px 0px 7px #222222
|
||||||
|
|
||||||
|
body[data-theme="monokai"]
|
||||||
|
.control-toggleModeButton
|
||||||
|
background-color #373831
|
||||||
|
.active
|
||||||
|
background-color #f92672
|
||||||
|
box-shadow 2px 0px 7px #222222
|
||||||
|
|
||||||
|
body[data-theme="dracula"]
|
||||||
|
.control-toggleModeButton
|
||||||
|
background-color #44475a
|
||||||
|
.active
|
||||||
|
background-color #bd93f9
|
||||||
|
box-shadow 2px 0px 7px #222222
|
||||||
|
|
||||||
|
.control-toggleModeButton
|
||||||
|
-webkit-user-drag none
|
||||||
|
user-select none
|
||||||
|
> div img
|
||||||
|
-webkit-user-drag none
|
||||||
|
user-select none
|
||||||
@@ -182,4 +182,4 @@ body[data-theme="default"]
|
|||||||
.SideNav ::-webkit-scrollbar-thumb
|
.SideNav ::-webkit-scrollbar-thumb
|
||||||
background-color rgba(255, 255, 255, 0.3)
|
background-color rgba(255, 255, 255, 0.3)
|
||||||
|
|
||||||
@import '../styles/Detail/TagSelect.styl'
|
@import '../styles/Detail/TagSelect.styl'
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export const DEFAULT_CONFIG = {
|
|||||||
hotkey: {
|
hotkey: {
|
||||||
toggleMain: OSX ? 'Command + Alt + L' : 'Super + Alt + E',
|
toggleMain: OSX ? 'Command + Alt + L' : 'Super + Alt + E',
|
||||||
toggleMode: OSX ? 'Command + Alt + M' : 'Ctrl + M',
|
toggleMode: OSX ? 'Command + Alt + M' : 'Ctrl + M',
|
||||||
|
toggleDirection: OSX ? 'Command + Alt + Right' : 'Ctrl + Right',
|
||||||
deleteNote: OSX ? 'Command + Shift + Backspace' : 'Ctrl + Shift + Backspace',
|
deleteNote: OSX ? 'Command + Shift + Backspace' : 'Ctrl + Shift + Backspace',
|
||||||
pasteSmartly: OSX ? 'Command + Shift + V' : 'Ctrl + Shift + V',
|
pasteSmartly: OSX ? 'Command + Shift + V' : 'Ctrl + Shift + V',
|
||||||
prettifyMarkdown: OSX ? 'Command + Shift + F' : 'Ctrl + Shift + F',
|
prettifyMarkdown: OSX ? 'Command + Shift + F' : 'Ctrl + Shift + F',
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ module.exports = {
|
|||||||
'toggleMode': () => {
|
'toggleMode': () => {
|
||||||
ee.emit('topbar:togglemodebutton')
|
ee.emit('topbar:togglemodebutton')
|
||||||
},
|
},
|
||||||
|
'toggleDirection': () => {
|
||||||
|
ee.emit('topbar:toggledirectionbutton')
|
||||||
|
},
|
||||||
'deleteNote': () => {
|
'deleteNote': () => {
|
||||||
ee.emit('hotkey:deletenote')
|
ee.emit('hotkey:deletenote')
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ class HotkeyTab extends React.Component {
|
|||||||
this.handleSettingError = (err) => {
|
this.handleSettingError = (err) => {
|
||||||
if (
|
if (
|
||||||
this.state.config.hotkey.toggleMain === '' ||
|
this.state.config.hotkey.toggleMain === '' ||
|
||||||
this.state.config.hotkey.toggleMode === ''
|
this.state.config.hotkey.toggleMode === '' ||
|
||||||
|
this.state.config.hotkey.toggleDirection === ''
|
||||||
) {
|
) {
|
||||||
this.setState({keymapAlert: {
|
this.setState({keymapAlert: {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@@ -79,6 +80,7 @@ class HotkeyTab extends React.Component {
|
|||||||
config.hotkey = Object.assign({}, config.hotkey, {
|
config.hotkey = Object.assign({}, config.hotkey, {
|
||||||
toggleMain: this.refs.toggleMain.value,
|
toggleMain: this.refs.toggleMain.value,
|
||||||
toggleMode: this.refs.toggleMode.value,
|
toggleMode: this.refs.toggleMode.value,
|
||||||
|
toggleDirection: this.refs.toggleDirection.value,
|
||||||
deleteNote: this.refs.deleteNote.value,
|
deleteNote: this.refs.deleteNote.value,
|
||||||
pasteSmartly: this.refs.pasteSmartly.value,
|
pasteSmartly: this.refs.pasteSmartly.value,
|
||||||
prettifyMarkdown: this.refs.prettifyMarkdown.value,
|
prettifyMarkdown: this.refs.prettifyMarkdown.value,
|
||||||
@@ -154,6 +156,17 @@ class HotkeyTab extends React.Component {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>{i18n.__('Toggle Direction')}</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<input styleName='group-section-control-input'
|
||||||
|
onChange={(e) => this.handleHotkeyChange(e)}
|
||||||
|
ref='toggleDirection'
|
||||||
|
value={config.hotkey.toggleDirection}
|
||||||
|
type='text'
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>{i18n.__('Delete Note')}</div>
|
<div styleName='group-section-label'>{i18n.__('Delete Note')}</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
|
|||||||
1
resources/icon/icon-left-to-right.svg
Normal file
1
resources/icon/icon-left-to-right.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 19 19" width="19" height="19"><defs><clipPath id="_clipPath_D2hneLn2MshV3kxCCg6onfZAUvTCrRVv"><rect width="19" height="19"/></clipPath></defs><g clip-path="url(#_clipPath_D2hneLn2MshV3kxCCg6onfZAUvTCrRVv)"><path d=" M 6.25 7.875 L 6.25 11.938 L 7.875 11.938 L 7.875 3 L 9.5 3 L 9.5 11.938 L 11.125 11.938 L 11.125 3 L 12.75 3 L 12.75 1.375 L 6.25 1.375 C 4.454 1.375 3 2.829 3 4.625 C 3 6.421 4.454 7.875 6.25 7.875 Z M 16 14.375 L 12.75 11.125 L 12.75 13.563 L 3 13.563 L 3 15.188 L 12.75 15.188 L 12.75 17.625 L 16 14.375 Z " fill="none" vector-effect="non-scaling-stroke" stroke-width="1" stroke="rgb(30,195,139)" stroke-linejoin="miter" stroke-linecap="butt" stroke-miterlimit="4"/><path d=" M 0 0 L 24 0 L 24 24 L 0 24 L 0 0 Z " fill="none"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 946 B |
1
resources/icon/icon-right-to-left.svg
Normal file
1
resources/icon/icon-right-to-left.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 19 19" width="19" height="19"><defs><clipPath id="_clipPath_4oBhjMfh8u0orAMDE1wkYXMRAyiloKfW"><rect width="19" height="19"/></clipPath></defs><g clip-path="url(#_clipPath_4oBhjMfh8u0orAMDE1wkYXMRAyiloKfW)"><path d=" M 7.875 7.875 L 7.875 11.938 L 9.5 11.938 L 9.5 3 L 11.125 3 L 11.125 11.938 L 12.75 11.938 L 12.75 3 L 14.375 3 L 14.375 1.375 L 7.875 1.375 C 6.079 1.375 4.625 2.829 4.625 4.625 C 4.625 6.421 6.079 7.875 7.875 7.875 Z M 6.25 13.563 L 6.25 11.125 L 3 14.375 L 6.25 17.625 L 6.25 15.188 L 16 15.188 L 16 13.563 L 6.25 13.563 Z " fill="none" vector-effect="non-scaling-stroke" stroke-width="1" stroke="rgb(30,195,139)" stroke-linejoin="miter" stroke-linecap="butt" stroke-miterlimit="4"/><path d=" M 0 -0.062 L 24 -0.062 L 24 23.938 L 0 23.938 L 0 -0.062 Z " fill="none"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 986 B |
Reference in New Issue
Block a user