Skip to content
Snippets Groups Projects
Select Git revision
  • 1f68d75d192e732f129aa25c72ade8fbbdf161ed
  • master default protected
  • 133-fail2ban-page
  • reorganisation
  • 16-maintenace-service
  • 11-fail2ban
  • 6-monit-update
  • 7-dolibarr-fail2ban
  • 6-surveillance-interne-des-serveur
  • test-glpi
  • 2-migrate-to-phpfpm
  • jessie
  • github
13 results

installCertbot.sh

Blame
  • annotationCreationCompanionWindow.js 1.71 KiB
    import * as actions from 'mirador/dist/es/src/state/actions';
    import { getCompanionWindow } from 'mirador/dist/es/src/state/selectors/companionWindows';
    import { getWindowCurrentTime, getWindowPausedStatus } from 'mirador/dist/es/src/state/selectors/window';
    import { getVisibleCanvases } from 'mirador/dist/es/src/state/selectors/canvases';
    import { getPresentAnnotationsOnSelectedCanvases } from 'mirador/dist/es/src/state/selectors/annotations';
    import AnnotationCreation from '../AnnotationCreation';
    
    /** */
    const mapDispatchToProps = (dispatch, { id, windowId }) => ({
      closeCompanionWindow: () => dispatch(
        actions.removeCompanionWindow(windowId, id),
      ),
      receiveAnnotation: (targetId, annoId, annotation) => dispatch(
        actions.receiveAnnotation(targetId, annoId, annotation),
      ),
      setCurrentTime: (...args) => dispatch(actions.setWindowCurrentTime(windowId, ...args)),
      setSeekTo: (...args) => dispatch(actions.setWindowSeekTo(windowId, ...args)),
    });
    
    /** */
    function mapStateToProps(state, { id: companionWindowId, windowId }) {
      const currentTime = getWindowCurrentTime(state, { windowId });
      const cw = getCompanionWindow(state, { companionWindowId, windowId });
      const { annotationid } = cw;
      const canvases = getVisibleCanvases(state, { windowId });
    
      const annotation = getPresentAnnotationsOnSelectedCanvases(state, { windowId })
        .flatMap((annoPage) => annoPage.json.items || [])
        .find((annot) => annot.id === annotationid);
    
      return {
        annotation,
        canvases,
        config: state.config,
        currentTime,
        paused: getWindowPausedStatus(state, { windowId }),
      };
    }
    
    export default {
      companionWindowKey: 'annotationCreation',
      component: AnnotationCreation,
      mapDispatchToProps,
      mapStateToProps,
    };