<commit_before>(function() {
  'use strict'

  function queryLink() {
    return {
      restrict: 'E',
      scope: {
        'query': '=',
        'visualization': '=?'
      },
      template: '<a class="query-link">{{query.name}}</a>',
      link: function(scope, element) {
        var link = '/queries/' + scope.query.id;
        if (scope.visualization) {
          if (scope.visualization.type === 'TABLE') {
            // link to hard-coded table tab instead of the (hidden) visualization tab
            link += '#table';
          } else {
            link += '#' + scope.visualization.id;
          }
        }
        element.find('a').attr('href', link);
      }
    }
  }

  function querySourceLink() {
    return {
      restrict: 'E',
      template: '<span ng-show="query.id && canViewSource">\
                    <a ng-show="!sourceMode"\
                      ng-href="{{query.id}}/source#{{selectedTab}}">Show Source\
                    </a>\
                    <a ng-show="sourceMode"\
                      ng-href="/queries/{{query.id}}#{{selectedTab}}">Hide Source\
                    </a>\
                </span>'
    }
  }

  function queryEditor() {
    return {
      restrict: 'E',<commit_msg>[#90] query-link: use ng-href as @arikfr suggested<commit_after>(function() {
  'use strict'

  function queryLink() {
    return {
      restrict: 'E',
      scope: {
        'query': '=',
        'visualization': '=?'
      },
      template: '<a ng-href="{{link}}" class="query-link">{{query.name}}</a>',
      link: function(scope, element) {
        scope.link = '/queries/' + scope.query.id;
        if (scope.visualization) {
          if (scope.visualization.type === 'TABLE') {
            // link to hard-coded table tab instead of the (hidden) visualization tab
            scope.link += '#table';
          } else {
            scope.link += '#' + scope.visualization.id;
          }
        }
        // element.find('a').attr('href', link);
      }
    }
  }

  function querySourceLink() {
    return {
      restrict: 'E',
      template: '<span ng-show="query.id && canViewSource">\
                    <a ng-show="!sourceMode"\
                      ng-href="{{query.id}}/source#{{selectedTab}}">Show Source\
                    </a>\
                    <a ng-show="sourceMode"\
                      ng-href="/queries/{{query.id}}#{{selectedTab}}">Hide Source\
                    </a>\
                </span>'
    }
  }

  function queryEditor() {
    return {
      restrict: 'E',
{'fraction_non_alphanumeric': 0.17370706671930516, 'fraction_numerical': 0.0007895775759968417, 'mean_word_length': 1.591002044989775, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '4901160', 'n_tokens_mistral': 762, 'n_tokens_neox': 731, 'n_words': 143}