Revision 2835:1a32b70ad212,
1.0 KB
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('entrylink', { |
---|
3 | icons: 'entrylink', |
---|
4 | init: function(editor) { |
---|
5 | popup_params = { 'width': 760, 'height': 500}; |
---|
6 | |
---|
7 | editor.addCommand('entryLinkCommand', { |
---|
8 | exec: function(editor) { |
---|
9 | if (editor.getSelection().getNative().toString().replace(/\s*/,'')!='') { |
---|
10 | $.toolbarPopup('popup_posts.php?popup=1&plugin_id=dcCKEditor', popup_params); |
---|
11 | } |
---|
12 | } |
---|
13 | }); |
---|
14 | |
---|
15 | editor.ui.addButton('EntryLink', { |
---|
16 | label: dotclear.msg.post_link_title, |
---|
17 | command: 'entryLinkCommand', |
---|
18 | toolbar: 'insert' |
---|
19 | }); |
---|
20 | |
---|
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('post')) { // link to original media @see js/popup_media.js |
---|
27 | editor.getSelection().selectElement(element); |
---|
28 | |
---|
29 | $.toolbarPopup('popup_posts.php?popup=1&plugin_id=dcCKEditor', popup_params); |
---|
30 | return false; |
---|
31 | } |
---|
32 | } |
---|
33 | }); |
---|
34 | } |
---|
35 | }); |
---|
36 | })(); |
---|
Note: See
TracBrowser
for help on using the repository browser.