Skip to content

Commit 674512a

Browse files
committed
Merge branch 'develop'
2 parents 9a4d9af + 503c6cd commit 674512a

File tree

7 files changed

+62
-6
lines changed

7 files changed

+62
-6
lines changed

Diff for: app/assets/javascripts/ckeditor/config.js

+22
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
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));
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
//= require ckeditor/init
2+
//= require ../ckeditor/config

Diff for: app/cells/plugins/core/tree/checkboxes.haml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
%h4
2-
= render_label
3-
1+
= render_label
2+
43
%p
54
Please select 1-2 Categories.
65

Diff for: app/models/asset_field_type.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ def style_urls
122122
if existing_data.empty?
123123
(metadata[:styles].map { |key, value| [key, asset.url(key)] }).to_h
124124
else
125-
existing_data[:asset][:style_urls]
125+
existing_data.deep_symbolize_keys[:asset][:style_urls]
126126
end
127127
end
128128

129129
def existing_metadata
130130
metadata.except!(:existing_data)
131131

132132
unless existing_data.empty?
133-
metadata[:path].gsub(":id", existing_data['asset_field_type_id']) if metadata[:path]
133+
metadata[:path].gsub!(":id", existing_data['asset_field_type_id']) if metadata[:path]
134134
end
135135

136136
metadata

Diff for: lib/cortex/plugins/core/version.rb

+1-1
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)