Changeset 9246


Ignore:
Timestamp:
Jun 9, 2011, 5:32:53 PM (13 years ago)
Author:
dennisw
Message:

Added a colorpicker for the filters.

Location:
src/django_gheat/website
Files:
2 added
3 edited

Legend:

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

    r9244 r9246  
    4747    lname = encodeURIComponent(document.getElementById("lname").value);
    4848
     49    // HEX to RGB: http://stackoverflow.com/questions/5798868/need-some-tips-with-how-to-convert-a-hexadecimal-color-value-to-a-rgb-one/5798900#5798900
     50    // '#' comes out as '%23', so substr() starts at char 3
     51    colour = parseInt((colour.substr(3, 2)),16) + ',' + parseInt((colour.substr(5, 2)),16) + ',' + parseInt((colour.substr(7, 2)),16);
     52
    4953    if (user != ''){user='&meetrondje__gebruiker__naam='+user;}
    5054    if (dataset != ''){dataset='&meetrondje__naam='+dataset;}
    51     if (wlnode != 'All'){wlnode='&accespoint__ssid='+wlnode;}
     55    if (wlnode != ''){wlnode='&accespoint__ssid='+wlnode;}
    5256//    if (enc != ''){enc='&accespoint__encryptie='+enc;}
    5357//    if (date != ''){date='&meetrondje__datum='+date;}
  • src/django_gheat/website/static/style.css

    r9237 r9246  
    111111  color:#DDD;
    112112}
     113
     114
     115/* Colorpicker */
     116 
     117div.color_picker {
     118  height: 16px;
     119  width: 16px;
     120  padding: 0 !important;
     121  border: 1px solid #ccc;
     122  background: url(img/arrow.gif) no-repeat top right;
     123  cursor: pointer;
     124  line-height: 16px;
     125  z-index:2;
     126  float:left;
     127  margin-top:-3px;
     128  margin-right:3px;
     129}
     130
     131div#color_selector {
     132  width: 110px;
     133  position: absolute;
     134  border: 1px solid #598FEF;
     135  background-color: #EFEFEF;
     136  padding: 2px;
     137  z-index:2;
     138}
     139  div#color_custom {width: 100%; float:left }
     140  div#color_custom label {font-size: 95%; color: #2F2F2F; margin: 5px 2px; width: 25%}
     141  div#color_custom input {margin: 5px 2px; padding: 0; font-size: 95%; border: 1px solid #000; width: 65%; }
     142
     143div.color_swatch {
     144  height: 12px;
     145  width: 12px;
     146  border: 1px solid #000;
     147  margin: 2px;
     148  float: left;
     149  cursor: pointer;
     150  line-height: 12px;
     151  z-index:2;
     152}
     153
  • src/django_gheat/website/templates/home.html

    r9243 r9246  
    88  <script type="text/javascript" language="javascript" src="{{ STATIC_URL }}jquery.chained.js"></script>
    99  <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap_extensions.js"></script>
     10  <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}colorpicker.js"></script>
    1011  <script language="javascript" type="text/javascript">
    1112    $(function(){
     13      // enable colorpicker
     14      $('#colour').colorPicker();
     15
    1216      $('#menu_filter').click(function(){
    1317        $('#filter').slideToggle('fast');
     
    4549          <select id="select_dataset" style="width:104px"></select> Dataset<br />
    4650          <select id="select_node" style="width:104px"></select> Node<br />
    47           <input type="text" id="lname" name="lname" size="10"/> Layername<br />
    48           <input type="text" id="colour" name="colour" size="10"/> Colour<br />
     51          <input type="text" id="lname" name="lname" size="10"/> Layername<br /><br />
     52          <input type="text" id="colour" name="colour"/> Colour<br /><br />
    4953          <input type="button" id="add_filter" value="Add filter"/>
    5054        </form>
Note: See TracChangeset for help on using the changeset viewer.