Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function () {
PluginManager.add('autoresize', function (editor) {
// If autoresize is enabled, disable resize if the user hasn't explicitly enabled it
if (!editor.settings.hasOwnProperty('resize')) {
editor.settings.resize = false;
}
if (!editor.inline) {
const oldSize = Cell(0);
Commands.register(editor, oldSize);
Resize.setup(editor, oldSize);
}
});
}
export default function () {
PluginManager.add('advlist', function (editor) {
const hasPlugin = function (editor, plugin) {
const plugins = editor.settings.plugins ? editor.settings.plugins : '';
return Tools.inArray(plugins.split(/[ ,]/), plugin) !== -1;
};
if (hasPlugin(editor, 'lists')) {
Buttons.register(editor);
Commands.register(editor);
}
});
}
export default function () {
PluginManager.add('table', Plugin);
}
export default function () {
PluginManager.add('fullscreen', (editor) => {
const fullscreenState = Cell(null);
if (editor.settings.inline) {
return Api.get(fullscreenState);
}
Commands.register(editor, fullscreenState);
Buttons.register(editor, fullscreenState);
editor.addShortcut('Meta+Shift+F', '', 'mceFullScreen');
return Api.get(fullscreenState);
});
}
export default function () {
PluginManager.add('textpattern', (editor) => {
const patternsState = Cell(Settings.getPatternSet(editor.settings));
Keyboard.setup(editor, patternsState);
return Api.get(patternsState);
});
}
export default function () {
PluginManager.add('searchreplace', function (editor) {
const currentSearchState = Cell({
index: -1,
count: 0,
text: '',
matchCase: false,
wholeWord: false
});
Commands.register(editor, currentSearchState);
Buttons.register(editor, currentSearchState);
return Api.get(editor, currentSearchState);
});
}
export default function () {
PluginManager.add('print', function (editor) {
Commands.register(editor);
Buttons.register(editor);
editor.addShortcut('Meta+P', '', 'mcePrint');
});
}
export default function () {
PluginManager.add('quickbars', function (editor) {
InsertButtons.setupButtons(editor);
InsertToolbars.addToEditor(editor);
SelectionToolbars.addToEditor(editor);
});
}
export default function () {
PluginManager.add('autolink', function (editor) {
Keys.setup(editor);
});
}
export default function () {
PluginManager.add('tabfocus', function (editor) {
Keyboard.setup(editor);
});
}