scrivito_elastic_slider_widget 0.0.4 → 0.0.5

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: e6f29229a0b9c3fc7fbea155f31f0433be263d0b
4
- data.tar.gz: 5e890b4310359e2fcf75715f33de9011876cd173
3
+ metadata.gz: 3327448bde84b1403e41a79b4c1803d2b22bc69a
4
+ data.tar.gz: 1d971436ac580e42f1eed58ccdf7d5e574d2a359
5
5
  SHA512:
6
- metadata.gz: 543078f704cb52931fa44a9646d70f38db8b477f87ded4415cef46e5dc7e99728beb32292a30fc1597da1c31ea533c2f53c33acc4e840c2d12ba33bc62bbe9ca
7
- data.tar.gz: bfa0b364a5b44aab63a81aa8acc366b808b28b2292d52b3b3ad36986c39cb85028955cd426212cca8742e211bea17b83d76aa1d1aba7324747d7846d8e5c1ab3
6
+ metadata.gz: 9b53ee1715c2f9b14695b4d22723a963ead69dc8f56d8467d5e8879782688028f0a839f812f4b21d5f6148eb94acfcb2ef0da540b3618c6ce9567688ecf3ce5a
7
+ data.tar.gz: 49b208126ce26fe38607c3d22a69a0ee47ed1f0aee37aaa23791d981de089d73dcb3f873d3474e3085bc819c773a192013520b222ce0ffedda8a7906ccceb60d
@@ -1,7 +1,12 @@
1
- $(".scrivito_elastic_slider_widget_add-new-panel").bind("click", function(e) {
2
- e.preventDefault();
3
- $.get("/scrivito_elastic_slider_widget/add_new_panel?obj=" + scrivito.obj.current_page.id() + "&widget=" + $(this).attr("widgetid"), function(data) {
4
- location.reload();
5
- });
1
+ $(function() {
2
+ $("body").on("click", ".scrivito_elastic_slider_widget_add-new-panel", function(e) {
3
+ e.preventDefault();
4
+ var pageid = $(this).attr("pageid");
5
+ var widgetid = $(this).attr("widgetid");
6
+ $.get("/scrivito_elastic_slider_widget/add_new_panel?obj=" + pageid + "&widget=" + widgetid, function(data) {
7
+ // TBD: trigger("scrivito_reload") is deprecated but new method wasn't yet documented in March '15
8
+ $("#carousel" + widgetid).trigger("scrivito_reload");
9
+ });
6
10
 
7
- });
11
+ });
12
+ });
@@ -1,22 +1,3 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
16
-
17
- /* Carousel
18
- ================================================== */
19
-
20
1
  .carousel-inner .item {height:400px;}
21
2
  .carousel-inner .item > img,
22
3
  .carousel-inner .item > a > img { display: block; height: auto; line-height: 1; min-width: 1200px; width: 100%;}
@@ -1,11 +1,24 @@
1
- /* Editing styles for the Elastic Slider */
2
-
3
- /* basic display settings */
4
-
5
- body[data-scrivito-display-mode='editing'] .carousel {padding-top: 30px;}
6
-
7
1
  /* additional tools */
8
- .scrivito_elastic_slider_widget_add-new-panel {background-color: #439439; color: white; display: block; padding: 0 5px; position: absolute; right: 120px; top: 0;}
2
+ .scrivito_elastic_slider_widget_add-new-panel {
3
+ background-color: #33312d;
4
+ color: white;
5
+ display: block;
6
+ padding: 5px;
7
+ position: absolute;
8
+ left: 10px;
9
+ top: 10px;
10
+ z-index: 1;
11
+ width: auto;
12
+ height: 24px;
13
+ font-size: 15px;
14
+ line-height: 15px;
15
+ text-align: center;
16
+ cursor: pointer;
17
+ }
18
+
19
+ .scrivito_elastic_slider_widget_add-new-panel * {
20
+ margin-right: 5px;
21
+ }
9
22
 
10
23
  /* Details view */
11
24
  .details-view .item {display: block; height: 100px; margin-bottom: 10px; overflow: hidden;}
@@ -1,3 +1,4 @@
1
+ <!-- leaving the first part in because I may have to rewrite this -->
1
2
  <!-- div class="details-view" data-scrivito-modal-size="large">
2
3
  <% widget.panels.each_with_index do |panel, index| %>
3
4
  <% unless index == 0 %>
@@ -1,7 +1,9 @@
1
1
  <!-- Carousel -->
2
2
  <div id="carousel<%= widget.id %>" class="carousel slide" data-ride="carousel">
3
3
  <% if scrivito_in_editable_view? %>
4
- <%= link_to "Add new Panel", "#", widgetid: widget.id, class: "scrivito_elastic_slider_widget_add-new-panel" %>
4
+ <div pageid="<%= @obj.id %>" widgetid="<%= widget.id %>" class="scrivito_elastic_slider_widget_add-new-panel">
5
+ <%= content_tag(:i, '', class: 'fa fa-plus') + "new panel" %>
6
+ </div>
5
7
  <% end %>
6
8
  <ol class="carousel-indicators">
7
9
  <% (0..widget.panels.size-1).each do |index| %>
@@ -1,3 +1,3 @@
1
1
  module ScrivitoElasticSliderWidget
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -0,0 +1,21 @@
1
+ class CreateElasticSliderWidget < ::Scrivito::Migration
2
+ def up
3
+ Scrivito::ObjClass.create(
4
+ name: 'ElasticSliderWidget',
5
+ is_binary: false,
6
+ attributes: [
7
+ {name: 'panels', type: :widget},
8
+ ]
9
+ )
10
+ Scrivito::ObjClass.create(
11
+ name: 'ElasticSliderPanelWidget',
12
+ is_binary: false,
13
+ attributes: [
14
+ {name: 'image', type: :reference},
15
+ {name: 'headline', type: :string },
16
+ {name: 'content', type: :text},
17
+ {name: 'button', type: :link},
18
+ ]
19
+ )
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_elastic_slider_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-21 00:00:00.000000000 Z
11
+ date: 2015-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,6 +83,7 @@ files:
83
83
  - lib/scrivito_elastic_slider_widget/engine.rb
84
84
  - lib/scrivito_elastic_slider_widget/version.rb
85
85
  - lib/tasks/scrivito_elastic_slider_tasks.rake
86
+ - scrivito/migrate/0_create_elastic_slider_widget.rb
86
87
  homepage: https://www.scrivito.com
87
88
  licenses:
88
89
  - LGPL-3.0