mirror of
https://github.com/codex-team/editor.js
synced 2024-06-01 21:42:26 +02:00
Release.1.6 (#178)
* Remove textarea, add holder * Change textareaId to holderId release.1.6.0 * Update bundles release.1.6
This commit is contained in:
parent
d581856d78
commit
a98d6e4f1a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
13
codex.js
13
codex.js
|
@ -40,7 +40,7 @@ module.exports = (function (editor) {
|
|||
*/
|
||||
editor.settings = {
|
||||
tools : ['paragraph', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'],
|
||||
textareaId: 'codex-editor',
|
||||
holderId : 'codex-editor',
|
||||
|
||||
// Type of block showing on empty editor
|
||||
initialBlockPlugin: 'paragraph'
|
||||
|
@ -52,7 +52,7 @@ module.exports = (function (editor) {
|
|||
* Static nodes
|
||||
*/
|
||||
editor.nodes = {
|
||||
textarea : null,
|
||||
holder : null,
|
||||
wrapper : null,
|
||||
toolbar : null,
|
||||
inlineToolbar : {
|
||||
|
@ -92,10 +92,9 @@ module.exports = (function (editor) {
|
|||
/**
|
||||
* Initialization
|
||||
* @uses Promise cEditor.core.prepare
|
||||
* @param {} userSettings are :
|
||||
* - tools [],
|
||||
* - textareaId String
|
||||
* ...
|
||||
* @param {Object} userSettings
|
||||
* @param {Array} userSettings.tools list of plugins
|
||||
* @param {String} userSettings.holderId Element's id to append editor
|
||||
*
|
||||
* Load user defined tools
|
||||
* Tools must contain this important objects :
|
||||
|
@ -143,4 +142,4 @@ module.exports = (function (editor) {
|
|||
|
||||
return editor;
|
||||
|
||||
})({});
|
||||
})({});
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<textarea name="" id="codex_area" cols="30" rows="10" hidden></textarea>
|
||||
<div id="codex-editor"></div>
|
||||
|
||||
</body>
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
|
||||
<script>
|
||||
codex.editor.start({
|
||||
textareaId : "codex_area",
|
||||
holderId : "codex-editor",
|
||||
initialBlockPlugin : 'paragraph',
|
||||
hideToolbar: false,
|
||||
tools : {
|
||||
|
|
|
@ -39,11 +39,11 @@ module.exports = (function (core) {
|
|||
|
||||
editor.hideToolbar = userSettings.hideToolbar;
|
||||
|
||||
editor.nodes.textarea = document.getElementById(userSettings.textareaId || editor.settings.textareaId);
|
||||
editor.nodes.holder = document.getElementById(userSettings.holderId || editor.settings.holderId);
|
||||
|
||||
if (typeof editor.nodes.textarea === undefined || editor.nodes.textarea === null) {
|
||||
if (typeof editor.nodes.holder === undefined || editor.nodes.holder === null) {
|
||||
|
||||
reject(Error("Textarea wasn't found by ID: #" + userSettings.textareaId));
|
||||
reject(Error("Holder wasn't found by ID: #" + userSettings.holderId));
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -293,4 +293,4 @@ module.exports = (function (core) {
|
|||
|
||||
return core;
|
||||
|
||||
})({});
|
||||
})({});
|
||||
|
|
|
@ -61,8 +61,8 @@ module.exports = (function (ui) {
|
|||
editor.nodes.wrapper = wrapper;
|
||||
editor.nodes.redactor = redactor;
|
||||
|
||||
/** Append editor wrapper with redactor zone after initial textarea */
|
||||
editor.core.insertAfter(editor.nodes.textarea, wrapper);
|
||||
/** Append editor wrapper with redactor zone into holder */
|
||||
editor.nodes.holder.appendChild(wrapper);
|
||||
|
||||
resolve();
|
||||
|
||||
|
@ -429,4 +429,4 @@ module.exports = (function (ui) {
|
|||
|
||||
return ui;
|
||||
|
||||
})({});
|
||||
})({});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "codex.editor",
|
||||
"version": "1.5.8",
|
||||
"version": "1.6.0",
|
||||
"description": "Codex Editor. Native JS, based on API and Open Source",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue