<commit_before>angular.module("doubtfire.common.pdf-viewer", [])
.directive('pdfViewer', ->
  restrict: 'E'
  templateUrl: 'common/pdf-panel/pdf-panel.tpl.html'
  scope:
    pdfUrl: '='
  controller: ($scope, $sce, $timeout) ->
    $scope.isSafari = navigator.userAgent.indexOf("Safari") > 0 && navigator.userAgent.indexOf("Chrome") == -1
    # Watch the URL, and hide the view if it hasn't loaded
    $scope.$watch 'pdfUrl', (newUrl) ->
      return unless newUrl?
      $scope.shouldShowIframe = false
      # Add a timeout to reset the iframe
      $timeout (nowLoading) ->
        $scope.shouldShowIframe = true
      $scope.googleDocsUrl = $sce.trustAsResourceUrl "https://docs.google.com/gview?url=#{newUrl}&embedded=true"
)<commit_msg>FIX: Add correct template URL to PDF viewer<commit_after>angular.module("doubtfire.common.pdf-viewer", [])
#
# Basic PDF viewer
#
.directive('pdfViewer', ->
  restrict: 'E'
  templateUrl: 'common/pdf-viewer/pdf-viewer.tpl.html'
  scope:
    pdfUrl: '='
  controller: ($scope, $sce, $timeout) ->
    $scope.isSafari = navigator.userAgent.indexOf("Safari") > 0 && navigator.userAgent.indexOf("Chrome") == -1
    # Watch the URL, and hide the view if it hasn't loaded
    $scope.$watch 'pdfUrl', (newUrl) ->
      return unless newUrl?
      $scope.shouldShowIframe = false
      # Add a timeout to reset the iframe
      $timeout (nowLoading) ->
        $scope.shouldShowIframe = true
      $scope.googleDocsUrl = $sce.trustAsResourceUrl "https://docs.google.com/gview?url=#{newUrl}&embedded=true"
)
{'fraction_non_alphanumeric': 0.15334632878492527, 'fraction_numerical': 0.002599090318388564, 'mean_word_length': 3.6666666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '4616264', 'n_tokens_mistral': 530, 'n_tokens_neox': 520, 'n_words': 110}