Skip to content

Commit 503c6cd

Browse files
Merge pull request #25 from cortex-cms/topic/COR-528-Media-Popup-Selection-For-WYSIWYGs
COR-528: Media Popup Selection for WYSIWYGs
2 parents 640785d + 21dba4a commit 503c6cd

File tree

5 files changed

+58
-1
lines changed

5 files changed

+58
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CKEDITOR.editorConfig = function( config ) {
2+
config.extraPlugins = 'cortex_media_insert';
3+
4+
config.toolbarGroups = [
5+
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
6+
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
7+
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
8+
{ name: 'forms', groups: [ 'forms' ] },
9+
{ name: 'styles', groups: [ 'styles' ] },
10+
{ name: 'colors', groups: [ 'colors' ] },
11+
{ name: 'tools', groups: [ 'tools' ] },
12+
{ name: 'others', groups: [ 'others' ] },
13+
{ name: 'about', groups: [ 'about' ] },
14+
'/',
15+
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
16+
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
17+
{ name: 'links', groups: [ 'links' ] },
18+
{ name: 'insert', groups: [ 'insert' ] }
19+
];
20+
21+
config.removeButtons = 'Image,Source,Save,NewPage,Preview,Print,Templates,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Flash,ShowBlocks,About';
22+
};
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
(function (global) {
2+
'use strict';
3+
4+
global.CKEDITOR.plugins.add('cortex_media_insert', {
5+
icons: 'media',
6+
init: function (editor) {
7+
editor.addCommand('insertMedia', {
8+
exec: function (editor) {
9+
window.MODALS.featured.open();
10+
11+
global.media_select = {};
12+
global.media_select_defer = $.Deferred();
13+
global.media_select_defer.promise(global.media_select);
14+
15+
global.media_select.done(function (media) {
16+
window.MODALS.featured.close();
17+
18+
var mediaTag = editor.document.createElement('media');
19+
mediaTag.setAttribute('id', media.id);
20+
mediaTag.setText(" " + media.title);
21+
22+
editor.insertElement(mediaTag);
23+
});
24+
}
25+
});
26+
27+
editor.ui.addButton('cortexMediaInsert', {
28+
label: 'Insert Media',
29+
command: 'insertMedia',
30+
toolbar: 'insert,0'
31+
});
32+
}
33+
});
34+
}(this));
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
//= require ckeditor/init
2+
//= require ../ckeditor/config

lib/cortex/plugins/core/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Cortex
22
module Plugins
33
module Core
4-
VERSION = '0.4.8'
4+
VERSION = '0.5.0'
55
end
66
end
77
end

0 commit comments

Comments
 (0)