mirror of
https://github.com/codex-team/editor.js
synced 2026-03-16 07:35:48 +01:00
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
This commit is contained in:
parent
e28349d3fb
commit
d2e755086a
35 changed files with 535 additions and 169 deletions
|
|
@ -3,7 +3,7 @@
|
|||
* Creates code tag and adds content to this tag
|
||||
*/
|
||||
|
||||
var code = (function(code) {
|
||||
var code = (function(code_plugin) {
|
||||
|
||||
var baseClass = "ce-code";
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ var code = (function(code) {
|
|||
/**
|
||||
* Method to render HTML block from JSON
|
||||
*/
|
||||
code.render = function (data) {
|
||||
code_plugin.render = function (data) {
|
||||
|
||||
return make_(data);
|
||||
};
|
||||
|
|
@ -36,7 +36,7 @@ var code = (function(code) {
|
|||
/**
|
||||
* Method to extract JSON data from HTML block
|
||||
*/
|
||||
code.save = function (blockContent){
|
||||
code_plugin.save = function (blockContent) {
|
||||
|
||||
var data = {
|
||||
text : blockContent.innerHTML
|
||||
|
|
@ -45,7 +45,7 @@ var code = (function(code) {
|
|||
|
||||
};
|
||||
|
||||
code.validate = function(data) {
|
||||
code_plugin.validate = function (data) {
|
||||
|
||||
if (data.text.trim() == '')
|
||||
return;
|
||||
|
|
@ -53,6 +53,12 @@ var code = (function(code) {
|
|||
return true;
|
||||
};
|
||||
|
||||
return code;
|
||||
code_plugin.destroy = function () {
|
||||
|
||||
code = null;
|
||||
|
||||
};
|
||||
|
||||
return code_plugin;
|
||||
|
||||
})({});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue