- Timestamp:
- Jun 10, 2011, 5:22:01 PM (13 years ago)
- Location:
- src/django_gheat/website
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/heatmap_extensions.js
r9246 r9251 44 44 // enc = $('#select_enc option:selected').text(); 45 45 // date = $('#select_date option:selected').text(); 46 start_date = $('#start_date').val(); 47 end_date = $('#end_date').val(); 46 48 colour = encodeURIComponent(document.getElementById("colour").value); 47 49 lname = encodeURIComponent(document.getElementById("lname").value); … … 56 58 // if (enc != ''){enc='&accespoint__encryptie='+enc;} 57 59 // if (date != ''){date='&meetrondje__datum='+date;} 58 if (colour != ''){colour='colour='+colour;} 60 if (start_date && end_date){ 61 sd_d=start_date.substr(0,2); 62 sd_m=start_date.substr(3,2); 63 sd_y=start_date.substr(6,4); 64 65 ed_d=end_date.substr(0,2); 66 ed_m=end_date.substr(3,2); 67 ed_y=end_date.substr(6,4); 68 69 start_date='&meetrondje__datum__gte=' + sd_y +'-'+ sd_m +'-'+ sd_d; 70 end_date='&meetrondje__datum__lte=' + ed_y +'-'+ ed_m +'-'+ ed_d; 71 } 72 73 74 if (colour != 'NaN,NaN,NaN'){colour='colour='+colour;} 59 75 else {colour = '&colour='+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256);} 60 76 if (lname != ''){lname=lname;} … … 66 82 initialize: function(name, options) { 67 83 var url = [ 68 baseurl + colour + user + dataset + wlnode /* + enc + date */84 baseurl + colour + user + dataset + wlnode + start_date + end_date /* + enc */ 69 85 ]; 70 86 document.getElementById('filter_text').innerHTML+="<br />Added: " + url; -
src/django_gheat/website/templates/home.html
r9249 r9251 3 3 <link href="{{ STATIC_URL }}style.css" rel="stylesheet" type="text/css" media="screen" /> 4 4 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}jquery-1.6.1.min.js"></script> 5 <!-- 5 6 6 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}OpenLayers.js"></script> 7 7 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}OpenStreetMap.js"></script> 8 8 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap.js"></script> 9 --> 9 10 10 <script type="text/javascript" language="javascript" src="{{ STATIC_URL }}jquery.chained.js"></script> 11 11 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap_extensions.js"></script> 12 12 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}colorpicker.js"></script> 13 13 14 <!-- jquery UI datapicker -->15 <link type="text/css" href="{{ STATIC_URL }}jquery-ui-1.8.13.custom.css" rel="Stylesheet" />16 <script type="text/javascript" src="{{ STATIC_URL }}jquery-ui-1.8.13.custom.min.js"></script>14 <!-- jquery UI datapicker --> 15 <link type="text/css" href="{{ STATIC_URL }}jquery-ui-1.8.13.custom.css" rel="Stylesheet" /> 16 <script type="text/javascript" src="{{ STATIC_URL }}jquery-ui-1.8.13.custom.min.js"></script> 17 17 18 18 19 19 <script language="javascript" type="text/javascript"> 20 20 $(function(){ 21 // enable colorpicker22 21 $('#colour').colorPicker(); 23 $('#start_date').datepicker(); 24 $('#end_date').datepicker(); 22 $('#start_date, #end_date').datepicker({ 23 dateFormat: 'dd/mm/yy', 24 beforeShow: setEnd, 25 }); 26 27 function setEnd(element){ 28 if (element.id=='end_date'){ 29 var start_date = new Date($('#start_date').val()); 30 start_date.setDate(start_date.getDate()) 31 return { 32 minDate: start_date 33 }; 34 } 35 return {} 36 } 37 38 $('#start_date').change(function(){ 39 $('#end_date').val('').text(''); 40 }); 25 41 26 42 $('#menu_filter').click(function(){
Note:
See TracChangeset
for help on using the changeset viewer.