<commit_before>;(function() {
'use strict';

angular.module('gebo-client-token')
  .controller('CallbackCtrl', function ($scope, $location) {

    /**
     * Parses an escaped url query string into key-value pairs.
     *
     * (Copied from Angular.js in the AngularJS project.)
     *
     * @param string
     *
     * @returns Object.<(string|boolean)>
     */
    function parseKeyValue(queryString) {
      var obj = {}, key_value, key;
      angular.forEach((queryString || '').split('&'), function(queryString){
        if (queryString) {
          key_value = queryString.split('=');
          key = decodeURIComponent(key_value[0]);
          obj[key] = angular.isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : true;
        }
      });
      return obj;
    }

    var queryString = $location.path().substring(1);  // preceding slash omitted
    var params = parseKeyValue(queryString);

    // TODO: The target origin should be set to an explicit origin.  Otherwise, 
    //       a malicious site that can receive the token if it manages to change
    //       the location of the parent. (See:
    //       https://developer.mozilla.org/en/docs/DOM/window.postMessage#Security_concerns)

    window.opener.postMessage(params, '*');
    window.close();

  });
}());<commit_msg>Add window param<commit_after>;(function(window) {
'use strict';

angular.module('gebo-client-token')
  .controller('CallbackCtrl', function ($scope, $location) {

    /**
     * Parses an escaped url query string into key-value pairs.
     *
     * (Copied from Angular.js in the AngularJS project.)
     *
     * @param string
     *
     * @returns Object.<(string|boolean)>
     */
    function parseKeyValue(queryString) {
      var obj = {}, key_value, key;
      angular.forEach((queryString || '').split('&'), function(queryString){
        if (queryString) {
          key_value = queryString.split('=');
          key = decodeURIComponent(key_value[0]);
          obj[key] = angular.isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : true;
        }
      });
      return obj;
    }

    var queryString = $location.path().substring(1);  // preceding slash omitted
    var params = parseKeyValue(queryString);

    // TODO: The target origin should be set to an explicit origin.  Otherwise, 
    //       a malicious site that can receive the token if it manages to change
    //       the location of the parent. (See:
    //       https://developer.mozilla.org/en/docs/DOM/window.postMessage#Security_concerns)

    window.opener.postMessage(params, '*');
    window.close();
  });
}(window));
{'fraction_non_alphanumeric': 0.13903743315508021, 'fraction_numerical': 0.0030557677616501145, 'mean_word_length': 2.7201704545454546, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3255367', 'n_tokens_mistral': 781, 'n_tokens_neox': 757, 'n_words': 187}