Changeset 9234 for src/django_gheat/website
- Timestamp:
- Jun 7, 2011, 12:43:21 PM (13 years ago)
- Location:
- src/django_gheat/website
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/heatmap_extensions_test.js
r9233 r9234 33 33 // Uses zoomlevel en mouseposition to call the nodelist.py view. View returns nodes in json format which is read and printed in document element. 34 34 function getNodeList(zoomlevel, mousepos) { 35 var url = "/website/nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon; 36 var ajax = new AjaxRequest(url, setNodeList); 37 ajax.doGet(); 38 } 39 40 41 function setNodeList(responseText) { 42 json_nodelist=eval('(' + responseText + ')'); 43 if (json_nodelist.length>0){ 44 list = 'Wireless Leiden nodes on mouseposition:<br /><b>'; 45 for (var i=0; i<json_nodelist.length; i++){ 46 list += json_nodelist[i].fields.ssid + '<br />'; 35 $.getJSON("/website/nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon, 36 function(json) { 37 content = 'Wireless Leiden nodes on mouseposition:<br /><b>'; 38 $.each(json, function(i,json){ 39 content += json.fields.ssid; 40 }); 41 content += '</br>'; 42 $("#node_list").html(content); 47 43 } 48 list += '</b>'; 49 } 50 else{ 51 list = 'No nodes to display.'; 52 } 53 document.getElementById('node_list').innerHTML=list; 44 ); 54 45 } 55 46 -
src/django_gheat/website/templates/home.html
r9223 r9234 2 2 <head> 3 3 <link href="{{ STATIC_URL }}style.css" rel="stylesheet" type="text/css" media="screen" /> 4 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 4 5 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}OpenLayers.js"></script> 5 6 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}OpenStreetMap.js"></script> 6 7 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap.js"></script> 7 8 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap_extensions_test.js"></script> 8 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>9 9 <script language="javascript" type="text/javascript"> 10 function toggleDiv(div){ 11 var show = div; 12 var hide; 13 if(show == 'info'){ 14 hide = 'filter'; 15 } 16 else{ 17 hide = 'info'; 18 } 19 if(document.getElementById(show).style.display != 'block'){ 20 document.getElementById(show).style.display = 'block'; 21 document.getElementById(hide).style.display = 'none'; 22 } 23 else{ 24 document.getElementById(show).style.display = 'none'; 25 document.getElementById(hide).style.display = 'none'; 26 } 27 } 10 $(function(){ 11 $('#menu_filter').click(function(){ 12 $('#filter').slideToggle('fast'); 13 $('#info').slideUp('fast'); 14 }); 15 $('#menu_info').click(function(){ 16 $('#filter').slideUp('fast'); 17 $('#info').slideToggle('fast'); 18 }); 19 }); 28 20 </script> 29 21 </head> 30 31 32 22 <body onload="init(), get_filters()"> 33 23 <div id="heatmap"></div> … … 37 27 </div> 38 28 <div id="menu"> 39 <a href="javascript:toggleDiv('info')">Info</a>40 <a href="javascript:toggleDiv('filter')">Filters</a>29 <a id="menu_info">Info</a> 30 <a id="menu_filter">Filters</a> 41 31 </div> 42 32 <div id="info"> … … 50 40 </div> 51 41 <div id="filter_list"> 52 53 42 </div> 54 43 </div>
Note:
See TracChangeset
for help on using the changeset viewer.