-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Login, signout and starting self registration
- Loading branch information
Greg Davis
committed
May 4, 2012
1 parent
c9c0e1e
commit 9e631b3
Showing
13 changed files
with
413 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@import url("reusableStyles.css"); | ||
@import url("../js/dojo-release-1.7.2-src/larson/login/resources/loginForm.css"); | ||
@import url("../js/dojo-release-1.7.2-src/larson/login/resources/register.css"); | ||
|
||
/* main application styles */ | ||
|
||
body { | ||
font-family: Tahoma, Verdana, sans-serif; | ||
font-size: .8em; | ||
line-height: 1.3em; | ||
margin: 30px; | ||
padding: 0; | ||
} | ||
|
||
a { | ||
color: #000; | ||
} | ||
a:hover { | ||
color: #666; | ||
} | ||
|
||
.sideBar { | ||
width: 200px; | ||
} | ||
|
||
.inlineError { | ||
font-size: .85em; | ||
color: red; | ||
line-height: 1.5em; | ||
} | ||
|
||
.plainTextButton .dijitButtonNode { | ||
border: 0; | ||
padding: 0; | ||
} | ||
|
||
.plainTextButtonHover .dijitButtonNode .dijitButtonText { | ||
color: #666; | ||
text-decoration: underline; | ||
} | ||
|
||
.larson .dijitButton.cancelButton .dijitButtonNode { | ||
background: none; | ||
border: 0; | ||
box-shadow: none; | ||
-moz-box-shadow: none; | ||
} | ||
.larson .dijitButton.cancelButton .dijitButtonNode .dijitButtonText { | ||
text-decoration: underline; | ||
} | ||
.larson .dijitButtonHover.cancelButton .dijitButtonNode .dijitButtonText { | ||
text-decoration: none; | ||
} |
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,62 @@ | ||
/* styles for text */ | ||
.times { font-family: Times New Roman, Times, serif; letter-spacing: -1px; } | ||
.helvetica { font-family: Helvetica, Arial, sans-serif; } | ||
.bold { font-weight: bold; } | ||
.bigText { font-size: 1.3em; } | ||
.grayText { color: #666; } | ||
.whiteText { color: #fff; } | ||
.whiteText a { color: #fff; } | ||
.whiteText a:hover { color: #efefef; } | ||
|
||
/*basic layout styles */ | ||
.clearFix { clear: both; } | ||
.floatRight { float: right; } | ||
.floatLeft { float: left; } | ||
.spaceAfter { padding-bottom: 15px; } | ||
.spacer { height: 20px; } | ||
.smallSpacer { height: 10px; } | ||
.smallerSpacer { height: 5px; } | ||
.spaceRight { margin-right: 10px; } | ||
|
||
/*padding and margins*/ | ||
.padding5 { padding: 5px; } | ||
.padding10 { padding: 10px; } | ||
.padding15 { padding: 15px; } | ||
.padding20 { padding: 20px; } | ||
.margin10 { margin: 10px; } | ||
.margin30 { margin: 30px; } | ||
.marginRight { margin-right: 10px; } | ||
.marginTop { margin-top: 10px; } | ||
.overflowAuto { overflow: auto; } | ||
|
||
/*simple backgrounds*/ | ||
.grayBackground { background-color: #e5e5e5; } | ||
.darkGrayBackground { background-color: #666; } | ||
|
||
/*rounded corners and shadows*/ | ||
.borderRadius { border-radius: 5px; -moz-border-radius: 5px; } | ||
.boxShadow { box-shadow: 2px 2px 3px #999; -moz-box-shadow: 2px 2px 3px #999; -webkit-box-shadow: 2px 2px 3px #999; } | ||
|
||
/*borders of every kind*/ | ||
.border { border: 1px solid #000; } | ||
.borderRight { border-right: 1px solid #000; } | ||
.borderTop { border-top: 1px solid #000; } | ||
.borderLeft { border-left: 1px solid #000; } | ||
.borderBottom { border-bottom: 1px solid #000; } | ||
.grayBorder { border-color: #666; } | ||
.whiteBorder { border-color: #fff; } | ||
.lightGrayBorder { border-color :#999 } | ||
|
||
/*alignment anyone?*/ | ||
.alignMiddle { vertical-align: middle; } | ||
.alignCenter { text-align: center; } | ||
|
||
/*a class for making an auto width image*/ | ||
.autoImage { width: 100%; height: auto; } | ||
|
||
/*some basic classes for styling*/ | ||
.quarterWidth { width: 25%; } | ||
|
||
.hidden { | ||
display: none; | ||
} |
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,89 @@ | ||
//signout file | ||
|
||
define([ | ||
"dijit/_Widget", | ||
"dijit/_Templated", | ||
"dojo/_base/declare", | ||
"dojo/cookie", | ||
"dojo/ready", | ||
"dojo/parser", | ||
"dojo/_base/connect", | ||
"dijit/form/Button", | ||
"dijit/form/ValidationTextBox", | ||
"dijit/Dialog", | ||
"dijit/form/Form", | ||
"dojo/text!./resources/register.html", | ||
"dojo/text!./resources/registerDialog.html" | ||
], function(_Widget, _Templated, declare, cookie, ready, parser, connect, | ||
Button, TextBox, Dialog, form, template, dialogTemplate) { | ||
|
||
declare("larson.login.register", [_Widget, _Templated], { | ||
templateString: template, | ||
widgetsInTemplate: true, | ||
dialog: "", | ||
username: "", | ||
postCreate: function() { | ||
this.inherited(arguments) | ||
|
||
var registerButton = dijit.byId("register") | ||
|
||
connect.connect(registerButton, "onClick", this.showRegistrationDialog) | ||
|
||
}, | ||
showRegistrationDialog: function() { | ||
this.inherited(arguments) | ||
|
||
this.dialog = new Dialog({ | ||
title: "Register for Larson", | ||
content: dialogTemplate, | ||
style: "width: 400px", | ||
id: "registerDialog", | ||
draggable: false, | ||
onClose: dojo.hitch(this, setTimeout(function(){ | ||
if (!dijit.byId("registerDialog").open){ | ||
dijit.byId("registerDialog").destroyRecursive() | ||
} | ||
}, 10)) | ||
}) | ||
|
||
this.dialog.show() | ||
|
||
var myForm = dijit.byId("registerForm") | ||
|
||
myForm.watch('value', function() { | ||
if(myForm.isValid()) { | ||
dijit.byId("registerButton").setAttribute('disabled', false) | ||
} | ||
else { | ||
dijit.byId("registerButton").setAttribute('disabled', true) | ||
} | ||
}) | ||
var emailAddress = dijit.byId("emailAddress") | ||
connect.connect(emailAddress, "onChange", this.checkEmailAddress) | ||
}, | ||
checkEmailAddress: function() { | ||
this.inherited(arguments) | ||
alert("checking email") | ||
this.username = dijit.byId("emailAddress").get("value") | ||
|
||
var xhrArgs = { | ||
url: "http://localhost/users/"+this.username, | ||
handleAs: "json", | ||
load: function(data) { | ||
dojo.byId("emailError").innerHTML = "This email is already taken" | ||
dijit.byId("emailAddress").setAttribute("value", "") | ||
}, | ||
error: function(error) { | ||
dojo.byId("emailError").innerHTML = "" | ||
} | ||
} | ||
|
||
var deferred = dojo.xhrGet(xhrArgs) | ||
} | ||
}) | ||
|
||
ready(function(){ | ||
// Call the parser manually so it runs after our widget is defined, and page has finished loading | ||
parser.parse(); | ||
}) | ||
}) |
Oops, something went wrong.