Skip to content

Commit

Permalink
add message when validating the form
Browse files Browse the repository at this point in the history
  • Loading branch information
maxiloc committed Mar 1, 2017
1 parent 8b3e120 commit 4fc8eb3
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 48 deletions.
1 change: 1 addition & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ group :development, :test do
gem 'guard-jekyll-plus'
gem 'guard-livereload'
gem 'guard-bundler', require: false
gem 'eventmachine', '1.2.3'
end
93 changes: 49 additions & 44 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.8)
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
blankslate (2.1.2.4)
classifier-reborn (2.0.4)
classifier-reborn (2.1.0)
fast-stemmer (~> 1.0)
coderay (1.1.0)
coderay (1.1.1)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
coffee-script-source (1.11.1)
colorator (0.1)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.2)
execjs (2.6.0)
faraday (0.9.2)
eventmachine (1.2.3)
execjs (2.7.0)
faraday (0.11.0)
multipart-post (>= 1.2, < 3)
fast-stemmer (1.0.2)
ffi (1.9.10)
ffi (1.9.17)
formatador (0.2.5)
guard (2.13.0)
guard (2.14.1)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
listen (>= 2.7, < 4.0)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
Expand All @@ -39,9 +40,10 @@ GEM
guard (~> 2.10, >= 2.10.3)
guard-compat (~> 1.1)
jekyll (>= 1.0.0)
guard-livereload (2.4.0)
guard-livereload (2.5.2)
em-websocket (~> 0.5)
guard (~> 2.8)
guard-compat (~> 1.0)
multi_json (~> 1.8)
haml (4.0.7)
tilt
Expand All @@ -61,63 +63,65 @@ GEM
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.1)
jekyll-coffeescript (1.0.2)
coffee-script (~> 2.2)
jekyll-contentblocks (1.0.1)
coffee-script-source (~> 1.11.1)
jekyll-contentblocks (1.2.0)
jekyll
jekyll-gist (1.4.0)
octokit (~> 4.2)
jekyll-haml (0.1.3)
jekyll-haml (0.1.4)
haml (>= 3.0.0)
jekyll (>= 0.10.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-watch (1.3.0)
listen (~> 3.0)
kramdown (1.9.0)
jekyll-sass-converter (1.5.0)
sass (~> 3.4)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
kramdown (1.13.2)
liquid (2.6.3)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.9)
mercenary (0.3.5)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
lumberjack (1.0.11)
mercenary (0.3.6)
method_source (0.8.2)
mini_portile (0.6.2)
multi_json (1.11.2)
mini_portile2 (2.1.0)
multi_json (1.12.1)
multipart-post (2.0.0)
nenv (0.2.0)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
notiffany (0.0.8)
nenv (0.3.0)
nokogiri (1.7.0.1)
mini_portile2 (~> 2.1.0)
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
octokit (4.2.0)
sawyer (~> 0.6.0, >= 0.5.3)
octokit (4.6.2)
sawyer (~> 0.8.0, >= 0.5.3)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.11)
pry (0.10.2)
posix-spawn (0.3.13)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
public_suffix (2.0.5)
pygments.rb (0.6.3)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.2.0)
rb-fsevent (0.9.6)
rb-inotify (0.9.5)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
redcarpet (3.3.3)
rouge (1.7.7)
redcarpet (3.4.0)
rouge (2.0.7)
safe_yaml (1.0.4)
sass (3.4.20)
sawyer (0.6.0)
addressable (~> 2.3.5)
faraday (~> 0.8, < 0.10)
sass (3.4.23)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
shellany (0.0.1)
slop (3.6.0)
thor (0.19.1)
tilt (2.0.1)
thor (0.19.4)
tilt (2.0.6)
toml (0.1.2)
parslet (~> 1.5.0)
yajl-ruby (1.2.1)
Expand All @@ -126,6 +130,7 @@ PLATFORMS
ruby

DEPENDENCIES
eventmachine (= 1.2.3)
guard
guard-bundler
guard-jekyll-plus
Expand Down
12 changes: 12 additions & 0 deletions docs/_includes/join-form.haml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@
.text-center
%button.btn.btn-primary.btn-lg{type: 'submit'}
JOIN THE PROGRAM!

%form.join-form.join-form-validated
%h3 Thank you !
.spacer20
%p.text-sm
%b
We'll review your request shortly,
after making sure your website is eligible to Docsearch.
%p.text-sm
This is a manual process and can take some time.
%p.text-sm We'll then email you the code you need to integrate on your website
.spacer20
4 changes: 4 additions & 0 deletions docs/css/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ html, body {
.join-form {
border-radius: 5px 5px 0 0;
}
.join-form.join-form-validated {
display: none;
border-radius: 5px;
}
.jumbotron-header {
text-align: center;
color: white;
Expand Down
7 changes: 3 additions & 4 deletions docs/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
document.body.appendChild(iframe);
}

$('.join-form').on('submit', function() {
$('.join-form').on('submit', function(e) {
var $button = $(this).find('button');
var $email = $(this).find('input[name="email"]');
var $url = $(this).find('input[name="url"]');
Expand Down Expand Up @@ -39,9 +39,8 @@
}
}).done(function() {
pardotAppendIframe('https://go.pardot.com/l/139121/2016-08-05/ldp67?email=' + encodeURIComponent($email.val()) + '&website=' + encodeURIComponent($url.val()));
$email.val('');
$url.val('');
$button.text('Thank you!');
$('.join-form').hide();
$('.join-form-validated').show();
}).fail(function() {
$button.attr('disabled', null);
alert('An error occurred, please try again later.');
Expand Down

0 comments on commit 4fc8eb3

Please sign in to comment.