Prototype. It is not been saved yet.
This commit is contained in:
Daniel Camargo 2013-03-06 12:06:46 -03:00
parent cdcadf3aab
commit c934670dd1
6 changed files with 66 additions and 14 deletions

View File

@ -79,7 +79,7 @@ $(function() {
App.topCommunities[App.topCommunities.length] = {
id_community: '<?=$restaurant->community()->permalink?>',
name: '<?=$restaurant->community()->name?>',
image: '/cache/images/<?=$restaurant->thumb()->getFileName()?>',
image: '/cache/images/<?//=$restaurant->thumb()->getFileName()?>',
restaurant: '<?=str_replace("'","\'",$restaurant->name)?>'
};
<? endforeach ; ?>
@ -115,6 +115,7 @@ $(function() {
<script src="/assets/js/order.js?v=<?=Cana_Util::gitVersion()?>"></script>
<script src="/assets/js/facebook.js?v=<?=Cana_Util::gitVersion()?>"></script>
<script src="/assets/js/support.js?v=<?=Cana_Util::gitVersion()?>"></script>
<script src="/assets/js/recommend.js?v=<?=Cana_Util::gitVersion()?>"></script>
<script type="text/javascript">(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===e.location.protocol?"https:":"http:")+'//cdn.mxpnl.com/libs/mixpanel-2.2.min.js';f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f);b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==
typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.increment people.append people.track_charge people.clear_charges people.delete_user".split(" ");for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,

View File

@ -25,16 +25,31 @@
</div>
<div class="divider"></div>
<div class="home-recommend">
<div class="home-recommend-title">
<h1>Recommend a restaurant:</h1>
<div class="home-recommend-form">
<div class="home-recommend-title">
<h1>Recommend a restaurant:</h1>
</div>
<input type="text" class="home-recommend-text">
<button class="home-recommend-button"><div>Recommend!</div></button>
<div class="divider"></div>
<div class="home-recommend-message">
What's your absolute favorite? What should be on Crunchbutton? <br/> Tell us, and we'll actually add it and get back to you.
</div>
<div class="divider"></div>
</div>
<input type="text" class="home-recommend-text">
<button class="home-recommend-button"><div>Recommend!</div></button>
<div class="divider"></div>
<div class="home-recommend-message">
What's your absolute favorite? What should be on Crunchbutton? <br/> Tell us, and we'll actually add it and get back to you.
<div class="home-recommend-thank-you">
<div class="home-recommend-title">
<h1>Awesome, thanks!</h1>
</div>
<div class="divider"></div>
<div class="home-recommend-message">
<% if( App.config.user.has_auth ) { %>
We'll let you know if they make it to Crunchbutton.
<% } else { %>
<a href="#" class="home-recommend-message-create-account">Create an account</a>, and when we'll let you know when we launch in your area!
<% } %>
</div>
</div>
<div class="divider"></div>
</div>
<div class="content-item-locations">

View File

@ -2481,12 +2481,15 @@ strong {
width: 687px;
font-weight: 100;
}
.home-recommend-thank-you{
display: none;
}
.home-recommend-message{
color: #888;
display: block;
font-size: 16px;
font-size: 14px;
line-height: 24px;
margin:10px 0 0 0;
margin:5px 0 0 0;
}
.home-recommend-title{
font-size: 28px;

View File

@ -1724,7 +1724,7 @@ $(function() {
App.signin.init();
App.signup.init();
App.suggestion.init();
App.recommend.init();
});

View File

@ -0,0 +1,34 @@
App.recommend = {
api : {
sms : 'support/sms',
},
itIsSending : false
}
App.recommend.init = function(){
$( document ).on( 'click', '.home-recommend-button', function() {
App.recommend.send();
} );
$( document ).on( 'click', '.home-recommend-message-create-account', function(){
App.signup.show( false );
} );
}
App.recommend.send = function(){
if ( $.trim( $( '.home-recommend-text' ).val() ) == '' ){
alert( "Please enter the restaurant\'s name." );
$( '.home-recommend-text' ).focus();
return;
}
App.recommend.showThankYou();
}
App.recommend.showThankYou = function(){
$( '.home-recommend-form' ).animate( { 'opacity' : 0 }, function(){
$( '.home-recommend-form' ).hide();
$( '.home-recommend-thank-you' ).css( 'opacity', 0 );
$( '.home-recommend-thank-you' ).show();
$( '.home-recommend-thank-you' ).animate( { 'opacity' : 1 } );
} );
}

View File

@ -18,8 +18,7 @@ App.support.init = function(){
$(document).on('click', '.support-maximized-button', function() {
App.support.sendSMS();
});
});
}
App.support.maxi = function(){