<commit_before>/**
 * This is where we load and initialize components of our app.
 */
define("app", function (require) {
  "use strict";

  var $ = require("jquery");
  var _ = require("lodash");

  // let's get going
  var Finder   = require("finder/Finder");
  var Donate   = require("donate/Donate");
  var Revealer = require("revealer/Revealer");
  var Swapper  = require("swapper/Swapper");
  var Reportback = require("reportback/Reportback");

  // Initialize modules on load
  require("neue");
  require("modal");
  require("validation");

  require("campaign/SchoolFinder");
  require("validators/auth");
  require("validators/reportback");
  require("validators/address");
  require("validators/donate");
  require("Analytics");
  require("tiles");

  $(document).ready(function() {
    // If a fixed-sticky element is on the page, hook it up.
    $(".js-fixedsticky").fixedsticky();

    var $body = $("body");

    var $campaignFinderForm = $(".js-finder-form");
    if( $campaignFinderForm.length ) {
      var $results = $(".js-campaign-results");
      var $blankSlate = $(".js-campaign-blankslate");
      Finder.init($campaignFinderForm, $results, $blankSlate);
    }


    var $donateForm = $("#modal--donate-form");
    if( $donateForm.length ) {
      Donate.init();
    }

    var $revealGalleries = $body.find('[data-show-more="true"]');
    /**
     * Show hide large galleries.
     */
    if ($revealGalleries.length > 0) {
      var galleryList = [];

      $revealGalleries.each(function (index, gallery) {
        var $gallery = $(gallery);
        var $tiles = $gallery.find("li");
        var isMosaicGallery = $gallery.hasClass('-mosaic');
        var initialItems = isMosaicGallery ? 5 : 6;
        var stepItems = isMosaicGallery ? 8 : 6;

        if ($tiles.length > initialItems) {
          galleryList[index] = new Revealer($gallery, $tiles, "gallery", initialItems, stepItems);
        }
      });
    }

    var $mosaicGalleries = $body.find(".gallery.-mosaic");

    /**
     * Swap low resolution images for feature tiles in mosaic gallery
     * with higher resolution version from tablet size up.
     */
    if ($mosaicGalleries.length && $mosaicGalleries.hasClass("-featured")) {
      var swappedImagesList = [];

      $(window).on("resize", _.debounce(function () {

        if (window.matchMedia("(min-width: 768px)").matches && !swappedImagesList.length) {
          $mosaicGalleries.each(function (index) {
            var $featureTile = $(this).find("li").first();
            swappedImagesList[index] = new Swapper($featureTile);
          });
        }
      }, 500));

    }

    /**
     * Initialize Reportback js.
     */
    var $reportback = $body.find("#reportback");

    if ($reportback.length) {
      Reportback.init($reportback);
    }


    // Open share links in a popup dialog.
    var windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes';
    var width         = 550;
    var height        = 420;
    var winHeight     = screen.height;
    var winWidth      = screen.width;

    $('body').on('click', 'a.js-share-link', function(event) {
      event.preventDefault();
      var leftPos = Math.round((winWidth / 2) - (width / 2));
      var topPos = 0;

      if (winHeight > height) {
        topPos = Math.round((winHeight / 2) - (height / 2));
      }

      window.open(this.href, 'intent', windowOptions + ',width=' + width +
       ',height=' + height + ',left=' + leftPos + ',top=' + topPos);
    });

    $("html").addClass("js-ready");

  });

});
<commit_msg>open a new window everytime<commit_after>/**
 * This is where we load and initialize components of our app.
 */
define("app", function (require) {
  "use strict";

  var $ = require("jquery");
  var _ = require("lodash");

  // let's get going
  var Finder   = require("finder/Finder");
  var Donate   = require("donate/Donate");
  var Revealer = require("revealer/Revealer");
  var Swapper  = require("swapper/Swapper");
  var Reportback = require("reportback/Reportback");

  // Initialize modules on load
  require("neue");
  require("modal");
  require("validation");

  require("campaign/SchoolFinder");
  require("validators/auth");
  require("validators/reportback");
  require("validators/address");
  require("validators/donate");
  require("Analytics");
  require("tiles");

  $(document).ready(function() {
    // If a fixed-sticky element is on the page, hook it up.
    $(".js-fixedsticky").fixedsticky();

    var $body = $("body");

    var $campaignFinderForm = $(".js-finder-form");
    if( $campaignFinderForm.length ) {
      var $results = $(".js-campaign-results");
      var $blankSlate = $(".js-campaign-blankslate");
      Finder.init($campaignFinderForm, $results, $blankSlate);
    }


    var $donateForm = $("#modal--donate-form");
    if( $donateForm.length ) {
      Donate.init();
    }

    var $revealGalleries = $body.find('[data-show-more="true"]');
    /**
     * Show hide large galleries.
     */
    if ($revealGalleries.length > 0) {
      var galleryList = [];

      $revealGalleries.each(function (index, gallery) {
        var $gallery = $(gallery);
        var $tiles = $gallery.find("li");
        var isMosaicGallery = $gallery.hasClass('-mosaic');
        var initialItems = isMosaicGallery ? 5 : 6;
        var stepItems = isMosaicGallery ? 8 : 6;

        if ($tiles.length > initialItems) {
          galleryList[index] = new Revealer($gallery, $tiles, "gallery", initialItems, stepItems);
        }
      });
    }

    var $mosaicGalleries = $body.find(".gallery.-mosaic");

    /**
     * Swap low resolution images for feature tiles in mosaic gallery
     * with higher resolution version from tablet size up.
     */
    if ($mosaicGalleries.length && $mosaicGalleries.hasClass("-featured")) {
      var swappedImagesList = [];

      $(window).on("resize", _.debounce(function () {

        if (window.matchMedia("(min-width: 768px)").matches && !swappedImagesList.length) {
          $mosaicGalleries.each(function (index) {
            var $featureTile = $(this).find("li").first();
            swappedImagesList[index] = new Swapper($featureTile);
          });
        }
      }, 500));

    }

    /**
     * Initialize Reportback js.
     */
    var $reportback = $body.find("#reportback");

    if ($reportback.length) {
      Reportback.init($reportback);
    }


    // Open share links in a popup dialog.
    var windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes';
    var width         = 550;
    var height        = 420;
    var winHeight     = screen.height;
    var winWidth      = screen.width;

    $('body').on('click', 'a.js-share-link', function(event) {
      event.preventDefault();
      var leftPos = Math.round((winWidth / 2) - (width / 2));
      var topPos = 0;

      if (winHeight > height) {
        topPos = Math.round((winHeight / 2) - (height / 2));
      }

      window.open(this.href, '_blank', windowOptions + ',width=' + width +
       ',height=' + height + ',left=' + leftPos + ',top=' + topPos);
    });

    $("html").addClass("js-ready");

  });

});

{'fraction_non_alphanumeric': 0.16619876473891074, 'fraction_numerical': 0.006176305446378439, 'mean_word_length': 2.7598944591029024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2009073', 'n_tokens_mistral': 2342, 'n_tokens_neox': 2165, 'n_words': 480}