forked from openstreetmap/iD
-
Notifications
You must be signed in to change notification settings - Fork 6
/
land.html
50 lines (45 loc) · 1.1 KB
/
land.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head></head>
<body>
<script>
var getQuery = function(queryString)
{
queryString = queryString || window.location.search.substr(1);
var value = {};
var queries = queryString.split('&').map(function(q)
{
var split = q.split('=');
value[decodeURIComponent(split[0])] = decodeURIComponent(split[
1]);
});
return value;
};
var updateUser = function(d3Library, callback)
{
d3Library.json("/status/get?version=2", function(error, json)
{
json.query = getQuery();
d3Library.xhr(
json.query.addUser
)
.header('Content-Type', 'application/json')
.post(JSON.stringify(json), function(e, d)
{
callback(e, d);
});
});
}
if (opener) {
opener.authComplete(window.location.href);
window.close();
} else if (parent) {
updateUser(parent.d3, function(err, res)
{
parent.authComplete(window.location.href);
parent.closeLogin();
});
}
</script>
</body>
</html>