coupdoeil 1.0.0.pre.beta.1 → 1.0.0.pre.beta.2

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/README.md +21 -21
  4. data/app/assets/javascripts/coupdoeil.js +132 -132
  5. data/app/assets/javascripts/coupdoeil.min.js +1 -1
  6. data/app/assets/javascripts/coupdoeil.min.js.map +1 -1
  7. data/app/assets/stylesheets/coupdoeil/popover-animation.css +44 -0
  8. data/app/assets/stylesheets/coupdoeil/popover-arrow.css +39 -0
  9. data/app/assets/stylesheets/coupdoeil/popover.css +84 -0
  10. data/app/controllers/coupdoeil/{hovercards_controller.rb → popovers_controller.rb} +13 -13
  11. data/app/helpers/coupdoeil/application_helper.rb +4 -4
  12. data/app/javascript/coupdoeil/elements/coupdoeil_element.js +13 -13
  13. data/app/javascript/coupdoeil/events/onclick.js +36 -36
  14. data/app/javascript/coupdoeil/events/onmouseover.js +52 -52
  15. data/app/javascript/coupdoeil/events.js +4 -4
  16. data/app/javascript/coupdoeil/index.js +1 -1
  17. data/app/javascript/coupdoeil/{hovercard → popover}/attributes.js +3 -3
  18. data/app/javascript/coupdoeil/popover/cache.js +22 -0
  19. data/app/javascript/coupdoeil/{hovercard → popover}/closing.js +18 -18
  20. data/app/javascript/coupdoeil/{hovercard → popover}/config.js +6 -6
  21. data/app/javascript/coupdoeil/popover/controller.js +20 -0
  22. data/app/javascript/coupdoeil/popover/current.js +13 -0
  23. data/app/javascript/coupdoeil/{hovercard → popover}/opening.js +26 -26
  24. data/app/javascript/coupdoeil/{hovercard → popover}/optionsParser.js +5 -5
  25. data/app/javascript/coupdoeil/{hovercard → popover}/positioning.js +2 -2
  26. data/app/javascript/coupdoeil/popover/state_check.js +12 -0
  27. data/app/models/coupdoeil/params.rb +4 -4
  28. data/app/models/coupdoeil/{hovercard → popover}/option/animation.rb +2 -2
  29. data/app/models/coupdoeil/{hovercard → popover}/option/cache.rb +2 -2
  30. data/app/models/coupdoeil/{hovercard → popover}/option/loading.rb +2 -2
  31. data/app/models/coupdoeil/{hovercard → popover}/option/offset.rb +2 -2
  32. data/app/models/coupdoeil/{hovercard → popover}/option/opening_delay.rb +2 -2
  33. data/app/models/coupdoeil/{hovercard → popover}/option/placement.rb +2 -2
  34. data/app/models/coupdoeil/{hovercard → popover}/option/trigger.rb +2 -2
  35. data/app/models/coupdoeil/{hovercard → popover}/option.rb +1 -1
  36. data/app/models/coupdoeil/{hovercard → popover}/options_set.rb +1 -1
  37. data/app/models/coupdoeil/{hovercard → popover}/registry.rb +2 -2
  38. data/app/models/coupdoeil/{hovercard → popover}/setup.rb +2 -2
  39. data/app/models/coupdoeil/{hovercard → popover}/view_context_delegation.rb +3 -3
  40. data/app/models/coupdoeil/{hovercard.rb → popover.rb} +8 -8
  41. data/app/models/coupdoeil/tag.rb +15 -15
  42. data/app/style/{hovercard-animation.scss → popover-animation.scss} +7 -7
  43. data/app/style/popover-arrow.scss +40 -0
  44. data/app/style/popover.scss +2 -0
  45. data/config/routes.rb +1 -1
  46. data/lib/coupdoeil/engine.rb +8 -8
  47. data/lib/coupdoeil/version.rb +1 -1
  48. data/lib/generators/coupdoeil/install/install_generator.rb +8 -8
  49. data/lib/generators/coupdoeil/install/templates/layout.html.erb.tt +1 -1
  50. data/lib/generators/coupdoeil/popover/USAGE +15 -0
  51. data/lib/generators/coupdoeil/popover/popover_generator.rb +22 -0
  52. data/lib/generators/coupdoeil/{hovercard/templates/hovercard.rb.tt → popover/templates/popover.rb.tt} +1 -1
  53. metadata +39 -39
  54. data/app/assets/stylesheets/coupdoeil/hovercard-animation.css +0 -44
  55. data/app/assets/stylesheets/coupdoeil/hovercard-arrow.css +0 -39
  56. data/app/assets/stylesheets/coupdoeil/hovercard.css +0 -84
  57. data/app/javascript/coupdoeil/hovercard/cache.js +0 -22
  58. data/app/javascript/coupdoeil/hovercard/controller.js +0 -20
  59. data/app/javascript/coupdoeil/hovercard/current.js +0 -13
  60. data/app/javascript/coupdoeil/hovercard/state_check.js +0 -12
  61. data/app/style/hovercard-arrow.scss +0 -40
  62. data/app/style/hovercard.scss +0 -2
  63. data/lib/generators/coupdoeil/hovercard/USAGE +0 -15
  64. data/lib/generators/coupdoeil/hovercard/hovercard_generator.rb +0 -22
  65. /data/app/javascript/coupdoeil/{hovercard → popover}/actions.js +0 -0
  66. /data/app/javascript/coupdoeil/{hovercard.js → popover.js} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0fd9529e23fb3e0e07534e4a893267f34f1759ad0da9f66c28f3e06598d8064
4
- data.tar.gz: 921bbe9b79fd87200f309b6e3ec7ed2650871bc66943cffdf4b6c726bf2e7de0
3
+ metadata.gz: ed6dba2c7479bf3bc8c8bc7a7dc64ff2337e48bfcc73f1676155b299397abfa7
4
+ data.tar.gz: 517aedf83960f882ded74e7c1ff9af8aa8fcf965c5a708ea764b1fb481af8752
5
5
  SHA512:
6
- metadata.gz: df7d9f69c35d3ec782694c8cad41d16714542d252883576e7c65551e451d9cdc382c5bc4c2c02fbe322c4d0c721e65a595e4b8b65cf43655fa41beecb115ae82
7
- data.tar.gz: 2cc87dbc76fd8579845913cd230409071c902bd8f4a3b91caff504ab6bb0c066b17f77caebe2f99c4a6ed5a0a956918a7023595e4b24cbb671741eb8698b708b
6
+ metadata.gz: 0dcbb4dffc044a7b211ab4e34b0b174ed4a1af787f9838ec16de7c5295c359f0646e161d0562c2bd7971cac655edbaaefac98b184b3dd0a62e6474052351e158
7
+ data.tar.gz: abed2844c081804342c98eddb10898bf74a1f2c8341c232c809c04474e91bc5577b8f48ece9be506309eaa8f2cf75c7472ba8dcb0e51e9881c646f3d8fec8755
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ### v1.0.0-beta.2
4
+ - change hovercard naming for popover
5
+
3
6
  ### v1.0.0-beta.1
4
7
  - fix path helpers in hovercard templates
5
8
  - fix call to clearHovercard in closing.js
data/README.md CHANGED
@@ -1,35 +1,35 @@
1
1
  # Coupdoeil
2
2
  [![Gem Version](https://badge.fury.io/rb/coupdoeil.svg?icon=si%3Arubygems&icon_color=%23ff2600)](https://badge.fury.io/rb/coupdoeil)
3
3
 
4
- A framework to easily handle hovercards.
4
+ A framework to easily handle popovers.
5
5
 
6
6
  ## Documentation
7
7
  See [coupdoeil.org](https://coupdoeil.org) for full documentation.
8
8
 
9
9
  ## Overview
10
10
 
11
- ### What is a Coupdoeil::Hovercard?
11
+ ### What is a Coupdoeil::Popover?
12
12
 
13
- Hovercards are ruby objects used to easily build powerful popups (from basic tooltips to full dialog hovercards).
14
- They are mostly inspired by GitHub hovercards (like hovering on a link to a repo, or a username)
13
+ Popovers are ruby objects used to easily build powerful popups (from basic tooltips to full dialog popovers).
14
+ They are mostly inspired by GitHub popovers (like hovering on a link to a repo, or a username)
15
15
  and Wikipedia popups (when hovering a link to another wikipedia article).
16
16
 
17
17
  Click to toggle examples
18
18
  <details>
19
19
  <summary><i>A quick look on a contact details</i></summary>
20
- <img src="https://coupdoeil.org/overview-example.gif" alt="hovercard example" />
20
+ <img src="https://coupdoeil.org/overview-example.gif" alt="popover example" />
21
21
  </details>
22
22
  <details>
23
23
  <summary><i>A form in a popup</i></summary>
24
- <img src="https://coupdoeil.org/overview-example-2.gif" alt="hovercard example" />
24
+ <img src="https://coupdoeil.org/overview-example-2.gif" alt="popover example" />
25
25
  </details>
26
26
  [See more use-cases](https://coupdoeil.org/case-studies.html)
27
27
 
28
28
  The current implementation takes inspiration from both ViewComponent and ActionMailer, to make it as easy as possible to use while offering a wide range of possibilities.
29
29
 
30
30
  ```ruby
31
- # app/hovercards/contact_hovercard.rb
32
- class ContactHovercard < Coupdoeil::Hovercard
31
+ # app/popovers/contact_popover.rb
32
+ class ContactPopover < Coupdoeil::Popover
33
33
  def details
34
34
  @contact = params[:contact]
35
35
  end
@@ -37,7 +37,7 @@ end
37
37
  ```
38
38
 
39
39
  ```erb
40
- <%# app/hovercards/contact_hovercard/details.html.erb %>
40
+ <%# app/popovers/contact_popover/details.html.erb %>
41
41
  <div class="contact-details">
42
42
  <%= image_tag @contact.avatar %>
43
43
  <strong><%= @contact.first_name %> <%= @contact.last_name %></strong>
@@ -51,40 +51,40 @@ Which is embedded by doing so:
51
51
  <%# app/views/messages/show.html.erb %>
52
52
  <div>
53
53
  <span>From: </span>
54
- <%= coupdoeil_hovercard_tag ContactHovercard.with(contact: @contact).details do %>
54
+ <%= coupdoeil_popover_tag ContactPopover.with(contact: @contact).details do %>
55
55
  <span class="contact-pill"><%= @contact.email %></span>
56
56
  <% end %>
57
57
  </div>
58
58
  ```
59
59
 
60
- ### Why use Coupdoeil hovercards?
60
+ ### Why use Coupdoeil popovers?
61
61
 
62
- The concept of 'quick look' allowed by hovercards can really improve UX by avoiding the need to navigate to another page and back again just to check summary for a resource.
62
+ The concept of 'quick look' allowed by popovers can really improve UX by avoiding the need to navigate to another page and back again just to check summary for a resource.
63
63
  It also permits to hiding until use some parts of UI like small forms, or quick actions in a list of elements.
64
64
 
65
- The most common examples of such hovercard are on GitHub (when hovering over a link to a repo, user profile, a PR, etc.) or on
65
+ The most common examples of such popover are on GitHub (when hovering over a link to a repo, user profile, a PR, etc.) or on
66
66
  Wikipedia (when hovering over a link to another article).
67
67
 
68
68
  While basic popups implementations can be made with simple helpers, data-attributes, and a bit of JavaScript,
69
69
  it tends to get too complex over time and often not handle enough edge-cases to be used everywhere it could improve UX.
70
70
 
71
- `Coupdoeil::Hovercard` offers a way to easily encapsulate and power up hovercards rendering logic.
71
+ `Coupdoeil::Popover` offers a way to easily encapsulate and power up popovers rendering logic.
72
72
  It allows a lot of customization possibilities (see [options](https://coupdoeil.org/opts.html)) and promotes re-usability by using an API similar to
73
73
  parameterized ActionMailer (see [Why does it look like a mailer?](https://coupdoeil.org/architectural-decisions.html#why-does-it-look-like-a-mailer)).
74
74
 
75
- This gem also tries to handle all known issues of such hovercards, such as
76
- the user's mouse quickly leaving and re-entering hovercard without closing it,
77
- preventing opening of an hovercard if mouse did not stop on it, etc.
75
+ This gem also tries to handle all known issues of such popovers, such as
76
+ the user's mouse quickly leaving and re-entering popover without closing it,
77
+ preventing opening of an popover if mouse did not stop on it, etc.
78
78
 
79
79
  ### Performances
80
80
 
81
- By default, an hovercard content is not loaded until it is needed.
81
+ By default, an popover content is not loaded until it is needed.
82
82
  It means the DOM is not cluttered with 'maybe to be used' HTML, hidden in template tags or data-attributes.
83
- However, params have to be present in HTML so they are sent for rendering the hovercard (eg: a record id),
83
+ However, params have to be present in HTML so they are sent for rendering the popover (eg: a record id),
84
84
  so try passing as few as required to build it later during render.
85
- Also, hovercards are cached so the fetch happens only the first time an hovercard is open.
85
+ Also, popovers are cached so the fetch happens only the first time an popover is open.
86
86
 
87
- When needed, hovercards can still be preloaded and included in DOM on initial page load. See [preload option](https://coupdoeil.org/options/loading.html).
87
+ When needed, popovers can still be preloaded and included in DOM on initial page load. See [preload option](https://coupdoeil.org/options/loading.html).
88
88
 
89
89
  ## Licence
90
90
  Coupdoeil is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT)