All files / app/component/viewer viewer.component.html

17.59% Statements 19/108
42.22% Branches 19/45
0% Functions 0/12
22.5% Lines 18/80

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 16511x 5x             5x             5x     5x                               5x                                 5x                 5x                       5x                     5x         5x                         5x               5x             5x                 11x                         11x                           11x             11x          
@if (ref || tags) {
  @if (repost) {
    <app-ref class="expand"
             [fetchRepost]="false"
             [showToggle]="true"
             [expandInline]="true"
             [ref]="repost"></app-ref>
  }
  @if (editingRef) {
    <app-ref class="expand"
             [fetchRepost]="false"
             [showToggle]="true"
             [expandInline]="true"
             [ref]="editingRef"></app-ref>
  }
  @if (playlist) {
    <app-playlist [ref]="ref"></app-playlist>
  }
  @if (lens) {
    @if (lensPage) {
      <app-lens class="lens-expand"
                [page]="lensPage"
                [pageControls]="false"
                [tag]="lensQuery"
                [ext]="ext"
                [size]="lensSize"
                [cols]="lensCols"
                [sort]="lensSort"
                [filter]="lensFilter"
                [search]="lensSearch"></app-lens>
    } @else {
      <app-loading></app-loading>
    }
  }
  @if (embedIframe) {
    <div class="embed-container"
         [class.loading]="!embedReady"
         [class.twitter]="twitter"
         [class.zoom]="zoom"
         [appResizeHandle]="resizable && !disableResize && !fullscreen"
         [child]="iframe">
      <iframe #iframe
              class="embed-expand"
              [class.ready]="embedReady"
              src="about:blank"
              frameborder="0"
              scrolling="yes"
              allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share;"
              referrerpolicy="strict-origin-when-cross-origin"></iframe>
    </div>
  }
  @if (imageUrl) {
    <div class="image-expand"
         [appImage]="imageUrl"
         [ref]="ref"
         [defaultWidth]="ref?.plugins?.['plugin/image']?.width"
         [defaultHeight]="ref?.plugins?.['plugin/image']?.height"
         [grid]="disableResize"
         [appResize]="!disableResize"></div>
  }
  @if (videoUrl) {
    <video #video
           class="video-expand"
           [autoplay]="autoplay"
           controls
           [appResize]="!disableResize"
           (playing)="playing.emit(videoUrl)"
           (pause)="!this.ended && pausing.emit(videoUrl)"
           (ended)="ended.emit(videoUrl)">
      <source [src]="videoUrl">
    </video>
  }
  @if (audioUrl) {
    <audio #audio
           class="no-resize audio-expand"
           [autoplay]="autoplay"
           controls
           (playing)="playing.emit(audioUrl)"
           (pause)="!this.ended && pausing.emit(audioUrl)"
           (ended)="ended.emit(audioUrl)">
      <source [src]="audioUrl">
    </audio>
  }
  @if (qrUrl) {
    <app-qr class="zoom qr-expand"
            [url]="qrUrl"
            [appResize]="!disableResize"></app-qr>
  }
  @if (map && mapPage) {
    @defer {
      <app-map class="map-embed"
               [page]="mapPage"
               [tag]="store.view.tag"
               [ext]="store.view.viewExt"
               [pageControls]="false"
               [bbox]="ref?.plugins?.['plugin/geo']?.bbox"
               [fitFeatures]="true"></app-map>
    } @placeholder {
      <app-loading></app-loading>
    }
  }
  @if (todo) {
    <app-todo class="zoom"
              [ref]="ref"
              [text]="text"
              [tags]="tags"
              (comment)="comment.emit($event)"
              (copied)="copied.emit($event)"></app-todo>
  }
  @if (backgammon) {
    <app-backgammon class="no-resize"
                    [ref]="ref"
                    [text]="text"
                    (comment)="comment.emit($event)"
                    (copied)="copied.emit($event)"></app-backgammon>
  }
  @if (chess) {
    <app-chess class="no-resize"
               [white]="chessWhite"
               [ref]="ref"
               [text]="text"
               (comment)="comment.emit($event)"
               (copied)="copied.emit($event)"></app-chess>
  }
}
@if (code) {
  <app-md class="code md-container"
          [origin]="currentOrigin"
          [text]="currentCode"
          [mermaid]="false"
          [clipboard]="false"></app-md>
} @else if (currentText) {
  <app-md class="zoom md-container"
          [class.expand]="expand"
          [origin]="currentOrigin"
          [text]="currentText"
          [plugins]="currentTags"></app-md>
}
@if (pdfUrl) {
  <div class="embed-container"
       [appResizeHandle]="!disableResize && !fullscreen"
       [child]="pdfIframe"
       [initChild]="true">
    <iframe #pdfIframe
            class="embed-expand ready"
            src="about:blank"
            frameborder="0"
            scrolling="yes"
            allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share;"
            referrerpolicy="strict-origin-when-cross-origin"></iframe>
  </div>
}
@for (ui of uis; track ui.tag) {
  <app-md class="zoom md-container"
          [class]="uiCss(ui.tag)"
          [disableSanitizer]="true"
          [origin]="currentOrigin"
          [text]="uiMarkdown(ui.tag)"></app-md>
}
@if (mod) {
  <app-mod class="zoom md-container"
           [mod]="mod"
           [class.expand]="expand"></app-mod>
}