Merge branch 'drawquad' into staging
[potlatch2.git] / resources / potlatch2.html
1 <html>
2
3 <!-- Potlatch 2 script -->
4
5 <head>
6 <title>Potlatch TWO</title>
7 <script type="text/javascript" src="swfobject.js"></script>
8
9 <script>
10         function getArgs() {
11                 var args = new Object();
12                 var query = location.search.substring(1);
13                 var pairs = query.split("&");
14                 for(var i = 0; i < pairs.length; i++) {
15                         var pos = pairs[i].indexOf('=');
16                         if (pos == -1) continue;
17                         var argname = pairs[i].substring(0,pos);
18                         var value = pairs[i].substring(pos+1);
19                         args[argname] = unescape(value);
20                 }
21                 return args;
22         }
23
24     var changesaved=true;
25   
26     window.onbeforeunload=function() {
27         if (!changesaved) {
28             return 'You have unsaved changes. You need to press the Save button to save them';
29         }
30     }
31
32     function markChanged(a) { changesaved=a; } /* called from flash */
33
34         var attributes = {
35                 id: "map",
36                 name: "map"
37         };
38
39         
40         var args = getArgs();
41         var lat;
42         var lon;
43         var zoom;
44         if (args.lat && args.lon) {
45                 lat = parseFloat(args.lat);
46                 lon = parseFloat(args.lon);
47         } else {
48                 lat=51.875;
49                 lon=-1.492;
50                 args["lat"] = lat;
51                 args["lon"] = lon;
52         }
53
54         if (args.zoom) {
55                 zoom = parseInt(args.zoom);
56         } else {
57                 zoom = 16;
58                 args["zoom"] = 16;
59         }
60
61                         args["api"] = "http://api06.dev.openstreetmap.org/api/0.6/";
62                         args["policy"] = "http://api06.dev.openstreetmap.org/api/crossdomain.xml";
63                         args["connection"] = "XML";
64                         args["oauth_policy"] = "http://api06.dev.openstreetmap.org/oauth/crossdomain.xml";
65                         args["oauth_request_url"] = "http://api06.dev.openstreetmap.org/oauth/request_token";
66                         args["oauth_access_url"] = "http://api06.dev.openstreetmap.org/oauth/access_token";
67                         args["oauth_auth_url"] = "http://api06.dev.openstreetmap.org/oauth/authorize";
68                         args["oauth_consumer_key"] = "fiM1IoqnKJk4JCfcl63DA";
69                         args["oauth_consumer_secret"] = "7fYgJK9M4vB1CvBZ6jEsPGxYK9UD1hEnI6NqTxNGs";
70                         args["serverName"] = "api06 Test On Dev";
71                 args["show_help"] = "once";
72                 args["site_name"] = "OpenStreetMap";
73                 args["force_auth"] = "force";
74         
75         var params = false;
76         
77         swfobject.embedSWF("potlatch2.swf?d="+Math.round(Math.random()*1000), "mapHolder", "100%", "100%", "9.0.0", "expressInstall.swf", args, params, attributes);
78 </script>
79
80
81 </head>
82
83 <body>
84
85 <div id="mapHolder" style="width:100%; height: 100%; border: 1px solid black">
86         If you see this message you need to install Flash Play 9.0 or above, from Adobe, <a href="http://get.adobe.com/flashplayer/" target="_blank">available here</a> in order to use Potlatch 2
87 </div>
88
89
90
91 </body>
92 </html>
93