Subversion Repositories SmartDukaan

Rev

Rev 1720 | Rev 1726 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <title>Phones I Own | Saholic</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        
        <!--link rel="stylesheet" href="/css/phonesiown.css" type="text/css" /-->
        <style>
div.productItem {
        float:left;
        width: 250px;
        padding: 7px;
}

div.productImg  {
        float: left;
}

a       {
        color: #0066CC;
        outline: medium none;
        text-decoration: none;
}

.title  {
        font-weight: bold;
        line-height: 13px;
}

div.productItem div.productDesp {
        font-size: 12px;
        line-height: 18px;
        margin-top: 5px;
}

.yellow-image {
    background: url("spriteme1.png") repeat-x scroll -10px -750px transparent;
    border: 1px solid #BFA864;
    color: #000000;
    cursor: pointer;
    float: left;
    font-size: 13px;
    font-weight: bold;
    height: 18px;
    padding: 4px 7px;
    text-align: center;
}

div.bigImgButton        {
        float: right;
}

.yellow-image input.button {
    background: none repeat scroll 0 0 transparent;
    border: medium none;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}

input, select, textarea {
    outline: medium none;
}
        </style>
</head>
<body>
        <img src="http://saholic.com/images/saholic-main.jpg" />
        <hr />
        <div>
                <form action="/fb/my-phones" method="get">
                        Which phone do you own?&nbsp;&nbsp;&nbsp;
                        <input type="text" name="q" />
                        <input type="submit" value="Search" />
                </form>
        </div>
        <hr />
#set($resultCount = $action.getResultCount())

#if($resultCount > 0)
        <div>
                <p>We found following phones matching with your search query:</p>
        #set($results = $action.getResults())
        #set($snippets =  $action.getSnippets())
        
        #foreach($entityId in $results)
                $snippets.get($entityId)
        #end
        </div>
#end
        <div id="fb-root"></div>
        <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script> 
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script> 
        <script type="text/javascript"> 
 
FB.init({
        appId  : '179519275432255',
        status : true, // check login status
        cookie : true, // enable cookies to allow the server to access the session
        xfbml  : true  // parse XFBML
});
 
 
function publishStream(productName, productURL, productImgURL, productDesc)     {
FB.ui({
                method: 'feed',
                name: productName,
                link: productURL,
                picture: productImgURL,
                caption: 'Phones I Own | Saholic.com',
                description: productDesc,
                message: 'Check out the phone I own!'
        },
        function(response) {
                if (response && response.post_id) {
                        // Post was published
                } else {
                        // Post was not published
                }
        });
}
$(function(){
        $('input.publish-button').click(function()      {
                var id = $(this).attr('id').replace('post-badge-', '');
                var productName = $(this).html();
                var productUrl = $('#url-' + id).html();
                var imageUrl = $('#img-' + id).attr('src');
                var desc = "";

                $('#desc-' + id).children().each(function(i, item){
                        desc += $(item).html() + ', ';
                });
                desc = jQuery.trim(desc);

                publishStream(productName, productUrl, imageUrl, desc);
        });
});
        </script>
</body>
</html>