• Robert Knight's avatar
    Support testing whether user is outside page range for assignment · c81a7191
    Robert Knight authored
    Extend the matching between focus filters and document segments to support
    matching page range focus filters against VitalSource chapter page ranges.
    
    In the case of VitalSource PDF books, each page is a separate segment, so this
    matching is simple. For EPUB-based books a segment can span a range of pages,
    and the `<mosaic-book>` element doesn't provide an API rather returns the page
    range directly as far as I can see. Instead we can use
    `MosaicBookElement.getPageBreaks` to get a list of the CFIs and corresponding
    labels of pages, which can then be matched against the current segment's CFI.
    
     - Add `SegmentInfo.pages` field which contains a page range for a
       segment
    
     - Support matching `SegmentInfo.pages` against focus filters in
       `segmentMatchesFocusFilters`.
    
     - Display data from `SegmentInfo.pages` in "Version" tab in sidebar
    
     - Add `getPageBreaks` API to VitalSource interfaces and use the data
       from this API to populate the `SegmentInfo.pages` field in the VS
       integration.
    
     - Extend the fake VitalSource books in the dev server to return fake page break
       information.
    c81a7191
version-data-test.js 4.34 KB