-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new sanitize method #103
new sanitize method #103
Conversation
@@ -224,6 +234,8 @@ var callbacks = (function(callbacks) { | |||
|
|||
callbacks.redactorClicked = function (event) { | |||
|
|||
callbacks.isClickedOnFirstLevelBlockArea(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
название должно четко соответствовать поведению: сейчас выглядит как будто функция возвращает булен
* clicked in redactor area | ||
* @type {null | Boolean} | ||
*/ | ||
content.editorArea = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
editorAreaHighlighted
@@ -517,7 +557,7 @@ var content = (function(content) { | |||
tool = workingNode.dataset.tool; | |||
|
|||
if (codex.tools[tool].allowedToPaste) { | |||
codex.content.sanitize(mutation.addedNodes); | |||
(codex.content.sanitize.bind(this, mutation.addedNodes))(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call
mutations.forEach(codex.content.paste); | ||
|
||
var self = this, | ||
callback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused var
* For that, we need to send Context, MutationObserver.__proto__ that contains | ||
* observer disconnect method. | ||
*/ | ||
console.warn('mutations count: %o', mutations.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove log
@@ -545,92 +585,70 @@ var content = (function(content) { | |||
* | |||
* Sanitizes HTML content | |||
* @param {Element} target - inserted element | |||
* @uses DFS function for deep searching | |||
* @uses Sanitize library and BASIC configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basic не используется
var sanitizer = new janitor(Config), | ||
clear = sanitizer.clean(node.outerHTML); | ||
|
||
var newFragment = document.createElement('DIV'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это больше не фрагмент
*/ | ||
block.addEventListener('paste', function (event) { | ||
codex.callback.blockPaste(event); | ||
codex.callback._blockPaste(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove _blockPaste
* start versioning * codex.version * eslint settings * versioning improved * cover restoring and fetch function fixed (#101) * cover restoring fixed * upd * fetch fixed in safari * updated * plugins * plugins ready * code improved * fixed bug with backspace * improved architecture * new sanitize method (#103) * new sanitize method Need to fix caret position * removed console logs * version updated * eslint style * caret position * big fixed on sanitize method * sanitize improved, using observers * sanitize: using html-janitor * fixes * last fixes, code improved after review * updated * new bundle * webpack config improved * upd * upd * upd
#105) * cover restoring fixed * upd * fetch fixed in safari * updated * plugins * plugins ready * code improved * fixed bug with backspace * improved architecture * Versioning (#102) * start versioning * codex.version * eslint settings * versioning improved * cover restoring and fetch function fixed (#101) * cover restoring fixed * upd * fetch fixed in safari * updated * plugins * plugins ready * code improved * fixed bug with backspace * improved architecture * new sanitize method (#103) * new sanitize method Need to fix caret position * removed console logs * version updated * eslint style * caret position * big fixed on sanitize method * sanitize improved, using observers * sanitize: using html-janitor * fixes * last fixes, code improved after review * updated * new bundle * webpack config improved * upd * upd * upd * upd * clear from conflicts * upd * upd
Need to fix caret position