source: binary-improvements/webserver_legacy/js/leaflet.control.login.js@ 464

Last change on this file since 464 was 249, checked in by alloc, 9 years ago

Fixes: Web v8

File size: 732 bytes
Line 
1L.Control.Login = L.Control.extend({
2 options: {
3 position: 'bottomleft'
4 },
5
6 onAdd: function (map) {
7 var name = 'control-login',
8 container = L.DomUtil.create('div', name + ' leaflet-bar');
9
10 this._map = map;
11 this._div = container;
12
13 if (userdata.loggedin == true) {
14 container.innerHTML =
15 "Logged in as: " + userdata.username + "<br/>\
16 <a href=\"/session/logout\">Sign&nbsp;out</a>";
17 } else {
18 container.innerHTML =
19 "Not logged in<br/>\
20 <a href=\"/session/login\">\
21 <img src=\"img/steamlogin.png\" title=\"Sign in through Steam\"></a>";
22 }
23
24
25 return container;
26 },
27
28 onRemove: function (map) {
29 },
30
31 _onMouseMove: function (e) {
32 this._div.innerHTML = FormatCoord(e.latlng);
33 }
34});
35
Note: See TracBrowser for help on using the repository browser.