Revision 71acaee4 snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js

b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js
473 473
});
474 474
}
475 475

  
476
function bytesToSize(bytes) {
477
    var sizes = [ 'n/a', 'bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
478
    var i = +Math.floor(Math.log(bytes) / Math.log(1024));
479
    return  (bytes / Math.pow(1024, i)).toFixed( 0 ) + sizes[ isNaN( bytes ) ? 0 : i+1 ];
480
}
481
function date_ddmmmyytime(date)
482
{
483
  var d = date.getDate();
484
  var m = date.getMonth();
485
  var y = date.getYear();
486
  if(y >= 100)
487
  {
488
    y -= 100;
489
    y += 2000;
490
  }
491

  
492
    var curr_hour = date.getHours();
493

  
494
    if (curr_hour < 12){
495
        a_p = "am";
496
    } else {
497
       a_p = "pm";
498
    }
499

  
500
    if (curr_hour == 0) {
501
       curr_hour = 12;
502
    }
503
    if (curr_hour > 12){
504
       curr_hour = curr_hour - 12;
505
    }
506

  
507
    var curr_min = date.getMinutes();
508

  
509
  return "" +
510
    (d<10?"0"+d:d) + "/" +m + "/" + y + ' '+curr_hour + ":" + curr_min + a_p;
511
}
512

  
476 513

  
477 514
$(document).ready(function(){
478 515

  
......
572 609

  
573 610
    // checkbox: basic reaction on click (checked, unchecked)
574 611
    // see wizard
575
    $('.check').click(function(e){
612
    $('.check').on('click', function(e){
613
        alert('skata');
576 614
        e.preventDefault();
577 615
        e.stopPropagation();
578 616
        ui.changeCheckboxState(this);

Also available in: Unified diff