Legend:
- Unmodified
- Added
- Removed
-
plugins/dcCKEditor/js/ckeditor-plugins/media/plugin.js
r2835 r3880 1 /*global CKEDITOR, dotclear, $ */ 2 'use strict'; 3 1 4 (function() { 2 CKEDITOR.plugins.add('media', { 3 icons: 'media', 4 init: function(editor) { 5 popup_params = { 'width': 760, 'height': 500}; 5 CKEDITOR.plugins.add('media', { 6 icons: 'media', 7 init: function(editor) { 8 const popup_params = { 9 'width': 760, 10 'height': 500 11 }; 6 12 7 8 exec: function(editor) {9 10 11 13 editor.addCommand('mediaCommand', { 14 exec: function() { 15 $.toolbarPopup('media.php?popup=1&plugin_id=dcCKEditor', popup_params); 16 } 17 }); 12 18 13 14 15 16 17 19 editor.ui.addButton('Media', { 20 label: dotclear.msg.img_select_title, 21 command: 'mediaCommand', 22 toolbar: 'insert' 23 }); 18 24 19 editor.on('doubleclick',function(e) {20 varelement = CKEDITOR.plugins.link.getSelectedLink(editor) || e.data.element;21 22 23 24 25 26 27 28 29 25 editor.on('doubleclick', function(e) { 26 const element = CKEDITOR.plugins.link.getSelectedLink(editor) || e.data.element; 27 if (!element.isReadOnly()) { 28 if (element.is('img') || (element.is('a') && element.hasClass('media-link'))) { 29 $.toolbarPopup('media.php?popup=1&plugin_id=dcCKEditor', popup_params); 30 return false; 31 } 32 } 33 }); 34 } 35 }); 30 36 })();
Note: See TracChangeset
for help on using the changeset viewer.