<commit_before><style type="text/css">
.img_view {
  float: left;
  margin: 0 0 10px 10px;
}
</style>

<script type="text/javascript">
  function refreshView() {
    $("#view_graphs img").each(function (index) {
	var src = $(this).attr("src");
	if (src.indexOf("graph.php") == 0) {
	  var d = new Date();
	  $(this).attr("src", jQuery.param.querystring(src, "&_=" + d.getTime()));
	}    
    });
  }

  $(function() {
    $( "#popup-dialog" ).dialog({ autoOpen: false, minWidth: 850 });
    $("#create_view_button")
      .button()
      .click(function() {
	$( "#create-new-view-dialog" ).dialog( "open" );
    });
    $("#delete_view_button")
      .button()
      .click(function() {
        if ($("#vn").val() != "") {
	  $.get('views_view.php?view_name=' + 
                encodeURIComponent($("#vn").val()) +
                '&delete_view&views_menu',
                function(data) {
                  $("#views_menu").html(data);
                  $("#view_graphs").html("");  
                  $.cookie('ganglia-selected-view-' + window.name, "");
		  $("#vn").val("");
                });
        } else
	  alert("Please select the view to delete");
    });
    highlightSelectedView('{$view_name}');
  });
</script>

<div id="popup-dialog" title="Inspect Graph">
  <div id="popup-dialog-content">
  </div>
</div>

<table id="views_table">
<tr><td valign="top">
<div id="views_menu">
  <p>Existing views:</p>
  <ul id="navlist"><commit_msg>Add a user check before deleting a view<commit_after><style type="text/css">
.img_view {
  float: left;
  margin: 0 0 10px 10px;
}
</style>

<script type="text/javascript">
  function refreshView() {
    $("#view_graphs img").each(function (index) {
	var src = $(this).attr("src");
	if (src.indexOf("graph.php") == 0) {
	  var d = new Date();
	  $(this).attr("src", jQuery.param.querystring(src, "&_=" + d.getTime()));
	}    
    });
  }

  $(function() {
    $( "#popup-dialog" ).dialog({ autoOpen: false, minWidth: 850 });
    $("#create_view_button")
      .button()
      .click(function() {
	$( "#create-new-view-dialog" ).dialog( "open" );
    });
    $("#delete_view_button")
      .button()
      .click(function() {
        if ($("#vn").val() != "") {
	  if (confirm("Are you sure you want to delete the view: " + $("#vn").val() + " ?")) {
	    $.get('views_view.php?view_name=' + 
                  encodeURIComponent($("#vn").val()) +
                  '&delete_view&views_menu',
                  function(data) {
                    $("#views_menu").html(data);
                    $("#view_graphs").html("");  
                    $.cookie('ganglia-selected-view-' + window.name, "");
		    $("#vn").val("");
                  });
          }
        } else
	  alert("Please select the view to delete");
    });
    highlightSelectedView('{$view_name}');
  });
</script>

<div id="popup-dialog" title="Inspect Graph">
  <div id="popup-dialog-content">
  </div>
</div>

<table id="views_table">
<tr><td valign="top">
<div id="views_menu">
  <p>Existing views:</p>
  <ul id="navlist">
{'fraction_non_alphanumeric': 0.2234251968503937, 'fraction_numerical': 0.006561679790026247, 'mean_word_length': 2.5619158878504673, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4311210', 'n_tokens_mistral': 1054, 'n_tokens_neox': 1005, 'n_words': 187}