mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +00:00
Compare commits
224 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b9cf775ff | ||
|
|
56879924bd | ||
|
|
6142f2d641 | ||
|
|
0d53f799b7 | ||
|
|
65e77e9669 | ||
|
|
2c8f3b56ae | ||
|
|
8ab190affc | ||
|
|
4fcc9af933 | ||
|
|
e2b4ac6ee8 | ||
|
|
c151049cc2 | ||
|
|
ac778d3f65 | ||
|
|
1aed0cb4b9 | ||
|
|
5836b65aad | ||
|
|
46f750efba | ||
|
|
b33c9e23ce | ||
|
|
14694f1cb0 | ||
|
|
75575348cd | ||
|
|
f6ad0a235c | ||
|
|
bbf6c60888 | ||
|
|
f5915f3e10 | ||
|
|
c90a878c9e | ||
|
|
6943b06a88 | ||
|
|
27a9def88c | ||
|
|
254c8816f1 | ||
|
|
0dfb14962a | ||
|
|
d493df4295 | ||
|
|
90f21f4ed1 | ||
|
|
646ebe592e | ||
|
|
b098a15e9c | ||
|
|
9590559b81 | ||
|
|
24bd2eddf1 | ||
|
|
f4ba06c401 | ||
|
|
cd405d1df9 | ||
|
|
9d6dbc1a6f | ||
|
|
6d57712fca | ||
|
|
080448af3a | ||
|
|
6e2272d043 | ||
|
|
71078dea4f | ||
|
|
333f0be879 | ||
|
|
3b0f664a3b | ||
|
|
2a23d19321 | ||
|
|
5ee4237510 | ||
|
|
bdb906c26d | ||
|
|
02095ac155 | ||
|
|
80d1ca81ac | ||
|
|
3bbabbc80b | ||
|
|
f8ff3d4bf5 | ||
|
|
3a40f9ebd6 | ||
|
|
cf776088e6 | ||
|
|
7ab81608e8 | ||
|
|
017e40fcb9 | ||
|
|
29309fbaa3 | ||
|
|
b766b08bf5 | ||
|
|
e796e00963 | ||
|
|
10136df977 | ||
|
|
44ec107ce8 | ||
|
|
c7fb5b0475 | ||
|
|
785735ccf5 | ||
|
|
f0736ccf8d | ||
|
|
a24a7e03be | ||
|
|
be235e5204 | ||
|
|
57ec598672 | ||
|
|
2627c09cda | ||
|
|
36e63bb8a9 | ||
|
|
5ea24f650b | ||
|
|
8c792ce7a1 | ||
|
|
055969f5c6 | ||
|
|
145ae10a79 | ||
|
|
bdb9349b52 | ||
|
|
8b11b57ec5 | ||
|
|
29888c89ad | ||
|
|
281fb2afd3 | ||
|
|
fbb7839f83 | ||
|
|
d3f9c170ac | ||
|
|
4f9a0b0040 | ||
|
|
aae584106a | ||
|
|
2a784deb4b | ||
|
|
5f5a7880a6 | ||
|
|
ab8b6d806d | ||
|
|
6c4206a2dd | ||
|
|
0d61d9cee4 | ||
|
|
48bdb9e818 | ||
|
|
cfe447a403 | ||
|
|
2c30f0e487 | ||
|
|
147211478c | ||
|
|
35b7674e69 | ||
|
|
55075b2a96 | ||
|
|
6577599959 | ||
|
|
0c4e72e507 | ||
|
|
9bf96e943d | ||
|
|
2811843e70 | ||
|
|
842ece2a8a | ||
|
|
222de03ea3 | ||
|
|
d31ae9f3fc | ||
|
|
1dd7644e12 | ||
|
|
2cee54f70a | ||
|
|
a8431fae96 | ||
|
|
03d11b7b58 | ||
|
|
316e2eeefb | ||
|
|
c21e19337a | ||
|
|
b9cab0dae8 | ||
|
|
33b3299ca2 | ||
|
|
00ba38beba | ||
|
|
433fce286e | ||
|
|
b36322bba4 | ||
|
|
c147e0a789 | ||
|
|
8bf5d02624 | ||
|
|
35616c1ccd | ||
|
|
7c8939ecb8 | ||
|
|
ccb0302d3f | ||
|
|
0cfd048013 | ||
|
|
f72b4f0249 | ||
|
|
b5cb209f14 | ||
|
|
1af374439d | ||
|
|
bbcd674516 | ||
|
|
3cba71b7a8 | ||
|
|
6a1e9c5818 | ||
|
|
ede41d01b4 | ||
|
|
826a67b550 | ||
|
|
f3d59a9b61 | ||
|
|
65434453b8 | ||
|
|
b8658abbad | ||
|
|
0387b33f6c | ||
|
|
41042fe64e | ||
|
|
1efc3bb15d | ||
|
|
0816a9410b | ||
|
|
cb823eaaa6 | ||
|
|
44f027bf18 | ||
|
|
571d159a1f | ||
|
|
a30d977727 | ||
|
|
847ad2d781 | ||
|
|
da9067a672 | ||
|
|
5ed5950ed5 | ||
|
|
f53c182cfb | ||
|
|
bb2978b370 | ||
|
|
66ae4a5163 | ||
|
|
f435595ad8 | ||
|
|
4bec4596fe | ||
|
|
10b86aec49 | ||
|
|
ecabd37cbb | ||
|
|
f3cabfcb4d | ||
|
|
46fc010cf9 | ||
|
|
e370c76521 | ||
|
|
1c283f88d0 | ||
|
|
cfffa1b10a | ||
|
|
8aaae4de49 | ||
|
|
4f6c35713e | ||
|
|
8fb0b5b572 | ||
|
|
12262671ee | ||
|
|
3165c62985 | ||
|
|
1ca1166f74 | ||
|
|
7b4d2f3b97 | ||
|
|
ccce75a047 | ||
|
|
410e82e375 | ||
|
|
bd385ec062 | ||
|
|
638227ef25 | ||
|
|
e70b35126b | ||
|
|
4d41c7f37f | ||
|
|
d01a7b16a1 | ||
|
|
326d873279 | ||
|
|
74c32bed29 | ||
|
|
a222fd0786 | ||
|
|
c633ba9497 | ||
|
|
40b5472866 | ||
|
|
a413e273ca | ||
|
|
0f82085cae | ||
|
|
fa1ab04409 | ||
|
|
f370508c93 | ||
|
|
7472019422 | ||
|
|
aa3597881a | ||
|
|
a36841e501 | ||
|
|
fe9afc8952 | ||
|
|
63d39a81aa | ||
|
|
b11dc2ca20 | ||
|
|
10f5ad6127 | ||
|
|
4800a88cf6 | ||
|
|
9d8bc40594 | ||
|
|
7d3d96a6e0 | ||
|
|
4c99429d76 | ||
|
|
96fbd7572c | ||
|
|
b012bba6d6 | ||
|
|
45d90b2530 | ||
|
|
a8b946a07a | ||
|
|
18392c4f23 | ||
|
|
88e7869284 | ||
|
|
3c8332c448 | ||
|
|
207f95693a | ||
|
|
de15120bf8 | ||
|
|
1dcf11e1c4 | ||
|
|
b74ba22c44 | ||
|
|
fa2d34dcfc | ||
|
|
0280a5f09e | ||
|
|
a35f876f4f | ||
|
|
c22b7f81c1 | ||
|
|
9344fd78d8 | ||
|
|
e89c0a3e61 | ||
|
|
5aa7ef5738 | ||
|
|
88ac6c6fc6 | ||
|
|
a537f9762b | ||
|
|
aab192223a | ||
|
|
6439810d03 | ||
|
|
c5c78763d1 | ||
|
|
012908e32d | ||
|
|
1f1e545538 | ||
|
|
5b8519b2b8 | ||
|
|
6502158716 | ||
|
|
7c525ab7a6 | ||
|
|
778e3d9799 | ||
|
|
e5f986a959 | ||
|
|
d76ecd5423 | ||
|
|
6bcb6398f8 | ||
|
|
6c341d8fa5 | ||
|
|
0d5e57eeab | ||
|
|
aef603ed8c | ||
|
|
97600e526b | ||
|
|
f3f6095d81 | ||
|
|
fb7280127c | ||
|
|
9473a26892 | ||
|
|
e5825e898d | ||
|
|
8d59bd9f71 | ||
|
|
a3ec6f470a | ||
|
|
8e85a33dac | ||
|
|
1769dd959e | ||
|
|
1253b81a01 |
2
.babelrc
2
.babelrc
@@ -5,7 +5,7 @@
|
|||||||
"presets": ["react-hmre"]
|
"presets": ["react-hmre"]
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"presets": ["react", "es2015"],
|
"presets": ["env" ,"react", "es2015"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
[ "babel-plugin-webpack-alias", { "config": "${PWD}/webpack.config.js" } ]
|
[ "babel-plugin-webpack-alias", { "config": "${PWD}/webpack.config.js" } ]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
"lineNumber": true
|
"lineNumber": true
|
||||||
},
|
},
|
||||||
"sortBy": "UPDATED_AT",
|
"sortBy": "UPDATED_AT",
|
||||||
|
"sortTagsBy": "ALPHABETICAL",
|
||||||
"ui": {
|
"ui": {
|
||||||
"defaultNote": "ALWAYS_ASK",
|
"defaultNote": "ALWAYS_ASK",
|
||||||
"disableDirectWrite": false,
|
"disableDirectWrite": false,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
compiled/
|
compiled/
|
||||||
dist/
|
dist/
|
||||||
|
extra_scripts/
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
"plugins": ["react"],
|
"plugins": ["react"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-useless-escape": 0,
|
"no-useless-escape": 0,
|
||||||
"prefer-const": "warn",
|
"prefer-const": ["warn", {
|
||||||
|
"destructuring": "all"
|
||||||
|
}],
|
||||||
"no-unused-vars": "warn",
|
"no-unused-vars": "warn",
|
||||||
"no-undef": "warn",
|
"no-undef": "warn",
|
||||||
"no-lone-blocks": "warn",
|
"no-lone-blocks": "warn",
|
||||||
|
|||||||
7
__mocks__/electron.js
Normal file
7
__mocks__/electron.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
require: jest.genMockFunction(),
|
||||||
|
match: jest.genMockFunction(),
|
||||||
|
app: jest.genMockFunction(),
|
||||||
|
remote: jest.genMockFunction(),
|
||||||
|
dialog: jest.genMockFunction()
|
||||||
|
}
|
||||||
@@ -8,10 +8,14 @@ import copyImage from 'browser/main/lib/dataApi/copyImage'
|
|||||||
import { findStorage } from 'browser/lib/findStorage'
|
import { findStorage } from 'browser/lib/findStorage'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
|
import iconv from 'iconv-lite'
|
||||||
|
const { ipcRenderer } = require('electron')
|
||||||
|
|
||||||
CodeMirror.modeURL = '../node_modules/codemirror/mode/%N/%N.js'
|
CodeMirror.modeURL = '../node_modules/codemirror/mode/%N/%N.js'
|
||||||
|
|
||||||
const defaultEditorFontFamily = ['Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'monospace']
|
const defaultEditorFontFamily = ['Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'monospace']
|
||||||
|
const buildCMRulers = (rulers, enableRulers) =>
|
||||||
|
enableRulers ? rulers.map(ruler => ({ column: ruler })) : []
|
||||||
|
|
||||||
function pass (name) {
|
function pass (name) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
@@ -32,8 +36,13 @@ export default class CodeEditor extends React.Component {
|
|||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
|
this.scrollHandler = _.debounce(this.handleScroll.bind(this), 100, {leading: false, trailing: true})
|
||||||
this.changeHandler = (e) => this.handleChange(e)
|
this.changeHandler = (e) => this.handleChange(e)
|
||||||
|
this.focusHandler = () => {
|
||||||
|
ipcRenderer.send('editor:focused', true)
|
||||||
|
}
|
||||||
this.blurHandler = (editor, e) => {
|
this.blurHandler = (editor, e) => {
|
||||||
|
ipcRenderer.send('editor:focused', false)
|
||||||
if (e == null) return null
|
if (e == null) return null
|
||||||
let el = e.relatedTarget
|
let el = e.relatedTarget
|
||||||
while (el != null) {
|
while (el != null) {
|
||||||
@@ -81,13 +90,14 @@ export default class CodeEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.scrollHandler = _.debounce(this.handleScroll.bind(this), 100, {leading: false, trailing: true})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
|
const { rulers, enableRulers } = this.props
|
||||||
this.value = this.props.value
|
this.value = this.props.value
|
||||||
|
|
||||||
this.editor = CodeMirror(this.refs.root, {
|
this.editor = CodeMirror(this.refs.root, {
|
||||||
|
rulers: buildCMRulers(rulers, enableRulers),
|
||||||
value: this.props.value,
|
value: this.props.value,
|
||||||
lineNumbers: this.props.displayLineNumbers,
|
lineNumbers: this.props.displayLineNumbers,
|
||||||
lineWrapping: true,
|
lineWrapping: true,
|
||||||
@@ -99,6 +109,8 @@ export default class CodeEditor extends React.Component {
|
|||||||
scrollPastEnd: this.props.scrollPastEnd,
|
scrollPastEnd: this.props.scrollPastEnd,
|
||||||
inputStyle: 'textarea',
|
inputStyle: 'textarea',
|
||||||
dragDrop: false,
|
dragDrop: false,
|
||||||
|
foldGutter: true,
|
||||||
|
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
|
||||||
autoCloseBrackets: true,
|
autoCloseBrackets: true,
|
||||||
extraKeys: {
|
extraKeys: {
|
||||||
Tab: function (cm) {
|
Tab: function (cm) {
|
||||||
@@ -139,6 +151,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
|
|
||||||
this.setMode(this.props.mode)
|
this.setMode(this.props.mode)
|
||||||
|
|
||||||
|
this.editor.on('focus', this.focusHandler)
|
||||||
this.editor.on('blur', this.blurHandler)
|
this.editor.on('blur', this.blurHandler)
|
||||||
this.editor.on('change', this.changeHandler)
|
this.editor.on('change', this.changeHandler)
|
||||||
this.editor.on('paste', this.pasteHandler)
|
this.editor.on('paste', this.pasteHandler)
|
||||||
@@ -162,6 +175,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
|
this.editor.off('focus', this.focusHandler)
|
||||||
this.editor.off('blur', this.blurHandler)
|
this.editor.off('blur', this.blurHandler)
|
||||||
this.editor.off('change', this.changeHandler)
|
this.editor.off('change', this.changeHandler)
|
||||||
this.editor.off('paste', this.pasteHandler)
|
this.editor.off('paste', this.pasteHandler)
|
||||||
@@ -173,6 +187,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
|
|
||||||
componentDidUpdate (prevProps, prevState) {
|
componentDidUpdate (prevProps, prevState) {
|
||||||
let needRefresh = false
|
let needRefresh = false
|
||||||
|
const { rulers, enableRulers } = this.props
|
||||||
if (prevProps.mode !== this.props.mode) {
|
if (prevProps.mode !== this.props.mode) {
|
||||||
this.setMode(this.props.mode)
|
this.setMode(this.props.mode)
|
||||||
}
|
}
|
||||||
@@ -190,6 +205,10 @@ export default class CodeEditor extends React.Component {
|
|||||||
needRefresh = true
|
needRefresh = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (prevProps.enableRulers !== enableRulers || prevProps.rulers !== rulers) {
|
||||||
|
this.editor.setOption('rulers', buildCMRulers(rulers, enableRulers))
|
||||||
|
}
|
||||||
|
|
||||||
if (prevProps.indentSize !== this.props.indentSize) {
|
if (prevProps.indentSize !== this.props.indentSize) {
|
||||||
this.editor.setOption('indentUnit', this.props.indentSize)
|
this.editor.setOption('indentUnit', this.props.indentSize)
|
||||||
this.editor.setOption('tabSize', this.props.indentSize)
|
this.editor.setOption('tabSize', this.props.indentSize)
|
||||||
@@ -258,11 +277,16 @@ export default class CodeEditor extends React.Component {
|
|||||||
|
|
||||||
handleDropImage (e) {
|
handleDropImage (e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
const imagePath = e.dataTransfer.files[0].path
|
const ValidImageTypes = ['image/gif', 'image/jpeg', 'image/png']
|
||||||
const filename = path.basename(imagePath)
|
|
||||||
|
|
||||||
copyImage(imagePath, this.props.storageKey).then((imagePath) => {
|
const file = e.dataTransfer.files[0]
|
||||||
const imageMd = `})`
|
const filePath = file.path
|
||||||
|
const filename = path.basename(filePath)
|
||||||
|
const fileType = file['type']
|
||||||
|
|
||||||
|
copyImage(filePath, this.props.storageKey).then((imagePath) => {
|
||||||
|
var showPreview = ValidImageTypes.indexOf(fileType) > 0
|
||||||
|
const imageMd = `${showPreview ? '!' : ''}[${filename}](${path.join('/:storage', imagePath)})`
|
||||||
this.insertImageMd(imageMd)
|
this.insertImageMd(imageMd)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -279,6 +303,19 @@ export default class CodeEditor extends React.Component {
|
|||||||
const matcher = /^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/
|
const matcher = /^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/
|
||||||
return matcher.test(str)
|
return matcher.test(str)
|
||||||
}
|
}
|
||||||
|
const isInLinkTag = (editor) => {
|
||||||
|
const startCursor = editor.getCursor('start')
|
||||||
|
const prevChar = editor.getRange(
|
||||||
|
{ line: startCursor.line, ch: startCursor.ch - 2 },
|
||||||
|
{ line: startCursor.line, ch: startCursor.ch }
|
||||||
|
)
|
||||||
|
const endCursor = editor.getCursor('end')
|
||||||
|
const nextChar = editor.getRange(
|
||||||
|
{ line: endCursor.line, ch: endCursor.ch },
|
||||||
|
{ line: endCursor.line, ch: endCursor.ch + 1 }
|
||||||
|
)
|
||||||
|
return prevChar === '](' && nextChar === ')'
|
||||||
|
}
|
||||||
if (dataTransferItem.type.match('image')) {
|
if (dataTransferItem.type.match('image')) {
|
||||||
const blob = dataTransferItem.getAsFile()
|
const blob = dataTransferItem.getAsFile()
|
||||||
const reader = new FileReader()
|
const reader = new FileReader()
|
||||||
@@ -298,7 +335,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
const imageMd = `})`
|
const imageMd = `})`
|
||||||
this.insertImageMd(imageMd)
|
this.insertImageMd(imageMd)
|
||||||
}
|
}
|
||||||
} else if (this.props.fetchUrlTitle && isURL(pastedTxt)) {
|
} else if (this.props.fetchUrlTitle && isURL(pastedTxt) && !isInLinkTag(editor)) {
|
||||||
this.handlePasteUrl(e, editor, pastedTxt)
|
this.handlePasteUrl(e, editor, pastedTxt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -317,7 +354,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
fetch(pastedTxt, {
|
fetch(pastedTxt, {
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
return (response.text())
|
return this.decodeResponse(response)
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
const parsedResponse = (new window.DOMParser()).parseFromString(response, 'text/html')
|
const parsedResponse = (new window.DOMParser()).parseFromString(response, 'text/html')
|
||||||
const value = editor.getValue()
|
const value = editor.getValue()
|
||||||
@@ -335,6 +372,31 @@ export default class CodeEditor extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
decodeResponse (response) {
|
||||||
|
const headers = response.headers
|
||||||
|
const _charset = headers.has('content-type')
|
||||||
|
? this.extractContentTypeCharset(headers.get('content-type'))
|
||||||
|
: undefined
|
||||||
|
return response.arrayBuffer().then((buff) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
try {
|
||||||
|
const charset = _charset !== undefined && iconv.encodingExists(_charset) ? _charset : 'utf-8'
|
||||||
|
resolve(iconv.decode(new Buffer(buff), charset).toString())
|
||||||
|
} catch (e) {
|
||||||
|
reject(e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
extractContentTypeCharset (contentType) {
|
||||||
|
return contentType.split(';').filter((str) => {
|
||||||
|
return str.trim().toLowerCase().startsWith('charset')
|
||||||
|
}).map((str) => {
|
||||||
|
return str.replace(/['"]/g, '').split('=')[1]
|
||||||
|
})[0]
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { className, fontSize } = this.props
|
const { className, fontSize } = this.props
|
||||||
let fontFamily = this.props.fontFamily
|
let fontFamily = this.props.fontFamily
|
||||||
@@ -361,6 +423,8 @@ export default class CodeEditor extends React.Component {
|
|||||||
|
|
||||||
CodeEditor.propTypes = {
|
CodeEditor.propTypes = {
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
|
enableRulers: PropTypes.bool,
|
||||||
|
rulers: PropTypes.arrayOf(Number),
|
||||||
mode: PropTypes.string,
|
mode: PropTypes.string,
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
onBlur: PropTypes.func,
|
onBlur: PropTypes.func,
|
||||||
|
|||||||
@@ -258,6 +258,8 @@ class MarkdownEditor extends React.Component {
|
|||||||
fontSize={editorFontSize}
|
fontSize={editorFontSize}
|
||||||
indentType={config.editor.indentType}
|
indentType={config.editor.indentType}
|
||||||
indentSize={editorIndentSize}
|
indentSize={editorIndentSize}
|
||||||
|
enableRulers={config.editor.enableRulers}
|
||||||
|
rulers={config.editor.rulers}
|
||||||
displayLineNumbers={config.editor.displayLineNumbers}
|
displayLineNumbers={config.editor.displayLineNumbers}
|
||||||
scrollPastEnd={config.editor.scrollPastEnd}
|
scrollPastEnd={config.editor.scrollPastEnd}
|
||||||
storageKey={storageKey}
|
storageKey={storageKey}
|
||||||
@@ -279,6 +281,8 @@ class MarkdownEditor extends React.Component {
|
|||||||
lineNumber={config.preview.lineNumber}
|
lineNumber={config.preview.lineNumber}
|
||||||
indentSize={editorIndentSize}
|
indentSize={editorIndentSize}
|
||||||
scrollPastEnd={config.preview.scrollPastEnd}
|
scrollPastEnd={config.preview.scrollPastEnd}
|
||||||
|
smartQuotes={config.preview.smartQuotes}
|
||||||
|
sanitize={config.preview.sanitize}
|
||||||
ref='preview'
|
ref='preview'
|
||||||
onContextMenu={(e) => this.handleContextMenu(e)}
|
onContextMenu={(e) => this.handleContextMenu(e)}
|
||||||
onDoubleClick={(e) => this.handleDoubleClick(e)}
|
onDoubleClick={(e) => this.handleDoubleClick(e)}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import markdown from 'browser/lib/markdown'
|
import Markdown from 'browser/lib/markdown'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import CodeMirror from 'codemirror'
|
import CodeMirror from 'codemirror'
|
||||||
import 'codemirror-mode-elixir'
|
import 'codemirror-mode-elixir'
|
||||||
@@ -13,6 +13,7 @@ import htmlTextHelper from 'browser/lib/htmlTextHelper'
|
|||||||
import copy from 'copy-to-clipboard'
|
import copy from 'copy-to-clipboard'
|
||||||
import mdurl from 'mdurl'
|
import mdurl from 'mdurl'
|
||||||
import exportNote from 'browser/main/lib/dataApi/exportNote'
|
import exportNote from 'browser/main/lib/dataApi/exportNote'
|
||||||
|
import {escapeHtmlCharacters} from 'browser/lib/utils'
|
||||||
|
|
||||||
const { remote } = require('electron')
|
const { remote } = require('electron')
|
||||||
const { app } = remote
|
const { app } = remote
|
||||||
@@ -130,6 +131,16 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
this.printHandler = () => this.handlePrint()
|
this.printHandler = () => this.handlePrint()
|
||||||
|
|
||||||
this.linkClickHandler = this.handlelinkClick.bind(this)
|
this.linkClickHandler = this.handlelinkClick.bind(this)
|
||||||
|
this.initMarkdown = this.initMarkdown.bind(this)
|
||||||
|
this.initMarkdown()
|
||||||
|
}
|
||||||
|
|
||||||
|
initMarkdown () {
|
||||||
|
const { smartQuotes, sanitize } = this.props
|
||||||
|
this.markdown = new Markdown({
|
||||||
|
typographer: smartQuotes,
|
||||||
|
sanitize
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePreviewAnchorClick (e) {
|
handlePreviewAnchorClick (e) {
|
||||||
@@ -198,7 +209,7 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
const {fontFamily, fontSize, codeBlockFontFamily, lineNumber, codeBlockTheme} = this.getStyleParams()
|
const {fontFamily, fontSize, codeBlockFontFamily, lineNumber, codeBlockTheme} = this.getStyleParams()
|
||||||
|
|
||||||
const inlineStyles = buildStyle(fontFamily, fontSize, codeBlockFontFamily, lineNumber, codeBlockTheme, lineNumber)
|
const inlineStyles = buildStyle(fontFamily, fontSize, codeBlockFontFamily, lineNumber, codeBlockTheme, lineNumber)
|
||||||
const body = markdown.render(noteContent)
|
const body = this.markdown.render(escapeHtmlCharacters(noteContent))
|
||||||
const files = [this.GetCodeThemeLink(codeBlockTheme), ...CSS_FILES]
|
const files = [this.GetCodeThemeLink(codeBlockTheme), ...CSS_FILES]
|
||||||
|
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
@@ -216,6 +227,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
|
|
||||||
return `<html>
|
return `<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1">
|
||||||
<style id="style">${inlineStyles}</style>
|
<style id="style">${inlineStyles}</style>
|
||||||
${styles}
|
${styles}
|
||||||
</head>
|
</head>
|
||||||
@@ -309,6 +322,10 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
|
|
||||||
componentDidUpdate (prevProps) {
|
componentDidUpdate (prevProps) {
|
||||||
if (prevProps.value !== this.props.value) this.rewriteIframe()
|
if (prevProps.value !== this.props.value) this.rewriteIframe()
|
||||||
|
if (prevProps.smartQuotes !== this.props.smartQuotes || prevProps.sanitize !== this.props.sanitize) {
|
||||||
|
this.initMarkdown()
|
||||||
|
this.rewriteIframe()
|
||||||
|
}
|
||||||
if (prevProps.fontFamily !== this.props.fontFamily ||
|
if (prevProps.fontFamily !== this.props.fontFamily ||
|
||||||
prevProps.fontSize !== this.props.fontSize ||
|
prevProps.fontSize !== this.props.fontSize ||
|
||||||
prevProps.codeBlockFontFamily !== this.props.codeBlockFontFamily ||
|
prevProps.codeBlockFontFamily !== this.props.codeBlockFontFamily ||
|
||||||
@@ -374,10 +391,13 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
value = value.replace(codeBlock, htmlTextHelper.encodeEntities(codeBlock))
|
value = value.replace(codeBlock, htmlTextHelper.encodeEntities(codeBlock))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.refs.root.contentWindow.document.body.innerHTML = markdown.render(value)
|
this.refs.root.contentWindow.document.body.innerHTML = this.markdown.render(value)
|
||||||
|
|
||||||
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('a'), (el) => {
|
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('a'), (el) => {
|
||||||
this.fixDecodedURI(el)
|
this.fixDecodedURI(el)
|
||||||
|
el.href = this.markdown.normalizeLinkText(el.href)
|
||||||
|
if (!/\/:storage/.test(el.href)) return
|
||||||
|
el.href = `file:///${this.markdown.normalizeLinkText(path.join(storagePath, 'images', path.basename(el.href)))}`
|
||||||
el.addEventListener('click', this.anchorClickHandler)
|
el.addEventListener('click', this.anchorClickHandler)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -390,9 +410,9 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
})
|
})
|
||||||
|
|
||||||
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('img'), (el) => {
|
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('img'), (el) => {
|
||||||
el.src = markdown.normalizeLinkText(el.src)
|
el.src = this.markdown.normalizeLinkText(el.src)
|
||||||
if (!/\/:storage/.test(el.src)) return
|
if (!/\/:storage/.test(el.src)) return
|
||||||
el.src = `file:///${markdown.normalizeLinkText(path.join(storagePath, 'images', path.basename(el.src)))}`
|
el.src = `file:///${this.markdown.normalizeLinkText(path.join(storagePath, 'images', path.basename(el.src)))}`
|
||||||
})
|
})
|
||||||
|
|
||||||
codeBlockTheme = consts.THEMES.some((_theme) => _theme === codeBlockTheme)
|
codeBlockTheme = consts.THEMES.some((_theme) => _theme === codeBlockTheme)
|
||||||
@@ -419,9 +439,9 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
el.innerHTML = ''
|
el.innerHTML = ''
|
||||||
if (codeBlockTheme.indexOf('solarized') === 0) {
|
if (codeBlockTheme.indexOf('solarized') === 0) {
|
||||||
const [refThema, color] = codeBlockTheme.split(' ')
|
const [refThema, color] = codeBlockTheme.split(' ')
|
||||||
el.parentNode.className += ` cm-s-${refThema} cm-s-${color} CodeMirror`
|
el.parentNode.className += ` cm-s-${refThema} cm-s-${color}`
|
||||||
} else {
|
} else {
|
||||||
el.parentNode.className += ` cm-s-${codeBlockTheme} CodeMirror`
|
el.parentNode.className += ` cm-s-${codeBlockTheme}`
|
||||||
}
|
}
|
||||||
CodeMirror.runMode(content, syntax.mime, el, {
|
CodeMirror.runMode(content, syntax.mime, el, {
|
||||||
tabSize: indentSize
|
tabSize: indentSize
|
||||||
@@ -504,9 +524,20 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
|
|
||||||
handlelinkClick (e) {
|
handlelinkClick (e) {
|
||||||
const noteHash = e.target.href.split('/').pop()
|
const noteHash = e.target.href.split('/').pop()
|
||||||
const regexIsNoteLink = /^(.{20})-(.{20})$/
|
// this will match the new uuid v4 hash and the old hash
|
||||||
|
// e.g.
|
||||||
|
// :note:1c211eb7dcb463de6490 and
|
||||||
|
// :note:7dd23275-f2b4-49cb-9e93-3454daf1af9c
|
||||||
|
const regexIsNoteLink = /^:note:([a-zA-Z0-9-]{20,36})$/
|
||||||
if (regexIsNoteLink.test(noteHash)) {
|
if (regexIsNoteLink.test(noteHash)) {
|
||||||
eventEmitter.emit('list:jump', noteHash)
|
eventEmitter.emit('list:jump', noteHash.replace(':note:', ''))
|
||||||
|
}
|
||||||
|
// this will match the old link format storage.key-note.key
|
||||||
|
// e.g.
|
||||||
|
// 877f99c3268608328037-1c211eb7dcb463de6490
|
||||||
|
const regexIsLegacyNoteLink = /^(.{20})-(.{20})$/
|
||||||
|
if (regexIsLegacyNoteLink.test(noteHash)) {
|
||||||
|
eventEmitter.emit('list:jump', noteHash.split('-')[1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,5 +564,6 @@ MarkdownPreview.propTypes = {
|
|||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
showCopyNotification: PropTypes.bool,
|
showCopyNotification: PropTypes.bool,
|
||||||
storagePath: PropTypes.string
|
storagePath: PropTypes.string,
|
||||||
|
smartQuotes: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ class MarkdownSplitEditor extends React.Component {
|
|||||||
displayLineNumbers={config.editor.displayLineNumbers}
|
displayLineNumbers={config.editor.displayLineNumbers}
|
||||||
indentType={config.editor.indentType}
|
indentType={config.editor.indentType}
|
||||||
indentSize={editorIndentSize}
|
indentSize={editorIndentSize}
|
||||||
|
enableRulers={config.editor.enableRulers}
|
||||||
|
rulers={config.editor.rulers}
|
||||||
scrollPastEnd={config.editor.scrollPastEnd}
|
scrollPastEnd={config.editor.scrollPastEnd}
|
||||||
fetchUrlTitle={config.editor.fetchUrlTitle}
|
fetchUrlTitle={config.editor.fetchUrlTitle}
|
||||||
storageKey={storageKey}
|
storageKey={storageKey}
|
||||||
@@ -127,6 +129,8 @@ class MarkdownSplitEditor extends React.Component {
|
|||||||
codeBlockFontFamily={config.editor.fontFamily}
|
codeBlockFontFamily={config.editor.fontFamily}
|
||||||
lineNumber={config.preview.lineNumber}
|
lineNumber={config.preview.lineNumber}
|
||||||
scrollPastEnd={config.preview.scrollPastEnd}
|
scrollPastEnd={config.preview.scrollPastEnd}
|
||||||
|
smartQuotes={config.preview.smartQuotes}
|
||||||
|
sanitize={config.preview.sanitize}
|
||||||
ref='preview'
|
ref='preview'
|
||||||
tabInde='0'
|
tabInde='0'
|
||||||
value={value}
|
value={value}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import CSSModules from 'browser/lib/CSSModules'
|
|||||||
import { getTodoStatus } from 'browser/lib/getTodoStatus'
|
import { getTodoStatus } from 'browser/lib/getTodoStatus'
|
||||||
import styles from './NoteItem.styl'
|
import styles from './NoteItem.styl'
|
||||||
import TodoProcess from './TodoProcess'
|
import TodoProcess from './TodoProcess'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Tag element component.
|
* @description Tag element component.
|
||||||
@@ -62,9 +63,9 @@ const NoteItem = ({
|
|||||||
? 'item--active'
|
? 'item--active'
|
||||||
: 'item'
|
: 'item'
|
||||||
}
|
}
|
||||||
key={`${note.storage}-${note.key}`}
|
key={note.key}
|
||||||
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
onClick={e => handleNoteClick(e, note.key)}
|
||||||
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
onContextMenu={e => handleNoteContextMenu(e, note.key)}
|
||||||
onDragStart={e => handleDragStart(e, note)}
|
onDragStart={e => handleDragStart(e, note)}
|
||||||
draggable='true'
|
draggable='true'
|
||||||
>
|
>
|
||||||
@@ -76,7 +77,7 @@ const NoteItem = ({
|
|||||||
<div styleName='item-title'>
|
<div styleName='item-title'>
|
||||||
{note.title.trim().length > 0
|
{note.title.trim().length > 0
|
||||||
? note.title
|
? note.title
|
||||||
: <span styleName='item-title-empty'>Empty</span>
|
: <span styleName='item-title-empty'>{i18n.__('Empty note')}</span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
{['ALL', 'STORAGE'].includes(viewType) && <div styleName='item-middle'>
|
{['ALL', 'STORAGE'].includes(viewType) && <div styleName='item-middle'>
|
||||||
@@ -93,14 +94,14 @@ const NoteItem = ({
|
|||||||
<div styleName='item-bottom-tagList'>
|
<div styleName='item-bottom-tagList'>
|
||||||
{note.tags.length > 0
|
{note.tags.length > 0
|
||||||
? TagElementList(note.tags)
|
? TagElementList(note.tags)
|
||||||
: <span style={{ fontStyle: 'italic', opacity: 0.5 }} styleName='item-bottom-tagList-empty'>No tags</span>
|
: <span style={{ fontStyle: 'italic', opacity: 0.5 }} styleName='item-bottom-tagList-empty'>{i18n.__('No tags')}</span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{note.isStarred
|
{note.isStarred
|
||||||
? <img styleName='item-star' src='../resources/icon/icon-starred.svg' /> : ''
|
? <img styleName='item-star' src='../resources/icon/icon-starred.svg' /> : ''
|
||||||
}
|
}
|
||||||
{note.isPinned && !pathname.match(/\/home|\/starred|\/trash/)
|
{note.isPinned && !pathname.match(/\/starred|\/trash/)
|
||||||
? <i styleName='item-pin' className='fa fa-thumb-tack' /> : ''
|
? <i styleName='item-pin' className='fa fa-thumb-tack' /> : ''
|
||||||
}
|
}
|
||||||
{note.type === 'MARKDOWN_NOTE'
|
{note.type === 'MARKDOWN_NOTE'
|
||||||
@@ -123,7 +124,11 @@ NoteItem.propTypes = {
|
|||||||
title: PropTypes.string.isrequired,
|
title: PropTypes.string.isrequired,
|
||||||
tags: PropTypes.array,
|
tags: PropTypes.array,
|
||||||
isStarred: PropTypes.bool.isRequired,
|
isStarred: PropTypes.bool.isRequired,
|
||||||
isTrashed: PropTypes.bool.isRequired
|
isTrashed: PropTypes.bool.isRequired,
|
||||||
|
blog: {
|
||||||
|
blogLink: PropTypes.string,
|
||||||
|
blogId: PropTypes.number
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
handleNoteClick: PropTypes.func.isRequired,
|
handleNoteClick: PropTypes.func.isRequired,
|
||||||
handleNoteContextMenu: PropTypes.func.isRequired,
|
handleNoteContextMenu: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ $control-height = 30px
|
|||||||
font-size 12px
|
font-size 12px
|
||||||
line-height 20px
|
line-height 20px
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
display flex
|
display block
|
||||||
|
|
||||||
.item-bottom-tagList
|
.item-bottom-tagList
|
||||||
flex 1
|
flex 1
|
||||||
@@ -144,18 +144,18 @@ $control-height = 30px
|
|||||||
padding-bottom 2px
|
padding-bottom 2px
|
||||||
|
|
||||||
.item-star
|
.item-star
|
||||||
position relative
|
position absolute
|
||||||
width 16px
|
right 2px
|
||||||
height 16px
|
top 5px
|
||||||
color alpha($ui-favorite-star-button-color, 60%)
|
color alpha($ui-favorite-star-button-color, 60%)
|
||||||
font-size 12px
|
font-size 12px
|
||||||
padding 0
|
padding 0
|
||||||
border-radius 17px
|
border-radius 17px
|
||||||
|
|
||||||
.item-pin
|
.item-pin
|
||||||
position relative
|
position absolute
|
||||||
width 34px
|
right 25px
|
||||||
height 34px
|
top 7px
|
||||||
color #E54D42
|
color #E54D42
|
||||||
font-size 14px
|
font-size 14px
|
||||||
padding 0
|
padding 0
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './NoteItemSimple.styl'
|
import styles from './NoteItemSimple.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Note item component when using simple display mode.
|
* @description Note item component when using simple display mode.
|
||||||
@@ -28,9 +29,9 @@ const NoteItemSimple = ({
|
|||||||
? 'item-simple--active'
|
? 'item-simple--active'
|
||||||
: 'item-simple'
|
: 'item-simple'
|
||||||
}
|
}
|
||||||
key={`${note.storage}-${note.key}`}
|
key={note.key}
|
||||||
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
onClick={e => handleNoteClick(e, note.key)}
|
||||||
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
onContextMenu={e => handleNoteContextMenu(e, note.key)}
|
||||||
onDragStart={e => handleDragStart(e, note)}
|
onDragStart={e => handleDragStart(e, note)}
|
||||||
draggable='true'
|
draggable='true'
|
||||||
>
|
>
|
||||||
@@ -45,7 +46,7 @@ const NoteItemSimple = ({
|
|||||||
}
|
}
|
||||||
{note.title.trim().length > 0
|
{note.title.trim().length > 0
|
||||||
? note.title
|
? note.title
|
||||||
: <span styleName='item-simple-title-empty'>Empty</span>
|
: <span styleName='item-simple-title-empty'>{i18n.__('Empty note')}</span>
|
||||||
}
|
}
|
||||||
{isAllNotesView && <div styleName='item-simple-right'>
|
{isAllNotesView && <div styleName='item-simple-right'>
|
||||||
<span styleName='item-simple-right-storageName'>
|
<span styleName='item-simple-right-storageName'>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './SideNavFilter.styl'
|
import styles from './SideNavFilter.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} isFolded
|
* @param {boolean} isFolded
|
||||||
@@ -31,7 +32,7 @@ const SideNavFilter = ({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span styleName='menu-button-label'>All Notes</span>
|
<span styleName='menu-button-label'>{i18n.__('All Notes')}</span>
|
||||||
<span styleName='counters'>{counterTotalNote}</span>
|
<span styleName='counters'>{counterTotalNote}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ const SideNavFilter = ({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span styleName='menu-button-label'>Starred</span>
|
<span styleName='menu-button-label'>{i18n.__('Starred')}</span>
|
||||||
<span styleName='counters'>{counterStarredNote}</span>
|
<span styleName='counters'>{counterStarredNote}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -59,7 +60,7 @@ const SideNavFilter = ({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span onContextMenu={handleFilterButtonContextMenu} styleName='menu-button-label'>Trash</span>
|
<span onContextMenu={handleFilterButtonContextMenu} styleName='menu-button-label'>{i18n.__('Trash')}</span>
|
||||||
<span styleName='counters'>{counterDelNote}</span>
|
<span styleName='counters'>{counterDelNote}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React from 'react'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './SnippetTab.styl'
|
import styles from './SnippetTab.styl'
|
||||||
import context from 'browser/lib/context'
|
import context from 'browser/lib/context'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class SnippetTab extends React.Component {
|
class SnippetTab extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -28,7 +29,7 @@ class SnippetTab extends React.Component {
|
|||||||
handleContextMenu (e) {
|
handleContextMenu (e) {
|
||||||
context.popup([
|
context.popup([
|
||||||
{
|
{
|
||||||
label: 'Rename',
|
label: i18n.__('Rename'),
|
||||||
click: (e) => this.handleRenameClick(e)
|
click: (e) => this.handleRenameClick(e)
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -114,7 +115,7 @@ class SnippetTab extends React.Component {
|
|||||||
{snippet.name.trim().length > 0
|
{snippet.name.trim().length > 0
|
||||||
? snippet.name
|
? snippet.name
|
||||||
: <span styleName='button-unnamed'>
|
: <span styleName='button-unnamed'>
|
||||||
Unnamed
|
{i18n.__('Unnamed')}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
.root
|
.root
|
||||||
position relative
|
position relative
|
||||||
flex 1
|
flex 1
|
||||||
|
min-width 70px
|
||||||
overflow hidden
|
overflow hidden
|
||||||
&:hover
|
&:hover
|
||||||
.deleteButton
|
.deleteButton
|
||||||
@@ -21,7 +22,7 @@
|
|||||||
height 29px
|
height 29px
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
text-align left
|
text-align left
|
||||||
padding-right 30px
|
padding-right 23px
|
||||||
border none
|
border none
|
||||||
background-color transparent
|
background-color transparent
|
||||||
transition 0.15s
|
transition 0.15s
|
||||||
|
|||||||
@@ -6,6 +6,18 @@ import React from 'react'
|
|||||||
import styles from './StorageItem.styl'
|
import styles from './StorageItem.styl'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import { SortableHandle } from 'react-sortable-hoc'
|
||||||
|
|
||||||
|
const DraggableIcon = SortableHandle(({ className }) => (
|
||||||
|
<i className={`fa ${className}`} />
|
||||||
|
))
|
||||||
|
|
||||||
|
const FolderIcon = ({ className, color, isActive }) => {
|
||||||
|
const iconStyle = isActive ? 'fa-folder-open-o' : 'fa-folder-o'
|
||||||
|
return (
|
||||||
|
<i className={`fa ${iconStyle} ${className}`} style={{ color: color }} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} isActive
|
* @param {boolean} isActive
|
||||||
@@ -21,34 +33,54 @@ import _ from 'lodash'
|
|||||||
* @return {React.Component}
|
* @return {React.Component}
|
||||||
*/
|
*/
|
||||||
const StorageItem = ({
|
const StorageItem = ({
|
||||||
isActive, handleButtonClick, handleContextMenu, folderName,
|
styles,
|
||||||
folderColor, isFolded, noteCount, handleDrop, handleDragEnter, handleDragLeave
|
isActive,
|
||||||
}) => (
|
handleButtonClick,
|
||||||
<button styleName={isActive
|
handleContextMenu,
|
||||||
? 'folderList-item--active'
|
folderName,
|
||||||
: 'folderList-item'
|
folderColor,
|
||||||
}
|
isFolded,
|
||||||
onClick={handleButtonClick}
|
noteCount,
|
||||||
onContextMenu={handleContextMenu}
|
handleDrop,
|
||||||
onDrop={handleDrop}
|
handleDragEnter,
|
||||||
onDragEnter={handleDragEnter}
|
handleDragLeave
|
||||||
onDragLeave={handleDragLeave}
|
}) => {
|
||||||
>
|
return (
|
||||||
<span styleName={isFolded
|
<button
|
||||||
? 'folderList-item-name--folded' : 'folderList-item-name'
|
styleName={isActive ? 'folderList-item--active' : 'folderList-item'}
|
||||||
}>
|
onClick={handleButtonClick}
|
||||||
<text style={{color: folderColor, paddingRight: '10px'}}>{isActive ? <i className='fa fa-folder-open-o' /> : <i className='fa fa-folder-o' />}</text>{isFolded ? _.truncate(folderName, {length: 1, omission: ''}) : folderName}
|
onContextMenu={handleContextMenu}
|
||||||
</span>
|
onDrop={handleDrop}
|
||||||
{(!isFolded && _.isNumber(noteCount)) &&
|
onDragEnter={handleDragEnter}
|
||||||
<span styleName='folderList-item-noteCount'>{noteCount}</span>
|
onDragLeave={handleDragLeave}
|
||||||
}
|
>
|
||||||
{isFolded &&
|
{!isFolded && (
|
||||||
<span styleName='folderList-item-tooltip'>
|
<DraggableIcon className={styles['folderList-item-reorder']} />
|
||||||
{folderName}
|
)}
|
||||||
|
<span
|
||||||
|
styleName={
|
||||||
|
isFolded ? 'folderList-item-name--folded' : 'folderList-item-name'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<FolderIcon
|
||||||
|
styleName='folderList-item-icon'
|
||||||
|
color={folderColor}
|
||||||
|
isActive={isActive}
|
||||||
|
/>
|
||||||
|
{isFolded
|
||||||
|
? _.truncate(folderName, { length: 1, omission: '' })
|
||||||
|
: folderName}
|
||||||
</span>
|
</span>
|
||||||
}
|
{!isFolded &&
|
||||||
</button>
|
_.isNumber(noteCount) && (
|
||||||
)
|
<span styleName='folderList-item-noteCount'>{noteCount}</span>
|
||||||
|
)}
|
||||||
|
{isFolded && (
|
||||||
|
<span styleName='folderList-item-tooltip'>{folderName}</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
StorageItem.propTypes = {
|
StorageItem.propTypes = {
|
||||||
isActive: PropTypes.bool.isRequired,
|
isActive: PropTypes.bool.isRequired,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
border none
|
border none
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
font-size 14px
|
font-size 14px
|
||||||
|
align-items: center
|
||||||
&:first-child
|
&:first-child
|
||||||
margin-top 0
|
margin-top 0
|
||||||
&:hover
|
&:hover
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
&:active
|
&:active
|
||||||
color $$ui-button-default-color
|
color $$ui-button-default-color
|
||||||
background-color alpha($ui-button-default--active-backgroundColor, 20%)
|
background-color alpha($ui-button-default--active-backgroundColor, 20%)
|
||||||
|
|
||||||
.folderList-item--active
|
.folderList-item--active
|
||||||
@extend .folderList-item
|
@extend .folderList-item
|
||||||
color #1EC38B
|
color #1EC38B
|
||||||
@@ -34,9 +35,7 @@
|
|||||||
.folderList-item-name
|
.folderList-item-name
|
||||||
display block
|
display block
|
||||||
flex 1
|
flex 1
|
||||||
padding 0 12px
|
padding-right: 10px
|
||||||
height 26px
|
|
||||||
line-height 26px
|
|
||||||
border-width 0 0 0 2px
|
border-width 0 0 0 2px
|
||||||
border-style solid
|
border-style solid
|
||||||
border-color transparent
|
border-color transparent
|
||||||
@@ -69,9 +68,20 @@
|
|||||||
.folderList-item-name--folded
|
.folderList-item-name--folded
|
||||||
@extend .folderList-item-name
|
@extend .folderList-item-name
|
||||||
padding-left 7px
|
padding-left 7px
|
||||||
text
|
.folderList-item-icon
|
||||||
font-size 9px
|
font-size 9px
|
||||||
|
|
||||||
|
.folderList-item-icon
|
||||||
|
padding-right: 10px
|
||||||
|
|
||||||
|
.folderList-item-reorder
|
||||||
|
font-size: 9px
|
||||||
|
padding: 10px 8px 10px 9px;
|
||||||
|
color: rgba(147, 147, 149, 0.3)
|
||||||
|
cursor: ns-resize
|
||||||
|
&:before
|
||||||
|
content: "\f142 \f142"
|
||||||
|
|
||||||
body[data-theme="white"]
|
body[data-theme="white"]
|
||||||
.folderList-item
|
.folderList-item
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
@@ -127,4 +137,4 @@ body[data-theme="solarized-dark"]
|
|||||||
background-color $ui-solarized-dark-button-backgroundColor
|
background-color $ui-solarized-dark-button-backgroundColor
|
||||||
&:hover
|
&:hover
|
||||||
color $ui-solarized-dark-text-color
|
color $ui-solarized-dark-text-color
|
||||||
background-color $ui-solarized-dark-button-backgroundColor
|
background-color $ui-solarized-dark-button-backgroundColor
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import CSSModules from 'browser/lib/CSSModules'
|
|||||||
* @param {Array} storgaeList
|
* @param {Array} storgaeList
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const StorageList = ({storageList}) => (
|
const StorageList = ({storageList, isFolded}) => (
|
||||||
<div styleName='storageList'>
|
<div styleName={isFolded ? 'storageList-folded' : 'storageList'}>
|
||||||
{storageList.length > 0 ? storageList : (
|
{storageList.length > 0 ? storageList : (
|
||||||
<div styleName='storgaeList-empty'>No storage mount.</div>
|
<div styleName='storgaeList-empty'>No storage mount.</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
top 180px
|
top 180px
|
||||||
overflow-y auto
|
overflow-y auto
|
||||||
|
|
||||||
|
.storageList-folded
|
||||||
|
@extend .storageList
|
||||||
|
width 44px
|
||||||
|
|
||||||
.storageList-empty
|
.storageList-empty
|
||||||
padding 0 10px
|
padding 0 10px
|
||||||
margin-top 15px
|
margin-top 15px
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ body
|
|||||||
.katex
|
.katex
|
||||||
font 400 1.2em 'KaTeX_Main'
|
font 400 1.2em 'KaTeX_Main'
|
||||||
line-height 1.2em
|
line-height 1.2em
|
||||||
white-space nowrap
|
white-space initial
|
||||||
text-indent 0
|
text-indent 0
|
||||||
.katex .mfrac>.vlist>span:nth-child(2)
|
.katex .mfrac>.vlist>span:nth-child(2)
|
||||||
top 0 !important
|
top 0 !important
|
||||||
|
|||||||
16
browser/lib/i18n.js
Normal file
16
browser/lib/i18n.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
const path = require('path')
|
||||||
|
const { remote } = require('electron')
|
||||||
|
const { app } = remote
|
||||||
|
|
||||||
|
// load package for localization
|
||||||
|
const i18n = new (require('i18n-2'))({
|
||||||
|
// setup some locales - other locales default to the first locale
|
||||||
|
locales: ['en', 'sq', 'zh-CN', 'zh-TW', 'da', 'fr', 'de', 'hu', 'ja', 'ko', 'no', 'pl', 'pt', 'es-ES'],
|
||||||
|
extension: '.json',
|
||||||
|
directory: process.env.NODE_ENV === 'production'
|
||||||
|
? path.join(app.getAppPath(), './locales')
|
||||||
|
: path.resolve('./locales'),
|
||||||
|
devMode: false
|
||||||
|
})
|
||||||
|
|
||||||
|
export default i18n
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
|
const uuidv4 = require('uuid/v4')
|
||||||
|
|
||||||
module.exports = function (length) {
|
module.exports = function (uuid) {
|
||||||
if (!_.isFinite(length)) length = 10
|
if (typeof uuid === typeof true && uuid) {
|
||||||
|
return uuidv4()
|
||||||
|
}
|
||||||
|
const length = 10
|
||||||
return crypto.randomBytes(length).toString('hex')
|
return crypto.randomBytes(length).toString('hex')
|
||||||
}
|
}
|
||||||
|
|||||||
23
browser/lib/markdown-it-sanitize-html.js
Normal file
23
browser/lib/markdown-it-sanitize-html.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
|
import sanitizeHtml from 'sanitize-html'
|
||||||
|
|
||||||
|
module.exports = function sanitizePlugin (md, options) {
|
||||||
|
options = options || {}
|
||||||
|
|
||||||
|
md.core.ruler.after('linkify', 'sanitize_inline', state => {
|
||||||
|
for (let tokenIdx = 0; tokenIdx < state.tokens.length; tokenIdx++) {
|
||||||
|
if (state.tokens[tokenIdx].type === 'html_block') {
|
||||||
|
state.tokens[tokenIdx].content = sanitizeHtml(state.tokens[tokenIdx].content, options)
|
||||||
|
}
|
||||||
|
if (state.tokens[tokenIdx].type === 'inline') {
|
||||||
|
const inlineTokens = state.tokens[tokenIdx].children
|
||||||
|
for (let childIdx = 0; childIdx < inlineTokens.length; childIdx++) {
|
||||||
|
if (inlineTokens[childIdx].type === 'html_inline') {
|
||||||
|
inlineTokens[childIdx].content = sanitizeHtml(inlineTokens[childIdx].content, options)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
import markdownit from 'markdown-it'
|
import markdownit from 'markdown-it'
|
||||||
|
import sanitize from './markdown-it-sanitize-html'
|
||||||
import emoji from 'markdown-it-emoji'
|
import emoji from 'markdown-it-emoji'
|
||||||
import math from '@rokt33r/markdown-it-math'
|
import math from '@rokt33r/markdown-it-math'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
|
import katex from 'katex'
|
||||||
import {lastFindInArray} from './utils'
|
import {lastFindInArray} from './utils'
|
||||||
|
|
||||||
// FIXME We should not depend on global variable.
|
|
||||||
const katex = window.katex
|
|
||||||
const config = ConfigManager.get()
|
|
||||||
|
|
||||||
function createGutter (str, firstLineNumber) {
|
function createGutter (str, firstLineNumber) {
|
||||||
if (Number.isNaN(firstLineNumber)) firstLineNumber = 1
|
if (Number.isNaN(firstLineNumber)) firstLineNumber = 1
|
||||||
const lastLineNumber = (str.match(/\n/g) || []).length + firstLineNumber - 1
|
const lastLineNumber = (str.match(/\n/g) || []).length + firstLineNumber - 1
|
||||||
@@ -19,171 +17,228 @@ function createGutter (str, firstLineNumber) {
|
|||||||
return '<span class="lineNumber CodeMirror-gutters">' + lines.join('') + '</span>'
|
return '<span class="lineNumber CodeMirror-gutters">' + lines.join('') + '</span>'
|
||||||
}
|
}
|
||||||
|
|
||||||
var md = markdownit({
|
class Markdown {
|
||||||
typographer: true,
|
constructor (options = {}) {
|
||||||
linkify: true,
|
const config = ConfigManager.get()
|
||||||
html: true,
|
const defaultOptions = {
|
||||||
xhtmlOut: true,
|
typographer: config.preview.smartQuotes,
|
||||||
breaks: true,
|
linkify: true,
|
||||||
highlight: function (str, lang) {
|
html: true,
|
||||||
const delimiter = ':'
|
xhtmlOut: true,
|
||||||
const langInfo = lang.split(delimiter)
|
breaks: true,
|
||||||
const langType = langInfo[0]
|
highlight: function (str, lang) {
|
||||||
const fileName = langInfo[1] || ''
|
const delimiter = ':'
|
||||||
const firstLineNumber = parseInt(langInfo[2], 10)
|
const langInfo = lang.split(delimiter)
|
||||||
|
const langType = langInfo[0]
|
||||||
|
const fileName = langInfo[1] || ''
|
||||||
|
const firstLineNumber = parseInt(langInfo[2], 10)
|
||||||
|
|
||||||
if (langType === 'flowchart') {
|
if (langType === 'flowchart') {
|
||||||
return `<pre class="flowchart">${str}</pre>`
|
return `<pre class="flowchart">${str}</pre>`
|
||||||
}
|
|
||||||
if (langType === 'sequence') {
|
|
||||||
return `<pre class="sequence">${str}</pre>`
|
|
||||||
}
|
|
||||||
return '<pre class="code">' +
|
|
||||||
'<span class="filename">' + fileName + '</span>' +
|
|
||||||
createGutter(str, firstLineNumber) +
|
|
||||||
'<code class="' + langType + '">' +
|
|
||||||
str +
|
|
||||||
'</code></pre>'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
md.use(emoji, {
|
|
||||||
shortcuts: {}
|
|
||||||
})
|
|
||||||
md.use(math, {
|
|
||||||
inlineOpen: config.preview.latexInlineOpen,
|
|
||||||
inlineClose: config.preview.latexInlineClose,
|
|
||||||
blockOpen: config.preview.latexBlockOpen,
|
|
||||||
blockClose: config.preview.latexBlockClose,
|
|
||||||
inlineRenderer: function (str) {
|
|
||||||
let output = ''
|
|
||||||
try {
|
|
||||||
output = katex.renderToString(str.trim())
|
|
||||||
} catch (err) {
|
|
||||||
output = `<span class="katex-error">${err.message}</span>`
|
|
||||||
}
|
|
||||||
return output
|
|
||||||
},
|
|
||||||
blockRenderer: function (str) {
|
|
||||||
let output = ''
|
|
||||||
try {
|
|
||||||
output = katex.renderToString(str.trim(), { displayMode: true })
|
|
||||||
} catch (err) {
|
|
||||||
output = `<div class="katex-error">${err.message}</div>`
|
|
||||||
}
|
|
||||||
return output
|
|
||||||
}
|
|
||||||
})
|
|
||||||
md.use(require('markdown-it-imsize'))
|
|
||||||
md.use(require('markdown-it-footnote'))
|
|
||||||
md.use(require('markdown-it-multimd-table'))
|
|
||||||
md.use(require('markdown-it-named-headers'), {
|
|
||||||
slugify: (header) => {
|
|
||||||
return encodeURI(header.trim()
|
|
||||||
.replace(/[\]\[\!\"\#\$\%\&\'\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~]/g, '')
|
|
||||||
.replace(/\s+/g, '-'))
|
|
||||||
.replace(/\-+$/, '')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
md.use(require('markdown-it-kbd'))
|
|
||||||
|
|
||||||
const deflate = require('markdown-it-plantuml/lib/deflate')
|
|
||||||
md.use(require('markdown-it-plantuml'), '', {
|
|
||||||
generateSource: function (umlCode) {
|
|
||||||
const s = unescape(encodeURIComponent(umlCode))
|
|
||||||
const zippedCode = deflate.encode64(
|
|
||||||
deflate.zip_deflate(`@startuml\n${s}\n@enduml`, 9)
|
|
||||||
)
|
|
||||||
return `http://www.plantuml.com/plantuml/svg/${zippedCode}`
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Override task item
|
|
||||||
md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) {
|
|
||||||
let content, terminate, i, l, token
|
|
||||||
let nextLine = startLine + 1
|
|
||||||
const terminatorRules = state.md.block.ruler.getRules('paragraph')
|
|
||||||
const endLine = state.lineMax
|
|
||||||
|
|
||||||
// jump line-by-line until empty one or EOF
|
|
||||||
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
|
||||||
// this would be a code block normally, but after paragraph
|
|
||||||
// it's considered a lazy continuation regardless of what's there
|
|
||||||
if (state.sCount[nextLine] - state.blkIndent > 3) { continue }
|
|
||||||
|
|
||||||
// quirk for blockquotes, this line should already be checked by that rule
|
|
||||||
if (state.sCount[nextLine] < 0) { continue }
|
|
||||||
|
|
||||||
// Some tags can terminate paragraph without empty line.
|
|
||||||
terminate = false
|
|
||||||
for (i = 0, l = terminatorRules.length; i < l; i++) {
|
|
||||||
if (terminatorRules[i](state, nextLine, endLine, true)) {
|
|
||||||
terminate = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (terminate) { break }
|
|
||||||
}
|
|
||||||
|
|
||||||
content = state.getLines(startLine, nextLine, state.blkIndent, false).trim()
|
|
||||||
|
|
||||||
state.line = nextLine
|
|
||||||
|
|
||||||
token = state.push('paragraph_open', 'p', 1)
|
|
||||||
token.map = [startLine, state.line]
|
|
||||||
|
|
||||||
if (state.parentType === 'list') {
|
|
||||||
const match = content.match(/^\[( |x)\] ?(.+)/i)
|
|
||||||
if (match) {
|
|
||||||
const liToken = lastFindInArray(state.tokens, token => token.type === 'list_item_open')
|
|
||||||
if (liToken) {
|
|
||||||
if (!liToken.attrs) {
|
|
||||||
liToken.attrs = []
|
|
||||||
}
|
}
|
||||||
liToken.attrs.push(['class', 'taskListItem'])
|
if (langType === 'sequence') {
|
||||||
}
|
return `<pre class="sequence">${str}</pre>`
|
||||||
content = `<label class='taskListItem${match[1] !== ' ' ? ' checked' : ''}' for='checkbox-${startLine + 1}'><input type='checkbox'${match[1] !== ' ' ? ' checked' : ''} id='checkbox-${startLine + 1}'/> ${content.substring(4, content.length)}</label>`
|
}
|
||||||
|
return '<pre class="code CodeMirror">' +
|
||||||
|
'<span class="filename">' + fileName + '</span>' +
|
||||||
|
createGutter(str, firstLineNumber) +
|
||||||
|
'<code class="' + langType + '">' +
|
||||||
|
str +
|
||||||
|
'</code></pre>'
|
||||||
|
},
|
||||||
|
sanitize: 'STRICT'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const updatedOptions = Object.assign(defaultOptions, options)
|
||||||
|
this.md = markdownit(updatedOptions)
|
||||||
|
|
||||||
|
if (updatedOptions.sanitize !== 'NONE') {
|
||||||
|
const allowedTags = ['iframe', 'input', 'b',
|
||||||
|
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'h8', 'br', 'b', 'i', 'strong', 'em', 'a', 'pre', 'code', 'img', 'tt',
|
||||||
|
'div', 'ins', 'del', 'sup', 'sub', 'p', 'ol', 'ul', 'table', 'thead', 'tbody', 'tfoot', 'blockquote',
|
||||||
|
'dl', 'dt', 'dd', 'kbd', 'q', 'samp', 'var', 'hr', 'ruby', 'rt', 'rp', 'li', 'tr', 'td', 'th', 's', 'strike', 'summary', 'details'
|
||||||
|
]
|
||||||
|
const allowedAttributes = [
|
||||||
|
'abbr', 'accept', 'accept-charset',
|
||||||
|
'accesskey', 'action', 'align', 'alt', 'axis',
|
||||||
|
'border', 'cellpadding', 'cellspacing', 'char',
|
||||||
|
'charoff', 'charset', 'checked',
|
||||||
|
'clear', 'cols', 'colspan', 'color',
|
||||||
|
'compact', 'coords', 'datetime', 'dir',
|
||||||
|
'disabled', 'enctype', 'for', 'frame',
|
||||||
|
'headers', 'height', 'hreflang',
|
||||||
|
'hspace', 'ismap', 'label', 'lang',
|
||||||
|
'maxlength', 'media', 'method',
|
||||||
|
'multiple', 'name', 'nohref', 'noshade',
|
||||||
|
'nowrap', 'open', 'prompt', 'readonly', 'rel', 'rev',
|
||||||
|
'rows', 'rowspan', 'rules', 'scope',
|
||||||
|
'selected', 'shape', 'size', 'span',
|
||||||
|
'start', 'summary', 'tabindex', 'target',
|
||||||
|
'title', 'type', 'usemap', 'valign', 'value',
|
||||||
|
'vspace', 'width', 'itemprop'
|
||||||
|
]
|
||||||
|
|
||||||
|
if (updatedOptions.sanitize === 'ALLOW_STYLES') {
|
||||||
|
allowedTags.push('style')
|
||||||
|
allowedAttributes.push('style')
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sanitize use rinput before other plugins
|
||||||
|
this.md.use(sanitize, {
|
||||||
|
allowedTags,
|
||||||
|
allowedAttributes: {
|
||||||
|
'*': allowedAttributes,
|
||||||
|
'a': ['href'],
|
||||||
|
'div': ['itemscope', 'itemtype'],
|
||||||
|
'blockquote': ['cite'],
|
||||||
|
'del': ['cite'],
|
||||||
|
'ins': ['cite'],
|
||||||
|
'q': ['cite'],
|
||||||
|
'img': ['src', 'width', 'height'],
|
||||||
|
'iframe': ['src', 'width', 'height', 'frameborder', 'allowfullscreen'],
|
||||||
|
'input': ['type', 'id', 'checked']
|
||||||
|
},
|
||||||
|
allowedIframeHostnames: ['www.youtube.com']
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
this.md.use(emoji, {
|
||||||
|
shortcuts: {}
|
||||||
|
})
|
||||||
|
this.md.use(math, {
|
||||||
|
inlineOpen: config.preview.latexInlineOpen,
|
||||||
|
inlineClose: config.preview.latexInlineClose,
|
||||||
|
blockOpen: config.preview.latexBlockOpen,
|
||||||
|
blockClose: config.preview.latexBlockClose,
|
||||||
|
inlineRenderer: function (str) {
|
||||||
|
let output = ''
|
||||||
|
try {
|
||||||
|
output = katex.renderToString(str.trim())
|
||||||
|
} catch (err) {
|
||||||
|
output = `<span class="katex-error">${err.message}</span>`
|
||||||
|
}
|
||||||
|
return output
|
||||||
|
},
|
||||||
|
blockRenderer: function (str) {
|
||||||
|
let output = ''
|
||||||
|
try {
|
||||||
|
output = katex.renderToString(str.trim(), { displayMode: true })
|
||||||
|
} catch (err) {
|
||||||
|
output = `<div class="katex-error">${err.message}</div>`
|
||||||
|
}
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.md.use(require('markdown-it-imsize'))
|
||||||
|
this.md.use(require('markdown-it-footnote'))
|
||||||
|
this.md.use(require('markdown-it-multimd-table'))
|
||||||
|
this.md.use(require('markdown-it-named-headers'), {
|
||||||
|
slugify: (header) => {
|
||||||
|
return encodeURI(header.trim()
|
||||||
|
.replace(/[\]\[\!\"\#\$\%\&\'\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~]/g, '')
|
||||||
|
.replace(/\s+/g, '-'))
|
||||||
|
.replace(/\-+$/, '')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.md.use(require('markdown-it-kbd'))
|
||||||
|
|
||||||
|
const deflate = require('markdown-it-plantuml/lib/deflate')
|
||||||
|
this.md.use(require('markdown-it-plantuml'), '', {
|
||||||
|
generateSource: function (umlCode) {
|
||||||
|
const s = unescape(encodeURIComponent(umlCode))
|
||||||
|
const zippedCode = deflate.encode64(
|
||||||
|
deflate.zip_deflate(`@startuml\n${s}\n@enduml`, 9)
|
||||||
|
)
|
||||||
|
return `http://www.plantuml.com/plantuml/svg/${zippedCode}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Override task item
|
||||||
|
this.md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) {
|
||||||
|
let content, terminate, i, l, token
|
||||||
|
let nextLine = startLine + 1
|
||||||
|
const terminatorRules = state.md.block.ruler.getRules('paragraph')
|
||||||
|
const endLine = state.lineMax
|
||||||
|
|
||||||
|
// jump line-by-line until empty one or EOF
|
||||||
|
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
||||||
|
// this would be a code block normally, but after paragraph
|
||||||
|
// it's considered a lazy continuation regardless of what's there
|
||||||
|
if (state.sCount[nextLine] - state.blkIndent > 3) { continue }
|
||||||
|
|
||||||
|
// quirk for blockquotes, this line should already be checked by that rule
|
||||||
|
if (state.sCount[nextLine] < 0) { continue }
|
||||||
|
|
||||||
|
// Some tags can terminate paragraph without empty line.
|
||||||
|
terminate = false
|
||||||
|
for (i = 0, l = terminatorRules.length; i < l; i++) {
|
||||||
|
if (terminatorRules[i](state, nextLine, endLine, true)) {
|
||||||
|
terminate = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (terminate) { break }
|
||||||
|
}
|
||||||
|
|
||||||
|
content = state.getLines(startLine, nextLine, state.blkIndent, false).trim()
|
||||||
|
|
||||||
|
state.line = nextLine
|
||||||
|
|
||||||
|
token = state.push('paragraph_open', 'p', 1)
|
||||||
|
token.map = [startLine, state.line]
|
||||||
|
|
||||||
|
if (state.parentType === 'list') {
|
||||||
|
const match = content.match(/^\[( |x)\] ?(.+)/i)
|
||||||
|
if (match) {
|
||||||
|
const liToken = lastFindInArray(state.tokens, token => token.type === 'list_item_open')
|
||||||
|
if (liToken) {
|
||||||
|
if (!liToken.attrs) {
|
||||||
|
liToken.attrs = []
|
||||||
|
}
|
||||||
|
liToken.attrs.push(['class', 'taskListItem'])
|
||||||
|
}
|
||||||
|
content = `<label class='taskListItem${match[1] !== ' ' ? ' checked' : ''}' for='checkbox-${startLine + 1}'><input type='checkbox'${match[1] !== ' ' ? ' checked' : ''} id='checkbox-${startLine + 1}'/> ${content.substring(4, content.length)}</label>`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
token = state.push('inline', '', 0)
|
||||||
|
token.content = content
|
||||||
|
token.map = [startLine, state.line]
|
||||||
|
token.children = []
|
||||||
|
|
||||||
|
token = state.push('paragraph_close', 'p', -1)
|
||||||
|
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
|
// Add line number attribute for scrolling
|
||||||
|
const originalRender = this.md.renderer.render
|
||||||
|
this.md.renderer.render = (tokens, options, env) => {
|
||||||
|
tokens.forEach((token) => {
|
||||||
|
switch (token.type) {
|
||||||
|
case 'heading_open':
|
||||||
|
case 'paragraph_open':
|
||||||
|
case 'blockquote_open':
|
||||||
|
case 'table_open':
|
||||||
|
token.attrPush(['data-line', token.map[0]])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const result = originalRender.call(this.md.renderer, tokens, options, env)
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
// FIXME We should not depend on global variable.
|
||||||
|
window.md = this.md
|
||||||
}
|
}
|
||||||
|
|
||||||
token = state.push('inline', '', 0)
|
render (content) {
|
||||||
token.content = content
|
|
||||||
token.map = [startLine, state.line]
|
|
||||||
token.children = []
|
|
||||||
|
|
||||||
token = state.push('paragraph_close', 'p', -1)
|
|
||||||
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
|
|
||||||
// Add line number attribute for scrolling
|
|
||||||
const originalRender = md.renderer.render
|
|
||||||
md.renderer.render = function render (tokens, options, env) {
|
|
||||||
tokens.forEach((token) => {
|
|
||||||
switch (token.type) {
|
|
||||||
case 'heading_open':
|
|
||||||
case 'paragraph_open':
|
|
||||||
case 'blockquote_open':
|
|
||||||
case 'table_open':
|
|
||||||
token.attrPush(['data-line', token.map[0]])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const result = originalRender.call(md.renderer, tokens, options, env)
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
// FIXME We should not depend on global variable.
|
|
||||||
window.md = md
|
|
||||||
|
|
||||||
function normalizeLinkText (linkText) {
|
|
||||||
return md.normalizeLinkText(linkText)
|
|
||||||
}
|
|
||||||
|
|
||||||
const markdown = {
|
|
||||||
render: function markdown (content) {
|
|
||||||
if (!_.isString(content)) content = ''
|
if (!_.isString(content)) content = ''
|
||||||
const renderedContent = md.render(content)
|
return this.md.render(content)
|
||||||
return renderedContent
|
}
|
||||||
},
|
|
||||||
normalizeLinkText
|
normalizeLinkText (linkText) {
|
||||||
|
return this.md.normalizeLinkText(linkText)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default markdown
|
export default Markdown
|
||||||
|
|
||||||
|
|||||||
@@ -4,39 +4,28 @@ export default function searchFromNotes (notes, search) {
|
|||||||
if (search.trim().length === 0) return []
|
if (search.trim().length === 0) return []
|
||||||
const searchBlocks = search.split(' ').filter(block => { return block !== '' })
|
const searchBlocks = search.split(' ').filter(block => { return block !== '' })
|
||||||
|
|
||||||
let foundNotes = findByWord(notes, searchBlocks[0])
|
let foundNotes = notes
|
||||||
searchBlocks.forEach((block) => {
|
searchBlocks.forEach((block) => {
|
||||||
foundNotes = findByWord(foundNotes, block)
|
foundNotes = findByWordOrTag(foundNotes, block)
|
||||||
if (block.match(/^#.+/)) {
|
|
||||||
foundNotes = foundNotes.concat(findByTag(notes, block))
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
return foundNotes
|
return foundNotes
|
||||||
}
|
}
|
||||||
|
|
||||||
function findByTag (notes, block) {
|
function findByWordOrTag (notes, block) {
|
||||||
const tag = block.match(/#(.+)/)[1]
|
let tag = block
|
||||||
const regExp = new RegExp(_.escapeRegExp(tag), 'i')
|
if (tag.match(/^#.+/)) {
|
||||||
|
tag = tag.match(/#(.+)/)[1]
|
||||||
|
}
|
||||||
|
const tagRegExp = new RegExp(_.escapeRegExp(tag), 'i')
|
||||||
|
const wordRegExp = new RegExp(_.escapeRegExp(block), 'i')
|
||||||
return notes.filter((note) => {
|
return notes.filter((note) => {
|
||||||
if (!_.isArray(note.tags)) return false
|
if (_.isArray(note.tags) && note.tags.some((_tag) => _tag.match(tagRegExp))) {
|
||||||
return note.tags.some((_tag) => {
|
|
||||||
return _tag.match(regExp)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function findByWord (notes, block) {
|
|
||||||
const regExp = new RegExp(_.escapeRegExp(block), 'i')
|
|
||||||
return notes.filter((note) => {
|
|
||||||
if (_.isArray(note.tags) && note.tags.some((_tag) => {
|
|
||||||
return _tag.match(regExp)
|
|
||||||
})) {
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (note.type === 'SNIPPET_NOTE') {
|
if (note.type === 'SNIPPET_NOTE') {
|
||||||
return note.description.match(regExp)
|
return note.description.match(wordRegExp)
|
||||||
} else if (note.type === 'MARKDOWN_NOTE') {
|
} else if (note.type === 'MARKDOWN_NOTE') {
|
||||||
return note.content.match(regExp)
|
return note.content.match(wordRegExp)
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6,6 +6,55 @@ export function lastFindInArray (array, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export function escapeHtmlCharacters (text) {
|
||||||
lastFindInArray
|
const matchHtmlRegExp = /["'&<>]/
|
||||||
|
const str = '' + text
|
||||||
|
const match = matchHtmlRegExp.exec(str)
|
||||||
|
|
||||||
|
if (!match) {
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
|
||||||
|
let escape
|
||||||
|
let html = ''
|
||||||
|
let index = 0
|
||||||
|
let lastIndex = 0
|
||||||
|
|
||||||
|
for (index = match.index; index < str.length; index++) {
|
||||||
|
switch (str.charCodeAt(index)) {
|
||||||
|
case 34: // "
|
||||||
|
escape = '"'
|
||||||
|
break
|
||||||
|
case 38: // &
|
||||||
|
escape = '&'
|
||||||
|
break
|
||||||
|
case 39: // '
|
||||||
|
escape = '''
|
||||||
|
break
|
||||||
|
case 60: // <
|
||||||
|
escape = '<'
|
||||||
|
break
|
||||||
|
case 62: // >
|
||||||
|
escape = '>'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastIndex !== index) {
|
||||||
|
html += str.substring(lastIndex, index)
|
||||||
|
}
|
||||||
|
|
||||||
|
lastIndex = index + 1
|
||||||
|
html += escape
|
||||||
|
}
|
||||||
|
|
||||||
|
return lastIndex !== index
|
||||||
|
? html + str.substring(lastIndex, index)
|
||||||
|
: html
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
lastFindInArray,
|
||||||
|
escapeHtmlCharacters
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React from 'react'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './FolderSelect.styl'
|
import styles from './FolderSelect.styl'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class FolderSelect extends React.Component {
|
class FolderSelect extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -249,7 +250,7 @@ class FolderSelect extends React.Component {
|
|||||||
<input styleName='search-input'
|
<input styleName='search-input'
|
||||||
ref='search'
|
ref='search'
|
||||||
value={this.state.search}
|
value={this.state.search}
|
||||||
placeholder='Folder...'
|
placeholder={i18n.__('Folder...')}
|
||||||
onChange={(e) => this.handleSearchInputChange(e)}
|
onChange={(e) => this.handleSearchInputChange(e)}
|
||||||
onBlur={(e) => this.handleSearchInputBlur(e)}
|
onBlur={(e) => this.handleSearchInputBlur(e)}
|
||||||
onKeyDown={(e) => this.handleSearchInputKeyDown(e)}
|
onKeyDown={(e) => this.handleSearchInputKeyDown(e)}
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './FullscreenButton.styl'
|
import styles from './FullscreenButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const FullscreenButton = ({
|
const FullscreenButton = ({
|
||||||
onClick
|
onClick
|
||||||
}) => (
|
}) => (
|
||||||
<button styleName='control-fullScreenButton' title='Fullscreen' onMouseDown={(e) => onClick(e)}>
|
<button styleName='control-fullScreenButton' title={i18n.__('Fullscreen')} onMouseDown={(e) => onClick(e)}>
|
||||||
<img styleName='iconInfo' src='../resources/icon/icon-full.svg' />
|
<img styleName='iconInfo' src='../resources/icon/icon-full.svg' />
|
||||||
<span styleName='tooltip'>Fullscreen</span>
|
<span styleName='tooltip'>{i18n.__('Fullscreen')}</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './InfoButton.styl'
|
import styles from './InfoButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const InfoButton = ({
|
const InfoButton = ({
|
||||||
onClick
|
onClick
|
||||||
@@ -10,7 +11,7 @@ const InfoButton = ({
|
|||||||
onClick={(e) => onClick(e)}
|
onClick={(e) => onClick(e)}
|
||||||
>
|
>
|
||||||
<img className='infoButton' src='../resources/icon/icon-info.svg' />
|
<img className='infoButton' src='../resources/icon/icon-info.svg' />
|
||||||
<span styleName='tooltip'>Info</span>
|
<span styleName='tooltip'>{i18n.__('Info')}</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React from 'react'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './InfoPanel.styl'
|
import styles from './InfoPanel.styl'
|
||||||
import copy from 'copy-to-clipboard'
|
import copy from 'copy-to-clipboard'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class InfoPanel extends React.Component {
|
class InfoPanel extends React.Component {
|
||||||
copyNoteLink () {
|
copyNoteLink () {
|
||||||
@@ -19,7 +20,7 @@ class InfoPanel extends React.Component {
|
|||||||
<div className='infoPanel' styleName='control-infoButton-panel' style={{display: 'none'}}>
|
<div className='infoPanel' styleName='control-infoButton-panel' style={{display: 'none'}}>
|
||||||
<div>
|
<div>
|
||||||
<p styleName='modification-date'>{updatedAt}</p>
|
<p styleName='modification-date'>{updatedAt}</p>
|
||||||
<p styleName='modification-date-desc'>MODIFICATION DATE</p>
|
<p styleName='modification-date-desc'>{i18n.__('MODIFICATION DATE')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
@@ -29,11 +30,11 @@ class InfoPanel extends React.Component {
|
|||||||
: <div styleName='count-wrap'>
|
: <div styleName='count-wrap'>
|
||||||
<div styleName='count-number'>
|
<div styleName='count-number'>
|
||||||
<p styleName='infoPanel-defaul-count'>{wordCount}</p>
|
<p styleName='infoPanel-defaul-count'>{wordCount}</p>
|
||||||
<p styleName='infoPanel-sub-count'>Words</p>
|
<p styleName='infoPanel-sub-count'>{i18n.__('Words')}</p>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='count-number'>
|
<div styleName='count-number'>
|
||||||
<p styleName='infoPanel-defaul-count'>{letterCount}</p>
|
<p styleName='infoPanel-defaul-count'>{letterCount}</p>
|
||||||
<p styleName='infoPanel-sub-count'>Letters</p>
|
<p styleName='infoPanel-sub-count'>{i18n.__('Letters')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -45,17 +46,17 @@ class InfoPanel extends React.Component {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p styleName='infoPanel-default'>{storageName}</p>
|
<p styleName='infoPanel-default'>{storageName}</p>
|
||||||
<p styleName='infoPanel-sub'>STORAGE</p>
|
<p styleName='infoPanel-sub'>{i18n.__('STORAGE')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p styleName='infoPanel-default'>{folderName}</p>
|
<p styleName='infoPanel-default'>{folderName}</p>
|
||||||
<p styleName='infoPanel-sub'>FOLDER</p>
|
<p styleName='infoPanel-sub'>{i18n.__('FOLDER')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p styleName='infoPanel-default'>{createdAt}</p>
|
<p styleName='infoPanel-default'>{createdAt}</p>
|
||||||
<p styleName='infoPanel-sub'>CREATION DATE</p>
|
<p styleName='infoPanel-sub'>{i18n.__('CREATION DATE')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -63,7 +64,7 @@ class InfoPanel extends React.Component {
|
|||||||
<button onClick={() => this.copyNoteLink()} styleName='infoPanel-copyButton'>
|
<button onClick={() => this.copyNoteLink()} styleName='infoPanel-copyButton'>
|
||||||
<i className='fa fa-clipboard' />
|
<i className='fa fa-clipboard' />
|
||||||
</button>
|
</button>
|
||||||
<p styleName='infoPanel-sub'>NOTE LINK</p>
|
<p styleName='infoPanel-sub'>{i18n.__('NOTE LINK')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
@@ -71,22 +72,22 @@ class InfoPanel extends React.Component {
|
|||||||
<div id='export-wrap'>
|
<div id='export-wrap'>
|
||||||
<button styleName='export--enable' onClick={(e) => exportAsMd(e)}>
|
<button styleName='export--enable' onClick={(e) => exportAsMd(e)}>
|
||||||
<i className='fa fa-file-code-o' />
|
<i className='fa fa-file-code-o' />
|
||||||
<p>.md</p>
|
<p>{i18n.__('.md')}</p>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button styleName='export--enable' onClick={(e) => exportAsTxt(e)}>
|
<button styleName='export--enable' onClick={(e) => exportAsTxt(e)}>
|
||||||
<i className='fa fa-file-text-o' />
|
<i className='fa fa-file-text-o' />
|
||||||
<p>.txt</p>
|
<p>{i18n.__('.txt')}</p>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button styleName='export--enable' onClick={(e) => exportAsHtml(e)}>
|
<button styleName='export--enable' onClick={(e) => exportAsHtml(e)}>
|
||||||
<i className='fa fa-html5' />
|
<i className='fa fa-html5' />
|
||||||
<p>.html</p>
|
<p>{i18n.__('.html')}</p>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button styleName='export--enable' onClick={(e) => print(e)}>
|
<button styleName='export--enable' onClick={(e) => print(e)}>
|
||||||
<i className='fa fa-print' />
|
<i className='fa fa-print' />
|
||||||
<p>Print</p>
|
<p>{i18n.__('Print')}</p>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './InfoPanel.styl'
|
import styles from './InfoPanel.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const InfoPanelTrashed = ({
|
const InfoPanelTrashed = ({
|
||||||
storageName, folderName, updatedAt, createdAt, exportAsMd, exportAsTxt, exportAsHtml
|
storageName, folderName, updatedAt, createdAt, exportAsMd, exportAsTxt, exportAsHtml
|
||||||
@@ -9,24 +10,24 @@ const InfoPanelTrashed = ({
|
|||||||
<div className='infoPanel' styleName='control-infoButton-panel-trash' style={{display: 'none'}}>
|
<div className='infoPanel' styleName='control-infoButton-panel-trash' style={{display: 'none'}}>
|
||||||
<div>
|
<div>
|
||||||
<p styleName='modification-date'>{updatedAt}</p>
|
<p styleName='modification-date'>{updatedAt}</p>
|
||||||
<p styleName='modification-date-desc'>MODIFICATION DATE</p>
|
<p styleName='modification-date-desc'>{i18n.__('MODIFICATION DATE')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p styleName='infoPanel-default'>{storageName}</p>
|
<p styleName='infoPanel-default'>{storageName}</p>
|
||||||
<p styleName='infoPanel-sub'>STORAGE</p>
|
<p styleName='infoPanel-sub'>{i18n.__('STORAGE')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p styleName='infoPanel-default'><text styleName='infoPanel-trash'>Trash</text>{folderName}</p>
|
<p styleName='infoPanel-default'><text styleName='infoPanel-trash'>Trash</text>{folderName}</p>
|
||||||
<p styleName='infoPanel-sub'>FOLDER</p>
|
<p styleName='infoPanel-sub'>{i18n.__('FOLDER')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p styleName='infoPanel-default'>{createdAt}</p>
|
<p styleName='infoPanel-default'>{createdAt}</p>
|
||||||
<p styleName='infoPanel-sub'>CREATION DATE</p>
|
<p styleName='infoPanel-sub'>{i18n.__('CREATION DATE')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id='export-wrap'>
|
<div id='export-wrap'>
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
hashHistory.replace({
|
hashHistory.replace({
|
||||||
pathname: location.pathname,
|
pathname: location.pathname,
|
||||||
query: {
|
query: {
|
||||||
key: newNote.storage + '-' + newNote.key
|
key: newNote.key
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -393,7 +393,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
<InfoPanel
|
<InfoPanel
|
||||||
storageName={currentOption.storage.name}
|
storageName={currentOption.storage.name}
|
||||||
folderName={currentOption.folder.name}
|
folderName={currentOption.folder.name}
|
||||||
noteLink={`[${note.title}](${location.query.key})`}
|
noteLink={`[${note.title}](:note:${location.query.key})`}
|
||||||
updatedAt={formatDate(note.updatedAt)}
|
updatedAt={formatDate(note.updatedAt)}
|
||||||
createdAt={formatDate(note.createdAt)}
|
createdAt={formatDate(note.createdAt)}
|
||||||
exportAsMd={this.exportAsMd}
|
exportAsMd={this.exportAsMd}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './TrashButton.styl'
|
import styles from './TrashButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const PermanentDeleteButton = ({
|
const PermanentDeleteButton = ({
|
||||||
onClick
|
onClick
|
||||||
@@ -10,7 +11,7 @@ const PermanentDeleteButton = ({
|
|||||||
onClick={(e) => onClick(e)}
|
onClick={(e) => onClick(e)}
|
||||||
>
|
>
|
||||||
<img styleName='iconInfo' src='../resources/icon/icon-trash.svg' />
|
<img styleName='iconInfo' src='../resources/icon/icon-trash.svg' />
|
||||||
<span styleName='tooltip'>Permanent Delete</span>
|
<span styleName='tooltip'>{i18n.__('Permanent Delete')}</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './RestoreButton.styl'
|
import styles from './RestoreButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const RestoreButton = ({
|
const RestoreButton = ({
|
||||||
onClick
|
onClick
|
||||||
@@ -10,7 +11,7 @@ const RestoreButton = ({
|
|||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
<i className='fa fa-undo fa-fw' styleName='iconRestore' />
|
<i className='fa fa-undo fa-fw' styleName='iconRestore' />
|
||||||
<span styleName='tooltip'>Restore</span>
|
<span styleName='tooltip'>{i18n.__('Restore')}</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import StarButton from './StarButton'
|
|||||||
import TagSelect from './TagSelect'
|
import TagSelect from './TagSelect'
|
||||||
import FolderSelect from './FolderSelect'
|
import FolderSelect from './FolderSelect'
|
||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import { hashHistory } from 'react-router'
|
import {hashHistory} from 'react-router'
|
||||||
import ee from 'browser/main/lib/eventEmitter'
|
import ee from 'browser/main/lib/eventEmitter'
|
||||||
import CodeMirror from 'codemirror'
|
import CodeMirror from 'codemirror'
|
||||||
import 'codemirror-mode-elixir'
|
import 'codemirror-mode-elixir'
|
||||||
@@ -17,7 +17,7 @@ import StatusBar from '../StatusBar'
|
|||||||
import context from 'browser/lib/context'
|
import context from 'browser/lib/context'
|
||||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { findNoteTitle } from 'browser/lib/findNoteTitle'
|
import {findNoteTitle} from 'browser/lib/findNoteTitle'
|
||||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
import TrashButton from './TrashButton'
|
import TrashButton from './TrashButton'
|
||||||
import RestoreButton from './RestoreButton'
|
import RestoreButton from './RestoreButton'
|
||||||
@@ -26,6 +26,7 @@ import InfoButton from './InfoButton'
|
|||||||
import InfoPanel from './InfoPanel'
|
import InfoPanel from './InfoPanel'
|
||||||
import InfoPanelTrashed from './InfoPanelTrashed'
|
import InfoPanelTrashed from './InfoPanelTrashed'
|
||||||
import { formatDate } from 'browser/lib/date-formatter'
|
import { formatDate } from 'browser/lib/date-formatter'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
function pass (name) {
|
function pass (name) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
@@ -53,12 +54,30 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
this.state = {
|
this.state = {
|
||||||
isMovingNote: false,
|
isMovingNote: false,
|
||||||
snippetIndex: 0,
|
snippetIndex: 0,
|
||||||
|
showArrows: false,
|
||||||
|
enableLeftArrow: false,
|
||||||
|
enableRightArrow: false,
|
||||||
note: Object.assign({
|
note: Object.assign({
|
||||||
description: ''
|
description: ''
|
||||||
}, props.note, {
|
}, props.note, {
|
||||||
snippets: props.note.snippets.map((snippet) => Object.assign({}, snippet))
|
snippets: props.note.snippets.map((snippet) => Object.assign({}, snippet))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.scrollToNextTabThreshold = 0.7
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount () {
|
||||||
|
const visibleTabs = this.visibleTabs
|
||||||
|
const allTabs = this.allTabs
|
||||||
|
|
||||||
|
if (visibleTabs.offsetWidth < allTabs.scrollWidth) {
|
||||||
|
this.setState({
|
||||||
|
showArrows: visibleTabs.offsetWidth < allTabs.scrollWidth,
|
||||||
|
enableRightArrow: allTabs.offsetLeft !== visibleTabs.offsetWidth - allTabs.scrollWidth,
|
||||||
|
enableLeftArrow: allTabs.offsetLeft !== 0
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
@@ -78,6 +97,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
this.refs['code-' + index].reload()
|
this.refs['code-' + index].reload()
|
||||||
})
|
})
|
||||||
if (this.refs.tags) this.refs.tags.reset()
|
if (this.refs.tags) this.refs.tags.reset()
|
||||||
|
this.setState(this.getArrowsState())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,7 +167,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
hashHistory.replace({
|
hashHistory.replace({
|
||||||
pathname: location.pathname,
|
pathname: location.pathname,
|
||||||
query: {
|
query: {
|
||||||
key: newNote.storage + '-' + newNote.key
|
key: newNote.key
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -228,6 +248,51 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
ee.emit('editor:fullscreen')
|
ee.emit('editor:fullscreen')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleTabMoveLeftButtonClick (e) {
|
||||||
|
{
|
||||||
|
const left = this.visibleTabs.scrollLeft
|
||||||
|
|
||||||
|
const tabs = this.allTabs.querySelectorAll('div')
|
||||||
|
const lastVisibleTab = Array.from(tabs).find((tab) => {
|
||||||
|
return tab.offsetLeft + tab.offsetWidth >= left
|
||||||
|
})
|
||||||
|
|
||||||
|
if (lastVisibleTab) {
|
||||||
|
const visiblePart = lastVisibleTab.offsetWidth + lastVisibleTab.offsetLeft - left
|
||||||
|
const isFullyVisible = visiblePart > lastVisibleTab.offsetWidth * this.scrollToNextTabThreshold
|
||||||
|
const scrollToTab = (isFullyVisible && lastVisibleTab.previousSibling)
|
||||||
|
? lastVisibleTab.previousSibling
|
||||||
|
: lastVisibleTab
|
||||||
|
|
||||||
|
// FIXME use `scrollIntoView()` instead of custom method after update to Electron2.0 (with Chrome 61 its possible animate the scroll)
|
||||||
|
this.moveToTab(scrollToTab)
|
||||||
|
// scrollToTab.scrollIntoView({behavior: 'smooth', inline: 'start', block: 'start'})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleTabMoveRightButtonClick (e) {
|
||||||
|
const left = this.visibleTabs.scrollLeft
|
||||||
|
const width = this.visibleTabs.offsetWidth
|
||||||
|
|
||||||
|
const tabs = this.allTabs.querySelectorAll('div')
|
||||||
|
const lastVisibleTab = Array.from(tabs).find((tab) => {
|
||||||
|
return tab.offsetLeft + tab.offsetWidth >= width + left
|
||||||
|
})
|
||||||
|
|
||||||
|
if (lastVisibleTab) {
|
||||||
|
const visiblePart = width + left - lastVisibleTab.offsetLeft
|
||||||
|
const isFullyVisible = visiblePart > lastVisibleTab.offsetWidth * this.scrollToNextTabThreshold
|
||||||
|
const scrollToTab = (isFullyVisible && lastVisibleTab.nextSibling)
|
||||||
|
? lastVisibleTab.nextSibling
|
||||||
|
: lastVisibleTab
|
||||||
|
|
||||||
|
// FIXME use `scrollIntoView()` instead of custom method after update to Electron2.0 (with Chrome 61 its possible animate the scroll)
|
||||||
|
this.moveToTab(scrollToTab)
|
||||||
|
// scrollToTab.scrollIntoView({behavior: 'smooth', inline: 'end', block: 'end'})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handleTabPlusButtonClick (e) {
|
handleTabPlusButtonClick (e) {
|
||||||
this.addSnippet()
|
this.addSnippet()
|
||||||
}
|
}
|
||||||
@@ -264,9 +329,9 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
if (this.state.note.snippets[index].content.trim().length > 0) {
|
if (this.state.note.snippets[index].content.trim().length > 0) {
|
||||||
const dialogIndex = dialog.showMessageBox(remote.getCurrentWindow(), {
|
const dialogIndex = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Delete a snippet',
|
message: i18n.__('Delete a snippet'),
|
||||||
detail: 'This work cannot be undone.',
|
detail: i18n.__('This work cannot be undone.'),
|
||||||
buttons: ['Confirm', 'Cancel']
|
buttons: [i18n.__('Confirm'), i18n.__('Cancel')]
|
||||||
})
|
})
|
||||||
if (dialogIndex === 0) {
|
if (dialogIndex === 0) {
|
||||||
this.deleteSnippetByIndex(index)
|
this.deleteSnippetByIndex(index)
|
||||||
@@ -287,6 +352,21 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
this.setState({ note, snippetIndex }, () => {
|
this.setState({ note, snippetIndex }, () => {
|
||||||
this.save()
|
this.save()
|
||||||
this.refs['code-' + this.state.snippetIndex].reload()
|
this.refs['code-' + this.state.snippetIndex].reload()
|
||||||
|
|
||||||
|
if (this.visibleTabs.offsetWidth > this.allTabs.scrollWidth) {
|
||||||
|
console.log('no need for arrows')
|
||||||
|
this.moveTabBarBy(0)
|
||||||
|
} else {
|
||||||
|
const lastTab = this.allTabs.lastChild
|
||||||
|
if (lastTab.offsetLeft + lastTab.offsetWidth < this.visibleTabs.offsetWidth) {
|
||||||
|
console.log('need to scroll')
|
||||||
|
const width = this.visibleTabs.offsetWidth
|
||||||
|
const newLeft = lastTab.offsetLeft + lastTab.offsetWidth - width
|
||||||
|
this.moveTabBarBy(newLeft > 0 ? -newLeft : 0)
|
||||||
|
} else {
|
||||||
|
this.setState(this.getArrowsState())
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,6 +423,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
|
|
||||||
handleKeyDown (e) {
|
handleKeyDown (e) {
|
||||||
switch (e.keyCode) {
|
switch (e.keyCode) {
|
||||||
|
// tab key
|
||||||
case 9:
|
case 9:
|
||||||
if (e.ctrlKey && !e.shiftKey) {
|
if (e.ctrlKey && !e.shiftKey) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@@ -355,6 +436,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
this.focusEditor()
|
this.focusEditor()
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
// L key
|
||||||
case 76:
|
case 76:
|
||||||
{
|
{
|
||||||
const isSuper = global.process.platform === 'darwin'
|
const isSuper = global.process.platform === 'darwin'
|
||||||
@@ -366,6 +448,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
// T key
|
||||||
case 84:
|
case 84:
|
||||||
{
|
{
|
||||||
const isSuper = global.process.platform === 'darwin'
|
const isSuper = global.process.platform === 'darwin'
|
||||||
@@ -457,6 +540,51 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
this.refs.description.focus()
|
this.refs.description.focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
moveToTab (tab) {
|
||||||
|
const easeOutCubic = t => (--t) * t * t + 1
|
||||||
|
const startScrollPosition = this.visibleTabs.scrollLeft
|
||||||
|
const animationTiming = 300
|
||||||
|
const scrollMoreCoeff = 1.4 // introduce coefficient, because we want to scroll a bit further to see next tab
|
||||||
|
|
||||||
|
let scrollBy = (tab.offsetLeft - startScrollPosition)
|
||||||
|
|
||||||
|
if (tab.offsetLeft > startScrollPosition) {
|
||||||
|
// if tab is on the right side and we want to show the whole tab in visible area,
|
||||||
|
// we need to include width of the tab and visible area in the formula
|
||||||
|
// ___________________________________________
|
||||||
|
// |____|_______|________|________|_show_this_|
|
||||||
|
// ↑_____________________↑
|
||||||
|
// visible area
|
||||||
|
scrollBy += (tab.offsetWidth - this.visibleTabs.offsetWidth)
|
||||||
|
}
|
||||||
|
|
||||||
|
let startTime = null
|
||||||
|
const scrollAnimation = time => {
|
||||||
|
startTime = startTime || time
|
||||||
|
const elapsed = (time - startTime) / animationTiming
|
||||||
|
|
||||||
|
this.visibleTabs.scrollLeft = startScrollPosition + easeOutCubic(elapsed) * scrollBy * scrollMoreCoeff
|
||||||
|
if (elapsed < 1) {
|
||||||
|
window.requestAnimationFrame(scrollAnimation)
|
||||||
|
} else {
|
||||||
|
this.setState(this.getArrowsState())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.requestAnimationFrame(scrollAnimation)
|
||||||
|
}
|
||||||
|
|
||||||
|
getArrowsState () {
|
||||||
|
const allTabs = this.allTabs
|
||||||
|
const visibleTabs = this.visibleTabs
|
||||||
|
|
||||||
|
const showArrows = visibleTabs.offsetWidth < allTabs.scrollWidth
|
||||||
|
const enableRightArrow = visibleTabs.scrollLeft !== allTabs.scrollWidth - visibleTabs.offsetWidth
|
||||||
|
const enableLeftArrow = visibleTabs.scrollLeft !== 0
|
||||||
|
|
||||||
|
return {showArrows, enableRightArrow, enableLeftArrow}
|
||||||
|
}
|
||||||
|
|
||||||
addSnippet () {
|
addSnippet () {
|
||||||
const { note } = this.state
|
const { note } = this.state
|
||||||
|
|
||||||
@@ -467,10 +595,16 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
}])
|
}])
|
||||||
const snippetIndex = note.snippets.length - 1
|
const snippetIndex = note.snippets.length - 1
|
||||||
|
|
||||||
this.setState({
|
this.setState(Object.assign({
|
||||||
note,
|
note,
|
||||||
snippetIndex
|
snippetIndex
|
||||||
}, () => {
|
}, this.getArrowsState()), () => {
|
||||||
|
if (this.state.showArrows) {
|
||||||
|
const tabs = this.allTabs.querySelectorAll('div')
|
||||||
|
if (tabs) {
|
||||||
|
this.moveToTab(tabs[snippetIndex])
|
||||||
|
}
|
||||||
|
}
|
||||||
this.refs['tab-' + snippetIndex].startRenaming()
|
this.refs['tab-' + snippetIndex].startRenaming()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -504,9 +638,9 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
showWarning () {
|
showWarning () {
|
||||||
dialog.showMessageBox(remote.getCurrentWindow(), {
|
dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Sorry!',
|
message: i18n.__('Sorry!'),
|
||||||
detail: 'md/text import is available only a markdown note.',
|
detail: i18n.__('md/text import is available only a markdown note.'),
|
||||||
buttons: ['OK']
|
buttons: [i18n.__('OK')]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,10 +766,10 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
isActive={note.isStarred}
|
isActive={note.isStarred}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<button styleName='control-fullScreenButton' title='Fullscreen'
|
<button styleName='control-fullScreenButton' title={i18n.__('Fullscreen')}
|
||||||
onMouseDown={(e) => this.handleFullScreenButton(e)}>
|
onMouseDown={(e) => this.handleFullScreenButton(e)}>
|
||||||
<img styleName='iconInfo' src='../resources/icon/icon-full.svg' />
|
<img styleName='iconInfo' src='../resources/icon/icon-full.svg' />
|
||||||
<span styleName='tooltip'>Fullscreen</span>
|
<span styleName='tooltip'>{i18n.__('Fullscreen')}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<TrashButton onClick={(e) => this.handleTrashButtonClick(e)} />
|
<TrashButton onClick={(e) => this.handleTrashButtonClick(e)} />
|
||||||
@@ -647,7 +781,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
<InfoPanel
|
<InfoPanel
|
||||||
storageName={currentOption.storage.name}
|
storageName={currentOption.storage.name}
|
||||||
folderName={currentOption.folder.name}
|
folderName={currentOption.folder.name}
|
||||||
noteLink={`[${note.title}](${location.query.key})`}
|
noteLink={`[${note.title}](:note:${location.query.key})`}
|
||||||
updatedAt={formatDate(note.updatedAt)}
|
updatedAt={formatDate(note.updatedAt)}
|
||||||
createdAt={formatDate(note.createdAt)}
|
createdAt={formatDate(note.createdAt)}
|
||||||
exportAsMd={this.showWarning}
|
exportAsMd={this.showWarning}
|
||||||
@@ -673,16 +807,32 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
fontSize: parseInt(config.preview.fontSize, 10)
|
fontSize: parseInt(config.preview.fontSize, 10)
|
||||||
}}
|
}}
|
||||||
ref='description'
|
ref='description'
|
||||||
placeholder='Description...'
|
placeholder={i18n.__('Description...')}
|
||||||
value={this.state.note.description}
|
value={this.state.note.description}
|
||||||
onChange={(e) => this.handleChange(e)}
|
onChange={(e) => this.handleChange(e)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='tabList'>
|
<div styleName='tabList'>
|
||||||
<div styleName='list'>
|
<button styleName='tabButton'
|
||||||
{tabList}
|
hidden={!this.state.showArrows}
|
||||||
|
disabled={!this.state.enableLeftArrow}
|
||||||
|
onClick={(e) => this.handleTabMoveLeftButtonClick(e)}
|
||||||
|
>
|
||||||
|
<i className='fa fa-chevron-left' />
|
||||||
|
</button>
|
||||||
|
<div styleName='list' onScroll={(e) => { this.setState(this.getArrowsState()) }} ref={(tabs) => { this.visibleTabs = tabs }}>
|
||||||
|
<div styleName='allTabs' ref={(tabs) => { this.allTabs = tabs }}>
|
||||||
|
{tabList}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='plusButton'
|
<button styleName='tabButton'
|
||||||
|
hidden={!this.state.showArrows}
|
||||||
|
disabled={!this.state.enableRightArrow}
|
||||||
|
onClick={(e) => this.handleTabMoveRightButtonClick(e)}
|
||||||
|
>
|
||||||
|
<i className='fa fa-chevron-right' />
|
||||||
|
</button>
|
||||||
|
<button styleName='tabButton'
|
||||||
onClick={(e) => this.handleTabPlusButtonClick(e)}
|
onClick={(e) => this.handleTabPlusButtonClick(e)}
|
||||||
>
|
>
|
||||||
<i className='fa fa-plus' />
|
<i className='fa fa-plus' />
|
||||||
@@ -696,7 +846,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
onClick={(e) => this.handleModeButtonClick(e, this.state.snippetIndex)}
|
onClick={(e) => this.handleModeButtonClick(e, this.state.snippetIndex)}
|
||||||
>
|
>
|
||||||
{this.state.note.snippets[this.state.snippetIndex].mode == null
|
{this.state.note.snippets[this.state.snippetIndex].mode == null
|
||||||
? 'Select Syntax...'
|
? i18n.__('Select Syntax...')
|
||||||
: this.state.note.snippets[this.state.snippetIndex].mode
|
: this.state.note.snippets[this.state.snippetIndex].mode
|
||||||
}
|
}
|
||||||
<i className='fa fa-caret-down' />
|
<i className='fa fa-caret-down' />
|
||||||
|
|||||||
@@ -35,13 +35,26 @@
|
|||||||
height 30px
|
height 30px
|
||||||
display flex
|
display flex
|
||||||
background-color $ui-noteDetail-backgroundColor
|
background-color $ui-noteDetail-backgroundColor
|
||||||
|
overflow hidden
|
||||||
|
|
||||||
.tabList .list
|
.tabList .list
|
||||||
flex 1
|
flex 1
|
||||||
display flex
|
|
||||||
overflow hidden
|
overflow hidden
|
||||||
|
overflow-x scroll
|
||||||
|
position relative
|
||||||
|
|
||||||
.tabList .plusButton
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.allTabs
|
||||||
|
display flex
|
||||||
|
position relative
|
||||||
|
overflow visible
|
||||||
|
left 0
|
||||||
|
transition left 0.1s
|
||||||
|
|
||||||
|
.tabList .tabButton
|
||||||
navWhiteButtonColor()
|
navWhiteButtonColor()
|
||||||
width 30px
|
width 30px
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React from 'react'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './StarButton.styl'
|
import styles from './StarButton.styl'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class StarButton extends React.Component {
|
class StarButton extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -53,7 +54,7 @@ class StarButton extends React.Component {
|
|||||||
: '../resources/icon/icon-star.svg'
|
: '../resources/icon/icon-star.svg'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<span styleName='tooltip'>Star</span>
|
<span styleName='tooltip'>{i18n.__('Star')}</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import CSSModules from 'browser/lib/CSSModules'
|
|||||||
import styles from './TagSelect.styl'
|
import styles from './TagSelect.styl'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class TagSelect extends React.Component {
|
class TagSelect extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -137,7 +138,7 @@ class TagSelect extends React.Component {
|
|||||||
<input styleName='newTag'
|
<input styleName='newTag'
|
||||||
ref='newTag'
|
ref='newTag'
|
||||||
value={this.state.newTag}
|
value={this.state.newTag}
|
||||||
placeholder='Add tag...'
|
placeholder={i18n.__('Add tag...')}
|
||||||
onChange={(e) => this.handleNewTagInputChange(e)}
|
onChange={(e) => this.handleNewTagInputChange(e)}
|
||||||
onKeyDown={(e) => this.handleNewTagInputKeyDown(e)}
|
onKeyDown={(e) => this.handleNewTagInputKeyDown(e)}
|
||||||
onBlur={(e) => this.handleNewTagBlur(e)}
|
onBlur={(e) => this.handleNewTagBlur(e)}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './ToggleModeButton.styl'
|
import styles from './ToggleModeButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const ToggleModeButton = ({
|
const ToggleModeButton = ({
|
||||||
onClick, editorType
|
onClick, editorType
|
||||||
@@ -13,7 +14,7 @@ const ToggleModeButton = ({
|
|||||||
<div styleName={editorType === 'EDITOR_PREVIEW' ? 'active' : 'non-active'} onClick={() => onClick('EDITOR_PREVIEW')}>
|
<div styleName={editorType === 'EDITOR_PREVIEW' ? 'active' : 'non-active'} onClick={() => onClick('EDITOR_PREVIEW')}>
|
||||||
<img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '' : '../resources/icon/icon-mode-split-on-active.svg'} />
|
<img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '' : '../resources/icon/icon-mode-split-on-active.svg'} />
|
||||||
</div>
|
</div>
|
||||||
<span styleName='tooltip'>Toggle Mode</span>
|
<span styleName='tooltip'>{i18n.__('Toggle Mode')}</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './TrashButton.styl'
|
import styles from './TrashButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const TrashButton = ({
|
const TrashButton = ({
|
||||||
onClick
|
onClick
|
||||||
@@ -10,7 +11,7 @@ const TrashButton = ({
|
|||||||
onClick={(e) => onClick(e)}
|
onClick={(e) => onClick(e)}
|
||||||
>
|
>
|
||||||
<img styleName='iconInfo' src='../resources/icon/icon-trash.svg' />
|
<img styleName='iconInfo' src='../resources/icon/icon-trash.svg' />
|
||||||
<span styleName='tooltip'>Trash</span>
|
<span styleName='tooltip'>{i18n.__('Trash')}</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import MarkdownNoteDetail from './MarkdownNoteDetail'
|
|||||||
import SnippetNoteDetail from './SnippetNoteDetail'
|
import SnippetNoteDetail from './SnippetNoteDetail'
|
||||||
import ee from 'browser/main/lib/eventEmitter'
|
import ee from 'browser/main/lib/eventEmitter'
|
||||||
import StatusBar from '../StatusBar'
|
import StatusBar from '../StatusBar'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const OSX = global.process.platform === 'darwin'
|
const OSX = global.process.platform === 'darwin'
|
||||||
|
|
||||||
@@ -40,9 +41,9 @@ class Detail extends React.Component {
|
|||||||
|
|
||||||
const alertConfig = {
|
const alertConfig = {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Confirm note deletion',
|
message: i18n.__('Confirm note deletion'),
|
||||||
detail: 'This will permanently remove this note.',
|
detail: i18n.__('This will permanently remove this note.'),
|
||||||
buttons: ['Confirm', 'Cancel']
|
buttons: [i18n.__('Confirm'), i18n.__('Cancel')]
|
||||||
}
|
}
|
||||||
|
|
||||||
const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), alertConfig)
|
const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), alertConfig)
|
||||||
@@ -56,11 +57,8 @@ class Detail extends React.Component {
|
|||||||
const { location, data, config } = this.props
|
const { location, data, config } = this.props
|
||||||
let note = null
|
let note = null
|
||||||
if (location.query.key != null) {
|
if (location.query.key != null) {
|
||||||
const splitted = location.query.key.split('-')
|
const noteKey = location.query.key
|
||||||
const storageKey = splitted.shift()
|
note = data.noteMap.get(noteKey)
|
||||||
const noteKey = splitted.shift()
|
|
||||||
|
|
||||||
note = data.noteMap.get(storageKey + '-' + noteKey)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (note == null) {
|
if (note == null) {
|
||||||
@@ -70,7 +68,7 @@ class Detail extends React.Component {
|
|||||||
tabIndex='0'
|
tabIndex='0'
|
||||||
>
|
>
|
||||||
<div styleName='empty'>
|
<div styleName='empty'>
|
||||||
<div styleName='empty-message'>{OSX ? 'Command(⌘)' : 'Ctrl(^)'} + N<br />to create a new note</div>
|
<div styleName='empty-message'>{OSX ? i18n.__('Command(⌘)') : i18n.__('Ctrl(^)')} + N<br />{i18n.__('to create a new note')}</div>
|
||||||
</div>
|
</div>
|
||||||
<StatusBar
|
<StatusBar
|
||||||
{..._.pick(this.props, ['config', 'location', 'dispatch'])}
|
{..._.pick(this.props, ['config', 'location', 'dispatch'])}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import mobileAnalytics from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
|||||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
import { hashHistory } from 'react-router'
|
import { hashHistory } from 'react-router'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const { remote } = electron
|
const { remote } = electron
|
||||||
@@ -148,6 +149,37 @@ class Main extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
document.body.setAttribute('data-theme', 'default')
|
document.body.setAttribute('data-theme', 'default')
|
||||||
}
|
}
|
||||||
|
if (config.ui.language === 'sq') {
|
||||||
|
i18n.setLocale('sq')
|
||||||
|
} else if (config.ui.language === 'zh-CN') {
|
||||||
|
i18n.setLocale('zh-CN')
|
||||||
|
} else if (config.ui.language === 'zh-TW') {
|
||||||
|
i18n.setLocale('zh-TW')
|
||||||
|
} else if (config.ui.language === 'da') {
|
||||||
|
i18n.setLocale('da')
|
||||||
|
} else if (config.ui.language === 'fr') {
|
||||||
|
i18n.setLocale('fr')
|
||||||
|
} else if (config.ui.language === 'de') {
|
||||||
|
i18n.setLocale('de')
|
||||||
|
} else if (config.ui.language === 'hu') {
|
||||||
|
i18n.setLocale('hu')
|
||||||
|
} else if (config.ui.language === 'ja') {
|
||||||
|
i18n.setLocale('ja')
|
||||||
|
} else if (config.ui.language === 'ko') {
|
||||||
|
i18n.setLocale('ko')
|
||||||
|
} else if (config.ui.language === 'no') {
|
||||||
|
i18n.setLocale('no')
|
||||||
|
} else if (config.ui.language === 'pl') {
|
||||||
|
i18n.setLocale('pl')
|
||||||
|
} else if (config.ui.language === 'pt') {
|
||||||
|
i18n.setLocale('pt')
|
||||||
|
} else if (config.ui.language === 'ru') {
|
||||||
|
i18n.setLocale('ru')
|
||||||
|
} else if (config.ui.language === 'es-ES') {
|
||||||
|
i18n.setLocale('es-ES')
|
||||||
|
} else {
|
||||||
|
i18n.setLocale('en')
|
||||||
|
}
|
||||||
|
|
||||||
// Reload all data
|
// Reload all data
|
||||||
dataApi.init()
|
dataApi.init()
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import _ from 'lodash'
|
|||||||
import modal from 'browser/main/lib/modal'
|
import modal from 'browser/main/lib/modal'
|
||||||
import NewNoteModal from 'browser/main/modals/NewNoteModal'
|
import NewNoteModal from 'browser/main/modals/NewNoteModal'
|
||||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const { remote } = require('electron')
|
const { remote } = require('electron')
|
||||||
const { dialog } = remote
|
const { dialog } = remote
|
||||||
@@ -56,9 +57,9 @@ class NewNoteButton extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (storage == null) this.showMessageBox('No storage to create a note')
|
if (storage == null) this.showMessageBox(i18n.__('No storage to create a note'))
|
||||||
const folder = _.find(storage.folders, {key: params.folderKey}) || storage.folders[0]
|
const folder = _.find(storage.folders, {key: params.folderKey}) || storage.folders[0]
|
||||||
if (folder == null) this.showMessageBox('No folder to create a note')
|
if (folder == null) this.showMessageBox(i18n.__('No folder to create a note'))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
storage,
|
storage,
|
||||||
@@ -86,7 +87,7 @@ class NewNoteButton extends React.Component {
|
|||||||
onClick={(e) => this.handleNewNoteButtonClick(e)}>
|
onClick={(e) => this.handleNewNoteButtonClick(e)}>
|
||||||
<img styleName='iconTag' src='../resources/icon/icon-newnote.svg' />
|
<img styleName='iconTag' src='../resources/icon/icon-newnote.svg' />
|
||||||
<span styleName='control-newNoteButton-tooltip'>
|
<span styleName='control-newNoteButton-tooltip'>
|
||||||
Make a note {OSX ? '⌘' : 'Ctrl'} + N
|
{i18n.__('Make a note')} {OSX ? '⌘' : i18n.__('Ctrl')} + N
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* global electron */
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
@@ -13,10 +14,14 @@ import searchFromNotes from 'browser/lib/search'
|
|||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { hashHistory } from 'react-router'
|
import { hashHistory } from 'react-router'
|
||||||
|
import copy from 'copy-to-clipboard'
|
||||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
import Markdown from '../../lib/markdown'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const { remote } = require('electron')
|
const { remote } = require('electron')
|
||||||
const { Menu, MenuItem, dialog } = remote
|
const { Menu, MenuItem, dialog } = remote
|
||||||
|
const WP_POST_PATH = '/wp/v2/posts'
|
||||||
|
|
||||||
function sortByCreatedAt (a, b) {
|
function sortByCreatedAt (a, b) {
|
||||||
return new Date(b.createdAt) - new Date(a.createdAt)
|
return new Date(b.createdAt) - new Date(a.createdAt)
|
||||||
@@ -31,7 +36,7 @@ function sortByUpdatedAt (a, b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function findNoteByKey (notes, noteKey) {
|
function findNoteByKey (notes, noteKey) {
|
||||||
return notes.find((note) => `${note.storage}-${note.key}` === noteKey)
|
return notes.find((note) => note.key === noteKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
function findNotesByKeys (notes, noteKeys) {
|
function findNotesByKeys (notes, noteKeys) {
|
||||||
@@ -39,7 +44,7 @@ function findNotesByKeys (notes, noteKeys) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getNoteKey (note) {
|
function getNoteKey (note) {
|
||||||
return `${note.storage}-${note.key}`
|
return note.key
|
||||||
}
|
}
|
||||||
|
|
||||||
class NoteList extends React.Component {
|
class NoteList extends React.Component {
|
||||||
@@ -70,6 +75,7 @@ class NoteList extends React.Component {
|
|||||||
this.getNoteFolder = this.getNoteFolder.bind(this)
|
this.getNoteFolder = this.getNoteFolder.bind(this)
|
||||||
this.getViewType = this.getViewType.bind(this)
|
this.getViewType = this.getViewType.bind(this)
|
||||||
this.restoreNote = this.restoreNote.bind(this)
|
this.restoreNote = this.restoreNote.bind(this)
|
||||||
|
this.copyNoteLink = this.copyNoteLink.bind(this)
|
||||||
|
|
||||||
// TODO: not Selected noteKeys but SelectedNote(for reusing)
|
// TODO: not Selected noteKeys but SelectedNote(for reusing)
|
||||||
this.state = {
|
this.state = {
|
||||||
@@ -114,10 +120,10 @@ class NoteList extends React.Component {
|
|||||||
componentDidUpdate (prevProps) {
|
componentDidUpdate (prevProps) {
|
||||||
const { location } = this.props
|
const { location } = this.props
|
||||||
const { selectedNoteKeys } = this.state
|
const { selectedNoteKeys } = this.state
|
||||||
const visibleNoteKeys = this.notes.map(note => `${note.storage}-${note.key}`)
|
const visibleNoteKeys = this.notes.map(note => note.key)
|
||||||
const note = this.notes[0]
|
const note = this.notes[0]
|
||||||
const prevKey = prevProps.location.query.key
|
const prevKey = prevProps.location.query.key
|
||||||
const noteKey = visibleNoteKeys.includes(prevKey) ? prevKey : note && `${note.storage}-${note.key}`
|
const noteKey = visibleNoteKeys.includes(prevKey) ? prevKey : note && note.key
|
||||||
|
|
||||||
if (note && location.query.key == null) {
|
if (note && location.query.key == null) {
|
||||||
const { router } = this.context
|
const { router } = this.context
|
||||||
@@ -257,27 +263,38 @@ class NoteList extends React.Component {
|
|||||||
handleNoteListKeyDown (e) {
|
handleNoteListKeyDown (e) {
|
||||||
if (e.metaKey || e.ctrlKey) return true
|
if (e.metaKey || e.ctrlKey) return true
|
||||||
|
|
||||||
|
// A key
|
||||||
if (e.keyCode === 65 && !e.shiftKey) {
|
if (e.keyCode === 65 && !e.shiftKey) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
ee.emit('top:new-note')
|
ee.emit('top:new-note')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// D key
|
||||||
if (e.keyCode === 68) {
|
if (e.keyCode === 68) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
this.deleteNote()
|
this.deleteNote()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// E key
|
||||||
if (e.keyCode === 69) {
|
if (e.keyCode === 69) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
ee.emit('detail:focus')
|
ee.emit('detail:focus')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.keyCode === 38) {
|
// F or S key
|
||||||
|
if (e.keyCode === 70 || e.keyCode === 83) {
|
||||||
|
e.preventDefault()
|
||||||
|
ee.emit('top:focus-search')
|
||||||
|
}
|
||||||
|
|
||||||
|
// UP or K key
|
||||||
|
if (e.keyCode === 38 || e.keyCode === 75) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
this.selectPriorNote()
|
this.selectPriorNote()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.keyCode === 40) {
|
// DOWN or J key
|
||||||
|
if (e.keyCode === 40 || e.keyCode === 74) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
this.selectNextNote()
|
this.selectNextNote()
|
||||||
}
|
}
|
||||||
@@ -309,8 +326,10 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (location.pathname.match(/\/searched/)) {
|
if (location.pathname.match(/\/searched/)) {
|
||||||
const searchInputText = document.getElementsByClassName('searchInput')[0].value
|
const searchInputText = params.searchword
|
||||||
if (searchInputText === '') {
|
const allNotes = data.noteMap.map((note) => note)
|
||||||
|
this.contextNotes = allNotes
|
||||||
|
if (searchInputText === undefined || searchInputText === '') {
|
||||||
return this.sortByPin(this.contextNotes)
|
return this.sortByPin(this.contextNotes)
|
||||||
}
|
}
|
||||||
return searchFromNotes(this.contextNotes, searchInputText)
|
return searchFromNotes(this.contextNotes, searchInputText)
|
||||||
@@ -428,9 +447,9 @@ class NoteList extends React.Component {
|
|||||||
if (this.notes[targetIndex].type === 'SNIPPET_NOTE') {
|
if (this.notes[targetIndex].type === 'SNIPPET_NOTE') {
|
||||||
dialog.showMessageBox(remote.getCurrentWindow(), {
|
dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Sorry!',
|
message: i18n.__('Sorry!'),
|
||||||
detail: 'md/text import is available only a markdown note.',
|
detail: i18n.__('md/text import is available only a markdown note.'),
|
||||||
buttons: ['OK', 'Cancel']
|
buttons: [i18n.__('OK'), i18n.__('Cancel')]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -454,34 +473,63 @@ class NoteList extends React.Component {
|
|||||||
this.handleNoteClick(e, uniqueKey)
|
this.handleNoteClick(e, uniqueKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
const pinLabel = note.isPinned ? 'Remove pin' : 'Pin to Top'
|
const pinLabel = note.isPinned ? i18n.__('Remove pin') : i18n.__('Pin to Top')
|
||||||
const deleteLabel = 'Delete Note'
|
const deleteLabel = i18n.__('Delete Note')
|
||||||
const cloneNote = 'Clone Note'
|
const cloneNote = i18n.__('Clone Note')
|
||||||
const restoreNote = 'Restore Note'
|
const restoreNote = i18n.__('Restore Note')
|
||||||
|
const copyNoteLink = i18n.__('Copy Note Link')
|
||||||
|
const publishLabel = i18n.__('Publish Blog')
|
||||||
|
const updateLabel = i18n.__('Update Blog')
|
||||||
|
const openBlogLabel = i18n.__('Open Blog')
|
||||||
|
|
||||||
const menu = new Menu()
|
const menu = new Menu()
|
||||||
if (!location.pathname.match(/\/starred|\/trash/)) {
|
|
||||||
menu.append(new MenuItem({
|
|
||||||
label: pinLabel,
|
|
||||||
click: this.pinToTop
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (location.pathname.match(/\/trash/)) {
|
if (location.pathname.match(/\/trash/)) {
|
||||||
menu.append(new MenuItem({
|
menu.append(new MenuItem({
|
||||||
label: restoreNote,
|
label: restoreNote,
|
||||||
click: this.restoreNote
|
click: this.restoreNote
|
||||||
}))
|
}))
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: deleteLabel,
|
||||||
|
click: this.deleteNote
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
if (!location.pathname.match(/\/starred/)) {
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: pinLabel,
|
||||||
|
click: this.pinToTop
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: deleteLabel,
|
||||||
|
click: this.deleteNote
|
||||||
|
}))
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: cloneNote,
|
||||||
|
click: this.cloneNote.bind(this)
|
||||||
|
}))
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: copyNoteLink,
|
||||||
|
click: this.copyNoteLink(note)
|
||||||
|
}))
|
||||||
|
if (note.type === 'MARKDOWN_NOTE') {
|
||||||
|
if (note.blog && note.blog.blogLink && note.blog.blogId) {
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: updateLabel,
|
||||||
|
click: this.publishMarkdown.bind(this)
|
||||||
|
}))
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: openBlogLabel,
|
||||||
|
click: () => this.openBlog.bind(this)(note)
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: publishLabel,
|
||||||
|
click: this.publishMarkdown.bind(this)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.append(new MenuItem({
|
|
||||||
label: deleteLabel,
|
|
||||||
click: this.deleteNote
|
|
||||||
}))
|
|
||||||
menu.append(new MenuItem({
|
|
||||||
label: cloneNote,
|
|
||||||
click: this.cloneNote.bind(this)
|
|
||||||
}))
|
|
||||||
menu.popup()
|
menu.popup()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,17 +590,15 @@ class NoteList extends React.Component {
|
|||||||
const noteExp = selectedNotes.length > 1 ? 'notes' : 'note'
|
const noteExp = selectedNotes.length > 1 ? 'notes' : 'note'
|
||||||
const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), {
|
const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Confirm note deletion',
|
message: i18n.__('Confirm note deletion'),
|
||||||
detail: `This will permanently remove ${selectedNotes.length} ${noteExp}.`,
|
detail: `This will permanently remove ${selectedNotes.length} ${noteExp}.`,
|
||||||
buttons: ['Confirm', 'Cancel']
|
buttons: [i18n.__('Confirm'), i18n.__('Cancel')]
|
||||||
})
|
})
|
||||||
if (dialogueButtonIndex === 1) return
|
if (dialogueButtonIndex === 1) return
|
||||||
Promise.all(
|
Promise.all(
|
||||||
selectedNoteKeys.map((uniqueKey) => {
|
selectedNotes.map((note) => {
|
||||||
const storageKey = uniqueKey.split('-')[0]
|
|
||||||
const noteKey = uniqueKey.split('-')[1]
|
|
||||||
return dataApi
|
return dataApi
|
||||||
.deleteNote(storageKey, noteKey)
|
.deleteNote(note.storage, note.key)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
@@ -609,27 +655,138 @@ class NoteList extends React.Component {
|
|||||||
.createNote(storage.key, {
|
.createNote(storage.key, {
|
||||||
type: firstNote.type,
|
type: firstNote.type,
|
||||||
folder: folder.key,
|
folder: folder.key,
|
||||||
title: firstNote.title + ' copy',
|
title: firstNote.title + ' ' + i18n.__('copy'),
|
||||||
content: firstNote.content
|
content: firstNote.content
|
||||||
})
|
})
|
||||||
.then((note) => {
|
.then((note) => {
|
||||||
const uniqueKey = note.storage + '-' + note.key
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'UPDATE_NOTE',
|
type: 'UPDATE_NOTE',
|
||||||
note: note
|
note: note
|
||||||
})
|
})
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
selectedNoteKeys: [uniqueKey]
|
selectedNoteKeys: [note.key]
|
||||||
})
|
})
|
||||||
|
|
||||||
hashHistory.push({
|
hashHistory.push({
|
||||||
pathname: location.pathname,
|
pathname: location.pathname,
|
||||||
query: {key: uniqueKey}
|
query: {key: note.key}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copyNoteLink (note) {
|
||||||
|
const noteLink = `[${note.title}](:note:${note.key})`
|
||||||
|
return copy(noteLink)
|
||||||
|
}
|
||||||
|
|
||||||
|
save (note) {
|
||||||
|
const { dispatch } = this.props
|
||||||
|
dataApi
|
||||||
|
.updateNote(note.storage, note.key, note)
|
||||||
|
.then((note) => {
|
||||||
|
dispatch({
|
||||||
|
type: 'UPDATE_NOTE',
|
||||||
|
note: note
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
publishMarkdown () {
|
||||||
|
if (this.pendingPublish) {
|
||||||
|
clearTimeout(this.pendingPublish)
|
||||||
|
}
|
||||||
|
this.pendingPublish = setTimeout(() => {
|
||||||
|
this.publishMarkdownNow()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
publishMarkdownNow () {
|
||||||
|
const {selectedNoteKeys} = this.state
|
||||||
|
const notes = this.notes.map((note) => Object.assign({}, note))
|
||||||
|
const selectedNotes = findNotesByKeys(notes, selectedNoteKeys)
|
||||||
|
const firstNote = selectedNotes[0]
|
||||||
|
const config = ConfigManager.get()
|
||||||
|
const {address, token, authMethod, username, password} = config.blog
|
||||||
|
let authToken = ''
|
||||||
|
if (authMethod === 'USER') {
|
||||||
|
authToken = `Basic ${window.btoa(`${username}:${password}`)}`
|
||||||
|
} else {
|
||||||
|
authToken = `Bearer ${token}`
|
||||||
|
}
|
||||||
|
const contentToRender = firstNote.content.replace(`# ${firstNote.title}`, '')
|
||||||
|
const markdown = new Markdown()
|
||||||
|
const data = {
|
||||||
|
title: firstNote.title,
|
||||||
|
content: markdown.render(contentToRender),
|
||||||
|
status: 'publish'
|
||||||
|
}
|
||||||
|
|
||||||
|
let url = ''
|
||||||
|
let method = ''
|
||||||
|
if (firstNote.blog && firstNote.blog.blogId) {
|
||||||
|
url = `${address}${WP_POST_PATH}/${firstNote.blog.blogId}`
|
||||||
|
method = 'PUT'
|
||||||
|
} else {
|
||||||
|
url = `${address}${WP_POST_PATH}`
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
fetch(url, {
|
||||||
|
method: method,
|
||||||
|
body: JSON.stringify(data),
|
||||||
|
headers: {
|
||||||
|
'Authorization': authToken,
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
}).then(res => res.json())
|
||||||
|
.then(response => {
|
||||||
|
if (_.isNil(response.link) || _.isNil(response.id)) {
|
||||||
|
return Promise.reject()
|
||||||
|
}
|
||||||
|
firstNote.blog = {
|
||||||
|
blogLink: response.link,
|
||||||
|
blogId: response.id
|
||||||
|
}
|
||||||
|
this.save(firstNote)
|
||||||
|
this.confirmPublish(firstNote)
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
this.confirmPublishError()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
confirmPublishError () {
|
||||||
|
const { remote } = electron
|
||||||
|
const { dialog } = remote
|
||||||
|
const alertError = {
|
||||||
|
type: 'warning',
|
||||||
|
message: i18n.__('Publish Failed'),
|
||||||
|
detail: i18n.__('Check and update your blog setting and try again.'),
|
||||||
|
buttons: [i18n.__('Confirm')]
|
||||||
|
}
|
||||||
|
dialog.showMessageBox(remote.getCurrentWindow(), alertError)
|
||||||
|
}
|
||||||
|
|
||||||
|
confirmPublish (note) {
|
||||||
|
const buttonIndex = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
|
type: 'warning',
|
||||||
|
message: i18n.__('Publish Succeeded'),
|
||||||
|
detail: `${note.title} is published at ${note.blog.blogLink}`,
|
||||||
|
buttons: [i18n.__('Confirm'), i18n.__('Open Blog')]
|
||||||
|
})
|
||||||
|
|
||||||
|
if (buttonIndex === 1) {
|
||||||
|
this.openBlog(note)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
openBlog (note) {
|
||||||
|
const { shell } = electron
|
||||||
|
shell.openExternal(note.blog.blogLink)
|
||||||
|
}
|
||||||
|
|
||||||
importFromFile () {
|
importFromFile () {
|
||||||
const options = {
|
const options = {
|
||||||
filters: [
|
filters: [
|
||||||
@@ -722,7 +879,7 @@ class NoteList extends React.Component {
|
|||||||
dialog.showMessageBox(remote.getCurrentWindow(), {
|
dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: message,
|
message: message,
|
||||||
buttons: ['OK']
|
buttons: [i18n.__('OK')]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -840,17 +997,17 @@ class NoteList extends React.Component {
|
|||||||
<div styleName='control-sortBy'>
|
<div styleName='control-sortBy'>
|
||||||
<i className='fa fa-angle-down' />
|
<i className='fa fa-angle-down' />
|
||||||
<select styleName='control-sortBy-select'
|
<select styleName='control-sortBy-select'
|
||||||
title='Select filter mode'
|
title={i18n.__('Select filter mode')}
|
||||||
value={config.sortBy}
|
value={config.sortBy}
|
||||||
onChange={(e) => this.handleSortByChange(e)}
|
onChange={(e) => this.handleSortByChange(e)}
|
||||||
>
|
>
|
||||||
<option title='Sort by update time' value='UPDATED_AT'>Updated</option>
|
<option title='Sort by update time' value='UPDATED_AT'>{i18n.__('Updated')}</option>
|
||||||
<option title='Sort by create time' value='CREATED_AT'>Created</option>
|
<option title='Sort by create time' value='CREATED_AT'>{i18n.__('Created')}</option>
|
||||||
<option title='Sort alphabetically' value='ALPHABETICAL'>Alphabetically</option>
|
<option title='Sort alphabetically' value='ALPHABETICAL'>{i18n.__('Alphabetically')}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='control-button-area'>
|
<div styleName='control-button-area'>
|
||||||
<button title='Default View' styleName={config.listStyle === 'DEFAULT'
|
<button title={i18n.__('Default View')} styleName={config.listStyle === 'DEFAULT'
|
||||||
? 'control-button--active'
|
? 'control-button--active'
|
||||||
: 'control-button'
|
: 'control-button'
|
||||||
}
|
}
|
||||||
@@ -858,7 +1015,7 @@ class NoteList extends React.Component {
|
|||||||
>
|
>
|
||||||
<img styleName='iconTag' src='../resources/icon/icon-column.svg' />
|
<img styleName='iconTag' src='../resources/icon/icon-column.svg' />
|
||||||
</button>
|
</button>
|
||||||
<button title='Compressed View' styleName={config.listStyle === 'SMALL'
|
<button title={i18n.__('Compressed View')} styleName={config.listStyle === 'SMALL'
|
||||||
? 'control-button--active'
|
? 'control-button--active'
|
||||||
: 'control-button'
|
: 'control-button'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './SwitchButton.styl'
|
import styles from './SwitchButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const ListButton = ({
|
const ListButton = ({
|
||||||
onClick, isTagActive
|
onClick, isTagActive
|
||||||
@@ -12,7 +13,7 @@ const ListButton = ({
|
|||||||
: '../resources/icon/icon-list-active.svg'
|
: '../resources/icon/icon-list-active.svg'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<span styleName='tooltip'>Notes</span>
|
<span styleName='tooltip'>{i18n.__('Notes')}</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './PreferenceButton.styl'
|
import styles from './PreferenceButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const PreferenceButton = ({
|
const PreferenceButton = ({
|
||||||
onClick
|
onClick
|
||||||
}) => (
|
}) => (
|
||||||
<button styleName='top-menu-preference' onClick={(e) => onClick(e)}>
|
<button styleName='top-menu-preference' onClick={(e) => onClick(e)}>
|
||||||
<img styleName='iconTag' src='../resources/icon/icon-setting.svg' />
|
<img styleName='iconTag' src='../resources/icon/icon-setting.svg' />
|
||||||
<span styleName='tooltip'>Preferences</span>
|
<span styleName='tooltip'>{i18n.__('Preferences')}</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,33 @@
|
|||||||
display flex
|
display flex
|
||||||
flex-direction column
|
flex-direction column
|
||||||
|
|
||||||
.tag-title
|
.tag-control
|
||||||
padding-left 15px
|
display flex
|
||||||
padding-bottom 13px
|
height 30px
|
||||||
p
|
line-height 25px
|
||||||
color $ui-button-default-color
|
overflow hidden
|
||||||
|
.tag-control-title
|
||||||
|
padding-left 15px
|
||||||
|
padding-bottom 13px
|
||||||
|
flex 1
|
||||||
|
p
|
||||||
|
color $ui-button-default-color
|
||||||
|
.tag-control-sortTagsBy
|
||||||
|
user-select none
|
||||||
|
font-size 12px
|
||||||
|
color $ui-inactive-text-color
|
||||||
|
margin-left 12px
|
||||||
|
margin-right 12px
|
||||||
|
.tag-control-sortTagsBy-select
|
||||||
|
appearance: none;
|
||||||
|
margin-left 5px
|
||||||
|
color $ui-inactive-text-color
|
||||||
|
padding 0
|
||||||
|
border none
|
||||||
|
background-color transparent
|
||||||
|
outline none
|
||||||
|
cursor pointer
|
||||||
|
font-size 12px
|
||||||
|
|
||||||
.tagList
|
.tagList
|
||||||
overflow-y auto
|
overflow-y auto
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import RenameFolderModal from 'browser/main/modals/RenameFolderModal'
|
|||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import StorageItemChild from 'browser/components/StorageItem'
|
import StorageItemChild from 'browser/components/StorageItem'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import { SortableElement } from 'react-sortable-hoc'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const { remote } = require('electron')
|
const { remote } = require('electron')
|
||||||
const { Menu, dialog } = remote
|
const { Menu, dialog } = remote
|
||||||
@@ -25,14 +27,14 @@ class StorageItem extends React.Component {
|
|||||||
handleHeaderContextMenu (e) {
|
handleHeaderContextMenu (e) {
|
||||||
const menu = Menu.buildFromTemplate([
|
const menu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
label: 'Add Folder',
|
label: i18n.__('Add Folder'),
|
||||||
click: (e) => this.handleAddFolderButtonClick(e)
|
click: (e) => this.handleAddFolderButtonClick(e)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Unlink Storage',
|
label: i18n.__('Unlink Storage'),
|
||||||
click: (e) => this.handleUnlinkStorageClick(e)
|
click: (e) => this.handleUnlinkStorageClick(e)
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -43,9 +45,9 @@ class StorageItem extends React.Component {
|
|||||||
handleUnlinkStorageClick (e) {
|
handleUnlinkStorageClick (e) {
|
||||||
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Unlink Storage',
|
message: i18n.__('Unlink Storage'),
|
||||||
detail: 'This work will just detatches a storage from Boostnote. (Any data won\'t be deleted.)',
|
detail: i18n.__('This work will just detatches a storage from Boostnote. (Any data won\'t be deleted.)'),
|
||||||
buttons: ['Confirm', 'Cancel']
|
buttons: [i18n.__('Confirm'), i18n.__('Cancel')]
|
||||||
})
|
})
|
||||||
|
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
@@ -92,21 +94,21 @@ class StorageItem extends React.Component {
|
|||||||
handleFolderButtonContextMenu (e, folder) {
|
handleFolderButtonContextMenu (e, folder) {
|
||||||
const menu = Menu.buildFromTemplate([
|
const menu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
label: 'Rename Folder',
|
label: i18n.__('Rename Folder'),
|
||||||
click: (e) => this.handleRenameFolderClick(e, folder)
|
click: (e) => this.handleRenameFolderClick(e, folder)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Export Folder',
|
label: i18n.__('Export Folder'),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'Export as txt',
|
label: i18n.__('Export as txt'),
|
||||||
click: (e) => this.handleExportFolderClick(e, folder, 'txt')
|
click: (e) => this.handleExportFolderClick(e, folder, 'txt')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Export as md',
|
label: i18n.__('Export as md'),
|
||||||
click: (e) => this.handleExportFolderClick(e, folder, 'md')
|
click: (e) => this.handleExportFolderClick(e, folder, 'md')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -115,7 +117,7 @@ class StorageItem extends React.Component {
|
|||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Delete Folder',
|
label: i18n.__('Delete Folder'),
|
||||||
click: (e) => this.handleFolderDeleteClick(e, folder)
|
click: (e) => this.handleFolderDeleteClick(e, folder)
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -134,8 +136,8 @@ class StorageItem extends React.Component {
|
|||||||
handleExportFolderClick (e, folder, fileType) {
|
handleExportFolderClick (e, folder, fileType) {
|
||||||
const options = {
|
const options = {
|
||||||
properties: ['openDirectory', 'createDirectory'],
|
properties: ['openDirectory', 'createDirectory'],
|
||||||
buttonLabel: 'Select directory',
|
buttonLabel: i18n.__('Select directory'),
|
||||||
title: 'Select a folder to export the files to',
|
title: i18n.__('Select a folder to export the files to'),
|
||||||
multiSelections: false
|
multiSelections: false
|
||||||
}
|
}
|
||||||
dialog.showOpenDialog(remote.getCurrentWindow(), options,
|
dialog.showOpenDialog(remote.getCurrentWindow(), options,
|
||||||
@@ -159,9 +161,9 @@ class StorageItem extends React.Component {
|
|||||||
handleFolderDeleteClick (e, folder) {
|
handleFolderDeleteClick (e, folder) {
|
||||||
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Delete Folder',
|
message: i18n.__('Delete Folder'),
|
||||||
detail: 'This will delete all notes in the folder and can not be undone.',
|
detail: i18n.__('This will delete all notes in the folder and can not be undone.'),
|
||||||
buttons: ['Confirm', 'Cancel']
|
buttons: [i18n.__('Confirm'), i18n.__('Cancel')]
|
||||||
})
|
})
|
||||||
|
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
@@ -191,33 +193,16 @@ class StorageItem extends React.Component {
|
|||||||
dropNote (storage, folder, dispatch, location, noteData) {
|
dropNote (storage, folder, dispatch, location, noteData) {
|
||||||
noteData = noteData.filter((note) => folder.key !== note.folder)
|
noteData = noteData.filter((note) => folder.key !== note.folder)
|
||||||
if (noteData.length === 0) return
|
if (noteData.length === 0) return
|
||||||
const newNoteData = noteData.map((note) => Object.assign({}, note, {storage: storage, folder: folder.key}))
|
|
||||||
|
|
||||||
Promise.all(
|
Promise.all(
|
||||||
newNoteData.map((note) => dataApi.createNote(storage.key, note))
|
noteData.map((note) => dataApi.moveNote(note.storage, note.key, storage.key, folder.key))
|
||||||
)
|
)
|
||||||
.then((createdNoteData) => {
|
.then((createdNoteData) => {
|
||||||
createdNoteData.forEach((note) => {
|
createdNoteData.forEach((newNote) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'UPDATE_NOTE',
|
type: 'MOVE_NOTE',
|
||||||
note: note
|
originNote: noteData.find((note) => note.content === newNote.content),
|
||||||
})
|
note: newNote
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(`error on create notes: ${err}`)
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
return Promise.all(
|
|
||||||
noteData.map((note) => dataApi.deleteNote(note.storage, note.key))
|
|
||||||
)
|
|
||||||
})
|
|
||||||
.then((deletedNoteData) => {
|
|
||||||
deletedNoteData.forEach((note) => {
|
|
||||||
dispatch({
|
|
||||||
type: 'DELETE_NOTE',
|
|
||||||
storageKey: note.storageKey,
|
|
||||||
noteKey: note.noteKey
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -236,7 +221,8 @@ class StorageItem extends React.Component {
|
|||||||
render () {
|
render () {
|
||||||
const { storage, location, isFolded, data, dispatch } = this.props
|
const { storage, location, isFolded, data, dispatch } = this.props
|
||||||
const { folderNoteMap, trashedSet } = data
|
const { folderNoteMap, trashedSet } = data
|
||||||
const folderList = storage.folders.map((folder) => {
|
const SortableStorageItemChild = SortableElement(StorageItemChild)
|
||||||
|
const folderList = storage.folders.map((folder, index) => {
|
||||||
const isActive = !!(location.pathname.match(new RegExp('\/storages\/' + storage.key + '\/folders\/' + folder.key)))
|
const isActive = !!(location.pathname.match(new RegExp('\/storages\/' + storage.key + '\/folders\/' + folder.key)))
|
||||||
const noteSet = folderNoteMap.get(storage.key + '-' + folder.key)
|
const noteSet = folderNoteMap.get(storage.key + '-' + folder.key)
|
||||||
|
|
||||||
@@ -250,8 +236,9 @@ class StorageItem extends React.Component {
|
|||||||
noteCount = noteSet.size - trashedNoteCount
|
noteCount = noteSet.size - trashedNoteCount
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<StorageItemChild
|
<SortableStorageItemChild
|
||||||
key={folder.key}
|
key={folder.key}
|
||||||
|
index={index}
|
||||||
isActive={isActive}
|
isActive={isActive}
|
||||||
handleButtonClick={(e) => this.handleFolderButtonClick(folder.key)(e)}
|
handleButtonClick={(e) => this.handleFolderButtonClick(folder.key)(e)}
|
||||||
handleContextMenu={(e) => this.handleFolderButtonContextMenu(e, folder)}
|
handleContextMenu={(e) => this.handleFolderButtonContextMenu(e, folder)}
|
||||||
@@ -273,9 +260,9 @@ class StorageItem extends React.Component {
|
|||||||
key={storage.key}
|
key={storage.key}
|
||||||
>
|
>
|
||||||
<div styleName={isActive
|
<div styleName={isActive
|
||||||
? 'header--active'
|
? 'header--active'
|
||||||
: 'header'
|
: 'header'
|
||||||
}
|
}
|
||||||
onContextMenu={(e) => this.handleHeaderContextMenu(e)}
|
onContextMenu={(e) => this.handleHeaderContextMenu(e)}
|
||||||
>
|
>
|
||||||
<button styleName='header-toggleButton'
|
<button styleName='header-toggleButton'
|
||||||
@@ -284,7 +271,7 @@ class StorageItem extends React.Component {
|
|||||||
<img src={this.state.isOpen
|
<img src={this.state.isOpen
|
||||||
? '../resources/icon/icon-down.svg'
|
? '../resources/icon/icon-down.svg'
|
||||||
: '../resources/icon/icon-right.svg'
|
: '../resources/icon/icon-right.svg'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './SwitchButton.styl'
|
import styles from './SwitchButton.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const TagButton = ({
|
const TagButton = ({
|
||||||
onClick, isTagActive
|
onClick, isTagActive
|
||||||
@@ -12,7 +13,7 @@ const TagButton = ({
|
|||||||
: '../resources/icon/icon-tag.svg'
|
: '../resources/icon/icon-tag.svg'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<span styleName='tooltip'>Tags</span>
|
<span styleName='tooltip'>{i18n.__('Tags')}</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import EventEmitter from 'browser/main/lib/eventEmitter'
|
|||||||
import PreferenceButton from './PreferenceButton'
|
import PreferenceButton from './PreferenceButton'
|
||||||
import ListButton from './ListButton'
|
import ListButton from './ListButton'
|
||||||
import TagButton from './TagButton'
|
import TagButton from './TagButton'
|
||||||
|
import {SortableContainer} from 'react-sortable-hoc'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class SideNav extends React.Component {
|
class SideNav extends React.Component {
|
||||||
// TODO: should not use electron stuff v0.7
|
// TODO: should not use electron stuff v0.7
|
||||||
@@ -68,8 +70,19 @@ class SideNav extends React.Component {
|
|||||||
router.push('/alltags')
|
router.push('/alltags')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSortEnd (storage) {
|
||||||
|
return ({oldIndex, newIndex}) => {
|
||||||
|
const { dispatch } = this.props
|
||||||
|
dataApi
|
||||||
|
.reorderFolder(storage.key, oldIndex, newIndex)
|
||||||
|
.then((data) => {
|
||||||
|
dispatch({ type: 'REORDER_FOLDER', storage: data.storage })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SideNavComponent (isFolded, storageList) {
|
SideNavComponent (isFolded, storageList) {
|
||||||
const { location, data } = this.props
|
const { location, data, config } = this.props
|
||||||
|
|
||||||
const isHomeActive = !!location.pathname.match(/^\/home$/)
|
const isHomeActive = !!location.pathname.match(/^\/home$/)
|
||||||
const isStarredActive = !!location.pathname.match(/^\/starred$/)
|
const isStarredActive = !!location.pathname.match(/^\/starred$/)
|
||||||
@@ -95,15 +108,30 @@ class SideNav extends React.Component {
|
|||||||
handleFilterButtonContextMenu={this.handleFilterButtonContextMenu.bind(this)}
|
handleFilterButtonContextMenu={this.handleFilterButtonContextMenu.bind(this)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<StorageList storageList={storageList} />
|
<StorageList storageList={storageList} isFolded={isFolded} />
|
||||||
<NavToggleButton isFolded={isFolded} handleToggleButtonClick={this.handleToggleButtonClick.bind(this)} />
|
<NavToggleButton isFolded={isFolded} handleToggleButtonClick={this.handleToggleButtonClick.bind(this)} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
component = (
|
component = (
|
||||||
<div styleName='tabBody'>
|
<div styleName='tabBody'>
|
||||||
<div styleName='tag-title'>
|
<div styleName='tag-control'>
|
||||||
<p>Tags</p>
|
<div styleName='tag-control-title'>
|
||||||
|
<p>{i18n.__('Tags')}</p>
|
||||||
|
</div>
|
||||||
|
<div styleName='tag-control-sortTagsBy'>
|
||||||
|
<i className='fa fa-angle-down' />
|
||||||
|
<select styleName='tag-control-sortTagsBy-select'
|
||||||
|
title={i18n.__('Select filter mode')}
|
||||||
|
value={config.sortTagsBy}
|
||||||
|
onChange={(e) => this.handleSortTagsByChange(e)}
|
||||||
|
>
|
||||||
|
<option title='Sort alphabetically'
|
||||||
|
value='ALPHABETICAL'>{i18n.__('Alphabetically')}</option>
|
||||||
|
<option title='Sort by update time'
|
||||||
|
value='COUNTER'>{i18n.__('Counter')}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='tagList'>
|
<div styleName='tagList'>
|
||||||
{this.tagListComponent(data)}
|
{this.tagListComponent(data)}
|
||||||
@@ -116,17 +144,21 @@ class SideNav extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tagListComponent () {
|
tagListComponent () {
|
||||||
const { data, location } = this.props
|
const { data, location, config } = this.props
|
||||||
const tagList = data.tagNoteMap.map((tag, name) => {
|
let tagList = _.sortBy(data.tagNoteMap.map(
|
||||||
return { name, size: tag.size }
|
(tag, name) => ({name, size: tag.size})),
|
||||||
})
|
['name']
|
||||||
|
)
|
||||||
|
if (config.sortTagsBy === 'COUNTER') {
|
||||||
|
tagList = _.sortBy(tagList, item => (0 - item.size))
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
tagList.map(tag => {
|
tagList.map(tag => {
|
||||||
return (
|
return (
|
||||||
<TagListItem
|
<TagListItem
|
||||||
name={tag.name}
|
name={tag.name}
|
||||||
handleClickTagListItem={this.handleClickTagListItem.bind(this)}
|
handleClickTagListItem={this.handleClickTagListItem.bind(this)}
|
||||||
isActive={this.getTagActive(location.pathname, tag)}
|
isActive={this.getTagActive(location.pathname, tag.name)}
|
||||||
key={tag.name}
|
key={tag.name}
|
||||||
count={tag.size}
|
count={tag.size}
|
||||||
/>
|
/>
|
||||||
@@ -146,12 +178,24 @@ class SideNav extends React.Component {
|
|||||||
router.push(`/tags/${name}`)
|
router.push(`/tags/${name}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleSortTagsByChange (e) {
|
||||||
|
const { dispatch } = this.props
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
sortTagsBy: e.target.value
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigManager.set(config)
|
||||||
|
dispatch({
|
||||||
|
type: 'SET_CONFIG',
|
||||||
|
config
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
emptyTrash (entries) {
|
emptyTrash (entries) {
|
||||||
const { dispatch } = this.props
|
const { dispatch } = this.props
|
||||||
const deletionPromises = entries.map((storageAndNoteKey) => {
|
const deletionPromises = entries.map((note) => {
|
||||||
const storageKey = storageAndNoteKey.split('-')[0]
|
return dataApi.deleteNote(note.storage, note.key)
|
||||||
const noteKey = storageAndNoteKey.split('-')[1]
|
|
||||||
return dataApi.deleteNote(storageKey, noteKey)
|
|
||||||
})
|
})
|
||||||
Promise.all(deletionPromises)
|
Promise.all(deletionPromises)
|
||||||
.then((arrayOfStorageAndNoteKeys) => {
|
.then((arrayOfStorageAndNoteKeys) => {
|
||||||
@@ -167,9 +211,9 @@ class SideNav extends React.Component {
|
|||||||
|
|
||||||
handleFilterButtonContextMenu (event) {
|
handleFilterButtonContextMenu (event) {
|
||||||
const { data } = this.props
|
const { data } = this.props
|
||||||
const entries = data.trashedSet.toJS()
|
const trashedNotes = data.trashedSet.toJS().map((uniqueKey) => data.noteMap.get(uniqueKey))
|
||||||
const menu = Menu.buildFromTemplate([
|
const menu = Menu.buildFromTemplate([
|
||||||
{ label: 'Empty Trash', click: () => this.emptyTrash(entries) }
|
{ label: i18n.__('Empty Trash'), click: () => this.emptyTrash(trashedNotes) }
|
||||||
])
|
])
|
||||||
menu.popup()
|
menu.popup()
|
||||||
}
|
}
|
||||||
@@ -180,13 +224,16 @@ class SideNav extends React.Component {
|
|||||||
const isFolded = config.isSideNavFolded
|
const isFolded = config.isSideNavFolded
|
||||||
|
|
||||||
const storageList = data.storageMap.map((storage, key) => {
|
const storageList = data.storageMap.map((storage, key) => {
|
||||||
return <StorageItem
|
const SortableStorageItem = SortableContainer(StorageItem)
|
||||||
|
return <SortableStorageItem
|
||||||
key={storage.key}
|
key={storage.key}
|
||||||
storage={storage}
|
storage={storage}
|
||||||
data={data}
|
data={data}
|
||||||
location={location}
|
location={location}
|
||||||
isFolded={isFolded}
|
isFolded={isFolded}
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
|
onSortEnd={this.onSortEnd.bind(this)(storage)}
|
||||||
|
useDragHandle
|
||||||
/>
|
/>
|
||||||
})
|
})
|
||||||
const style = {}
|
const style = {}
|
||||||
|
|||||||
@@ -21,20 +21,19 @@
|
|||||||
color white
|
color white
|
||||||
|
|
||||||
.zoom
|
.zoom
|
||||||
display none
|
navButtonColor()
|
||||||
// navButtonColor()
|
color rgba(0,0,0,.54)
|
||||||
// color rgba(0,0,0,.54)
|
height 20px
|
||||||
// height 20px
|
display flex
|
||||||
// display flex
|
padding 0
|
||||||
// padding 0
|
align-items center
|
||||||
// align-items center
|
background-color transparent
|
||||||
// background-color transparent
|
&:hover
|
||||||
// &:hover
|
color $ui-active-color
|
||||||
// color $ui-active-color
|
&:active
|
||||||
// &:active
|
color $ui-active-color
|
||||||
// color $ui-active-color
|
span
|
||||||
// span
|
margin-left 5px
|
||||||
// margin-left 5px
|
|
||||||
|
|
||||||
.update
|
.update
|
||||||
navButtonColor()
|
navButtonColor()
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React from 'react'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './StatusBar.styl'
|
import styles from './StatusBar.styl'
|
||||||
import ZoomManager from 'browser/main/lib/ZoomManager'
|
import ZoomManager from 'browser/main/lib/ZoomManager'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const { remote, ipcRenderer } = electron
|
const { remote, ipcRenderer } = electron
|
||||||
@@ -14,9 +15,9 @@ class StatusBar extends React.Component {
|
|||||||
updateApp () {
|
updateApp () {
|
||||||
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Update Boostnote',
|
message: i18n.__('Update Boostnote'),
|
||||||
detail: 'New Boostnote is ready to be installed.',
|
detail: i18n.__('New Boostnote is ready to be installed.'),
|
||||||
buttons: ['Restart & Install', 'Not Now']
|
buttons: [i18n.__('Restart & Install'), i18n.__('Not Now')]
|
||||||
})
|
})
|
||||||
|
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
@@ -62,7 +63,7 @@ class StatusBar extends React.Component {
|
|||||||
|
|
||||||
{status.updateReady
|
{status.updateReady
|
||||||
? <button onClick={this.updateApp} styleName='update'>
|
? <button onClick={this.updateApp} styleName='update'>
|
||||||
<i styleName='update-icon' className='fa fa-cloud-download' /> Ready to Update!
|
<i styleName='update-icon' className='fa fa-cloud-download' /> {i18n.__('Ready to Update!')}
|
||||||
</button>
|
</button>
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,32 @@ $control-height = 34px
|
|||||||
padding-bottom 2px
|
padding-bottom 2px
|
||||||
background-color $ui-noteList-backgroundColor
|
background-color $ui-noteList-backgroundColor
|
||||||
|
|
||||||
|
.control-search-input-clear
|
||||||
|
height 16px
|
||||||
|
width 16px
|
||||||
|
position absolute
|
||||||
|
right 40px
|
||||||
|
top 10px
|
||||||
|
z-index 300
|
||||||
|
border none
|
||||||
|
background-color transparent
|
||||||
|
color #999
|
||||||
|
&:hover .control-search-input-clear-tooltip
|
||||||
|
opacity 1
|
||||||
|
|
||||||
|
.control-search-input-clear-tooltip
|
||||||
|
tooltip()
|
||||||
|
position fixed
|
||||||
|
pointer-events none
|
||||||
|
top 50px
|
||||||
|
left 433px
|
||||||
|
z-index 200
|
||||||
|
padding 5px
|
||||||
|
line-height normal
|
||||||
|
border-radius 2px
|
||||||
|
opacity 0
|
||||||
|
transition 0.1s
|
||||||
|
|
||||||
.control-search-optionList
|
.control-search-optionList
|
||||||
position fixed
|
position fixed
|
||||||
z-index 200
|
z-index 200
|
||||||
@@ -207,4 +233,4 @@ body[data-theme="solarized-dark"]
|
|||||||
background-color $ui-solarized-dark-noteList-backgroundColor
|
background-color $ui-solarized-dark-noteList-backgroundColor
|
||||||
input
|
input
|
||||||
background-color $ui-solarized-dark-noteList-backgroundColor
|
background-color $ui-solarized-dark-noteList-backgroundColor
|
||||||
color $ui-solarized-dark-text-color
|
color $ui-solarized-dark-text-color
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import styles from './TopBar.styl'
|
|||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import ee from 'browser/main/lib/eventEmitter'
|
import ee from 'browser/main/lib/eventEmitter'
|
||||||
import NewNoteButton from 'browser/main/NewNoteButton'
|
import NewNoteButton from 'browser/main/NewNoteButton'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class TopBar extends React.Component {
|
class TopBar extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -27,6 +28,14 @@ class TopBar extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
|
const { params } = this.props
|
||||||
|
const searchWord = params.searchword
|
||||||
|
if (searchWord !== undefined) {
|
||||||
|
this.setState({
|
||||||
|
search: searchWord,
|
||||||
|
isSearching: true
|
||||||
|
})
|
||||||
|
}
|
||||||
ee.on('top:focus-search', this.focusSearchHandler)
|
ee.on('top:focus-search', this.focusSearchHandler)
|
||||||
ee.on('code:init', this.codeInitHandler)
|
ee.on('code:init', this.codeInitHandler)
|
||||||
}
|
}
|
||||||
@@ -36,6 +45,17 @@ class TopBar extends React.Component {
|
|||||||
ee.off('code:init', this.codeInitHandler)
|
ee.off('code:init', this.codeInitHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleSearchClearButton (e) {
|
||||||
|
const { router } = this.context
|
||||||
|
this.setState({
|
||||||
|
search: '',
|
||||||
|
isSearching: false
|
||||||
|
})
|
||||||
|
this.refs.search.childNodes[0].blur
|
||||||
|
router.push('/searched')
|
||||||
|
e.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
handleKeyDown (e) {
|
handleKeyDown (e) {
|
||||||
// reset states
|
// reset states
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -43,6 +63,23 @@ class TopBar extends React.Component {
|
|||||||
isIME: false
|
isIME: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Clear search on ESC
|
||||||
|
if (e.keyCode === 27) {
|
||||||
|
return this.handleSearchClearButton(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Next note on DOWN key
|
||||||
|
if (e.keyCode === 40) {
|
||||||
|
ee.emit('list:next')
|
||||||
|
e.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prev note on UP key
|
||||||
|
if (e.keyCode === 38) {
|
||||||
|
ee.emit('list:prior')
|
||||||
|
e.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
// When the key is an alphabet, del, enter or ctr
|
// When the key is an alphabet, del, enter or ctr
|
||||||
if (e.keyCode <= 90 || e.keyCode >= 186 && e.keyCode <= 222) {
|
if (e.keyCode <= 90 || e.keyCode >= 186 && e.keyCode <= 222) {
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -68,9 +105,10 @@ class TopBar extends React.Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
isConfirmTranslation: true
|
isConfirmTranslation: true
|
||||||
})
|
})
|
||||||
router.push('/searched')
|
const keyword = this.refs.searchInput.value
|
||||||
|
router.push(`/searched/${encodeURIComponent(keyword)}`)
|
||||||
this.setState({
|
this.setState({
|
||||||
search: this.refs.searchInput.value
|
search: keyword
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,7 +117,7 @@ class TopBar extends React.Component {
|
|||||||
const { router } = this.context
|
const { router } = this.context
|
||||||
const keyword = this.refs.searchInput.value
|
const keyword = this.refs.searchInput.value
|
||||||
if (this.state.isAlphabet || this.state.isConfirmTranslation) {
|
if (this.state.isAlphabet || this.state.isConfirmTranslation) {
|
||||||
router.push('/searched')
|
router.push(`/searched/${encodeURIComponent(keyword)}`)
|
||||||
} else {
|
} else {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
@@ -114,10 +152,12 @@ class TopBar extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleOnSearchFocus () {
|
handleOnSearchFocus () {
|
||||||
|
const el = this.refs.search.childNodes[0]
|
||||||
if (this.state.isSearching) {
|
if (this.state.isSearching) {
|
||||||
this.refs.search.childNodes[0].blur()
|
el.blur()
|
||||||
} else {
|
} else {
|
||||||
this.refs.search.childNodes[0].focus()
|
el.focus()
|
||||||
|
el.setSelectionRange(0, el.value.length)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,19 +186,19 @@ class TopBar extends React.Component {
|
|||||||
onChange={(e) => this.handleSearchChange(e)}
|
onChange={(e) => this.handleSearchChange(e)}
|
||||||
onKeyDown={(e) => this.handleKeyDown(e)}
|
onKeyDown={(e) => this.handleKeyDown(e)}
|
||||||
onKeyUp={(e) => this.handleKeyUp(e)}
|
onKeyUp={(e) => this.handleKeyUp(e)}
|
||||||
placeholder='Search'
|
placeholder={i18n.__('Search')}
|
||||||
type='text'
|
type='text'
|
||||||
className='searchInput'
|
className='searchInput'
|
||||||
/>
|
/>
|
||||||
|
{this.state.search !== '' &&
|
||||||
|
<button styleName='control-search-input-clear'
|
||||||
|
onClick={(e) => this.handleSearchClearButton(e)}
|
||||||
|
>
|
||||||
|
<i className='fa fa-fw fa-times' />
|
||||||
|
<span styleName='control-search-input-clear-tooltip'>{i18n.__('Clear Search')}</span>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
{this.state.search > 0 &&
|
|
||||||
<button styleName='left-search-clearButton'
|
|
||||||
onClick={(e) => this.handleSearchClearButton(e)}
|
|
||||||
>
|
|
||||||
<i className='fa fa-times' />
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{location.pathname === '/trashed' ? ''
|
{location.pathname === '/trashed' ? ''
|
||||||
|
|||||||
@@ -108,6 +108,21 @@ body[data-theme="dark"]
|
|||||||
background #B1D7FE
|
background #B1D7FE
|
||||||
::selection
|
::selection
|
||||||
background #B1D7FE
|
background #B1D7FE
|
||||||
|
.CodeMirror-foldmarker
|
||||||
|
font-family: arial
|
||||||
|
|
||||||
|
.CodeMirror-foldgutter
|
||||||
|
width: .7em
|
||||||
|
|
||||||
|
.CodeMirror-foldgutter-open,
|
||||||
|
.CodeMirror-foldgutter-folded
|
||||||
|
cursor: pointer
|
||||||
|
|
||||||
|
.CodeMirror-foldgutter-open:after
|
||||||
|
content: "\25BE"
|
||||||
|
|
||||||
|
.CodeMirror-foldgutter-folded:after
|
||||||
|
content: "\25B8"
|
||||||
|
|
||||||
.sortableItemHelper
|
.sortableItemHelper
|
||||||
z-index modalZIndex + 5
|
z-index modalZIndex + 5
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { Router, Route, IndexRoute, IndexRedirect, hashHistory } from 'react-rou
|
|||||||
import { syncHistoryWithStore } from 'react-router-redux'
|
import { syncHistoryWithStore } from 'react-router-redux'
|
||||||
require('./lib/ipcClient')
|
require('./lib/ipcClient')
|
||||||
require('../lib/customMeta')
|
require('../lib/customMeta')
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
|
|
||||||
@@ -46,9 +47,9 @@ function notify (...args) {
|
|||||||
function updateApp () {
|
function updateApp () {
|
||||||
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Update Boostnote',
|
message: i18n.__('Update Boostnote'),
|
||||||
detail: 'New Boostnote is ready to be installed.',
|
detail: i18n.__('New Boostnote is ready to be installed.'),
|
||||||
buttons: ['Restart & Install', 'Not Now']
|
buttons: [i18n.__('Restart & Install'), i18n.__('Not Now')]
|
||||||
})
|
})
|
||||||
|
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
@@ -63,7 +64,9 @@ ReactDOM.render((
|
|||||||
<IndexRedirect to='/home' />
|
<IndexRedirect to='/home' />
|
||||||
<Route path='home' />
|
<Route path='home' />
|
||||||
<Route path='starred' />
|
<Route path='starred' />
|
||||||
<Route path='searched' />
|
<Route path='searched'>
|
||||||
|
<Route path=':searchword' />
|
||||||
|
</Route>
|
||||||
<Route path='trashed' />
|
<Route path='trashed' />
|
||||||
<Route path='alltags' />
|
<Route path='alltags' />
|
||||||
<Route path='tags'>
|
<Route path='tags'>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import RcParser from 'browser/lib/RcParser'
|
import RcParser from 'browser/lib/RcParser'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const OSX = global.process.platform === 'darwin'
|
const OSX = global.process.platform === 'darwin'
|
||||||
const win = global.process.platform === 'win32'
|
const win = global.process.platform === 'win32'
|
||||||
@@ -15,12 +16,14 @@ export const DEFAULT_CONFIG = {
|
|||||||
listWidth: 280,
|
listWidth: 280,
|
||||||
navWidth: 200,
|
navWidth: 200,
|
||||||
sortBy: 'UPDATED_AT', // 'CREATED_AT', 'UPDATED_AT', 'APLHABETICAL'
|
sortBy: 'UPDATED_AT', // 'CREATED_AT', 'UPDATED_AT', 'APLHABETICAL'
|
||||||
|
sortTagsBy: 'ALPHABETICAL', // 'ALPHABETICAL', 'COUNTER'
|
||||||
listStyle: 'DEFAULT', // 'DEFAULT', 'SMALL'
|
listStyle: 'DEFAULT', // 'DEFAULT', 'SMALL'
|
||||||
amaEnabled: true,
|
amaEnabled: true,
|
||||||
hotkey: {
|
hotkey: {
|
||||||
toggleMain: OSX ? 'Cmd + Alt + L' : 'Super + Alt + E'
|
toggleMain: OSX ? 'Cmd + Alt + L' : 'Super + Alt + E'
|
||||||
},
|
},
|
||||||
ui: {
|
ui: {
|
||||||
|
language: 'en',
|
||||||
theme: 'default',
|
theme: 'default',
|
||||||
showCopyNotification: true,
|
showCopyNotification: true,
|
||||||
disableDirectWrite: false,
|
disableDirectWrite: false,
|
||||||
@@ -33,6 +36,8 @@ export const DEFAULT_CONFIG = {
|
|||||||
fontFamily: win ? 'Segoe UI' : 'Monaco, Consolas',
|
fontFamily: win ? 'Segoe UI' : 'Monaco, Consolas',
|
||||||
indentType: 'space',
|
indentType: 'space',
|
||||||
indentSize: '2',
|
indentSize: '2',
|
||||||
|
enableRulers: false,
|
||||||
|
rulers: [80, 120],
|
||||||
displayLineNumbers: true,
|
displayLineNumbers: true,
|
||||||
switchPreview: 'BLUR', // Available value: RIGHTCLICK, BLUR
|
switchPreview: 'BLUR', // Available value: RIGHTCLICK, BLUR
|
||||||
scrollPastEnd: false,
|
scrollPastEnd: false,
|
||||||
@@ -48,7 +53,17 @@ export const DEFAULT_CONFIG = {
|
|||||||
latexInlineClose: '$',
|
latexInlineClose: '$',
|
||||||
latexBlockOpen: '$$',
|
latexBlockOpen: '$$',
|
||||||
latexBlockClose: '$$',
|
latexBlockClose: '$$',
|
||||||
scrollPastEnd: false
|
scrollPastEnd: false,
|
||||||
|
smartQuotes: true,
|
||||||
|
sanitize: 'STRICT' // 'STRICT', 'ALLOW_STYLES', 'NONE'
|
||||||
|
},
|
||||||
|
blog: {
|
||||||
|
type: 'wordpress', // Available value: wordpress, add more types in the future plz
|
||||||
|
address: 'http://wordpress.com/wp-json',
|
||||||
|
authMethod: 'JWT', // Available value: JWT, USER
|
||||||
|
token: '',
|
||||||
|
username: '',
|
||||||
|
password: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,6 +139,8 @@ function set (updates) {
|
|||||||
document.body.setAttribute('data-theme', 'default')
|
document.body.setAttribute('data-theme', 'default')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i18n.setLocale(newConfig.ui.language)
|
||||||
|
|
||||||
let editorTheme = document.getElementById('editorTheme')
|
let editorTheme = document.getElementById('editorTheme')
|
||||||
if (editorTheme == null) {
|
if (editorTheme == null) {
|
||||||
editorTheme = document.createElement('link')
|
editorTheme = document.createElement('link')
|
||||||
@@ -151,6 +168,7 @@ function set (updates) {
|
|||||||
function assignConfigValues (originalConfig, rcConfig) {
|
function assignConfigValues (originalConfig, rcConfig) {
|
||||||
const config = Object.assign({}, DEFAULT_CONFIG, originalConfig, rcConfig)
|
const config = Object.assign({}, DEFAULT_CONFIG, originalConfig, rcConfig)
|
||||||
config.hotkey = Object.assign({}, DEFAULT_CONFIG.hotkey, originalConfig.hotkey, rcConfig.hotkey)
|
config.hotkey = Object.assign({}, DEFAULT_CONFIG.hotkey, originalConfig.hotkey, rcConfig.hotkey)
|
||||||
|
config.blog = Object.assign({}, DEFAULT_CONFIG.blog, originalConfig.blog, rcConfig.blog)
|
||||||
config.ui = Object.assign({}, DEFAULT_CONFIG.ui, originalConfig.ui, rcConfig.ui)
|
config.ui = Object.assign({}, DEFAULT_CONFIG.ui, originalConfig.ui, rcConfig.ui)
|
||||||
config.editor = Object.assign({}, DEFAULT_CONFIG.editor, originalConfig.editor, rcConfig.editor)
|
config.editor = Object.assign({}, DEFAULT_CONFIG.editor, originalConfig.editor, rcConfig.editor)
|
||||||
config.preview = Object.assign({}, DEFAULT_CONFIG.preview, originalConfig.preview, rcConfig.preview)
|
config.preview = Object.assign({}, DEFAULT_CONFIG.preview, originalConfig.preview, rcConfig.preview)
|
||||||
|
|||||||
@@ -3,19 +3,20 @@ const path = require('path')
|
|||||||
const { findStorage } = require('browser/lib/findStorage')
|
const { findStorage } = require('browser/lib/findStorage')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description To copy an image and return the path.
|
* @description Copy an image and return the path.
|
||||||
* @param {String} filePath
|
* @param {String} filePath
|
||||||
* @param {String} storageKey
|
* @param {String} storageKey
|
||||||
* @return {String} an image path
|
* @param {Boolean} rename create new filename or leave the old one
|
||||||
|
* @return {Promise<any>} an image path
|
||||||
*/
|
*/
|
||||||
function copyImage (filePath, storageKey) {
|
function copyImage (filePath, storageKey, rename = true) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
const targetStorage = findStorage(storageKey)
|
const targetStorage = findStorage(storageKey)
|
||||||
|
|
||||||
const inputImage = fs.createReadStream(filePath)
|
const inputImage = fs.createReadStream(filePath)
|
||||||
const imageExt = path.extname(filePath)
|
const imageExt = path.extname(filePath)
|
||||||
const imageName = Math.random().toString(36).slice(-16)
|
const imageName = rename ? Math.random().toString(36).slice(-16) : path.basename(filePath, imageExt)
|
||||||
const basename = `${imageName}${imageExt}`
|
const basename = `${imageName}${imageExt}`
|
||||||
const imageDir = path.join(targetStorage.path, 'images')
|
const imageDir = path.join(targetStorage.path, 'images')
|
||||||
if (!fs.existsSync(imageDir)) fs.mkdirSync(imageDir)
|
if (!fs.existsSync(imageDir)) fs.mkdirSync(imageDir)
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ function createNote (storageKey, input) {
|
|||||||
return storage
|
return storage
|
||||||
})
|
})
|
||||||
.then(function saveNote (storage) {
|
.then(function saveNote (storage) {
|
||||||
let key = keygen()
|
let key = keygen(true)
|
||||||
let isUnique = false
|
let isUnique = false
|
||||||
while (!isUnique) {
|
while (!isUnique) {
|
||||||
try {
|
try {
|
||||||
sander.statSync(path.join(storage.path, 'notes', key + '.cson'))
|
sander.statSync(path.join(storage.path, 'notes', key + '.cson'))
|
||||||
key = keygen()
|
key = keygen(true)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code === 'ENOENT') {
|
if (err.code === 'ENOENT') {
|
||||||
isUnique = true
|
isUnique = true
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { findStorage } from 'browser/lib/findStorage'
|
import { findStorage } from 'browser/lib/findStorage'
|
||||||
import resolveStorageData from './resolveStorageData'
|
import resolveStorageData from './resolveStorageData'
|
||||||
import resolveStorageNotes from './resolveStorageNotes'
|
import resolveStorageNotes from './resolveStorageNotes'
|
||||||
|
import filenamify from 'filenamify'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ function exportFolder (storageKey, folderKey, fileType, exportDir) {
|
|||||||
notes
|
notes
|
||||||
.filter(note => note.folder === folderKey && note.isTrashed === false && note.type === 'MARKDOWN_NOTE')
|
.filter(note => note.folder === folderKey && note.isTrashed === false && note.type === 'MARKDOWN_NOTE')
|
||||||
.forEach(snippet => {
|
.forEach(snippet => {
|
||||||
const notePath = path.join(exportDir, `${snippet.title}.${fileType}`)
|
const notePath = path.join(exportDir, `${filenamify(snippet.title, {replacement: '_'})}.${fileType}`)
|
||||||
fs.writeFileSync(notePath, snippet.content)
|
fs.writeFileSync(notePath, snippet.content)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import copyFile from 'browser/main/lib/dataApi/copyFile'
|
import copyFile from 'browser/main/lib/dataApi/copyFile'
|
||||||
import {findStorage} from 'browser/lib/findStorage'
|
import {findStorage} from 'browser/lib/findStorage'
|
||||||
|
import filenamify from 'filenamify'
|
||||||
|
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
const LOCAL_STORED_REGEX = /!\[(.*?)\]\(\s*?\/:storage\/(.*\.\S*?)\)/gi
|
const LOCAL_STORED_REGEX = /!\[(.*?)]\(\s*?\/:storage\/(.*\.\S*?)\)/gi
|
||||||
const IMAGES_FOLDER_NAME = 'images'
|
const IMAGES_FOLDER_NAME = 'images'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,6 +29,7 @@ function exportNote (storageKey, noteContent, targetPath, outputFormatter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let exportedData = noteContent.replace(LOCAL_STORED_REGEX, (match, dstFilename, srcFilename) => {
|
let exportedData = noteContent.replace(LOCAL_STORED_REGEX, (match, dstFilename, srcFilename) => {
|
||||||
|
dstFilename = filenamify(dstFilename, {replacement: '_'})
|
||||||
if (!path.extname(dstFilename)) {
|
if (!path.extname(dstFilename)) {
|
||||||
dstFilename += path.extname(srcFilename)
|
dstFilename += path.extname(srcFilename)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
const resolveStorageData = require('./resolveStorageData')
|
const resolveStorageData = require('./resolveStorageData')
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const fs = require('fs')
|
||||||
const CSON = require('@rokt33r/season')
|
const CSON = require('@rokt33r/season')
|
||||||
const keygen = require('browser/lib/keygen')
|
const keygen = require('browser/lib/keygen')
|
||||||
const sander = require('sander')
|
const sander = require('sander')
|
||||||
const { findStorage } = require('browser/lib/findStorage')
|
const { findStorage } = require('browser/lib/findStorage')
|
||||||
|
const copyImage = require('./copyImage')
|
||||||
|
|
||||||
function moveNote (storageKey, noteKey, newStorageKey, newFolderKey) {
|
function moveNote (storageKey, noteKey, newStorageKey, newFolderKey) {
|
||||||
let oldStorage, newStorage
|
let oldStorage, newStorage
|
||||||
@@ -37,12 +39,12 @@ function moveNote (storageKey, noteKey, newStorageKey, newFolderKey) {
|
|||||||
return resolveStorageData(newStorage)
|
return resolveStorageData(newStorage)
|
||||||
.then(function findNewNoteKey (_newStorage) {
|
.then(function findNewNoteKey (_newStorage) {
|
||||||
newStorage = _newStorage
|
newStorage = _newStorage
|
||||||
newNoteKey = keygen()
|
newNoteKey = keygen(true)
|
||||||
let isUnique = false
|
let isUnique = false
|
||||||
while (!isUnique) {
|
while (!isUnique) {
|
||||||
try {
|
try {
|
||||||
sander.statSync(path.join(newStorage.path, 'notes', newNoteKey + '.cson'))
|
sander.statSync(path.join(newStorage.path, 'notes', newNoteKey + '.cson'))
|
||||||
newNoteKey = keygen()
|
newNoteKey = keygen(true)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code === 'ENOENT') {
|
if (err.code === 'ENOENT') {
|
||||||
isUnique = true
|
isUnique = true
|
||||||
@@ -65,6 +67,27 @@ function moveNote (storageKey, noteKey, newStorageKey, newFolderKey) {
|
|||||||
|
|
||||||
return noteData
|
return noteData
|
||||||
})
|
})
|
||||||
|
.then(function moveImages (noteData) {
|
||||||
|
const searchImagesRegex = /!\[.*?]\(\s*?\/:storage\/(.*\.\S*?)\)/gi
|
||||||
|
let match = searchImagesRegex.exec(noteData.content)
|
||||||
|
|
||||||
|
const moveTasks = []
|
||||||
|
while (match != null) {
|
||||||
|
const [, filename] = match
|
||||||
|
const oldPath = path.join(oldStorage.path, 'images', filename)
|
||||||
|
moveTasks.push(
|
||||||
|
copyImage(oldPath, noteData.storage, false)
|
||||||
|
.then(() => {
|
||||||
|
fs.unlinkSync(oldPath)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
// find next occurence
|
||||||
|
match = searchImagesRegex.exec(noteData.content)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.all(moveTasks).then(() => noteData)
|
||||||
|
})
|
||||||
.then(function writeAndReturn (noteData) {
|
.then(function writeAndReturn (noteData) {
|
||||||
CSON.writeFileSync(path.join(newStorage.path, 'notes', noteData.key + '.cson'), _.omit(noteData, ['key', 'storage']))
|
CSON.writeFileSync(path.join(newStorage.path, 'notes', noteData.key + '.cson'), _.omit(noteData, ['key', 'storage']))
|
||||||
return noteData
|
return noteData
|
||||||
|
|||||||
@@ -27,9 +27,12 @@ function resolveStorageNotes (storage) {
|
|||||||
data.storage = storage.key
|
data.storage = storage.key
|
||||||
return data
|
return data
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(notePath)
|
console.error(`error on note path: ${notePath}, error: ${err}`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.filter(function filterOnlyNoteObject (noteObj) {
|
||||||
|
return typeof noteObj === 'object'
|
||||||
|
})
|
||||||
|
|
||||||
return Promise.resolve(notes)
|
return Promise.resolve(notes)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ function validateInput (input) {
|
|||||||
validatedInput.isPinned = !!input.isPinned
|
validatedInput.isPinned = !!input.isPinned
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_.isNil(input.blog)) {
|
||||||
|
validatedInput.blog = input.blog
|
||||||
|
}
|
||||||
validatedInput.type = input.type
|
validatedInput.type = input.type
|
||||||
switch (input.type) {
|
switch (input.type) {
|
||||||
case 'MARKDOWN_NOTE':
|
case 'MARKDOWN_NOTE':
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import ConfigManager from './ConfigManager'
|
import ConfigManager from './ConfigManager'
|
||||||
import store from 'browser/main/store'
|
|
||||||
|
|
||||||
const nodeIpc = require('node-ipc')
|
const nodeIpc = require('node-ipc')
|
||||||
const { remote, ipcRenderer } = require('electron')
|
const { remote, ipcRenderer } = require('electron')
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import store from 'browser/main/store'
|
|||||||
import consts from 'browser/lib/consts'
|
import consts from 'browser/lib/consts'
|
||||||
import ModalEscButton from 'browser/components/ModalEscButton'
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class CreateFolderModal extends React.Component {
|
class CreateFolderModal extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -79,12 +80,12 @@ class CreateFolderModal extends React.Component {
|
|||||||
onKeyDown={(e) => this.handleKeyDown(e)}
|
onKeyDown={(e) => this.handleKeyDown(e)}
|
||||||
>
|
>
|
||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='title'>Create new folder</div>
|
<div styleName='title'>{i18n.__('Create new folder')}</div>
|
||||||
</div>
|
</div>
|
||||||
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
<div styleName='control-folder'>
|
<div styleName='control-folder'>
|
||||||
<div styleName='control-folder-label'>Folder name</div>
|
<div styleName='control-folder-label'>{i18n.__('Folder name')}</div>
|
||||||
<input styleName='control-folder-input'
|
<input styleName='control-folder-input'
|
||||||
ref='name'
|
ref='name'
|
||||||
value={this.state.name}
|
value={this.state.name}
|
||||||
@@ -95,7 +96,7 @@ class CreateFolderModal extends React.Component {
|
|||||||
<button styleName='control-confirmButton'
|
<button styleName='control-confirmButton'
|
||||||
onClick={(e) => this.handleConfirmButtonClick(e)}
|
onClick={(e) => this.handleConfirmButtonClick(e)}
|
||||||
>
|
>
|
||||||
Create
|
{i18n.__('Create')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { hashHistory } from 'react-router'
|
|||||||
import ee from 'browser/main/lib/eventEmitter'
|
import ee from 'browser/main/lib/eventEmitter'
|
||||||
import ModalEscButton from 'browser/components/ModalEscButton'
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class NewNoteModal extends React.Component {
|
class NewNoteModal extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -35,7 +36,7 @@ class NewNoteModal extends React.Component {
|
|||||||
content: ''
|
content: ''
|
||||||
})
|
})
|
||||||
.then((note) => {
|
.then((note) => {
|
||||||
const noteHash = `${note.storage}-${note.key}`
|
const noteHash = note.key
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'UPDATE_NOTE',
|
type: 'UPDATE_NOTE',
|
||||||
note: note
|
note: note
|
||||||
@@ -75,7 +76,7 @@ class NewNoteModal extends React.Component {
|
|||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
.then((note) => {
|
.then((note) => {
|
||||||
const noteHash = `${note.storage}-${note.key}`
|
const noteHash = note.key
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'UPDATE_NOTE',
|
type: 'UPDATE_NOTE',
|
||||||
note: note
|
note: note
|
||||||
@@ -110,7 +111,7 @@ class NewNoteModal extends React.Component {
|
|||||||
onKeyDown={(e) => this.handleKeyDown(e)}
|
onKeyDown={(e) => this.handleKeyDown(e)}
|
||||||
>
|
>
|
||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='title'>Make a note</div>
|
<div styleName='title'>{i18n.__('Make a note')}</div>
|
||||||
</div>
|
</div>
|
||||||
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
@@ -122,8 +123,8 @@ class NewNoteModal extends React.Component {
|
|||||||
<i styleName='control-button-icon'
|
<i styleName='control-button-icon'
|
||||||
className='fa fa-file-text-o'
|
className='fa fa-file-text-o'
|
||||||
/><br />
|
/><br />
|
||||||
<span styleName='control-button-label'>Markdown Note</span><br />
|
<span styleName='control-button-label'>{i18n.__('Markdown Note')}</span><br />
|
||||||
<span styleName='control-button-description'>This format is for creating text documents. Checklists, code blocks and Latex blocks are available.</span>
|
<span styleName='control-button-description'>{i18n.__('This format is for creating text documents. Checklists, code blocks and Latex blocks are available.')}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button styleName='control-button'
|
<button styleName='control-button'
|
||||||
@@ -134,13 +135,13 @@ class NewNoteModal extends React.Component {
|
|||||||
<i styleName='control-button-icon'
|
<i styleName='control-button-icon'
|
||||||
className='fa fa-code'
|
className='fa fa-code'
|
||||||
/><br />
|
/><br />
|
||||||
<span styleName='control-button-label'>Snippet Note</span><br />
|
<span styleName='control-button-label'>{i18n.__('Snippet Note')}</span><br />
|
||||||
<span styleName='control-button-description'>This format is for creating code snippets. Multiple snippets can be grouped into a single note.
|
<span styleName='control-button-description'>{i18n.__('This format is for creating code snippets. Multiple snippets can be grouped into a single note.')}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div styleName='description'><i className='fa fa-arrows-h' /> Tab to switch format</div>
|
<div styleName='description'><i className='fa fa-arrows-h' />{i18n.__('Tab to switch format')}</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
199
browser/main/modals/PreferencesModal/Blog.js
Normal file
199
browser/main/modals/PreferencesModal/Blog.js
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
|
import styles from './ConfigTab.styl'
|
||||||
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
|
import store from 'browser/main/store'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
import _ from 'lodash'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
|
const electron = require('electron')
|
||||||
|
const { shell } = electron
|
||||||
|
const ipc = electron.ipcRenderer
|
||||||
|
class Blog extends React.Component {
|
||||||
|
constructor (props) {
|
||||||
|
super(props)
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
config: props.config,
|
||||||
|
BlogAlert: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleLinkClick (e) {
|
||||||
|
shell.openExternal(e.currentTarget.href)
|
||||||
|
e.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
clearMessage () {
|
||||||
|
_.debounce(() => {
|
||||||
|
this.setState({
|
||||||
|
BlogAlert: null
|
||||||
|
})
|
||||||
|
}, 2000)()
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount () {
|
||||||
|
this.handleSettingDone = () => {
|
||||||
|
this.setState({BlogAlert: {
|
||||||
|
type: 'success',
|
||||||
|
message: i18n.__('Successfully applied!')
|
||||||
|
}})
|
||||||
|
}
|
||||||
|
this.handleSettingError = (err) => {
|
||||||
|
this.setState({BlogAlert: {
|
||||||
|
type: 'error',
|
||||||
|
message: err.message != null ? err.message : i18n.__('Error occurs!')
|
||||||
|
}})
|
||||||
|
}
|
||||||
|
this.oldBlog = this.state.config.blog
|
||||||
|
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)
|
||||||
|
ipc.addListener('APP_SETTING_ERROR', this.handleSettingError)
|
||||||
|
}
|
||||||
|
|
||||||
|
handleBlogChange (e) {
|
||||||
|
const { config } = this.state
|
||||||
|
config.blog = {
|
||||||
|
password: !_.isNil(this.refs.passwordInput) ? this.refs.passwordInput.value : config.blog.password,
|
||||||
|
username: !_.isNil(this.refs.usernameInput) ? this.refs.usernameInput.value : config.blog.username,
|
||||||
|
token: !_.isNil(this.refs.tokenInput) ? this.refs.tokenInput.value : config.blog.token,
|
||||||
|
authMethod: this.refs.authMethodDropdown.value,
|
||||||
|
address: this.refs.addressInput.value,
|
||||||
|
type: this.refs.typeDropdown.value
|
||||||
|
}
|
||||||
|
this.setState({
|
||||||
|
config
|
||||||
|
})
|
||||||
|
if (_.isEqual(this.oldBlog, config.blog)) {
|
||||||
|
this.props.haveToSave()
|
||||||
|
} else {
|
||||||
|
this.props.haveToSave({
|
||||||
|
tab: 'Blog',
|
||||||
|
type: 'warning',
|
||||||
|
message: i18n.__('You have to save!')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleSaveButtonClick (e) {
|
||||||
|
const newConfig = {
|
||||||
|
blog: this.state.config.blog
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigManager.set(newConfig)
|
||||||
|
|
||||||
|
store.dispatch({
|
||||||
|
type: 'SET_UI',
|
||||||
|
config: newConfig
|
||||||
|
})
|
||||||
|
this.clearMessage()
|
||||||
|
this.props.haveToSave()
|
||||||
|
}
|
||||||
|
|
||||||
|
render () {
|
||||||
|
const {config, BlogAlert} = this.state
|
||||||
|
const blogAlertElement = BlogAlert != null
|
||||||
|
? <p className={`alert ${BlogAlert.type}`}>
|
||||||
|
{BlogAlert.message}
|
||||||
|
</p>
|
||||||
|
: null
|
||||||
|
return (
|
||||||
|
<div styleName='root'>
|
||||||
|
<div styleName='group'>
|
||||||
|
<div styleName='group-header'>{i18n.__('Blog')}</div>
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>
|
||||||
|
{i18n.__('Blog Type')}
|
||||||
|
</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<select
|
||||||
|
value={config.blog.type}
|
||||||
|
ref='typeDropdown'
|
||||||
|
onChange={(e) => this.handleBlogChange(e)}
|
||||||
|
>
|
||||||
|
<option value='wordpress' key='wordpress'>{i18n.__('wordpress')}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>{i18n.__('Blog Address')}</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<input styleName='group-section-control-input'
|
||||||
|
onChange={(e) => this.handleBlogChange(e)}
|
||||||
|
ref='addressInput'
|
||||||
|
value={config.blog.address}
|
||||||
|
type='text'
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div styleName='group-control'>
|
||||||
|
<button styleName='group-control-rightButton'
|
||||||
|
onClick={(e) => this.handleSaveButtonClick(e)}>{i18n.__('Save')}
|
||||||
|
</button>
|
||||||
|
{blogAlertElement}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div styleName='group-header2'>{i18n.__('Auth')}</div>
|
||||||
|
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>
|
||||||
|
{i18n.__('Authentication Method')}
|
||||||
|
</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<select
|
||||||
|
value={config.blog.authMethod}
|
||||||
|
ref='authMethodDropdown'
|
||||||
|
onChange={(e) => this.handleBlogChange(e)}
|
||||||
|
>
|
||||||
|
<option value='JWT' key='JWT'>{i18n.__('JWT')}</option>
|
||||||
|
<option value='USER' key='USER'>{i18n.__('USER')}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{ config.blog.authMethod === 'JWT' &&
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>{i18n.__('Token')}</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<input styleName='group-section-control-input'
|
||||||
|
onChange={(e) => this.handleBlogChange(e)}
|
||||||
|
ref='tokenInput'
|
||||||
|
value={config.blog.token}
|
||||||
|
type='text' />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
{ config.blog.authMethod === 'USER' &&
|
||||||
|
<div>
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>{i18n.__('UserName')}</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<input styleName='group-section-control-input'
|
||||||
|
onChange={(e) => this.handleBlogChange(e)}
|
||||||
|
ref='usernameInput'
|
||||||
|
value={config.blog.username}
|
||||||
|
type='text' />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>{i18n.__('Password')}</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<input styleName='group-section-control-input'
|
||||||
|
onChange={(e) => this.handleBlogChange(e)}
|
||||||
|
ref='passwordInput'
|
||||||
|
value={config.blog.password}
|
||||||
|
type='password' />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Blog.propTypes = {
|
||||||
|
dispatch: PropTypes.func,
|
||||||
|
haveToSave: PropTypes.func
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CSSModules(Blog, styles)
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './Crowdfunding.styl'
|
import styles from './Crowdfunding.styl'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const { shell } = electron
|
const { shell } = electron
|
||||||
@@ -21,22 +22,22 @@ class Crowdfunding extends React.Component {
|
|||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<div styleName='root'>
|
<div styleName='root'>
|
||||||
<div styleName='header'>Crowdfunding</div>
|
<div styleName='header'>{i18n.__('Crowdfunding')}</div>
|
||||||
<p>Dear everyone,</p>
|
<p>{i18n.__('Dear everyone,')}</p>
|
||||||
<br />
|
<br />
|
||||||
<p>Thank you for using Boostnote!</p>
|
<p>{i18n.__('Thank you for using Boostnote!')}</p>
|
||||||
<p>Boostnote is used in about 200 different countries and regions by an awesome community of developers.</p>
|
<p>{i18n.__('Boostnote is used in about 200 different countries and regions by an awesome community of developers.')}</p>
|
||||||
<br />
|
<br />
|
||||||
<p>To continue supporting this growth, and to satisfy community expectations,</p>
|
<p>{i18n.__('To continue supporting this growth, and to satisfy community expectations,')}</p>
|
||||||
<p>we would like to invest more time and resources in this project.</p>
|
<p>{i18n.__('we would like to invest more time and resources in this project.')}</p>
|
||||||
<br />
|
<br />
|
||||||
<p>If you like this project and see its potential, you can help by supporting us on OpenCollective!</p>
|
<p>{i18n.__('If you like this project and see its potential, you can help by supporting us on OpenCollective!')}</p>
|
||||||
<br />
|
<br />
|
||||||
<p>Thanks,</p>
|
<p>{i18n.__('Thanks,')}</p>
|
||||||
<p>Boostnote maintainers</p>
|
<p>{i18n.__('Boostnote maintainers')}</p>
|
||||||
<br />
|
<br />
|
||||||
<button styleName='cf-link'>
|
<button styleName='cf-link'>
|
||||||
<a href='https://opencollective.com/boostnoteio' onClick={(e) => this.handleLinkClick(e)}>Support via OpenCollective</a>
|
<a href='https://opencollective.com/boostnoteio' onClick={(e) => this.handleLinkClick(e)}>{i18n.__('Support via OpenCollective')}</a>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import dataApi from 'browser/main/lib/dataApi'
|
|||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import { SketchPicker } from 'react-color'
|
import { SketchPicker } from 'react-color'
|
||||||
import { SortableElement, SortableHandle } from 'react-sortable-hoc'
|
import { SortableElement, SortableHandle } from 'react-sortable-hoc'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class FolderItem extends React.Component {
|
class FolderItem extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -150,12 +151,12 @@ class FolderItem extends React.Component {
|
|||||||
<button styleName='folderItem-right-confirmButton'
|
<button styleName='folderItem-right-confirmButton'
|
||||||
onClick={(e) => this.handleConfirmButtonClick(e)}
|
onClick={(e) => this.handleConfirmButtonClick(e)}
|
||||||
>
|
>
|
||||||
Confirm
|
{i18n.__('Confirm')}
|
||||||
</button>
|
</button>
|
||||||
<button styleName='folderItem-right-button'
|
<button styleName='folderItem-right-button'
|
||||||
onClick={(e) => this.handleCancelButtonClick(e)}
|
onClick={(e) => this.handleCancelButtonClick(e)}
|
||||||
>
|
>
|
||||||
Cancel
|
{i18n.__('Cancel')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -179,18 +180,18 @@ class FolderItem extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div styleName='folderItem'>
|
<div styleName='folderItem'>
|
||||||
<div styleName='folderItem-left'>
|
<div styleName='folderItem-left'>
|
||||||
Are you sure to <span styleName='folderItem-left-danger'>delete</span> this folder?
|
{i18n.__('Are you sure to ')} <span styleName='folderItem-left-danger'>{i18n.__(' delete')}</span> {i18n.__('this folder?')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='folderItem-right'>
|
<div styleName='folderItem-right'>
|
||||||
<button styleName='folderItem-right-dangerButton'
|
<button styleName='folderItem-right-dangerButton'
|
||||||
onClick={(e) => this.handleDeleteConfirmButtonClick(e)}
|
onClick={(e) => this.handleDeleteConfirmButtonClick(e)}
|
||||||
>
|
>
|
||||||
Confirm
|
{i18n.__('Confirm')}
|
||||||
</button>
|
</button>
|
||||||
<button styleName='folderItem-right-button'
|
<button styleName='folderItem-right-button'
|
||||||
onClick={(e) => this.handleCancelButtonClick(e)}
|
onClick={(e) => this.handleCancelButtonClick(e)}
|
||||||
>
|
>
|
||||||
Cancel
|
{i18n.__('Cancel')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -231,12 +232,12 @@ class FolderItem extends React.Component {
|
|||||||
<button styleName='folderItem-right-button'
|
<button styleName='folderItem-right-button'
|
||||||
onClick={(e) => this.handleEditButtonClick(e)}
|
onClick={(e) => this.handleEditButtonClick(e)}
|
||||||
>
|
>
|
||||||
Edit
|
{i18n.__('Edit')}
|
||||||
</button>
|
</button>
|
||||||
<button styleName='folderItem-right-button'
|
<button styleName='folderItem-right-button'
|
||||||
onClick={(e) => this.handleDeleteButtonClick(e)}
|
onClick={(e) => this.handleDeleteButtonClick(e)}
|
||||||
>
|
>
|
||||||
Delete
|
{i18n.__('Delete')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import styles from './FolderList.styl'
|
|||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import FolderItem from './FolderItem'
|
import FolderItem from './FolderItem'
|
||||||
import { SortableContainer } from 'react-sortable-hoc'
|
import { SortableContainer } from 'react-sortable-hoc'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class FolderList extends React.Component {
|
class FolderList extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
@@ -24,7 +25,7 @@ class FolderList extends React.Component {
|
|||||||
<div styleName='folderList'>
|
<div styleName='folderList'>
|
||||||
{folderList.length > 0
|
{folderList.length > 0
|
||||||
? folderList
|
? folderList
|
||||||
: <div styleName='folderList-empty'>No Folders</div>
|
: <div styleName='folderList-empty'>{i18n.__('No Folders')}</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import styles from './ConfigTab.styl'
|
|||||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const ipc = electron.ipcRenderer
|
const ipc = electron.ipcRenderer
|
||||||
@@ -23,13 +24,13 @@ class HotkeyTab extends React.Component {
|
|||||||
this.handleSettingDone = () => {
|
this.handleSettingDone = () => {
|
||||||
this.setState({keymapAlert: {
|
this.setState({keymapAlert: {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: 'Successfully applied!'
|
message: i18n.__('Successfully applied!')
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
this.handleSettingError = (err) => {
|
this.handleSettingError = (err) => {
|
||||||
this.setState({keymapAlert: {
|
this.setState({keymapAlert: {
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: err.message != null ? err.message : 'Error occurs!'
|
message: err.message != null ? err.message : i18n.__('Error occurs!')
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
this.oldHotkey = this.state.config.hotkey
|
this.oldHotkey = this.state.config.hotkey
|
||||||
@@ -77,7 +78,7 @@ class HotkeyTab extends React.Component {
|
|||||||
this.props.haveToSave({
|
this.props.haveToSave({
|
||||||
tab: 'Hotkey',
|
tab: 'Hotkey',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'You have to save!'
|
message: i18n.__('You have to save!')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,9 +103,9 @@ class HotkeyTab extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div styleName='root'>
|
<div styleName='root'>
|
||||||
<div styleName='group'>
|
<div styleName='group'>
|
||||||
<div styleName='group-header'>Hotkeys</div>
|
<div styleName='group-header'>{i18n.__('Hotkeys')}</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>Show/Hide Boostnote</div>
|
<div styleName='group-section-label'>{i18n.__('Show/Hide Boostnote')}</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
onChange={(e) => this.handleHotkeyChange(e)}
|
onChange={(e) => this.handleHotkeyChange(e)}
|
||||||
@@ -119,18 +120,18 @@ class HotkeyTab extends React.Component {
|
|||||||
onClick={(e) => this.handleHintToggleButtonClick(e)}
|
onClick={(e) => this.handleHintToggleButtonClick(e)}
|
||||||
>
|
>
|
||||||
{this.state.isHotkeyHintOpen
|
{this.state.isHotkeyHintOpen
|
||||||
? 'Hide Help'
|
? i18n.__('Hide Help')
|
||||||
: 'Help'
|
: i18n.__('Help')
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
<button styleName='group-control-rightButton'
|
<button styleName='group-control-rightButton'
|
||||||
onClick={(e) => this.handleSaveButtonClick(e)}>Save
|
onClick={(e) => this.handleSaveButtonClick(e)}>{i18n.__('Save')}
|
||||||
</button>
|
</button>
|
||||||
{keymapAlertElement}
|
{keymapAlertElement}
|
||||||
</div>
|
</div>
|
||||||
{this.state.isHotkeyHintOpen &&
|
{this.state.isHotkeyHintOpen &&
|
||||||
<div styleName='group-hint'>
|
<div styleName='group-hint'>
|
||||||
<p>Available Keys</p>
|
<p>{i18n.__('Available Keys')}</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>0</code> to <code>9</code></li>
|
<li><code>0</code> to <code>9</code></li>
|
||||||
<li><code>A</code> to <code>Z</code></li>
|
<li><code>A</code> to <code>Z</code></li>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
|
|||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const { shell, remote } = electron
|
const { shell, remote } = electron
|
||||||
@@ -38,11 +39,11 @@ class InfoTab extends React.Component {
|
|||||||
if (!newConfig.amaEnabled) {
|
if (!newConfig.amaEnabled) {
|
||||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('DISABLE_AMA')
|
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('DISABLE_AMA')
|
||||||
this.setState({
|
this.setState({
|
||||||
amaMessage: 'We hope we will gain your trust'
|
amaMessage: i18n.__('We hope we will gain your trust')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
amaMessage: 'Thank\'s for trust us'
|
amaMessage: i18n.__('Thank\'s for trusting us')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,48 +70,48 @@ class InfoTab extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div styleName='root'>
|
<div styleName='root'>
|
||||||
|
|
||||||
<div styleName='header--sub'>Community</div>
|
<div styleName='header--sub'>{i18n.__('Community')}</div>
|
||||||
<div styleName='top'>
|
<div styleName='top'>
|
||||||
<ul styleName='list'>
|
<ul styleName='list'>
|
||||||
<li>
|
<li>
|
||||||
<a href='https://boostnote.io/#subscribe'
|
<a href='https://boostnote.io/#subscribe'
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
>Subscribe to Newsletter</a>
|
>{i18n.__('Subscribe to Newsletter')}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href='https://github.com/BoostIO/Boostnote/issues'
|
<a href='https://github.com/BoostIO/Boostnote/issues'
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
>GitHub</a>
|
>{i18n.__('GitHub')}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href='https://boostlog.io/@junp1234'
|
<a href='https://boostlog.io/@junp1234'
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
>Blog</a>
|
>{i18n.__('Blog')}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href='https://www.facebook.com/groups/boostnote'
|
<a href='https://www.facebook.com/groups/boostnote'
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
>Facebook Group</a>
|
>{i18n.__('Facebook Group')}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href='https://twitter.com/boostnoteapp'
|
<a href='https://twitter.com/boostnoteapp'
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
>Twitter</a>
|
>{i18n.__('Twitter')}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div styleName='header--sub'>About</div>
|
<div styleName='header--sub'>{i18n.__('About')}</div>
|
||||||
|
|
||||||
<div styleName='top'>
|
<div styleName='top'>
|
||||||
<div styleName='icon-space'>
|
<div styleName='icon-space'>
|
||||||
<img styleName='icon' src='../resources/app.png' width='92' height='92' />
|
<img styleName='icon' src='../resources/app.png' width='92' height='92' />
|
||||||
<div styleName='icon-right'>
|
<div styleName='icon-right'>
|
||||||
<div styleName='appId'>Boostnote {appVersion}</div>
|
<div styleName='appId'>{i18n.__('Boostnote')} {appVersion}</div>
|
||||||
<div styleName='description'>
|
<div styleName='description'>
|
||||||
An open source note-taking app made for programmers just like you.
|
{i18n.__('An open source note-taking app made for programmers just like you.')}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -120,35 +121,35 @@ class InfoTab extends React.Component {
|
|||||||
<li>
|
<li>
|
||||||
<a href='https://boostnote.io'
|
<a href='https://boostnote.io'
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
>Website</a>
|
>{i18n.__('Website')}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href='https://github.com/BoostIO/Boostnote/blob/master/docs/build.md'
|
<a href='https://github.com/BoostIO/Boostnote/blob/master/docs/build.md'
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
>Development</a> : Development configurations for Boostnote.
|
>{i18n.__('Development')}</a>{i18n.__(' : Development configurations for Boostnote.')}
|
||||||
</li>
|
</li>
|
||||||
<li styleName='cc'>
|
<li styleName='cc'>
|
||||||
Copyright (C) 2017 - 2018 BoostIO
|
{i18n.__('Copyright (C) 2017 - 2018 BoostIO')}
|
||||||
</li>
|
</li>
|
||||||
<li styleName='cc'>
|
<li styleName='cc'>
|
||||||
License: GPL v3
|
{i18n.__('License: GPL v3')}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<hr styleName='separate-line' />
|
<hr styleName='separate-line' />
|
||||||
|
|
||||||
<div styleName='policy'>Analytics</div>
|
<div styleName='policy'>{i18n.__('Analytics')}</div>
|
||||||
<div>Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.</div>
|
<div>{i18n.__('Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.')}</div>
|
||||||
<div>You can see how it works on <a href='https://github.com/BoostIO/Boostnote' onClick={(e) => this.handleLinkClick(e)}>GitHub</a>.</div>
|
<div>{i18n.__('You can see how it works on ')}<a href='https://github.com/BoostIO/Boostnote' onClick={(e) => this.handleLinkClick(e)}>GitHub</a>.</div>
|
||||||
<br />
|
<br />
|
||||||
<div>You can choose to enable or disable this option.</div>
|
<div>{i18n.__('You can choose to enable or disable this option.')}</div>
|
||||||
<input onChange={(e) => this.handleConfigChange(e)}
|
<input onChange={(e) => this.handleConfigChange(e)}
|
||||||
checked={this.state.config.amaEnabled}
|
checked={this.state.config.amaEnabled}
|
||||||
ref='amaEnabled'
|
ref='amaEnabled'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
Enable analytics to help improve Boostnote<br />
|
{i18n.__('Enable analytics to help improve Boostnote')}<br />
|
||||||
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>Save</button>
|
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>{i18n.__('Save')}</button>
|
||||||
<br />
|
<br />
|
||||||
{this.infoMessage()}
|
{this.infoMessage()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import consts from 'browser/lib/consts'
|
|||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import FolderList from './FolderList'
|
import FolderList from './FolderList'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const { shell, remote } = require('electron')
|
const { shell, remote } = require('electron')
|
||||||
const { dialog } = remote
|
const { dialog } = remote
|
||||||
@@ -22,7 +23,7 @@ class StorageItem extends React.Component {
|
|||||||
handleNewFolderButtonClick (e) {
|
handleNewFolderButtonClick (e) {
|
||||||
const { storage } = this.props
|
const { storage } = this.props
|
||||||
const input = {
|
const input = {
|
||||||
name: 'Untitled',
|
name: i18n.__('New Folder'),
|
||||||
color: consts.FOLDER_COLORS[Math.floor(Math.random() * 7) % 7]
|
color: consts.FOLDER_COLORS[Math.floor(Math.random() * 7) % 7]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,9 +47,9 @@ class StorageItem extends React.Component {
|
|||||||
handleUnlinkButtonClick (e) {
|
handleUnlinkButtonClick (e) {
|
||||||
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
const index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Unlink Storage',
|
message: i18n.__('Unlink Storage'),
|
||||||
detail: 'Unlinking removes this linked storage from Boostnote. No data is removed, please manually delete the folder from your hard drive if needed.',
|
detail: i18n.__('Unlinking removes this linked storage from Boostnote. No data is removed, please manually delete the folder from your hard drive if needed.'),
|
||||||
buttons: ['Unlink', 'Cancel']
|
buttons: [i18n.__('Unlink'), i18n.__('Cancel')]
|
||||||
})
|
})
|
||||||
|
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
@@ -127,7 +128,7 @@ class StorageItem extends React.Component {
|
|||||||
<i className='fa fa-plus' />
|
<i className='fa fa-plus' />
|
||||||
<span styleName='header-control-button-tooltip'
|
<span styleName='header-control-button-tooltip'
|
||||||
style={{left: -20}}
|
style={{left: -20}}
|
||||||
>Add Folder</span>
|
>{i18n.__('Add Folder')}</span>
|
||||||
</button>
|
</button>
|
||||||
<button styleName='header-control-button'
|
<button styleName='header-control-button'
|
||||||
onClick={(e) => this.handleExternalButtonClick(e)}
|
onClick={(e) => this.handleExternalButtonClick(e)}
|
||||||
@@ -135,7 +136,7 @@ class StorageItem extends React.Component {
|
|||||||
<i className='fa fa-external-link' />
|
<i className='fa fa-external-link' />
|
||||||
<span styleName='header-control-button-tooltip'
|
<span styleName='header-control-button-tooltip'
|
||||||
style={{left: -50}}
|
style={{left: -50}}
|
||||||
>Open Storage folder</span>
|
>{i18n.__('Open Storage folder')}</span>
|
||||||
</button>
|
</button>
|
||||||
<button styleName='header-control-button'
|
<button styleName='header-control-button'
|
||||||
onClick={(e) => this.handleUnlinkButtonClick(e)}
|
onClick={(e) => this.handleUnlinkButtonClick(e)}
|
||||||
@@ -143,7 +144,7 @@ class StorageItem extends React.Component {
|
|||||||
<i className='fa fa-unlink' />
|
<i className='fa fa-unlink' />
|
||||||
<span styleName='header-control-button-tooltip'
|
<span styleName='header-control-button-tooltip'
|
||||||
style={{left: -10}}
|
style={{left: -10}}
|
||||||
>Unlink</span>
|
>{i18n.__('Unlink')}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import CSSModules from 'browser/lib/CSSModules'
|
|||||||
import styles from './StoragesTab.styl'
|
import styles from './StoragesTab.styl'
|
||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import StorageItem from './StorageItem'
|
import StorageItem from './StorageItem'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const { shell, remote } = electron
|
const { shell, remote } = electron
|
||||||
@@ -14,7 +15,7 @@ function browseFolder () {
|
|||||||
const defaultPath = remote.app.getPath('home')
|
const defaultPath = remote.app.getPath('home')
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
dialog.showOpenDialog({
|
dialog.showOpenDialog({
|
||||||
title: 'Select Directory',
|
title: i18n.__('Select Directory'),
|
||||||
defaultPath,
|
defaultPath,
|
||||||
properties: ['openDirectory', 'createDirectory']
|
properties: ['openDirectory', 'createDirectory']
|
||||||
}, function (targetPaths) {
|
}, function (targetPaths) {
|
||||||
@@ -69,16 +70,16 @@ class StoragesTab extends React.Component {
|
|||||||
})
|
})
|
||||||
return (
|
return (
|
||||||
<div styleName='list'>
|
<div styleName='list'>
|
||||||
<div styleName='header'>Storages</div>
|
<div styleName='header'>{i18n.__('Storages')}</div>
|
||||||
{storageList.length > 0
|
{storageList.length > 0
|
||||||
? storageList
|
? storageList
|
||||||
: <div styleName='list-empty'>No storage found.</div>
|
: <div styleName='list-empty'>{i18n.__('No storage found.')}</div>
|
||||||
}
|
}
|
||||||
<div styleName='list-control'>
|
<div styleName='list-control'>
|
||||||
<button styleName='list-control-addStorageButton'
|
<button styleName='list-control-addStorageButton'
|
||||||
onClick={(e) => this.handleAddStorageButton(e)}
|
onClick={(e) => this.handleAddStorageButton(e)}
|
||||||
>
|
>
|
||||||
<i className='fa fa-plus' /> Add Storage Location
|
<i className='fa fa-plus' /> {i18n.__('Add Storage Location')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -140,13 +141,13 @@ class StoragesTab extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div styleName='addStorage'>
|
<div styleName='addStorage'>
|
||||||
|
|
||||||
<div styleName='addStorage-header'>Add Storage</div>
|
<div styleName='addStorage-header'>{i18n.__('Add Storage')}</div>
|
||||||
|
|
||||||
<div styleName='addStorage-body'>
|
<div styleName='addStorage-body'>
|
||||||
|
|
||||||
<div styleName='addStorage-body-section'>
|
<div styleName='addStorage-body-section'>
|
||||||
<div styleName='addStorage-body-section-label'>
|
<div styleName='addStorage-body-section-label'>
|
||||||
Name
|
{i18n.__('Name')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='addStorage-body-section-name'>
|
<div styleName='addStorage-body-section-name'>
|
||||||
<input styleName='addStorage-body-section-name-input'
|
<input styleName='addStorage-body-section-name-input'
|
||||||
@@ -158,25 +159,25 @@ class StoragesTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div styleName='addStorage-body-section'>
|
<div styleName='addStorage-body-section'>
|
||||||
<div styleName='addStorage-body-section-label'>Type</div>
|
<div styleName='addStorage-body-section-label'>{i18n.__('Type')}</div>
|
||||||
<div styleName='addStorage-body-section-type'>
|
<div styleName='addStorage-body-section-type'>
|
||||||
<select styleName='addStorage-body-section-type-select'
|
<select styleName='addStorage-body-section-type-select'
|
||||||
value={this.state.newStorage.type}
|
value={this.state.newStorage.type}
|
||||||
readOnly
|
readOnly
|
||||||
>
|
>
|
||||||
<option value='FILESYSTEM'>File System</option>
|
<option value='FILESYSTEM'>{i18n.__('File System')}</option>
|
||||||
</select>
|
</select>
|
||||||
<div styleName='addStorage-body-section-type-description'>
|
<div styleName='addStorage-body-section-type-description'>
|
||||||
Setting up 3rd-party cloud storage integration:{' '}
|
{i18n.__('Setting up 3rd-party cloud storage integration:')}{' '}
|
||||||
<a href='https://github.com/BoostIO/Boostnote/wiki/Cloud-Syncing-and-Backup'
|
<a href='https://github.com/BoostIO/Boostnote/wiki/Cloud-Syncing-and-Backup'
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
>Cloud-Syncing-and-Backup</a>
|
>{i18n.__('Cloud-Syncing-and-Backup')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div styleName='addStorage-body-section'>
|
<div styleName='addStorage-body-section'>
|
||||||
<div styleName='addStorage-body-section-label'>Location
|
<div styleName='addStorage-body-section-label'>{i18n.__('Location')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='addStorage-body-section-path'>
|
<div styleName='addStorage-body-section-path'>
|
||||||
<input styleName='addStorage-body-section-path-input'
|
<input styleName='addStorage-body-section-path-input'
|
||||||
@@ -196,10 +197,10 @@ class StoragesTab extends React.Component {
|
|||||||
<div styleName='addStorage-body-control'>
|
<div styleName='addStorage-body-control'>
|
||||||
<button styleName='addStorage-body-control-createButton'
|
<button styleName='addStorage-body-control-createButton'
|
||||||
onClick={(e) => this.handleAddStorageCreateButton(e)}
|
onClick={(e) => this.handleAddStorageCreateButton(e)}
|
||||||
>Add</button>
|
>{i18n.__('Add')}</button>
|
||||||
<button styleName='addStorage-body-control-cancelButton'
|
<button styleName='addStorage-body-control-cancelButton'
|
||||||
onClick={(e) => this.handleAddStorageCancelButton(e)}
|
onClick={(e) => this.handleAddStorageCancelButton(e)}
|
||||||
>Cancel</button>
|
>{i18n.__('Cancel')}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import ReactCodeMirror from 'react-codemirror'
|
|||||||
import CodeMirror from 'codemirror'
|
import CodeMirror from 'codemirror'
|
||||||
import 'codemirror-mode-elixir'
|
import 'codemirror-mode-elixir'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
const OSX = global.process.platform === 'darwin'
|
const OSX = global.process.platform === 'darwin'
|
||||||
|
|
||||||
@@ -29,13 +30,13 @@ class UiTab extends React.Component {
|
|||||||
this.handleSettingDone = () => {
|
this.handleSettingDone = () => {
|
||||||
this.setState({UiAlert: {
|
this.setState({UiAlert: {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: 'Successfully applied!'
|
message: i18n.__('Successfully applied!')
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
this.handleSettingError = (err) => {
|
this.handleSettingError = (err) => {
|
||||||
this.setState({UiAlert: {
|
this.setState({UiAlert: {
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: err.message != null ? err.message : 'Error occurs!'
|
message: err.message != null ? err.message : i18n.__('Error occurs!')
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)
|
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)
|
||||||
@@ -61,6 +62,7 @@ class UiTab extends React.Component {
|
|||||||
const newConfig = {
|
const newConfig = {
|
||||||
ui: {
|
ui: {
|
||||||
theme: this.refs.uiTheme.value,
|
theme: this.refs.uiTheme.value,
|
||||||
|
language: this.refs.uiLanguage.value,
|
||||||
showCopyNotification: this.refs.showCopyNotification.checked,
|
showCopyNotification: this.refs.showCopyNotification.checked,
|
||||||
confirmDeletion: this.refs.confirmDeletion.checked,
|
confirmDeletion: this.refs.confirmDeletion.checked,
|
||||||
disableDirectWrite: this.refs.uiD2w != null
|
disableDirectWrite: this.refs.uiD2w != null
|
||||||
@@ -73,6 +75,8 @@ class UiTab extends React.Component {
|
|||||||
fontFamily: this.refs.editorFontFamily.value,
|
fontFamily: this.refs.editorFontFamily.value,
|
||||||
indentType: this.refs.editorIndentType.value,
|
indentType: this.refs.editorIndentType.value,
|
||||||
indentSize: this.refs.editorIndentSize.value,
|
indentSize: this.refs.editorIndentSize.value,
|
||||||
|
enableRulers: this.refs.enableEditorRulers.value === 'true',
|
||||||
|
rulers: this.refs.editorRulers.value.replace(/[^0-9,]/g, '').split(','),
|
||||||
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,
|
||||||
@@ -88,7 +92,9 @@ class UiTab extends React.Component {
|
|||||||
latexInlineClose: this.refs.previewLatexInlineClose.value,
|
latexInlineClose: this.refs.previewLatexInlineClose.value,
|
||||||
latexBlockOpen: this.refs.previewLatexBlockOpen.value,
|
latexBlockOpen: this.refs.previewLatexBlockOpen.value,
|
||||||
latexBlockClose: this.refs.previewLatexBlockClose.value,
|
latexBlockClose: this.refs.previewLatexBlockClose.value,
|
||||||
scrollPastEnd: this.refs.previewScrollPastEnd.checked
|
scrollPastEnd: this.refs.previewScrollPastEnd.checked,
|
||||||
|
smartQuotes: this.refs.previewSmartQuotes.checked,
|
||||||
|
sanitize: this.refs.previewSanitize.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,7 +112,7 @@ class UiTab extends React.Component {
|
|||||||
this.props.haveToSave({
|
this.props.haveToSave({
|
||||||
tab: 'UI',
|
tab: 'UI',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'You have to save!'
|
message: i18n.__('You have to save!')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -148,25 +154,53 @@ class UiTab extends React.Component {
|
|||||||
const themes = consts.THEMES
|
const themes = consts.THEMES
|
||||||
const { config, codemirrorTheme } = this.state
|
const { config, codemirrorTheme } = this.state
|
||||||
const codemirrorSampleCode = 'function iamHappy (happy) {\n\tif (happy) {\n\t console.log("I am Happy!")\n\t} else {\n\t console.log("I am not Happy!")\n\t}\n};'
|
const codemirrorSampleCode = 'function iamHappy (happy) {\n\tif (happy) {\n\t console.log("I am Happy!")\n\t} else {\n\t console.log("I am not Happy!")\n\t}\n};'
|
||||||
|
const enableEditRulersStyle = config.editor.enableRulers ? 'block' : 'none'
|
||||||
return (
|
return (
|
||||||
<div styleName='root'>
|
<div styleName='root'>
|
||||||
<div styleName='group'>
|
<div styleName='group'>
|
||||||
<div styleName='group-header'>Interface</div>
|
<div styleName='group-header'>{i18n.__('Interface')}</div>
|
||||||
|
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
Interface Theme
|
{i18n.__('Interface Theme')}
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<select value={config.ui.theme}
|
<select value={config.ui.theme}
|
||||||
onChange={(e) => this.handleUIChange(e)}
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
ref='uiTheme'
|
ref='uiTheme'
|
||||||
>
|
>
|
||||||
<option value='default'>Default</option>
|
<option value='default'>{i18n.__('Default')}</option>
|
||||||
<option value='white'>White</option>
|
<option value='white'>{i18n.__('White')}</option>
|
||||||
<option value='solarized-dark'>Solarized Dark</option>
|
<option value='solarized-dark'>{i18n.__('Solarized Dark')}</option>
|
||||||
<option value='dark'>Dark</option>
|
<option value='dark'>{i18n.__('Dark')}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div styleName='group-section'>
|
||||||
|
{i18n.__('Language')}
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<select value={config.ui.language}
|
||||||
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
|
ref='uiLanguage'
|
||||||
|
>
|
||||||
|
<option value='sq'>{i18n.__('Albanian')}</option>
|
||||||
|
<option value='zh-CN'>{i18n.__('Chinese (zh-CN)')}</option>
|
||||||
|
<option value='zh-TW'>{i18n.__('Chinese (zh-TW)')}</option>
|
||||||
|
<option value='da'>{i18n.__('Danish')}</option>
|
||||||
|
<option value='en'>{i18n.__('English')}</option>
|
||||||
|
<option value='fr'>{i18n.__('French')}</option>
|
||||||
|
<option value='de'>{i18n.__('German')}</option>
|
||||||
|
<option value='hu'>{i18n.__('Hungarian')}</option>
|
||||||
|
<option value='ja'>{i18n.__('Japanese')}</option>
|
||||||
|
<option value='ko'>{i18n.__('Korean')}</option>
|
||||||
|
<option value='no'>{i18n.__('Norwegian')}</option>
|
||||||
|
<option value='pl'>{i18n.__('Polish')}</option>
|
||||||
|
<option value='pt'>{i18n.__('Portuguese')}</option>
|
||||||
|
<option value='ru'>{i18n.__('Russian')}</option>
|
||||||
|
<option value='es'>{i18n.__('Spanish')}</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)}
|
||||||
@@ -174,7 +208,7 @@ class UiTab extends React.Component {
|
|||||||
ref='showCopyNotification'
|
ref='showCopyNotification'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
Show "Saved to Clipboard" notification when copying
|
{i18n.__('Show "Saved to Clipboard" notification when copying')}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-checkBoxSection'>
|
<div styleName='group-checkBoxSection'>
|
||||||
@@ -184,7 +218,7 @@ class UiTab extends React.Component {
|
|||||||
ref='confirmDeletion'
|
ref='confirmDeletion'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
Show a confirmation dialog when deleting notes
|
{i18n.__('Show a confirmation dialog when deleting notes')}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
@@ -206,7 +240,7 @@ class UiTab extends React.Component {
|
|||||||
|
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
Editor Theme
|
{i18n.__('Editor Theme')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<select value={config.editor.theme}
|
<select value={config.editor.theme}
|
||||||
@@ -226,7 +260,7 @@ class UiTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
Editor Font Size
|
{i18n.__('Editor Font Size')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
@@ -239,7 +273,7 @@ class UiTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
Editor Font Family
|
{i18n.__('Editor Font Family')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
@@ -252,7 +286,7 @@ class UiTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
Editor Indent Style
|
{i18n.__('Editor Indent Style')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<select value={config.editor.indentSize}
|
<select value={config.editor.indentSize}
|
||||||
@@ -268,42 +302,70 @@ class UiTab extends React.Component {
|
|||||||
ref='editorIndentType'
|
ref='editorIndentType'
|
||||||
onChange={(e) => this.handleUIChange(e)}
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
>
|
>
|
||||||
<option value='space'>Spaces</option>
|
<option value='space'>{i18n.__('Spaces')}</option>
|
||||||
<option value='tab'>Tabs</option>
|
<option value='tab'>{i18n.__('Tabs')}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
Switch to Preview
|
{i18n.__('Editor Rulers')}
|
||||||
|
</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<div>
|
||||||
|
<select value={config.editor.enableRulers}
|
||||||
|
ref='enableEditorRulers'
|
||||||
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
|
>
|
||||||
|
<option value='true'>
|
||||||
|
{i18n.__('Enable')}
|
||||||
|
</option>
|
||||||
|
<option value='false'>
|
||||||
|
{i18n.__('Disable')}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<input styleName='group-section-control-input'
|
||||||
|
style={{ display: enableEditRulersStyle }}
|
||||||
|
ref='editorRulers'
|
||||||
|
value={config.editor.rulers}
|
||||||
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
|
type='text'
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>
|
||||||
|
{i18n.__('Switch to Preview')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<select value={config.editor.switchPreview}
|
<select value={config.editor.switchPreview}
|
||||||
ref='editorSwitchPreview'
|
ref='editorSwitchPreview'
|
||||||
onChange={(e) => this.handleUIChange(e)}
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
>
|
>
|
||||||
<option value='BLUR'>When Editor Blurred</option>
|
<option value='BLUR'>{i18n.__('When Editor Blurred')}</option>
|
||||||
<option value='DBL_CLICK'>When Editor Blurred, Edit On Double Click</option>
|
<option value='DBL_CLICK'>{i18n.__('When Editor Blurred, Edit On Double Click')}</option>
|
||||||
<option value='RIGHTCLICK'>On Right Click</option>
|
<option value='RIGHTCLICK'>{i18n.__('On Right Click')}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
Editor Keymap
|
{i18n.__('Editor Keymap')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<select value={config.editor.keyMap}
|
<select value={config.editor.keyMap}
|
||||||
ref='editorKeyMap'
|
ref='editorKeyMap'
|
||||||
onChange={(e) => this.handleUIChange(e)}
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
>
|
>
|
||||||
<option value='sublime'>default</option>
|
<option value='sublime'>{i18n.__('default')}</option>
|
||||||
<option value='vim'>vim</option>
|
<option value='vim'>{i18n.__('vim')}</option>
|
||||||
<option value='emacs'>emacs</option>
|
<option value='emacs'>{i18n.__('emacs')}</option>
|
||||||
</select>
|
</select>
|
||||||
<p styleName='note-for-keymap'>⚠️ Please restart boostnote after you change the keymap</p>
|
<p styleName='note-for-keymap'>{i18n.__('⚠️ Please restart boostnote after you change the keymap')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -314,7 +376,7 @@ class UiTab extends React.Component {
|
|||||||
ref='editorDisplayLineNumbers'
|
ref='editorDisplayLineNumbers'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
Show line numbers in the editor
|
{i18n.__('Show line numbers in the editor')}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -325,7 +387,7 @@ class UiTab extends React.Component {
|
|||||||
ref='scrollPastEnd'
|
ref='scrollPastEnd'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
Allow editor to scroll past the last line
|
{i18n.__('Allow editor to scroll past the last line')}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -336,14 +398,14 @@ class UiTab extends React.Component {
|
|||||||
ref='editorFetchUrlTitle'
|
ref='editorFetchUrlTitle'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
Bring in web page title when pasting URL on editor
|
{i18n.__('Bring in web page title when pasting URL on editor')}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div styleName='group-header2'>Preview</div>
|
<div styleName='group-header2'>{i18n.__('Preview')}</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
Preview Font Size
|
{i18n.__('Preview Font Size')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
@@ -356,7 +418,7 @@ class UiTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
Preview Font Family
|
{i18n.__('Preview Font Family')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
@@ -368,7 +430,7 @@ class UiTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>Code block Theme</div>
|
<div styleName='group-section-label'>{i18n.__('Code block Theme')}</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<select value={config.preview.codeBlockTheme}
|
<select value={config.preview.codeBlockTheme}
|
||||||
ref='previewCodeBlockTheme'
|
ref='previewCodeBlockTheme'
|
||||||
@@ -389,7 +451,7 @@ class UiTab extends React.Component {
|
|||||||
ref='previewScrollPastEnd'
|
ref='previewScrollPastEnd'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
Allow preview to scroll past the last line
|
{i18n.__('Allow preview to scroll past the last line')}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-checkBoxSection'>
|
<div styleName='group-checkBoxSection'>
|
||||||
@@ -399,12 +461,39 @@ class UiTab extends React.Component {
|
|||||||
ref='previewLineNumber'
|
ref='previewLineNumber'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
Show line numbers for preview code blocks
|
{i18n.__('Show line numbers for preview code blocks')}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div styleName='group-checkBoxSection'>
|
||||||
|
<label>
|
||||||
|
<input onChange={(e) => this.handleUIChange(e)}
|
||||||
|
checked={this.state.config.preview.smartQuotes}
|
||||||
|
ref='previewSmartQuotes'
|
||||||
|
type='checkbox'
|
||||||
|
/>
|
||||||
|
Enable smart quotes
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div styleName='group-section'>
|
||||||
|
<div styleName='group-section-label'>
|
||||||
|
{i18n.__('Sanitization')}
|
||||||
|
</div>
|
||||||
|
<div styleName='group-section-control'>
|
||||||
|
<select value={config.preview.sanitize}
|
||||||
|
ref='previewSanitize'
|
||||||
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
|
>
|
||||||
|
<option value='STRICT'>✅ {i18n.__('Only allow secure html tags (recommended)')}
|
||||||
|
</option>
|
||||||
|
<option value='ALLOW_STYLES'>⚠️ {i18n.__('Allow styles')}</option>
|
||||||
|
<option value='NONE'>❌ {i18n.__('Allow dangerous html tags')}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
LaTeX Inline Open Delimiter
|
{i18n.__('LaTeX Inline Open Delimiter')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
@@ -417,7 +506,7 @@ class UiTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
LaTeX Inline Close Delimiter
|
{i18n.__('LaTeX Inline Close Delimiter')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
@@ -430,7 +519,7 @@ class UiTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
LaTeX Block Open Delimiter
|
{i18n.__('LaTeX Block Open Delimiter')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
@@ -443,7 +532,7 @@ class UiTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>
|
<div styleName='group-section-label'>
|
||||||
LaTeX Block Close Delimiter
|
{i18n.__('LaTeX Block Close Delimiter')}
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
@@ -457,7 +546,7 @@ class UiTab extends React.Component {
|
|||||||
|
|
||||||
<div styleName='group-control'>
|
<div styleName='group-control'>
|
||||||
<button styleName='group-control-rightButton'
|
<button styleName='group-control-rightButton'
|
||||||
onClick={(e) => this.handleSaveUIClick(e)}>Save
|
onClick={(e) => this.handleSaveUIClick(e)}>{i18n.__('Save')}
|
||||||
</button>
|
</button>
|
||||||
{UiAlertElement}
|
{UiAlertElement}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,11 +6,13 @@ import UiTab from './UiTab'
|
|||||||
import InfoTab from './InfoTab'
|
import InfoTab from './InfoTab'
|
||||||
import Crowdfunding from './Crowdfunding'
|
import Crowdfunding from './Crowdfunding'
|
||||||
import StoragesTab from './StoragesTab'
|
import StoragesTab from './StoragesTab'
|
||||||
|
import Blog from './Blog'
|
||||||
import ModalEscButton from 'browser/components/ModalEscButton'
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './PreferencesModal.styl'
|
import styles from './PreferencesModal.styl'
|
||||||
import RealtimeNotification from 'browser/components/RealtimeNotification'
|
import RealtimeNotification from 'browser/components/RealtimeNotification'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class Preferences extends React.Component {
|
class Preferences extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -19,7 +21,8 @@ class Preferences extends React.Component {
|
|||||||
this.state = {
|
this.state = {
|
||||||
currentTab: 'STORAGES',
|
currentTab: 'STORAGES',
|
||||||
UIAlert: '',
|
UIAlert: '',
|
||||||
HotkeyAlert: ''
|
HotkeyAlert: '',
|
||||||
|
BlogAlert: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +78,14 @@ class Preferences extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Crowdfunding />
|
<Crowdfunding />
|
||||||
)
|
)
|
||||||
|
case 'BLOG':
|
||||||
|
return (
|
||||||
|
<Blog
|
||||||
|
dispatch={dispatch}
|
||||||
|
config={config}
|
||||||
|
haveToSave={alert => this.setState({BlogAlert: alert})}
|
||||||
|
/>
|
||||||
|
)
|
||||||
case 'STORAGES':
|
case 'STORAGES':
|
||||||
default:
|
default:
|
||||||
return (
|
return (
|
||||||
@@ -107,11 +118,12 @@ class Preferences extends React.Component {
|
|||||||
const content = this.renderContent()
|
const content = this.renderContent()
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{target: 'STORAGES', label: 'Storage'},
|
{target: 'STORAGES', label: i18n.__('Storage')},
|
||||||
{target: 'HOTKEY', label: 'Hotkeys', Hotkey: this.state.HotkeyAlert},
|
{target: 'HOTKEY', label: i18n.__('Hotkeys'), Hotkey: this.state.HotkeyAlert},
|
||||||
{target: 'UI', label: 'Interface', UI: this.state.UIAlert},
|
{target: 'UI', label: i18n.__('Interface'), UI: this.state.UIAlert},
|
||||||
{target: 'INFO', label: 'About'},
|
{target: 'INFO', label: i18n.__('About')},
|
||||||
{target: 'CROWDFUNDING', label: 'Crowdfunding'}
|
{target: 'CROWDFUNDING', label: i18n.__('Crowdfunding')},
|
||||||
|
{target: 'BLOG', label: i18n.__('Blog'), Blog: this.state.BlogAlert}
|
||||||
]
|
]
|
||||||
|
|
||||||
const navButtons = tabs.map((tab) => {
|
const navButtons = tabs.map((tab) => {
|
||||||
@@ -140,7 +152,7 @@ class Preferences extends React.Component {
|
|||||||
onKeyDown={(e) => this.handleKeyDown(e)}
|
onKeyDown={(e) => this.handleKeyDown(e)}
|
||||||
>
|
>
|
||||||
<div styleName='top-bar'>
|
<div styleName='top-bar'>
|
||||||
<p>Your preferences for Boostnote</p>
|
<p>{i18n.__('Your preferences for Boostnote')}</p>
|
||||||
</div>
|
</div>
|
||||||
<ModalEscButton handleEscButtonClick={(e) => this.handleEscButtonClick(e)} />
|
<ModalEscButton handleEscButtonClick={(e) => this.handleEscButtonClick(e)} />
|
||||||
<div styleName='nav'>
|
<div styleName='nav'>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import styles from './RenameFolderModal.styl'
|
|||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import ModalEscButton from 'browser/components/ModalEscButton'
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
|
import i18n from 'browser/lib/i18n'
|
||||||
|
|
||||||
class RenameFolderModal extends React.Component {
|
class RenameFolderModal extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -72,13 +73,13 @@ class RenameFolderModal extends React.Component {
|
|||||||
onKeyDown={(e) => this.handleKeyDown(e)}
|
onKeyDown={(e) => this.handleKeyDown(e)}
|
||||||
>
|
>
|
||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='title'>Rename Folder</div>
|
<div styleName='title'>{i18n.__('Rename Folder')}</div>
|
||||||
</div>
|
</div>
|
||||||
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
|
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
<input styleName='control-input'
|
<input styleName='control-input'
|
||||||
placeholder='Folder Name'
|
placeholder={i18n.__('Folder Name')}
|
||||||
ref='name'
|
ref='name'
|
||||||
value={this.state.name}
|
value={this.state.name}
|
||||||
onChange={(e) => this.handleChange(e)}
|
onChange={(e) => this.handleChange(e)}
|
||||||
@@ -87,7 +88,7 @@ class RenameFolderModal extends React.Component {
|
|||||||
<button styleName='control-confirmButton'
|
<button styleName='control-confirmButton'
|
||||||
onClick={(e) => this.handleConfirmButtonClick(e)}
|
onClick={(e) => this.handleConfirmButtonClick(e)}
|
||||||
>
|
>
|
||||||
Confirm
|
{i18n.__('Confirm')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function data (state = defaultDataMap(), action) {
|
|||||||
|
|
||||||
action.notes.some((note) => {
|
action.notes.some((note) => {
|
||||||
if (note === undefined) return true
|
if (note === undefined) return true
|
||||||
const uniqueKey = note.storage + '-' + note.key
|
const uniqueKey = note.key
|
||||||
const folderKey = note.storage + '-' + note.folder
|
const folderKey = note.storage + '-' + note.folder
|
||||||
state.noteMap.set(uniqueKey, note)
|
state.noteMap.set(uniqueKey, note)
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ function data (state = defaultDataMap(), action) {
|
|||||||
case 'UPDATE_NOTE':
|
case 'UPDATE_NOTE':
|
||||||
{
|
{
|
||||||
const note = action.note
|
const note = action.note
|
||||||
const uniqueKey = note.storage + '-' + note.key
|
const uniqueKey = note.key
|
||||||
const folderKey = note.storage + '-' + note.folder
|
const folderKey = note.storage + '-' + note.folder
|
||||||
const oldNote = state.noteMap.get(uniqueKey)
|
const oldNote = state.noteMap.get(uniqueKey)
|
||||||
|
|
||||||
@@ -162,9 +162,9 @@ function data (state = defaultDataMap(), action) {
|
|||||||
case 'MOVE_NOTE':
|
case 'MOVE_NOTE':
|
||||||
{
|
{
|
||||||
const originNote = action.originNote
|
const originNote = action.originNote
|
||||||
const originKey = originNote.storage + '-' + originNote.key
|
const originKey = originNote.key
|
||||||
const note = action.note
|
const note = action.note
|
||||||
const uniqueKey = note.storage + '-' + note.key
|
const uniqueKey = note.key
|
||||||
const folderKey = note.storage + '-' + note.folder
|
const folderKey = note.storage + '-' + note.folder
|
||||||
const oldNote = state.noteMap.get(uniqueKey)
|
const oldNote = state.noteMap.get(uniqueKey)
|
||||||
|
|
||||||
@@ -297,7 +297,7 @@ function data (state = defaultDataMap(), action) {
|
|||||||
}
|
}
|
||||||
case 'DELETE_NOTE':
|
case 'DELETE_NOTE':
|
||||||
{
|
{
|
||||||
const uniqueKey = action.storageKey + '-' + action.noteKey
|
const uniqueKey = action.noteKey
|
||||||
const targetNote = state.noteMap.get(uniqueKey)
|
const targetNote = state.noteMap.get(uniqueKey)
|
||||||
|
|
||||||
state = Object.assign({}, state)
|
state = Object.assign({}, state)
|
||||||
@@ -423,7 +423,7 @@ function data (state = defaultDataMap(), action) {
|
|||||||
state.folderNoteMap = new Map(state.folderNoteMap)
|
state.folderNoteMap = new Map(state.folderNoteMap)
|
||||||
state.tagNoteMap = new Map(state.tagNoteMap)
|
state.tagNoteMap = new Map(state.tagNoteMap)
|
||||||
action.notes.forEach((note) => {
|
action.notes.forEach((note) => {
|
||||||
const uniqueKey = note.storage + '-' + note.key
|
const uniqueKey = note.key
|
||||||
const folderKey = note.storage + '-' + note.folder
|
const folderKey = note.storage + '-' + note.folder
|
||||||
state.noteMap.set(uniqueKey, note)
|
state.noteMap.set(uniqueKey, note)
|
||||||
|
|
||||||
@@ -483,7 +483,7 @@ function data (state = defaultDataMap(), action) {
|
|||||||
state.tagNoteMap = new Map(state.tagNoteMap)
|
state.tagNoteMap = new Map(state.tagNoteMap)
|
||||||
state.starredSet = new Set(state.starredSet)
|
state.starredSet = new Set(state.starredSet)
|
||||||
notes.forEach((note) => {
|
notes.forEach((note) => {
|
||||||
const noteKey = storage.key + '-' + note.key
|
const noteKey = note.key
|
||||||
state.noteMap.delete(noteKey)
|
state.noteMap.delete(noteKey)
|
||||||
state.starredSet.delete(noteKey)
|
state.starredSet.delete(noteKey)
|
||||||
note.tags.forEach((tag) => {
|
note.tags.forEach((tag) => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ $danger-color = #c9302c
|
|||||||
$danger-lighten-color = lighten(#c9302c, 5%)
|
$danger-lighten-color = lighten(#c9302c, 5%)
|
||||||
|
|
||||||
// Layouts
|
// Layouts
|
||||||
$statusBar-height = 0px
|
$statusBar-height = 22px
|
||||||
$sideNav-width = 200px
|
$sideNav-width = 200px
|
||||||
$sideNav--folded-width = 44px
|
$sideNav--folded-width = 44px
|
||||||
$topBar-height = 60px
|
$topBar-height = 60px
|
||||||
@@ -347,4 +347,4 @@ modalSolarizedDark()
|
|||||||
width 100%
|
width 100%
|
||||||
background-color $ui-solarized-dark-backgroundColor
|
background-color $ui-solarized-dark-backgroundColor
|
||||||
overflow hidden
|
overflow hidden
|
||||||
border-radius $modal-border-radius
|
border-radius $modal-border-radius
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build
|
# Build
|
||||||
Diese Seite ist auch verfügbar in [Japanese](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/build.md), [Korean](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/build.md), [Russain](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/build.md), [Simplified Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/build.md), [French](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/build.md) and [German](https://github.com/BoostIO/Boostnote/blob/master/docs/de/build.md).
|
Diese Seite ist auch verfügbar in [Japanisch](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/build.md), [Koreanisch](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/build.md), [Russisch](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/build.md), [Vereinfachtem Chinesisch](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/build.md), [Französisch](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/build.md) und [Deutsch](https://github.com/BoostIO/Boostnote/blob/master/docs/de/build.md).
|
||||||
|
|
||||||
## Umgebungen
|
## Umgebungen
|
||||||
* npm: 4.x
|
* npm: 4.x
|
||||||
|
|||||||
@@ -1,25 +1,31 @@
|
|||||||
# How to debug Boostnote (Electron app)
|
# How to debug Boostnote (Electron app)
|
||||||
Diese Seite ist auch verfügbar in [Japanese](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Korean](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russain](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Simplified Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [French](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) and [German](https://github.com/BoostIO/Boostnote/blob/add-german-documents/docs/de/debug.md).
|
|
||||||
|
|
||||||
Boostnote is eine Electron app, somit basiert sie auf Chromium; Entwickler können die `Developer Tools` verwenden, wie Google Chrome.
|
Diese Seite ist auch verfügbar in [Japanisch](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Koreanisch](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russisch](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Vereinfachtem Chinesisch](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [Französisch](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) und [Deutsch](https://github.com/BoostIO/Boostnote/blob/master/docs/de/debug.md).
|
||||||
|
|
||||||
|
|
||||||
|
Boostnote ist eine Electron App und basiert auf Chromium.
|
||||||
|
|
||||||
|
Zum Entwicklen verwendest du am Besten die `Developer Tools` von Google Chrome verwenden. Diese kannst du ganz einfach im unter dem Menüpunkt `View` mit `Toggle Developer Tools` aktivieren:
|
||||||
|
|
||||||
Du kannst die `Developer Tools` so einschalten:
|
|
||||||

|

|
||||||
|
|
||||||
Die `Developer Tools` schauen dann ungefähr so aus:
|
Die Anzeige der `Developer Tools` sieht in etwa so aus:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Wenn Fehler vorkommen, werden die Fehlermeldungen in der `console` ausgegeben.
|
|
||||||
|
|
||||||
## Debugging
|
## Debugging
|
||||||
Zum Beispiel kannst du mit dem `debugger` Haltepunkte im Code setzen wie hier veranschaulicht:
|
|
||||||
|
Fehlermeldungen werden in der Regel in der `console` ausgegeben, die du über den gleichnamigen Reiter der `Developer Tools` anzeigen lassen kannst. Zum Debuggen kannst du beispielsweise über den `debugger` Haltepunkte im Code setzen.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Das ist ledigtlich ein Beispiel, du kannst die Art von Debugging verwenden die für dich am besten ist.
|
Du kannst aber natürlich auch die Art von Debugging verwenden mit der du am besten zurecht kommst.
|
||||||
|
|
||||||
## Referenz
|
## Referenz
|
||||||
|
|
||||||
* [Official document of Google Chrome about debugging](https://developer.chrome.com/devtools)
|
* [Official document of Google Chrome about debugging](https://developer.chrome.com/devtools)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Special thanks: Translated by [gino909](https://github.com/gino909)
|
Special thanks: Translated by [gino909](https://github.com/gino909), [mdeuerlein](https://github.com/mdeuerlein)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# How to debug Boostnote (Electron app)
|
# How to debug Boostnote (Electron app)
|
||||||
This page is also available in [Japanese](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Korean](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russain](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Simplified Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [French](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) and [German](https://github.com/BoostIO/Boostnote/blob/add-german-documents/docs/de/debug.md).
|
This page is also available in [Japanese](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Korean](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russain](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Simplified Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [French](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) and [German](https://github.com/BoostIO/Boostnote/blob/master/docs/de/debug.md).
|
||||||
|
|
||||||
Boostnote is an Electron app so it's based on Chromium; developers can use `Developer Tools` just like Google Chrome.
|
Boostnote is an Electron app so it's based on Chromium; developers can use `Developer Tools` just like Google Chrome.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build
|
# Build
|
||||||
Cette page est également disponible en [Japonais](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/build.md), [Coréen](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/build.md), [Russe](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/build.md), et en [Chinois Simplifié](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/build.md).
|
Cette page est également disponible en [Anglais](https://github.com/BoostIO/Boostnote/blob/master/docs/build.md), [Japonais](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/build.md), [Coréen](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/build.md), [Russe](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/build.md), [Chinois Simplifié](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/build.md) et en [Allemand](https://github.com/BoostIO/Boostnote/blob/master/docs/de/build.md)
|
||||||
|
|
||||||
## Environnements
|
## Environnements
|
||||||
* npm: 4.x
|
* npm: 4.x
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Comment débugger Boostnote (Application Electron)
|
# Comment débugger Boostnote (Application Electron)
|
||||||
Cette page est également disponible en [Japonais](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Coréen](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russe](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), et en [Chinois Simplifié](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md)
|
Cette page est également disponible en [Angalis](https://github.com/BoostIO/Boostnote/blob/master/docs/debug.md), [Japonais](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Coréen](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russe](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Chinois Simplifié](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md) et en [Allemand](https://github.com/BoostIO/Boostnote/blob/master/docs/de/debug.md)
|
||||||
|
|
||||||
Boostnote est une application Electron donc basée sur Chromium. Il est possible d'utiliser les `Developer Tools` comme dans Google Chrome.
|
Boostnote est une application Electron donc basée sur Chromium. Il est possible d'utiliser les `Developer Tools` comme dans Google Chrome.
|
||||||
|
|
||||||
@@ -19,4 +19,4 @@ Par exemple, vous pouvez utiliser le `debugger` pour placer un point d'arrêt da
|
|||||||
C'est une façon comme une autre de faire, vous pouvez trouver une façon de débugger que vous trouverez plus adaptée.
|
C'est une façon comme une autre de faire, vous pouvez trouver une façon de débugger que vous trouverez plus adaptée.
|
||||||
|
|
||||||
## Références
|
## Références
|
||||||
* [Documentation officiel de Google Chrome sur le debugging](https://developer.chrome.com/devtools)
|
* [Documentation officiel de Google Chrome sur le debugging](https://developer.chrome.com/devtools)
|
||||||
|
|||||||
86
docs/zh_TW/build.md
Normal file
86
docs/zh_TW/build.md
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# 編譯
|
||||||
|
此文件還提供下列的語言 [日文](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/build.md), [韓文](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/build.md), [俄文](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/build.md), [簡體中文](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/build.md), [法文](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/build.md) and [德文](https://github.com/BoostIO/Boostnote/blob/master/docs/de/build.md).
|
||||||
|
|
||||||
|
## 環境
|
||||||
|
* npm: 4.x
|
||||||
|
* node: 7.x
|
||||||
|
|
||||||
|
`$ grunt pre-build` 在 `npm v5.x` 有問題,所以只能用 `npm v4.x` 。
|
||||||
|
|
||||||
|
## 開發
|
||||||
|
|
||||||
|
我們使用 Webpack HMR 來開發 Boostnote。
|
||||||
|
|
||||||
|
在專案根目錄底下執行下列指令,將會以原始設置啟動 Boostnote。
|
||||||
|
|
||||||
|
**用 yarn 來安裝必要 packages**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ yarn
|
||||||
|
```
|
||||||
|
|
||||||
|
**開始開發**
|
||||||
|
|
||||||
|
```
|
||||||
|
$ yarn run dev-start
|
||||||
|
```
|
||||||
|
|
||||||
|
上述指令同時運行了 `yarn run webpack` 及 `yarn run hot`,相當於將這兩個指令在不同的 terminal 中運行。
|
||||||
|
|
||||||
|
`webpack` 會同時監控修改過的程式碼,並
|
||||||
|
The `webpack` will watch for code changes and then apply them automatically.
|
||||||
|
|
||||||
|
If the following error occurs: `Failed to load resource: net::ERR_CONNECTION_REFUSED`, please reload Boostnote.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
> ### Notice
|
||||||
|
> There are some cases where you have to refresh the app manually.
|
||||||
|
> 1. When editing a constructor method of a component
|
||||||
|
> 2. When adding a new css class (similar to 1: the CSS class is re-written by each component. This process occurs at the Constructor method.)
|
||||||
|
|
||||||
|
## Deploy
|
||||||
|
|
||||||
|
We use Grunt to automate deployment.
|
||||||
|
You can build the program by using `grunt`. However, we don't recommend this because the default task includes codesign and authenticode.
|
||||||
|
|
||||||
|
So, we've prepared a separate script which just makes an executable file.
|
||||||
|
|
||||||
|
This build doesn't work on npm v5.3.0. So you need to use v5.2.0 when you build it.
|
||||||
|
|
||||||
|
```
|
||||||
|
grunt pre-build
|
||||||
|
```
|
||||||
|
|
||||||
|
You will find the executable in the `dist` directory. Note, the auto updater won't work because the app isn't signed.
|
||||||
|
|
||||||
|
If you find it necessary, you can use codesign or authenticode with this executable.
|
||||||
|
|
||||||
|
## Make own distribution packages (deb, rpm)
|
||||||
|
|
||||||
|
Distribution packages are created by exec `grunt build` on Linux platform (e.g. Ubuntu, Fedora).
|
||||||
|
|
||||||
|
> Note: You can create both `.deb` and `.rpm` in a single environment.
|
||||||
|
|
||||||
|
After installing the supported version of `node` and `npm`, install build dependency packages.
|
||||||
|
|
||||||
|
|
||||||
|
Ubuntu/Debian:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt-get install -y rpm fakeroot
|
||||||
|
```
|
||||||
|
|
||||||
|
Fedora:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo dnf install -y dpkg dpkg-dev rpm-build fakeroot
|
||||||
|
```
|
||||||
|
|
||||||
|
Then execute `grunt build`.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ grunt build
|
||||||
|
```
|
||||||
|
|
||||||
|
You will find `.deb` and `.rpm` in the `dist` directory.
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
(function (mod) {
|
||||||
|
if (typeof exports === 'object' && typeof module === 'object') { // Common JS
|
||||||
|
mod(require('../codemirror/lib/codemirror'))
|
||||||
|
} else if (typeof define === 'function' && define.amd) { // AMD
|
||||||
|
define(['../codemirror/lib/codemirror'], mod)
|
||||||
|
} else { // Plain browser env
|
||||||
|
mod(CodeMirror)
|
||||||
|
}
|
||||||
|
})(function (CodeMirror) {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/
|
||||||
|
var emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/
|
||||||
|
var unorderedListRE = /[*+-]\s/
|
||||||
|
|
||||||
|
CodeMirror.commands.boostNewLineAndIndentContinueMarkdownList = function (cm) {
|
||||||
|
if (cm.getOption('disableInput')) return CodeMirror.Pass
|
||||||
|
var ranges = cm.listSelections()
|
||||||
|
var replacements = []
|
||||||
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
|
var pos = ranges[i].head
|
||||||
|
var eolState = cm.getStateAfter(pos.line)
|
||||||
|
var inList = eolState.list !== false
|
||||||
|
var inQuote = eolState.quote !== 0
|
||||||
|
var line = cm.getLine(pos.line)
|
||||||
|
var match = listRE.exec(line)
|
||||||
|
if (!ranges[i].empty() || (!inList && !inQuote) || !match || pos.ch < match[2].length - 1) {
|
||||||
|
cm.execCommand('newlineAndIndent')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (emptyListRE.test(line)) {
|
||||||
|
if (!/>\s*$/.test(line)) {
|
||||||
|
cm.replaceRange('', {
|
||||||
|
line: pos.line, ch: 0
|
||||||
|
}, {
|
||||||
|
line: pos.line, ch: pos.ch + 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
replacements[i] = '\n'
|
||||||
|
} else {
|
||||||
|
var indent = match[1]
|
||||||
|
var after = match[5]
|
||||||
|
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf('>') >= 0
|
||||||
|
? match[2].replace('x', ' ')
|
||||||
|
: (parseInt(match[3], 10) + 1) + match[4]
|
||||||
|
replacements[i] = '\n' + indent + bullet + after
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.replaceSelections(replacements)
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -69,6 +69,10 @@ ipc.on('update-app-confirm', function (event, msg) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.on('window-all-closed', function () {
|
||||||
|
app.quit()
|
||||||
|
})
|
||||||
|
|
||||||
app.on('ready', function () {
|
app.on('ready', function () {
|
||||||
mainWindow = require('./main-window')
|
mainWindow = require('./main-window')
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const BrowserWindow = electron.BrowserWindow
|
const BrowserWindow = electron.BrowserWindow
|
||||||
const shell = electron.shell
|
const shell = electron.shell
|
||||||
|
const ipc = electron.ipcMain
|
||||||
const mainWindow = require('./main-window')
|
const mainWindow = require('./main-window')
|
||||||
|
|
||||||
const macOS = process.platform === 'darwin'
|
const macOS = process.platform === 'darwin'
|
||||||
@@ -259,6 +260,23 @@ const view = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let editorFocused
|
||||||
|
|
||||||
|
// Define extra shortcut keys
|
||||||
|
mainWindow.webContents.on('before-input-event', (event, input) => {
|
||||||
|
// Synonyms for Search (Find)
|
||||||
|
if (input.control && input.key === 'f' && input.type === 'keyDown') {
|
||||||
|
if (!editorFocused) {
|
||||||
|
mainWindow.webContents.send('top:focus-search')
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
ipc.on('editor:focused', (event, isFocused) => {
|
||||||
|
editorFocused = isFocused
|
||||||
|
})
|
||||||
|
|
||||||
const window = {
|
const window = {
|
||||||
label: 'Window',
|
label: 'Window',
|
||||||
submenu: [
|
submenu: [
|
||||||
@@ -267,6 +285,11 @@ const window = {
|
|||||||
accelerator: 'Command+M',
|
accelerator: 'Command+M',
|
||||||
selector: 'performMiniaturize:'
|
selector: 'performMiniaturize:'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Toggle Full Screen',
|
||||||
|
accelerator: 'Command+Control+F',
|
||||||
|
selector: 'toggleFullScreen:'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Close',
|
label: 'Close',
|
||||||
accelerator: 'Command+W',
|
accelerator: 'Command+W',
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ mainWindow.webContents.sendInputEvent({
|
|||||||
keyCode: '\u0008'
|
keyCode: '\u0008'
|
||||||
})
|
})
|
||||||
|
|
||||||
if (process.platform === 'darwin' || process.env.DESKTOP_SESSION === 'cinnamon') {
|
if (process.platform === 'darwin') {
|
||||||
mainWindow.on('close', function (e) {
|
mainWindow.on('close', function (e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if (mainWindow.isFullScreen()) {
|
if (mainWindow.isFullScreen()) {
|
||||||
@@ -56,11 +56,8 @@ if (process.platform === 'darwin' || process.env.DESKTOP_SESSION === 'cinnamon')
|
|||||||
app.on('before-quit', function (e) {
|
app.on('before-quit', function (e) {
|
||||||
mainWindow.removeAllListeners()
|
mainWindow.removeAllListeners()
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
app.on('window-all-closed', function () {
|
|
||||||
app.quit()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mainWindow.on('resize', _.throttle(storeWindowSize, 500))
|
mainWindow.on('resize', _.throttle(storeWindowSize, 500))
|
||||||
|
|
||||||
function storeWindowSize () {
|
function storeWindowSize () {
|
||||||
|
|||||||
@@ -57,6 +57,10 @@
|
|||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
pointer-events: auto !important;
|
pointer-events: auto !important;
|
||||||
}
|
}
|
||||||
|
.CodeMirror-ruler {
|
||||||
|
border-left-color: rgba(142, 142, 142, 0.5);
|
||||||
|
mix-blend-mode: difference;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -78,9 +82,10 @@
|
|||||||
<script src="../node_modules/codemirror/keymap/emacs.js"></script>
|
<script src="../node_modules/codemirror/keymap/emacs.js"></script>
|
||||||
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
|
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
|
||||||
|
|
||||||
<script src="../node_modules/boost/boostNewLineIndentContinueMarkdownList.js"></script>
|
<script src="../extra_scripts/boost/boostNewLineIndentContinueMarkdownList.js"></script>
|
||||||
|
|
||||||
<script src="../node_modules/codemirror/addon/edit/closebrackets.js"></script>
|
<script src="../node_modules/codemirror/addon/edit/closebrackets.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/edit/matchbrackets.js"></script>
|
||||||
|
|
||||||
<script src="../node_modules/codemirror/addon/search/search.js"></script>
|
<script src="../node_modules/codemirror/addon/search/search.js"></script>
|
||||||
<script src="../node_modules/codemirror/addon/search/searchcursor.js"></script>
|
<script src="../node_modules/codemirror/addon/search/searchcursor.js"></script>
|
||||||
@@ -88,7 +93,13 @@
|
|||||||
<script src="../node_modules/codemirror/addon/scroll/scrollpastend.js"></script>
|
<script src="../node_modules/codemirror/addon/scroll/scrollpastend.js"></script>
|
||||||
<script src="../node_modules/codemirror/addon/search/matchesonscrollbar.js"></script>
|
<script src="../node_modules/codemirror/addon/search/matchesonscrollbar.js"></script>
|
||||||
<script src="../node_modules/codemirror/addon/search/jump-to-line.js"></script>
|
<script src="../node_modules/codemirror/addon/search/jump-to-line.js"></script>
|
||||||
|
|
||||||
|
<script src="../node_modules/codemirror/addon/fold/brace-fold.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/fold/foldgutter.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/fold/foldcode.js"></script>
|
||||||
|
|
||||||
<script src="../node_modules/codemirror/addon/dialog/dialog.js"></script>
|
<script src="../node_modules/codemirror/addon/dialog/dialog.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/display/rulers.js"></script>
|
||||||
|
|
||||||
<script src="../node_modules/raphael/raphael.min.js"></script>
|
<script src="../node_modules/raphael/raphael.min.js"></script>
|
||||||
<script src="../node_modules/flowchart.js/release/flowchart.min.js"></script>
|
<script src="../node_modules/flowchart.js/release/flowchart.min.js"></script>
|
||||||
@@ -97,7 +108,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="../node_modules/js-sequence-diagrams/fucknpm/sequence-diagram-min.js"></script>
|
<script src="../node_modules/js-sequence-diagrams/fucknpm/sequence-diagram-min.js"></script>
|
||||||
<script src="../node_modules/katex/dist/katex.min.js"></script>
|
|
||||||
<script src="../node_modules/react/dist/react.min.js"></script>
|
<script src="../node_modules/react/dist/react.min.js"></script>
|
||||||
<script src="../node_modules/react-dom/dist/react-dom.min.js"></script>
|
<script src="../node_modules/react-dom/dist/react-dom.min.js"></script>
|
||||||
<script src="../node_modules/redux/dist/redux.min.js"></script>
|
<script src="../node_modules/redux/dist/redux.min.js"></script>
|
||||||
|
|||||||
153
locales/da.json
Normal file
153
locales/da.json
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
{
|
||||||
|
"Notes": "Notes",
|
||||||
|
"Tags": "Tags",
|
||||||
|
"Preferences": "Preferences",
|
||||||
|
"Make a note": "Make a note",
|
||||||
|
"Ctrl": "Ctrl",
|
||||||
|
"Ctrl(^)": "Ctrl",
|
||||||
|
"to create a new note": "to create a new note",
|
||||||
|
"Toggle Mode": "Toggle Mode",
|
||||||
|
"Trash": "Trash",
|
||||||
|
"MODIFICATION DATE": "MODIFICATION DATE",
|
||||||
|
"Words": "Words",
|
||||||
|
"Letters": "Letters",
|
||||||
|
"STORAGE": "STORAGE",
|
||||||
|
"FOLDER": "FOLDER",
|
||||||
|
"CREATION DATE": "CREATION DATE",
|
||||||
|
"NOTE LINK": "NOTE LINK",
|
||||||
|
".md": ".md",
|
||||||
|
".txt": ".txt",
|
||||||
|
".html": ".html",
|
||||||
|
"Print": "Print",
|
||||||
|
"Your preferences for Boostnote": "Your preferences for Boostnote",
|
||||||
|
"Storages": "Storages",
|
||||||
|
"Add Storage Location": "Add Storage Location",
|
||||||
|
"Add Folder": "Add Folder",
|
||||||
|
"Open Storage folder": "Open Storage folder",
|
||||||
|
"Unlink": "Unlink",
|
||||||
|
"Edit": "Edit",
|
||||||
|
"Delete": "Delete",
|
||||||
|
"Interface": "Interface",
|
||||||
|
"Interface Theme": "Interface Theme",
|
||||||
|
"Default": "Default",
|
||||||
|
"White": "White",
|
||||||
|
"Solarized Dark": "Solarized Dark",
|
||||||
|
"Dark": "Dark",
|
||||||
|
"Show a confirmation dialog when deleting notes": "Show a confirmation dialog when deleting notes",
|
||||||
|
"Editor Theme": "Editor Theme",
|
||||||
|
"Editor Font Size": "Editor Font Size",
|
||||||
|
"Editor Font Family": "Editor Font Family",
|
||||||
|
"Editor Indent Style": "Editor Indent Style",
|
||||||
|
"Spaces": "Spaces",
|
||||||
|
"Tabs": "Tabs",
|
||||||
|
"Switch to Preview": "Switch to Preview",
|
||||||
|
"When Editor Blurred": "When Editor Blurred",
|
||||||
|
"When Editor Blurred, Edit On Double Click": "When Editor Blurred, Edit On Double Click",
|
||||||
|
"On Right Click": "On Right Click",
|
||||||
|
"Editor Keymap": "Editor Keymap",
|
||||||
|
"default": "default",
|
||||||
|
"vim": "vim",
|
||||||
|
"emacs": "emacs",
|
||||||
|
"⚠️ Please restart boostnote after you change the keymap": "⚠️ Please restart boostnote after you change the keymap",
|
||||||
|
"Show line numbers in the editor": "Show line numbers in the editor",
|
||||||
|
"Allow editor to scroll past the last line": "Allow editor to scroll past the last line",
|
||||||
|
"Bring in web page title when pasting URL on editor": "Bring in web page title when pasting URL on editor",
|
||||||
|
"Preview": "Preview",
|
||||||
|
"Preview Font Size": "Preview Font Size",
|
||||||
|
"Preview Font Family": "Preview Font Family",
|
||||||
|
"Code block Theme": "Code block Theme",
|
||||||
|
"Allow preview to scroll past the last line": "Allow preview to scroll past the last line",
|
||||||
|
"Show line numbers for preview code blocks": "Show line numbers for preview code blocks",
|
||||||
|
"LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter",
|
||||||
|
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
|
||||||
|
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
|
||||||
|
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
|
||||||
|
"Community": "Community",
|
||||||
|
"Subscribe to Newsletter": "Subscribe to Newsletter",
|
||||||
|
"GitHub": "GitHub",
|
||||||
|
"Blog": "Blog",
|
||||||
|
"Facebook Group": "Facebook Group",
|
||||||
|
"Twitter": "Twitter",
|
||||||
|
"About": "About",
|
||||||
|
"Boostnote": "Boostnote",
|
||||||
|
"An open source note-taking app made for programmers just like you.": "An open source note-taking app made for programmers just like you.",
|
||||||
|
"Website": "Website",
|
||||||
|
"Development": "Development",
|
||||||
|
" : Development configurations for Boostnote.": " : Development configurations for Boostnote.",
|
||||||
|
"Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO",
|
||||||
|
"License: GPL v3": "License: GPL v3",
|
||||||
|
"Analytics": "Analytics",
|
||||||
|
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.",
|
||||||
|
"You can see how it works on ": "You can see how it works on ",
|
||||||
|
"You can choose to enable or disable this option.": "You can choose to enable or disable this option.",
|
||||||
|
"Enable analytics to help improve Boostnote": "Enable analytics to help improve Boostnote",
|
||||||
|
"Crowdfunding": "Crowdfunding",
|
||||||
|
"Dear everyone,": "Dear everyone,",
|
||||||
|
"Thank you for using Boostnote!": "Thank you for using Boostnote!",
|
||||||
|
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote is used in about 200 different countries and regions by an awesome community of developers.",
|
||||||
|
"To continue supporting this growth, and to satisfy community expectations,": "To continue supporting this growth, and to satisfy community expectations,",
|
||||||
|
"we would like to invest more time and resources in this project.": "we would like to invest more time and resources in this project.",
|
||||||
|
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "If you like this project and see its potential, you can help by supporting us on OpenCollective!",
|
||||||
|
"Thanks,": "Thanks,",
|
||||||
|
"Boostnote maintainers": "Boostnote maintainers",
|
||||||
|
"Support via OpenCollective": "Support via OpenCollective",
|
||||||
|
"Language": "Language",
|
||||||
|
"English": "English",
|
||||||
|
"German": "German",
|
||||||
|
"French": "French",
|
||||||
|
"Show \"Saved to Clipboard\" notification when copying": "Show \"Saved to Clipboard\" notification when copying",
|
||||||
|
"All Notes": "All Notes",
|
||||||
|
"Starred": "Starred",
|
||||||
|
"Are you sure to ": "Are you sure to ",
|
||||||
|
" delete": " delete",
|
||||||
|
"this folder?": "this folder?",
|
||||||
|
"Confirm": "Confirm",
|
||||||
|
"Cancel": "Cancel",
|
||||||
|
"Markdown Note": "Markdown Note",
|
||||||
|
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "This format is for creating text documents. Checklists, code blocks and Latex blocks are available.",
|
||||||
|
"Snippet Note": "Snippet Note",
|
||||||
|
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "This format is for creating code snippets. Multiple snippets can be grouped into a single note.",
|
||||||
|
"Tab to switch format": "Tab to switch format",
|
||||||
|
"Updated": "Updated",
|
||||||
|
"Created": "Created",
|
||||||
|
"Alphabetically": "Alphabetically",
|
||||||
|
"Default View": "Default View",
|
||||||
|
"Compressed View": "Compressed View",
|
||||||
|
"Search": "Search",
|
||||||
|
"Blog Type": "Blog Type",
|
||||||
|
"Blog Address": "Blog Address",
|
||||||
|
"Save": "Save",
|
||||||
|
"Auth": "Auth",
|
||||||
|
"Authentication Method": "Authentication Method",
|
||||||
|
"JWT": "JWT",
|
||||||
|
"USER": "USER",
|
||||||
|
"Token": "Token",
|
||||||
|
"Storage": "Storage",
|
||||||
|
"Hotkeys": "Hotkeys",
|
||||||
|
"Show/Hide Boostnote": "Show/Hide Boostnote",
|
||||||
|
"Restore": "Restore",
|
||||||
|
"Permanent Delete": "Permanent Delete",
|
||||||
|
"Confirm note deletion": "Confirm note deletion",
|
||||||
|
"This will permanently remove this note.": "This will permanently remove this note.",
|
||||||
|
"Successfully applied!": "Successfully applied!",
|
||||||
|
"Albanian": "Albanian",
|
||||||
|
"Chinese (zh-CN)": "Chinese (zh-CN)",
|
||||||
|
"Chinese (zh-TW)": "Chinese (zh-TW)",
|
||||||
|
"Danish": "Danish",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Korean": "Korean",
|
||||||
|
"Norwegian": "Norwegian",
|
||||||
|
"Polish": "Polish",
|
||||||
|
"Portuguese": "Portuguese",
|
||||||
|
"Spanish": "Spanish",
|
||||||
|
"You have to save!": "You have to save!",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Command(⌘)": "Command(⌘)",
|
||||||
|
"Editor Rulers": "Editor Rulers",
|
||||||
|
"Enable": "Enable",
|
||||||
|
"Disable": "Disable",
|
||||||
|
"Sanitization": "Sanitization",
|
||||||
|
"Only allow secure html tags (recommended)": "Only allow secure html tags (recommended)",
|
||||||
|
"Allow styles": "Allow styles",
|
||||||
|
"Allow dangerous html tags": "Allow dangerous html tags"
|
||||||
|
}
|
||||||
208
locales/de.json
Normal file
208
locales/de.json
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
{
|
||||||
|
"Notes": "Notizen",
|
||||||
|
"Tags": "Tags",
|
||||||
|
"Preferences": "Einstellungen",
|
||||||
|
"Make a note": "Notiz erstellen",
|
||||||
|
"Ctrl": "Strg",
|
||||||
|
"Ctrl(^)": "Strg",
|
||||||
|
"to create a new note": "um eine neue Notiz zu erstellen",
|
||||||
|
"Toggle Mode": "Modus umschalten",
|
||||||
|
"Trash": "Papierkorb",
|
||||||
|
"MODIFICATION DATE": "ÄNDERUNGSDATUM",
|
||||||
|
"Words": "Wörter",
|
||||||
|
"Letters": "Buchstaben",
|
||||||
|
"STORAGE": "SPEICHERORT",
|
||||||
|
"FOLDER": "ORDNER",
|
||||||
|
"CREATION DATE": "ERSTELLUNGSDATUM",
|
||||||
|
"NOTE LINK": "NOTIZ LINK",
|
||||||
|
".md": ".md",
|
||||||
|
".txt": ".txt",
|
||||||
|
".html": ".html",
|
||||||
|
"Print": "Drucken",
|
||||||
|
"Your preferences for Boostnote": "Boostnote Einstellungen",
|
||||||
|
"Storages": "Speicherverwaltung",
|
||||||
|
"Add Storage Location": "Speicherort hinzufügen",
|
||||||
|
"Add Folder": "Ordner hinzufügen",
|
||||||
|
"Open Storage folder": "Speicherort öffnen",
|
||||||
|
"Unlink": "Verknüpfung aufheben",
|
||||||
|
"Edit": "Bearbeiten",
|
||||||
|
"Delete": "Löschen",
|
||||||
|
"Interface": "Darstellung",
|
||||||
|
"Interface Theme": "Stil",
|
||||||
|
"Default": "Standard",
|
||||||
|
"White": "Hell",
|
||||||
|
"Solarized Dark": "Solarized Dark",
|
||||||
|
"Dark": "Dunkel",
|
||||||
|
"Show a confirmation dialog when deleting notes": "Bestätigungsdialog beim Löschen von Notizen anzeigen",
|
||||||
|
"Editor Theme": "Editor Theme",
|
||||||
|
"Editor Font Size": "Editor Schriftgröße",
|
||||||
|
"Editor Font Family": "Editor Schriftart",
|
||||||
|
"Editor Indent Style": "Editor Einrückestil",
|
||||||
|
"Spaces": "Leerzeichen",
|
||||||
|
"Tabs": "Tabs",
|
||||||
|
"Switch to Preview": "Zur Vorschau wechseln",
|
||||||
|
"When Editor Blurred": "Wenn Editor nicht fokusiert",
|
||||||
|
"When Editor Blurred, Edit On Double Click": "Mit Doppelklick bearbeiten, wenn Editor in Vorschaumodus",
|
||||||
|
"On Right Click": "Mit Rechtsklick",
|
||||||
|
"Editor Keymap": "Editor Tastenbelegung",
|
||||||
|
"default": "Standard",
|
||||||
|
"vim": "vim",
|
||||||
|
"emacs": "emacs",
|
||||||
|
"⚠️ Please restart boostnote after you change the keymap": "⚠️ Boostnote nach Änderung der Tastenbelegung neu starten",
|
||||||
|
"Show line numbers in the editor": "Zeilennummern im Editor anzeigen",
|
||||||
|
"Allow editor to scroll past the last line": "Editor das Scrollen über das Ende hinaus erlauben",
|
||||||
|
"Bring in web page title when pasting URL on editor": "Titel der Website beim Einfügen in den Editor anzeigen",
|
||||||
|
"Preview": "Vorschau",
|
||||||
|
"Preview Font Size": "Vorschau Schriftgröße",
|
||||||
|
"Preview Font Family": "Vorschau Schriftart",
|
||||||
|
"Code block Theme": "Code-Block Theme",
|
||||||
|
"Allow preview to scroll past the last line": "Vorschau das Scrollen über das Ende hinaus erlauben",
|
||||||
|
"Show line numbers for preview code blocks": "Zeilennummern in Vorschau-Code-Blöcken anzeigen",
|
||||||
|
"LaTeX Inline Open Delimiter": "LaTeX Inline Beginn Kennzeichen",
|
||||||
|
"LaTeX Inline Close Delimiter": "LaTeX Inline Ende Kennzeichen",
|
||||||
|
"LaTeX Block Open Delimiter": "LaTeX Block Beginn Kennzeichen",
|
||||||
|
"LaTeX Block Close Delimiter": "LaTeX Block Ende Kennzeichen",
|
||||||
|
"Community": "Community",
|
||||||
|
"Subscribe to Newsletter": "Newsletter abonnieren",
|
||||||
|
"GitHub": "GitHub",
|
||||||
|
"Blog": "Blog",
|
||||||
|
"Facebook Group": "Facebook Gruppe",
|
||||||
|
"Twitter": "Twitter",
|
||||||
|
"About": "Über",
|
||||||
|
"Boostnote": "Boostnote",
|
||||||
|
"An open source note-taking app made for programmers just like you.": "Eine OpenSource-Notizapp für Programmierer wie du und ich.",
|
||||||
|
"Website": "Website",
|
||||||
|
"Development": "Entwicklung",
|
||||||
|
" : Development configurations for Boostnote.": " : Entwicklungseinstellungen für Boostnote.",
|
||||||
|
"Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO",
|
||||||
|
"License: GPL v3": "License: GPL v3",
|
||||||
|
"Analytics": "Analytics",
|
||||||
|
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote sammelt anonyme Daten, um die App zu verbessern. Persönliche Informationen, wie z.B. der Inhalt deiner Notizen, werden dabei nicht erfasst.",
|
||||||
|
"You can see how it works on ": "Wie das funktioniert, kannst du dir hier ansehen ",
|
||||||
|
"You can choose to enable or disable this option.": "Du kannst wählen, ob du diese Option aktivieren oder daektivieren möchtest.",
|
||||||
|
"Enable analytics to help improve Boostnote": "Datenerhebung zur Verbesserung von Boostnote aktivieren",
|
||||||
|
"Crowdfunding": "Crowdfunding",
|
||||||
|
"Dear everyone,": "Hallo,",
|
||||||
|
"Thank you for using Boostnote!": "Danke, dass du Boostnote verwendest.",
|
||||||
|
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote wird in über 200 verschiedenen Ländern von einer großartigen Community von Entwicklern verwendet.",
|
||||||
|
"To continue supporting this growth, and to satisfy community expectations,": "Um die Erwartungen der Community weiterhin erfüllen zu können und die Verbreitung von Boostnote weiter voranzutreiben,",
|
||||||
|
"we would like to invest more time and resources in this project.": "würden wir gern mehr Zeit und Resourcen in dieses Projekt investieren.",
|
||||||
|
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "Wenn dir dieses Projekt gefällt und du sein Potential erkennst, kannst du uns gern mit OpenCollective unterstützen!",
|
||||||
|
"Thanks,": "Vielen Dank,",
|
||||||
|
"Boostnote maintainers": "Dein Boostnote Team",
|
||||||
|
"Support via OpenCollective": "Unterstützen mit OpenCollective",
|
||||||
|
"Language": "Sprache",
|
||||||
|
"English": "Englisch",
|
||||||
|
"German": "Deutsch",
|
||||||
|
"French": "Französisch",
|
||||||
|
"Show \"Saved to Clipboard\" notification when copying": "\"Auf Clipboard gespeichert\" Benachrichtigungen beim Kopieren anzeigen",
|
||||||
|
"All Notes": "Alle Notizen",
|
||||||
|
"Starred": "Markiert",
|
||||||
|
"Are you sure to ": "Sind sie sicher ",
|
||||||
|
" delete": " zu löschen",
|
||||||
|
"this folder?": "diesen Ordner?",
|
||||||
|
"Confirm": "Bestätigen",
|
||||||
|
"Cancel": "Abbrechen",
|
||||||
|
"Markdown Note": "Markdown Notiz",
|
||||||
|
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "Mit diesem Format kannst du einzelne Textdokumente erstellen. Dabei stehen dir Checklisten, Code- & Latex-Blöcke zur Verfügung.",
|
||||||
|
"Snippet Note": "Codeschnipsel",
|
||||||
|
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "Mit diesem Format kannst du mehrere Codeschnipsel erstellen und sie in einer Notiz zusammenfassen.",
|
||||||
|
"Tab to switch format": "Tab drücken, um das Format zu wechseln",
|
||||||
|
"Updated": "Bearbeitet",
|
||||||
|
"Created": "Erstellt",
|
||||||
|
"Alphabetically": "Alphabetisch",
|
||||||
|
"Default View": "Standardansicht",
|
||||||
|
"Compressed View": "Kompaktansicht",
|
||||||
|
"Search": "Suchen",
|
||||||
|
"Blog Type": "Blog-Typ",
|
||||||
|
"Blog Address": "Blog Adresse",
|
||||||
|
"Save": "Speichern",
|
||||||
|
"Auth": "Authentifizierung",
|
||||||
|
"Authentication Method": "Authentifizierungsmethode",
|
||||||
|
"JWT": "JWT",
|
||||||
|
"USER": "BENUTZER",
|
||||||
|
"Token": "Token",
|
||||||
|
"Storage": "Speicher",
|
||||||
|
"Hotkeys": "Tastenkürzel",
|
||||||
|
"Show/Hide Boostnote": "Boostnote anzeigen/verstecken",
|
||||||
|
"Restore": "Wiederherstellen",
|
||||||
|
"Permanent Delete": "Dauerhaft löschen",
|
||||||
|
"Confirm note deletion": "Löschen bestätigen",
|
||||||
|
"This will permanently remove this note.": "Diese Notiz wird dauerhaft gelöscht.",
|
||||||
|
"You have to save!": "Speichern notwendig!",
|
||||||
|
"Albanian": "Albanisch",
|
||||||
|
"Danish": "Dänisch",
|
||||||
|
"Japanese": "Japanisch",
|
||||||
|
"Korean": "Koreanisch",
|
||||||
|
"Norwegian": "Norwegisch",
|
||||||
|
"Polish": "Polnisch",
|
||||||
|
"Portuguese": "Portugiesisch",
|
||||||
|
"Spanish": "Spanisch",
|
||||||
|
"Chinese (zh-CN)": "Chinesisch (China)",
|
||||||
|
"Chinese (zh-TW)": "Chinesisch (Taiwan)",
|
||||||
|
"Successfully applied!": "Erfolgreich gespeichert!",
|
||||||
|
"UserName": "Benutzername",
|
||||||
|
"Password": "Passwort",
|
||||||
|
"Russian": "Russisch",
|
||||||
|
"Command(⌘)": "Befehlstaste(⌘)",
|
||||||
|
"Editor Rulers": "Editor Trennline",
|
||||||
|
"Enable": "Aktiviert",
|
||||||
|
"Disable": "Deaktiviert",
|
||||||
|
"Sanitization": "Sanitization",
|
||||||
|
"Only allow secure html tags (recommended)": "Erlaube nur sichere HTML Tags (empfohlen)",
|
||||||
|
"Allow styles": "Erlaube Styles",
|
||||||
|
"Allow dangerous html tags": "Erlaube gefähliche HTML Tags",
|
||||||
|
"Select filter mode": "Wähle Filter Modus",
|
||||||
|
"Add tag...": "Tag hinzufügen...",
|
||||||
|
"Star": "Markieren",
|
||||||
|
"Fullscreen": "Vollbild",
|
||||||
|
"Info": "Info",
|
||||||
|
"Remove pin": "Pin entfernen",
|
||||||
|
"Pin to Top": "Notiz anpinnen",
|
||||||
|
"Delete Note": "Notiz löschen",
|
||||||
|
"Clone Note": "Notiz duplizieren",
|
||||||
|
"Restore Note": "Notiz wiederherstellen",
|
||||||
|
"Copy Note Link": "Link zur Notiz kopieren",
|
||||||
|
"Publish Blog": "Auf Blog veröffentlichen",
|
||||||
|
"Update Blog": "Blog aktualisieren",
|
||||||
|
"Open Blog": "Blog öffnen",
|
||||||
|
"Empty Trash": "Papierkorb leeren",
|
||||||
|
"Rename Folder": "Ordner umbenennen",
|
||||||
|
"Export Folder": "Ordner exportieren",
|
||||||
|
"Export as txt": "Exportieren als txt",
|
||||||
|
"Export as md": "Exportieren als md",
|
||||||
|
"Delete Folder": "Ordner löschen",
|
||||||
|
"Select directory": "Ordner auswählen",
|
||||||
|
"Select a folder to export the files to": "Wähle einen Ordner zum Export der Dateien",
|
||||||
|
"Description...": "Beschreibung...",
|
||||||
|
"Publish Failed": "Veröffentlichung fehlgeschlagen",
|
||||||
|
"Check and update your blog setting and try again.": "Prüfe und aktualisiere deine Blog Einstellungen und versuche es noch einmal.",
|
||||||
|
"Delete a snippet": "Codeschnipsel löschen",
|
||||||
|
"This work cannot be undone.": "Diese Aktion kann nicht rückgängig gemacht werden.",
|
||||||
|
"Help": "Hilfe",
|
||||||
|
"Hungarian": "Ungarisch",
|
||||||
|
"Hide Help": "Hilfe verstecken",
|
||||||
|
"wordpress": "Wordpress",
|
||||||
|
"Add Storage": "Speicher hinzufügen",
|
||||||
|
"Name": "Name",
|
||||||
|
"Type": "Typ",
|
||||||
|
"File System": "Dateisystem",
|
||||||
|
"Setting up 3rd-party cloud storage integration:": "Integration von Cloudspeicher externer Anbieter einrichten:",
|
||||||
|
"Cloud-Syncing-and-Backup": "Cloud-Syncing-and-Backup",
|
||||||
|
"Location": "Ort",
|
||||||
|
"Add": "Hinzufügen",
|
||||||
|
"Available Keys": "Verfügbare Tasten",
|
||||||
|
"Select Directory": "Ordner auswählen",
|
||||||
|
"copy": "Kopie",
|
||||||
|
"Create new folder": "Ordner erstellen",
|
||||||
|
"Folder name": "Ordnername",
|
||||||
|
"Create": "Erstellen",
|
||||||
|
"Untitled": "Neuer Ordner",
|
||||||
|
"Unlink Storage": "Speicherverknüpfung aufheben",
|
||||||
|
"Unlinking removes this linked storage from Boostnote. No data is removed, please manually delete the folder from your hard drive if needed.": "Die Verknüpfung des Speichers mit Boostnote wird entfernt. Es werden keine Daten gelöscht. Um die Daten dauerhaft zu löschen musst du den Ordner auf der Festplatte manuell entfernen.",
|
||||||
|
"Empty note": "Leere Notiz",
|
||||||
|
"Unnamed": "Unbenannt",
|
||||||
|
"Rename": "Umbenennen",
|
||||||
|
"Folder Name": "Ordnername",
|
||||||
|
"No tags": "Keine Tags"
|
||||||
|
}
|
||||||
156
locales/en.json
Normal file
156
locales/en.json
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
{
|
||||||
|
"Notes": "Notes",
|
||||||
|
"Tags": "Tags",
|
||||||
|
"Preferences": "Preferences",
|
||||||
|
"Make a note": "Make a note",
|
||||||
|
"Ctrl": "Ctrl",
|
||||||
|
"Ctrl(^)": "Ctrl",
|
||||||
|
"to create a new note": "to create a new note",
|
||||||
|
"Toggle Mode": "Toggle Mode",
|
||||||
|
"Trash": "Trash",
|
||||||
|
"MODIFICATION DATE": "MODIFICATION DATE",
|
||||||
|
"Words": "Words",
|
||||||
|
"Letters": "Letters",
|
||||||
|
"STORAGE": "STORAGE",
|
||||||
|
"FOLDER": "FOLDER",
|
||||||
|
"CREATION DATE": "CREATION DATE",
|
||||||
|
"NOTE LINK": "NOTE LINK",
|
||||||
|
".md": ".md",
|
||||||
|
".txt": ".txt",
|
||||||
|
".html": ".html",
|
||||||
|
"Print": "Print",
|
||||||
|
"Your preferences for Boostnote": "Your preferences for Boostnote",
|
||||||
|
"Storages": "Storages",
|
||||||
|
"Add Storage Location": "Add Storage Location",
|
||||||
|
"Add Folder": "Add Folder",
|
||||||
|
"Open Storage folder": "Open Storage folder",
|
||||||
|
"Unlink": "Unlink",
|
||||||
|
"Edit": "Edit",
|
||||||
|
"Delete": "Delete",
|
||||||
|
"Interface": "Interface",
|
||||||
|
"Interface Theme": "Interface Theme",
|
||||||
|
"Default": "Default",
|
||||||
|
"White": "White",
|
||||||
|
"Solarized Dark": "Solarized Dark",
|
||||||
|
"Dark": "Dark",
|
||||||
|
"Show a confirmation dialog when deleting notes": "Show a confirmation dialog when deleting notes",
|
||||||
|
"Editor Theme": "Editor Theme",
|
||||||
|
"Editor Font Size": "Editor Font Size",
|
||||||
|
"Editor Font Family": "Editor Font Family",
|
||||||
|
"Editor Indent Style": "Editor Indent Style",
|
||||||
|
"Spaces": "Spaces",
|
||||||
|
"Tabs": "Tabs",
|
||||||
|
"Switch to Preview": "Switch to Preview",
|
||||||
|
"When Editor Blurred": "When Editor Blurred",
|
||||||
|
"When Editor Blurred, Edit On Double Click": "When Editor Blurred, Edit On Double Click",
|
||||||
|
"On Right Click": "On Right Click",
|
||||||
|
"Editor Keymap": "Editor Keymap",
|
||||||
|
"default": "default",
|
||||||
|
"vim": "vim",
|
||||||
|
"emacs": "emacs",
|
||||||
|
"⚠️ Please restart boostnote after you change the keymap": "⚠️ Please restart boostnote after you change the keymap",
|
||||||
|
"Show line numbers in the editor": "Show line numbers in the editor",
|
||||||
|
"Allow editor to scroll past the last line": "Allow editor to scroll past the last line",
|
||||||
|
"Bring in web page title when pasting URL on editor": "Bring in web page title when pasting URL on editor",
|
||||||
|
"Preview": "Preview",
|
||||||
|
"Preview Font Size": "Preview Font Size",
|
||||||
|
"Preview Font Family": "Preview Font Family",
|
||||||
|
"Code block Theme": "Code block Theme",
|
||||||
|
"Allow preview to scroll past the last line": "Allow preview to scroll past the last line",
|
||||||
|
"Show line numbers for preview code blocks": "Show line numbers for preview code blocks",
|
||||||
|
"LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter",
|
||||||
|
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
|
||||||
|
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
|
||||||
|
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
|
||||||
|
"Community": "Community",
|
||||||
|
"Subscribe to Newsletter": "Subscribe to Newsletter",
|
||||||
|
"GitHub": "GitHub",
|
||||||
|
"Blog": "Blog",
|
||||||
|
"Facebook Group": "Facebook Group",
|
||||||
|
"Twitter": "Twitter",
|
||||||
|
"About": "About",
|
||||||
|
"Boostnote": "Boostnote",
|
||||||
|
"An open source note-taking app made for programmers just like you.": "An open source note-taking app made for programmers just like you.",
|
||||||
|
"Website": "Website",
|
||||||
|
"Development": "Development",
|
||||||
|
" : Development configurations for Boostnote.": " : Development configurations for Boostnote.",
|
||||||
|
"Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO",
|
||||||
|
"License: GPL v3": "License: GPL v3",
|
||||||
|
"Analytics": "Analytics",
|
||||||
|
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.",
|
||||||
|
"You can see how it works on ": "You can see how it works on ",
|
||||||
|
"You can choose to enable or disable this option.": "You can choose to enable or disable this option.",
|
||||||
|
"Enable analytics to help improve Boostnote": "Enable analytics to help improve Boostnote",
|
||||||
|
"Crowdfunding": "Crowdfunding",
|
||||||
|
"Dear everyone,": "Dear everyone,",
|
||||||
|
"Thank you for using Boostnote!": "Thank you for using Boostnote!",
|
||||||
|
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote is used in about 200 different countries and regions by an awesome community of developers.",
|
||||||
|
"To continue supporting this growth, and to satisfy community expectations,": "To continue supporting this growth, and to satisfy community expectations,",
|
||||||
|
"we would like to invest more time and resources in this project.": "we would like to invest more time and resources in this project.",
|
||||||
|
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "If you like this project and see its potential, you can help by supporting us on OpenCollective!",
|
||||||
|
"Thanks,": "Thanks,",
|
||||||
|
"Boostnote maintainers": "Boostnote maintainers",
|
||||||
|
"Support via OpenCollective": "Support via OpenCollective",
|
||||||
|
"Language": "Language",
|
||||||
|
"English": "English",
|
||||||
|
"German": "German",
|
||||||
|
"French": "French",
|
||||||
|
"Show \"Saved to Clipboard\" notification when copying": "Show \"Saved to Clipboard\" notification when copying",
|
||||||
|
"All Notes": "All Notes",
|
||||||
|
"Starred": "Starred",
|
||||||
|
"Are you sure to ": "Are you sure to ",
|
||||||
|
" delete": " delete",
|
||||||
|
"this folder?": "this folder?",
|
||||||
|
"Confirm": "Confirm",
|
||||||
|
"Cancel": "Cancel",
|
||||||
|
"Markdown Note": "Markdown Note",
|
||||||
|
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "This format is for creating text documents. Checklists, code blocks and Latex blocks are available.",
|
||||||
|
"Snippet Note": "Snippet Note",
|
||||||
|
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "This format is for creating code snippets. Multiple snippets can be grouped into a single note.",
|
||||||
|
"Tab to switch format": "Tab to switch format",
|
||||||
|
"Updated": "Updated",
|
||||||
|
"Created": "Created",
|
||||||
|
"Alphabetically": "Alphabetically",
|
||||||
|
"Counter": "Counter",
|
||||||
|
"Default View": "Default View",
|
||||||
|
"Compressed View": "Compressed View",
|
||||||
|
"Search": "Search",
|
||||||
|
"Blog Type": "Blog Type",
|
||||||
|
"Blog Address": "Blog Address",
|
||||||
|
"Save": "Save",
|
||||||
|
"Auth": "Auth",
|
||||||
|
"Authentication Method": "Authentication Method",
|
||||||
|
"JWT": "JWT",
|
||||||
|
"USER": "USER",
|
||||||
|
"Token": "Token",
|
||||||
|
"Storage": "Storage",
|
||||||
|
"Hotkeys": "Hotkeys",
|
||||||
|
"Show/Hide Boostnote": "Show/Hide Boostnote",
|
||||||
|
"Restore": "Restore",
|
||||||
|
"Permanent Delete": "Permanent Delete",
|
||||||
|
"Confirm note deletion": "Confirm note deletion",
|
||||||
|
"This will permanently remove this note.": "This will permanently remove this note.",
|
||||||
|
"Successfully applied!": "Successfully applied!",
|
||||||
|
"Albanian": "Albanian",
|
||||||
|
"Chinese (zh-CN)": "Chinese (zh-CN)",
|
||||||
|
"Chinese (zh-TW)": "Chinese (zh-TW)",
|
||||||
|
"Danish": "Danish",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Korean": "Korean",
|
||||||
|
"Norwegian": "Norwegian",
|
||||||
|
"Polish": "Polish",
|
||||||
|
"Portuguese": "Portuguese",
|
||||||
|
"Spanish": "Spanish",
|
||||||
|
"You have to save!": "You have to save!",
|
||||||
|
"UserName": "UserName",
|
||||||
|
"Password": "Password",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Command(⌘)": "Command(⌘)",
|
||||||
|
"Editor Rulers": "Editor Rulers",
|
||||||
|
"Enable": "Enable",
|
||||||
|
"Disable": "Disable",
|
||||||
|
"Sanitization": "Sanitization",
|
||||||
|
"Only allow secure html tags (recommended)": "Only allow secure html tags (recommended)",
|
||||||
|
"Allow styles": "Allow styles",
|
||||||
|
"Allow dangerous html tags": "Allow dangerous html tags"
|
||||||
|
}
|
||||||
153
locales/es-ES.json
Normal file
153
locales/es-ES.json
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
{
|
||||||
|
"Notes": "Notas",
|
||||||
|
"Tags": "Etiquetas",
|
||||||
|
"Preferences": "Preferencias",
|
||||||
|
"Make a note": "Tomar una nota",
|
||||||
|
"Ctrl": "Ctrl",
|
||||||
|
"Ctrl(^)": "Ctrl",
|
||||||
|
"to create a new note": "para crear una nueva nota",
|
||||||
|
"Toggle Mode": "Alternar modo",
|
||||||
|
"Trash": "Basura",
|
||||||
|
"MODIFICATION DATE": "FECHA DE MODIFICACIÓN",
|
||||||
|
"Words": "Palabras",
|
||||||
|
"Letters": "Letras",
|
||||||
|
"STORAGE": "ALMACENAMIENTO",
|
||||||
|
"FOLDER": "CARPETA",
|
||||||
|
"CREATION DATE": "FECHA DE CREACIÓN",
|
||||||
|
"NOTE LINK": "ENLACE A LA NOTA",
|
||||||
|
".md": ".md",
|
||||||
|
".txt": ".txt",
|
||||||
|
".html": ".html",
|
||||||
|
"Print": "Imprimir",
|
||||||
|
"Your preferences for Boostnote": "Tus preferencias para Boostnote",
|
||||||
|
"Storages": "Almacenamientos",
|
||||||
|
"Add Storage Location": "Añadir ubicación de almacenamiento",
|
||||||
|
"Add Folder": "Añadir carpeta",
|
||||||
|
"Open Storage folder": "Añadir carpeta de almacenamiento",
|
||||||
|
"Unlink": "Desvincular",
|
||||||
|
"Edit": "Editar",
|
||||||
|
"Delete": "Eliminar",
|
||||||
|
"Interface": "Interfaz",
|
||||||
|
"Interface Theme": "Tema de la interfaz",
|
||||||
|
"Default": "Por defecto",
|
||||||
|
"White": "Blanco",
|
||||||
|
"Solarized Dark": "Solarizado oscuro",
|
||||||
|
"Dark": "Oscuro",
|
||||||
|
"Show a confirmation dialog when deleting notes": "Requerir confirmación al eliminar nota",
|
||||||
|
"Editor Theme": "Tema del editor",
|
||||||
|
"Editor Font Size": "Tamaño de fuente del editor",
|
||||||
|
"Editor Font Family": "Fuente del editor",
|
||||||
|
"Editor Indent Style": "Estilo de indentado del editor",
|
||||||
|
"Spaces": "Espacios",
|
||||||
|
"Tabs": "Tabulación",
|
||||||
|
"Switch to Preview": "Cambiar a Previsualización",
|
||||||
|
"When Editor Blurred": "Cuando el editor pierde el foco",
|
||||||
|
"When Editor Blurred, Edit On Double Click": "Cuando el editor pierde el foco, editar con doble clic",
|
||||||
|
"On Right Click": "Al hacer clic derecho",
|
||||||
|
"Editor Keymap": "Mapeo de teclas del editor",
|
||||||
|
"default": "por defecto",
|
||||||
|
"vim": "vim",
|
||||||
|
"emacs": "emacs",
|
||||||
|
"⚠️ Please restart boostnote after you change the keymap": "⚠️ Reinicie boostnote después de cambiar el mapeo de teclas",
|
||||||
|
"Show line numbers in the editor": "Mostrar números de línea en el editor",
|
||||||
|
"Allow editor to scroll past the last line": "Permitir al editor desplazarse más allá de la última línea",
|
||||||
|
"Bring in web page title when pasting URL on editor": "Al pegar una URL en el editor, insertar el título de la web automáticamente",
|
||||||
|
"Preview": "Previsualización",
|
||||||
|
"Preview Font Size": "Previsualizar tamaño de la fuente",
|
||||||
|
"Preview Font Family": "Previsualizar fuente",
|
||||||
|
"Code block Theme": "Tema de los bloques de código",
|
||||||
|
"Allow preview to scroll past the last line": "Permitir a la previsualización desplazarse más allá de la última línea",
|
||||||
|
"Show line numbers for preview code blocks": "Mostar números de línea al previsualizar bloques de código",
|
||||||
|
"LaTeX Inline Open Delimiter": "Delimitador de apertura LaTeX en línea",
|
||||||
|
"LaTeX Inline Close Delimiter": "Delimitador de cierre LaTeX en línea",
|
||||||
|
"LaTeX Block Open Delimiter": "Delimitado de apertura bloque LaTeX",
|
||||||
|
"LaTeX Block Close Delimiter": "Delimitador de cierre bloque LaTeX",
|
||||||
|
"Community": "Comunidad",
|
||||||
|
"Subscribe to Newsletter": "Suscribirse al boletín",
|
||||||
|
"GitHub": "GitHub",
|
||||||
|
"Blog": "Blog",
|
||||||
|
"Facebook Group": "Grupo de Facebook",
|
||||||
|
"Twitter": "Twitter",
|
||||||
|
"About": "Sobre",
|
||||||
|
"Boostnote": "Boostnote",
|
||||||
|
"An open source note-taking app made for programmers just like you.": "Una aplicación para tomar notas de código abieto para programadores como tú.",
|
||||||
|
"Website": "Página web",
|
||||||
|
"Development": "Desarrollo",
|
||||||
|
" : Development configurations for Boostnote.": " : Configuraciones de desarrollo para Boostnote.",
|
||||||
|
"Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO",
|
||||||
|
"License: GPL v3": "Licencia: GPL v3",
|
||||||
|
"Analytics": "Analítica",
|
||||||
|
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote recopila datos anónimos con el único propósito de mejorar la aplicación. No recopila ninguna información personal, como puede ser el contenido de sus notas.",
|
||||||
|
"You can see how it works on ": "Puedes ver cómo funciona en ",
|
||||||
|
"You can choose to enable or disable this option.": "Puedes elegir activar o desactivar esta opción.",
|
||||||
|
"Enable analytics to help improve Boostnote": "Activa analítica para ayudar a mejorar Boostnote",
|
||||||
|
"Crowdfunding": "Crowdfunding",
|
||||||
|
"Dear everyone,": "Hola a todos,",
|
||||||
|
"Thank you for using Boostnote!": "Gracias por usar Boostnote!",
|
||||||
|
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote es utilizado en alrededor de 200 países y regiones diferentes por una increíble comunidad de desarrolladores.",
|
||||||
|
"To continue supporting this growth, and to satisfy community expectations,": "Para continuar apoyando este crecimiento y satisfacer las expectativas de la comunidad,",
|
||||||
|
"we would like to invest more time and resources in this project.": "nos gustaría invertir más tiempo y recursos en este proyecto.",
|
||||||
|
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "Si te gusta este proyecto y ves potencial en él, ¡puedes ayudar apoyándonos en OpenCollective!",
|
||||||
|
"Thanks,": "Gracias,",
|
||||||
|
"Boostnote maintainers": "Equipo de Boostnote",
|
||||||
|
"Support via OpenCollective": "Contribuir vía OpenCollective",
|
||||||
|
"Language": "Idioma",
|
||||||
|
"English": "Inglés",
|
||||||
|
"German": "Alemán",
|
||||||
|
"French": "Francés",
|
||||||
|
"Show \"Saved to Clipboard\" notification when copying": "Mostrar la notificaión \"Guardado en Portapapeles\" al copiar",
|
||||||
|
"All Notes": "Todas las notas",
|
||||||
|
"Starred": "Destacado",
|
||||||
|
"Are you sure to ": "Estás seguro de ",
|
||||||
|
" delete": " eliminar",
|
||||||
|
"this folder?": "esta carpeta?",
|
||||||
|
"Confirm": "Confirmar",
|
||||||
|
"Cancel": "Cancelar",
|
||||||
|
"Markdown Note": "Nota Markdown",
|
||||||
|
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "Formato para crear documentos de texto. Permite utilizar listas, bloques de código y LaTeX.",
|
||||||
|
"Snippet Note": "Nota Snippet",
|
||||||
|
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "Formato para fragmentos de código. Múltiples fragmentos se pueden agrupar en una sola nota.",
|
||||||
|
"Tab to switch format": "Tabulador para cambiar formato",
|
||||||
|
"Updated": "Actualizado",
|
||||||
|
"Created": "Creado",
|
||||||
|
"Alphabetically": "Alfabéticamente",
|
||||||
|
"Default View": "Vista por defecto",
|
||||||
|
"Compressed View": "Vista comprimida",
|
||||||
|
"Search": "Buscar",
|
||||||
|
"Blog Type": "Tipo de blog",
|
||||||
|
"Blog Address": "Dirección del blog",
|
||||||
|
"Save": "Guardar",
|
||||||
|
"Auth": "Auth",
|
||||||
|
"Authentication Method": "Método de autentificación",
|
||||||
|
"JWT": "JWT",
|
||||||
|
"USER": "USUARIO",
|
||||||
|
"Token": "Token",
|
||||||
|
"Storage": "Almacenamiento",
|
||||||
|
"Hotkeys": "Atajos de teclado",
|
||||||
|
"Show/Hide Boostnote": "Mostrar/Ocultar Boostnote",
|
||||||
|
"Restore": "Restaurar",
|
||||||
|
"Permanent Delete": "Eliminar permanentemente",
|
||||||
|
"Confirm note deletion": "Confirmar eliminación de nota",
|
||||||
|
"This will permanently remove this note.": "La nota se eliminará permanentemente.",
|
||||||
|
"Successfully applied!": "Aplicado con éxito!",
|
||||||
|
"Albanian": "Albanés",
|
||||||
|
"Chinese (zh-CN)": "Chino - China",
|
||||||
|
"Chinese (zh-TW)": "Chino - Taiwan",
|
||||||
|
"Danish": "Danés",
|
||||||
|
"Japanese": "Japonés",
|
||||||
|
"Korean": "Coreano",
|
||||||
|
"Norwegian": "Noruego",
|
||||||
|
"Polish": "Polaco",
|
||||||
|
"Portuguese": "Portugues",
|
||||||
|
"Spanish": "Español",
|
||||||
|
"You have to save!": "Tienes que guardar!",
|
||||||
|
"Russian": "Ruso",
|
||||||
|
"Command(⌘)": "Command(⌘)",
|
||||||
|
"Editor Rulers": "Reglas del editor",
|
||||||
|
"Enable": "Activar",
|
||||||
|
"Disable": "Desactivar",
|
||||||
|
"Sanitization": "Saneamiento",
|
||||||
|
"Only allow secure html tags (recommended)": "Solo permitir etiquetas html seguras (recomendado)",
|
||||||
|
"Allow styles": "Permitir estilos",
|
||||||
|
"Allow dangerous html tags": "Permitir etiques html peligrosas"
|
||||||
|
}
|
||||||
153
locales/fr.json
Normal file
153
locales/fr.json
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
{
|
||||||
|
"Notes": "Notes",
|
||||||
|
"Tags": "Tags",
|
||||||
|
"Preferences": "Préférences",
|
||||||
|
"Make a note": "Créer une note",
|
||||||
|
"Ctrl": "Ctrl",
|
||||||
|
"Ctrl(^)": "Ctrl",
|
||||||
|
"to create a new note": "pour créer une nouvelle note",
|
||||||
|
"Toggle Mode": "Toggle Mode",
|
||||||
|
"Trash": "Poubelle",
|
||||||
|
"MODIFICATION DATE": "DATE DE MODIFICATION",
|
||||||
|
"Words": "Mots",
|
||||||
|
"Letters": "Lettres",
|
||||||
|
"STORAGE": "STOCKAGE",
|
||||||
|
"FOLDER": "DOSSIER",
|
||||||
|
"CREATION DATE": "DATE DE CREATION",
|
||||||
|
"NOTE LINK": "LIEN DE LA NOTE",
|
||||||
|
".md": ".md",
|
||||||
|
".txt": ".txt",
|
||||||
|
".html": ".html",
|
||||||
|
"Print": "Imprimer",
|
||||||
|
"Your preferences for Boostnote": "Vos préférences pour Boostnote",
|
||||||
|
"Storages": "Stockages",
|
||||||
|
"Add Storage Location": "Ajouter un espace de stockage",
|
||||||
|
"Add Folder": "Ajouter un dossier",
|
||||||
|
"Open Storage folder": "Ouvrir un dossier de stockage",
|
||||||
|
"Unlink": "Délier",
|
||||||
|
"Edit": "Editer",
|
||||||
|
"Delete": "Supprimer",
|
||||||
|
"Interface": "Interface",
|
||||||
|
"Interface Theme": "Thème d'interface",
|
||||||
|
"Default": "Effacer",
|
||||||
|
"White": "Blanc",
|
||||||
|
"Solarized Dark": "Foncé solarisé",
|
||||||
|
"Dark": "Foncé",
|
||||||
|
"Show a confirmation dialog when deleting notes": "Montrer une alerte de confirmation lors de la suppression de notes",
|
||||||
|
"Editor Theme": "Theme d'éditeur",
|
||||||
|
"Editor Font Size": "Taille de police de l'éditeur",
|
||||||
|
"Editor Font Family": "Police de l'éditeur",
|
||||||
|
"Editor Indent Style": "Style d'indentation de l'éditeur",
|
||||||
|
"Spaces": "Espaces",
|
||||||
|
"Tabs": "Tabulations",
|
||||||
|
"Switch to Preview": "Switcher vers l'aperçu",
|
||||||
|
"When Editor Blurred": "Quand l'éditeur n'est pas sélectionné",
|
||||||
|
"When Editor Blurred, Edit On Double Click": "Quand l'éditeur n'est pas sélectionné, éditer avec un double clic",
|
||||||
|
"On Right Click": "Avec un clic droit",
|
||||||
|
"Editor Keymap": "Keymap de l'éditeur",
|
||||||
|
"default": "Par défaut",
|
||||||
|
"vim": "vim",
|
||||||
|
"emacs": "emacs",
|
||||||
|
"⚠️ Please restart boostnote after you change the keymap": "⚠️ Redémarrez Boostnote après avoir changé la keymap",
|
||||||
|
"Show line numbers in the editor": "Montrer les numéros de lignes dans l'éditeur",
|
||||||
|
"Allow editor to scroll past the last line": "Contrôle si l'éditeur défile au-delà de la dernière ligne",
|
||||||
|
"Bring in web page title when pasting URL on editor": "Mettre le titre de la page lors d'un collé d'une URL dans l'éditeur",
|
||||||
|
"Preview": "Aperçu",
|
||||||
|
"Preview Font Size": "Taille de police de l'aperçu",
|
||||||
|
"Preview Font Family": "Police de l'aperçu",
|
||||||
|
"Code block Theme": "Thème des blocs de code",
|
||||||
|
"Show line numbers for preview code blocks": "Montrer les numéros de lignes dans les blocs de code dans l'aperçu",
|
||||||
|
"LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter",
|
||||||
|
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
|
||||||
|
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
|
||||||
|
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
|
||||||
|
"Community": "Communauté",
|
||||||
|
"Subscribe to Newsletter": "Souscrire à la newsletter",
|
||||||
|
"GitHub": "GitHub",
|
||||||
|
"Blog": "Blog",
|
||||||
|
"Facebook Group": "Groupe Facebook",
|
||||||
|
"Twitter": "Twitter",
|
||||||
|
"About": "A propos",
|
||||||
|
"Boostnote": "Boostnote",
|
||||||
|
"An open source note-taking app made for programmers just like you.": "Une appli de prise de notes open-source faite pour les développeurs comme vous.",
|
||||||
|
"Website": "Site web",
|
||||||
|
"Development": "Développement",
|
||||||
|
" : Development configurations for Boostnote.": " : Configurations de développement pour Boostnote.",
|
||||||
|
"Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO",
|
||||||
|
"License: GPL v3": "License: GPL v3",
|
||||||
|
"Analytics": "Analytics",
|
||||||
|
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote collecte des données anonymisées dans le seul but d'améliorer l'application, et ne collecte aucune donnée personnelle telle que le contenu de vos notes.",
|
||||||
|
"You can see how it works on ": "Vous pouvez voir comment ça marche sur",
|
||||||
|
"You can choose to enable or disable this option.": "Vous pouvez choisir d'activer/désactiver cette option.",
|
||||||
|
"Enable analytics to help improve Boostnote": "Activer la collecte de données anonymisées pour améliorer Boostnote",
|
||||||
|
"Crowdfunding": "Crowdfunding",
|
||||||
|
"Dear everyone,": "Cher utilisateur,",
|
||||||
|
"Thank you for using Boostnote!": "Merci d'utiliser Boostnote !",
|
||||||
|
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote est utilisé dans plus de 200 pays et régions par une impressionnante communauté de développeurs.",
|
||||||
|
"To continue supporting this growth, and to satisfy community expectations,": "Afin de continuer à grandir, et de satisfaire les attentes de la communauté,",
|
||||||
|
"we would like to invest more time and resources in this project.": "nous aimerions investir d'avantage de temps et de ressources dans ce proje.",
|
||||||
|
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "Si vous aimez ce projet et que vous en voyez tout le potentiel, vous pouvez aider par un support sur OpenCollective !",
|
||||||
|
"Thanks,": "Merci,",
|
||||||
|
"Boostnote maintainers": "Les mainteneurs de Boostnote",
|
||||||
|
"Support via OpenCollective": "Support via OpenCollective",
|
||||||
|
"Language": "Langues",
|
||||||
|
"English": "Anglais",
|
||||||
|
"German": "Allemand",
|
||||||
|
"French": "Français",
|
||||||
|
"Show \"Saved to Clipboard\" notification when copying": "Montrer la notification \"Sauvegardé dans le presse-papiers\" lors de la copie",
|
||||||
|
"All Notes": "Toutes les notes",
|
||||||
|
"Starred": "Favoris",
|
||||||
|
"Are you sure to ": "Etes-vous sûr de ",
|
||||||
|
" delete": " supprimer",
|
||||||
|
"this folder?": "ce dossier ?",
|
||||||
|
"Confirm": "Confimer",
|
||||||
|
"Cancel": "Annuler",
|
||||||
|
"Markdown Note": "Note Markdown",
|
||||||
|
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "Ce format est pour créer des documents texte. Checklists, blocks de code et blocks Latex sont disponibles.",
|
||||||
|
"Snippet Note": "Note Snippet",
|
||||||
|
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "Ce format est pour créer des snippets de code. Plusieurs snippets peuvent être groupés en une seule note.",
|
||||||
|
"Tab to switch format": "Tab pour changer de format",
|
||||||
|
"Updated": "Mis à jour",
|
||||||
|
"Created": "Créé",
|
||||||
|
"Alphabetically": "De manière alphabétique",
|
||||||
|
"Default View": "Vue par défaut",
|
||||||
|
"Compressed View": "Vue compressée",
|
||||||
|
"Search": "Chercher",
|
||||||
|
"Blog Type": "Blog Type",
|
||||||
|
"Blog Address": "Blog Address",
|
||||||
|
"Save": "Sauvegarder",
|
||||||
|
"Auth": "Auth",
|
||||||
|
"Authentication Method": "Méthode d'Authentification",
|
||||||
|
"JWT": "JWT",
|
||||||
|
"USER": "USER",
|
||||||
|
"Token": "Token",
|
||||||
|
"Storage": "Stockage",
|
||||||
|
"Hotkeys": "Raccourcis",
|
||||||
|
"Show/Hide Boostnote": "Montrer/Cacher Boostnote",
|
||||||
|
"Restore": "Restaurer",
|
||||||
|
"Permanent Delete": "Supprimer définivitement",
|
||||||
|
"Confirm note deletion": "Confirmer la suppression de la note",
|
||||||
|
"This will permanently remove this note.": "Cela va supprimer cette note définitivement.",
|
||||||
|
"Successfully applied!": " Succès !",
|
||||||
|
"Albanian": "Albanais",
|
||||||
|
"Chinese (zh-CN)": "Chinois (zh-CN)",
|
||||||
|
"Chinese (zh-TW)": "Chinois (zh-TW)",
|
||||||
|
"Danish": "Danois",
|
||||||
|
"Japanese": "Japonais",
|
||||||
|
"Korean": "Coréen",
|
||||||
|
"Norwegian": "Norvégien",
|
||||||
|
"Polish": "Polonais",
|
||||||
|
"Portuguese": "Portugais",
|
||||||
|
"Spanish": "Espagnol",
|
||||||
|
"You have to save!": "Il faut sauvegarder !",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Command(⌘)": "Command(⌘)",
|
||||||
|
"Editor Rulers": "Editor Rulers",
|
||||||
|
"Enable": "Enable",
|
||||||
|
"Disable": "Disable",
|
||||||
|
"Allow preview to scroll past the last line": "Allow preview to scroll past the last line",
|
||||||
|
"Sanitization": "Sanitization",
|
||||||
|
"Only allow secure html tags (recommended)": "Only allow secure html tags (recommended)",
|
||||||
|
"Allow styles": "Allow styles",
|
||||||
|
"Allow dangerous html tags": "Allow dangerous html tags"
|
||||||
|
}
|
||||||
160
locales/hu.json
Normal file
160
locales/hu.json
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
{
|
||||||
|
"Notes": "Jegyzetek",
|
||||||
|
"Tags": "Címkék",
|
||||||
|
"Preferences": "Beállítások",
|
||||||
|
"Make a note": "Új jegyzet",
|
||||||
|
"Ctrl": "Ctrl",
|
||||||
|
"Ctrl(^)": "Ctrl",
|
||||||
|
"to create a new note": "hogy létrehozz egy jegyzetet",
|
||||||
|
"Toggle Mode": "Mód Váltás",
|
||||||
|
"Trash": "Lomtár",
|
||||||
|
"MODIFICATION DATE": "MÓDOSÍTÁS DÁTUMA",
|
||||||
|
"Words": "Szó",
|
||||||
|
"Letters": "Betű",
|
||||||
|
"STORAGE": "TÁROLÓ",
|
||||||
|
"FOLDER": "KÖNYVTÁR",
|
||||||
|
"CREATION DATE": "LÉTREHOZÁS DÁTUMA",
|
||||||
|
"NOTE LINK": "JEGYZET LINKJE",
|
||||||
|
".md": ".md",
|
||||||
|
".txt": ".txt",
|
||||||
|
".html": ".html",
|
||||||
|
"Print": "Nyomtatás",
|
||||||
|
"Your preferences for Boostnote": "Boostnote beállításaid",
|
||||||
|
"Storages": "Tárolók",
|
||||||
|
"Add Storage Location": "Tároló Hozzáadása",
|
||||||
|
"Add Folder": "Könyvtár Hozzáadása",
|
||||||
|
"Open Storage folder": "Tároló Megnyitása",
|
||||||
|
"Unlink": "Tároló Leválasztása",
|
||||||
|
"Edit": "Szerkesztés",
|
||||||
|
"Delete": "Törlés",
|
||||||
|
"Interface": "Felület",
|
||||||
|
"Interface Theme": "Felület Témája",
|
||||||
|
"Default": "Alapértelmezett",
|
||||||
|
"White": "Világos",
|
||||||
|
"Solarized Dark": "Solarized Dark",
|
||||||
|
"Dark": "Sötét",
|
||||||
|
"Show a confirmation dialog when deleting notes": "Kérjen megerősítést a jegyzetek törlése előtt",
|
||||||
|
"Editor Theme": "Szerkesztő Témája",
|
||||||
|
"Editor Font Size": "Szerkesztő Betűmérete",
|
||||||
|
"Editor Font Family": "Szerkesztő Betűtípusa",
|
||||||
|
"Editor Indent Style": "Szerkesztő Behúzása",
|
||||||
|
"Spaces": "Szóközök",
|
||||||
|
"Tabs": "Tabulátor karakterek",
|
||||||
|
"Switch to Preview": "Váltás Megtekintésre",
|
||||||
|
"When Editor Blurred": "Szerkesztő Elhagyásakor",
|
||||||
|
"When Editor Blurred, Edit On Double Click": "Szerkesztő Elhagyásakor, Szerkesztő Megnyitása Dupla Kattintással",
|
||||||
|
"On Right Click": "Jobb Egérgombbal",
|
||||||
|
"Editor Keymap": "Szerkesztő Billentyűzetkiosztása",
|
||||||
|
"default": "alapértelmezett",
|
||||||
|
"vim": "vim",
|
||||||
|
"emacs": "emacs",
|
||||||
|
"⚠️ Please restart boostnote after you change the keymap": "⚠️ Kérlek, indítsd újra a programot a kiosztás megváltoztatása után",
|
||||||
|
"Show line numbers in the editor": "Mutatassa a sorszámokat a szerkesztőben",
|
||||||
|
"Allow editor to scroll past the last line": "A szerkesztőben az utolsó sor alá is lehessen görgetni",
|
||||||
|
"Bring in web page title when pasting URL on editor": "Weboldal főcímének lekérdezése URL cím beillesztésekor",
|
||||||
|
"Preview": "Megtekintés",
|
||||||
|
"Preview Font Size": "Megtekintés Betűmérete",
|
||||||
|
"Preview Font Family": "Megtekintés Betűtípusa",
|
||||||
|
"Code block Theme": "Kódblokk Témája",
|
||||||
|
"Allow preview to scroll past the last line": "Megtekintésben az utolsó sor alá is lehessen görgetni",
|
||||||
|
"Show line numbers for preview code blocks": "Mutatassa a sorszámokat a megtekintett kódblokkokban",
|
||||||
|
"LaTeX Inline Open Delimiter": "LaTeX Inline Nyitó Határolója",
|
||||||
|
"LaTeX Inline Close Delimiter": "LaTeX Inline Záró Határolója",
|
||||||
|
"LaTeX Block Open Delimiter": "LaTeX Blokk Nyitó Határolója",
|
||||||
|
"LaTeX Block Close Delimiter": "LaTeX Blokk Záró Határolója",
|
||||||
|
"Community": "Közösség",
|
||||||
|
"Subscribe to Newsletter": "Feliratkozás a Hírlevélre",
|
||||||
|
"GitHub": "GitHub",
|
||||||
|
"Blog": "Blog",
|
||||||
|
"Facebook Group": "Facebook Csoport",
|
||||||
|
"Twitter": "Twitter",
|
||||||
|
"About": "Névjegy",
|
||||||
|
"Boostnote": "Boostnote",
|
||||||
|
"An open source note-taking app made for programmers just like you.": "Nyílt forráskódú jegyzetkészítő program a hozzád hasonló programozóknak.",
|
||||||
|
"Website": "Weboldal",
|
||||||
|
"Development": "Fejlesztés",
|
||||||
|
" : Development configurations for Boostnote.": " : Információk a Boostnote fejlesztéséről.",
|
||||||
|
"Copyright (C) 2017 - 2018 BoostIO": "Szerzői jog (C) 2017 - 2018 BoostIO",
|
||||||
|
"License: GPL v3": "Licensz: GPL v3",
|
||||||
|
"Analytics": "Adatok elemzése",
|
||||||
|
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "A Boostnote névtelen adatokat gyűjt össze az alkalmazás tökéletesítése céljából, és szigorúan nem gyűjt semmilyen személyes adatot, például a jegyzetek tartalmát.",
|
||||||
|
"You can see how it works on ": "A működéséről további információkat itt találsz: ",
|
||||||
|
"You can choose to enable or disable this option.": "Kiválaszthatod, hogy engedélyezed, vagy tiltod ezt az opciót.",
|
||||||
|
"Enable analytics to help improve Boostnote": "Adatok elemzésének engedélyezése a Boostnote tökéletesítésének céljából",
|
||||||
|
"Crowdfunding": "Közösségi finanszírozás",
|
||||||
|
"Dear everyone,": "Kedves felhasználók!",
|
||||||
|
"Thank you for using Boostnote!": "Köszönjük, hogy a Boostnote-ot használjátok!",
|
||||||
|
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "A Boostnote-ot több, mint 200 ország és régió fantasztikus fejlesztői használják.",
|
||||||
|
"To continue supporting this growth, and to satisfy community expectations,": "Hogy folytathassuk ezt a fejlődést és kielégíthessük a felhasználói elvárásokat,",
|
||||||
|
"we would like to invest more time and resources in this project.": "több időt és erőforrást szeretnénk a projektbe fektetni.",
|
||||||
|
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "Ha tetszik a projekt és hasznosnak találod, te is segíthetsz ebben az OpenCollective-en keresztül küldött támogatásoddal.",
|
||||||
|
"Thanks,": "Köszönjük!",
|
||||||
|
"Boostnote maintainers": "A Boostnote csapata",
|
||||||
|
"Support via OpenCollective": "Támogatás Küldése",
|
||||||
|
"Language": "Nyelv",
|
||||||
|
"English": "English",
|
||||||
|
"German": "German",
|
||||||
|
"French": "French",
|
||||||
|
"Show \"Saved to Clipboard\" notification when copying": "Mutassa a \"Vágólapra Másolva\" üzenetet másoláskor",
|
||||||
|
"All Notes": "Minden Jegyzet",
|
||||||
|
"Starred": "Kiemelt",
|
||||||
|
"Are you sure to ": "Biztos, hogy ",
|
||||||
|
" delete": " törölni",
|
||||||
|
"this folder?": "szeretnéd a könyvtárat?",
|
||||||
|
"Confirm": "Igen",
|
||||||
|
"Cancel": "Mégse",
|
||||||
|
"Markdown Note": "Markdown Jegyzet",
|
||||||
|
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "Ez a formátum szöveges dokumentumok készítésére használható. Jelölőnégyzeteket, kódblokkokat és Latex blokkokat is tartalmazhat.",
|
||||||
|
"Snippet Note": "Kód Jegyzet",
|
||||||
|
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "Ez a formátum kódrészletek készítésére használható. Több kódrészlet tárolására is alkalmas (pl. HTML + CSS).",
|
||||||
|
"Tab to switch format": "Formátum váltásához nyomd le a Tabulátor billentyűt!",
|
||||||
|
"Updated": "Módosítás",
|
||||||
|
"Created": "Létrehozás",
|
||||||
|
"Alphabetically": "Ábécé sorrendben",
|
||||||
|
"Counter": "Számláló",
|
||||||
|
"Default View": "Alapértelmezett Nézet",
|
||||||
|
"Compressed View": "Tömörített Nézet",
|
||||||
|
"Search": "Keresés",
|
||||||
|
"Blog Type": "Blog Típusa",
|
||||||
|
"Blog Address": "Blog Címe",
|
||||||
|
"Save": "Mentés",
|
||||||
|
"Auth": "Hitelesítés",
|
||||||
|
"Authentication Method": "Hitelesítési Módszer",
|
||||||
|
"JWT": "JWT",
|
||||||
|
"USER": "USER",
|
||||||
|
"Token": "Token",
|
||||||
|
"Storage": "Tároló",
|
||||||
|
"Hotkeys": "Gyorsbillentyűk",
|
||||||
|
"Show/Hide Boostnote": "Boostnote Megjelenítése/Elrejtése",
|
||||||
|
"Restore": "Visszaállítás",
|
||||||
|
"Permanent Delete": "Végleges Törlés",
|
||||||
|
"Confirm note deletion": "Törlés megerősítése",
|
||||||
|
"This will permanently remove this note.": "A jegyzet véglegesen törölve lesz.",
|
||||||
|
"Successfully applied!": "Sikeresen alkalmazva.",
|
||||||
|
"Albanian": "Albanian",
|
||||||
|
"Chinese (zh-CN)": "Chinese (zh-CN)",
|
||||||
|
"Chinese (zh-TW)": "Chinese (zh-TW)",
|
||||||
|
"Danish": "Danish",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Korean": "Korean",
|
||||||
|
"Norwegian": "Norwegian",
|
||||||
|
"Polish": "Polish",
|
||||||
|
"Portuguese": "Portuguese",
|
||||||
|
"Spanish": "Spanish",
|
||||||
|
"You have to save!": "Mentened kell!",
|
||||||
|
"UserName": "FelhasznaloNev",
|
||||||
|
"Password": "Jelszo",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Command(⌘)": "Command(⌘)",
|
||||||
|
"Hungarian": "Hungarian",
|
||||||
|
"Add Storage": "Tároló hozzáadása",
|
||||||
|
"Name": "Név",
|
||||||
|
"Type": "Típus",
|
||||||
|
"File System": "Fájlrendszer",
|
||||||
|
"Setting up 3rd-party cloud storage integration:": "Harmadik féltől származó felhőtárolási integráció beállítása:",
|
||||||
|
"Cloud-Syncing-and-Backup": "Cloud-Syncing-and-Backup",
|
||||||
|
"Location": "Hely",
|
||||||
|
"Add": "Hozzáadás",
|
||||||
|
"Unlink Storage": "Tároló Leválasztása",
|
||||||
|
"Unlinking removes this linked storage from Boostnote. No data is removed, please manually delete the folder from your hard drive if needed.": "A leválasztás eltávolítja ezt a tárolót a Boostnote-ból. Az adatok nem lesznek törölve, kérlek manuálisan töröld a könyvtárat a merevlemezről, ha szükséges."
|
||||||
|
}
|
||||||
153
locales/ja.json
Normal file
153
locales/ja.json
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
{
|
||||||
|
"Notes": "Notes",
|
||||||
|
"Tags": "Tags",
|
||||||
|
"Preferences": "Preferences",
|
||||||
|
"Make a note": "Make a note",
|
||||||
|
"Ctrl": "Ctrl",
|
||||||
|
"Ctrl(^)": "Ctrl",
|
||||||
|
"to create a new note": "to create a new note",
|
||||||
|
"Toggle Mode": "Toggle Mode",
|
||||||
|
"Trash": "Trash",
|
||||||
|
"MODIFICATION DATE": "MODIFICATION DATE",
|
||||||
|
"Words": "Words",
|
||||||
|
"Letters": "Letters",
|
||||||
|
"STORAGE": "STORAGE",
|
||||||
|
"FOLDER": "FOLDER",
|
||||||
|
"CREATION DATE": "CREATION DATE",
|
||||||
|
"NOTE LINK": "NOTE LINK",
|
||||||
|
".md": ".md",
|
||||||
|
".txt": ".txt",
|
||||||
|
".html": ".html",
|
||||||
|
"Print": "Print",
|
||||||
|
"Your preferences for Boostnote": "Your preferences for Boostnote",
|
||||||
|
"Storages": "Storages",
|
||||||
|
"Add Storage Location": "Add Storage Location",
|
||||||
|
"Add Folder": "Add Folder",
|
||||||
|
"Open Storage folder": "Open Storage folder",
|
||||||
|
"Unlink": "Unlink",
|
||||||
|
"Edit": "Edit",
|
||||||
|
"Delete": "Delete",
|
||||||
|
"Interface": "Interface",
|
||||||
|
"Interface Theme": "Interface Theme",
|
||||||
|
"Default": "Default",
|
||||||
|
"White": "White",
|
||||||
|
"Solarized Dark": "Solarized Dark",
|
||||||
|
"Dark": "Dark",
|
||||||
|
"Show a confirmation dialog when deleting notes": "Show a confirmation dialog when deleting notes",
|
||||||
|
"Editor Theme": "Editor Theme",
|
||||||
|
"Editor Font Size": "Editor Font Size",
|
||||||
|
"Editor Font Family": "Editor Font Family",
|
||||||
|
"Editor Indent Style": "Editor Indent Style",
|
||||||
|
"Spaces": "Spaces",
|
||||||
|
"Tabs": "Tabs",
|
||||||
|
"Switch to Preview": "Switch to Preview",
|
||||||
|
"When Editor Blurred": "When Editor Blurred",
|
||||||
|
"When Editor Blurred, Edit On Double Click": "When Editor Blurred, Edit On Double Click",
|
||||||
|
"On Right Click": "On Right Click",
|
||||||
|
"Editor Keymap": "Editor Keymap",
|
||||||
|
"default": "default",
|
||||||
|
"vim": "vim",
|
||||||
|
"emacs": "emacs",
|
||||||
|
"⚠️ Please restart boostnote after you change the keymap": "⚠️ Please restart boostnote after you change the keymap",
|
||||||
|
"Show line numbers in the editor": "Show line numbers in the editor",
|
||||||
|
"Allow editor to scroll past the last line": "Allow editor to scroll past the last line",
|
||||||
|
"Bring in web page title when pasting URL on editor": "Bring in web page title when pasting URL on editor",
|
||||||
|
"Preview": "Preview",
|
||||||
|
"Preview Font Size": "Preview Font Size",
|
||||||
|
"Preview Font Family": "Preview Font Family",
|
||||||
|
"Code block Theme": "Code block Theme",
|
||||||
|
"Allow preview to scroll past the last line": "Allow preview to scroll past the last line",
|
||||||
|
"Show line numbers for preview code blocks": "Show line numbers for preview code blocks",
|
||||||
|
"LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter",
|
||||||
|
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
|
||||||
|
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
|
||||||
|
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
|
||||||
|
"Community": "Community",
|
||||||
|
"Subscribe to Newsletter": "Subscribe to Newsletter",
|
||||||
|
"GitHub": "GitHub",
|
||||||
|
"Blog": "Blog",
|
||||||
|
"Facebook Group": "Facebook Group",
|
||||||
|
"Twitter": "Twitter",
|
||||||
|
"About": "About",
|
||||||
|
"Boostnote": "Boostnote",
|
||||||
|
"An open source note-taking app made for programmers just like you.": "An open source note-taking app made for programmers just like you.",
|
||||||
|
"Website": "Website",
|
||||||
|
"Development": "Development",
|
||||||
|
" : Development configurations for Boostnote.": " : Development configurations for Boostnote.",
|
||||||
|
"Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO",
|
||||||
|
"License: GPL v3": "License: GPL v3",
|
||||||
|
"Analytics": "Analytics",
|
||||||
|
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.",
|
||||||
|
"You can see how it works on ": "You can see how it works on ",
|
||||||
|
"You can choose to enable or disable this option.": "You can choose to enable or disable this option.",
|
||||||
|
"Enable analytics to help improve Boostnote": "Enable analytics to help improve Boostnote",
|
||||||
|
"Crowdfunding": "Crowdfunding",
|
||||||
|
"Dear everyone,": "Dear everyone,",
|
||||||
|
"Thank you for using Boostnote!": "Thank you for using Boostnote!",
|
||||||
|
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote is used in about 200 different countries and regions by an awesome community of developers.",
|
||||||
|
"To continue supporting this growth, and to satisfy community expectations,": "To continue supporting this growth, and to satisfy community expectations,",
|
||||||
|
"we would like to invest more time and resources in this project.": "we would like to invest more time and resources in this project.",
|
||||||
|
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "If you like this project and see its potential, you can help by supporting us on OpenCollective!",
|
||||||
|
"Thanks,": "Thanks,",
|
||||||
|
"Boostnote maintainers": "Boostnote maintainers",
|
||||||
|
"Support via OpenCollective": "Support via OpenCollective",
|
||||||
|
"Language": "Language",
|
||||||
|
"English": "English",
|
||||||
|
"German": "German",
|
||||||
|
"French": "French",
|
||||||
|
"Show \"Saved to Clipboard\" notification when copying": "Show \"Saved to Clipboard\" notification when copying",
|
||||||
|
"All Notes": "All Notes",
|
||||||
|
"Starred": "Starred",
|
||||||
|
"Are you sure to ": "Are you sure to ",
|
||||||
|
" delete": " delete",
|
||||||
|
"this folder?": "this folder?",
|
||||||
|
"Confirm": "Confirm",
|
||||||
|
"Cancel": "Cancel",
|
||||||
|
"Markdown Note": "Markdown Note",
|
||||||
|
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "This format is for creating text documents. Checklists, code blocks and Latex blocks are available.",
|
||||||
|
"Snippet Note": "Snippet Note",
|
||||||
|
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "This format is for creating code snippets. Multiple snippets can be grouped into a single note.",
|
||||||
|
"Tab to switch format": "Tab to switch format",
|
||||||
|
"Updated": "Updated",
|
||||||
|
"Created": "Created",
|
||||||
|
"Alphabetically": "Alphabetically",
|
||||||
|
"Default View": "Default View",
|
||||||
|
"Compressed View": "Compressed View",
|
||||||
|
"Search": "Search",
|
||||||
|
"Blog Type": "Blog Type",
|
||||||
|
"Blog Address": "Blog Address",
|
||||||
|
"Save": "Save",
|
||||||
|
"Auth": "Auth",
|
||||||
|
"Authentication Method": "Authentication Method",
|
||||||
|
"JWT": "JWT",
|
||||||
|
"USER": "USER",
|
||||||
|
"Token": "Token",
|
||||||
|
"Storage": "Storage",
|
||||||
|
"Hotkeys": "Hotkeys",
|
||||||
|
"Show/Hide Boostnote": "Show/Hide Boostnote",
|
||||||
|
"Restore": "Restore",
|
||||||
|
"Permanent Delete": "Permanent Delete",
|
||||||
|
"Confirm note deletion": "Confirm note deletion",
|
||||||
|
"This will permanently remove this note.": "This will permanently remove this note.",
|
||||||
|
"Successfully applied!": "Successfully applied!",
|
||||||
|
"Albanian": "Albanian",
|
||||||
|
"Chinese (zh-CN)": "Chinese (zh-CN)",
|
||||||
|
"Chinese (zh-TW)": "Chinese (zh-TW)",
|
||||||
|
"Danish": "Danish",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Korean": "Korean",
|
||||||
|
"Norwegian": "Norwegian",
|
||||||
|
"Polish": "Polish",
|
||||||
|
"Portuguese": "Portuguese",
|
||||||
|
"Spanish": "Spanish",
|
||||||
|
"You have to save!": "You have to save!",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Command(⌘)": "Command(⌘)",
|
||||||
|
"Editor Rulers": "Editor Rulers",
|
||||||
|
"Enable": "Enable",
|
||||||
|
"Disable": "Disable",
|
||||||
|
"Sanitization": "Sanitization",
|
||||||
|
"Only allow secure html tags (recommended)": "Only allow secure html tags (recommended)",
|
||||||
|
"Allow styles": "Allow styles",
|
||||||
|
"Allow dangerous html tags": "Allow dangerous html tags"
|
||||||
|
}
|
||||||
159
locales/ko.json
Normal file
159
locales/ko.json
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
{
|
||||||
|
"Notes": "노트",
|
||||||
|
"Tags": "태그",
|
||||||
|
"Preferences": "설정",
|
||||||
|
"Make a note": "노트 생성",
|
||||||
|
"Ctrl": "Ctrl",
|
||||||
|
"Ctrl(^)": "Ctrl",
|
||||||
|
"to create a new note": "to create a new note",
|
||||||
|
"Toggle Mode": "모드 전환",
|
||||||
|
"Trash": "쓰레기 통",
|
||||||
|
"MODIFICATION DATE": "변경 날짜",
|
||||||
|
"Words": "단어 수",
|
||||||
|
"Letters": "글자 수",
|
||||||
|
"STORAGE": "STORAGE",
|
||||||
|
"FOLDER": "FOLDER",
|
||||||
|
"CREATION DATE": "생성일",
|
||||||
|
"NOTE LINK": "노트 링크",
|
||||||
|
".md": ".md",
|
||||||
|
".txt": ".txt",
|
||||||
|
".html": ".html",
|
||||||
|
"Print": "인쇄",
|
||||||
|
"Your preferences for Boostnote": "Boostnote 설정",
|
||||||
|
"Storages": "저장소",
|
||||||
|
"Add Storage Location": "저장소 위치 추가",
|
||||||
|
"Add Folder": "폴더 추가",
|
||||||
|
"Open Storage folder": "저장소 위치 열기",
|
||||||
|
"Unlink": "연결 해제",
|
||||||
|
"Edit": "편집",
|
||||||
|
"Delete": "삭제",
|
||||||
|
"Interface": "인터페이스",
|
||||||
|
"Interface Theme": "인터페이스 테마",
|
||||||
|
"Default": "Default",
|
||||||
|
"White": "White",
|
||||||
|
"Solarized Dark": "Solarized Dark",
|
||||||
|
"Dark": "Dark",
|
||||||
|
"Show a confirmation dialog when deleting notes": "노트 삭제시 확인 다이얼로그를 보여줌",
|
||||||
|
"Editor Theme": "에디터 테마",
|
||||||
|
"Editor Font Size": "에디터 폰트 크기",
|
||||||
|
"Editor Font Family": "에디터 폰트 종류",
|
||||||
|
"Editor Indent Style": "에디터 인덴트 스타일",
|
||||||
|
"Spaces": "Spaces",
|
||||||
|
"Tabs": "Tabs",
|
||||||
|
"Switch to Preview": "프리뷰 전환",
|
||||||
|
"When Editor Blurred": "에디터 선택이 풀렸을 때",
|
||||||
|
"When Editor Blurred, Edit On Double Click": "에디터 선택이 풀렸을 때, 더블클릭으로 편집",
|
||||||
|
"On Right Click": "우클릭시",
|
||||||
|
"Editor Keymap": "에디터 키맵",
|
||||||
|
"default": "default",
|
||||||
|
"vim": "vim",
|
||||||
|
"emacs": "emacs",
|
||||||
|
"⚠️ Please restart boostnote after you change the keymap": "⚠️ 키맵 변경후에는 앱을 다시 재시작해주세요.",
|
||||||
|
"Show line numbers in the editor": "에디터에서 줄 번호를 보여줌",
|
||||||
|
"Allow editor to scroll past the last line": "마지막 줄보다 더 밑으로 스크롤 가능하게 해줌",
|
||||||
|
"Bring in web page title when pasting URL on editor": "URL이 붙여넣기 되었을 때, 웹페이지 타이틀을 가져옴",
|
||||||
|
"Preview": "프리뷰",
|
||||||
|
"Preview Font Size": "프리뷰시 폰트 크기",
|
||||||
|
"Preview Font Family": "프리뷰시 폰트 종류",
|
||||||
|
"Code block Theme": "코드 블록 테마",
|
||||||
|
"Allow preview to scroll past the last line": "Allow preview to scroll past the last line",
|
||||||
|
"Show line numbers for preview code blocks": "Show line numbers for preview code blocks",
|
||||||
|
"LaTeX Inline Open Delimiter": "LaTeX 인라인 블록 열기 기호",
|
||||||
|
"LaTeX Inline Close Delimiter": "LaTeX 인라인 블록 닫기 기호",
|
||||||
|
"LaTeX Block Open Delimiter": "LaTeX 블록 열기 기호",
|
||||||
|
"LaTeX Block Close Delimiter": "LaTeX 블록 닫기 기호",
|
||||||
|
"Community": "커뮤니티",
|
||||||
|
"Subscribe to Newsletter": "뉴스레터 구독",
|
||||||
|
"GitHub": "깃허브",
|
||||||
|
"Blog": "블로그",
|
||||||
|
"Facebook Group": "페이스북 그룹",
|
||||||
|
"Twitter": "트위터",
|
||||||
|
"About": "About",
|
||||||
|
"Boostnote": "Boostnote",
|
||||||
|
"An open source note-taking app made for programmers just like you.": "여러분과 같은 프로그래머를 위한 오픈소스 노트 앱",
|
||||||
|
"Website": "웹사이트",
|
||||||
|
"Development": "개발",
|
||||||
|
" : Development configurations for Boostnote.": " : Boostnote 개발을 위한 설정들.",
|
||||||
|
"Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO",
|
||||||
|
"License: GPL v3": "License: GPL v3",
|
||||||
|
"Analytics": "사용 통계/분석",
|
||||||
|
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote는 서비스개선을 위해 익명으로 데이터를 수집하며 노트의 내용과같은 일체의 개인정보는 수집하지 않습니다.",
|
||||||
|
"You can see how it works on ": "여기서 어떻게 작동하는지 확인하실 수 있습니다.",
|
||||||
|
"You can choose to enable or disable this option.": "사용 통계/분석 수집 여부는 직접 선택하실 수 있습니다.",
|
||||||
|
"Enable analytics to help improve Boostnote": "Boostnote 개선을 돕기위해 사용 통계/분석 수집 허가",
|
||||||
|
"Crowdfunding": "크라우드펀딩",
|
||||||
|
"Dear everyone,": "모두들에게,",
|
||||||
|
"Thank you for using Boostnote!": "사용해주셔서 감사합니다!",
|
||||||
|
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote는 200여개의 국가에서 뛰어난 개발자들에게 사용되어지고 있습니다.",
|
||||||
|
"To continue supporting this growth, and to satisfy community expectations,": "성장을 계속하기 위해 그리고 커뮤니티의 기대를 만족시키기 위해서,",
|
||||||
|
"we would like to invest more time and resources in this project.": "저희도 시간과 자원을 더 쏟아붓고 싶습니다.",
|
||||||
|
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "만약 이 프로젝트가 마음에 들고 가능성이 보이신다면, 저희를 OpenCollective에서 도와주세요!",
|
||||||
|
"Thanks,": "감사합니다,",
|
||||||
|
"Boostnote maintainers": "Boostnote 메인테이너",
|
||||||
|
"Support via OpenCollective": "OpenCollective로 지원하기",
|
||||||
|
"Language": "언어(Language)",
|
||||||
|
"English": "English",
|
||||||
|
"German": "German",
|
||||||
|
"French": "French",
|
||||||
|
"Show \"Saved to Clipboard\" notification when copying": "Show \"Saved to Clipboard\" notification when copying",
|
||||||
|
"All Notes": "모든 노트들",
|
||||||
|
"Starred": "즐겨찾기",
|
||||||
|
"Are you sure to ": "정말 이 폴더를",
|
||||||
|
" delete": " 삭제",
|
||||||
|
"this folder?": "하시겠습니까?",
|
||||||
|
"Confirm": "확인",
|
||||||
|
"Cancel": "취소",
|
||||||
|
"Markdown Note": "마크다운 노트",
|
||||||
|
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "텍스트 문서를 작성하기 위한 형식입니다. 체크리스트, 코드블록 그리고 LaTeX블록이 사용가능합니다.",
|
||||||
|
"Snippet Note": "스닙펫 노트",
|
||||||
|
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "코드스닙펫을 작성하기 위한 형식입니다. 여러개의 스닙펫들을 하나의 노트로 만들 수 있습니다.",
|
||||||
|
"Tab to switch format": "탭으로 형식을 바꿀 수 있습니다.",
|
||||||
|
"Updated": "수정일 순",
|
||||||
|
"Created": "생성일 순",
|
||||||
|
"Alphabetically": "알파벳 순",
|
||||||
|
"Default View": "크게 보기",
|
||||||
|
"Compressed View": "작게 보기",
|
||||||
|
"Search": "검색",
|
||||||
|
"Blog Type": "블로그 종류",
|
||||||
|
"Blog Address": "블로그 주소",
|
||||||
|
"Save": "저장",
|
||||||
|
"Auth": "인증",
|
||||||
|
"Authentication Method": "인증방식",
|
||||||
|
"JWT": "JWT",
|
||||||
|
"USER": "USER",
|
||||||
|
"토큰": "Token",
|
||||||
|
"저장소": "저장소",
|
||||||
|
"단축키": "단축키",
|
||||||
|
"Show/Hide Boostnote": "앱 열기/숨기기",
|
||||||
|
"Restore": "복구",
|
||||||
|
"Permanent Delete": "완전 삭제",
|
||||||
|
"Confirm note deletion": "노트 삭제 확인",
|
||||||
|
"This will permanently remove this note.": "노트를 완전히 삭제하게 됩니다.",
|
||||||
|
"Successfully applied!": "설정됨!",
|
||||||
|
"Albanian": "Albanian",
|
||||||
|
"Chinese (zh-CN)": "Chinese (zh-CN)",
|
||||||
|
"Chinese (zh-TW)": "Chinese (zh-TW)",
|
||||||
|
"Danish": "Danish",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Korean": "Korean",
|
||||||
|
"Norwegian": "Norwegian",
|
||||||
|
"Polish": "Polish",
|
||||||
|
"Portuguese": "Portuguese",
|
||||||
|
"Spanish": "Spanish",
|
||||||
|
"You have to save!": "저장해주세요!",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Command(⌘)": "Command(⌘)",
|
||||||
|
"Delete Folder": "폴더 삭게",
|
||||||
|
"This will delete all notes in the folder and can not be undone.": "폴더의 모든 노트를 지우게 되고, 되돌릴 수 없습니다.",
|
||||||
|
"UserName": "유저명",
|
||||||
|
"Password": "패스워드",
|
||||||
|
"Storage": "저장소",
|
||||||
|
"Hotkeys": "단축키",
|
||||||
|
"Editor Rulers": "Editor Rulers",
|
||||||
|
"Enable": "Enable",
|
||||||
|
"Disable": "Disable",
|
||||||
|
"Sanitization": "허용 태그 범위",
|
||||||
|
"Only allow secure html tags (recommended)": "안전한 HTML 태그만 허용 (추천)",
|
||||||
|
"Allow styles": "style 태그, 속성까지 허용",
|
||||||
|
"Allow dangerous html tags": "모든 위험한 태그 허용"
|
||||||
|
}
|
||||||
152
locales/no.json
Normal file
152
locales/no.json
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
{
|
||||||
|
"Notes": "Notes",
|
||||||
|
"Tags": "Tags",
|
||||||
|
"Preferences": "Preferences",
|
||||||
|
"Make a note": "Make a note",
|
||||||
|
"Ctrl": "Ctrl",
|
||||||
|
"Ctrl(^)": "Ctrl",
|
||||||
|
"to create a new note": "to create a new note",
|
||||||
|
"Toggle Mode": "Toggle Mode",
|
||||||
|
"Trash": "Trash",
|
||||||
|
"MODIFICATION DATE": "MODIFICATION DATE",
|
||||||
|
"Words": "Words",
|
||||||
|
"Letters": "Letters",
|
||||||
|
"STORAGE": "STORAGE",
|
||||||
|
"FOLDER": "FOLDER",
|
||||||
|
"CREATION DATE": "CREATION DATE",
|
||||||
|
"NOTE LINK": "NOTE LINK",
|
||||||
|
".md": ".md",
|
||||||
|
".txt": ".txt",
|
||||||
|
".html": ".html",
|
||||||
|
"Print": "Print",
|
||||||
|
"Your preferences for Boostnote": "Your preferences for Boostnote",
|
||||||
|
"Storages": "Storages",
|
||||||
|
"Add Storage Location": "Add Storage Location",
|
||||||
|
"Add Folder": "Add Folder",
|
||||||
|
"Open Storage folder": "Open Storage folder",
|
||||||
|
"Unlink": "Unlink",
|
||||||
|
"Edit": "Edit",
|
||||||
|
"Delete": "Delete",
|
||||||
|
"Interface": "Interface",
|
||||||
|
"Interface Theme": "Interface Theme",
|
||||||
|
"Default": "Default",
|
||||||
|
"White": "White",
|
||||||
|
"Solarized Dark": "Solarized Dark",
|
||||||
|
"Dark": "Dark",
|
||||||
|
"Show a confirmation dialog when deleting notes": "Show a confirmation dialog when deleting notes",
|
||||||
|
"Editor Theme": "Editor Theme",
|
||||||
|
"Editor Font Size": "Editor Font Size",
|
||||||
|
"Editor Font Family": "Editor Font Family",
|
||||||
|
"Editor Indent Style": "Editor Indent Style",
|
||||||
|
"Spaces": "Spaces",
|
||||||
|
"Tabs": "Tabs",
|
||||||
|
"Switch to Preview": "Switch to Preview",
|
||||||
|
"When Editor Blurred": "When Editor Blurred",
|
||||||
|
"When Editor Blurred, Edit On Double Click": "When Editor Blurred, Edit On Double Click",
|
||||||
|
"On Right Click": "On Right Click",
|
||||||
|
"Editor Keymap": "Editor Keymap",
|
||||||
|
"default": "default",
|
||||||
|
"vim": "vim",
|
||||||
|
"emacs": "emacs",
|
||||||
|
"⚠️ Please restart boostnote after you change the keymap": "⚠️ Please restart boostnote after you change the keymap",
|
||||||
|
"Show line numbers in the editor": "Show line numbers in the editor",
|
||||||
|
"Allow editor to scroll past the last line": "Allow editor to scroll past the last line",
|
||||||
|
"Bring in web page title when pasting URL on editor": "Bring in web page title when pasting URL on editor",
|
||||||
|
"Preview": "Preview",
|
||||||
|
"Preview Font Size": "Preview Font Size",
|
||||||
|
"Preview Font Family": "Preview Font Family",
|
||||||
|
"Code block Theme": "Code block Theme",
|
||||||
|
"Allow preview to scroll past the last line": "Allow preview to scroll past the last line",
|
||||||
|
"Show line numbers for preview code blocks": "Show line numbers for preview code blocks",
|
||||||
|
"LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter",
|
||||||
|
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
|
||||||
|
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
|
||||||
|
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
|
||||||
|
"Community": "Community",
|
||||||
|
"Subscribe to Newsletter": "Subscribe to Newsletter",
|
||||||
|
"GitHub": "GitHub",
|
||||||
|
"Blog": "Blog",
|
||||||
|
"Facebook Group": "Facebook Group",
|
||||||
|
"Twitter": "Twitter",
|
||||||
|
"About": "About",
|
||||||
|
"Boostnote": "Boostnote",
|
||||||
|
"An open source note-taking app made for programmers just like you.": "An open source note-taking app made for programmers just like you.",
|
||||||
|
"Website": "Website",
|
||||||
|
"Development": "Development",
|
||||||
|
" : Development configurations for Boostnote.": " : Development configurations for Boostnote.",
|
||||||
|
"Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO",
|
||||||
|
"License: GPL v3": "License: GPL v3",
|
||||||
|
"Analytics": "Analytics",
|
||||||
|
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.",
|
||||||
|
"You can see how it works on ": "You can see how it works on ",
|
||||||
|
"You can choose to enable or disable this option.": "You can choose to enable or disable this option.",
|
||||||
|
"Enable analytics to help improve Boostnote": "Enable analytics to help improve Boostnote",
|
||||||
|
"Crowdfunding": "Crowdfunding",
|
||||||
|
"Dear everyone,": "Dear everyone,",
|
||||||
|
"Thank you for using Boostnote!": "Thank you for using Boostnote!",
|
||||||
|
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote is used in about 200 different countries and regions by an awesome community of developers.",
|
||||||
|
"To continue supporting this growth, and to satisfy community expectations,": "To continue supporting this growth, and to satisfy community expectations,",
|
||||||
|
"we would like to invest more time and resources in this project.": "we would like to invest more time and resources in this project.",
|
||||||
|
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "If you like this project and see its potential, you can help by supporting us on OpenCollective!",
|
||||||
|
"Thanks,": "Thanks,",
|
||||||
|
"Boostnote maintainers": "Boostnote maintainers",
|
||||||
|
"Support via OpenCollective": "Support via OpenCollective",
|
||||||
|
"Language": "Language",
|
||||||
|
"English": "English",
|
||||||
|
"German": "German",
|
||||||
|
"French": "French",
|
||||||
|
"Show \"Saved to Clipboard\" notification when copying": "Show \"Saved to Clipboard\" notification when copying",
|
||||||
|
"All Notes": "All Notes",
|
||||||
|
"Starred": "Starred",
|
||||||
|
"Are you sure to ": "Are you sure to ",
|
||||||
|
" delete": " delete",
|
||||||
|
"this folder?": "this folder?",
|
||||||
|
"Confirm": "Confirm",
|
||||||
|
"Cancel": "Cancel",
|
||||||
|
"Markdown Note": "Markdown Note",
|
||||||
|
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "This format is for creating text documents. Checklists, code blocks and Latex blocks are available.",
|
||||||
|
"Snippet Note": "Snippet Note",
|
||||||
|
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "This format is for creating code snippets. Multiple snippets can be grouped into a single note.",
|
||||||
|
"Tab to switch format": "Tab to switch format",
|
||||||
|
"Updated": "Updated",
|
||||||
|
"Created": "Created",
|
||||||
|
"Alphabetically": "Alphabetically",
|
||||||
|
"Default View": "Default View",
|
||||||
|
"Compressed View": "Compressed View",
|
||||||
|
"Search": "Search",
|
||||||
|
"Blog Type": "Blog Type",
|
||||||
|
"Blog Address": "Blog Address",
|
||||||
|
"Save": "Save",
|
||||||
|
"Auth": "Auth",
|
||||||
|
"Authentication Method": "Authentication Method",
|
||||||
|
"JWT": "JWT",
|
||||||
|
"USER": "USER",
|
||||||
|
"Token": "Token",
|
||||||
|
"Storage": "Storage",
|
||||||
|
"Hotkeys": "Hotkeys",
|
||||||
|
"Show/Hide Boostnote": "Show/Hide Boostnote",
|
||||||
|
"Restore": "Restore",
|
||||||
|
"Permanent Delete": "Permanent Delete",
|
||||||
|
"Confirm note deletion": "Confirm note deletion",
|
||||||
|
"This will permanently remove this note.": "This will permanently remove this note.",
|
||||||
|
"Successfully applied!": "Successfully applied!",
|
||||||
|
"Albanian": "Albanian",
|
||||||
|
"Chinese (zh-CN)": "Chinese (zh-CN)",
|
||||||
|
"Chinese (zh-TW)": "Chinese (zh-TW)",
|
||||||
|
"Danish": "Danish",
|
||||||
|
"Japanese": "Japanese",
|
||||||
|
"Korean": "Korean",
|
||||||
|
"Norwegian": "Norwegian",
|
||||||
|
"Polish": "Polish",
|
||||||
|
"Portuguese": "Portuguese",
|
||||||
|
"Spanish": "Spanish",
|
||||||
|
"You have to save!": "You have to save!",
|
||||||
|
"Russian": "Russian",
|
||||||
|
"Editor Rulers": "Editor Rulers",
|
||||||
|
"Enable": "Enable",
|
||||||
|
"Disable": "Disable",
|
||||||
|
"Sanitization": "Sanitization",
|
||||||
|
"Only allow secure html tags (recommended)": "Only allow secure html tags (recommended)",
|
||||||
|
"Allow styles": "Allow styles",
|
||||||
|
"Allow dangerous html tags": "Allow dangerous html tags"
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user