Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
9ddc9429
Commit
9ddc9429
authored
13 years ago
by
Lloyd Hilaiel
Browse files
Options
Downloads
Patches
Plain Diff
implement live email checking as you type
parent
90f66c89
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
authority/server/wsapi.js
+1
-2
1 addition, 2 deletions
authority/server/wsapi.js
authority/static/dialog/index.html
+0
-4
0 additions, 4 deletions
authority/static/dialog/index.html
authority/static/dialog/main.js
+13
-11
13 additions, 11 deletions
authority/static/dialog/main.js
with
14 additions
and
17 deletions
authority/server/wsapi.js
+
1
−
2
View file @
9ddc9429
...
...
@@ -9,8 +9,7 @@ exports.have_email = function(req, resp) {
console
.
log
(
"
have_email for
"
+
email
+
"
:
"
+
haveit
);
// 200 means we have the email, 404 means no
resp
.
writeHead
(
haveit
?
200
:
404
,
{
"
Content-Type
"
:
"
application/json
"
});
resp
.
writeHead
(
200
,
{
"
Content-Type
"
:
"
application/json
"
});
resp
.
write
(
JSON
.
stringify
(
haveit
));
resp
.
end
();
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
authority/static/dialog/index.html
+
0
−
4
View file @
9ddc9429
...
...
@@ -70,10 +70,6 @@
<form
id=
"identities"
name=
"identities"
>
</form>
</div>
<div
id=
"logo"
><img
src=
"mozilla.png"
></div>
</div>
<div
id=
"create_dialog"
class=
"dialog"
>
zxcvzxcvHI MOM
</div>
<div
id=
"bottom-bar"
>
<button
id=
"back"
>
Go Back
</button>
...
...
This diff is collapsed.
Click to expand it.
authority/static/dialog/main.js
+
13
−
11
View file @
9ddc9429
...
...
@@ -125,6 +125,7 @@
// check the email address
var
email
=
$
(
"
#create_dialog input:eq(0)
"
).
val
();
$
(
"
#create_dialog div.note:eq(0)
"
).
empty
();
if
(
typeof
email
===
'
string
'
&&
email
.
length
)
{
var
valid
=
checkedEmails
[
email
];
if
(
typeof
valid
===
'
boolean
'
)
{
...
...
@@ -139,19 +140,23 @@
if
(
emailCheckState
!==
'
querying
'
)
{
if
(
emailCheckState
)
window
.
clearTimeout
(
emailCheckState
);
emailCheckState
=
setTimeout
(
function
()
{
// XXX: this is where we should actually bounce off the server and enter the 'querying' state
// for now, we just call it valid
checkedEmails
[
nextEmailToCheck
]
=
true
;
emailCheckState
=
undefined
;
checkInput
();
},
500
);
emailCheckState
=
'
querying
'
;
var
checkingNow
=
nextEmailToCheck
;
// bounce off the server and enter the 'querying' state
$
.
get
(
'
/wsapi/have_email?email=
'
+
encodeURIComponent
(
checkingNow
),
null
,
function
(
data
,
textStatus
,
jqXHR
)
{
checkedEmails
[
checkingNow
]
=
!
JSON
.
parse
(
data
);
emailCheckState
=
undefined
;
checkInput
();
});
},
700
);
}
else
{
$
(
"
#create_dialog div.note:eq(0)
"
).
html
(
$
(
'
<span class="warning"/>
'
).
text
(
"
Checking address
"
));
}
nextEmailToCheck
=
email
;
$
(
"
#submit
"
).
addClass
(
"
disabled
"
);
$
(
"
#create_dialog div.note:eq(0)
"
).
html
(
$
(
'
<span class="warning"/>
'
).
text
(
"
Checking address
"
));
}
}
else
{
$
(
"
#create_dialog div.note:eq(0)
"
).
empty
();
$
(
"
#submit
"
).
addClass
(
"
disabled
"
);
}
...
...
@@ -228,7 +233,4 @@
});
}
});
$
(
"
.sitename
"
).
text
(
"
somesite.com
"
);
runSignInDialog
();
})();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment