cortex-plugins-core 0.4.8 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ckeditor/config.js +22 -0
- data/app/assets/javascripts/ckeditor/plugins/cortex_media_insert/icons/media.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/cortex_media_insert/plugin.js +34 -0
- data/app/assets/javascripts/cortex-field_types-core/application.js +1 -0
- data/app/cells/plugins/core/tree/checkboxes.haml +2 -3
- data/app/models/asset_field_type.rb +2 -2
- data/lib/cortex/plugins/core/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b88d7586b26e56ce255dafceb0124d01e9cf27c
|
4
|
+
data.tar.gz: 484b60478cfe4ce36b165d1513d8183affdcc5d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3d3fefcc3428c74fbfe3b4b5271bca209a74cf0044c802e05260b8807f49f568c755c69e43b5597b2379160e54a61f77213028f1bb3c204763dadbfc2020fbf
|
7
|
+
data.tar.gz: d7a6a2894175c3195ea084a30d8f3cd4a380bf843fdad13352fa105aa939fbeb410bbba6556fea65557f6e47db96a2e6d35bf1e4b0b1f9a4521891a2963030e0
|
@@ -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
|
+
};
|
@@ -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));
|
@@ -122,7 +122,7 @@ class AssetFieldType < FieldType
|
|
122
122
|
if existing_data.empty?
|
123
123
|
(metadata[:styles].map { |key, value| [key, asset.url(key)] }).to_h
|
124
124
|
else
|
125
|
-
existing_data[:asset][:style_urls]
|
125
|
+
existing_data.deep_symbolize_keys[:asset][:style_urls]
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
@@ -130,7 +130,7 @@ class AssetFieldType < FieldType
|
|
130
130
|
metadata.except!(:existing_data)
|
131
131
|
|
132
132
|
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]
|
134
134
|
end
|
135
135
|
|
136
136
|
metadata
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cortex-plugins-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CareerBuilder Employer Site & Content Products
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -118,6 +118,9 @@ files:
|
|
118
118
|
- LICENSE.md
|
119
119
|
- README.md
|
120
120
|
- Rakefile
|
121
|
+
- app/assets/javascripts/ckeditor/config.js
|
122
|
+
- app/assets/javascripts/ckeditor/plugins/cortex_media_insert/icons/media.png
|
123
|
+
- app/assets/javascripts/ckeditor/plugins/cortex_media_insert/plugin.js
|
121
124
|
- app/assets/javascripts/cortex-field_types-core/application.js
|
122
125
|
- app/cells/plugins/core/asset/input.haml
|
123
126
|
- app/cells/plugins/core/asset_cell.rb
|