Dotclear

source: plugins/dcCKEditor/js/ckeditor-plugins/external-media/dialogs/external-media.js @ 2868:2f77d528185b

Revision 2868:2f77d528185b, 600 bytes checked in by Nicolas <nikrou77@…>, 9 years ago (diff)

Add external media for CKEditor
Allow link around external media

Line 
1CKEDITOR.dialog.add('externalMediaDialog', function(editor) {
2     return {
3          title: dotclear.msg.external_media_title,
4          minWidth: 400,
5          minHeight: 100,
6          contents: [{
7               id: 'main-tab',
8               elements: [{
9                    id: 'url',
10                    type: 'text',
11                    label: 'URL',
12                    validate: CKEDITOR.dialog.validate.notEmpty(dotclear.msg.url_cannot_be_empty)
13               }]
14          }],
15          onOk: function() {
16               var dialog = this;
17               var src = dialog.getValueOf('main-tab', 'url');
18
19               var img = editor.document.createElement('img');
20               img.setAttribute('src', src);
21               img.setAttribute('alt', src);
22               editor.insertElement(img);
23          }
24     };
25});
Note: See TracBrowser for help on using the repository browser.

Sites map