cortex-plugins-core 0.8.0 → 0.9.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82c5f29246b247faa0240f0f158bf58324f8fe7c
|
4
|
+
data.tar.gz: 4303743945edb31897ded379045e318dcaac7b37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e20309de17fd952e47c8950b61e734214346ef6e67531d5ca2b285f22d7d158562c5742048625b68f2f660da412d30fa53d95d842936d1ca93867a88cbbbf4df
|
7
|
+
data.tar.gz: 99910694787efc918ad733df65c2a2db217ca4db02bccdbe6439e108e4ebe954fc2cc138c17bfb9ab4ee7d74f6499eaa871b2a17c1dc96fe0d6979939a8ffa63
|
@@ -5,20 +5,45 @@
|
|
5
5
|
requires: 'widget',
|
6
6
|
init: function (editor) {
|
7
7
|
editor.widgets.add('media', {
|
8
|
-
template: '<media
|
8
|
+
template: '<media></media>',
|
9
9
|
data: function () {
|
10
10
|
if (this.data.id) {
|
11
|
-
var
|
12
|
-
alt_text = this.data.alt || this.data.title
|
11
|
+
var child_element,
|
12
|
+
alt_text = this.data.alt || this.data.title,
|
13
|
+
width = this.data.width || this.element.getAttribute('width'),
|
14
|
+
height = this.data.height || this.element.getAttribute('height'),
|
15
|
+
style = this.data.style || this.element.getAttribute('style'),
|
16
|
+
className = this.data.class || this.element.getAttribute('class');
|
13
17
|
|
14
|
-
this.
|
15
|
-
|
16
|
-
|
18
|
+
if (this.data.asset_type === 'image') {
|
19
|
+
child_element = new CKEDITOR.dom.element('img');
|
20
|
+
|
21
|
+
if (this.data.id) {
|
22
|
+
this.element.setAttribute('id', this.data.id);
|
23
|
+
child_element.setAttribute('src', this.data.url);
|
24
|
+
child_element.setAttribute('alt', alt_text);
|
25
|
+
}
|
26
|
+
|
27
|
+
if (width) child_element.setAttribute('width', width);
|
28
|
+
if (height) child_element.setAttribute('height', height);
|
29
|
+
if (style) child_element.setAttribute('style', style);
|
30
|
+
if (className) child_element.setAttribute('class', className);
|
31
|
+
} else {
|
32
|
+
child_element = new CKEDITOR.dom.element('a');
|
33
|
+
|
34
|
+
if (this.data.id) {
|
35
|
+
this.element.setAttribute('id', this.data.id);
|
36
|
+
child_element.setAttribute('href', this.data.url);
|
37
|
+
child_element.setText(alt_text)
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
this.element.append(child_element);
|
17
42
|
}
|
18
43
|
},
|
19
|
-
requiredContent: 'media
|
44
|
+
requiredContent: 'media',
|
20
45
|
upcast: function (element) {
|
21
|
-
return element.name
|
46
|
+
return element.name === 'media';
|
22
47
|
}
|
23
48
|
});
|
24
49
|
|
@@ -37,8 +62,9 @@
|
|
37
62
|
startupData: {
|
38
63
|
id: media.id,
|
39
64
|
title: media.title,
|
40
|
-
|
41
|
-
alt: media.alt
|
65
|
+
url: media.url,
|
66
|
+
alt: media.alt,
|
67
|
+
asset_type: media.asset_type
|
42
68
|
}
|
43
69
|
});
|
44
70
|
});
|
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.9.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: 2017-01-
|
11
|
+
date: 2017-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|