Skip to content
Snippets Groups Projects
Select Git revision
  • cdb77c6f10c134027c508e79792cf1f1b0803782
  • mui5-tetras-main-stable default protected
  • mui5-tetras-main-old-stable
  • preprod protected
  • 75-dernieres-ameliorations-avant-workshop-du-7-02
  • wip-fix-xywh
  • wip-positionement-annot
  • wip-surface-transformer
  • uploads-file
  • 69-la-video-demare-quand-on-fait-glisser-le-slider-et-le-clic-creer-un-decalage-entre-le-player
  • 61-recettage-des-outils-d-annotation
  • gestion_multiple_ouverture_pannel_annotation
  • autorisation_un_pannel_annotation
  • autorisation_un_pannel_edition_annotation
  • récupération_temps_video
  • save-shapes-and-position
  • fix-error-create-annotation-pannel
  • time-saving-on-annotation
  • tetras-main protected
  • fix-poc-mirador
  • tetras-antho-test
21 results

index.js

Blame
  • AnnotationPage.js 922 B
    import flatten from 'lodash/flatten';
    import AnnotationItem from './AnnotationItem';
    /**
     * Annotation representation for IIIF Presentation v3
     * https://iiif.io/api/presentation/3.0/#55-annotation-page
     */
    export default class AnnotationPage {
      /** */
      constructor(json, target) {
        this.json = json;
        this.target = target;
      }
    
      /** */
      get id() {
        return this.json.id;
      }
    
      /** */
      present() {
        return (this.items
          && this.items.length > 0);
      }
    
      /** */
      get items() {
        this._items = this._items || (() => { // eslint-disable-line no-underscore-dangle
          if (!this.json || !this.json.items) return [];
    
          return flatten([this.json.items]).map(resource => new AnnotationItem(resource));
        })();
        return this._items; // eslint-disable-line no-underscore-dangle
      }
    
      /**
       * Alias to items for compatibility for right now.
       */
      get resources() {
        return this.items;
      }
    }