-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
202 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
pre { | ||
overflow-y:scroll; | ||
overflow-x: auto; | ||
height: 100%; | ||
background-color: #f0f6fa; | ||
border: 1px solid #CCCCCC; | ||
border-width: 1px 0; | ||
padding: 10px; | ||
margin: 10px 40px; | ||
clear: both; | ||
} | ||
|
||
html,body { | ||
height: 95%; | ||
} | ||
|
||
.method-container { | ||
float: right; | ||
margin-right: 40px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.button-container { | ||
float: left; | ||
margin-left: 40px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
/* | ||
Button styling is a modified copy of Tom Raspo's Simple Web Buttons. | ||
Check it out at: http://www.lab.tommasoraspo.com/simple-web-buttoms/ | ||
*/ | ||
|
||
button{ | ||
display: inline-block; | ||
text-decoration: none; | ||
font: bold 12px/12px HelveticaNeue, Arial; | ||
padding: 8px 11px; | ||
color: #555; | ||
border: 1px solid #dedede; | ||
-webkit-border-radius: 3px; | ||
-moz-border-radius: 3px; | ||
border-radius: 3px; | ||
background: #bdbdbd; | ||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cacaca', endColorstr='#aeaeae'); /* IE */ | ||
background: -webkit-gradient(linear, left top, left bottom, from(#cacaca), to(#aeaeae)); /* WebKit */ | ||
background: -moz-linear-gradient(top, #cacaca, #aeaeae); | ||
border-color: #b5b5b5 #a1a1a1 #8f8f8f; | ||
color: #555; | ||
text-shadow: 0 1px 0 #d4d4d4; | ||
-webkit-box-shadow: 0 1px 1px #c9c9c9, inset 0 1px 0 #d7d7d7; | ||
-moz-box-shadow: 0 1px 1px #c9c9c9, inset 0 1px 0 #d7d7d7; | ||
box-shadow: 0 1px 1px #c9c9c9, inset 0 1px 0 #d7d7d7; | ||
} | ||
|
||
button:hover{ | ||
background: #c2c2c2; | ||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bcbcbc', endColorstr='#c2c2c2'); /* IE */ | ||
background: -webkit-gradient(linear, left top, left bottom, from(#bcbcbc), to(#c2c2c2)); /* WebKit */ | ||
background: -moz-linear-gradient(top, #bcbcbc, #c2c2c2); | ||
border-color: #989898 #8e8e8e #878787; | ||
text-shadow: 0 1px 0 #dadada; | ||
-webkit-box-shadow: 0 1px 1px #cdcdcd, inset 0 1px 0 #ccc; | ||
-moz-box-shadow: 0 1px 1px #cdcdcd, inset 0 1px 0 #ccc; | ||
box-shadow: 0 1px 1px #cdcdcd, inset 0 1px 0 #ccc; | ||
} | ||
|
||
button:disabled{ | ||
color: #888; | ||
background: #f4f4f4; | ||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#efefef', endColorstr='#f8f8f8'); /* IE */ | ||
background: -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#f8f8f8)); /* WebKit */ | ||
background: -moz-linear-gradient(top, #efefef, #f8f8f8); | ||
border-color: #c7c7c7 #c3c3c3 #bebebe; | ||
text-shadow: 0 1px 0 #fdfdfd; | ||
-webkit-box-shadow: 0 1px 1px #ebebeb, inset 0 1px 0 #f3f3f3; | ||
-moz-box-shadow: 0 1px 1px #ebebeb, inset 0 1px 0 #f3f3f3; | ||
box-shadow: 0 1px 1px #ebebeb, inset 0 1px 0 #f3f3f3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="auth"> | ||
<head> | ||
<title>AngularFire Auth Manual Tests</title> | ||
|
||
<!-- Angular --> | ||
<script src="../../bower_components/angular/angular.min.js"></script> | ||
|
||
<!-- Firebase --> | ||
<script src="../../bower_components/firebase/firebase.js"></script> | ||
|
||
<!-- AngularFire --> | ||
<script src="../../dist/angularfire.js"></script> | ||
|
||
|
||
<!-- AngularFire --> | ||
<script src="auth.js"></script> | ||
|
||
<!-- Custom CSS --> | ||
<link rel="stylesheet" href="auth.css"> | ||
</head> | ||
<body ng-controller="MainCtrl"> | ||
|
||
<!-- Radio Buttons to Pick AuthMode (popup or redirect) --> | ||
<div class="method-container"> | ||
<input type="radio" ng-model="authMode" value="popup">Popup | ||
<input type="radio" ng-model="authMode" value="redirect">Redirect | ||
</div> | ||
|
||
<!-- Login Buttons --> | ||
<div class="button-container"> | ||
<button ng-click="login('twitter')" ng-disabled="data.authData.provider=='twitter'">Twitter</button> | ||
<button ng-click="login('facebook')" ng-disabled="data.authData.provider=='facebook'">Facebook</button> | ||
<button ng-click="login('github')" ng-disabled="data.authData.provider=='github'">GitHub</button> | ||
<button ng-click="login('google')" ng-disabled="data.authData.provider=='google'">Google</button> | ||
<button ng-click="anonymous()" ng-disabled="data.authData.provider=='anonymous'">Anonymous</button> | ||
<button ng-click="logout()" ng-disabled="data.authData == null">Logout</button> | ||
</div> | ||
|
||
<pre>{{prettyData()}}</pre> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var app = angular.module('auth',['firebase']); | ||
|
||
app.controller('MainCtrl',function($scope,$firebaseAuth,$location){ | ||
|
||
var ref = new Firebase('https://jrtechnical-testing.firebaseio.com/authtesting'); | ||
|
||
var auth = $firebaseAuth(ref); | ||
|
||
$scope.data = {}; | ||
|
||
auth.$bindTo($scope,'data.authData'); | ||
|
||
$scope.prettyData = function(){ | ||
return angular.toJson($scope.data.authData,true); | ||
}; | ||
|
||
$scope.authMode=$location.search().authMode || 'popup'; | ||
|
||
$scope.$watch('authMode',function(newValue, oldValue){ | ||
if(newValue !== oldValue){ | ||
$location.search('authMode',newValue); | ||
} | ||
}); | ||
|
||
$scope.login = function (provider){ | ||
switch ($scope.authMode) { | ||
case 'popup' : | ||
return auth.$authWithOAuthPopup(provider); | ||
case 'redirect' : | ||
return auth.$authWithOAuthRedirect(provider); | ||
default : | ||
throw new Error('authMode not set correctly'); | ||
} | ||
}; | ||
|
||
$scope.anonymous = auth.$authAnonymously; | ||
$scope.logout = auth.$unauth; | ||
|
||
}); |