editor.js/modules/parser.js
George Berezhnoy d2e755086a Destroy module (#157)
* 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
2017-02-13 20:54:18 +03:00

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;
})({});