sn-minimal-markdown-editor
Advanced tools
Comparing version 1.3.8 to 1.3.9
{ | ||
"name": "sn-minimal-markdown-editor", | ||
"version": "1.3.8", | ||
"version": "1.3.9", | ||
"description": "A minimal Markdown editor for Standard Notes.", | ||
"main": "dist/dist.js", | ||
"author": "Standard Notes <hello@standardnotes.org>", | ||
"scripts": { | ||
"prepublish": "npm run build", | ||
"build": "grunt" | ||
}, | ||
"dependencies": { | ||
@@ -8,0 +12,0 @@ "sn-codemirror-search": "1.0.0" |
@@ -20,8 +20,10 @@ document.addEventListener("DOMContentLoaded", function (event) { | ||
} | ||
loadEditor(); | ||
// only use CodeMirror selection color if we're not on mobile. | ||
editor.setOption("styleSelectedText", !componentRelay.isMobile); | ||
} | ||
}); | ||
// only use CodeMirror selection color if we're not on mobile. | ||
editor.setOption("styleSelectedText", !componentRelay.isMobile); | ||
componentRelay.streamContextItem((note) => { | ||
@@ -32,3 +34,3 @@ onReceivedNote(note); | ||
function save() { | ||
function saveNote() { | ||
if (workingNote) { | ||
@@ -80,2 +82,7 @@ // Be sure to capture this object as a variable, as this.note may be reassigned in `streamContextItem`, so by the time | ||
} | ||
editor.setOption( | ||
"spellcheck", | ||
workingNote.content.spellcheck | ||
); | ||
} | ||
@@ -88,3 +95,4 @@ } | ||
lineWrapping: true, | ||
extraKeys: { "Alt-F": "findPersistent" } | ||
extraKeys: { "Alt-F": "findPersistent" }, | ||
inputStyle: getInputStyleForEnvironment() | ||
}); | ||
@@ -95,8 +103,12 @@ editor.setSize(undefined, "100%"); | ||
if (ignoreTextChange) { return; } | ||
save(); | ||
saveNote(); | ||
}); | ||
} | ||
loadEditor(); | ||
function getInputStyleForEnvironment() { | ||
const environment = componentRelay.environment ?? 'web'; | ||
return environment === 'mobile' ? 'textarea' : 'contenteditable'; | ||
} | ||
loadComponentRelay(); | ||
}); |
Sorry, the diff of this file is too big to display
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
918020
12736
1