summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-03-13 17:20:24 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-03-13 17:20:24 -0800
commiteff9b899606f4797b51a6e26b7fd3cf87bb57d15 (patch)
tree82327b29b2b3fd114eb21e723c76193e139a99f2 /samples
parentd197a28a898228296600c8b87b4f37301004c195 (diff)
parent514eb596a424c5ff29675053731b8ec550382cda (diff)
downloadDotNetOpenAuth-eff9b899606f4797b51a6e26b7fd3cf87bb57d15.zip
DotNetOpenAuth-eff9b899606f4797b51a6e26b7fd3cf87bb57d15.tar.gz
DotNetOpenAuth-eff9b899606f4797b51a6e26b7fd3cf87bb57d15.tar.bz2
MVC RP project template now has the AJAX OpenID Selector.
Merge branch 'MVCselector' into v3.4
Diffstat (limited to 'samples')
-rw-r--r--samples/OpenIdRelyingPartyMvc/Controllers/UserController.cs4
-rw-r--r--samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj1
-rw-r--r--samples/OpenIdRelyingPartyMvc/Views/Home/Index.aspx1
-rw-r--r--samples/OpenIdRelyingPartyMvc/Views/User/LoginPopup.aspx207
4 files changed, 0 insertions, 213 deletions
diff --git a/samples/OpenIdRelyingPartyMvc/Controllers/UserController.cs b/samples/OpenIdRelyingPartyMvc/Controllers/UserController.cs
index fd22389..54121cf 100644
--- a/samples/OpenIdRelyingPartyMvc/Controllers/UserController.cs
+++ b/samples/OpenIdRelyingPartyMvc/Controllers/UserController.cs
@@ -20,10 +20,6 @@
return View("Index");
}
- public ActionResult LoginPopup() {
- return View("LoginPopup");
- }
-
public ActionResult Logout() {
FormsAuthentication.SignOut();
return Redirect("/Home");
diff --git a/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj b/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj
index 3255f53..21ded3e 100644
--- a/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj
+++ b/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj
@@ -121,7 +121,6 @@
<Content Include="Global.asax" />
<Content Include="Views\User\Index.aspx" />
<Content Include="Views\User\Login.aspx" />
- <Content Include="Views\User\LoginPopup.aspx" />
<Content Include="Web.config" />
<Content Include="Content\Site.css" />
<Content Include="Views\Home\Index.aspx" />
diff --git a/samples/OpenIdRelyingPartyMvc/Views/Home/Index.aspx b/samples/OpenIdRelyingPartyMvc/Views/Home/Index.aspx
index be4bd20..ba9ddfd 100644
--- a/samples/OpenIdRelyingPartyMvc/Views/Home/Index.aspx
+++ b/samples/OpenIdRelyingPartyMvc/Views/Home/Index.aspx
@@ -11,6 +11,5 @@
<p>Visit the
<%=Html.ActionLink("Members Only", "Index", "User") %>
area to trigger a login. </p>
- <p>Optionally, you can try out the <%=Html.ActionLink("JQuery login popup UX", "LoginPopup", "User")%>. </p>
<% } %>
</asp:Content>
diff --git a/samples/OpenIdRelyingPartyMvc/Views/User/LoginPopup.aspx b/samples/OpenIdRelyingPartyMvc/Views/User/LoginPopup.aspx
deleted file mode 100644
index e7bc18a..0000000
--- a/samples/OpenIdRelyingPartyMvc/Views/User/LoginPopup.aspx
+++ /dev/null
@@ -1,207 +0,0 @@
-<%@ Page Title="Popup Login sample" Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
-
-<!-- COPYRIGHT (C) 2009 Andrew Arnott. All rights reserved. -->
-<!-- LICENSE: Microsoft Public License available at http://opensource.org/licenses/ms-pl.html -->
-
-<html>
-<head>
- <title>OpenID login demo</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <link type="text/css" href="../../Content/theme/ui.all.css" rel="Stylesheet" />
- <link type="text/css" href="../../Content/css/openidlogin.css" rel="stylesheet" />
- <script type="text/javascript" src="../../Content/scripts/jquery-1.3.1.js"></script>
- <script type="text/javascript" src="../../Content/scripts/jquery-ui-personalized-1.6rc6.js"></script>
- <script>
- $(function() {
- $('#openidlogin').dialog({
- bgiframe: true,
-// autoOpen: true,
- modal: true,
- title: 'Login or Create new account',
- resizable: false,
- hide: 'clip',
- width: '420px',
- buttons: { },
- closeOnEscape: true,
- focus: function(event, ui) {
- var box = $('#openid_identifier')[0];
- if (box.style.display != 'none') {
- box.focus();
- }
- }
- });
-
- $('#loggedOut').dialog({
- bgiframe: true,
- autoOpen: false,
- title: 'Logged out',
- resizable: false,
- closeOnEscape: true,
- buttons: {
- "Ok": function() { $(this).dialog('close'); }
- }
- });
-
- $('#loginAction').click(function() {
- $('#openidlogin').dialog('open');
- return false;
- });
-
- $('#logoutAction').click(function() {
- // TODO: asynchronously log out.
- document.setClaimedIdentifier();
- //$('#loggedOut').dialog('open');
- return false;
- });
-
- //hover states on the static widgets
- $('.ui-button, ul#icons li').hover(
- function() { $(this).addClass('ui-state-hover'); },
- function() { $(this).removeClass('ui-state-hover'); }
- );
-
- document.usernamePlaceholder = "{username}";
-
- function isCompleteIdentifier(identifier) {
- return identifier && identifier != '' && identifier != 'http://' && identifier.indexOf(document.usernamePlaceholder) < 0;
- };
-
- function setSelection() {
- var box = $('#openid_identifier')[0];
- var usernamePlaceholderIndex = box.value.indexOf(document.usernamePlaceholder);
- if (usernamePlaceholderIndex >= 0) {
- box.setSelectionRange(usernamePlaceholderIndex + document.usernamePlaceholder.length);
- box.setSelectionRange(usernamePlaceholderIndex, usernamePlaceholderIndex + document.usernamePlaceholder.length);
- }
- };
-
- function completeLogin() {
- var box = $('#openid_identifier')[0];
- if (box.value.indexOf(document.usernamePlaceholder) >= 0) {
- alert('You need to type in your username first.');
- box.focus();
- setSelection();
- return;
- }
-
- if (!isCompleteIdentifier(box.value)) {
- alert(box.value + ' is not a valid identifier.');
- return;
- }
-
- var box = $('#openid_identifier')[0];
- $('#openidlogin').dialog('close');
- document.setClaimedIdentifier(box.value);
- $('#loginForm').submit();
- return box.value;
- };
-
- document.selectProvider = function(button, identifierTemplate) {
- var box = $('#openid_identifier')[0];
- $('#openidlogin .provider').removeClass('highlight');
- if (isCompleteIdentifier(identifierTemplate)) {
- box.value = identifierTemplate;
- $('#openidlogin .inputbox').slideUp();
- completeLogin();
- } else {
- if (this.lastIdentifierTemplate == identifierTemplate) {
- $('#openidlogin .inputbox').slideToggle();
- } else {
- $(button).addClass('highlight').show();
- $('#openidlogin .inputbox').slideDown();
- box.value = identifierTemplate;
- if (box.value == null || box.value == '') {
- box.value = 'http://';
- }
-
- setSelection();
- }
-
- box.focus();
- }
- this.lastIdentifierTemplate = identifierTemplate;
- };
-
- $('#loginButton').click(function() {
- completeLogin();
- return true;
- });
-
- document.openid_identifier_keydown = function(e) {
- if (window.event && window.event.keyCode == 13) {
- $('#loginButton').effect('highlight');
- completeLogin();
- }
- };
-
- document.setClaimedIdentifier = function(identifier) {
- if (identifier) {
- // Apply login
- $('#loginAction').hide();
- $('#logoutAction').show();
- } else {
- // Apply logout
- $('#loginAction').show();
- $('#logoutAction').hide();
- }
- $('#claimedIdentifierLabel')[0].innerText = identifier ? identifier : '';
- };
-
- $('#logoutAction').hide();
- });
- </script>
-
- <style>
- body{ font: 62.5% "Trebuchet MS", sans-serif;}
- .ui-button {padding: .4em .5em .4em 20px;text-decoration: none;position: relative;}
- .ui-button span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
- #loginButton {padding: 0.1em 0.4em 0.1em 20px}
- </style>
-</head>
-<body>
-
-<div style="margin-top: 10px">
- <p style="float: right; margin-top: 0px">
- <a href="#" id="loginAction" class="ui-button ui-state-default ui-corner-all"><span class="ui-icon ui-icon-locked"></span>Login / New user</a>
- <a href="#" id="logoutAction" class="ui-button ui-state-default ui-corner-all"><span class="ui-icon ui-icon-unlocked"></span>Logout</a>
- </p>
- <p style="text-align: center; margin-top: 3px; font-family: Arial" id="claimedIdentifierLabel"/>
-</div>
-
-<div id="openidlogin" class="ui-widget-content">
- <p>Log in with an account you already use:</p>
- <div class="large buttons">
- <div class="provider" onclick="document.selectProvider(this, 'https://www.google.com/accounts/o8/id')"><div><img src="../../Content/images/google.gif"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, 'https://me.yahoo.com/')"><div><img src="../../Content/images/yahoo.gif"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, 'http://openid.aol.com/{username}')"><div><img src="../../Content/images/aol.gif"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, '')"><div><img src="../../Content/images/openid.gif"/></div></div>
- </div>
- <div class="small buttons">
- <div class="provider" onclick="document.selectProvider(this, 'http://www.flickr.com/photos/{username}')"><div><img src="http://flickr.com/favicon.ico"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, 'https://www.myopenid.com/')"><div><img src="http://myopenid.com/favicon.ico"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, 'http://{username}.livejournal.com/')"><div><img src="http://www.livejournal.com/favicon.ico"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, 'https://technorati.com/people/technorati/{username}/')"><div><img src="http://technorati.com/favicon.ico"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, 'https://{username}.wordpress.com/')"><div><img src="http://www.wordpress.com/favicon.ico"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, 'http://{username}.blogspot.com/')"><div><img src="http://blogspot.com/favicon.ico"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, 'https://myvidoop.com/')"><div><img src="http://www.myvidoop.com/favicon.ico"/></div></div>
- <div class="provider" onclick="document.selectProvider(this, 'https://pip.verisignlabs.com/')"><div><img src="http://pip.verisignlabs.com/favicon.ico"/></div></div>
- </div>
- <% Html.BeginForm("Authenticate", "User", FormMethod.Post, new { id = "loginForm" }); %>
- <div class="inputbox">
- <input type="text" id="openid_identifier" name="openid_identifier" onKeyDown="document.openid_identifier_keydown(this)" onFocus="$('#loginButton').addClass('ui-state-hover')" onBlur="$('#loginButton').removeClass('ui-state-hover')" />
- <a href="#" id="loginButton" class="ui-button ui-state-default ui-corner-all" style="color: white; font-size: 10pt"><span class="ui-icon ui-icon-key"></span>Login</a>
- </div>
- <% Html.EndForm(); %>
- <p><a href="javascript:$('#openidlogin .help').slideToggle()">Get help logging in</a></p>
- <div class="help">
- <p>If you don't have an account with any of these services, you can
- <a href="https://www.myopenid.com/signup" target="OpenIdProvider">create one</a>.
- <p>If you have logged into this site previously, click the same button you did last time.</p>
- </div>
-</div>
-
-<div id="loggedOut" class="ui-widget-content">
- <p>You have been logged out.</p>
-</div>
-</body>
-</html> \ No newline at end of file