<commit_before>'use strict';
/**
 * Created by oleksandr at 6/14/14 1:53 PM
 */
angular.module('myApp')
  .directive('dimensionedImg', ['util', '$parse',function(util, $parse) {
    function link($scope, element, attrs) {
      var image = new Image();
      if (!$scope.src) {
        console.log('skip dimensionedImg because src is undefined');
        return;
      }

      console.log($scope.src);
      image.src = $scope.src;
      image.onload = onLoad;

      element.removeAttr('src');
      element.removeAttr('width');
      element.removeAttr('height');

      function onLoad() {
        var dimensions = util.calculateImgDimensions(this, {width: attrs.width, height: attrs.height});
        element.css('width', dimensions.width);
        element.css('height', dimensions.height);
        element.attr('src', $scope.src); // show image when dimensions have been calculated
      }
    }
    return {
      replace: true,
      template: '<img/>',
      scope: {
        src: '=ngSrc',
        width: '=',
        height: '='
      },
      restrict: 'E',
      link: link
    };
  }]);<commit_msg>Remove log<commit_after>'use strict';
/**
 * Created by oleksandr at 6/14/14 1:53 PM
 */
angular.module('myApp')
  .directive('dimensionedImg', ['util', '$parse',function(util, $parse) {
    function link($scope, element, attrs) {
      var image = new Image();
      if (!$scope.src) {
        console.log('skip dimensionedImg because src is undefined');
        return;
      }

      image.src = $scope.src;
      image.onload = onLoad;

      element.removeAttr('src');
      element.removeAttr('width');
      element.removeAttr('height');

      function onLoad() {
        var dimensions = util.calculateImgDimensions(this, {width: attrs.width, height: attrs.height});
        element.css('width', dimensions.width);
        element.css('height', dimensions.height);
        element.attr('src', $scope.src); // show image when dimensions have been calculated
      }
    }
    return {
      replace: true,
      template: '<img/>',
      scope: {
        src: '=ngSrc',
        width: '=',
        height: '='
      },
      restrict: 'E',
      link: link
    };
  }]);
{'fraction_non_alphanumeric': 0.1598173515981735, 'fraction_numerical': 0.0073059360730593605, 'mean_word_length': 2.428794992175274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6814452', 'n_tokens_mistral': 666, 'n_tokens_neox': 655, 'n_words': 150}