Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 77 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"prop-types": "^15.6.2",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-keyboard-shortcuts": "^1.1.3"
"react-keyboard-shortcuts": "^1.1.3",
"react-simple-tooltip": "^2.3.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
.button {
font-weight: lighter;
font-size: 0.8em;
cursor: pointer;
}
23 changes: 23 additions & 0 deletions src/lib/TranscriptEditor/TimedTextEditor/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import Tooltip from 'react-simple-tooltip';

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faQuestionCircle, faMousePointer, faICursor, faUserEdit, faKeyboard, faSave } from '@fortawesome/free-solid-svg-icons';

import {
Editor,
Expand Down Expand Up @@ -401,6 +405,14 @@ class TimedTextEditor extends React.Component {
}

render() {
const helpMessage = <div className={ style.helpMessage }>
<span><FontAwesomeIcon className={ style.icon } icon={ faMousePointer } />Double click on a word or timestamp to jump to that point in the video.</span>
<span><FontAwesomeIcon className={ style.icon } icon={ faICursor } />Start typing to edit text.</span>
<span><FontAwesomeIcon className={ style.icon } icon={ faUserEdit } />You can add and change names of speakers in your transcript.</span>
<span><FontAwesomeIcon className={ style.icon } icon={ faKeyboard } />Use keyboard shortcuts for quick control.</span>
<span><FontAwesomeIcon className={ style.icon } icon={ faSave } />Save & export to get a copy to your desktop.</span>
</div>;

const currentWord = this.getCurrentWord();
const highlightColour = '#69e3c2';
const unplayedColor = '#767676';
Expand Down Expand Up @@ -435,6 +447,17 @@ class TimedTextEditor extends React.Component {

return (
<section>
<Tooltip
className={ style.help }
content={ helpMessage }
fadeDuration={ 250 }
fadeEasing={ 'ease-in' }
placement={ 'bottom' }
radius={ 5 }>
<FontAwesomeIcon className={ style.icon } icon={ faQuestionCircle } />
How does this work?
</Tooltip>

{ this.props.transcriptData !== null ? editor : null }
</section>
);
Expand Down
24 changes: 23 additions & 1 deletion src/lib/TranscriptEditor/TimedTextEditor/index.module.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
@value color-subt-green, color-darkest-grey, color-labs-red from '../colours.module.css';

.DraftEditor-root {
background: #f9f9f9;
}

/*
Giving the editor a oveflow
https://github.com/facebook/draft-js/issues/528
*/
*/
.editor :global(.public-DraftEditor-content) {
max-height: 75vh;
overflow: auto;
Expand All @@ -21,3 +23,23 @@ https://github.com/facebook/draft-js/issues/528
margin: 0 auto;
}
}

.help {
cursor: pointer;
float: right;
padding-right: 0.5em;
padding-left: 11em;
margin: 0.5em 0;
}

.icon {
color: color-labs-red;
margin-right: 0.5em;
}

.helpMessage span {
display: block;
font-size: 0.8em;
font-weight: lighter;
margin-top: 1em;
}
2 changes: 1 addition & 1 deletion src/lib/TranscriptEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class TranscriptEditor extends React.Component {
getEditorContent = (exportFormat) => {
return this.refs.timedTextEditor.getEditorContent(exportFormat);
}

render() {
const mediaPlayer = <MediaPlayer
hookSeek={ foo => this.setCurrentTime = foo }
Expand Down
6 changes: 1 addition & 5 deletions src/lib/TranscriptEditor/index.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@value color-subt-green, color-darkest-grey from './colours.module.css';
@value color-subt-green, color-darkest-grey, color-labs-red from './colours.module.css';

/* Desktop size */
@media (min-width: 768px) {
Expand Down Expand Up @@ -47,10 +47,6 @@
width: 2em;
height: 2em;
}

.cog {
font-weight: lighter;
}
}

/* Mobile devices */
Expand Down