Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
node.textContent = removeChar(node.textContent, position - 1);
const caret = getCaret(node);
caret.setPosition(position - 2);
}
else {
node.innerHTML = insertString(node.innerHTML, htmlPosition, '.');
node.textContent = removeChar(node.textContent, position);
const caret = getCaret(node);
caret.setPosition(position)
//MediumEditor.selection.moveCursor(document, node, position)
}
}
export default MediumEditor.Extension.extend({
name: 'cheeky-keys', // Safe to say we're in our own namespace here.
triggers: [
{
key: '"',
handler: handleDoubleQuote,
},
{
key: "'",
handler: handleSingleQuote,
},
{
key: '.',
handler: handleElipsis,
if (self.isProperty) {
options.toolbar = false;
}
if (options.toolbar && Array.isArray(options.toolbar.buttons)) {
options.toolbar.buttons.forEach((button, i) => {
if (typeof (button) !== 'string') { return; }
if (buttonDefinitions[button]) {
options.toolbar.buttons[i] = buttonDefinitions[button];
}
});
}
var InsertMedia = MediumEditor.Extension.extend({
name: 'insert-media',
getButton: function (editor, getter) {
var btn = document.createElement('button');
btn.innerText = 'Media';
btn.addEventListener('click', event => {
event.preventDefault();
event.stopPropagation();
top.LackeyManager
.stack
.inspectMedia({}, null)
.then(result => {
if (result) {
let
init: function () {
MediumEditor.Extension.prototype.init.apply(this, arguments);
this.subscribe('editableInput', this.handleInput.bind(this));
this.keys = {};
this.triggers
.forEach((key, i) => {
this.keys[key.keyCode] = i;
});
},