drive 0.14.0 → 0.16.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: 24419ab8de44f3e2b5b3441f15a770c76eb011b03f947050d31be42e32d73c6a
4
- data.tar.gz: 367abd230ea32c9d975e291f1f4055d6b1107516fb15218d6284e61e456c4774
3
+ metadata.gz: bba39784566ab073fd1b48d9f3c2039c654f13428be44592e0eb6dc949136a43
4
+ data.tar.gz: bcfdcacd52b9d29b94cdbf4573236d854536a847e036380b0ba3379d51dcbdd8
5
5
  SHA512:
6
- metadata.gz: b301347f49f53d6272d89946e9c176494683660956e15c3887669a64c08bddccf20f3ecd042585e57284813929fc0879e175cfe8aea40d9802fb1d392cd9ce22
7
- data.tar.gz: 9dbbdbbcb087ecaaae146947862a7de9c72ae6bba533316e881afd3d82da91e86182a3fa412c0b7a79412eb83ae6eb83539b2b7953140c828cb61b3ad5fd5380
6
+ metadata.gz: 96729b842a8714ae33ad3d758ca4b99c2be368148d2c09f5c7dceb0c332eb4adb07818760566d60a84fe9ace099b7816c202e5a982d9b6fd38f4b1f39f74407b
7
+ data.tar.gz: 6a40e287f83d1e543fff492c8b47ec135245e1a768359acddf96c6b584ba18b5485c1e7424f972bb79882392f658f19c2bdd9e1e9819e590bdb872c271fab39d
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.16.0 - 2026-11-06
10
+
11
+ * [FEATURE] `easy/mailer/code` (HTML and text): the email carrying a 6-digit code, the same from every easy app, the
12
+ design of easyfaa.com's sign-in email. The code is selected whole by one click or tap, and sits in plain digits next
13
+ 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.
14
+
15
+ ## 0.15.0 - 2026-11-06
16
+
17
+ * [FEATURE] `render "easy/pin_code", name:` (`id:`, `autofocus:`, `label:`) and `easy/pin_code.js`: the 6-digit code as
18
+ one real field drawn over six slots, the next one lit, its form submitted on the sixth digit, `is-invalid` cleared
19
+ by the next. easyfaa.com's sign-in dialog and aircraft gate drew it with a script of their own.
20
+
9
21
  ## 0.14.0 - 2026-11-06
10
22
 
11
23
  * [FEATURE] `easy/konami.js`, the flyer's easter egg, included beside `easy/flyer`: the Konami code (↑ ↑ ↓ ↓ ← → ← → B
@@ -0,0 +1,43 @@
1
+ // The 6-digit code of render "easy/pin_code": its six slots show what its one real field holds, the next one to fill
2
+ // lit, and six digits submit the form without a click, typed, pasted or offered by the phone from the email. A field
3
+ // the page empties redraws on an input event; a code refused is the page's to mark, is-invalid on the .pin-code,
4
+ // which the next digit clears. A .pin-code already drawn is left alone, so including the script twice is harmless.
5
+ // ES5 alone: every easy app has to work on old iPhones, Androids and Windows browsers.
6
+ (function () {
7
+ if (!document.querySelectorAll || !document.addEventListener) { return; }
8
+
9
+ // The form's own submit, so its handlers run first: requestSubmit, or an old browser's submit event.
10
+ function submit(form) {
11
+ if (form.requestSubmit) { form.requestSubmit(); return; }
12
+ var event = document.createEvent('Event');
13
+ event.initEvent('submit', true, true);
14
+ if (form.dispatchEvent(event)) { form.submit(); }
15
+ }
16
+
17
+ function drawn(pin) {
18
+ var input = pin.querySelector('.pin-code-input'), slots = pin.querySelectorAll('.pin-code-slots span');
19
+ function draw() {
20
+ var value = input.value.replace(/\D/g, '').slice(0, 6), focused = document.activeElement === input;
21
+ if (value !== input.value) { input.value = value; }
22
+ for (var i = 0; i < slots.length; i++) {
23
+ slots[i].textContent = value.charAt(i);
24
+ slots[i].className = focused && i === Math.min(value.length, 5) ? 'is-active' : '';
25
+ }
26
+ return value;
27
+ }
28
+ input.addEventListener('input', function () {
29
+ pin.className = pin.className.replace(/\s*\bis-invalid\b/g, '');
30
+ input.removeAttribute('aria-invalid');
31
+ if (draw().length === 6 && input.form) { submit(input.form); }
32
+ });
33
+ input.addEventListener('focus', draw);
34
+ input.addEventListener('blur', draw);
35
+ pin.className += ' is-drawn';
36
+ draw();
37
+ }
38
+
39
+ var pins = document.querySelectorAll('.pin-code');
40
+ for (var i = 0; i < pins.length; i++) {
41
+ if (!/\bis-drawn\b/.test(pins[i].className)) { drawn(pins[i]); }
42
+ }
43
+ })();
@@ -0,0 +1,9 @@
1
+ <%# locals: (name:, id: nil, autofocus: false, label: "6-digit code") -%>
2
+ <%# The 6-digit code emailed to sign in or to sign: one real field, so a pasted or autofilled code lands whole, drawn
3
+ over six slots by easy/pin_code.js, which the page includes once; without the script, the field itself shows.
4
+ name: the field's, "sign_in[pin]"; a code refused is the page's to mark, is-invalid on the .pin-code. -%>
5
+ <div class="pin-code">
6
+ <%= tag.input type: "text", name:, id:, class: "pin-code-input", required: true, autofocus:, autocomplete: "one-time-code",
7
+ inputmode: "numeric", pattern: "[0-9]{6}", maxlength: 6, aria: { label: } %>
8
+ <div class="pin-code-slots" aria-hidden="true"><span></span><span></span><span></span><span></span><span></span><span></span></div>
9
+ </div>
@@ -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.14.0'.freeze
3
+ VERSION = '0.16.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.14.0
4
+ version: 0.16.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/pin_code.js
42
43
  - app/assets/javascripts/easy/rotating_placeholder.js
43
44
  - app/assets/stylesheets/easy/base.css
44
45
  - app/assets/stylesheets/easy/components.css
@@ -53,6 +54,9 @@ files:
53
54
  - app/models/serial.rb
54
55
  - app/views/drive/errors/show.html.erb
55
56
  - app/views/easy/_flyer.html.erb
57
+ - app/views/easy/_pin_code.html.erb
58
+ - app/views/easy/mailer/_code.html.erb
59
+ - app/views/easy/mailer/_code.text.erb
56
60
  - app/views/layouts/drive/errors.html.erb
57
61
  - app/views/layouts/easy/site.html.erb
58
62
  - lib/drive.rb