How to use the tinymce/core/api/PluginManager.add function in tinymce

To help you get started, we’ve selected a few tinymce examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinymce / tinymce / modules / tinymce / src / plugins / autoresize / main / ts / Plugin.ts View on Github external
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);
    }
  });
}
github tinymce / tinymce / modules / tinymce / src / plugins / advlist / main / ts / Plugin.ts View on Github external
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);
    }
  });
}
github tinymce / tinymce / modules / tinymce / src / plugins / fullscreen / main / ts / Plugin.ts View on Github external
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);
  });
}
github tinymce / tinymce / modules / tinymce / src / plugins / textpattern / main / ts / Plugin.ts View on Github external
export default function () {
  PluginManager.add('textpattern', (editor) => {
    const patternsState = Cell(Settings.getPatternSet(editor.settings));

    Keyboard.setup(editor, patternsState);

    return Api.get(patternsState);
  });
}
github tinymce / tinymce / modules / tinymce / src / plugins / searchreplace / main / ts / Plugin.ts View on Github external
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);
  });
}
github tinymce / tinymce / modules / tinymce / src / plugins / print / main / ts / Plugin.ts View on Github external
export default function () {
  PluginManager.add('print', function (editor) {
    Commands.register(editor);
    Buttons.register(editor);
    editor.addShortcut('Meta+P', '', 'mcePrint');
  });
}
github tinymce / tinymce / modules / tinymce / src / plugins / quickbars / main / ts / Plugin.ts View on Github external
export default function () {
  PluginManager.add('quickbars', function (editor) {
    InsertButtons.setupButtons(editor);
    InsertToolbars.addToEditor(editor);

    SelectionToolbars.addToEditor(editor);
  });
}
github tinymce / tinymce / modules / tinymce / src / plugins / autolink / main / ts / Plugin.ts View on Github external
export default function () {
  PluginManager.add('autolink', function (editor) {
    Keys.setup(editor);
  });
}
github tinymce / tinymce / modules / tinymce / src / plugins / tabfocus / main / ts / Plugin.ts View on Github external
export default function () {
  PluginManager.add('tabfocus', function (editor) {
    Keyboard.setup(editor);
  });
}