Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4a19156a
authored
Nov 11, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: common getCookie js func
parent
56721df3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
40 deletions
+23
-40
circle/dashboard/static/dashboard/dashboard.js
+23
-0
circle/dashboard/static/dashboard/vm-create.js
+0
-24
circle/dashboard/static/dashboard/vm-list.js
+0
-16
No files found.
circle/dashboard/static/dashboard/dashboard.js
View file @
4a19156a
...
@@ -62,3 +62,26 @@ function refreshSliders() {
...
@@ -62,3 +62,26 @@ function refreshSliders() {
$
(
this
).
parent
(
'div'
).
nextAll
(
"span"
).
html
(
$
(
this
).
val
());
$
(
this
).
parent
(
'div'
).
nextAll
(
"span"
).
html
(
$
(
this
).
val
());
});
});
}
}
// for AJAX calls
/**
* Getter for user cookies
* @param {String} name Cookie name
* @return {String} Cookie value
*/
function
getCookie
(
name
)
{
var
cookieValue
=
null
;
if
(
document
.
cookie
&&
document
.
cookie
!=
''
)
{
var
cookies
=
document
.
cookie
.
split
(
';'
);
for
(
var
i
=
0
;
i
<
cookies
.
length
;
i
++
)
{
var
cookie
=
jQuery
.
trim
(
cookies
[
i
]);
if
(
cookie
.
substring
(
0
,
name
.
length
+
1
)
==
(
name
+
'='
))
{
cookieValue
=
decodeURIComponent
(
cookie
.
substring
(
name
.
length
+
1
));
break
;
}
}
}
return
cookieValue
;
}
circle/dashboard/static/dashboard/vm-create.js
View file @
4a19156a
...
@@ -292,27 +292,3 @@ function vmCreateDiskLabel(pk, name) {
...
@@ -292,27 +292,3 @@ function vmCreateDiskLabel(pk, name) {
}
}
/* copied from /static/js/network.js
* we gonna need this anyways for ajax POSTs */
// for AJAX calls
/**
* Getter for user cookies
* @param {String} name Cookie name
* @return {String} Cookie value
*/
function
getCookie
(
name
)
{
var
cookieValue
=
null
;
if
(
document
.
cookie
&&
document
.
cookie
!=
''
)
{
var
cookies
=
document
.
cookie
.
split
(
';'
);
for
(
var
i
=
0
;
i
<
cookies
.
length
;
i
++
)
{
var
cookie
=
jQuery
.
trim
(
cookies
[
i
]);
if
(
cookie
.
substring
(
0
,
name
.
length
+
1
)
==
(
name
+
'='
))
{
cookieValue
=
decodeURIComponent
(
cookie
.
substring
(
name
.
length
+
1
));
break
;
}
}
}
return
cookieValue
;
}
circle/dashboard/static/dashboard/vm-list.js
View file @
4a19156a
...
@@ -128,19 +128,3 @@ function setRowColor(row) {
...
@@ -128,19 +128,3 @@ function setRowColor(row) {
}
}
}
}
// TODO common getCookie
function
getCookie
(
name
)
{
var
cookieValue
=
null
;
if
(
document
.
cookie
&&
document
.
cookie
!=
''
)
{
var
cookies
=
document
.
cookie
.
split
(
';'
);
for
(
var
i
=
0
;
i
<
cookies
.
length
;
i
++
)
{
var
cookie
=
jQuery
.
trim
(
cookies
[
i
]);
if
(
cookie
.
substring
(
0
,
name
.
length
+
1
)
==
(
name
+
'='
))
{
cookieValue
=
decodeURIComponent
(
cookie
.
substring
(
name
.
length
+
1
));
break
;
}
}
}
return
cookieValue
;
}
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