mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Merge branch 'master' into filter-tags-and-folders
This commit is contained in:
@@ -202,7 +202,7 @@ export default class CodeEditor extends React.Component {
|
||||
}
|
||||
cm.execCommand('goLineEnd')
|
||||
} else if (
|
||||
!charBeforeCursor.match(/\t|\s|\r|\n/) &&
|
||||
!charBeforeCursor.match(/\t|\s|\r|\n|\$/) &&
|
||||
cursor.ch > 1
|
||||
) {
|
||||
// text expansion on tab key if the char before is alphabet
|
||||
@@ -489,7 +489,7 @@ export default class CodeEditor extends React.Component {
|
||||
getWordBeforeCursor (line, lineNumber, cursorPosition) {
|
||||
let wordBeforeCursor = ''
|
||||
const originCursorPosition = cursorPosition
|
||||
const emptyChars = /\t|\s|\r|\n/
|
||||
const emptyChars = /\t|\s|\r|\n|\$/
|
||||
|
||||
// to prevent the word is long that will crash the whole app
|
||||
// the safeStop is there to stop user to expand words that longer than 20 chars
|
||||
|
||||
@@ -26,11 +26,29 @@ const { remote } = require('electron')
|
||||
const { dialog } = remote
|
||||
const WP_POST_PATH = '/wp/v2/posts'
|
||||
|
||||
const regexMatchStartingTitleNumber = new RegExp('^([0-9]*\.?[0-9]+).*$')
|
||||
|
||||
function sortByCreatedAt (a, b) {
|
||||
return new Date(b.createdAt) - new Date(a.createdAt)
|
||||
}
|
||||
|
||||
function sortByAlphabetical (a, b) {
|
||||
const matchA = regexMatchStartingTitleNumber.exec(a.title)
|
||||
const matchB = regexMatchStartingTitleNumber.exec(b.title)
|
||||
|
||||
if (matchA && matchA.length === 2 && matchB && matchB.length === 2) {
|
||||
// Both note titles are starting with a float. We will compare it now.
|
||||
const floatA = parseFloat(matchA[1])
|
||||
const floatB = parseFloat(matchB[1])
|
||||
|
||||
const diff = floatA - floatB
|
||||
if (diff !== 0) {
|
||||
return diff
|
||||
}
|
||||
|
||||
// The float values are equal. We will compare the full title.
|
||||
}
|
||||
|
||||
return a.title.localeCompare(b.title)
|
||||
}
|
||||
|
||||
|
||||
@@ -79,4 +79,11 @@ class MyComponent extends React.Component {
|
||||
// code goes here...
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
## React Hooks
|
||||
Existing code will be kept class-based and will only be changed to functional components with hooks if it improves readability or makes things more reusable.
|
||||
|
||||
For new components it's OK to use hooks with functional components but don't mix hooks & class-based components within a feature - just for code style / readability reasons.
|
||||
|
||||
Read more about hooks in the [React hooks introduction](https://reactjs.org/docs/hooks-intro.html).
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
"Successfully applied!": "¡Aplicado con éxito!",
|
||||
"Albanian": "Albanés",
|
||||
"Chinese (zh-CN)": "Chino - China",
|
||||
"Chinese (zh-TW)": "Chino - Taiwan",
|
||||
"Chinese (zh-TW)": "Chino - Taiwán",
|
||||
"Danish": "Danés",
|
||||
"Japanese": "Japonés",
|
||||
"Korean": "Coreano",
|
||||
@@ -155,9 +155,9 @@
|
||||
"Allow dangerous html tags": "Permitir etiquetas html peligrosas",
|
||||
"⚠ You have pasted a link referring an attachment that could not be found in the location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ Ha pegado un enlace a un archivo adjunto que no se puede encontrar en el almacenamiento de esta nota. Pegar enlaces a archivos adjuntos solo está soportado si el origen y el destino son el mismo almacenamiento. ¡Por favor, mejor arrastre el archivo! ⚠",
|
||||
"Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Convertir flechas textuales a símbolos bonitos. ⚠ Esto interferirá cuando use comentarios HTML en Markdown.",
|
||||
"Spellcheck disabled": "Spellcheck disabled",
|
||||
"Show menu bar": "Show menu bar",
|
||||
"Auto Detect": "Auto Detect",
|
||||
"Spellcheck disabled": "Deshabilitar corrector ortográfico",
|
||||
"Show menu bar": "Mostrar barra del menú",
|
||||
"Auto Detect": "Detección automática",
|
||||
"Snippet Default Language": "Lenguaje por defecto de los fragmentos de código",
|
||||
"Filter tags/folders...": "filter etiquetas/carpeta..."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user