drive 0.15.0 → 0.17.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
  SHA256:
3
- metadata.gz: 0e30f8466f1e9a247348f1139fc5e0d6715328efe23ade1017b278c332c51cb1
4
- data.tar.gz: 0d56d490a3b5a791b62138e8643865691eba0f0fa527affd6cf593a7f295d133
3
+ metadata.gz: 8578690e477feee9d2e1d7f1bee314192de30a35adbbee71ab4c2701c8be8150
4
+ data.tar.gz: 5b7bb3d5c598ccf0576170520243d5095e8c5dd70fa0a4dadadd972a3531aaba
5
5
  SHA512:
6
- metadata.gz: 050be52a55e1f0fb4ccd11f1c3d699ad85d1839795d6b49139c49c40e19e6ffd3586f57db85084bac38e8f2184cd5c97482a14aeb12d5a130c3ca944305ae0db
7
- data.tar.gz: 64cf867baad5eb66436cdeecbae091597b5f8e21e397b1c4579d15a1000fcfa0ad07d301971b46e28fff8de9d9c4c06a3d6a281dd80fe24a9d09ed70742b68a4
6
+ metadata.gz: 42e6b99c7586b679f5a79a9bcc19e7cc6d6b34398db56ace0c93803510623ca3802f213ec7f7e22f897f6da52615d438d03d08e287557b69f8881020c710f354
7
+ data.tar.gz: ef48882a4c7e1973341568cb65c19cc1709e984d346b10feab1830fa7bd8c68cb7cf8871fed60b21910fe4203fdd73f3f3d53985efd91761764b2c89755522b1
data/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## 0.17.0 - 2026-11-06
10
+
11
+ * [FEATURE] `render layout: "easy/modal", locals: { id:, title:, close: }` (`open:`, `emoji:`, `classes:`) and
12
+ `easy/modal.js`: a dialog that always lets its reader out, its × and Esc closing it in place (the address becoming
13
+ the ×'s), the × a plain link without the script. A dialog closed by its #id opens again on a link to it.
14
+
15
+ ## 0.16.0 - 2026-11-06
16
+
17
+ * [FEATURE] `easy/mailer/code` (HTML and text): the email carrying a 6-digit code, the same from every easy app, the
18
+ design of easyfaa.com's sign-in email. The code is selected whole by one click or tap, and sits in plain digits next
19
+ to the word "code" (and in the inbox's preview), as Apple Mail, iOS and Gmail look for it to offer it to the field.
20
+
9
21
  ## 0.15.0 - 2026-11-06
10
22
 
11
23
  * [FEATURE] `render "easy/pin_code", name:` (`id:`, `autofocus:`, `label:`) and `easy/pin_code.js`: the 6-digit code as
@@ -0,0 +1,46 @@
1
+ // Every dialog of render "easy/modal" lets its reader out: its × or Esc closes it where it is, without loading a page,
2
+ // and the address becomes the × link's (the page without what opened it), or loses the #id that opened it. A link to
3
+ // that #id opens it again. Without the script, the × is a plain link.
4
+ // ES5 alone: every easy app has to work on old iPhones, Androids and Windows browsers.
5
+ (function () {
6
+ if (!document.querySelector || !document.addEventListener) { return; }
7
+
8
+ function close(modal) {
9
+ var link = modal.querySelector('.modal-x'), href = link && link.getAttribute('href');
10
+ modal.className = modal.className.replace(/\s*\bis-open\b/g, '') + ' is-closed';
11
+ if (!window.history || !history.replaceState) { return; }
12
+ if (href && href.charAt(0) !== '#') { history.replaceState(null, '', href + location.hash); }
13
+ else if (location.hash === '#' + modal.id) { history.replaceState(null, '', location.pathname + location.search); }
14
+ }
15
+
16
+ // The dialog showing: drawn open, or the one the address's #id names.
17
+ function shown() {
18
+ var target = location.hash.length > 1 && document.getElementById(location.hash.slice(1));
19
+ var open = document.querySelector('.modal.is-open');
20
+ if (open) { return open; }
21
+ return target && /(^|\s)modal(\s|$)/.test(target.className) && !/\bis-closed\b/.test(target.className) ? target : null;
22
+ }
23
+
24
+ // The node or its nearest ancestor with the class: old browsers have no closest().
25
+ function up(node, name) {
26
+ var pattern = new RegExp('(^|\\s)' + name + '(\\s|$)');
27
+ while (node && node.nodeType === 1 && !pattern.test(node.className)) { node = node.parentNode; }
28
+ return node && node.nodeType === 1 ? node : null;
29
+ }
30
+
31
+ document.addEventListener('click', function (event) {
32
+ var x = up(event.target, 'modal-x'), modal = x && up(x, 'modal');
33
+ if (!modal) { return; }
34
+ event.preventDefault();
35
+ close(modal);
36
+ });
37
+ document.addEventListener('keydown', function (event) {
38
+ if (event.key !== 'Escape' && event.key !== 'Esc' && event.keyCode !== 27) { return; }
39
+ var modal = shown();
40
+ if (modal) { event.preventDefault(); close(modal); }
41
+ });
42
+ window.addEventListener('hashchange', function () {
43
+ var target = location.hash.length > 1 && document.getElementById(location.hash.slice(1));
44
+ if (target) { target.className = target.className.replace(/\s*\bis-closed\b/g, ''); }
45
+ });
46
+ })();
@@ -171,6 +171,7 @@ ol.ad-card-list.js-live li.ad-card.superseded{display:block}
171
171
  /* modal: a dialog; tooltip: a hover or tap explanation; pin-code: the six-digit code */
172
172
  .modal{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;background:rgba(11,30,58,.55);align-items:center;justify-content:center;padding:16px}
173
173
  .modal:target,.modal.is-open{display:flex}
174
+ .modal.is-closed:not(.is-open){display:none}
174
175
  .modal-box{position:relative;width:100%;max-width:760px;max-height:100%;overflow:auto;background:var(--color-bg);color:var(--color-text);border-radius:18px;padding:28px 24px 24px;box-shadow:0 20px 50px rgba(0,0,0,.3)}
175
176
  .modal-box h2{font-size:22px;margin:0 32px 6px 0}
176
177
  .modal-box h2 > span[aria-hidden="true"]:first-child{margin-right:.35em}
@@ -0,0 +1,13 @@
1
+ <%# locals: (id:, title:, close:, open: false, emoji: nil, classes: nil) -%>
2
+ <%# A dialog over the page, rendered as a layout around what it holds (render layout: "easy/modal" do … end), which
3
+ always lets its reader out: its ×, Esc (easy/modal.js, which the page includes once), or without the script the
4
+ × as a link. Shown when its address's #id names it, or open: true (drawn already open, say once a form asked).
5
+ close: where the × leads, "#" for a dialog opened by its #id, the page without what opened it otherwise.
6
+ classes: the app's own, beside modal, to style what it holds. -%>
7
+ <%= tag.div id:, class: [ "modal", ("is-open" if open), classes ], role: "dialog", aria: { modal: true, labelledby: "#{id}-title" } do %>
8
+ <div class="modal-box">
9
+ <%= link_to "×", close, class: "modal-x", aria: { label: "Close" } %>
10
+ <h2 id="<%= id %>-title"><% if emoji %><span aria-hidden="true"><%= emoji %></span> <% end %><%= title %></h2>
11
+ <%= yield %>
12
+ </div>
13
+ <% end %>
@@ -0,0 +1,67 @@
1
+ <%# locals: (code:, brand:, site:, logo:, purpose:, lifetime:, ignore:, link: nil, link_label: nil, link_lede: nil, fine: nil) -%>
2
+ <%# The email carrying a 6-digit code, the same from every easy app (its text twin: _code.text.erb): the logo, then a
3
+ card whose navy head holds the code large enough to read across the room, selected whole by one click or tap.
4
+ The code is plain digits next to the word "code", in the subject too ("123456 is your easyFAA code"), with no
5
+ other run of digits near it: what Apple Mail, iOS and Gmail look for to offer it to the field that asks for it.
6
+ code: "123456"; brand: "easyFAA"; site: the app's address, under the card; logo: the URL of the brand's logo,
7
+ an inline attachment so it shows wherever the email is read; purpose: "to sign in", "to sign the airframe
8
+ logbook entry for N22196"; lifetime: "10 minutes"; ignore: what to do with an email nobody asked for.
9
+ link, link_label, link_lede: a button doing what the code does, the sentence above it; fine: under it (HTML). -%>
10
+ <% heading = %(font-family:"Outfit","Helvetica Neue",Helvetica,Arial,sans-serif;) %>
11
+ <% body = %(font-family:-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;) %>
12
+ <% host = URI(site).host %>
13
+ <!DOCTYPE html>
14
+ <html lang="en">
15
+ <head>
16
+ <meta charset="utf-8">
17
+ <meta name="viewport" content="width=device-width, initial-scale=1">
18
+ <meta name="color-scheme" content="light">
19
+ <meta name="supported-color-schemes" content="light">
20
+ <meta name="format-detection" content="telephone=no, date=no, address=no">
21
+ <title><%= code %> is your <%= brand %> code</title>
22
+ <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&amp;display=swap" rel="stylesheet">
23
+ </head>
24
+ <body style="margin:0;padding:0;background:#f1f2f3;">
25
+ <div style="display:none;max-height:0;overflow:hidden;opacity:0;">Your <%= brand %> code <%= purpose %>: <%= code %></div>
26
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#f1f2f3;">
27
+ <tr><td align="center" style="padding:32px 16px;">
28
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width:560px;">
29
+
30
+ <tr><td style="padding:0 4px 20px;">
31
+ <a href="<%= site %>" style="text-decoration:none;"><img src="<%= logo %>" height="32" alt="<%= brand %>" style="display:block;border:0;height:32px;width:auto;"></a>
32
+ </td></tr>
33
+
34
+ <tr><td style="background:#ffffff;border:1px solid #c6cbcf;border-radius:18px;overflow:hidden;">
35
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
36
+ <tr><td align="center" style="background:#0b1e3a;padding:30px 28px 30px;border-radius:17px 17px 0 0;">
37
+ <div style="<%= body %>font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:#9fb6d4;margin:0 0 12px;">Your <%= brand %> code</div>
38
+ <div style="<%= heading %>font-size:56px;font-weight:700;letter-spacing:.14em;color:#ffffff;line-height:1;-webkit-user-select:all;user-select:all;"><%= code %></div>
39
+ <div style="<%= body %>font-size:15px;line-height:1.4;color:#cfe0f3;margin:14px 0 0;"><%= purpose.upcase_first %></div>
40
+ </td></tr>
41
+
42
+ <% if link %>
43
+ <tr><td align="center" style="padding:22px 28px 8px;<%= body %>font-size:16px;line-height:1.5;color:#2c2f32;"><%= link_lede %></td></tr>
44
+ <tr><td align="center" style="padding:10px 28px 18px;">
45
+ <table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr>
46
+ <td style="background:#1a70d0;border-radius:24px;">
47
+ <a href="<%= link %>" style="display:inline-block;padding:14px 30px;<%= heading %>font-size:17px;font-weight:600;color:#ffffff;text-decoration:none;border-radius:24px;"><%= link_label %></a>
48
+ </td>
49
+ </tr></table>
50
+ </td></tr>
51
+ <% end %>
52
+ <tr><td align="center" style="padding:<%= link ? "0" : "22px" %> 28px 26px;<%= body %>font-size:13px;line-height:1.5;color:#636c74;">
53
+ <% if fine %><%= fine %><br><% end %>
54
+ It works once, for <%= lifetime %>. <%= ignore %>
55
+ </td></tr>
56
+ </table>
57
+ </td></tr>
58
+
59
+ <tr><td style="padding:18px 8px 0;<%= body %>font-size:12px;line-height:1.5;color:#636c74;text-align:center;">
60
+ <a href="<%= site %>" style="color:#636c74;"><%= host %></a>
61
+ </td></tr>
62
+
63
+ </table>
64
+ </td></tr>
65
+ </table>
66
+ </body>
67
+ </html>
@@ -0,0 +1,16 @@
1
+ <%# locals: (code:, brand:, site:, purpose:, lifetime:, ignore:, logo: nil, link: nil, link_label: nil, link_lede: nil, fine: nil) -%>
2
+ <%# The plain-text twin of _code.html.erb: the code first, on its own line beside the word "code". fine: plain text. -%>
3
+ Your <%= brand %> code <%= purpose %>: <%= code %>
4
+ <% if link %>
5
+
6
+ <%= link_lede %>
7
+ <%= link %>
8
+ <% end %>
9
+ <% if fine %>
10
+
11
+ <%= fine %>
12
+ <% end %>
13
+
14
+ It works once, for <%= lifetime %>. <%= ignore %>
15
+
16
+ <%= site %>
data/lib/drive/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Drive
2
2
  # Version of the gem, read by the gemspec.
3
- VERSION = '0.15.0'.freeze
3
+ VERSION = '0.17.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob
@@ -39,6 +39,7 @@ files:
39
39
  - app/assets/images/easy/sprite.svg
40
40
  - app/assets/javascripts/easy/flyer.js
41
41
  - app/assets/javascripts/easy/konami.js
42
+ - app/assets/javascripts/easy/modal.js
42
43
  - app/assets/javascripts/easy/pin_code.js
43
44
  - app/assets/javascripts/easy/rotating_placeholder.js
44
45
  - app/assets/stylesheets/easy/base.css
@@ -54,7 +55,10 @@ files:
54
55
  - app/models/serial.rb
55
56
  - app/views/drive/errors/show.html.erb
56
57
  - app/views/easy/_flyer.html.erb
58
+ - app/views/easy/_modal.html.erb
57
59
  - app/views/easy/_pin_code.html.erb
60
+ - app/views/easy/mailer/_code.html.erb
61
+ - app/views/easy/mailer/_code.text.erb
58
62
  - app/views/layouts/drive/errors.html.erb
59
63
  - app/views/layouts/easy/site.html.erb
60
64
  - lib/drive.rb