scrivito_advanced_editors 1.3.0 → 1.4.0.dev

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: 1ed94decf22d824ecbe0437780cdbaccdd4ca468
4
- data.tar.gz: 5bbfbbc979e2cd4d9be1d474cb15612cc55c565d
3
+ metadata.gz: 461d4ae5a5653f43b8108eae56609267669d1b74
4
+ data.tar.gz: 9ef0e794d4535d7240b8631e2b9e600c0b241495
5
5
  SHA512:
6
- metadata.gz: 5b13ba5c55d9c3a3877e27329c8926f8709e760a392d0e390e75b16d0cac140e4d0e3d070369a78974f3d4158ac96a496d1b7c30041ca023c810f84b976f5dec
7
- data.tar.gz: c6be970fa52d38fcfdc5d4d54b26d9e83f697ba5765a528e61f29afb4c62c8cf6d04e29e9dbcb02ca839fc7ac140ac2d477114dccf9a52db8de70fcc6fc1a9b8
6
+ metadata.gz: 40e524e86d6d0818469095ff41139ad6ff4ac0eb7bf5e99cded5cd558a6c781eee9dcb528f205bce5d1268fc74cbc71a0baf752417e66a0cda7f6384a67ae0a7
7
+ data.tar.gz: f7a309248a87a7ec4194f18a540cc922d4377797d0af3b05c2162ba9f041fb8fbdaf3f351910aef9670a778112d1161f51abc91200268b2941868941ebf8f3b5
@@ -10,17 +10,19 @@
10
10
  if(with_text) $(scrivito_tag).addClass('with-text');
11
11
 
12
12
  $(scrivito_tag).addClass('scrivito_color_picker').html('');
13
- return $.each(values, function(index, color) {
14
- var css_class = (color === content) ? 'active' : 'inactive'
15
- $('<button></button>')
16
- .addClass('scrivito-color-select')
17
- .addClass(color === "" ? "default" : color)
18
- .addClass(color !== "" ? '' : 'transparent_bg')
19
- .addClass(css_class)
20
- .data('content', color)
21
- .html('')
22
- .appendTo($(scrivito_tag));
23
- });
13
+
14
+ if(Array.isArray(values[0])) {
15
+ $.each(values, function(index, list) {
16
+ if(index > 0) $('<div class="clear"></div>').appendTo($(scrivito_tag));
17
+ if(list === null) {
18
+ $('<hr>').appendTo($(scrivito_tag));
19
+ } else {
20
+ ScrivitoColorPicker.buttons(list, content, scrivito_tag);
21
+ }
22
+ });
23
+ } else {
24
+ ScrivitoColorPicker.buttons(values, content, scrivito_tag);
25
+ }
24
26
  },
25
27
 
26
28
  clickFunction: function(event) {
@@ -32,6 +34,23 @@
32
34
 
33
35
  scrivito_tag.scrivito('save', text);
34
36
  },
37
+
38
+ buttons: function(values, content, scrivito_tag) {
39
+ $.each(values, function(index, color) {
40
+ var css_class = (color === content) ? 'active' : 'inactive'
41
+ ScrivitoColorPicker.button(color, css_class).appendTo($(scrivito_tag));
42
+ });
43
+ },
44
+
45
+ button: function(color, css_class) {
46
+ return $('<button></button>')
47
+ .addClass('scrivito-color-select')
48
+ .addClass(color === "" ? "default" : color)
49
+ .addClass(color !== "" ? '' : 'transparent_bg')
50
+ .addClass(css_class)
51
+ .data('content', color)
52
+ .html('')
53
+ }
35
54
  };
36
55
 
37
56
  scrivito.on('content', function() {
@@ -21,9 +21,9 @@
21
21
  overflow: hidden;
22
22
  position: relative;
23
23
  border: 0;
24
- margin: 0 5px 0 0;
24
+ margin: 10px 10px 5px 0;
25
25
  box-shadow: 0 0 4px 1px rgba(0,0,0,0.1);
26
- border-radius: 3px;
26
+ border-radius: 2px;
27
27
  background: transparent;
28
28
  top: -5px;
29
29
  outline: none;
@@ -33,6 +33,7 @@
33
33
  width: 55px;
34
34
  height: 55px;
35
35
  top: 0;
36
+ margin: 0px 5px 0px -5px;
36
37
  }
37
38
 
38
39
  .scrivito_dialog [data-colors-list] .scrivito-color-select.none {
@@ -64,6 +65,7 @@
64
65
  left: 0;
65
66
  right: 0;
66
67
  bottom: 0;
68
+ border-radius: 3px;
67
69
  }
68
70
 
69
71
  .scrivito_dialog [data-colors-list] .scrivito-color-select:after {
@@ -75,4 +77,5 @@
75
77
  left: 0;
76
78
  right: 0;
77
79
  bottom: 0;
78
- }
80
+ border-radius: 2px;
81
+ }
@@ -0,0 +1,7 @@
1
+ <%= link_to scrivito_path(obj), class: 'editing-button editing-blue', target: :_top do %>
2
+ <i class='scrivito_icon scrivito_icon_eye' style='font-size: 10px;'></i> Go to page
3
+ <% end %>
4
+
5
+ <%= link_to scrivito_path(obj).sub(/_scrivito_display_mode=\w+/,'_scrivito_display_mode=view'), class: 'editing-button editing-blue', target: :_blank do %>
6
+ <i class='scrivito_icon scrivito_icon_plus' style='font-size: 10px;'></i> Preview
7
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module ScrivitoAdvancedEditors
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0.dev"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_advanced_editors
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0.dev
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-01 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -95,6 +95,7 @@ files:
95
95
  - app/assets/stylesheets/scrivito_advanced_editors/textarea_editor.css
96
96
  - app/helpers/scrivito_advanced_editors/scrivito_advanced_tag_helper.rb
97
97
  - app/views/scrivito_advanced_editors/_create_obj.html.erb
98
+ - app/views/scrivito_advanced_editors/_page_preview_buttons.html.erb
98
99
  - lib/scrivito_advanced_editors.rb
99
100
  - lib/scrivito_advanced_editors/engine.rb
100
101
  - lib/scrivito_advanced_editors/version.rb
@@ -114,9 +115,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
115
  version: '0'
115
116
  required_rubygems_version: !ruby/object:Gem::Requirement
116
117
  requirements:
117
- - - ">="
118
+ - - ">"
118
119
  - !ruby/object:Gem::Version
119
- version: '0'
120
+ version: 1.3.1
120
121
  requirements: []
121
122
  rubyforge_project:
122
123
  rubygems_version: 2.4.5