<commit_before><!DOCTYPE html>
<html>
<head>
  <title>Bootstrap Dialog Examples</title>
  <link
    rel="stylesheet"
    href="../components/bootstrap/docs/assets/css/bootstrap.css">
</head>
<body>
  <div class="container">
    <h3>Bootstrap Dialog Examples</h3>

    <p class="well">
      <button class="btn show-alert">Show Alert</button>
      <button class="btn show-confirm">Show Confirm</button>
      <button class="btn show-prompt">Show Prompt</button>
    </p>

    <div class="alert alert-success hide fade in">
      <button type="button" class="close" data-dismiss="alert">×</button>
      <strong></strong>
    </div>

    <div class="alert alert-error hide fade in">
      <button type="button" class="close" data-dismiss="alert">×</button>
      <strong></strong>
    </div>
  </div>

  <script src="../components/jquery/jquery.js"></script>
  <script src="../components/bootstrap/js/bootstrap-alert.js"></script>
  <script src="../components/bootstrap/js/bootstrap-modal.js"></script>
  <script src="../dist/bootstrap-dialogs.js"></script>

  <script>
    $(function () {

      function showSuccess(text) {
        var $el = $('.alert-success');
        $el.find('strong').text(text);
        $el.show().delay(1000).fadeOut('slow');
      }

      function showFailure(text) {
        var $el = $('.alert-error');
        $el.find('strong').text(text);
        $el.show().delay(1000).fadeOut('slow');
      }

      $('.show-alert').click(function () {
        Bootstrap.Dialogs
          .alert('Some message!')
          .always(function () {
            showSuccess('Alert dismissed!');
          });
      });

      $('.show-confirm').click(function () {
        Bootstrap.Dialogs
          .confirm('Please confirm', 'Can you confirm this?')
          .done(function () {
            showSuccess('You confirmed \\:D/');
          })
          .fail(function () {
            showFailure('You declined :(');
          });
      });

      $('.show-prompt').click(function () {
        Bootstrap.Dialogs
          .prompt('Please provide some input')
          .done(function (text) {
            if (text) {
              showSuccess('You typed: ' + text);
            } else {
              showFailure("You didn't type anything");
            }
          })
          .fail(function () {
            showFailure('Input cancelled');
          });
      });
    });
  </script>
</body>
</html><commit_msg>Add custom dialog to examples<commit_after><!DOCTYPE html>
<html>
<head>
  <title>Bootstrap Dialog Examples</title>
  <link
    rel="stylesheet"
    href="../components/bootstrap/docs/assets/css/bootstrap.css">
</head>
<body>
  <div class="container">
    <h3>Bootstrap Dialog Examples</h3>

    <p class="well">
      <button class="btn show-alert">Show Alert</button>
      <button class="btn show-confirm">Show Confirm</button>
      <button class="btn show-prompt">Show Prompt</button>
      <button class="btn show-custom">Custom</button>
    </p>

    <div class="alert alert-success hide fade in">
      <button type="button" class="close" data-dismiss="alert">×</button>
      <strong></strong>
    </div>

    <div class="alert alert-error hide fade in">
      <button type="button" class="close" data-dismiss="alert">×</button>
      <strong></strong>
    </div>
  </div>

  <script src="../components/jquery/jquery.js"></script>
  <script src="../components/bootstrap/js/bootstrap-alert.js"></script>
  <script src="../components/bootstrap/js/bootstrap-modal.js"></script>
  <script src="../dist/bootstrap-dialogs.js"></script>

  <script>
    $(function () {

      function showSuccess(text) {
        var $el = $('.alert-success');
        $el.find('strong').text(text);
        $el.show().delay(1000).fadeOut('slow');
      }

      function showFailure(text) {
        var $el = $('.alert-error');
        $el.find('strong').text(text);
        $el.show().delay(1000).fadeOut('slow');
      }


      /*
          Show an alert message.
       */

      $('.show-alert').click(function () {
        Bootstrap.Dialogs
          .alert('Some message!')
          .always(function () {
            showSuccess('Alert dismissed!');
          });
      });


      /*
          Show a confirmation dialog.
       */

      $('.show-confirm').click(function () {
        Bootstrap.Dialogs
          .confirm('Please confirm', 'Can you confirm this?')
          .done(function () {
            showSuccess('You confirmed \\:D/');
          })
          .fail(function () {
            showFailure('You declined :(');
          });
      });


      /*
          Show a simple prompt.
       */

      $('.show-prompt').click(function () {
        Bootstrap.Dialogs
          .prompt('Please provide some input')
          .done(function (text) {
            if (text) {
              showSuccess('You typed: ' + text);
            } else {
              showFailure("You didn't type anything");
            }
          })
          .fail(function () {
            showFailure('Input cancelled');
          });
      });


      /*
          A more contrived example of customizing possibilites.
       */

      $('.show-custom').click(function () {
        var dialog;

        function cancel() {
          dialog.reject();
        }

        function ok() {
          dialog.resolve();
        }

        var body = $('<div>').html([
          '<b>Custom body!</b>'
        ]);

        dialog = Bootstrap.Dialogs
          .dialog('Custom title', body, [
            [ 'CANCEL!', cancel ],
            $('<button>')
              .addClass('btn btn-primary')
              .html('OK!')
              .click(ok),
            [
              $('<button>')
                .addClass('btn btn-danger')
                .html('ERROR!'),
              function () {
                dialog.reject('error');
              }
            ]
          ])
          .done(function () {
            showSuccess('You clicked "OK!"');
          })
          .fail(function (error) {
            if (error) {
              showFailure('You clicked "ERROR!"');
            } else {
              showFailure('You clicked "CANCEL!"');
            }
          })
      });
    });
  </script>
</body>
</html>
{'fraction_non_alphanumeric': 0.17662170841361594, 'fraction_numerical': 0.0032113037893384713, 'mean_word_length': 1.8442922374429225, 'pattern_counts': {'":': 0, '<': 98, '<?xml version=': 0, '>': 98, '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': '4076588', 'n_tokens_mistral': 1811, 'n_tokens_neox': 1731, 'n_words': 326}