Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
internship
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Skripnikov
internship
Commits
06e1d4c2
Commit
06e1d4c2
authored
Feb 01, 2018
by
Alina Habibulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+auth form v3
parent
809c0b06
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
106 deletions
+111
-106
src/main/webapp/css/beau.css
src/main/webapp/css/beau.css
+48
-80
src/main/webapp/index.html
src/main/webapp/index.html
+1
-11
src/main/webapp/js/Player.js
src/main/webapp/js/Player.js
+62
-15
No files found.
src/main/webapp/css/beau.css
View file @
06e1d4c2
.submit
{
.login-form
{
background-color
:
#e7e7e7
;
left
:
50%
;
color
:
black
;
transform
:
translate
(
-50%
,
0
);
border
:
none
;
width
:
320px
;
padding
:
15px
32px
;
height
:
230px
;
text-align
:
center
;
background-color
:
white
;
text-decoration
:
none
;
position
:
absolute
;
border-radius
:
5px
;
border-color
:
#24282B
;
display
:
inline-block
;
border-style
:
none
solid
solid
;
font-size
:
16px
;
border-width
:
1px
;
top
:
150px
;
}
}
.login-form
{
.header
{
position
:
relative
;
background-color
:
#4C5256
;
width
:
200px
;
position
:
relative
;
height
:
250px
;
padding
:
12px
;
margin-left
:
auto
;
color
:
white
;
margin-right
:
auto
;
font-family
:
arial
,
tahoma
,
sans-serif
;
padding
:
15px
25px
0
25px
;
font-size
:
13pt
;
margin-top
:
15px
;
font-weight
:
bold
;
cursor
:
default
;
cursor
:
pointer
;
background-color
:
#141517
;
-webkit-border-radius
:
5px
;
-moz-border-radius
:
5px
;
border-radius
:
5px
;
-webkit-box-shadow
:
0px
1px
1px
0px
rgba
(
255
,
255
,
255
,
.2
),
inset
0px
1px
1px
0px
rgb
(
0
,
0
,
0
);
-moz-box-shadow
:
0px
1px
1px
0px
rgba
(
255
,
255
,
255
,
.2
),
inset
0px
1px
1px
0px
rgb
(
0
,
0
,
0
);
box-shadow
:
0px
1px
1px
0px
rgba
(
255
,
255
,
255
,
.2
),
inset
0px
1px
1px
0px
rgb
(
0
,
0
,
0
);
}
}
.login-form
h3
{
.error
{
line-height
:
20px
;
margin-top
:
5px
;
font-family
:
'Myriad Pro'
,
sans-serif
;
color
:
red
;
font-size
:
22px
;
font-family
:
arial
,
tahoma
,
sans-serif
;
font-weight
:
normal
;
font-size
:
15pt
;
color
:
#e4e4e4
;
}
}
.login-form
input
[
type
=
text
],
.login
{
.login-form
input
[
type
=
password
]
{
position
:
static
;
line-height
:
14px
;
margin-top
:
25px
;
margin
:
10px
0
;
width
:
250px
;
padding
:
6px
15px
;
display
:
inline-block
;
border
:
0
;
height
:
20px
;
outline
:
none
;
size
:
50px
;
font-family
:
Helvetica
,
sans-serif
;
font-size
:
12px
;
font-weight
:
bold
;
text-shadow
:
0px
1px
1px
rgba
(
255
,
255
,
255
,
.2
);
-webkit-border-radius
:
26px
;
-moz-border-radius
:
26px
;
border-radius
:
26px
;
-webkit-transition
:
all
.15s
ease-in-out
;
-moz-transition
:
all
.15s
ease-in-out
;
transition
:
all
.15s
ease-in-out
;
}
}
.login-form
input
[
type
=
text
],
.password
{
.login-form
input
[
type
=
password
]
{
position
:
static
;
color
:
#686868
;
margin-top
:
15px
;
width
:
170px
;
width
:
250px
;
-webkit-box-shadow
:
inset
1px
1px
1px
0px
rgba
(
255
,
255
,
255
,
.6
);
display
:
inline-block
;
-moz-box-shadow
:
inset
1px
1px
1px
0px
rgba
(
255
,
255
,
255
,
.6
);
height
:
20px
;
box-shadow
:
inset
1px
1px
1px
0px
rgba
(
255
,
255
,
255
,
.6
);
background
:
#989898
;
background
:
-moz-linear-gradient
(
top
,
#ffffff
0%
,
#989898
100%
);
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0%
,
#ffffff
),
color-stop
(
100%
,
#989898
));
background
:
-webkit-linear-gradient
(
top
,
#ffffff
0%
,
#989898
100%
);
background
:
-o-linear-gradient
(
top
,
#ffffff
0%
,
#989898
100%
);
background
:
-ms-linear-gradient
(
top
,
#ffffff
0%
,
#989898
100%
);
background
:
linear-gradient
(
top
,
#ffffff
0%
,
#989898
100%
);
}
}
.login-form
input
[
type
=
text
]
:hover
,
.submit
{
.login-form
input
[
type
=
password
]
:hover
{
margin-top
:
15px
;
-webkit-box-shadow
:
inset
1px
1px
1px
0px
rgba
(
255
,
255
,
255
,
.6
),
0px
0px
5px
rgba
(
255
,
255
,
255
,
.5
);
width
:
100px
;
-moz-box-shadow
:
inset
1px
1px
1px
0px
rgba
(
255
,
255
,
255
,
.6
),
0px
0px
5px
rgba
(
255
,
255
,
255
,
.5
);
position
:
relative
;
box-shadow
:
inset
1px
1px
1px
0px
rgba
(
255
,
255
,
255
,
.6
),
0px
0px
5px
rgba
(
255
,
255
,
255
,
.5
);
height
:
35px
;
}
border-radius
:
5px
;
background-color
:
#49b785
;
.login-form
input
[
type
=
text
]
:focus
,
border-color
:
#49b785
;
.login-form
input
[
type
=
password
]
:focus
{
color
:
#ffffff
;
background
:
#e1e1e1
;
background
:
-moz-linear-gradient
(
top
,
#ffffff
0%
,
#e1e1e1
100%
);
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0%
,
#ffffff
),
color-stop
(
100%
,
#e1e1e1
));
background
:
-webkit-linear-gradient
(
top
,
#ffffff
0%
,
#e1e1e1
100%
);
background
:
-o-linear-gradient
(
top
,
#ffffff
0%
,
#e1e1e1
100%
);
background
:
-ms-linear-gradient
(
top
,
#ffffff
0%
,
#e1e1e1
100%
);
background
:
linear-gradient
(
top
,
#ffffff
0%
,
#e1e1e1
100%
);
}
}
\ No newline at end of file
src/main/webapp/index.html
View file @
06e1d4c2
...
@@ -18,16 +18,6 @@
...
@@ -18,16 +18,6 @@
<div
id =
"form_player_container"
align =
"center"
>
<div
id =
"form_player_container"
align =
"center"
>
<div
id =
"form_player_div"
></div>
<div
id =
"form_player_div"
></div>
</div>
</div>
<div
id=
"authForm"
></div>
<div
class =
"login-form"
align =
"center"
>
<form
id =
"authorization"
>
<p><h3>
Please, log in:
</h3>
<div
class =
"infoInput"
>
<p><input
type =
"text"
id =
"login"
name =
"login"
placeholder =
"Username"
size =
"20"
required
></p>
<p><input
type =
"password"
id =
"password"
name =
"password"
placeholder =
"Password"
size =
"20"
required
></p>
</div>
<input
type =
"submit"
id =
"submit"
class =
"submit"
align =
"center"
value =
"Submit"
></button>
</form>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/main/webapp/js/Player.js
View file @
06e1d4c2
...
@@ -17,36 +17,83 @@ var portal = {
...
@@ -17,36 +17,83 @@ var portal = {
portal
.
player
=
AS
.
FORMS
.
createPlayer
();
portal
.
player
=
AS
.
FORMS
.
createPlayer
();
portal
.
player
.
showFormByCode
(
formCode
);
portal
.
player
.
showFormByCode
(
formCode
);
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
},
showMessage
:
function
(
message
)
{
alert
(
message
);
}
}
};
};
AS
.
SERVICES
.
unAuthorized
=
function
()
AS
.
SERVICES
.
unAuthorized
=
function
()
{
{
portal
.
showMessage
(
"
Authorization Error!
"
);
CreateAuthForm
();
location
.
reload
();
};
};
function
CreateAuthForm
(){
var
forma
=
document
.
createElement
(
"
form
"
);
forma
.
className
=
"
login-form
"
;
forma
.
setAttribute
(
'
id
'
,
"
login-form
"
);
forma
.
setAttribute
(
'
align
'
,
"
center
"
);
var
authHeader
=
document
.
createTextNode
(
'
Введите логин и пароль
'
);
var
authErr
=
document
.
createTextNode
(
'
Неверный логин или пароль
'
);
var
Hdiv
=
document
.
createElement
(
"
div
"
);
Hdiv
.
className
=
"
header
"
;
Hdiv
.
appendChild
(
authHeader
);
var
Ediv
=
document
.
createElement
(
"
div
"
);
Ediv
.
className
=
"
error
"
;
Ediv
.
appendChild
(
authErr
);
Ediv
.
setAttribute
(
'
id
'
,
"
error
"
);
var
textInp
=
document
.
createElement
(
"
input
"
);
textInp
.
className
=
"
login
"
;
textInp
.
setAttribute
(
'
type
'
,
"
text
"
);
textInp
.
setAttribute
(
'
name
'
,
"
login
"
);
textInp
.
setAttribute
(
'
id
'
,
"
login
"
);
textInp
.
setAttribute
(
'
placeholder
'
,
"
Логин
"
);
textInp
.
setAttribute
(
'
align
'
,
"
center
"
);
var
pasInp
=
document
.
createElement
(
"
input
"
);
pasInp
.
className
=
"
password
"
;
pasInp
.
setAttribute
(
'
type
'
,
"
password
"
);
pasInp
.
setAttribute
(
'
name
'
,
"
password
"
);
pasInp
.
setAttribute
(
'
id
'
,
"
password
"
);
pasInp
.
setAttribute
(
'
placeholder
'
,
"
Пароль
"
);
pasInp
.
setAttribute
(
'
align
'
,
"
center
"
);
var
submitBtn
=
document
.
createElement
(
"
input
"
);
submitBtn
.
className
=
"
submit
"
;
submitBtn
.
setAttribute
(
'
type
'
,
"
submit
"
);
submitBtn
.
setAttribute
(
'
value
'
,
"
Войти
"
);
submitBtn
.
setAttribute
(
'
id
'
,
"
submit
"
);
submitBtn
.
setAttribute
(
'
align
'
,
"
center
"
);
var
addHandlers
=
function
(){
forma
.
appendChild
(
Hdiv
);
forma
.
appendChild
(
Ediv
);
forma
.
appendChild
(
textInp
);
forma
.
appendChild
(
pasInp
);
forma
.
appendChild
(
submitBtn
);
document
.
getElementById
(
"
authForm
"
).
appendChild
(
forma
);
authFunc
();
};
var
authFunc
=
function
(){
jQuery
(
"
.submit
"
).
on
(
"
click
"
,
function
(
event
){
jQuery
(
"
.submit
"
).
on
(
"
click
"
,
function
(
event
){
AS
.
OPTIONS
.
login
=
$
(
"
input#login
"
).
val
();
AS
.
OPTIONS
.
login
=
$
(
"
input#login
"
).
val
();
AS
.
OPTIONS
.
password
=
$
(
"
input#password
"
).
val
();
AS
.
OPTIONS
.
password
=
$
(
"
input#password
"
).
val
();
var
xhr
=
new
XMLHttpRequest
();
var
xhr
=
new
XMLHttpRequest
();
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
'
rest/api
'
,
xhr
);
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
'
rest/api
'
,
xhr
);
if
(
xhr
.
status
==
"
401
"
)
{
if
(
xhr
.
status
!=
200
)
{
AS
.
SERVICES
.
unAuthorized
();
}
else
{
$
(
"
.login-form
"
).
remove
();
$
(
"
.form_player_container
"
).
show
();
$
(
"
.form_player_container
"
).
show
();
portal
.
createPlayer
(
"
timesheet
"
);
portal
.
createPlayer
(
"
timesheet
"
);
$
(
"
.login-form
"
).
remove
();
}
else
{
CreateAuthForm
();
}
}
});
});
}
}
;
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
addHandlers
();
CreateAuthForm
();
});
$
(
"
.error
"
).
hide
();
\ No newline at end of file
});
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