localmail 0.2.1 → 0.2.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 +6 -0
- data/lib/localmail/message.rb +12 -1
- data/lib/localmail/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fff6275885473ff681acef6b4f0f25b53fbb5dd80774e58aa8cae32edf66673d
|
|
4
|
+
data.tar.gz: 509d6fba1d91f1cefba48c0e2375b5e621de01916ff556b5212a24d1d2c7727d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e270cde29fb6a3eba25b125f9656848b76a079dc487045a69d1b08c1bc4d7b1091813b68a2afb3bedde5528a8ff156d86198a89879593b811c8026fc64e5b563
|
|
7
|
+
data.tar.gz: d26b30d335d02bb7a4b9fbd3c4da4fe5ef01bdc9b2e16442dd4b315099a3bea9702a0cf7c1b22f9a042bd00c9e581b1056313994e8259e82a49afe9c4842bbe7
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.2.2]
|
|
6
|
+
|
|
7
|
+
- **The mobile preview reflows wide emails to fit**, as a phone mail app does: fixed widths
|
|
8
|
+
give way and the text wraps at full size. A fixed-width email no longer scrolls sideways
|
|
9
|
+
in the 390px preview. The desktop preview is unchanged.
|
|
10
|
+
|
|
5
11
|
## [0.2.1]
|
|
6
12
|
|
|
7
13
|
- Declare the MIT licence in the gemspec, so RubyGems lists it.
|
data/lib/localmail/message.rb
CHANGED
|
@@ -2,6 +2,17 @@ module Localmail
|
|
|
2
2
|
# One captured email, rebuilt from its stored raw source, with the parts the inbox
|
|
3
3
|
# renders exposed as UTF-8 strings.
|
|
4
4
|
class Message
|
|
5
|
+
REFLOW_ON_PHONE = <<~CSS.squish
|
|
6
|
+
@media (max-width: 480px) {
|
|
7
|
+
html, body { min-width: 0 !important; }
|
|
8
|
+
body * { max-width: 100% !important; min-width: 0 !important; }
|
|
9
|
+
td[width]:not([width$="%"]), th[width]:not([width$="%"]),
|
|
10
|
+
td[style*="width"]:not([style*="%"]), th[style*="width"]:not([style*="%"]) { width: auto !important; }
|
|
11
|
+
img { height: auto !important; }
|
|
12
|
+
body { overflow-wrap: anywhere; }
|
|
13
|
+
}
|
|
14
|
+
CSS
|
|
15
|
+
|
|
5
16
|
attr_reader :id, :mail
|
|
6
17
|
|
|
7
18
|
delegate :subject, :from, :to, :cc, :bcc, :date, to: :mail
|
|
@@ -18,7 +29,7 @@ module Localmail
|
|
|
18
29
|
def preview_html
|
|
19
30
|
return if html_body.nil?
|
|
20
31
|
|
|
21
|
-
%(<base target="_blank">#{html_body})
|
|
32
|
+
%(<base target="_blank"><style>#{REFLOW_ON_PHONE}</style>#{html_body})
|
|
22
33
|
end
|
|
23
34
|
|
|
24
35
|
def text_body
|
data/lib/localmail/version.rb
CHANGED