<commit_before>(function($) {
  $.fn.toModal = function(options) {

    // TODO: Add default settings
    // var settings = {
    // ...
    // };

    return this.each(function() {

      // if (options) {
      //   $.extend(settings, options);
      // }

      var popup = $(this);
      var overlay = $('<div id="toModalOverlay" />').prependTo('body');
      var modal = [popup, overlay];

      overlay.css({
        'z-index': 100,
        'background-color': '#000',
        'opacity': '0.85',
        'position': 'fixed',
        'top': 0, 'right': 0, 'bottom': 0, 'left': 0,
        'display': 'none'
      });

      popup.css({
        'z-index': 101,
        'margin-top': -(popup.height() / 2),
        'margin-left': -(popup.width() / 2),
        'position': 'fixed',
        'top': '50%', 'left': '50%',
        'display': 'none'
      });
      
      $(".toModalClose").click(function() {
        $.each(modal, function() {this.hide()});
      });
      
      $(".toModalOpen").click(function() {
        $.each(modal, function() {this.show()});
      });

    });
  };
})( jQuery );
<commit_msg>Added settings as function argument<commit_after>(function($) {
  $.fn.toModal = function(options) {

    var settings = {
      opacity: '0.85',
      zIndex: 100,
      showOnLoad: false,
      openElement: ".toModalOpen",
      closeElement: ".toModalClose",
      overlayElement: "#toModalOverlay"
    };

    return this.each(function() {

      if (options) {
        $.extend(settings, options);
      }

      var popup = $(this);
      var overlay = $('<div id="' + settings.overlayElement + '" />').prependTo('body');
      var modal = [popup, overlay];
      
      var isDisplay = function() {
        return (settings.showOnLoad) ? 'block' : 'none';
      }

      overlay.css({
        zIndex: settings.zIndex,
        backgroundColor: '#000',
        opacity: settings.opacity,
        position: 'fixed',
        top: 0, right: 0, bottom: 0, left: 0,
        display: isDisplay
      });

      popup.css({
        zIndex: settings.zIndex += 1,
        marginTop: -(popup.height() / 2),
        marginLeft: -(popup.width() / 2),
        position: 'fixed',
        top: '50%', left: '50%',
        display: isDisplay
      });

      $(settings.openElement).click(function() {
        $.each(modal, function() {this.show()});
      });

      $(settings.closeElement).click(function() {
        $.each(modal, function() {this.hide()});
      });


    });
  };
})( jQuery );

{'fraction_non_alphanumeric': 0.19808306709265175, 'fraction_numerical': 0.016773162939297124, 'mean_word_length': 1.9680094786729858, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '855226', 'n_tokens_mistral': 831, 'n_tokens_neox': 767, 'n_words': 165}