1
0
Fork 0

chore(website): simple join the program form

This commit is contained in:
Sylvain UTARD 2015-12-18 14:29:41 +01:00
parent 23ae786c59
commit 2e758b79a5
4 changed files with 49 additions and 23 deletions

View file

@ -22,6 +22,8 @@
{%if page.noFooter == null %}
{% include footer.html %}
{% endif %}
<script src="//cdn.jsdelivr.net/jquery/2.1/jquery.min.js"></script>
<script src="{{ "/js/bootstrap.min.js" | prepend: site.baseurl }}"></script>
<script src="//cdn.jsdelivr.net/autocomplete.js/0/autocomplete.jquery.min.js"></script>
<script src="//cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js"></script>

View file

@ -152,21 +152,6 @@ header.site-header nav.navbar .navbar-nav > li > a.navbar-github-link:hover {
display: block;
font-weight: normal;
}
input {
width: 100%;
margin: 0 0 10px;
padding: 8px 12px;
border-radius: 4px;
color: #091724;
outline: none;
&#form-submit {
background: transparent;
border: 3px solid #46AEDA;
color: #FF2E6C;
font-size: 16px;
font-weight: bold;
}
}
p {
font-size: 13px;
color: #C7C4C4;

View file

@ -16,15 +16,27 @@ layout: default
.jumbotron-left-column
%p Weve created the fastest, easiest way to search within documentation.
%p And best of all? Its free!
#join-form
%form#join-form{action: '#', method: 'POST'}
%h3 Want to try it out?
%label Website
%input{:type=>"text", :placeholder => "http://docs.mywebsite.com/"}
%p Well crawl the documentation pages of your website and index them on Algolia.
%label Email
%input{:type=>"text", :placeholder => "my@email.com"}
%p Well send you the code you need to integrate the search autocomplete into your documentation.
%input{:type=>"submit", :name => "join", :value => "Join the beta!", :id => "form-submit"}
.row
.col-sm-10.col-sm-offset-1
.spacer20
.input-group
%span.input-group-addon
%i.fa.fa-fw.fa-envelope-o
%input.form-control{type: 'email', placeholder: 'you@example.org', name: 'email'}
.text-sm We'll crawl the documentation pages of your website and index them using Algolia.
.spacer20
.input-group
%span.input-group-addon
%i.fa.fa-fw.fa-globe
%input.form-control{type: 'text', placeholder: 'https://website.com/doc', name: 'url'}
.text-sm We'll send you the code you need to improve the search of your documentation.
.spacer20
%p.text-center
%button.btn.btn-primary{type: 'submit'}
Join the DocSearch beta
%i.fa.fa-chevron-right
#section_why.page-section
.container
.row
@ -96,3 +108,7 @@ layout: default
%h2.page-section-title Get started
%p Add the url of your documentation site and your email to the form at the top of the page. Well get back to you with what you need to integrate your new search into your website.
%p Dont forget, DocSearch is completely free! Theres no need to sign up for Algolia or submit any payment information. Lets tackle document search together.
{% contentfor site-footer %}
<script src="{{ "/js/home.js" | prepend: site.baseurl }}"></script>
{% endcontentfor %}

23
docs/js/home.js Normal file
View file

@ -0,0 +1,23 @@
(function($) {
$('#join-form').on('submit', function() {
var $button = $(this).find('button');
var $email = $(this).find('input[name="email"]');
var $url = $(this).find('input[name="url"]');
$button.attr('disabled', true);
$.ajax({
url: 'https://www.algolia.com/docsearch/join',
type: 'POST',
data: {
email: $email.val(),
url: $url.val()
}
}).done(function() {
$email.val('');
$url.val('');
$button.text('Thank you!');
}).fail(function() {
$button.attr('disabled', null);
})
return false;
});
})(jQuery);