Skip to content
Snippets Groups Projects
Select Git revision
  • 33-bug-on-youtube-embed-urls
  • main default
  • 35-cgu
  • 34-peertube-support
  • 27-add-autoplay-to-iframe
  • RC-Rekall-v1.1-fix_lpo
  • tuleap-140-go-back-to-my-capsules-page-when-i-m-on-capsule-preview-page
  • RC-Rekall-v1.2-fix10
  • RC-Rekall-v1.2-fix9
  • RC-Rekall-v1.2-fix8
  • RC-Rekall-v1.2-fix7
  • RC-Rekall-v1.2-fix6
  • RC-Rekall-v1.2-fix5
  • RC-Rekall-v1.2-fix4
  • RC-Rekall-v1.2-fix3
  • RC-Rekall-v1.2-fix2
  • RC-Rekall-v1.2-fix1
  • RC-Rekall-v1.1-fix-3
  • RC-Rekall-v1.1-fix-2
  • RC-Rekall-v1.1-fix-1
  • RC-Rekall-v1.1-delivered
  • preprod20220209-1535
22 results

Version20220307154836.php

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;
      }
    }