Permalink
Browse files

Added authentication box

  • Loading branch information...
1 parent 3498f5a commit 8f9f5675f5b6307a2fb13e9911e1cb9a7ac6d738 @robrighter committed Apr 24, 2010
Showing with 131 additions and 13 deletions.
  1. +43 −1 dynamic/css/site.sass
  2. +10 −0 dynamic/index.haml
  3. +43 −0 prod-buildout/css/site.css
  4. +11 −0 prod-buildout/index.html
  5. +11 −5 prod-buildout/js/site.js
  6. +1 −1 prod-buildout/user.js
  7. +11 −5 static/js/site.js
  8. +1 −1 static/user.js
View
@@ -349,4 +349,46 @@ em
color: #666666
margin: 0
text-align: center
- font-size: 12px
+ font-size: 12px
+
+#authbox
+ width: 400px
+ height: 110px
+ +borderRadius(5px)
+ background-color: #ffffff
+ border: 6px solid
+ border-color= !green
+ margin-left: 170px
+ position: absolute
+ top: 200px
+ overflow: hidden
+ padding: 25px
+ display: none
+
+#authbox h1
+ font-size: 16px
+ color= !textgreen
+
+#authbox p
+ color: #666666
+
+#authbox img
+ float: left
+ cursor: pointer
+
+
+.cancellink
+ float: left
+ width: 60px
+ font-size: 12px
+ text-align: right
+ margin-left: 155px
+ color: #666666
+ margin-right: 15px
+ margin-top: 5px
+
+.cancellink a
+ color: #666666
+ text-decoration: underline
+ cursor: pointer
+
View
@@ -61,3 +61,13 @@
%div{:class=>'button add'}= '+'
%div{:class=>'button minus',:onClick=>'tw.unfollowByScreenName("montytwitter",alert("Done."));'}= '-'
%div{:style=>'clear:all;'}
+
+ #authbox
+ %h1 Please sign in with Twitter
+ %p Please click on the button below to sign in to Friendagon via Twitter.
+ %div{:class=>'cancellink'}
+ %a{:onClick=>'hideAuthenticate();return false;'}= 'Cancel'
+ %span= ' or'
+ %a{:onClick=>'openAuthenticateBox();return false;',:href=>"#"}
+ %img{:src=>'http://apiwiki.twitter.com/f/1242697715/Sign-in-with-Twitter-darker.png'}
+
@@ -366,3 +366,46 @@ em {
margin: 0;
text-align: center;
font-size: 12px; }
+
+#authbox {
+ width: 400px;
+ height: 110px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ border-radius: 5px;
+ background-color: #ffffff;
+ border: 6px solid;
+ border-color: #90d55c;
+ margin-left: 170px;
+ position: absolute;
+ top: 200px;
+ overflow: hidden;
+ padding: 25px;
+ display: none; }
+
+#authbox h1 {
+ font-size: 16px;
+ color: #58b33f; }
+
+#authbox p {
+ color: #666666; }
+
+#authbox img {
+ float: left;
+ cursor: pointer; }
+
+.cancellink {
+ float: left;
+ width: 60px;
+ font-size: 12px;
+ text-align: right;
+ margin-left: 155px;
+ color: #666666;
+ margin-right: 15px;
+ margin-top: 5px; }
+
+.cancellink a {
+ color: #666666;
+ text-decoration: underline;
+ cursor: pointer; }
@@ -91,6 +91,17 @@
</div>
<div style='clear:all;'></div>
</div>
+ <div id='authbox'>
+ <h1>Please sign in with Twitter</h1>
+ <p>Please click on the button below to sign in to Friendagon via Twitter.</p>
+ <div class='cancellink'>
+ <a onClick='hideAuthenticate();return false;'>Cancel</a>
+ <span> or</span>
+ </div>
+ <a href='#' onClick='openAuthenticateBox();return false;'>
+ <img src='http://apiwiki.twitter.com/f/1242697715/Sign-in-with-Twitter-darker.png' />
+ </a>
+ </div>
</div>
</div>
</body>
@@ -24,23 +24,29 @@ var setProfile = function(user){
};
var unfollow = function(screenname,callback){
+ authenticate();
$.getJSON('/__unfollow?screen_name='+screenname, function(data){
- window.open('./oauth','Connect with Twitter','menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes,width=800,height=400');
- console.log(data);
if(data.error){
- console.log('The user is NOT authenticated');
authenticate();
}
else{
- console.log('SUCCESS!!!!');
callback();
}
});
}
var authenticate = function(){
- console.log('starting oauth sequence...');
+ $("body").animate({ scrollTop: 0 }, 500);
+ $("#authbox").fadeIn('slow');
+}
+
+var openAuthenticateBox = function(){
window.open('./oauth','Connect with Twitter','menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes,width=800,height=400');
+ hideAuthenticate();
+}
+
+var hideAuthenticate = function(){
+ $("#authbox").fadeOut('slow');
}
var clearList = function() {
@@ -1 +1 @@
-var theuser = '_uncle_slam_';
+var theuser = 'robrighter';
View
@@ -24,23 +24,29 @@ var setProfile = function(user){
};
var unfollow = function(screenname,callback){
+ authenticate();
$.getJSON('/__unfollow?screen_name='+screenname, function(data){
- window.open('./oauth','Connect with Twitter','menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes,width=800,height=400');
- console.log(data);
if(data.error){
- console.log('The user is NOT authenticated');
authenticate();
}
else{
- console.log('SUCCESS!!!!');
callback();
}
});
}
var authenticate = function(){
- console.log('starting oauth sequence...');
+ $("body").animate({ scrollTop: 0 }, 500);
+ $("#authbox").fadeIn('slow');
+}
+
+var openAuthenticateBox = function(){
window.open('./oauth','Connect with Twitter','menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes,width=800,height=400');
+ hideAuthenticate();
+}
+
+var hideAuthenticate = function(){
+ $("#authbox").fadeOut('slow');
}
var clearList = function() {
View
@@ -1 +1 @@
-var theuser = '_uncle_slam_';
+var theuser = 'robrighter';

0 comments on commit 8f9f567

Please sign in to comment.