# HG changeset patch # User ymh # Date 1480729437 -3600 # Node ID 5c43f17f87b5b5ac12d60df898138826aefe86a2 # Parent ebd8269781fa12445d606b255a8940eaba479799 add a checkbox in player to control transcript autoscroll diff -r ebd8269781fa -r 5c43f17f87b5 cms/app-client/app/components/transcript-component.js --- a/cms/app-client/app/components/transcript-component.js Sat Dec 03 01:32:43 2016 +0100 +++ b/cms/app-client/app/components/transcript-component.js Sat Dec 03 02:43:57 2016 +0100 @@ -9,7 +9,7 @@ autoscrollElement: '.corpus-app-container', previousElement: 0, - autoscroll: true, + autoscroll: Ember.computed.alias('player.autoscroll'), timeout: null, transcript: Ember.computed.readOnly('player.transcript'), diff -r ebd8269781fa -r 5c43f17f87b5 cms/app-client/app/services/player.js --- a/cms/app-client/app/services/player.js Sat Dec 03 01:32:43 2016 +0100 +++ b/cms/app-client/app/services/player.js Sat Dec 03 02:43:57 2016 +0100 @@ -8,6 +8,7 @@ transcript: null, transcriptIframe: false, transcriptLoading: false, + autoscroll: true, window: false, playing: false, diff -r ebd8269781fa -r 5c43f17f87b5 cms/app-client/app/styles/app.scss --- a/cms/app-client/app/styles/app.scss Sat Dec 03 01:32:43 2016 +0100 +++ b/cms/app-client/app/styles/app.scss Sat Dec 03 02:43:57 2016 +0100 @@ -164,7 +164,7 @@ .corpus-app-container.window { overflow-x: hidden; - overflow-y: hidden; + overflow-y: auto; height: 500px; } diff -r ebd8269781fa -r 5c43f17f87b5 cms/app-client/app/styles/components/player-component.scss --- a/cms/app-client/app/styles/components/player-component.scss Sat Dec 03 01:32:43 2016 +0100 +++ b/cms/app-client/app/styles/components/player-component.scss Sat Dec 03 02:43:57 2016 +0100 @@ -23,7 +23,7 @@ height: 100%; } -.player-component #audio .controls i { +.player-component #audio .controls .player-control { position: relative; width: auto; height: 40px; @@ -200,7 +200,7 @@ .player-component #audio .controls.extra i.fa-text-height { position: relative; overflow: hidden; - display: inline-block; + display: block; width: 16px; } @@ -216,3 +216,26 @@ .player-component .player-language-list span { display: inline; } + +.player-component .controls-transcript { + display:inline-block; +} + +.player-component .controls-transcript { + /* taken from https://codepen.io/jamesbarnett/pen/yILjk*/ + input[type=checkbox] { display:none; } /* to hide the checkbox itself */ + input[type=checkbox] + label:before { + font-family: FontAwesome; + display: inline-block; + color: $corpus-white; + font-size: 15px; + width: 15px; + padding-left: 2px; + } + label { + width: 16px; + } + input[type=checkbox] + label:before { content: "\f096"; } /* unchecked icon */ + + input[type=checkbox]:checked + label:before { content: "\f046"; } /* checked icon */ + } diff -r ebd8269781fa -r 5c43f17f87b5 cms/app-client/app/templates/components/player-component.hbs --- a/cms/app-client/app/templates/components/player-component.hbs Sat Dec 03 01:32:43 2016 +0100 +++ b/cms/app-client/app/templates/components/player-component.hbs Sat Dec 03 02:43:57 2016 +0100 @@ -1,12 +1,12 @@
- Précédent + Précédent {{#if player.playing}} - Pause + Pause {{else}} - Lecture + Lecture {{/if}} - Suivant + Suivant
{{to-minutes head}} @@ -16,13 +16,16 @@
{{#if player.model.video}} {{#if player.videoscreen}} - Hide video + Hide video {{else}} - Show video + Show video {{/if}} {{/if}} {{#if player.transcript}} +
Transcript + {{input type="checkbox" name="autoscroll" id="transcript-autoscroll" title="autoscroll" checked=player.autoscroll}} +
{{/if}}