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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +21 -21
- data/app/assets/javascripts/coupdoeil.js +132 -132
- data/app/assets/javascripts/coupdoeil.min.js +1 -1
- data/app/assets/javascripts/coupdoeil.min.js.map +1 -1
- data/app/assets/stylesheets/coupdoeil/popover-animation.css +44 -0
- data/app/assets/stylesheets/coupdoeil/popover-arrow.css +39 -0
- data/app/assets/stylesheets/coupdoeil/popover.css +84 -0
- data/app/controllers/coupdoeil/{hovercards_controller.rb → popovers_controller.rb} +13 -13
- data/app/helpers/coupdoeil/application_helper.rb +4 -4
- data/app/javascript/coupdoeil/elements/coupdoeil_element.js +13 -13
- data/app/javascript/coupdoeil/events/onclick.js +36 -36
- data/app/javascript/coupdoeil/events/onmouseover.js +52 -52
- data/app/javascript/coupdoeil/events.js +4 -4
- data/app/javascript/coupdoeil/index.js +1 -1
- data/app/javascript/coupdoeil/{hovercard → popover}/attributes.js +3 -3
- data/app/javascript/coupdoeil/popover/cache.js +22 -0
- data/app/javascript/coupdoeil/{hovercard → popover}/closing.js +18 -18
- data/app/javascript/coupdoeil/{hovercard → popover}/config.js +6 -6
- data/app/javascript/coupdoeil/popover/controller.js +20 -0
- data/app/javascript/coupdoeil/popover/current.js +13 -0
- data/app/javascript/coupdoeil/{hovercard → popover}/opening.js +26 -26
- data/app/javascript/coupdoeil/{hovercard → popover}/optionsParser.js +5 -5
- data/app/javascript/coupdoeil/{hovercard → popover}/positioning.js +2 -2
- data/app/javascript/coupdoeil/popover/state_check.js +12 -0
- data/app/models/coupdoeil/params.rb +4 -4
- data/app/models/coupdoeil/{hovercard → popover}/option/animation.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/cache.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/loading.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/offset.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/opening_delay.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/placement.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option/trigger.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/option.rb +1 -1
- data/app/models/coupdoeil/{hovercard → popover}/options_set.rb +1 -1
- data/app/models/coupdoeil/{hovercard → popover}/registry.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/setup.rb +2 -2
- data/app/models/coupdoeil/{hovercard → popover}/view_context_delegation.rb +3 -3
- data/app/models/coupdoeil/{hovercard.rb → popover.rb} +8 -8
- data/app/models/coupdoeil/tag.rb +15 -15
- data/app/style/{hovercard-animation.scss → popover-animation.scss} +7 -7
- data/app/style/popover-arrow.scss +40 -0
- data/app/style/popover.scss +2 -0
- data/config/routes.rb +1 -1
- data/lib/coupdoeil/engine.rb +8 -8
- data/lib/coupdoeil/version.rb +1 -1
- data/lib/generators/coupdoeil/install/install_generator.rb +8 -8
- data/lib/generators/coupdoeil/install/templates/layout.html.erb.tt +1 -1
- data/lib/generators/coupdoeil/popover/USAGE +15 -0
- data/lib/generators/coupdoeil/popover/popover_generator.rb +22 -0
- data/lib/generators/coupdoeil/{hovercard/templates/hovercard.rb.tt → popover/templates/popover.rb.tt} +1 -1
- metadata +39 -39
- data/app/assets/stylesheets/coupdoeil/hovercard-animation.css +0 -44
- data/app/assets/stylesheets/coupdoeil/hovercard-arrow.css +0 -39
- data/app/assets/stylesheets/coupdoeil/hovercard.css +0 -84
- data/app/javascript/coupdoeil/hovercard/cache.js +0 -22
- data/app/javascript/coupdoeil/hovercard/controller.js +0 -20
- data/app/javascript/coupdoeil/hovercard/current.js +0 -13
- data/app/javascript/coupdoeil/hovercard/state_check.js +0 -12
- data/app/style/hovercard-arrow.scss +0 -40
- data/app/style/hovercard.scss +0 -2
- data/lib/generators/coupdoeil/hovercard/USAGE +0 -15
- data/lib/generators/coupdoeil/hovercard/hovercard_generator.rb +0 -22
- /data/app/javascript/coupdoeil/{hovercard → popover}/actions.js +0 -0
- /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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed6dba2c7479bf3bc8c8bc7a7dc64ff2337e48bfcc73f1676155b299397abfa7
|
4
|
+
data.tar.gz: 517aedf83960f882ded74e7c1ff9af8aa8fcf965c5a708ea764b1fb481af8752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dcbb4dffc044a7b211ab4e34b0b174ed4a1af787f9838ec16de7c5295c359f0646e161d0562c2bd7971cac655edbaaefac98b184b3dd0a62e6474052351e158
|
7
|
+
data.tar.gz: abed2844c081804342c98eddb10898bf74a1f2c8341c232c809c04474e91bc5577b8f48ece9be506309eaa8f2cf75c7472ba8dcb0e51e9881c646f3d8fec8755
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
# Coupdoeil
|
2
2
|
[](https://badge.fury.io/rb/coupdoeil)
|
3
3
|
|
4
|
-
A framework to easily handle
|
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::
|
11
|
+
### What is a Coupdoeil::Popover?
|
12
12
|
|
13
|
-
|
14
|
-
They are mostly inspired by GitHub
|
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="
|
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="
|
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/
|
32
|
-
class
|
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/
|
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
|
-
<%=
|
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
|
60
|
+
### Why use Coupdoeil popovers?
|
61
61
|
|
62
|
-
The concept of 'quick look' allowed by
|
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
|
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::
|
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
|
76
|
-
the user's mouse quickly leaving and re-entering
|
77
|
-
preventing opening of an
|
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
|
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
|
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,
|
85
|
+
Also, popovers are cached so the fetch happens only the first time an popover is open.
|
86
86
|
|
87
|
-
When needed,
|
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)
|