mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-21 14:19:42 +02:00
Landing + mobile adoptation (#38)
* Landing + mobile adoptation * replace svg * small updates * use landing as iframe * Delete .codexdocsrc * remove unused * updates * Delete _index.twig * update header shrink in chrome * Delete .codexdocsrc * remove focus
This commit is contained in:
parent
d1e48cbb64
commit
044c24c950
30 changed files with 429 additions and 1068 deletions
|
@ -1,9 +1,18 @@
|
|||
import CodeXEditor from 'codex.editor';
|
||||
|
||||
/**
|
||||
* Tools for the Editor
|
||||
*/
|
||||
import Header from 'codex.editor.header';
|
||||
import CodeTool from 'codex.editor.code';
|
||||
import InlineCode from 'codex.editor.inline-code';
|
||||
import Quote from 'codex.editor.quote';
|
||||
import Marker from 'codex.editor.marker';
|
||||
import ListTool from 'codex.editor.list';
|
||||
import CodeTool from 'codex.editor.code';
|
||||
import Delimiter from 'codex.editor.delimiter';
|
||||
import InlineCode from 'codex.editor.inline-code';
|
||||
import List from 'codex.editor.list';
|
||||
import RawTool from 'codex.editor.raw';
|
||||
import ImageTool from 'codex.editor.image';
|
||||
import Embed from 'codex.editor.embed';
|
||||
|
||||
/**
|
||||
* Class for working with Editor.js
|
||||
|
@ -11,32 +20,59 @@ import ListTool from 'codex.editor.list';
|
|||
export default class Editor {
|
||||
/**
|
||||
* Creates Editor instance
|
||||
* @property {object} initialData - data to start with
|
||||
* @param {object} editorConfig - configuration object for Editor.js
|
||||
* @param {object} data.blocks - data to start with
|
||||
* @param {object} options
|
||||
* @param {string} options.headerPlaceholder - placeholder for Header tool
|
||||
*/
|
||||
constructor({initialData}) {
|
||||
this.editor = new CodeXEditor({
|
||||
constructor(editorConfig = {}, options = {}) {
|
||||
const defaultConfig = {
|
||||
tools: {
|
||||
header: {
|
||||
class: Header,
|
||||
inlineToolbar: ['link', 'marker'],
|
||||
config: {
|
||||
placeholder: 'Enter a title'
|
||||
placeholder: options.headerPlaceholder || ''
|
||||
}
|
||||
},
|
||||
code: CodeTool,
|
||||
// image: {
|
||||
// class: ImageTool,
|
||||
// inlineToolbar: true,
|
||||
// config: {
|
||||
// endpoints: {
|
||||
// byFile: '/editor/transport',
|
||||
// byUrl: '/editor/transport'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
list: {
|
||||
class: List,
|
||||
inlineToolbar: true
|
||||
},
|
||||
quote: {
|
||||
class: Quote,
|
||||
inlineToolbar: true
|
||||
},
|
||||
code: {
|
||||
class: CodeTool,
|
||||
shortcut: 'CMD+SHIFT+D'
|
||||
},
|
||||
inlineCode: {
|
||||
class: InlineCode,
|
||||
shortcut: 'CMD+SHIFT+I'
|
||||
shortcut: 'CMD+SHIFT+C'
|
||||
},
|
||||
Marker: {
|
||||
rawTool: {
|
||||
class: RawTool,
|
||||
shortcut: 'CMD+SHIFT+R'
|
||||
},
|
||||
marker: {
|
||||
class: Marker,
|
||||
shortcut: 'CMD+SHIFT+M'
|
||||
},
|
||||
list: {
|
||||
class: ListTool,
|
||||
inlineToolbar: true
|
||||
}
|
||||
delimiter: Delimiter,
|
||||
embed: Embed
|
||||
},
|
||||
data: initialData || {
|
||||
data: {
|
||||
blocks: [
|
||||
{
|
||||
type: 'header',
|
||||
|
@ -47,7 +83,9 @@ export default class Editor {
|
|||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.editor = new CodeXEditor(Object.assign(defaultConfig, editorConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue