Changeset 9213
- Timestamp:
- May 24, 2011, 4:08:04 PM (13 years ago)
- Location:
- src/django_gheat/website
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/heatmap_extensions.js
r9208 r9213 13 13 if (nodelist.readyState==4 && nodelist.status==200){ 14 14 json=eval('(' + nodelist.responseText + ')'); 15 var list = '<br>'; 16 for (var i=0; i<json.length; i++){ 17 list += json[i].fields.ssid + '<br>'; 15 var list; 16 if (json.length>0){ 17 list = '<center>Wireless Leiden nodes on mouseposition:<br /><b>'; 18 for (var i=0; i<json.length; i++){ 19 list += json[i].fields.ssid + '<br />'; 20 } 21 list += '</b></center>'; 18 22 } 19 document.getElementById('nodelist').innerHTML=list; 23 else{ 24 list = '<center>No nodes to display.</center>'; 25 } 26 document.getElementById('node_list').innerHTML=list; 20 27 } 21 28 } … … 25 32 26 33 27 // Retrieve form values for filter and pass them on to addFilter() 28 function filters(){ 29 var user = encodeURIComponent(document.getElementById("user").value); 30 var dataset = encodeURIComponent(document.getElementById("dataset").value); 31 var wlnode = encodeURIComponent(document.getElementById("wlnode").value); 32 var enc = encodeURIComponent(document.getElementById("enc").value); 33 var date = encodeURIComponent(document.getElementById("date").value); 34 var colour = encodeURIComponent(document.getElementById("colour").value); 35 var lname = encodeURIComponent(document.getElementById("lname").value); 34 // Get filter values from django view and serve as option list 35 function getFilters(){ 36 var filterlist; 36 37 37 addFilter(user, dataset, wlnode, enc, date, colour, lname); 38 if (window.XMLHttpRequest){ 39 filterlist=new XMLHttpRequest(); 40 } 41 else{ 42 filterlist=new ActiveXObject("Microsoft.XMLHTTP"); 43 } 44 45 filterlist.onreadystatechange=function(){ 46 if (filterlist.readyState==4 && filterlist.status==200){ 47 json=eval('(' + filterlist.responseText + ')'); 48 var list = '<form method="get" action="">'; 49 list += '<select id="wlnode" style="width:104px"><option></option>'; 50 for (var i=0; i<json.length; i++){ 51 list += '<option>' + json[i].fields.ssid + '</option>'; 52 } 53 list += '</select> WLnode<br />'; 54 list += '<input type="text" id="colour" name="colour" size="10"/> Colour<br />'; 55 list += '<input type="text" id="lname" name="lname" size="10"/> Layername<br />'; 56 list += '<input type="button" value="Add filter" onClick="addFilter()"/>'; 57 list += '</form>'; 58 document.getElementById('filter_list').innerHTML=list; 59 } 60 } 61 filterlist.open("GET","/website/filters",true); 62 filterlist.send(); 38 63 } 39 64 40 65 41 66 // Some value checks, create an overlay using these values and place it on the map. 42 function addFilter(user, dataset, wlnode, enc, date, colour, lname){ 67 function addFilter(){ 68 69 var user = ''; 70 var dataset = ''; 71 var wlnode = encodeURIComponent(document.getElementById("wlnode").value); 72 var enc =''; 73 var date = ''; 74 var colour = encodeURIComponent(document.getElementById("colour").value); 75 var lname = encodeURIComponent(document.getElementById("lname").value); 43 76 44 77 if (user != ''){user='&accespoint__id='+user;} -
src/django_gheat/website/static/style.css
r9212 r9213 57 57 } 58 58 59 #filter s{59 #filter{ 60 60 width:100%-10px; 61 61 display:none; … … 63 63 } 64 64 65 #filter s_text{65 #filter_text{ 66 66 height:100%; 67 67 width:570px; … … 70 70 } 71 71 72 #filter s_list{72 #filter_list{ 73 73 padding:5px; 74 74 width:200px; … … 76 76 float:right; 77 77 margin-bottom:5px; 78 } 79 80 #node_list{ 81 position:absolute; 82 left:50%; 83 margin-left:-150px; 84 bottom:-2px; 85 width:300px; 86 background-color:#FFF; 87 border:2px solid #BA0000; 88 z-index:1; 89 padding:5px; 78 90 } 79 91 … … 84 96 A:link{ 85 97 color:#FFF; 98 padding-left:8px; 86 99 } 87 100 -
src/django_gheat/website/templates/home.html
r9212 r9213 11 11 var hide; 12 12 if(show == 'info'){ 13 hide = 'filter s';13 hide = 'filter'; 14 14 } 15 15 else{ … … 29 29 30 30 31 <body onload="init() ">31 <body onload="init(),getFilters()"> 32 32 <div id="heatmap"></div> 33 33 <div id="container"> … … 37 37 <div id="menu"> 38 38 <a href="javascript:toggleDiv('info')">Info</a> 39 <a href="javascript:toggleDiv('filter s')" style="padding-left:15px;">Filters</a>39 <a href="javascript:toggleDiv('filter')">Filters</a> 40 40 </div> 41 41 <div id="info"> 42 42 test<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />test 43 43 </div> 44 <div id="filter s">45 <div id="filter s_text">44 <div id="filter"> 45 <div id="filter_text"> 46 46 <h1>Filters</h1> 47 47 <p>Create your custom layer by choosing the desired filter options on the right and adding it the layer to the list.</p> 48 48 <p>For instance, you can choose to create a layer with data measured only by yourself, or with a certain node from Wireless Leiden only.</p> 49 49 </div> 50 <div id="filter s_list">50 <div id="filter_list"> 51 51 <form method="get" action=""> 52 52 <table border="0"> … … 88 88 </div> 89 89 </div> 90 <div id='node_list'> 91 <center>Click on the map to display Wireless Leiden nodes.</center> 92 </div> 90 93 </body> 91 94 </html> -
src/django_gheat/website/urls.py
r9196 r9213 36 36 ), 37 37 ) 38 39 urlpatterns += patterns('website.filters', 40 url( 41 regex = r'^filters$', 42 view = 'serve_filters', 43 name = 'serve_filters', 44 ), 45 )
Note:
See TracChangeset
for help on using the changeset viewer.