sibu 0.1.31 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4ce5724416f6921c5a4529d03b9291ffd80876b
4
- data.tar.gz: f06dee1f7ecd38a5482fe94b7dbe613f59780894
3
+ metadata.gz: de5cda6f4ef051d7e724abb03090d7cb7057edba
4
+ data.tar.gz: 0d768bddd8641ec038babb501e9d7a9b78f1e60b
5
5
  SHA512:
6
- metadata.gz: 13b0f98002eda8b9fd1af7d8e0fd51f867dada1b1eaa8b1975b6d6b82008d7703fe11aed808a853fb207303482b5eb410367d5e671d70ae0b089d52037b9fc7c
7
- data.tar.gz: c018e9f2c7c125eb60342a403943d28f9245ea6575e55b63f27e9e273d36d15d25466cc3998774ae98070af4282e67b34cdd58a27ef4eb42a56eb6f218b94e6d
6
+ metadata.gz: 473a8590fe208a18be9f598bc0f5d3cbbdb712d631c135b71e95e65547999dd4da57e9d9b9c2a9027e7a5a072d63704727ad0e060d19793e57295e675664e8f3
7
+ data.tar.gz: 80adac713e3c3bedf4da2a37a3941403fc546b434b6997e24dc2262388fb128b4f601cc3b4a623f29365e9bd8adbfe0727263a0383746f78f50f2d34e294acea
@@ -0,0 +1,7 @@
1
+ function sibuCallback(actionName, args) {
2
+ var callback = actionName + "SibuCallback";
3
+ console.log(callback);
4
+ if(typeof window[callback] === "function") {
5
+ window[callback](args);
6
+ }
7
+ }
@@ -1,5 +1,6 @@
1
1
  //= require jquery
2
2
  //= require jquery_ujs
3
+ //= require sibu/common
3
4
  //= require ../quill/quill
4
5
  //= require_self
5
6
 
@@ -86,7 +86,7 @@ module Sibu
86
86
  if new_section["template"].blank?
87
87
  nil
88
88
  else
89
- template_defaults = site_template.templates ? site_template.templates[new_section["template"]] : {}
89
+ template_defaults = (site_template.templates && site_template.templates[new_section["template"]]) ? site_template.templates[new_section["template"]] : {}
90
90
  sec = template_defaults.merge(new_section)
91
91
  ref_pos = parent.index {|s| s["id"] == ids.last}
92
92
  parent.insert(after.to_s == 'true' ? ref_pos + 1 : ref_pos, sec)
@@ -4,6 +4,7 @@
4
4
  <title><%= conf[:title] %></title>
5
5
  <%= stylesheet_link_tag conf[:stylesheet], media: 'all' %>
6
6
  <%= javascript_include_tag conf[:javascript] %>
7
+ <%= javascript_include_tag 'sibu/common' %>
7
8
  <%= csrf_meta_tags %>
8
9
  </head>
9
10
  <body>
@@ -14,6 +15,9 @@
14
15
  </div>
15
16
  <% end %>
16
17
  <% end %>
18
+ <script>
19
+ sibuCallback("<%= "#{action_name}_#{controller_name}".camelize(:lower) %>");
20
+ </script>
17
21
  <%= yield :scripts %>
18
22
  </body>
19
23
  </html>
@@ -44,6 +44,7 @@
44
44
 
45
45
  $(function () {
46
46
  initOverlays();
47
+ sibuCallback("editContent");
47
48
  });
48
49
 
49
50
  function setEditMode(section, overlay, left, top, width, height) {
@@ -1,6 +1,6 @@
1
1
  <div id="pages" class="sibu_view">
2
2
  <div class="actions">
3
- <%= link_to 'Télécharger une image', new_site_image_path(@site.id) %> | <%= link_to 'Retour', :back %>
3
+ <%= link_to 'Télécharger une image', new_site_image_path(@site.id) %> <%= link_to 'Retour', :back %>
4
4
  </div>
5
5
  <h2>Images du site "<%= @site.name %>"</h2>
6
6
  <% @images.each do |image| %>
@@ -57,3 +57,4 @@ $("#child_elt").remove();
57
57
  <% end %>
58
58
  editPanel.slideDown("fast");
59
59
  document.body.style.overflow = "hidden";
60
+ sibuCallback("editElement", "<%= @content_type %>");
@@ -14,4 +14,5 @@ sectionsPanel.slideDown("fast", function() {
14
14
  initSectionsForm();
15
15
  }
16
16
  });
17
- document.body.style.overflow = "hidden";
17
+ document.body.style.overflow = "hidden";
18
+ sibuCallback("newSection");
@@ -66,7 +66,7 @@
66
66
  <%= hidden_field_tag :next_page, @next_page %>
67
67
  <%= f.hidden_field :user_id %>
68
68
  <div class="sibu_actions">
69
- <%= f.submit 'Valider', data: {disable: 'Enregistrement en cours...'} %>
69
+ <%= f.submit 'Valider', data: {disable_with: 'Enregistrement en cours...'} %>
70
70
  <%= link_to 'Annuler', :back %>
71
71
  </div>
72
72
  <% end %>
data/lib/sibu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.1.31'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.31
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
@@ -125,6 +125,7 @@ files:
125
125
  - app/assets/fonts/sibu/Sibu.ttf
126
126
  - app/assets/fonts/sibu/Sibu.woff
127
127
  - app/assets/javascripts/quill/quill.js
128
+ - app/assets/javascripts/sibu/common.js
128
129
  - app/assets/javascripts/sibu/sibu.js.erb
129
130
  - app/assets/stylesheets/quill/quill.snow.css
130
131
  - app/assets/stylesheets/sibu/icons.scss