<commit_before>// Initialize 3rd party social sharing widgets
/*global FB, twttr, IN, STMBLPN */
define(['jquery'], function($) {
  'use strict';

  return {
    init: function($context) {
      this.twitter($context);
      this.facebook($context);
      this.linkedin($context);
      this.pinterest($context);
      this.stumbledupon($context);
    },

    twitter: function($context) {
      if ($('.viral-button-twitter', $context).length) {
        require(['//platform.twitter.com/widgets.js'], function() {
          try {
            twttr.widgets.load();
          }
          catch (e) {}
        });
      }
    },

    linkedin: function($context) {
      if ($('.viral-button-linkedin', $context).length) {
        require(['//platform.linkedin.com/in.js'], function() {
          if (typeof IN !== 'undefined' && IN.parse) { IN.parse(); }
        });
      }
    },

    facebook: function($context) {
      if ($('.fb-like', $context).length) {
        require(['//connect.facebook.net/en_US/all.js#xfbml=1'], function() {
          if (typeof FB !== 'undefined' && FB.XFBML) { FB.XFBML.parse(); }
        });
      }
    },

    pinterest: function pinterest($context) {
      $('.viral-button-pinterest', $context).on('click', function() {
        require(['//assets.pinterest.com/js/pinmarklet.js'], function() {
          if (typeof pinterest === 'undefined') {
            return;
          }

          if (pinterest.PIN) {
            window[pinterest.PIN].f.init();
            return;
          }

          pinterest.PIN = Object.keys(window).filter(function(key) {
            return (/^PIN_/).test(key);
          })[0];
        });
      });
    },

    stumbledupon: function($context) {
      if ($('.viral-button-stumble', $context).length && window.location.protocol === 'https:') {
        require(['//platform.stumbleupon.com/1/widgets.js'], function() {
          if (typeof STMBLPN !== 'undefined') { STMBLPN.processWidgets(); }
        });
      }
    }
  };
});<commit_msg>Social: add js classes and fix bug that showed stumble upon on secure pages.<commit_after>// Initialize 3rd party social sharing widgets
/*global FB, twttr, IN, STMBLPN */
define(['jquery'], function($) {
  'use strict';

  return {
    init: function($context) {
      this.twitter($context);
      this.facebook($context);
      this.linkedin($context);
      this.pinterest($context);
      this.stumbledupon($context);
    },

    twitter: function($context) {
      if ($('.js-viral-button-twitter', $context).length) {
        require(['//platform.twitter.com/widgets.js'], function() {
          try {
            twttr.widgets.load();
          }
          catch (e) {}
        });
      }
    },

    linkedin: function($context) {
      if ($('.js-viral-button-linkedin', $context).length) {
        require(['//platform.linkedin.com/in.js'], function() {
          if (typeof IN !== 'undefined' && IN.parse) { IN.parse(); }
        });
      }
    },

    facebook: function($context) {
      if ($('.js-viral-button-fb', $context).length) {
        require(['//connect.facebook.net/en_US/all.js#xfbml=1'], function() {
          if (typeof FB !== 'undefined' && FB.XFBML) { FB.XFBML.parse(); }
        });
      }
    },

    pinterest: function pinterest($context) {
      $('.js-viral-button-pinterest', $context).on('click', function() {
        require(['//assets.pinterest.com/js/pinmarklet.js'], function() {
          if (typeof pinterest === 'undefined') {
            return;
          }

          if (pinterest.PIN) {
            window[pinterest.PIN].f.init();
            return;
          }

          pinterest.PIN = Object.keys(window).filter(function(key) {
            return (/^PIN_/).test(key);
          })[0];
        });
      });
    },

    stumbledupon: function($context) {
      // Do not show stumbleupon when on secure pages as they throw security
      // warnings because they load insecure subresources, last checked 3/13/2015
      if (window.location.protocol !== 'https:' && $('.js-viral-button-stumble', $context).length) {
        require(['//platform.stumbleupon.com/1/widgets.js'], function() {
          if (typeof STMBLPN !== 'undefined') { STMBLPN.processWidgets(); }
        });
      }
    }
  };
});
{'fraction_non_alphanumeric': 0.1848208011243851, 'fraction_numerical': 0.0035137034434293743, 'mean_word_length': 2.139705882352941, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '568237', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1260, 'n_words': 228}