This commit is contained in:
David Mulder 2011-03-21 11:57:20 -06:00
Родитель b9223ec0dd
Коммит 802874a1bd
3 изменённых файлов: 26 добавлений и 32 удалений

Просмотреть файл

@ -1,28 +1,14 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default2" %> <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default2" %>
<asp:Content ID="Head" ContentPlaceHolderID="Head" Runat="Server"> <asp:Content ID="Head" ContentPlaceHolderID="Head" Runat="Server">
<script type="text/javascript">
function GetEmail()
{
FB.api('/me', function(response) {
document.getElementById('email').value = response.email;
document.getElementById('name').value = response.name;
if (response.email != null) {
document.forms["userform"].submit();
}
});
}
window.onload=GetEmail;
</script>
</asp:Content> </asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="Body" Runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="Body" Runat="Server">
<form id="userform" method="post" action="RankingPage.aspx"> <!-- <form id="userform" method="post" action="RankingPage.aspx">
<input type="hidden" id="email" /> <input type="hidden" id="email" />
<input type="hidden" id="name" /> <input type="hidden" id="name" />
</form> </form> -->
<!-- Everything we want to see in the page needs to go here --> <!-- Everything we want to see in the page needs to go here -->
<p>Somebody did something that we see here.</p> <p>Somebody did something that we see here.</p>
</asp:Content> </asp:Content>

Просмотреть файл

@ -30,6 +30,21 @@
_uacct = "UA-76510-1"; _uacct = "UA-76510-1";
urchinTracker(); urchinTracker();
</script> </script>
<script type="text/javascript">
function GetEmail()
{
FB.api('/me', function(response) {
document.getElementById('email').value = response.email;
document.getElementById('name').value = response.name;
//if (response.email != null) {
// document.forms["userform"].submit();
//}
});
}
//window.onload=GetEmail;
</script>
</head> </head>
@ -79,11 +94,12 @@
window.fbAsyncInit = function() { window.fbAsyncInit = function() {
FB.init({appId: '200500963301473', status: true, cookie: true, FB.init({appId: '200500963301473', status: true, cookie: true,
xfbml: true}); xfbml: true});
FB.Event.subscribe('auth.login', function(response) { FB.Event.subscribe('auth.login', function(response) {
document.forms["default"].submit(); GetEmail();
document.forms["rank"].submit();
}); });
FB.Event.subscribe('auth.logout', function(response) { FB.Event.subscribe('auth.logout', function(response) {
document.forms["default"].submit(); document.forms["default"].submit();
}); });
}; };
(function() { (function() {
@ -96,6 +112,10 @@
</script> </script>
<form id="default" method="post" action="Default.aspx"></form> <form id="default" method="post" action="Default.aspx"></form>
<form id="rank" method="post" action="RankingPage.aspx">
<input type="hidden" id="email" />
<input type="hidden" id="name" />
</form>
<div id="content-header"><h2><!--BEGIN PAGE TITLE-->The Voices of the Mono Project<!--END PAGE TITLE--></h2></div> <div id="content-header"><h2><!--BEGIN PAGE TITLE-->The Voices of the Mono Project<!--END PAGE TITLE--></h2></div>
<div id="wrapper" class="wide"> <div id="wrapper" class="wide">

Просмотреть файл

@ -1,23 +1,11 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="RankingPage.aspx.cs" Inherits="RankingPage" %> <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="RankingPage.aspx.cs" Inherits="RankingPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">
<script type="text/javascript">
function LoggedOut()
{
FB.api('/me', function(response) {
if (response.email == null) {
document.forms["loggedout"].submit();
}
});
}
window.onload=LoggedOut;
</script>
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" Runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Body" Runat="Server">
<form id="loggedout" method="post" action="Default.aspx">
</form>
<div id="leftcolumn"> <div id="leftcolumn">
<table> <table>