<commit_before>var App = (function(){

  var map;
  var marker;

  function placeMarker(location) {
      if ( marker ) {
          marker.setPosition(location);
      } else {
          marker = new google.maps.Marker({
            position: location,
            map: map,
            title: 'Tu tienda'
          });
      }
    }

  var initializeMap = function(mapContainerId, latitude, longitude, latitudeBox, longitudeBox) {

    var mapOptions = {
      zoom: 8,
      center: new google.maps.LatLng(latitude, longitude)
    };

    map = new google.maps.Map(document.getElementById(mapContainerId),
        mapOptions);

    placeMarker(new google.maps.LatLng(latitude, longitude));

    google.maps.event.addListener(map, 'click', function(event) {
        placeMarker(event.latLng);
        document.getElementById(latitudeBox).value = event.latLng.lat();
        document.getElementById(longitudeBox).value = event.latLng.lng();
    });
  }

  var verifyFieldsMatch = function (firstFieldId, secondFieldId){
    var doMatch = (document.getElementById(firstFieldId).value == document.getElementById(secondFieldId).value);
    
    if (!doMatch)
    {
      alert('Las contraseñas no coinciden');
      return false;
    }
    else
    {
      return true;
    }
  };

  var syncronizeGertuPriceBoxes = function (normalPriceBoxId, gertuPriceBoxId, discountBoxId){

    document.getElementById(normalPriceBoxId).onchange = function(){

      var normalPrice = parseFloat((document.getElementById(normalPriceBoxId).value + '').replace(',', '.'));
      var gertuPrice = parseFloat((document.getElementById(gertuPriceBoxId).value + '').replace(',', '.'));
      
      var discount = 100 - (100 * (normalPrice > 0 ? 
                       gertuPrice / normalPrice :
                       0));

      discount = discount.toFixed(2);
   
      document.getElementById(discountBoxId).value = discount;
    };

    document.getElementById(gertuPriceBoxId).onchange = function(){

      var normalPrice = parseFloat(document.getElementById(normalPriceBoxId).value.replace(',', '.'));
      var gertuPrice = parseFloat(document.getElementById(gertuPriceBoxId).value.replace(',', '.'));
      
      var discount = 100 - (100 * (normalPrice > 0 ? 
                       gertuPrice / normalPrice :
                       0));

      discount = discount.toFixed(2);

      document.getElementById(discountBoxId).value = discount;
    };

    document.getElementById(discountBoxId).onchange = function(){

      var normalPrice = parseFloat(document.getElementById(normalPriceBoxId).value.replace(',', '.'));
      var discount = parseFloat(document.getElementById(discountBoxId).value.replace(',', '.'));
      
      var gertuPrice = normalPrice - (normalPrice * discount) / 100;

      gertuPrice = gertuPrice.toFixed(2);

      document.getElementById(gertuPriceBoxId).value = gertuPrice;
    };
  };

  return {
    initializeMap: initializeMap,
    verifyFieldsMatch: verifyFieldsMatch,
    syncronizeGertuPriceBoxes: syncronizeGertuPriceBoxes

  }
})();<commit_msg>Added method for managing all alerts in application<commit_after>var App = (function(){

  var map;
  var marker;

  function placeMarker(location) {
      if ( marker ) {
          marker.setPosition(location);
      } else {
          marker = new google.maps.Marker({
            position: location,
            map: map,
            title: 'Tu tienda'
          });
      }
    }

  var initializeMap = function(mapContainerId, latitude, longitude, latitudeBox, longitudeBox) {

    var mapOptions = {
      zoom: 8,
      center: new google.maps.LatLng(latitude, longitude)
    };

    map = new google.maps.Map(document.getElementById(mapContainerId),
        mapOptions);

    placeMarker(new google.maps.LatLng(latitude, longitude));

    google.maps.event.addListener(map, 'click', function(event) {
        placeMarker(event.latLng);
        document.getElementById(latitudeBox).value = event.latLng.lat();
        document.getElementById(longitudeBox).value = event.latLng.lng();
    });
  }

  var verifyFieldsMatch = function (firstFieldId, secondFieldId){
    var doMatch = (document.getElementById(firstFieldId).value == document.getElementById(secondFieldId).value);
    
    if (!doMatch)
    {
      alert('Las contraseñas no coinciden');
      return false;
    }
    else
    {
      return true;
    }
  };

  var syncronizeGertuPriceBoxes = function (normalPriceBoxId, gertuPriceBoxId, discountBoxId){

    document.getElementById(normalPriceBoxId).onchange = function(){

      var normalPrice = parseFloat((document.getElementById(normalPriceBoxId).value + '').replace(',', '.'));
      var gertuPrice = parseFloat((document.getElementById(gertuPriceBoxId).value + '').replace(',', '.'));
      
      var discount = 100 - (100 * (normalPrice > 0 ? 
                       gertuPrice / normalPrice :
                       0));

      discount = discount.toFixed(2);
   
      document.getElementById(discountBoxId).value = discount;
    };

    document.getElementById(gertuPriceBoxId).onchange = function(){

      var normalPrice = parseFloat(document.getElementById(normalPriceBoxId).value.replace(',', '.'));
      var gertuPrice = parseFloat(document.getElementById(gertuPriceBoxId).value.replace(',', '.'));
      
      var discount = 100 - (100 * (normalPrice > 0 ? 
                       gertuPrice / normalPrice :
                       0));

      discount = discount.toFixed(2);

      document.getElementById(discountBoxId).value = discount;
    };

    document.getElementById(discountBoxId).onchange = function(){

      var normalPrice = parseFloat(document.getElementById(normalPriceBoxId).value.replace(',', '.'));
      var discount = parseFloat(document.getElementById(discountBoxId).value.replace(',', '.'));
      
      var gertuPrice = normalPrice - (normalPrice * discount) / 100;

      gertuPrice = gertuPrice.toFixed(2);

      document.getElementById(gertuPriceBoxId).value = gertuPrice;
    };
  };

  var showAlert = function(outputMessage){

    alert(outputMessage);

  };

  return {
    initializeMap: initializeMap,
    verifyFieldsMatch: verifyFieldsMatch,
    syncronizeGertuPriceBoxes: syncronizeGertuPriceBoxes,
    showAlert: showAlert

  }
})();
{'fraction_non_alphanumeric': 0.12362768496420047, 'fraction_numerical': 0.007319013524264121, 'mean_word_length': 2.8874458874458875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6526068', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1760, 'n_words': 309}