Legend:
- Unmodified
- Added
- Removed
-
plugins/dcCKEditor/js/ckeditor-plugins/entrylink/plugin.js
r2901 r3880 1 /*global CKEDITOR, dotclear, $ */ 2 'use strict'; 3 1 4 (function() { 2 CKEDITOR.plugins.add('entrylink', { 3 icons: 'entrylink', 4 init: function(editor) { 5 popup_params = { 'width': 760, 'height': 500}; 5 CKEDITOR.plugins.add('entrylink', { 6 icons: 'entrylink', 7 init: function(editor) { 8 const popup_params = { 9 'width': 760, 10 'height': 500 11 }; 6 12 7 8 9 if (editor.getSelection().getNative().toString().replace(/\s*/,'')!='') {10 11 12 13 13 editor.addCommand('entryLinkCommand', { 14 exec: function(editor) { 15 if (editor.getSelection().getNative().toString().replace(/\s*/, '') != '') { 16 $.toolbarPopup('popup_posts.php?popup=1&plugin_id=dcCKEditor', popup_params); 17 } 18 } 19 }); 14 20 15 16 17 18 19 21 editor.ui.addButton('EntryLink', { 22 label: dotclear.msg.post_link_title, 23 command: 'entryLinkCommand', 24 toolbar: 'insert' 25 }); 20 26 21 editor.on('doubleclick',function(e) { 22 var element = CKEDITOR.plugins.link.getSelectedLink(editor) || e.data.element; 23 if (!element.isReadOnly()) { 24 if (element.is('a') 25 && !element.hasClass('media-link') 26 && element.hasClass('ref-post')) { // link to original media @see js/popup_media.js 27 editor.getSelection().selectElement(element); 27 editor.on('doubleclick', function(e) { 28 const element = CKEDITOR.plugins.link.getSelectedLink(editor) || e.data.element; 29 if (!element.isReadOnly()) { 30 if (element.is('a') && !element.hasClass('media-link') && element.hasClass('ref-post')) { 31 // link to original media @see js/popup_media.js 32 editor.getSelection().selectElement(element); 28 33 29 30 31 32 33 34 35 34 $.toolbarPopup('popup_posts.php?popup=1&plugin_id=dcCKEditor', popup_params); 35 return false; 36 } 37 } 38 }); 39 } 40 }); 36 41 })();
Note: See TracChangeset
for help on using the changeset viewer.