Skip to content

Instantly share code, notes, and snippets.

@agustinhaller
Created November 11, 2012 01:33
Show Gist options
  • Select an option

  • Save agustinhaller/4053305 to your computer and use it in GitHub Desktop.

Select an option

Save agustinhaller/4053305 to your computer and use it in GitHub Desktop.
pepe
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Bumbea.com</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Bootstrap -->
<link rel="stylesheet" href="http://dev.bumbea.com/site/css/bootstrap.css">
<link rel="stylesheet" href="http://dev.bumbea.com/site/css/font-awesome.css">
<link rel="stylesheet" href="http://dev.bumbea.com/site/css/zocial.css">
<link rel="stylesheet" href="http://dev.bumbea.com/site/css/main.css">
<script src="http://dev.bumbea.com/site/js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script>
</head>
<body class="home">
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<input type="hidden" id="complete-user-data-flag" name="complete-user-data-flag" value="1">
<header>
<h1 class="main-title">
<a href="http://dev.bumbea.com/site" title="Bumbea.com">
<img src="http://dev.bumbea.com/site/img/logo.png" alt="Bumbea"/>
</a>
</h1>
<section class="search-wrapper">
<div class="input-append search-container">
<input class="search-input" type="text" placeholder="¿Que estas buscando?"/>
<a class="search-btn" href="#" title="Buscar"><i class="icon-search"></i></a>
</div>
</section>
<section class="header-actions">
<ul class="unstyled actions-list">
<li>
<a class="custom-popover" id="log-in-btn" href="#">Ingresar</a>
</li>
</ul>
<a style="display:none;" id="log-in-continue-hidden" href="#">a</a>
</section>
</header>
<div class="navbar">
<div class="navbar-inner main-navbar">
<div class="container">
<a href="http://dev.bumbea.com/site" class="home-btn"><i class="icon-home"></i></a>
<div class="nav-collapse">
<ul class="nav">
<li class="divider-vertical"></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Categorias <b class="caret"></b></a>
<ul class="dropdown-menu categories-menu">
<li class="nav-header">Tecnología</li>
<li>
<ul class="sub-category">
<li>
<a href="#" title="">
<img class="category-image" src="http://dev.bumbea.com/site/img/categories/notebook-icon.png" alt=""/>
<span>Computadoras</span>
</a>
</li>
<li>
<a href="#" title="">
<img class="category-image" src="http://dev.bumbea.com/site/img/categories/phone-icon.png" alt=""/>
<span>Teléfonos</span>
</a>
</li>
<li>
<a href="#" title="">
<img class="category-image" src="http://dev.bumbea.com/site/img/categories/tv-icon.png" alt=""/>
<span>Televisores</span>
</a>
</li>
</ul>
</li>
<li class="divider"></li>
<li class="nav-header">Otros</li>
<li>
<ul class="sub-category">
<li>
<a href="#" title="">
<img class="category-image" src="http://dev.bumbea.com/site/img/categories/phone-icon.png" alt=""/>
<span>Teléfonos</span>
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider-vertical"></li>
<li><a href="#">Todo</a></li>
<li class="divider-vertical"></li>
<li><a href="#">Más Vistos</a></li>
<li class="divider-vertical"></li>
<li class="active"><a href="#">Destacados</a></li>
<li class="divider-vertical"></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Acerca de <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Ayuda</a></li>
<li class="divider"></li>
<li><a href="#">Equipo</a></li>
<li class="divider"></li>
<li><a href="#">Condiciones del servicio</a></li>
<li><a href="#">Politicas de privacidad</a></li>
<li class="divider"></li>
<li><a href="#">Copyright</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<!-- END NAVBAR -->
<div class="container">
<div class="top-content">
<ul class="breadcrumb breadcrumbs-list">
<li><a href="#">Inicio</a><span class="divider">/</span></li>
<li class="active">Destacados</li>
</ul>
<div class="notification-area">
<div class="alert alert-info">
<a class="close">×</a>
<strong>Información</strong> Tomá la mejor desición en bumbea.
</div>
</div>
<a href="http://dev.bumbea.com/site/review/step-1" title="Hacer review!" class="btn btn-large btn-primary make-review-btn">Hacer Review!</a>
</div>
<div class="main-content">
<ul class="thumbnails products-list">
<li class="product-item">
<div class="thumbnail product-wrapper">
<div class="product-image">
<a href="http://dev.bumbea.com/site/product/iphone-4s" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/resources/iphone-4.jpeg"/>
</a>
</div>
<div class="product-details">
<a class="product-category" href="#" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/categories/phone-icon.png"/>
</a>
<div class="product-rating">
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
</div>
<div class="product-content">
<a class="product-title" href="http://dev.bumbea.com/site/product/iphone-4s" title="product title">
<h5>Item 1</h5>
</a>
<div class="product-reviews">
<div class="reviews-resume">
<h4>6</h4>
<h5>Reviews</h5>
</div>
<div class="reviews-people">
<ul>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</li>
<li class="product-item">
<div class="thumbnail product-wrapper">
<div class="product-image">
<a href="http://dev.bumbea.com/site/product/iphone-4s" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/resources/macbook-pro.jpeg"/>
</a>
</div>
<div class="product-details">
<a class="product-category" href="#" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/categories/notebook-icon.png"/>
</a>
<div class="product-rating">
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star-empty"></i>
</div>
<div class="product-content">
<a class="product-title" href="http://dev.bumbea.com/site/product/iphone-4s" title="product title">
<h5>Item 1</h5>
</a>
<div class="product-reviews">
<div class="reviews-resume">
<h4>6</h4>
<h5>Reviews</h5>
</div>
<div class="reviews-people">
<ul>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</li>
<li class="product-item">
<div class="thumbnail product-wrapper">
<div class="product-image">
<a href="http://dev.bumbea.com/site/product/iphone-4s" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/resources/toshiba-satellite-pro-a300.jpeg"/>
</a>
</div>
<div class="product-details">
<a class="product-category" href="#" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/categories/notebook-icon.png"/>
</a>
<div class="product-rating">
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
</div>
<div class="product-content">
<a class="product-title" href="http://dev.bumbea.com/site/product/iphone-4s" title="product title">
<h5>Item 1</h5>
</a>
<div class="product-reviews">
<div class="reviews-resume">
<h4>6</h4>
<h5>Reviews</h5>
</div>
<div class="reviews-people">
<ul>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</li>
<li class="product-item">
<div class="thumbnail product-wrapper">
<div class="product-image">
<a href="http://dev.bumbea.com/site/product/iphone-4s" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/resources/galaxy-s.jpeg"/>
</a>
</div>
<div class="product-details">
<a class="product-category" href="#" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/categories/phone-icon.png"/>
</a>
<div class="product-rating">
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
</div>
<div class="product-content">
<a class="product-title" href="http://dev.bumbea.com/site/product/iphone-4s" title="product title">
<h5>Item 1</h5>
</a>
<div class="product-reviews">
<div class="reviews-resume">
<h4>6</h4>
<h5>Reviews</h5>
</div>
<div class="reviews-people">
<ul>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</li>
<li class="product-item">
<div class="thumbnail product-wrapper">
<div class="product-image">
<a href="http://dev.bumbea.com/site/product/iphone-4s" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/resources/iphone-5.jpeg"/>
</a>
</div>
<div class="product-details">
<a class="product-category" href="#" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/categories/phone-icon.png"/>
</a>
<div class="product-rating">
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star"></i>
</div>
<div class="product-content">
<a class="product-title" href="http://dev.bumbea.com/site/product/iphone-4s" title="product title">
<h5>Item 1</h5>
</a>
<div class="product-reviews">
<div class="reviews-resume">
<h4>6</h4>
<h5>Reviews</h5>
</div>
<div class="reviews-people">
<ul>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</li>
<li class="product-item">
<div class="thumbnail product-wrapper">
<div class="product-image">
<a href="http://dev.bumbea.com/site/product/iphone-4s" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/resources/samsung-led-tv.jpeg"/>
</a>
</div>
<div class="product-details">
<a class="product-category" href="#" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/categories/tv-icon.png"/>
</a>
<div class="product-rating">
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
</div>
<div class="product-content">
<a class="product-title" href="http://dev.bumbea.com/site/product/iphone-4s" title="product title">
<h5>Item 1</h5>
</a>
<div class="product-reviews">
<div class="reviews-resume">
<h4>6</h4>
<h5>Reviews</h5>
</div>
<div class="reviews-people">
<ul>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</li>
<li class="product-item">
<div class="thumbnail product-wrapper">
<div class="product-image">
<a href="http://dev.bumbea.com/site/product/iphone-4s" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/resources/iphone-3gs.jpeg"/>
</a>
</div>
<div class="product-details">
<a class="product-category" href="#" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/categories/phone-icon.png"/>
</a>
<div class="product-rating">
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
</div>
<div class="product-content">
<a class="product-title" href="http://dev.bumbea.com/site/product/iphone-4s" title="product title">
<h5>Item 1</h5>
</a>
<div class="product-reviews">
<div class="reviews-resume">
<h4>6</h4>
<h5>Reviews</h5>
</div>
<div class="reviews-people">
<ul>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</li>
<li class="product-item">
<div class="thumbnail product-wrapper">
<div class="product-image">
<a href="http://dev.bumbea.com/site/product/iphone-4s" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/resources/asus-s121.jpeg"/>
</a>
</div>
<div class="product-details">
<a class="product-category" href="#" title="product image">
<img alt="" src="http://dev.bumbea.com/site/img/categories/notebook-icon.png"/>
</a>
<div class="product-rating">
<i class="icon-star"></i>
<i class="icon-star"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
<i class="icon-star-empty"></i>
</div>
<div class="product-content">
<a class="product-title" href="http://dev.bumbea.com/site/product/iphone-4s" title="product title">
<h5>Item 1</h5>
</a>
<div class="product-reviews">
<div class="reviews-resume">
<h4>6</h4>
<h5>Reviews</h5>
</div>
<div class="reviews-people">
<ul>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
<li>
<a class="people-image" href="#" title="product image">
<img alt="" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
<style>
li.log-in-option .input-prepend input
{
width:165px;
}
li.log-in-option .input-prepend input.user-name
{
width:110px;
}
.popover-content ul.log-in-options li:last-child
{
margin-bottom: 0px;
}
li.log-in-option.devider
{
text-align: center;
}
li.log-in-option .user-image
{
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding: 0px;
border: 2px solid #2FA4E7;
width: 48px;
height: 48px;
}
li.log-in-option .input-prepend.user-name-container
{
margin: 22px 0px 0px 0px;
}
li.log-in-option .input-prepend
{
margin-bottom: 10px;
}
</style>
<!-- /container -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="http://dev.bumbea.com/site/js/vendor/jquery-1.8.2.min.js"><\/script>')</script>
<script src="http://dev.bumbea.com/site/js/vendor/bootstrap.min.js"></script>
<script src="http://dev.bumbea.com/site/js/vendor/jquery.masonry.min.js"></script>
<script src="http://dev.bumbea.com/site/js/vendor/jquery.infinitescroll.js"></script>
<script src="http://dev.bumbea.com/site/js/main.js"></script>
<script>
// Here goes the magic!
$(document).ready(function(){
var $container = $('.products-list');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector: '.product-item',
columnWidth: 225,
gutterWidth: 13
});
});
$container.infinitescroll({
navSelector : '#page-nav', // selector for the paged navigation
nextSelector : '#page-nav a', // selector for the NEXT link (to page 2)
itemSelector : '.box', // selector for all items you'll retrieve
loading: {
finishedMsg: 'No more pages to load.',
img: 'http://i.imgur.com/6RMhx.gif'
}
},
// trigger Masonry as a callback
function( newElements ) {
// hide new items while they are loading
var $newElems = $( newElements ).css({ opacity: 0 });
// ensure that images load before adding to masonry layout
$newElems.imagesLoaded(function(){
// show elems now they're ready
$newElems.animate({ opacity: 1 });
$container.masonry( 'appended', $newElems, true );
});
}
);
// Hide popovers when clicking utside of them
$(document).click(function(event){
// check the parents to see if we are inside of a popover. If the click came
// from outside the popover, then hide our popover
var $target = $(event.target);
// if($(event.target).parents('.custom-popover').length == 0)
if(!$target.hasClass('custom-popover') && !$target.parents().hasClass('popover'))
{
console.log("should hide popover's");
// $('.custom-popover').popover('hide');
$('.custom-popover').each(function(){
$(this).popover('hide');
});
}
});
var login_popover = (function(){
// var pepe = 'pepe';
return {
init : function(){
var complete_user_data = ($("#complete-user-data-flag").val() == 1);
console.log($("#complete-user-data-flag").val(), "VAL complete_user_data");
console.log(complete_user_data, "complete_user_data");
if(complete_user_data)
{
// Then show popover with the data the user must complete
// Get the data the user already has in order to init the popover
var user_name = "",
user_email = "pepe@pepe.com",
user_pass = true,
create_account_html = '<ul class="log-in-options">'+
'<li class="log-in-option">'+
'<img class="pull-left user-image" alt="User image" src="https://twimg0-a.akamaihd.net/profile_images/1121298010/anita-brick-499x499_normal.jpg"/>'+
'<div class="user-name-container input-prepend pull-right">'+
'<span class="add-on"><i class="icon-user"></i></span>'+
'<input class="user-name" id="name" name="name" type="text" placeholder="Nombre" value="'+user_name+'">'+
'</div>'+
'<div class="clearfix"></div>'+
'</li>'+
'<li class="log-in-option clearfix">'+
'<div class="input-prepend">'+
'<span class="add-on"><i class="icon-envelope"></i></span>'+
'<input id="email" name="email" type="text" placeholder="Email" value="'+user_email+'">'+
'</div>'+
'<div class="input-prepend">'+
'<span class="add-on"><i class="icon-key"></i></i></span>'+
'<input id="password" name="password" type="text" placeholder="Contraseña">'+
'</div>'+
'<div class="clearfix">'+
'<a href="#" class="pull-right btn btn-primary btn-mini" title="Crear cuenta">Crear cuenta</a>'+
'</div>'+
'</li>'+
'</ul>';
$("#log-in-btn").popover({
html:true,
placement:'bottom',
title:'Crear cuenta',
content:create_account_html
});
}
else
{
var login_html = '<ul class="log-in-options">'+
'<li class="log-in-option">'+
'<a href="#" class="btn-block zocial facebook">con Facebook</a>'+
'</li>'+
'<li class="log-in-option">'+
'<a href="#" class="btn-block zocial twitter">con Twitter</a>'+
'</li>'+
'<li class="log-in-option">'+
'<a href="#" class="btn-block zocial googleplus">con Google+</a>'+
'</li>'+
'<li class="log-in-option devider">'+
'<span>O</span>'+
'</li>'+
'<li class="log-in-option">'+
'<div class="input-prepend">'+
'<span class="add-on"><i class="icon-envelope"></i></span>'+
'<input id="email" name="email" type="text" placeholder="Email">'+
'</div>'+
'<div class="input-prepend">'+
'<span class="add-on"><i class="icon-key"></i></i></span>'+
'<input id="password" name="password" type="text" placeholder="Contraseña">'+
'</div>'+
'<div class="clearfix">'+
'<a href="#" id="log-in-continue" class="pull-right btn btn-primary btn-mini" title="Ingresar">Ingresar</a>'+
'</div>'+
'</li>'+
'</ul>';
$("#log-in-btn").popover({
html:true,
placement:'bottom',
title:'Ingresar',
content:login_html
});
}// END 'INGRESAR' POPOVER
}
}
}());
login_popover.init();
// $("#log-in-btn").popover({
// // $('#log-in-btn').data('popover', null).popover({
// html:true,
// placement:'bottom',
// title:'a',
// content:'b'
// });
$(".actions-list").delegate("#log-in-btn", "click", function(event){
event.preventDefault();
// $("#register-btn").popover('hide');
// We need to have a singleton for the popover instance, if not we are creating multiple popovers
// Rensantiate popover (troubles with create account and login popovers content)
// $("#log-in-btn").popover({
// $('#log-in-btn').data('popover', null).popover({
// html:true,
// placement:'bottom',
// title:'Ingresar',
// content:login_html
// });
// $('#log-in-btn').data('popover').options.title = 'Ingresar';
// $('#log-in-btn').data('popover').options.content = login_html;
// $("#log-in-btn").popover('show');
});
$(document).delegate("#log-in-continue", "click", function(event){
event.preventDefault();
console.log("continuing login ....");
// If we are here it's because the user wants to log-in with his email
// If it's his first time (we have no cookie), then redirect to complete user info before logging in
// If he has already logged in at least once (we will have the second magic cookie), just log-in him
// To implement this, we will make an ajax call to 'continue_login' controller
// There we are going to check if we have the second cookie, in that case we return this:
// response:'OK'/'ERROR', missing_user_data:false
// If we don't have the second cookie (first time user), then we return this
// response:'OK'/'ERROR', missing_user_data:true, user_data:{name:'pepe'||null, email:'email'||null, password:true||false}
// // First validate fields
// var fields_ok = true;
// if(fields_ok)
// {
// // Then do the AJAX CALL
// // THIS SIMULATES AJAX CALL RETURN ...
// var missing_user_data = true;
// if(missing_user_data)
// {
// // First, hide previous popover
// // $("#log-in-btn").popover('hide');
// // We need 'name', 'email', and 'password' for that user, get user data from controller response (he may have some data and some other data may be missing), and then show a popover
// var user_name = "",
// user_email = "pepe@pepe.com",
// user_pass = true,
// create_account_html = '<ul class="log-in-options">'+
// '<li class="log-in-option">'+
// '<a href="#" class="btn-block zocial googleplus">con Google+</a>'+
// '</li>'+
// '<li class="log-in-option devider">'+
// '<span>O</span>'+
// '</li>'+
// '<li class="log-in-option">'+
// '<div class="input-prepend">'+
// '<span class="add-on"><i class="icon-envelope"></i></span>'+
// '<input id="email" name="email" type="text" placeholder="Email">'+
// '</div>'+
// '<div class="input-prepend">'+
// '<span class="add-on"><i class="icon-key"></i></i></span>'+
// '<input id="password" name="password" type="text" placeholder="Contraseña">'+
// '</div>'+
// '<div class="clearfix">'+
// '<a href="#" class="pull-right btn btn-primary btn-mini" title="Crear cuenta">Crear cuenta</a>'+
// '</div>'+
// '</li>'+
// '</ul>';
// $("#log-in-btn").popover('hide');
// $('#log-in-btn').data('popover').options.title = 'Crear cuenta';
// $('#log-in-btn').data('popover').options.content = create_account_html;
// $("#log-in-btn").popover('show');
// // $("#log-in-continue").popover({
// // $("#log-in-continue-hidden").popover({
// // html:true,
// // placement:'bottom',
// // title:'Crear cuenta',
// // content:create_account_html
// // });
// }
// else
// {
// // User logged-in correctly, refresh page in order to show the user logged
// location.href = location.href;
// }
// }
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment