scrivito_icon_box_widget 1.0.3 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/icon_box_widget/application.css +1 -0
- data/app/assets/stylesheets/icon_box_widget/base.css +17 -0
- data/app/assets/stylesheets/icon_box_widget/widget.css +24 -29
- data/app/models/icon_box_widget.rb +3 -15
- data/app/views/icon_box_widget/details.html.erb +12 -19
- data/app/views/icon_box_widget/partials/_animation_select.erb +12 -0
- data/app/views/icon_box_widget/partials/_color_picker.html.erb +5 -5
- data/app/views/icon_box_widget/partials/_icons_picker.html.erb +8 -0
- data/app/views/icon_box_widget/show.html.erb +2 -2
- data/lib/scrivito_icon_box_widget/version.rb +1 -1
- metadata +20 -11
- data/app/assets/javascript/icon_box_widget/editing.js +0 -2
- data/app/assets/javascript/icon_box_widget/editing/editors/button_picker.js +0 -32
- data/app/assets/stylesheets/icon_box_widget/editing.css +0 -19
- data/app/views/icon_box_widget/partials/_icon_picker.html.erb +0 -10
- data/app/views/icon_box_widget/partials/_size_picker.html.erb +0 -5
- data/app/views/icon_box_widget/partials/_style_picker.html.erb +0 -5
- data/lib/generators/scrivito_icon_box_widget.rb +0 -7
- data/lib/generators/scrivito_icon_box_widget_generator.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee1ad31f6fe894b4e29796a98e1813a51b47f77e
|
4
|
+
data.tar.gz: a52ad85a34613dbb6dde76e88d501d671c3ec38d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72068aa03af28058fe6235ba5657ef0b5cfb7e9989fcf0dd617abe47b25bbf448801ee8eaa8a447f39ad8af8fbb4fff4750d1b14031567ead7f58caadd58d2d0
|
7
|
+
data.tar.gz: 8b1212ebb21402d2285dd6561288980f3b79d1cadda7137fd4cbb42d30e7e5c14ae1169403f12cef7abc6be355c3e0be733e44a2d377e8a76b8cd72dfce89e93
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.scrivito-icon-box {
|
2
|
+
overflow: hidden;
|
3
|
+
margin: 10px auto;
|
4
|
+
padding: 10px;
|
5
|
+
width: 70px;
|
6
|
+
height: 70px;
|
7
|
+
box-sizing: initial;
|
8
|
+
-webkit-box-sizing: initial;
|
9
|
+
-moz-box-sizing: initial;
|
10
|
+
}
|
11
|
+
|
12
|
+
.scrivito-icon-box i {
|
13
|
+
margin: 10px;
|
14
|
+
font-size: 50px;
|
15
|
+
line-height: 50px;
|
16
|
+
text-align: center;
|
17
|
+
}
|
@@ -1,35 +1,29 @@
|
|
1
|
-
.scrivito-icon-box {
|
2
|
-
overflow: hidden;
|
3
|
-
margin: 10px auto;
|
4
|
-
padding: 10px;
|
5
|
-
box-sizing: initial;
|
6
|
-
-webkit-box-sizing: initial;
|
7
|
-
-moz-box-sizing: initial;
|
8
|
-
}
|
9
|
-
|
10
|
-
.scrivito-icon-box.circle,
|
11
|
-
.scrivito-icon-box.filled-circle {
|
12
|
-
border-radius: 50px;
|
13
|
-
text-align: center;
|
14
|
-
}
|
15
|
-
|
16
1
|
.scrivito-icon-box.small {
|
17
2
|
width: 50px;
|
18
3
|
height: 50px;
|
19
4
|
}
|
20
5
|
|
21
6
|
.scrivito-icon-box.medium {
|
22
|
-
width:
|
23
|
-
height:
|
7
|
+
width: 70px;
|
8
|
+
height: 70px;
|
24
9
|
}
|
25
10
|
|
26
11
|
.scrivito-icon-box.large {
|
27
|
-
width:
|
28
|
-
height:
|
12
|
+
width: 90px;
|
13
|
+
height: 90px;
|
29
14
|
}
|
30
15
|
|
31
|
-
.scrivito-icon-box
|
32
|
-
|
16
|
+
.scrivito-icon-box.circle,
|
17
|
+
.scrivito-icon-box.filled-circle {
|
18
|
+
border-radius: 70px;
|
19
|
+
text-align: center;
|
20
|
+
}
|
21
|
+
|
22
|
+
.scrivito-icon-box.circle,
|
23
|
+
.scrivito-icon-box.square {
|
24
|
+
background: transparent !important;
|
25
|
+
border-width: 3px;
|
26
|
+
border-style: solid;
|
33
27
|
}
|
34
28
|
|
35
29
|
.scrivito-icon-box.small i {
|
@@ -40,15 +34,16 @@
|
|
40
34
|
}
|
41
35
|
|
42
36
|
.scrivito-icon-box.medium i {
|
43
|
-
font-size: 40px;
|
44
|
-
height: 40px;
|
45
|
-
width: 40px;
|
46
|
-
line-height: 40px;
|
47
|
-
}
|
48
|
-
|
49
|
-
.scrivito-icon-box.large i {
|
50
37
|
font-size: 50px;
|
51
38
|
height: 50px;
|
52
39
|
width: 50px;
|
53
40
|
line-height: 50px;
|
54
|
-
}
|
41
|
+
}
|
42
|
+
|
43
|
+
.scrivito-icon-box.large i {
|
44
|
+
font-size: 70px;
|
45
|
+
height: 70px;
|
46
|
+
width: 70px;
|
47
|
+
line-height: 70px;
|
48
|
+
}
|
49
|
+
|
@@ -8,24 +8,12 @@ class IconBoxWidget < Widget
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
def self.sizes
|
12
|
-
["small","medium","large"]
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.styles
|
16
|
-
["circle","square","filled-circle","filled-square"]
|
17
|
-
end
|
18
|
-
|
19
11
|
def self.icons
|
20
|
-
["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"]
|
12
|
+
["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"]
|
21
13
|
end
|
22
14
|
|
23
|
-
def
|
24
|
-
|
25
|
-
"background-color: #{self.background_color}"
|
26
|
-
elsif self.style
|
27
|
-
"border: 3px solid #{self.background_color}"
|
28
|
-
end
|
15
|
+
def background_class
|
16
|
+
self.background_color
|
29
17
|
end
|
30
18
|
|
31
19
|
private
|
@@ -1,23 +1,16 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank"><strong>Font Awesome</strong></a>.
|
5
|
-
</p>
|
6
|
-
<p>
|
7
|
-
Use only the name of the icon without fa. For Example the icon <i>fa fa-car</i>, use only <strong>car</strong>
|
8
|
-
</p>
|
1
|
+
<div class="details-view">
|
2
|
+
<h4>Icon</h4>
|
3
|
+
<%= render 'icon_box_widget/partials/icons_picker', widget: widget, attribute: :icon %>
|
9
4
|
|
10
|
-
</
|
11
|
-
<%=
|
5
|
+
<h4>Size</h4>
|
6
|
+
<%= scrivito_toggle_button_editor(widget, :size) %>
|
12
7
|
|
13
|
-
<h4>
|
14
|
-
<%=
|
8
|
+
<h4>Style</h4>
|
9
|
+
<%= scrivito_toggle_button_editor(widget, :style) %>
|
15
10
|
|
16
|
-
<h4>
|
17
|
-
<%= render
|
11
|
+
<h4>Icon Color</h4>
|
12
|
+
<%= render 'icon_box_widget/partials/color_picker', widget: widget, attribute: :color %>
|
18
13
|
|
19
|
-
<h4>Color</h4>
|
20
|
-
<%= render
|
21
|
-
|
22
|
-
<h4>Background Color</h4>
|
23
|
-
<%= render "icon_box_widget/partials/color_picker", widget: widget, attribute: :background_color %>
|
14
|
+
<h4>Background Color</h4>
|
15
|
+
<%= render 'icon_box_widget/partials/color_picker', widget: widget, attribute: :background_color %>
|
16
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= scrivito_toggle_button_editor(widget, attribute, IconBoxWidget.icons) %>
|
2
|
+
|
3
|
+
<h4>Different Icon</h4>
|
4
|
+
<div class="alert alert-info">
|
5
|
+
<p>More Icons can be found at
|
6
|
+
<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank"><strong>Font Awesome</strong></a>.
|
7
|
+
</p>
|
8
|
+
<p>
|
9
|
+
Use only the name of the icon without fa. For Example the icon <i>fa fa-car</i>, use only <strong>car</strong>
|
10
|
+
</p>
|
11
|
+
</div>
|
12
|
+
<%= scrivito_tag(:div, widget, attribute) %>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<%= scrivito_toggle_button_editor(widget, attribute, Obj.selectable_color_classes(widget.obj_class.name, attribute)) do |elem|
|
2
|
+
scrivito_tag(:button, widget, attribute, class: "#{elem == widget.send(attribute) ? 'active' : ''} #{elem}", data: {editor: 'scrivito-toggle-button', content: elem}) do
|
3
|
+
elem
|
4
|
+
end
|
5
|
+
end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= scrivito_toggle_button_editor(widget, attribute, IconBoxWidget.icons) do |elem|
|
2
|
+
scrivito_tag(:button, widget, attribute, class: elem == widget.send(attribute) ? 'active' : '', data: {editor: 'scrivito-toggle-button', content: elem}) do
|
3
|
+
content_tag(:i, '', :class => "fa fa-#{elem}") + " " + elem
|
4
|
+
end
|
5
|
+
end %>
|
6
|
+
|
7
|
+
<h4>Select Icon not in List <abbr title="You can select an icon out of over 500. Look for font-awesome" class="initialism"></abbr></h4>
|
8
|
+
<%= scrivito_tag :div, widget, :icon %>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<div class="scrivito-icon-box <%= widget.size %> <%= widget.style %>
|
2
|
-
<i class="fa fa-<%= widget.icon %>
|
1
|
+
<div class="scrivito-icon-box <%= widget.size %> <%= widget.style %> <%= widget.background_class %>">
|
2
|
+
<i class="fa fa-<%= widget.icon %> <%= widget.color %>"></i>
|
3
3
|
</div>
|
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.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scrivito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ 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'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: font-awesome-rails
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,21 +89,16 @@ extra_rdoc_files: []
|
|
75
89
|
files:
|
76
90
|
- LICENSE
|
77
91
|
- Rakefile
|
78
|
-
- app/assets/javascript/icon_box_widget/editing.js
|
79
|
-
- app/assets/javascript/icon_box_widget/editing/editors/button_picker.js
|
80
92
|
- app/assets/stylesheets/icon_box_widget/application.css
|
81
|
-
- app/assets/stylesheets/icon_box_widget/
|
93
|
+
- app/assets/stylesheets/icon_box_widget/base.css
|
82
94
|
- app/assets/stylesheets/icon_box_widget/widget.css
|
83
95
|
- app/models/icon_box_widget.rb
|
84
96
|
- app/views/icon_box_widget/details.html.erb
|
97
|
+
- app/views/icon_box_widget/partials/_animation_select.erb
|
85
98
|
- app/views/icon_box_widget/partials/_color_picker.html.erb
|
86
|
-
- app/views/icon_box_widget/partials/
|
87
|
-
- app/views/icon_box_widget/partials/_size_picker.html.erb
|
88
|
-
- app/views/icon_box_widget/partials/_style_picker.html.erb
|
99
|
+
- app/views/icon_box_widget/partials/_icons_picker.html.erb
|
89
100
|
- app/views/icon_box_widget/show.html.erb
|
90
101
|
- app/views/icon_box_widget/thumbnail.html.erb
|
91
|
-
- lib/generators/scrivito_icon_box_widget.rb
|
92
|
-
- lib/generators/scrivito_icon_box_widget_generator.rb
|
93
102
|
- lib/scrivito_icon_box_widget.rb
|
94
103
|
- lib/scrivito_icon_box_widget/engine.rb
|
95
104
|
- lib/scrivito_icon_box_widget/version.rb
|
@@ -115,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
124
|
version: '0'
|
116
125
|
requirements: []
|
117
126
|
rubyforge_project:
|
118
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.2.2
|
119
128
|
signing_key:
|
120
129
|
specification_version: 4
|
121
130
|
summary: Widget for scrivito to display an icon in a box.
|
@@ -1,32 +0,0 @@
|
|
1
|
-
(function($, App) {
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
$(function() {
|
5
|
-
|
6
|
-
App.buttonPickerEditor = {
|
7
|
-
// set selector for Editor
|
8
|
-
selector: '.button-picker',
|
9
|
-
|
10
|
-
// Function that will be called on scrvito load
|
11
|
-
initFunction: function(index, elem) {},
|
12
|
-
|
13
|
-
// set function triggert on click
|
14
|
-
clickFunction: function(cmsField) {
|
15
|
-
var text = cmsField.data('picker-content');
|
16
|
-
|
17
|
-
cmsField.addClass('activated');
|
18
|
-
cmsField.siblings().removeClass('activated');
|
19
|
-
|
20
|
-
return cmsField.scrivito('save', text);
|
21
|
-
},
|
22
|
-
};
|
23
|
-
|
24
|
-
// Set click event
|
25
|
-
scrivito.on('load', function() {
|
26
|
-
return $('body').on('click', buttonPickerEditor.selector, function(event) {
|
27
|
-
buttonPickerEditor.clickFunction($(event.target));
|
28
|
-
});
|
29
|
-
});
|
30
|
-
});
|
31
|
-
|
32
|
-
})(jQuery, this);
|
@@ -1,19 +0,0 @@
|
|
1
|
-
.scrivito_button.button-picker {
|
2
|
-
margin: 0 0 4px 0;
|
3
|
-
height: auto !important;
|
4
|
-
width: 120px !important;
|
5
|
-
text-align: left;
|
6
|
-
text-shadow: 0 0 2px #222;
|
7
|
-
background: #444;
|
8
|
-
color: #fff;
|
9
|
-
outline: none !important;
|
10
|
-
border: none;
|
11
|
-
}
|
12
|
-
|
13
|
-
.scrivito_button.button-picker:hover {
|
14
|
-
background: #888;
|
15
|
-
}
|
16
|
-
|
17
|
-
.scrivito_button.button-picker.activated {
|
18
|
-
box-shadow: 0 0 0 1px rgba(255,255,255,0.6) inset, 0 0 3px 1px #222
|
19
|
-
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<% IconBoxWidget.icons.each do |icon| %>
|
2
|
-
<%= scrivito_tag(:button, widget, attribute,
|
3
|
-
class: "scrivito_button button-picker #{widget.send(attribute) == icon ? "activated" : ""}",
|
4
|
-
:"data-picker-content" => icon, :"data-editor" => 'button-picker') do %>
|
5
|
-
<i class="fa fa-<%= icon %>"></i> <%= icon %>
|
6
|
-
<% end %>
|
7
|
-
<% end %>
|
8
|
-
|
9
|
-
<h4>Different Icon</h4>
|
10
|
-
<%= scrivito_tag(:div, widget, attribute) %>
|
@@ -1,5 +0,0 @@
|
|
1
|
-
<% IconBoxWidget.sizes.each do |size| %>
|
2
|
-
<%= scrivito_tag(:button, widget, attribute, class: "scrivito_button button-picker #{widget.send(attribute) == size ? "activated" : ""}", :"data-picker-content" => size, :"data-editor" => 'button-picker') do %>
|
3
|
-
<%= size %>
|
4
|
-
<% end %>
|
5
|
-
<% end %>
|
@@ -1,5 +0,0 @@
|
|
1
|
-
<% IconBoxWidget.styles.each do |style| %>
|
2
|
-
<%= scrivito_tag(:button, widget, attribute, class: "scrivito_button button-picker #{widget.send(attribute) == style ? "activated" : ""}", :"data-picker-content" => style, :"data-editor" => 'button-picker') do %>
|
3
|
-
<%= style %>
|
4
|
-
<% end %>
|
5
|
-
<% end %>
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# config/initializers/load_config.rb
|
2
|
-
APP_CONFIG = YAML.load_file("#{Rails.root}/config/config.yml")
|
3
|
-
|
4
|
-
# application.rb
|
5
|
-
if APP_CONFIG && APP_CONFIG['scrivito_icon_box_widget']['colors']
|
6
|
-
Rails.configuration.icon_box_colors = APP_CONFIG['scrivito_icon_box_widget']['colors']
|
7
|
-
end
|