mirror of
https://github.com/codex-team/editor.js
synced 2024-06-10 09:52:36 +02:00
d2e755086a
* listeners module added
* Destroy method added
* Destroy method for plugins added
* Delete plugins properties from window obj
* Revert "Delete plugins properties from window obj"
This reverts commit 6c91f81229
.
* Twitter and instagram api's destroy
* Scripts destoy added
* Fix
* Replace regex with String.indexOf
* Settings for destroyer
37 lines
733 B
JavaScript
37 lines
733 B
JavaScript
/**
|
|
* Codex Editor Parser Module
|
|
*
|
|
* @author Codex Team
|
|
* @version 1.1
|
|
*/
|
|
|
|
module.exports = (function (parser) {
|
|
|
|
let editor = codex.editor;
|
|
|
|
/** inserting text */
|
|
parser.insertPastedContent = function (blockType, tag) {
|
|
|
|
editor.content.insertBlock({
|
|
type : blockType.type,
|
|
block : blockType.render({
|
|
text : tag.innerHTML
|
|
})
|
|
});
|
|
|
|
};
|
|
|
|
/**
|
|
* Check DOM node for display style: separated block or child-view
|
|
*/
|
|
parser.isFirstLevelBlock = function (node) {
|
|
|
|
return node.nodeType == editor.core.nodeTypes.TAG &&
|
|
node.classList.contains(editor.ui.className.BLOCK_CLASSNAME);
|
|
|
|
};
|
|
|
|
return parser;
|
|
|
|
})({});
|