rails_email_preview 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a586d7cf77f0bdcdeebffa23d9b0346196ae0277
4
- data.tar.gz: 6725bf049c7b76b8cebe6e0a57385d67101ce83e
3
+ metadata.gz: b6595d136da9bdf30c3a5482ea8c57000f7615bb
4
+ data.tar.gz: c07d82a4300334cb80f05bb465ed93bcbd8f055b
5
5
  SHA512:
6
- metadata.gz: e75aa9aea3ecd4c3782ecf8608afebe6f5073570e5161ee6ffd3cb28d8a38d8835e7c895d7645cb7a3d7414886c616f7a8c7d5f640d140d87727c42f7dde93a3
7
- data.tar.gz: 31c10088387e24bf73252d76a3ec9407cee17913df1507e17fd47a09cc5a94ec48cc1f7ac9e997d0bc9363a77c086d83d9e6049b63d65d33ce01fd02f1b6170e
6
+ metadata.gz: ed1b766dea0908a99e87a9f277d65c987b902611cb99c930fa16db5cf661730e26ab1198f0bfa7b4cea073112857c962281941438b2f6b4021123a541dfe690a
7
+ data.tar.gz: ad4dc222663aae25b1288bed9f157fdab5db8be5de54e5d29a8776fd17bbb574525c2c60ed87a8261054c8c9378a5e8a4af20f03266b36bb068980c4a551ca42
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rails Email Preview [![Build Status][travis-badge]][travis] [![Test Coverage][coverage-badge]][coverage] [![Code Climate][codeclimate-badge]][codeclimate] [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/glebm/rails_email_preview?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1
+ # Rails Email Preview [![Build Status][travis-badge]][travis] [![Test Coverage][coverage-badge]][coverage] [![Code Climate][codeclimate-badge]][codeclimate] [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/glebm/rails_email_preview?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2
2
 
3
3
  Preview email in the browser with this Rails engine. Compatible with Rails 4.2+.
4
4
 
@@ -113,12 +113,30 @@ REP works with [Comfortable Mexican Sofa CMS](https://github.com/comfy/comfortab
113
113
 
114
114
  [![screenshot](https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-edit-sofa.png)](https://github.com/glebm/rails_email_preview/wiki/Edit-Emails-with-Comfortable-Mexican-Sofa)
115
115
 
116
- ### Premailer
116
+ ### CSS inlining
117
117
 
118
- [Premailer](https://github.com/alexdunae/premailer) automatically translates standard CSS rules into old-school inline styles. Integration can be done by using the <code>before_render</code> hook.
118
+ For CSS inlining, REP supports [Roadie](https://github.com/Mange/roadie) and
119
+ [Premailer](https://github.com/alexdunae/premailer).
120
+ Both of these automatically translate CSS rules into inline styles and turn
121
+ relative URLs into absolute ones.
122
+
123
+ Roadie additionally extracts styles that cannot be inlined into a separate
124
+ `<style>` tag that is supported by some email clients. For this reason I
125
+ recommend Roadie over Premailer.
126
+
127
+ Unlike Premailer, Roadie does **not** automatically generate a plain text
128
+ version for HTML emails, but you can use another gem for this, such as
129
+ [plain-david](https://github.com/lucaspiller/plain-david).
130
+
131
+ #### Roadie
132
+
133
+ To integrate Roadie with your Rails app, use [roadie-rails](https://github.com/Mange/roadie-rails).
134
+ To integrate roadie-rails with REP, uncomment the relevant option in [the initializer](https://github.com/glebm/rails_email_preview/blob/master/config/initializers/rails_email_preview.rb). *initializer is generated during `rails g rails_email_preview:install`*
135
+
136
+ #### Premailer
119
137
 
120
138
  To integrate Premailer with your Rails app you can use either [actionmailer_inline_css](https://github.com/ndbroadbent/actionmailer_inline_css) or [premailer-rails](https://github.com/fphilipe/premailer-rails).
121
- Simply uncomment the relevant options in [the initializer](https://github.com/glebm/rails_email_preview/blob/master/config/initializers/rails_email_preview.rb). *initializer is generated during `rails g rails_email_preview:install`*
139
+ To integrate either with REP, uncomment the relevant options in [the initializer](https://github.com/glebm/rails_email_preview/blob/master/config/initializers/rails_email_preview.rb). *initializer is generated during `rails g rails_email_preview:install`*
122
140
 
123
141
  ### I18n
124
142
 
@@ -0,0 +1 @@
1
+ //= require turbolinks
@@ -108,7 +108,7 @@ $rep-text-color-secondary: #263238 !default
108
108
  clear: left
109
109
  margin-right: 0.4em
110
110
  text-align: right
111
- width: 4.8em
111
+ width: 6em
112
112
  dd
113
113
  width: auto
114
114
  margin-left: 0
@@ -20,9 +20,15 @@
20
20
  }
21
21
 
22
22
  function getBodyHeight(body) {
23
- // firefox sometimes returns the wrong value for all of these and needs a bit of extra height
24
- return (/Firefox/.test(navigator.userAgent) ? 50 : 0) +
25
- Math.max(body.scrollHeight, body.offsetHeight, body.clientHeight);
23
+ var boundingRect = body.getBoundingClientRect();
24
+ var style = body.ownerDocument.defaultView.getComputedStyle(body);
25
+ var marginY = parseInt(style['margin-bottom'], 10) +
26
+ parseInt(style['margin-top'], 10);
27
+ // There may be a horizontal scrollbar adding to the height.
28
+ var scrollbarHeight = 17;
29
+ return scrollbarHeight + marginY + Math.max(
30
+ body.scrollHeight, body.offsetHeight, body.clientHeight,
31
+ boundingRect.height + boundingRect.top);
26
32
  }
27
33
 
28
34
  function fetchHeaders() {
@@ -5,9 +5,11 @@ require 'rails_email_preview'
5
5
  #
6
6
  # # hook before rendering preview:
7
7
  # config.before_render do |message, preview_class_name, mailer_action|
8
- # # apply premailer-rails:
8
+ # # Use roadie-rails:
9
+ # Roadie::Rails::MailInliner.new(message, message.roadie_options).execute
10
+ # # Use premailer-rails:
9
11
  # Premailer::Rails::Hook.delivering_email(message)
10
- # # or actionmailer-inline-css:
12
+ # # Use actionmailer-inline-css:
11
13
  # ActionMailer::InlineCssHook.delivering_email(message)
12
14
  # end
13
15
  #
@@ -1,3 +1,3 @@
1
1
  module RailsEmailPreview
2
- VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_email_preview
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-12 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -132,7 +132,7 @@ files:
132
132
  - MIT-LICENSE
133
133
  - README.md
134
134
  - Rakefile
135
- - app/assets/javascripts/rails_email_preview/application.js.coffee
135
+ - app/assets/javascripts/rails_email_preview/application.js
136
136
  - app/assets/stylesheets/rails_email_preview/application.sass
137
137
  - app/assets/stylesheets/rails_email_preview/bootstrap3.sass
138
138
  - app/controllers/rails_email_preview/application_controller.rb
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  requirements: []
192
192
  rubyforge_project:
193
- rubygems_version: 2.5.1
193
+ rubygems_version: 2.6.10
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: Preview emails in browser (rails engine)
@@ -1 +0,0 @@
1
- #= require turbolinks