Changeset 9243


Ignore:
Timestamp:
Jun 8, 2011, 4:12:31 PM (13 years ago)
Author:
dennisw
Message:

Options are now added to select-elements as described on http://stackoverflow.com/questions/170986/what-is-the-best-way-to-add-options-to-a-select-from-an-array-with-jquery which seems to be a faster way.

Disabled non-working filters. No point in showing them if they don't work yet. (date & encryption)

Location:
src/django_gheat/website
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/website/static/heatmap_extensions.js

    r9241 r9243  
    1 // Uses zoomlevel en mouseposition to call the nodelist.py view. View returns nodes in json format which is read and printed in document element.
     1// Uses zoomlevel and mouseposition to call the nodelist.py view. View returns nodes in json format which is read and printed in document element.
    22function getNodeList(zoomlevel, mousepos) {
    33  $.getJSON("/website/nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon,
     
    2020    function(json) {
    2121      $.each(json, function(i,json){
    22        // $("<option value='"  + json.gebruiker + "'>" + json.gebruiker + "</option>").appendTo("#select_user");
    2322        $("#select_user").append($("<option/>").attr("value",json.gebruiker).text(json.gebruiker));
    2423        $.each(json.meetrondje, function(m, meetrondje){
    25           $("<option class='" + json.gebruiker + "' value='" + meetrondje.naam + "'>"+ meetrondje.naam + "</option>").appendTo("#select_dataset");
     24          $("#select_dataset").append($("<option/>").attr({"class":json.gebruiker, "value":meetrondje.naam}).text(meetrondje.naam));
    2625          $.each(meetrondje.nodes, function(n, nodes){
    27             $("<option class='" + meetrondje.naam + "' value='" + nodes + "'>" + nodes + "</option>").appendTo("#select_node");
     26            $("#select_node").append($("<option/>").attr({"class":meetrondje.naam, "value":nodes}).text(nodes));
    2827          });
    29 //          $("<option>" + meetrondje.datum + "</option>").appendTo("#select_date");
    3028        });
    3129      });
    32 // Initiate the chain
     30    // Initiate the chain
    3331    $("#select_dataset").chained("#select_user");
    3432    $("#select_node").chained("#select_dataset");
     
    4442    dataset = $('#select_dataset option:selected').text();
    4543    wlnode = $('#select_node option:selected').text();
    46     enc = $('#select_enc option:selected').text();
    47     date = $('#select_date option:selected').text();
     44//    enc = $('#select_enc option:selected').text();
     45//    date = $('#select_date option:selected').text();
    4846    colour = encodeURIComponent(document.getElementById("colour").value);
    4947    lname = encodeURIComponent(document.getElementById("lname").value);
    5048
    5149    if (user != ''){user='&meetrondje__gebruiker__naam='+user;}
    52     else{user='';}
    5350    if (dataset != ''){dataset='&meetrondje__naam='+dataset;}
    54     else{dataset='';}
    55     if (wlnode != ''){wlnode='&accespoint__ssid='+wlnode;}
    56     else{wlnode='';}
    57     if (enc != ''){enc='&accespoint__encryptie='+enc;}
    58     if (date != ''){date='&meetrondje__datum='+date;}
    59     else{date='';}
     51    if (wlnode != 'All'){wlnode='&accespoint__ssid='+wlnode;}
     52//    if (enc != ''){enc='&accespoint__encryptie='+enc;}
     53//    if (date != ''){date='&meetrondje__datum='+date;}
    6054    if (colour != ''){colour='colour='+colour;}
    6155    else {colour = '&colour='+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256);}
     
    6862      initialize: function(name, options) {
    6963        var url = [
    70           baseurl + colour + user + dataset + wlnode + enc + date
     64          baseurl + colour + user + dataset + wlnode /* + enc + date */
    7165        ];
    7266        document.getElementById('filter_text').innerHTML+="<br />Added: " + url;
  • src/django_gheat/website/templates/home.html

    r9242 r9243  
    4242      <div id="filter_list">
    4343        <form method="get" action="">
    44           <select id="select_date" style="width:104px"></select> Date<br />
    4544          <select id="select_user" style="width:104px"></select> User<br />
    4645          <select id="select_dataset" style="width:104px"></select> Dataset<br />
    4746          <select id="select_node" style="width:104px"></select> Node<br />
    48           <select id="select_encryption" style="width:104px"></select> Encryption<br />
    4947          <input type="text" id="lname" name="lname" size="10"/> Layername<br />
    5048          <input type="text" id="colour" name="colour" size="10"/> Colour<br />
Note: See TracChangeset for help on using the changeset viewer.