Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
BeHub-web
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
Dominik Rosiek
BeHub-web
Commits
bce26f39
Commit
bce26f39
authored
Nov 22, 2015
by
Dominik Rosiek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
projct managing js
parent
03b553f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
map.js
BeHub/Hub/static/js/map.js
+11
-14
No files found.
BeHub/Hub/static/js/map.js
View file @
bce26f39
...
@@ -34,7 +34,6 @@ Map.prototype.addMarker = function(data){
...
@@ -34,7 +34,6 @@ Map.prototype.addMarker = function(data){
title
:
data
.
title
,
title
:
data
.
title
,
beacon
:
data
.
beacon
beacon
:
data
.
beacon
}).
addListener
(
'click'
,
function
()
{
}).
addListener
(
'click'
,
function
()
{
if
(
!
project_data
){
$
.
getJSON
(
"/api/user_project/"
+
project_id
+
"/beacons"
,
function
(
beacon
){
return
function
(
data
){
$
.
getJSON
(
"/api/user_project/"
+
project_id
+
"/beacons"
,
function
(
beacon
){
return
function
(
data
){
project_data
=
data
project_data
=
data
project_summary
[
'uuids'
]
=
[];
project_summary
[
'uuids'
]
=
[];
...
@@ -43,10 +42,6 @@ Map.prototype.addMarker = function(data){
...
@@ -43,10 +42,6 @@ Map.prototype.addMarker = function(data){
}
}
self
.
showInfo
(
beacon
)
self
.
showInfo
(
beacon
)
}}(
this
.
beacon
))
}}(
this
.
beacon
))
}
else
{
self
.
showInfo
(
this
.
beacon
)
}
})
})
self
.
markers
.
push
(
marker
)
self
.
markers
.
push
(
marker
)
...
@@ -117,15 +112,16 @@ Map.prototype.showInfo = function(beacon){
...
@@ -117,15 +112,16 @@ Map.prototype.showInfo = function(beacon){
$
(
"#removeFromProjectBtn"
).
click
(
function
(
beacon
){
return
function
(){
$
(
"#removeFromProjectBtn"
).
click
(
function
(
beacon
){
return
function
(){
$
.
getJSON
(
"/api/user_project/"
+
project_id
,
function
(
beacon
){
return
function
(
data
){
$
.
getJSON
(
"/api/user_project/"
+
project_id
,
function
(
beacon
){
return
function
(
data
){
var
index
=
data
[
'beacon_managers'
].
indexOf
(
beacon
.
beacon_manager_url
)
var
index
=
data
[
'beacon_managers'
].
indexOf
(
beacon
.
beacon_manager
)
data
[
'beacon_managers'
].
slice
(
index
,
1
);
data
[
'beacon_managers'
]
=
data
[
'beacon_managers'
].
slice
(
index
,
-
1
);
delete
data
[
'url'
];
$
.
ajax
({
$
.
ajax
({
url
:
"/api/user_project/"
+
project_id
,
url
:
"/api/user_project/"
+
project_id
,
type
:
'PUT'
,
type
:
'PUT'
,
data
:
data
,
data
:
JSON
.
stringify
(
data
)
,
dataType
:
"
json"
,
contentType
:
"application/
json"
,
success
:
function
(
result
)
{
success
:
function
(
result
)
{
alert
(
result
)
alert
(
JSON
.
stringify
(
result
)
)
}
}
});
});
...
@@ -134,14 +130,15 @@ Map.prototype.showInfo = function(beacon){
...
@@ -134,14 +130,15 @@ Map.prototype.showInfo = function(beacon){
$
(
"#addToProjectBtn"
).
click
(
function
(
beacon
){
return
function
(){
$
(
"#addToProjectBtn"
).
click
(
function
(
beacon
){
return
function
(){
$
.
getJSON
(
"/api/user_project/"
+
project_id
,
function
(
beacon
){
return
function
(
data
){
$
.
getJSON
(
"/api/user_project/"
+
project_id
,
function
(
beacon
){
return
function
(
data
){
data
[
'beacon_managers'
].
push
(
beacon
.
beacon_manager_url
)
data
[
'beacon_managers'
].
push
(
beacon
.
beacon_manager
)
delete
data
[
'url'
];
$
.
ajax
({
$
.
ajax
({
url
:
"/api/user_project/"
+
project_id
,
url
:
"/api/user_project/"
+
project_id
,
type
:
'PUT'
,
type
:
'PUT'
,
data
:
data
,
data
:
JSON
.
stringify
(
data
)
,
dataType
:
"
json"
,
contentType
:
"application/
json"
,
success
:
function
(
result
)
{
success
:
function
(
result
)
{
alert
(
result
)
alert
(
JSON
.
stringify
(
result
)
)
}
}
});
});
...
...
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