Commit 34cbf615 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

interval selection modal wip (2)

parent 3915c726
Loading
Loading
Loading
Loading
+33 −5
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ table th{ background:#efefef; }
  font-weight:700;
}

.navbar a.button{
a.button{
  display:block;
  text-decoration:none;
  float:right;
@@ -145,7 +145,7 @@ table th{ background:#efefef; }
  cursor:pointer;
}

.navbar a.button.back{
a.button.back{
  float:left;
  margin-left:17px;
  font-weight: bold;
@@ -155,7 +155,7 @@ table th{ background:#efefef; }
  color:#555;
}

.navbar a.button:hover{
a.button:hover, a.button.dark{
background-color: #F4F4F4;
background-image: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#e9e9e9));
background-image: -webkit-linear-gradient(top, #f4f4f4, #e9e9e9);
@@ -167,10 +167,14 @@ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f4f4f4', EndC
color:#000;
}

.navbar a.button:active{
a.button:active, a.button.dark:hover{
  background:#ddd;
}

a.button.dark:active{
  background:#ccc;
}

.navbar a.button.datepicker{
  padding-left:0;
  padding-right:10px;
@@ -565,7 +569,7 @@ position: relative;
}

.modal.visible {
  top: 40px;
  top: 47px;
}

.modal_inner{
@@ -734,3 +738,27 @@ ul.ui_numbers li.twoline .title{
ul.ui_numbers li.twoline .val{
  font-size:16px;
}

input.input{
  background: white;
  padding: 0 13px;
  border: 1px solid #ccc;
  box-shadow: 0 0 2px #ddd inset;
  border-radius:3px;
  color: #666;
  font-size:14px;
  height: 32px;
  line-height: 32px;
}

input.input.ropen{
  border-right:none;
  border-top-right-radius:0;
  border-bottom-right-radius:0;
}

input.input.lopen{
  border-left:none;
  border-top-left-radius:0;
  border-bottom-left-radius:0;
}
+22 −5
Original line number Diff line number Diff line
@@ -77,10 +77,27 @@ FnordMetric.views.gaugeView = (function(gauge_name){
  }

  function open_interval_modal(){
    var modal = $('<div>');

    var interval_list = $('<ul>');
    var now = parseInt((new Date()).getTime() / 1000);

    for(n=0; n < 10; n++){
    modal.append(
      $('<div>')
        .css({
          background: '#f2f2f2',
          borderBottom: "1px solid #ddd",
          padding: '12px 20px 10px 20px'
        })
        .append('<a class="button dark" style="height:30px; float:right; margin:1px; line-height:30px;">OK</a>')
        .append('<input class="input ropen" style="width:100px;" placeholder="DD.MM.YYYY" />')
        .append('<input class="input lopen" style="width:50px;" placeholder="HH:MM" />')
        .append('<span style="margin:0 15px; color:#999;">&mdash;</span>')
        .append('<input class="input ropen" style="width:100px;" placeholder="DD.MM.YYYY" />')
        .append('<input class="input lopen" style="width:50px;" placeholder="HH:MM" />')
    );

    /*for(n=0; n < 10; n++){
      var interval = now;
      now -= 3600;
      interval += "-" + now;
@@ -93,12 +110,12 @@ FnordMetric.views.gaugeView = (function(gauge_name){
            select_interval($(this).attr('data'))
          }))
      );
    }
    }*/

    FnordMetric.ui.modal({
      height: 400,
      max_width: 900,
      content: interval_list
      height: 340,
      max_width: 570,
      content: modal
    });
  }

+1 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ var FnordMetric = (function(){
  }

  function loadView(_view){
    FnordMetric.ui.close_modal('body');
    if(currentView){ currentView.close(); }
    canvasElem.html('loading!');
    currentView = _view;
+2 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ FnordMetric.ui.navbar = function(elem, opts){
}

FnordMetric.ui.modal = function(opts){
  FnordMetric.ui.close_modal('body');
  width = $("#viewport").width() * 0.8;

  if (opts.max_width)
@@ -65,6 +66,7 @@ FnordMetric.ui.modal = function(opts){

FnordMetric.ui.close_modal = function(elem){
  $(elem).closest('.modal').removeClass('visible').fadeOut();
  $('.modal', $(elem)).removeClass('visible').fadeOut();
  $('.modal_backdrop').removeClass('visible').fadeOut();
}