Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
12e1a7fe
Commit
12e1a7fe
authored
Jul 19, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add files linked with login
parent
2e404066
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
365 additions
and
0 deletions
+365
-0
UNGProject/images/ung/ung-logo.png
UNGProject/images/ung/ung-logo.png
+0
-0
UNGProject/js/login.js
UNGProject/js/login.js
+74
-0
UNGProject/login.html
UNGProject/login.html
+291
-0
No files found.
UNGProject/images/ung/ung-logo.png
0 → 100644
View file @
12e1a7fe
40.1 KB
UNGProject/js/login.js
0 → 100644
View file @
12e1a7fe
/**
* change the display if the new account button is clicked
*/
var
displayNewAccountForm
=
function
(
bool
)
{
if
(
bool
)
{
$
(
"
table#create-new-user
"
).
css
(
"
display
"
,
"
table
"
);
$
(
"
table#field_table
"
).
css
(
"
display
"
,
"
none
"
);
$
(
"
table#new-account-table
"
).
css
(
"
display
"
,
"
none
"
);
}
else
{
$
(
"
table#create-new-user
"
).
css
(
"
display
"
,
"
none
"
);
$
(
"
table#field_table
"
).
css
(
"
display
"
,
"
table
"
);
$
(
"
table#new-account-table
"
).
css
(
"
display
"
,
"
table
"
);
}
}
/**
* Log an user with it's Name and ID provider
*/
var
logUser
=
function
()
{
var
name
=
$
(
"
input#name
"
).
attr
(
"
value
"
);
var
IDProvider
=
$
(
"
input#id_provider
"
).
attr
(
"
value
"
);
if
(
name
)
{
setCurrentStorage
(
IDProvider
?
new
JIOStorage
(
name
,
IDProvider
)
:
new
LocalStorage
(
name
));
window
.
location
=
"
ung.html
"
;
}
}
/**
* create an account (to use only if UNG is also an ID provider)
*/
var
createNewUser
=
function
()
{
var
form
=
$
(
"
form#create-user
"
)[
0
];
/* check that the form is complete */
for
(
var
i
=
0
;
i
<
form
.
length
-
1
;
i
++
)
{
if
(
!
form
[
i
].
value
)
{
formError
(
"
please fill each field
"
);}
}
if
(
form
[
4
].
value
!=
form
[
5
].
value
)
{
formError
(
"
please enter the same password twice
"
);
form
[
4
].
value
=
""
;
form
[
5
].
value
=
""
;
}
if
(
!
testEMail
())
{
formError
(
"
please enter a valid email
"
);}
/* create the new user */
//JIO
}
/**
* Report an error when filling the form
*/
var
formError
=
function
(
message
)
{
$
(
"
td#form-message
"
).
attr
(
"
value
"
,
message
);
$
(
"
td#form-message
"
).
css
(
"
display
"
,
"
table-cell
"
);
}
/**
* check if an email address is valid
*/
function
testEMail
(
email
)
{
var
patern
=
"
^([a-zA-Z0-9]+(([
\
.
\
-
\
_]?[a-zA-Z0-9]+)+)?)
\
@(([a-zA-Z0-9]+[
\
.
\
-
\
_])+[a-zA-Z]{2,4})$
"
;
var
regEx
=
new
RegExp
(
patern
);
return
regEx
.
test
(
email
);
}
function
setFocus
()
{
login
=
document
.
getElementById
(
'
name
'
);
password
=
document
.
getElementById
(
'
password
'
);
if
(
login
.
value
!=
''
)
password
.
focus
();
else
login
.
focus
();
}
\ No newline at end of file
UNGProject/login.html
0 → 100644
View file @
12e1a7fe
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment