Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exec: function (editor) {
var selection = editor.getSelection();
if (selection && !selection.isInvalid) {
var startElement = selection.getStartElement();
var currentPath = new Editor.ElementPath(startElement);
var block = currentPath.block || currentPath.blockLimit;
var nodeName = block && block.nodeName() || '';
if (nodeName.match(/^h\d$/) || nodeName === 'p') {
return nodeName;
}
}
}
});
exec: function (editor) {
var selection = editor.getSelection();
if (selection && !selection.isInvalid) {
var startElement = selection.getStartElement(), currentPath = new Editor.ElementPath(startElement);
return style.checkActive(currentPath);
}
}
});
exec: function (editor) {
var selection = editor.getSelection();
if (selection && !selection.isInvalid) {
var startElement = selection.getStartElement();
var elementPath = new Editor.ElementPath(startElement);
return checkOutdentActive(elementPath);
}
}
});
exec: function (editor) {
var selection = editor.getSelection();
if (selection && !selection.isInvalid) {
var startElement = selection.getStartElement();
var elementPath = new Editor.ElementPath(startElement);
return queryActive('ul', elementPath);
}
}
});
exec: function (editor) {
var selection = editor.getSelection();
if (selection && !selection.isInvalid) {
var startElement = selection.getStartElement();
var elementPath = new Editor.ElementPath(startElement);
return queryActive('ul', elementPath);
}
}
});
exec: function (editor) {
var selection = editor.getSelection();
if (selection && !selection.isInvalid) {
var startElement = selection.getStartElement();
var currentPath = new Editor.ElementPath(startElement);
return getValueFromStyleObj(currentPath, styleObj);
}
}
});
exec: function (editor) {
var selection = editor.getSelection();
if (selection && !selection.isInvalid) {
var startElement = selection.getStartElement(),
currentPath = new Editor.ElementPath(startElement);
return style.checkActive(currentPath);
}
}
});
exec: function (editor) {
var selection = editor.getSelection();
if (selection && !selection.isInvalid) {
var startElement = selection.getStartElement();
var currentPath = new Editor.ElementPath(startElement);
var block = currentPath.block || currentPath.blockLimit;
var nodeName = block && block.nodeName() || '';
if (nodeName.match(/^h\d$/) || nodeName === 'p') {
return nodeName;
}
}
}
});
editor.addCommand(Editor.Utils.getQueryCmd(command), {exec:function(editor) {
var selection = editor.getSelection();
if(selection && !selection.isInvalid) {
var startElement = selection.getStartElement();
var path = new Editor.ElementPath(startElement);
var block = path.block || path.blockLimit;
if(!block || block.nodeName() === "body") {
return false
}
return isAlign(block, textAlign)
}
}})
}
exec: function (editor) {
var selection = editor.getSelection();
if (selection && !selection.isInvalid) {
var startElement = selection.getStartElement();
var elementPath = new Editor.ElementPath(startElement);
return queryActive('ol', elementPath);
}
}
});