<commit_before>/**
 * Buffer share buttons visible on hover
 */
;(function(){

  /**
   * Prevent from being inserted in certain situations
   */
  // Do not insert for iframes
  if (window !== window.parent) return;
  // Do no insert for content editing windows
  if (!document.body || document.body.hasAttribute('contenteditable')) return;


  /**
   * Site detection
   */
  var domain = window.location.hostname.replace('www.','');
  var site = {
    isGmail: /mail.google.com/.test(domain),
    isInstagram: /instagram.com/.test(domain)
  };

  // List of sites to disable this on:
  var disabledDomains = [
    'buffer.com',
    'bufferapp.com',
    'twitter.com',
    'facebook.com'
  ];
  if (disabledDomains.indexOf(domain) > -1) {
    return;
  }

  /**
   * Create a single global button
   */
  var currentImageUrl = null;
  var buttonWidth = 100;
  var buttonHeight = 25;
  var dpr = window.devicePixelRatio;
  var backgroundImage = (dpr && dpr > 1) ?
    xt.data.get('data/shared/img/buffer-hover-icon@2x.png') :
    xt.data.get('data/shared/img/buffer-hover-icon@1x.png');
  var isButtonVisible = false;

  var button = document.createElement('span');
  button.id = 'buffer-extension-hover-button';

  button.style.cssText = [
    'display: none;',
    'position: absolute;',
    'z-index: 8675309;',
    'width: ' + buttonWidth + 'px;',
    'height: ' + buttonHeight + 'px;',
    'background-image: url(' + backgroundImage +');',
    'background-size: ' + buttonWidth +'px ' + buttonHeight + 'px;',
    'opacity: 0.9;',
    'cursor: pointer;'
  ].join('');

  var offset = 5;
  var image;
  var box;

  var showButton = function(e) {
    image = e.target;

    box = image.getBoundingClientRect();
    if (box.height < 250 || box.width < 350) return;

    button.style.display = 'block';
    currentImageUrl = getImageUrl(image);
    isButtonVisible = true;
  };

  var locateButton = function() {<commit_msg>Prevent sharing of unsupported extension types<commit_after>/**
 * Buffer share buttons visible on hover
 */
;(function(){

  /**
   * Prevent from being inserted in certain situations
   */
  // Do not insert for iframes
  if (window !== window.parent) return;
  // Do no insert for content editing windows
  if (!document.body || document.body.hasAttribute('contenteditable')) return;


  /**
   * Site detection
   */
  var domain = window.location.hostname.replace('www.','');
  var site = {
    isGmail: /mail.google.com/.test(domain),
    isInstagram: /instagram.com/.test(domain)
  };

  // List of sites to disable this on:
  var disabledDomains = [
    'buffer.com',
    'bufferapp.com',
    'twitter.com',
    'facebook.com'
  ];
  if (disabledDomains.indexOf(domain) > -1) {
    return;
  }

  /**
   * Create a single global button
   */
  var currentImageUrl = null;
  var buttonWidth = 100;
  var buttonHeight = 25;
  var dpr = window.devicePixelRatio;
  var backgroundImage = (dpr && dpr > 1) ?
    xt.data.get('data/shared/img/buffer-hover-icon@2x.png') :
    xt.data.get('data/shared/img/buffer-hover-icon@1x.png');
  var isButtonVisible = false;

  var button = document.createElement('span');
  button.id = 'buffer-extension-hover-button';

  button.style.cssText = [
    'display: none;',
    'position: absolute;',
    'z-index: 8675309;',
    'width: ' + buttonWidth + 'px;',
    'height: ' + buttonHeight + 'px;',
    'background-image: url(' + backgroundImage +');',
    'background-size: ' + buttonWidth +'px ' + buttonHeight + 'px;',
    'opacity: 0.9;',
    'cursor: pointer;'
  ].join('');

  var offset = 5;
  var image;
  var box;

  var showButton = function(e) {
    image = e.target;
    var imageUrl = getImageUrl(image);

    var imageExtensionMatch = imageUrl.match(/\.[a-z]{3,4}$/i);
    if (imageExtensionMatch !== null && !/\.(jpg|jpeg|gif|png)/i.test(imageExtensionMatch[0])) {
      return;
    }

    box = image.getBoundingClientRect();
    if (box.height < 250 || box.width < 350) return;

    button.style.display = 'block';
    currentImageUrl = imageUrl;
    isButtonVisible = true;
  };

  var locateButton = function() {
{'fraction_non_alphanumeric': 0.15999022960429898, 'fraction_numerical': 0.012945774303859306, 'mean_word_length': 3.0424481737413624, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, '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': '1658141', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1341, 'n_words': 316}