Commit 759ad9ee authored by Mab's avatar Mab

tmp

parent c13979b5
......@@ -48,19 +48,28 @@ class SpellCheckManager {
}
_runSpellCheck(pathStr) {
throw Error("AHAHAHAAH")
const path = pathStr.split(',')
const editorLang = this.editorSession.editor.props.spellCheckLang
const string = this.editorSession.getDocument().get(path)
const lang = editorLang === '' ? 'en-US' : editorLang
const { checkSpell } = this.editorSession.editor.props
return checkSpell(lang, encodeURI(string))
.then(({ data: { spellChecker: results } }) => {
this._addSpellErrors(path, results)
})
.catch(error => {
console.log(error)
})
const text = this.editorSession.getDocument().get(path)
const lang = editorLang === '' ? 'fr' : editorLang
console.log('aaa')
const url = `http://localhost:8081/v2/check?language=${lang}&text=${text}`
const params = {
method: 'POST',
}
fetch(url, params)
.then(data => {
return data.json()
})
.then(res => {
this._addSpellErrors(path, res)
})
.catch(error => {
console.log(error)
})
return
}
/*
......
export default {
configure: config => {
'plumeToolPanels',
name: 'plumeToolPanels',
config.addToolPanel('plumeTopToolBar', [
{
name: 'undo-redo',
......@@ -79,13 +79,6 @@ export default {
style: 'minimal',
commandGroups: ['highlighter'],
},
{
name: 'ornament',
type: 'tool-group',
showDisabled: true,
style: 'minimal',
commandGroups: ['ornament'],
},
{
name: 'placeholder',
type: 'tool-group',
......@@ -100,13 +93,6 @@ export default {
style: 'minimal',
commandGroups: ['table-of-contents'],
},
{
name: 'spell-check-toggle',
type: 'tool-group',
showDisabled: true,
style: 'minimal',
commandGroups: ['spell-check-toggle'],
},
{
name: 'comment-control-tools',
type: 'tool-group',
......@@ -196,7 +182,7 @@ export default {
},
])
config.addToolPanel('ucpSideToolBarBodyPart', [
config.addToolPanel('plumeSideToolBarBodyPart', [
{
name: 'text-display',
type: 'tool-group',
......@@ -330,12 +316,6 @@ export default {
showDisabled: false,
commandGroups: ['prompt'],
},
{
name: 'spell-check',
type: 'tool-prompt',
showDisabled: false,
commandGroups: ['spell-check'],
},
])
},
}
......@@ -24,7 +24,7 @@ import './plume.scss'
TODO -- refactor so that as much as default is re-used here
*/
class EditoriaLayout extends Component {
class PlumeLayout extends Component {
render($$) {
const {
chapterNumber,
......@@ -186,4 +186,4 @@ class EditoriaLayout extends Component {
}
}
export default EditoriaLayout
export default PlumeLayout
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment