{% extends "base.html" %} {% from "_paper.html" import paper_head with context %} {% from "_icons.html" import icon %} {% from "_keys.html" import key with context %} {% from "_speed.html" import speed_field with context %} {% block title %}{{ t('listen.title', name=document.name) }} · {{ t('common.app') }}{% endblock %} {% block scripts %}{% if view %}{% endif %}{% endblock %} {#- A piece of a block: a sentence the voice reads (`.s`) or text between sentences. Its parts show what the audiobook's own edits did (#392, D-665 conflict 2, D-704b): text left out is struck in pencil, text read differently is underlined with its reading. -#} {% macro parts(piece) -%} {%- if piece.parts -%} {%- for part in piece.parts -%} {%- if part.mark == 'cut' -%}{{ part.text }} {{ t('listen.cut_hidden') }} {%- elif part.mark == 'said' -%}{{ part.text }} {{ t('listen.said_as_hidden', said=part.said) }} {%- else -%}{{ part.text }}{%- endif -%} {%- endfor -%} {%- else -%}{{ piece.text }}{%- endif -%} {%- endmacro %} {% macro pieces(block) -%} {%- for piece in block.pieces -%} {%- if piece.element -%}{{ parts(piece) }} {%- else -%}{{ parts(piece) }}{%- endif -%} {%- endfor -%} {%- endmacro %} {% macro show(block) -%} {% if block.page %}

{{ t('listen.page', page=block.page) }}

{% endif %} {% if block.notice %}

{{ icon('skip') }}{{ t('listen.notice') }} {{ block.notice }}

{% for figure in block.figures %}{{ figure.alt }}{% endfor %} {% if block.printed %}
{{ t('listen.found') }}

{{ block.printed }}

{% endif %} {% if block.code %}
{{ block.code }}
{% endif %}
{% elif block.heading %} {% if not block.read %}{{ t('listen.not_read') }} {% endif %}{{ pieces(block) }} {% else %}

{% if not block.read %}{{ t('listen.not_read') }} {% endif %}{{ pieces(block) }}

{% endif %} {%- endmacro %} {% block view_class %} wide listen-view{% endblock %} {% block main %} {{ paper_head(head, 'listen', 'listen-title', '') }} {% if not view %}

{{ problem }}

{% if document.outside %}

{{ t('common.back_home') }}

{% else %}

{{ t('listen.back') }}

{% endif %} {% else %} {#- The Listen page (#392, #393; DESIGN.md "Listen"): the desk with the sheet and one context panel beside it, and the dock. Every button player.js wires is drawn disabled, so a press before the script ran is never lost silently (#350, #427). -#}
{#- The dock (DESIGN.md "Player dock", D-664). It comes first, so the keyboard reaches the player before the text; player.js pins it to the window's foot while it fits there. -#}
{#- the markers' ticks (#474), above the track: player.js draws them #}

{{ head.title }} {{ t('player.chapter', n=1, total=view.chapters|length) }} {{ view.chapters[0].title }} {{ t('player.time_of', time='0:00', total=total) }}

{#- a marker on the sentence being read (#474): pressed while it has one #} {#- the speed (#152, #651): a button with the speed opens the usual speeds and the field #}
{{ t('listen.ai_label') }}

{{ t('listen.ai_notice', voice=voice) }}

{% if not view.marked %}

{{ t('listen.unmarked', version=view.made_with or '?') }}{% if not document.outside %} {{ t('listen.unmarked_link') }}{% endif %}

{% endif %} {% if resume %}

{{ t('listen.resume', n=resume.number, time=resume.clock) }} {{ resume.title }}

{% endif %}

{#- the sentence being read, for screen readers, only if the person switched it on (#388) #} {% if announce %}

{% endif %}
{% for chapter in view.chapters %}
{% if chapter.title_block %} {{ show(chapter.title_block) }} {% else %}

{{ chapter.title }}

{% endif %} {% for block in chapter.blocks %} {{ show(block) }} {% endfor %}
{% endfor %}
{#- Focus listening (#394, DESIGN.md "Focus"): a mode of this page, with no address of its own. player.js shows it in place of the rail, the sheet and the panel, and fills the stage with the sentence being read and its neighbours, copied from the sheet. -#}
{#- One context panel (#393): Changes, read-only, Chapters and Markers (#474). The other captures wait for the study layer. From 1280 px it stands beside the desk; below, it opens over it. -#}
{% if document.outside %}

{{ t('common.back_home') }}

{% endif %} {% endif %} {% endblock %}