Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You will need something like</p> <pre><code>ed.onContextMenu.add(function(ed, e) { if (!e.ctrlKey) { // Restore the last selection since it was removed if (lastRng) ed.selection.setRng(lastRng); var menu = this._getMenu(ed); if ((typeof menu).toLowerCase() == 'object') { menu.showMenu(e.clientX, e.clientY); Event.add(ed.getDoc(), 'click', function(e) { hide(ed, e); }); Event.cancel(e); } } }); </code></pre> <p>and the function _getMenu where you may insert contextmenu options:</p> <pre><code>//example this will only display if an image was clicked if (node !== "undefined" &amp;&amp; node.nodeName.toLowerCase() == 'img') { m.add({ title: 'my menu', }); m.addSeparator(); // Inline-Element editieren m.add({ title: 'to be choosen1', icon: 'http://...', cmd: 'undo' }); t.onContextMenu.dispatch(t, m, el, col); return m; } </code></pre> <p><strong>EDIT:</strong> </p> <p>you can get the default menu using (the plugin contextmenu needs to be active)</p> <pre><code>var editor = tinymce.get(editor_id); var menu = editor.plugins.contextmenu._getMenu(editor); </code></pre> <p>adding an entry to the menu should work as follows</p> <pre><code>menu.add({title : 'undo', icon : 'undo', cmd : 'Undo'}); </code></pre> <p>it might be necessary to render the menu explicitly using <code>showMenu</code>. Another way to insert a menu to the contextemenu is to modify the editor_plugin.js in the tiny_mce/plugins/contextemneu directory and add the entry directly. You may also copy the plugin, modify and rename it - let it work as a custom plugin.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload