<commit_before>'use strict';

(function(){

  angular
    .module('bitcoincom.controllers')
    .controller('tabSpendController', tabSpendController);
    
  function tabSpendController(
    externalLinkService
    , gettextCatalog
    , $scope
    , uxLanguage
    ) {
    
    var vm = this;

    // Functions
    vm.onCheapAir = onCheapAir
    vm.onStartAccepting = onStartAccepting;
    vm.onEGifter = onEGifter;
    vm.onMerchant = onMerchant;
    vm.onPurseIo = onPurseIo;

    // Variables
    vm.merchants = [];
    
    var startAcceptingLinks = {
      en: 'https://bitcoincashers.org/en/intro/for-merchants/',
      es: 'https://bitcoincashers.org/es/intro/for-merchants/',
      fr: 'https://bitcoincashers.org/fr/intro/for-merchants/',
      pt: 'https://bitcoincashers.org/pt/intro/for-merchants/',
      de: 'https://bitcoincashers.org/de/intro/for-merchants/',
      it: 'https://bitcoincashers.org/it/intro/for-merchants/',
      ja: 'https://bitcoincashers.org/ja/intro/for-merchants/',
      ko: 'https://bitcoincashers.org/ko/intro/for-merchants/',
      zh: 'https://bitcoincashers.org/zh/intro/for-merchants/'
    };

    
    $scope.$on("$ionicView.beforeEnter", _onBeforeEnter);

    function _onBeforeEnter(event, data) {

      // Do the setup here so we get the translations
      
      vm.merchants = [
        {
          description: gettextCatalog.getString("The market's highest paying pool"),
          icon: 'img/merchants/mining_merchant_icon.svg',
          name: gettextCatalog.getString('Start mining Bitcoin'),
          url: 'https://pool.bitcoin.com'
        },
        {
          description: gettextCatalog.getString('Pay with BCH, get 10% back'),
          icon: 'img/merchants/bitcoincom_store_merchant_icon.svg',
          name: gettextCatalog.getString('Get your Bitcoin merch'),
          url: 'https://store.bitcoin.com'
        }
      ];
      
      
    }
    
    function onCheapAir() {
      externalLinkService.open('https://www.cheapair.com/');
    }

    function onEGifter() {
      externalLinkService.open('https://www.egifter.com/');
    }

    function onMerchant(index) {
      var merchant = vm.merchants[index];
      externalLinkService.open(merchant.url);
    }

    function onPurseIo() {
      externalLinkService.open('https://purse.io/?_r=bitcoinwallet');
    }

    function onStartAccepting() {
      var currentLanguageCode = uxLanguage.currentLanguage;
      var url = startAcceptingLinks[currentLanguageCode] || startAcceptingLinks.en;
      externalLinkService.open(url);
    }

    
  }
  
})();<commit_msg>Added campaign tracking for our merchant links on the Spend screen.<commit_after>'use strict';

(function(){

  angular
    .module('bitcoincom.controllers')
    .controller('tabSpendController', tabSpendController);
    
  function tabSpendController(
    externalLinkService
    , gettextCatalog
    , platformInfo
    , $scope
    , uxLanguage
    ) {
    
    var vm = this;

    // Functions
    vm.onCheapAir = onCheapAir
    vm.onStartAccepting = onStartAccepting;
    vm.onEGifter = onEGifter;
    vm.onMerchant = onMerchant;
    vm.onPurseIo = onPurseIo;

    // Variables
    vm.merchants = [];

    var os = platformInfo.isAndroid ? 'android' : platformInfo.isIOS ? 'ios' : 'desktop';
    
    var startAcceptingLinks = {
      en: 'https://bitcoincashers.org/en/intro/for-merchants/',
      es: 'https://bitcoincashers.org/es/intro/for-merchants/',
      fr: 'https://bitcoincashers.org/fr/intro/for-merchants/',
      pt: 'https://bitcoincashers.org/pt/intro/for-merchants/',
      de: 'https://bitcoincashers.org/de/intro/for-merchants/',
      it: 'https://bitcoincashers.org/it/intro/for-merchants/',
      ja: 'https://bitcoincashers.org/ja/intro/for-merchants/',
      ko: 'https://bitcoincashers.org/ko/intro/for-merchants/',
      zh: 'https://bitcoincashers.org/zh/intro/for-merchants/'
    };

    
    $scope.$on("$ionicView.beforeEnter", _onBeforeEnter);

    function _onBeforeEnter(event, data) {

      // Do the setup here so we get the translations
      
      vm.merchants = [
        {
          description: gettextCatalog.getString("The market's highest paying pool"),
          icon: 'img/merchants/mining_merchant_icon.svg',
          name: gettextCatalog.getString('Start mining Bitcoin'),
          url: 'https://pool.bitcoin.com/?utm_source=WalletApp&utm_medium=' + os + '&utm_campaign=Pool'
        },
        {
          description: gettextCatalog.getString('Pay with BCH, get 10% back'),
          icon: 'img/merchants/bitcoincom_store_merchant_icon.svg',
          name: gettextCatalog.getString('Get your Bitcoin merch'),
          url: 'https://store.bitcoin.com/?utm_source=WalletApp&utm_medium=' + os + '&utm_campaign=Pool'
        }
      ];
      
      
    }
    
    function onCheapAir() {
      externalLinkService.open('https://www.cheapair.com/');
    }

    function onEGifter() {
      externalLinkService.open('https://www.egifter.com/');
    }

    function onMerchant(index) {
      var merchant = vm.merchants[index];
      externalLinkService.open(merchant.url);
    }

    function onPurseIo() {
      externalLinkService.open('https://purse.io/?_r=bitcoinwallet');
    }

    function onStartAccepting() {
      var currentLanguageCode = uxLanguage.currentLanguage;
      var url = startAcceptingLinks[currentLanguageCode] || startAcceptingLinks.en;
      externalLinkService.open(url);
    }

    
  }
  
})();
{'fraction_non_alphanumeric': 0.13538236370289058, 'fraction_numerical': 0.0007317965605561653, 'mean_word_length': 2.671591672263264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 28, 'lorem ipsum': 0, 'www.': 4, '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': '2128676', 'n_tokens_mistral': 1860, 'n_tokens_neox': 1789, 'n_words': 260}