scrivito_icon_box_widget 1.1.11 → 1.2.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: 2238da868dd25dfee689a65e8968f627e287f5a7
4
- data.tar.gz: d57f952fbe6d52df21bd2e13088466b0c79b88fb
3
+ metadata.gz: fad4a41b40ad05278b267d862712b764363e7b6b
4
+ data.tar.gz: 03d4bb7f0196c28cb476cd7b8b1c045bcb7b27d5
5
5
  SHA512:
6
- metadata.gz: 519168ea086b93c627dae42fd5233086222661d48fcfc7bb786bd01257a89bd5bbd0fe957f2bf72ae5fd9aec4cbd6b60b3195e41a4567f238b0af2a6e063b393
7
- data.tar.gz: f2e9ad02873e28d6e90934726ea10f5b5d48a3537eaaa4b8d065ad535c09d6cbc7794dbd3280fad7e464486e9e4c12c807fe0737b7b6654d0d18b0874783d2e8
6
+ metadata.gz: 2e1164ab0ce9af961794f9e43ee4c19a8f454061904154fe5e6dec0f8eca28c6f615bf9c73587d2fe5ae9abd6517c526489fade487730a2a4fc1b8d440280080
7
+ data.tar.gz: 64bd2b2116b43eb591631f08ab1f29ed0d1b7b8dd887d8689521fb61ae4f9f66b0981a337607778a1b31956a912a405ae85c0b527cca7ea081d8cbf5fc9b8bad
@@ -1,5 +1,4 @@
1
1
  /*
2
2
  *= require font-awesome
3
- *= require scrivito_advanced_editors
4
3
  *= require_tree ./scrivito_icon_box_widget
5
4
  */
@@ -17,7 +17,7 @@
17
17
  text-align: center;
18
18
  }
19
19
 
20
- .scrivito_dialog .button_list button[data-editor="scrivito-toggle-button"].icon-select {
20
+ .scrivito_dialog .icon-select .toggle_button_list .scrivito-toggle-button {
21
21
  padding: 6px 18px;
22
22
  font-size: 10px;
23
23
  line-height: 10px;
@@ -14,25 +14,33 @@ class IconBoxWidget < Widget
14
14
  end
15
15
 
16
16
  def self.icons
17
- IconBoxWidget.icon_list.map do |icon|
18
- {
19
- content: icon,
20
- caption: "<i class='fa fa-#{icon}'></i>#{icon.present? ? icon : 'none'}".html_safe,
21
- style: '',
22
- css: 'icon-select'
23
- }
17
+ IconBoxWidget.icon_list
18
+ end
19
+
20
+ def self.caption
21
+ elems = {}
22
+ IconBoxWidget.icon_list.each do |elem|
23
+ elems[elem] = "<i class='fa fa-#{elem}'></i>#{elem}".html_safe
24
24
  end
25
+ return elems
25
26
  end
26
27
 
27
- def background_class
28
- self.background_color
28
+ def background_classes
29
+ c = ["scrivito-icon-box"]
30
+ c << self.size
31
+ c << self.style
32
+ c << self.background_color
33
+ c.join(' ')
29
34
  end
30
35
 
31
- private
32
- def self.fallback_colors
33
- %w(transparent black gray light-gray red green blue yellow)
36
+ def icon_classes
37
+ c = ["fa"]
38
+ c << "fa-#{self.icon}"
39
+ c << self.color
40
+ c.join(' ')
34
41
  end
35
42
 
43
+ private
36
44
  def self.icon_list
37
45
  ["none", "plus","minus","warning","paw","send","car","sliders","tree","bell","certificate","cloud","comment","dashboard","female","male","flag","globe","heart","leaf","plane","refresh","rocket","question","star","unlock"]
38
46
  end
@@ -3,17 +3,17 @@
3
3
  <% end %>
4
4
 
5
5
  <%= scrivito_details_for 'Size' do %>
6
- <%= scrivito_toggle_button_editor(widget, :size) %>
6
+ <%= scrivito_tag(:div, widget, :size) %>
7
7
  <% end %>
8
8
 
9
9
  <%= scrivito_details_for 'Style' do %>
10
- <%= scrivito_toggle_button_editor(widget, :style) %>
10
+ <%= scrivito_tag(:div, widget, :style) %>
11
11
  <% end %>
12
12
 
13
13
  <%= scrivito_details_for 'Icon Color' do %>
14
- <%= render 'scrivito_advanced_editors/color_picker', widget: widget, attribute: :color %>
14
+ <%= scrivito_tag :div, widget, :color, data: {colors_list: scrivito_selectable_color_classes('icon_box_widget', 'color')} %>
15
15
  <% end %>
16
16
 
17
17
  <%= scrivito_details_for 'Background Color' do %>
18
- <%= render 'scrivito_advanced_editors/color_picker', widget: widget, attribute: :background_color %>
18
+ <%= scrivito_tag :div, widget, :background_color, data: {colors_list: scrivito_selectable_color_classes('icon_box_widget', 'background_color')} %>
19
19
  <% end %>
@@ -1,4 +1,6 @@
1
- <%= scrivito_toggle_button_editor(widget, attribute, IconBoxWidget.icons) %>
1
+ <div class="icon-select">
2
+ <%= scrivito_tag(:div, widget, attribute, data: {toggle_button_list: IconBoxWidget.icons, toggle_button_caption: IconBoxWidget.caption}) %>
3
+ </div>
2
4
  <hr />
3
5
  <h4>Icon not in List</h4>
4
6
  <div class="alert alert-info">
@@ -1,3 +1,3 @@
1
- <div class="scrivito-icon-box <%= widget.size %> <%= widget.style %> <%= widget.background_class %>">
2
- <i class="fa fa-<%= widget.icon %> <%= widget.color %>"></i>
1
+ <div class="<%= widget.background_classes %>">
2
+ <i class="<%= widget.icon_classes %>"></i>
3
3
  </div>
@@ -1,4 +1,3 @@
1
- require 'scrivito_advanced_editors'
2
1
  require 'font-awesome-rails'
3
2
 
4
3
  module ScrivitoIconBoxWidget
@@ -1,3 +1,3 @@
1
1
  module ScrivitoIconBoxWidget
2
- VERSION = "1.1.11"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_icon_box_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-22 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: scrivito_advanced_editors
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: font-awesome-rails
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -90,7 +76,6 @@ files:
90
76
  - LICENSE
91
77
  - Rakefile
92
78
  - app/assets/images/widget_preview_icon.png
93
- - app/assets/javascripts/scrivito_icon_box_widget.js
94
79
  - app/assets/stylesheets/scrivito_icon_box_widget.css
95
80
  - app/assets/stylesheets/scrivito_icon_box_widget/base.css.scss
96
81
  - app/assets/stylesheets/scrivito_icon_box_widget/colors.css
@@ -1 +0,0 @@
1
- //= require scrivito_advanced_editors