Dotclear

source: plugins/dcCKEditor/js/ckeditor-plugins/media/plugin.js @ 2738:d6b4c5ac9b33

Revision 2738:d6b4c5ac9b33, 726 bytes checked in by Nicolas <nikrou77@…>, 11 years ago (diff)

Integrate dcCKEditor to distribution

Line 
1(function() {
2     CKEDITOR.plugins.add('media', {
3          icons: 'media',
4          init: function(editor) {
5               editor.addCommand('mediaCommand', {
6                    exec: function(editor) {
7                         $.toolbarPopup('media.php?popup=1&editor='+editor.name);
8                    }
9               });
10               
11               editor.ui.addButton('Media', {
12                    label: 'Media Selection',
13                    command: 'mediaCommand',
14                    toolbar: 'insert'
15               });
16               
17               editor.on('doubleclick',function(e) {
18                    var element = CKEDITOR.plugins.link.getSelectedLink(editor) || e.data.element;
19                    if (!element.isReadOnly()) {
20                         if (element.is('img') || (element.is('a') && element.hasClass('media-link'))) {
21                              $.toolbarPopup('media.php?popup=1&editor='+editor.name);
22                              return false;
23                         }
24                    }
25               });
26          }
27     });
28})();
29
Note: See TracBrowser for help on using the repository browser.

Sites map