scrivito_accordion_widget 1.0.16 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -21
- data/app/models/accordion_panel_widget.rb +7 -0
- data/app/views/accordion_panel_widget/details.html.erb +1 -1
- data/lib/scrivito_accordion_widget/version.rb +1 -1
- metadata +2 -5
- data/app/assets/javascripts/scrivito_accordion_widget.js +0 -20
- data/app/assets/stylesheets/scrivito_accordion_widget.css.scss +0 -25
- data/scrivito/migrate/0_create_accordion_widget.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e2feaca2474034179474fad524fe44c6c8fbcf2
|
4
|
+
data.tar.gz: 73b7a03df1f96d9fafe99d1ece4ec91f04808381
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 040d47a458d3a6f2f8f771fdc9f69be55c8e144c2db79cdeb70ee7c63177f0291faf85304de9c9ea4a7775499d1be99b5e78fc4e92759cbfd9e67ab857e59a71
|
7
|
+
data.tar.gz: 3698db1365dd1ac21cd3a3f744da158b26ec4d11c0ca93dca5cb78c091548eeebbf37f0a448382193249c66c7ac6f0b9c53535ddad0c92eb416cee3db116c05f
|
data/README.md
CHANGED
@@ -1,33 +1,25 @@
|
|
1
|
-
#
|
1
|
+
# ScrivitoAccordionWidget
|
2
2
|
|
3
|
-
|
3
|
+
A Scrivito widget to add an accordion.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Prerequists
|
6
6
|
|
7
|
-
|
7
|
+
This widget requires bootstrap.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
11
|
-
Add this line to your application's
|
11
|
+
Add this line to your application's Gemfile:
|
12
12
|
|
13
13
|
gem 'scrivito_accordion_widget'
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
*= require scrivito_accordion_widget
|
18
|
-
|
19
|
-
Than add to your Javascript manifest:
|
20
|
-
|
21
|
-
//= require scrivito_accordion_widget
|
15
|
+
## Customization
|
22
16
|
|
23
|
-
|
24
|
-
See [Changelog](https://github.com/Scrivito/scrivito_accordion_widget/blob/master/CHANGELOG.md) for more
|
25
|
-
details.
|
17
|
+
This widget includes an attribute for a background color of a panel. The value of this attribute is used as CSS class. If ypu want to use the feature add a CSS rule for your selectable colors:
|
26
18
|
|
27
|
-
|
19
|
+
```css
|
20
|
+
.bg-red {
|
21
|
+
background-color: red;
|
22
|
+
}
|
23
|
+
```
|
28
24
|
|
29
|
-
|
30
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
33
|
-
5. Create a new Pull Request
|
25
|
+
You can also use [Scrivito Advanced Editors](https://github.com/Scrivito/scrivito_advanced_editors #color_picker) color picker to have a better visualation of selectable color classes.
|
@@ -11,4 +11,11 @@ class AccordionPanelWidget < Widget
|
|
11
11
|
def self.description_for_editor
|
12
12
|
'Panel'
|
13
13
|
end
|
14
|
+
|
15
|
+
def scrivito_selectable_color_classes
|
16
|
+
helper = ApplicationController.helpers
|
17
|
+
if helper.respond_to? 'scrivito_selectable_color_classes'
|
18
|
+
helper.scrivito_selectable_color_classes('accordion_widget', 'background_color')
|
19
|
+
end
|
20
|
+
end
|
14
21
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<div class="scrivito-details-<%= widget.id %>">
|
5
5
|
<div>
|
6
6
|
<b>Background Color</b>
|
7
|
-
<%=
|
7
|
+
<%= scrivito_tag :div, widget, :background_color, data: {colors_list: widget.scrivito_selectable_color_classes()} %>
|
8
8
|
</div>
|
9
9
|
</div>
|
10
10
|
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrivito_accordion_widget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.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-
|
11
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,8 +63,6 @@ files:
|
|
63
63
|
- README.md
|
64
64
|
- Rakefile
|
65
65
|
- app/assets/images/widget_preview_accordion.png
|
66
|
-
- app/assets/javascripts/scrivito_accordion_widget.js
|
67
|
-
- app/assets/stylesheets/scrivito_accordion_widget.css.scss
|
68
66
|
- app/models/accordion_panel_widget.rb
|
69
67
|
- app/models/accordion_widget.rb
|
70
68
|
- app/views/accordion_panel_widget/details.html.erb
|
@@ -75,7 +73,6 @@ files:
|
|
75
73
|
- lib/scrivito_accordion_widget/engine.rb
|
76
74
|
- lib/scrivito_accordion_widget/version.rb
|
77
75
|
- lib/tasks/scrivito_accordion_widget_tasks.rake
|
78
|
-
- scrivito/migrate/0_create_accordion_widget.rb
|
79
76
|
homepage: https://www.scrivito.com
|
80
77
|
licenses:
|
81
78
|
- LGPL-3.0
|
@@ -1,20 +0,0 @@
|
|
1
|
-
(function($, App) {
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
$(function() {
|
5
|
-
$('.scrivito-accordion-group').each(function(i, group) {
|
6
|
-
var accordion_group = $(group);
|
7
|
-
accordion_group.find('.scrivito-accordion-title').each(function(i, accordion_title) {
|
8
|
-
var accordion_title = $(accordion_title);
|
9
|
-
accordion_title.on('click', function() {
|
10
|
-
accordion_group.find('.scrivito-accordion-title').removeClass('scrivito-accordion-active');
|
11
|
-
accordion_group.find('.scrivito-accordion-content').stop(true,false).slideUp(350);
|
12
|
-
|
13
|
-
|
14
|
-
accordion_title.addClass('scrivito-accordion-active');
|
15
|
-
accordion_title.next().stop(true,false).slideDown(350);
|
16
|
-
});
|
17
|
-
});
|
18
|
-
});
|
19
|
-
});
|
20
|
-
})(jQuery, this);
|
@@ -1,25 +0,0 @@
|
|
1
|
-
.scrivito-accordion-group {
|
2
|
-
.scrivito-accordion-panel {
|
3
|
-
box-shadow: 0 0 3px 1px rgba(0,0,0,0.1);
|
4
|
-
border-radius: 5px;
|
5
|
-
overflow: hidden;
|
6
|
-
margin-bottom: 10px;
|
7
|
-
}
|
8
|
-
.scrivito-accordion-title {
|
9
|
-
background-color: whitesmoke;
|
10
|
-
padding: 10px 15px;
|
11
|
-
font-size: 16px;
|
12
|
-
cursor: pointer;
|
13
|
-
&:hover {
|
14
|
-
background-color: #d9d9d9;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
.scrivito-accordion-content {
|
18
|
-
display: none;
|
19
|
-
padding: 10px 15px;
|
20
|
-
position: static;
|
21
|
-
}
|
22
|
-
.scrivito-accordion-content.scrivito-accordion-active {
|
23
|
-
display: block;
|
24
|
-
}
|
25
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
class CreateAccordionWidget < ::Scrivito::Migration
|
2
|
-
def up
|
3
|
-
Scrivito::ObjClass.create(
|
4
|
-
name: 'AccordionWidget',
|
5
|
-
is_binary: false,
|
6
|
-
attributes: [
|
7
|
-
{
|
8
|
-
name: 'panels',
|
9
|
-
type: :widget,
|
10
|
-
},
|
11
|
-
]
|
12
|
-
)
|
13
|
-
|
14
|
-
Scrivito::ObjClass.create(
|
15
|
-
name: 'AccordionPanelWidget',
|
16
|
-
is_binary: false,
|
17
|
-
attributes: [
|
18
|
-
{
|
19
|
-
name: 'headline',
|
20
|
-
type: :string,
|
21
|
-
},
|
22
|
-
{
|
23
|
-
name: 'content',
|
24
|
-
type: :widget,
|
25
|
-
},
|
26
|
-
]
|
27
|
-
)
|
28
|
-
end
|
29
|
-
end
|