Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
CTF
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grzegorz
CTF
Commits
91a87295
Commit
91a87295
authored
Mar 11, 2016
by
Antek Grzanka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI for login.
parent
73cd8d5a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
13 deletions
+23
-13
index.html
service/src/main/resources/assets/index.html
+5
-11
loginController.js
...esources/assets/statics/js/controllers/loginController.js
+1
-0
navigationController.js
...ces/assets/statics/js/controllers/navigationController.js
+1
-0
main.js
service/src/main/resources/assets/statics/js/main.js
+10
-0
typed.js
service/src/main/resources/assets/statics/libs/typed.js
+6
-2
No files found.
service/src/main/resources/assets/index.html
View file @
91a87295
...
...
@@ -15,10 +15,10 @@
<span
class=
"title"
></span>
</a>
<ul
id=
"nav-mobile"
class=
"right hide-on-med-and-down"
>
<li><a
href=
"page#/home"
>
Początek
</a></li>
<li><a
href=
"page#/tasks"
>
Zadania
</a></li>
<li><a
href=
"page#/scores"
>
Wyniki
</a></li>
<li
ng-if=
"logged"
ng-click=
"logout()"
>
Wyloguj {{user}}
</li>
<li
ng-if=
"logged"
><a
href=
"page#/home"
>
Początek
</a></li>
<li
ng-if=
"logged"
><a
href=
"page#/tasks"
>
Zadania
</a></li>
<li
ng-if=
"logged"
><a
href=
"page#/scores"
>
Wyniki
</a></li>
<li
ng-if=
"logged"
ng-click=
"logout()"
>
<a
href=
"page#/"
>
Wyloguj
</a>
</li>
</ul>
</div>
</nav>
...
...
@@ -52,13 +52,7 @@
<script>
$
(
function
(){
$
(
".title"
).
typed
({
strings
:
[
"<b>capture the flag</b>"
,
"<b>capture the flAGH 2016</b>"
],
startDelay
:
10
,
backDelay
:
500
});
});
...
...
service/src/main/resources/assets/statics/js/controllers/loginController.js
View file @
91a87295
...
...
@@ -10,6 +10,7 @@
AuthenticationService
.
login
(
$scope
.
username
,
$scope
.
password
,
function
(
response
)
{
if
(
response
.
status
==
200
)
{
AuthenticationService
.
setCredentials
(
$scope
.
username
,
$scope
.
password
,
response
.
team
);
$
(
'.title'
).
html
(
$scope
.
username
+
'@<b>capture-the-flAGH-2016</b>'
);
$location
.
path
(
'/'
);
}
else
{
$scope
.
error
=
response
.
message
;
...
...
service/src/main/resources/assets/statics/js/controllers/navigationController.js
View file @
91a87295
...
...
@@ -9,6 +9,7 @@
$scope
.
logout
=
function
(){
AuthenticationService
.
logout
(
function
(
data
){
console
.
log
(
"Logged you out... i guess..."
,
data
);
$
(
'.title'
).
html
(
'guest@<b>capture-the-flAGH-2016</b>'
);
$location
.
path
(
'/'
);
});
};
...
...
service/src/main/resources/assets/statics/js/main.js
View file @
91a87295
...
...
@@ -45,9 +45,19 @@
app
.
run
([
'$rootScope'
,
'$location'
,
'$cookieStore'
,
'$http'
,
function
(
$rootScope
,
$location
,
$cookieStore
,
$http
)
{
// keep user logged in after page refresh
$rootScope
.
globals
=
$cookieStore
.
get
(
'globals'
)
||
{};
var
username
=
$rootScope
.
globals
.
currentUser
?
$rootScope
.
globals
.
currentUser
.
username
:
'guest'
;
$
(
".title"
).
typed
({
strings
:
[
username
+
"@<b>capture-the-flag</b>"
,
username
+
"@<b>capture-the-flAGH-2016</b>"
],
startDelay
:
10
,
backDelay
:
500
,
whenToStop
:
14
+
username
.
length
});
if
(
$rootScope
.
globals
.
currentUser
)
{
$http
.
defaults
.
headers
.
common
[
'Authorization'
]
=
'Not-So-Basic '
+
$rootScope
.
globals
.
currentUser
.
authdata
;
// jshint ignore:line
}
...
...
service/src/main/resources/assets/statics/libs/typed.js
View file @
91a87295
...
...
@@ -93,6 +93,8 @@
// the order of strings
this
.
sequence
=
[];
this
.
whenToStop
=
this
.
options
.
whenToStop
||
14
;
// All systems go!
this
.
build
();
};
...
...
@@ -249,7 +251,9 @@
// humanized value for typing
},
humanize
);
}
},
whenToStop
:
14
,
backspace
:
function
(
curString
,
curStrPos
)
{
...
...
@@ -272,7 +276,7 @@
// the stopNum actually represents the amount of chars to
// keep in the current string. In my case it's 14.
if
(
self
.
arrayPos
==
0
){
self
.
stopNum
=
14
;
self
.
stopNum
=
self
.
whenToStop
;
}
//every other time, delete the whole typed string
else
{
...
...
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