<commit_before><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="favicon.png">

    <title>Gerenciador de Mensagens</title>

    <!-- Bootstrap core CSS -->
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/style.css" rel="stylesheet">

    <!-- DataTables -->
    <link rel="stylesheet" href="/static/css/dataTables.bootstrap.css">

  </head>

  <body>

    <!-- Wrap all page content here -->
    <div id="wrap">

      <!-- Fixed navbar -->
      <div class="navbar navbar-default navbar-fixed-top">
        <div class="container">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Gerenciador de Mensagens</a>
          </div>
          <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>

      <!-- Begin page content -->
      <div class="container">
        &nbsp;
        <div class="row">
          <div class="span12">
            <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="mensagens" width="100%">
              <thead>
                  <tr>
                      <th>IP</th>
                      <th>Data</th>
                      <th>Nome</th>
                      <th>Cidade</th>
                      <th>Mensagem</th>
                      <th>E-Mail</th>
                      <th></th>
                  </tr>
              </thead>
              <tbody></tbody>
          </table>
        </div>
      </div>
      &nbsp;
      <div class="row">
          <div class="span12">
              <div class="btn-toolbar" style="margin: 0;">
                <button class="btn btn-primary" onclick="javascript:refreshMessages();"><span class="glyphicon glyphicon-refresh"></span> Atualizar</button>
                <a data-toggle="modal" href="#deleteAllModal" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span> Apagar Todas</a>
              </div>
          </div>
        </div>
      </div>

        <div class="modal fade" id="deleteAllModal" tabindex="-1" role="dialog" aria-labelledby="deleteAllModal" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Apagar Todas Mensagens?</h4>
                    </div>
                    <div class="modal-body">
                        <p>Você tem certeza que deseja apagar todas mensagens?</p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
                        <button type="button" class="btn btn-danger" data-dismiss="modal" onclick="javascript:deleteMessage('all');"><span class="glyphicon glyphicon-trash"></span> Confirmar</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->

    </div>

    <div id="footer">
      <div class="container">
        <p class="text-muted credit">Desenvolvido por <a href="http://overloaded.io/"><NAME></a>. &copy; 2013 <NAME>.</p>
      </div>
    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js"></script>
    <script src="/static/js/dataTables.bootstrap.js"></script>
    <script src="/static/js/dataTables.fnReloadAjax.js"></script>
    <script type="text/javascript">
      function deleteMessage(id) {
          var oTable = $('#mensagens').dataTable();
          $.ajax({
              type: "DELETE",
              url: "/message",
              data: {id: id},
              complete: function() {
                  setTimeout(function() {
                      oTable.fnReloadAjax();
                  }, 500); // Waiting 500ms until the delete is active on the database
              }
          });
      }

      function refreshMessages() {
          var oTable = $('#mensagens').dataTable();
          oTable.fnReloadAjax();<commit_msg>Fixing delete problem where body was being sent with DELETE requests.<commit_after><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="favicon.png">

    <title>Gerenciador de Mensagens</title>

    <!-- Bootstrap core CSS -->
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/style.css" rel="stylesheet">

    <!-- DataTables -->
    <link rel="stylesheet" href="/static/css/dataTables.bootstrap.css">

  </head>

  <body>

    <!-- Wrap all page content here -->
    <div id="wrap">

      <!-- Fixed navbar -->
      <div class="navbar navbar-default navbar-fixed-top">
        <div class="container">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Gerenciador de Mensagens</a>
          </div>
          <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>

      <!-- Begin page content -->
      <div class="container">
        &nbsp;
        <div class="row">
          <div class="span12">
            <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="mensagens" width="100%">
              <thead>
                  <tr>
                      <th>IP</th>
                      <th>Data</th>
                      <th>Nome</th>
                      <th>Cidade</th>
                      <th>Mensagem</th>
                      <th>E-Mail</th>
                      <th></th>
                  </tr>
              </thead>
              <tbody></tbody>
          </table>
        </div>
      </div>
      &nbsp;
      <div class="row">
          <div class="span12">
              <div class="btn-toolbar" style="margin: 0;">
                <button class="btn btn-primary" onclick="javascript:refreshMessages();"><span class="glyphicon glyphicon-refresh"></span> Atualizar</button>
                <a data-toggle="modal" href="#deleteAllModal" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span> Apagar Todas</a>
              </div>
          </div>
        </div>
      </div>

        <div class="modal fade" id="deleteAllModal" tabindex="-1" role="dialog" aria-labelledby="deleteAllModal" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Apagar Todas Mensagens?</h4>
                    </div>
                    <div class="modal-body">
                        <p>Você tem certeza que deseja apagar todas mensagens?</p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
                        <button type="button" class="btn btn-danger" data-dismiss="modal" onclick="javascript:deleteMessage('all');"><span class="glyphicon glyphicon-trash"></span> Confirmar</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->

    </div>

    <div id="footer">
      <div class="container">
        <p class="text-muted credit">Desenvolvido por <a href="http://overloaded.io/"><NAME></a>. &copy; 2013 <NAME>.</p>
      </div>
    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js"></script>
    <script src="/static/js/dataTables.bootstrap.js"></script>
    <script src="/static/js/dataTables.fnReloadAjax.js"></script>
    <script type="text/javascript">
      function deleteMessage(id) {
          var oTable = $('#mensagens').dataTable();
          $.ajax({
              type: "DELETE",
              url: "/message?id=" + id,
              complete: function() {
                  setTimeout(function() {
                      oTable.fnReloadAjax();
                  }, 1000); // Waiting 1s until the delete is active on the database
              }
          });
      }

      function refreshMessages() {
          var oTable = $('#mensagens').dataTable();
          oTable.fnReloadAjax();
{'fraction_non_alphanumeric': 0.17944267669462927, 'fraction_numerical': 0.007617394658181467, 'mean_word_length': 1.880311024715357, 'pattern_counts': {'":': 0, '<': 275, '<?xml version=': 0, '>': 275, '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': '6228423', 'n_tokens_mistral': 3094, 'n_tokens_neox': 2892, 'n_words': 581}