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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6aee33f1b4e0d7a3b526b5bd5d277530126674e
4
- data.tar.gz: 1a07c0bb7dd2fc2173bed343238bcd78b334ffd1
3
+ metadata.gz: 7b88d7586b26e56ce255dafceb0124d01e9cf27c
4
+ data.tar.gz: 484b60478cfe4ce36b165d1513d8183affdcc5d3
5
5
  SHA512:
6
- metadata.gz: e00c6be6d563d461aab181e35ee26e5893a1720f0418206c6ea8e7587fa0585b87648313798a7ed997b5e731c9f15c765c243296c5386039a2bf4bd15c404d6a
7
- data.tar.gz: 570a5c05398901cb96a1343751f30749c85a361b7141c08218e94b101dd78e4d699a87a53b8caf9b6b46efa5b936e66210c2da0ddbdc62b6e9cfea5dab9db9cd
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));
@@ -1 +1,2 @@
1
1
  //= require ckeditor/init
2
+ //= require ../ckeditor/config
@@ -1,6 +1,5 @@
1
- %h4
2
- = render_label
3
-
1
+ = render_label
2
+
4
3
  %p
5
4
  Please select 1-2 Categories.
6
5
 
@@ -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
@@ -1,7 +1,7 @@
1
1
  module Cortex
2
2
  module Plugins
3
3
  module Core
4
- VERSION = '0.4.8'
4
+ VERSION = '0.5.0'
5
5
  end
6
6
  end
7
7
  end
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.8
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-19 00:00:00.000000000 Z
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