Dotclear

source: plugins/dcCKEditor/js/ckeditor-plugins/media/plugin.js @ 2835:1a32b70ad212

Revision 2835:1a32b70ad212, 812 bytes checked in by Nicolas <nikrou77@…>, 11 years ago (diff)

CKEditor : sizes of popups for media, links and links to entry can be choosen

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

Sites map