( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<html>
<head>
<title>Mimy</title>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=medium-dpi" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/wall.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="css/mytv.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="css/font.css" type="text/css" charset="utf-8" />
<!-- onload="checkPreAuth()"-->
</head>
<body bgcolor="#f7f7f7" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id="fb-root"></div>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" style="background-image:url(images/newprofile.png); background-position:left; background-position:top">
<tr>
<td valign="top" width="100%" height="40" >
<table border="0" cellpadding="0" cellspacing="0" height="40" width="100%" class="header-contX" >
<tr>
<td width="53" height="40" ><a href="index.html"><img src="images/homey.png" height="40" style="-webkit-transform: translate3d(0,0,0); "></a></td>
<td width="100%" height="40" align="right" style="color: #FFF" background="images/app_03.png" > <a href="#" class="reload" id="1"><span id="check"></span></a></td>
<td width="44" height="40"><a href="index.html"><img src="images/app_04.png" width="44" height="40" alt=""> </a></td>
<td width="44" height="40" > <img src="images/app_05.png" width="44" height="40" alt="" class="menu-trigger" > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="55" valign="top">
<table border="0" cellpadding="0" cellspacing="0" height="55">
<tr>
<td width="153" height="55" >
<img src="images/signin.png" width="190" height="55" alt=""></td>
<td width="100%" height="55" bgcolor="" >
</td>
<td width="54" height="55" > </td>
<td width="53" height="55" > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" valign="top">
<section class="panel " style="padding:10px ; background-color:#5dcff3; background:none; color:#FFF">
<span class="h3 animated pulse" id="notice" style="color:#FFF;"></span><br>
<a onClick="getInfo();" class="btn btn-facebook btn-block m-b-sm" id="ona"><i class="icon-facebook pull-left"></i>Sign in now</a> <br>
<button class="btn btn-facebook btn-block m-b-sm" onClick="revoke()">Revoke Permissions</button><br>
<button class="btn btn-block" onClick="logout()">Logout</button>
<br>
<button class="btn btn-facebook btn-block m-b-sm" onClick="getInfo()" style="display:none" id="getinfo"><i class="icon-facebook pull-left"></i>Finish</button>
<p class="text-muted text-center" style="color:#FFF"> </p>
</section>
</td>
</tr>
</table>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script src="js/openfb.js"></script>
<script type="text/javascript">
openFB.init({appId: '116217261776250'});
function login() {
openFB.login(
function(response) {
if(response.status === 'connected') {
var ona = document.getElementById('ona');
ona.style.visibility = "hidden";
ona.style.display = "none";
ona.style.width = "0px";
document.getElementById('notice').innerHTML = "Finish";
var getinfo = document.getElementById('getinfo');
getinfo.style.visibility = "visible";
getinfo.style.display = "block";
/*alert('Facebook login succeeded, got access token: ' + response.authResponse.token);*/
$('#notice').html('Successfully Connected to Facebook ');
} else {
/* alert('Facebook login failed: ' + response.error);*/
$('#notice').html('Facebook login failed ');
}
}, {scope: 'email,read_stream,publish_stream'});
}
function share() {
openFB.api({
method: 'POST',
path: '/me/feed',
params: {
message: 'Welcome to Vshare'
},
success: function() {
alert('the item was posted on Facebook');
},
error: errorHandler});
}
function revoke() {
openFB.revokePermissions(
function() {
alert('Permissions revoked');
},
errorHandler);
}
function logout() {
openFB.logout(
function() {
alert('Logout successful');
},
errorHandler);
}
function errorHandler(error) {
alert(error.message);
}
function getInfo() {
openFB.api({
path: '/me',
success: function(data) {
console.log(JSON.stringify(data));
$('#notice').html('Now Connecting to vshare...');
var catalogname = data.name;
var user_name = data.name;
var user_email = data.email;
var catalogid = data.id;
var gender = data.gender;
$.get(mimiServer+'service/account/account.php?facebookLogin=facebookLogin&catalogid='+data.id+'&user_name='+user_name+'&user_email='+user_name+'&gender='+gender+'', formData, function(data) {
var returnValue = data;
if(7 == returnValue){
localStorage.setItem('myaccount', catalogid);
localStorage.setItem('username', user_name);
localStorage.setItem('pwd', user_name);
openFB.api({
method: 'POST',
path: '/me/feed',
params: {
message: 'Checking in out Vshare'
/* message: document.getElementById('Message').value || 'Testing Facebook APIs'*/
},
success: function() {
window.location = "profile3.html";
return;
},
error: errorHandler});
}
if(5 == returnValue){
// $("#doLogin").removeAttr("disabled");
$('#notice').html('Oops! Sign in failed. ');
//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});
return;
} else {
localStorage.setItem('myaccount', catalogid);
localStorage.setItem('username', username);
localStorage.setItem('pwd', username);
window.location = "index.html";
}//end else
}, 'html');
/*
document.getElementById("userName").innerHTML = data.name;
document.getElementById("userPic").src = 'http://graph.facebook.com/' + data.id + '/picture?type=small';*/
},
error: errorHandler});
}
</script>
<script src="js/jquery-1.8.0.min.js"></script>
</body>
</html>