mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
fixed eslint
This commit is contained in:
@@ -219,11 +219,19 @@ export default class CodeEditor extends React.Component {
|
|||||||
},
|
},
|
||||||
[translateHotkey(hotkey.insertDate)]: function(cm) {
|
[translateHotkey(hotkey.insertDate)]: function(cm) {
|
||||||
const dateNow = new Date()
|
const dateNow = new Date()
|
||||||
cm.replaceSelection(dateNow.toLocaleDateString())
|
if (self.props.dateFormatISO8601) {
|
||||||
|
cm.replaceSelection(dateNow.toISOString().split('T')[0])
|
||||||
|
} else {
|
||||||
|
cm.replaceSelection(dateNow.toLocaleDateString())
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[translateHotkey(hotkey.insertDateTime)]: function(cm) {
|
[translateHotkey(hotkey.insertDateTime)]: function(cm) {
|
||||||
const dateNow = new Date()
|
const dateNow = new Date()
|
||||||
cm.replaceSelection(dateNow.toLocaleString())
|
if (self.props.dateFormatISO8601) {
|
||||||
|
cm.replaceSelection(dateNow.toISOString())
|
||||||
|
} else {
|
||||||
|
cm.replaceSelection(dateNow.toLocaleString())
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Enter: 'boostNewLineAndIndentContinueMarkdownList',
|
Enter: 'boostNewLineAndIndentContinueMarkdownList',
|
||||||
'Ctrl-C': cm => {
|
'Ctrl-C': cm => {
|
||||||
|
|||||||
@@ -381,6 +381,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
switchPreview={config.editor.switchPreview}
|
switchPreview={config.editor.switchPreview}
|
||||||
enableMarkdownLint={config.editor.enableMarkdownLint}
|
enableMarkdownLint={config.editor.enableMarkdownLint}
|
||||||
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
|
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
|
||||||
|
dateFormatISO8601={config.editor.dateFormatISO8601}
|
||||||
prettierConfig={config.editor.prettierConfig}
|
prettierConfig={config.editor.prettierConfig}
|
||||||
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
|
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
|
||||||
RTL={RTL}
|
RTL={RTL}
|
||||||
|
|||||||
@@ -280,6 +280,7 @@ class MarkdownSplitEditor extends React.Component {
|
|||||||
switchPreview={config.editor.switchPreview}
|
switchPreview={config.editor.switchPreview}
|
||||||
enableMarkdownLint={config.editor.enableMarkdownLint}
|
enableMarkdownLint={config.editor.enableMarkdownLint}
|
||||||
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
|
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
|
||||||
|
dateFormatISO8601={config.editor.dateFormatISO8601}
|
||||||
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
|
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
|
||||||
RTL={RTL}
|
RTL={RTL}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -870,6 +870,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
enableSmartPaste={config.editor.enableSmartPaste}
|
enableSmartPaste={config.editor.enableSmartPaste}
|
||||||
hotkey={config.hotkey}
|
hotkey={config.hotkey}
|
||||||
autoDetect={autoDetect}
|
autoDetect={autoDetect}
|
||||||
|
dateFormatISO8601={config.editor.dateFormatISO8601}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ export const DEFAULT_CONFIG = {
|
|||||||
enableSmartPaste: false,
|
enableSmartPaste: false,
|
||||||
enableMarkdownLint: false,
|
enableMarkdownLint: false,
|
||||||
customMarkdownLintConfig: DEFAULT_MARKDOWN_LINT_CONFIG,
|
customMarkdownLintConfig: DEFAULT_MARKDOWN_LINT_CONFIG,
|
||||||
|
dateFormatISO8601: false,
|
||||||
prettierConfig: `{
|
prettierConfig: `{
|
||||||
"trailingComma": "es5",
|
"trailingComma": "es5",
|
||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ class UiTab extends React.Component {
|
|||||||
customMarkdownLintConfig: this.customMarkdownLintConfigCM
|
customMarkdownLintConfig: this.customMarkdownLintConfigCM
|
||||||
.getCodeMirror()
|
.getCodeMirror()
|
||||||
.getValue(),
|
.getValue(),
|
||||||
|
dateFormatISO8601: this.refs.dateFormatISO8601.checked,
|
||||||
prettierConfig: this.prettierConfigCM.getCodeMirror().getValue(),
|
prettierConfig: this.prettierConfigCM.getCodeMirror().getValue(),
|
||||||
deleteUnusedAttachments: this.refs.deleteUnusedAttachments.checked,
|
deleteUnusedAttachments: this.refs.deleteUnusedAttachments.checked,
|
||||||
rtlEnabled: this.refs.rtlEnabled.checked
|
rtlEnabled: this.refs.rtlEnabled.checked
|
||||||
@@ -875,6 +876,19 @@ class UiTab extends React.Component {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div styleName='group-checkBoxSection'>
|
||||||
|
<label>
|
||||||
|
<input
|
||||||
|
onChange={e => this.handleUIChange(e)}
|
||||||
|
checked={this.state.config.editor.dateFormatISO8601}
|
||||||
|
ref='dateFormatISO8601'
|
||||||
|
type='checkbox'
|
||||||
|
/>
|
||||||
|
|
||||||
|
{i18n.__('Date shortcut use iso 8601 format')}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
{i18n.__('Matching character pairs')}
|
{i18n.__('Matching character pairs')}
|
||||||
|
|||||||
Reference in New Issue
Block a user