Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better Facebook sign-in button.

  • Loading branch information...
commit 6368c168cf42ae4a2ec6b37e7bd25f73a8d1a36d 1 parent f44cba6
@akoprow akoprow authored
View
BIN  resources/img/facebook_signin.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
3  resources/style.css
@@ -22,6 +22,9 @@
.search-pubDate {
color: dimgrey;
}
+.userbox {
+ float: right;
+}
.username {
color: lime;
}
View
11 src/facebook.opa
@@ -65,14 +65,9 @@ Please re-run your application with: --fb-config option")
xhtml =
login_url = FBA.user_login_url([], redirect)
- WBootstrap.Button.make(
- { button:
- <img style="width:18px; height:18px; vertical-align:top;" title="Facebook" src="https://opalang.org/sso/img/fb-icon.png" alt="Connect with Facebook" />
- <span>Facebook</>
- , callback: function(_) { Client.goto(login_url) }
- },
- []
- )
+ <a onclick={function (_) { Client.goto(login_url) }}>
+ <img src="resources/img/facebook_signin.png" />
+ </>
function login(token) {
match (FBA.get_token_raw(token, redirect)) {
View
14 src/webshell.opa
@@ -60,9 +60,7 @@ function login_box() {
function block(content) {
<h3 style="float: right">{content}</>
}
- login =
- prompt = <a>You can sign in with:</>
- block(<>{prompt}{FacebookConnect.xhtml}</>)
+ login = <>{FacebookConnect.xhtml}</>
logout =
function do_logout(_) {
Login.set_current_user({guest})
@@ -71,10 +69,12 @@ function login_box() {
name = <a>{Login.get_current_user_name()}</>
button = WBootstrap.Button.make({ button: <>Logout</>, callback: do_logout}, [])
block(<>{button}{name}</>)
- match (Login.get_current_user()) {
- case {guest}: login
- default: logout
- }
+ content =
+ match (Login.get_current_user()) {
+ case {guest}: login
+ default: logout
+ }
+ <span class=userbox>{content}</>
}
function page() {
Please sign in to comment.
Something went wrong with that request. Please try again.