bookends 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/bookends.gemspec +1 -0
- data/lib/bookends/version.rb +1 -1
- data/lib/generators/bookends/install/install_generator.rb +2 -1
- data/lib/generators/bookends/install/templates/footer.html.erb +7 -1
- data/lib/generators/bookends/install/templates/{footer.css.scss → footer.scss} +78 -47
- data/lib/generators/bookends/install/templates/newsletter.js +58 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0afe580982cefaaaf366a337b970d463e012a6de
|
4
|
+
data.tar.gz: 7310cdefffb24ae207aa3e133c5cdf8246f7e468
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b65d2c5be5360dc30775c6702dfa156ed6117b4c77ffd53b1068b8a0465412387f25a87904e004e5ff8e1e2eec880db293e57392d9ca01b96b79203760627bc0
|
7
|
+
data.tar.gz: cddf3716609911800f7a7507383e8c62ac1afb0c0ea56bc80c6f60a15d876d89c25841399c0152acc6e745600ec4e9ebd8cae0c156f38a2945bca0bc0097241e
|
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Bookends
|
2
2
|
Shared footer (and eventually header) for Heroku properties.
|
3
3
|
|
4
|
+
## Requirements
|
5
|
+
Bookends assumes the presence of:
|
6
|
+
* jQuery
|
7
|
+
|
4
8
|
## Installation
|
5
9
|
|
6
10
|
Add this line to your application's Gemfile:
|
@@ -16,8 +20,10 @@ And then execute:
|
|
16
20
|
## Usage
|
17
21
|
|
18
22
|
* `rails g bookends:install`
|
19
|
-
* add `@import 'bookends/footer';` to your application.
|
23
|
+
* add `@import 'bookends/footer';` to your application.scss
|
20
24
|
* add `<%= render 'bookends/footer' %>` to your layout where you want the footer.
|
25
|
+
* ensure that your JavaScript manifest includes the bookends JavaScript
|
26
|
+
* e.g. `//= require_tree ./bookends`
|
21
27
|
|
22
28
|
## Development
|
23
29
|
|
data/bookends.gemspec
CHANGED
data/lib/bookends/version.rb
CHANGED
@@ -12,7 +12,8 @@ module Bookends
|
|
12
12
|
FileUtils.mkdir_p 'app/views/bookends'
|
13
13
|
|
14
14
|
copy_file 'footer.html.erb', 'app/views/bookends/_footer.html.erb'
|
15
|
-
copy_file 'footer.
|
15
|
+
copy_file 'footer.scss', 'app/assets/stylesheets/bookends/_footer.scss'
|
16
|
+
copy_file 'newsletter.js', 'app/assets/javascripts/bookends/newsletter.js'
|
16
17
|
directory 'footer_images' , 'app/assets/images/bookends/footer/'
|
17
18
|
end
|
18
19
|
end
|
@@ -43,7 +43,13 @@
|
|
43
43
|
</div>
|
44
44
|
<div class="col heroku-footer-social">
|
45
45
|
<h3><span class="heroku-footer-icon-newsletter"></span>Subscribe to our monthly newsletter</h3>
|
46
|
-
<
|
46
|
+
<form id="bookends-newsletter" accept-charset="UTF-8" action="https://www.heroku.com/newsletter_signups" method="post">
|
47
|
+
<input name="utf8" type="hidden" value="✓">
|
48
|
+
<input type="text" name="website" id="bookends-website" placeholder="do not fill this in" tabindex="-1">
|
49
|
+
<input type="email" name="newsletter_signup[email]" id="newsletter_signup_email" placeholder="Your email address" required="required">
|
50
|
+
<input type="submit" name="commit" value="Go">
|
51
|
+
<p id="bookends-newsletter-result" class="hide"></p>
|
52
|
+
</form>
|
47
53
|
<ul class="social-list">
|
48
54
|
<li><a class="heroku-footer-icon-rss" href="http://feeds2.feedburner.com/heroku" target="_blank">RSS Feed</a></li>
|
49
55
|
<li><a class="heroku-footer-icon-twitter" href="https://twitter.com/heroku" target="_blank">Twitter</a></li>
|
@@ -1,4 +1,12 @@
|
|
1
1
|
#heroku-footer {
|
2
|
+
#bookends-website { //honeypot
|
3
|
+
position: absolute;
|
4
|
+
left: -9999px;
|
5
|
+
}
|
6
|
+
|
7
|
+
.hide {
|
8
|
+
display: none;
|
9
|
+
}
|
2
10
|
|
3
11
|
$asset-path: 'bookends/footer';
|
4
12
|
|
@@ -189,53 +197,76 @@
|
|
189
197
|
}
|
190
198
|
}
|
191
199
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
200
|
+
#bookends-newsletter {
|
201
|
+
$input-height: 40px;
|
202
|
+
|
203
|
+
position: relative;
|
204
|
+
width: 100%;
|
205
|
+
padding-bottom: 10px;
|
206
|
+
@include screen(min-width, $threshold-tablet) {
|
207
|
+
border-bottom: 1px solid $color-border;
|
208
|
+
}
|
209
|
+
|
210
|
+
input[type="text"],
|
211
|
+
input[type="email"], {
|
212
|
+
-webkit-appearance: none;
|
213
|
+
width: 100%;
|
214
|
+
height: $input-height;
|
215
|
+
padding: 0 10px;
|
216
|
+
border-radius: 4px;
|
217
|
+
border: 1px solid $color-border;
|
218
|
+
box-shadow: 0 0 4px fade-out($color-purple, 1);
|
219
|
+
transition: all .2s ease;
|
220
|
+
-webkit-transition: all .2s ease;
|
221
|
+
|
222
|
+
&:focus {
|
223
|
+
outline: none;
|
224
|
+
box-shadow: 0 0 4px fade-out($color-purple, .5);
|
225
|
+
border-color: $color-purple;
|
226
|
+
}
|
227
|
+
}
|
228
|
+
|
229
|
+
input[type="submit"] {
|
230
|
+
-webkit-appearance: none;
|
231
|
+
position: absolute;
|
232
|
+
top: 0;
|
233
|
+
right: 0;
|
234
|
+
margin: 5px;
|
235
|
+
width: $input-height;
|
236
|
+
height: ($input-height - 10);
|
237
|
+
border: 0;
|
238
|
+
background-color: $color-purple;
|
239
|
+
border-radius: 3px;
|
240
|
+
text-transform: uppercase;
|
241
|
+
letter-spacing: .05em;
|
242
|
+
font-weight: bold;
|
243
|
+
text-align: center;
|
244
|
+
color: #fff;
|
245
|
+
|
246
|
+
&:focus {
|
247
|
+
outline: none;
|
248
|
+
border: 1px solid fade-out($color-purple, .5);
|
249
|
+
}
|
250
|
+
|
251
|
+
&:hover {
|
252
|
+
background-color: darken($color-purple, 5%);
|
253
|
+
}
|
254
|
+
}
|
255
|
+
|
256
|
+
p {
|
257
|
+
margin: 6px 0;
|
258
|
+
padding: 8px;
|
259
|
+
border-radius: 3px;
|
260
|
+
font-size: 11px;
|
261
|
+
text-align: left;
|
262
|
+
background-color: #fff;
|
263
|
+
height: $input-height;
|
264
|
+
|
265
|
+
&.error {
|
266
|
+
background-color: tomato;
|
267
|
+
}
|
268
|
+
}
|
269
|
+
}
|
239
270
|
|
240
271
|
.social-list {
|
241
272
|
margin: 0;
|
@@ -0,0 +1,58 @@
|
|
1
|
+
var Heroku = Heroku || {};
|
2
|
+
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
3
|
+
|
4
|
+
Heroku.NewsletterSignup = (function() {
|
5
|
+
function NewsletterSignup() {
|
6
|
+
this.handleSubmit = bind(this.handleSubmit, this);
|
7
|
+
this.$container = $("#bookends-newsletter");
|
8
|
+
this.$honeyPot = this.$container.find("#bookends-website");
|
9
|
+
this.$input = this.$container.find("input[type=email]");
|
10
|
+
this.$submit = this.$container.find(":submit");
|
11
|
+
this.$resultContainer = $("#bookends-newsletter-result");
|
12
|
+
|
13
|
+
this.$container.on("submit", this.handleSubmit);
|
14
|
+
}
|
15
|
+
|
16
|
+
NewsletterSignup.prototype.handleSubmit = function(e) {
|
17
|
+
var val;
|
18
|
+
var self;
|
19
|
+
|
20
|
+
e.preventDefault();
|
21
|
+
if(this.$honeyPot.val() !== "") {
|
22
|
+
return this.handleSuccess();
|
23
|
+
}
|
24
|
+
|
25
|
+
val = this.$input.val();
|
26
|
+
self = this;
|
27
|
+
$.ajax({
|
28
|
+
url: "https://www.heroku.com/newsletter_signups",
|
29
|
+
type: "POST",
|
30
|
+
crossDomain: true,
|
31
|
+
data: { newsletter_signup: { email: val } }
|
32
|
+
})
|
33
|
+
.done(function(res) {
|
34
|
+
return self.handleSuccess();
|
35
|
+
})
|
36
|
+
.fail(function(err) {
|
37
|
+
return self.handleFailure();
|
38
|
+
});
|
39
|
+
};
|
40
|
+
|
41
|
+
NewsletterSignup.prototype.handleSuccess = function() {
|
42
|
+
this.$input.replaceWith("<p>Check your email now to confirm your sign-up.</p>");
|
43
|
+
};
|
44
|
+
|
45
|
+
NewsletterSignup.prototype.handleFailure = function() {
|
46
|
+
this.$input.val("");
|
47
|
+
this.$resultContainer
|
48
|
+
.removeClass("hide")
|
49
|
+
.text("There was an error registering you. Please refresh.");
|
50
|
+
};
|
51
|
+
|
52
|
+
return NewsletterSignup;
|
53
|
+
|
54
|
+
})();
|
55
|
+
|
56
|
+
$(function() {
|
57
|
+
return window.Heroku.newsletterSignup = new Heroku.NewsletterSignup();
|
58
|
+
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookends
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marketing Web Ops at heroku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: jquery-rails
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: an engine to abstract common html/css elements across Heroku properties
|
98
112
|
email:
|
99
113
|
- max.beizer@gmail.com
|
@@ -115,11 +129,12 @@ files:
|
|
115
129
|
- lib/bookends/engine.rb
|
116
130
|
- lib/bookends/version.rb
|
117
131
|
- lib/generators/bookends/install/install_generator.rb
|
118
|
-
- lib/generators/bookends/install/templates/footer.css.scss
|
119
132
|
- lib/generators/bookends/install/templates/footer.html.erb
|
133
|
+
- lib/generators/bookends/install/templates/footer.scss
|
120
134
|
- lib/generators/bookends/install/templates/footer_images/footer_sprite.png
|
121
135
|
- lib/generators/bookends/install/templates/footer_images/footer_sprite@2x.png
|
122
136
|
- lib/generators/bookends/install/templates/footer_images/salesforce_heroku_gray.png
|
137
|
+
- lib/generators/bookends/install/templates/newsletter.js
|
123
138
|
homepage: https://www.heroku.com
|
124
139
|
licenses: []
|
125
140
|
metadata: {}
|