sibu 0.8.3 → 0.8.4

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: 7b2770373432dab6850c3180a56ebd42af66c248
4
- data.tar.gz: 8dfa1d1647b7d938a798893e9c39d3a68d8cc39f
3
+ metadata.gz: cddd12680eea5507eda3f1b851337aab642c5a2b
4
+ data.tar.gz: 9d6cf08c38f7459d759fda9ea6456d28234d8e29
5
5
  SHA512:
6
- metadata.gz: c67407583fd247daa99dfc66d450a07985601aa1d7f28f8ef1f6cef18e0729b5f5cdf57ceba2c8c6045ee7c111ed4e0e7c8f62aea06128f779aefa007feb610e
7
- data.tar.gz: 7b9246e9424ece9f7555fa5f33af00cdb8181b2db2d649d11602080cd8c9431bdf92f8e48634c4cf3cfde22450805976dfaca5047ec8320fcb16588ac62fe74b
6
+ metadata.gz: 6998bfcfb8d923ecaa92db0e5d7e8d225153e569e307f01fdda5bd5bc38b0366743ef60f656bd552d5b1ba54a16874a4a150aafd6c27be961bf330506b2ed465
7
+ data.tar.gz: 90e2d568bf8a02310aac7cc9c8419083c3708ad6532e611c0d3c6113738937add8a6eafee93b9bebd1eaad7aba4708254501eed9a8a91ec3f24a5eaac78a1cb4
@@ -113,6 +113,7 @@ function initQuillEditor(container) {
113
113
  function initCustomCenter() {
114
114
  var wrapper = $(".sibu_center > img"), centerPos = $(".sibu_center > #sibu_center_pos");
115
115
  displayCurrentCenter(wrapper[0], centerPos);
116
+ $(".sibu_center > #sibu_center_desc").show();
116
117
  wrapper.click(function(e) {
117
118
  var rect = e.target.getBoundingClientRect();
118
119
  var x = e.clientX - rect.left;
@@ -58,6 +58,10 @@ $sibu-color3 : #333 !default;
58
58
  &.selected {
59
59
  background-color: $sibu-color3;
60
60
  }
61
+
62
+ &:hover {
63
+ cursor: pointer;
64
+ }
61
65
  }
62
66
 
63
67
  .sibu_form {
@@ -163,35 +167,6 @@ $sibu-color3 : #333 !default;
163
167
  width: 70%;
164
168
  max-height: calc(100vh - 300px);
165
169
  overflow: auto;
166
-
167
- .sibu_image {
168
- position: relative;
169
- span {
170
- position: absolute;
171
- z-index: -1;
172
- line-height: 1;
173
- width: 100%;
174
- text-align: center;
175
- top: 30px;
176
-
177
- & + .selected {
178
- background-color: transparentize($sibu-color3, 0.5);
179
- }
180
- }
181
- }
182
-
183
- img {
184
- padding: 5px;
185
- border: 1px solid $sibu-color3;
186
-
187
- &.selected {
188
- background-color: $sibu-color3;
189
- }
190
-
191
- &:hover {
192
- cursor: pointer;
193
- }
194
- }
195
170
  }
196
171
 
197
172
  .sibu_selected_image {
@@ -219,6 +194,12 @@ $sibu-color3 : #333 !default;
219
194
  color: white;
220
195
  text-shadow: 0 2px grey;
221
196
  }
197
+
198
+ #sibu_center_desc {
199
+ font-size: 10px;
200
+ line-height: 1.2;
201
+ margin-top: 5px;
202
+ }
222
203
  }
223
204
  }
224
205
 
@@ -7,13 +7,29 @@
7
7
  <div class="sibu_select_images sibu_field">
8
8
  <p>Sélectionnez ou <%= link_to 'téléchargez', new_image_path(page_id: @page.id, section_id: @section_id, entity_type: @entity_type,
9
9
  element_id: @element_id, img_id: @element["id"], size: @size) %> une image</p>
10
- <% site_images.each_with_index do |image, i| %>
11
- <div class="sibu_image" data-img-id="<%= image.id %>">
12
- <% if i == 0 %><span>Aucune image</span><% end %>
13
- <%= image_tag image.file_url(:small), class: (@element["src"] == image.file_url(@size) ? 'selected' : ''),
14
- data: {src: image.file_url(@size), alt: image.alt} %>
15
- </div>
16
- <% end %>
10
+ <table class="sibu_images">
11
+ <thead>
12
+ <tr>
13
+ <th>Aperçu</th>
14
+ <th>Descriptif</th>
15
+ <th>Crédits</th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <% site_images.each do |image| %>
20
+ <tr>
21
+ <td>
22
+ <span class="sibu_image" data-img-id="<%= image.id %>">
23
+ <%= image_tag image.file_url(:small), class: (@element["src"] == image.file_url(@size) ? 'selected' : ''),
24
+ data: {src: image.file_url(@size), alt: image.alt} %>
25
+ </span>
26
+ </td>
27
+ <td><%= image.alt %></td>
28
+ <td><%= image.credits %></td>
29
+ </tr>
30
+ <% end %>
31
+ </tbody>
32
+ </table>
17
33
  </div>
18
34
  <div class="sibu_selected_image">
19
35
  <% if @element["src"] == DEFAULT_IMG || @element["src"].blank? %>
@@ -26,6 +42,7 @@
26
42
  <div class="sibu_center">
27
43
  <%= image_tag(@element["src"]) unless @element["src"] == DEFAULT_IMG || @element["src"].blank? %>
28
44
  <div id="sibu_center_pos" style="display: none;">✕</div>
45
+ <div id="sibu_center_desc" style="display: none;"><em>Cliquez sur l'image pour la recentrer sur un point donné (à utiliser lorsque l'image est tronquée car la zone d'affichage est trop petite).</em></div>
29
46
  </div>
30
47
  <div class="sibu_field" style="display: <%= (@element["src"] == DEFAULT_IMG || @element["src"].blank?) ? 'none' : 'block' %>">
31
48
  <%= label_tag 'element[alt]', 'Légende / texte alternatif' %>
@@ -38,15 +38,19 @@ editPanel.slideDown("fast", function() {
38
38
  "text-align": wrapper.css("text-align")
39
39
  });
40
40
  <% when 'media' %>
41
- var images = editPanel.find(".sibu_image img");
42
- var customCenter = $("#custom_center"), customCtr;
41
+ var images = editPanel.find(".sibu_image");
42
+ var customCenter = $("#custom_center");
43
43
  images.click(function() {
44
44
  if(!$(this).hasClass('selected')) {
45
45
  images.removeClass('selected');
46
46
  $(this).addClass('selected');
47
- $("#element_src").val($(this).data("src"));
48
- $("#element_alt").val($(this).data("alt"));
49
- editPanel.find(".sibu_center").html('<img src="' + $("#element_src").val() + '"/><div id="sibu_center_pos" style="display: none;">✕</div>');
47
+ var imgElt = $(this).find("img");
48
+ $("#element_src").val(imgElt.data("src"));
49
+ $("#element_alt").val(imgElt.data("alt"));
50
+ editPanel.find(".sibu_center").html(
51
+ '<img src="' + $("#element_src").val() + '"/>' +
52
+ '<div id="sibu_center_pos" style="display: none;">✕</div>' +
53
+ '<div id="sibu_center_desc" style="display: none;"><em>Cliquez sur l\'image pour la recentrer sur un point donné (à utiliser lorsque l\'image est tronquée car la zone d\'affichage est trop petite)</em></div>');
50
54
  editPanel.find(".sibu_selected_image > p:first-child").hide();
51
55
  editPanel.find(".sibu_selected_image").find(".sibu_custom_center").show();
52
56
  editPanel.find(".sibu_selected_image").find(".sibu_field").show();
@@ -69,6 +73,7 @@ editPanel.slideDown("fast", function() {
69
73
  $("#element_class").val("");
70
74
  $(".sibu_center").attr("style", "");
71
75
  $(".sibu_center > #sibu_center_pos").hide();
76
+ $(".sibu_center > #sibu_center_desc").hide();
72
77
  }
73
78
  });
74
79
  <% when 'link' %>
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.8.3'
2
+ VERSION = '0.8.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-18 00:00:00.000000000 Z
11
+ date: 2019-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails