Skip to content
Snippets Groups Projects
Commit b6ade082 authored by Antoine Roy's avatar Antoine Roy
Browse files

Intégration du slider

parent 447e7334
Branches
No related tags found
1 merge request!7Change on the slide bar's UI from pluggin annotation
Pipeline #1518 failed
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -26,6 +26,7 @@ import { withStyles } from '@material-ui/core/styles'; ...@@ -26,6 +26,7 @@ import { withStyles } from '@material-ui/core/styles';
import CompanionWindow from 'mirador/dist/es/src/containers/CompanionWindow'; import CompanionWindow from 'mirador/dist/es/src/containers/CompanionWindow';
import { VideosReferences } from 'mirador/dist/es/src/plugins/VideosReferences'; import { VideosReferences } from 'mirador/dist/es/src/plugins/VideosReferences';
import { OSDReferences } from 'mirador/dist/es/src/plugins/OSDReferences'; import { OSDReferences } from 'mirador/dist/es/src/plugins/OSDReferences';
import Slider from '@material-ui/core/Slider';
import AnnotationDrawing from './AnnotationDrawing'; import AnnotationDrawing from './AnnotationDrawing';
import TextEditor from './TextEditor'; import TextEditor from './TextEditor';
import WebAnnotation from './WebAnnotation'; import WebAnnotation from './WebAnnotation';
...@@ -62,7 +63,6 @@ class AnnotationCreation extends Component { ...@@ -62,7 +63,6 @@ class AnnotationCreation extends Component {
super(props); super(props);
const annoState = {}; const annoState = {};
if (props.annotation) { if (props.annotation) {
// //
// annotation body // annotation body
...@@ -137,7 +137,10 @@ class AnnotationCreation extends Component { ...@@ -137,7 +137,10 @@ class AnnotationCreation extends Component {
textBody: '', textBody: '',
textEditorStateBustingKey: 0, textEditorStateBustingKey: 0,
xywh: null, xywh: null,
// eslint-disable-next-line sort-keys
valueTime: [],
...annoState, ...annoState,
valuetextTime: '',
}; };
this.submitForm = this.submitForm.bind(this); this.submitForm = this.submitForm.bind(this);
...@@ -159,8 +162,16 @@ class AnnotationCreation extends Component { ...@@ -159,8 +162,16 @@ class AnnotationCreation extends Component {
this.closeChooseColor = this.closeChooseColor.bind(this); this.closeChooseColor = this.closeChooseColor.bind(this);
this.updateStrokeColor = this.updateStrokeColor.bind(this); this.updateStrokeColor = this.updateStrokeColor.bind(this);
this.handleImgChange = this.handleImgChange.bind(this); this.handleImgChange = this.handleImgChange.bind(this);
this.handleChangeTime = this.handleChangeTime.bind(this);
this.valuetextTime = this.valuetextTime.bind(this);
} }
handleChangeTime = (event, newValueTime) => {
this.setState({
valueTime: newValueTime,
});
};
/** */ /** */
handleImgChange(newUrl, imgRef) { handleImgChange(newUrl, imgRef) {
const { image } = this.state; const { image } = this.state;
...@@ -196,6 +207,11 @@ class AnnotationCreation extends Component { ...@@ -196,6 +207,11 @@ class AnnotationCreation extends Component {
this.setState({ tend: Math.floor(this.props.currentTime) }); this.setState({ tend: Math.floor(this.props.currentTime) });
} }
// eslint-disable-next-line require-jsdoc
valuetextTime() {
return `${this.valueTime}°C`;
}
/** seekTo/goto annotation start time */ /** seekTo/goto annotation start time */
seekToTstart() { seekToTstart() {
const { paused, setCurrentTime, setSeekTo } = this.props; const { paused, setCurrentTime, setSeekTo } = this.props;
...@@ -484,7 +500,20 @@ class AnnotationCreation extends Component { ...@@ -484,7 +500,20 @@ class AnnotationCreation extends Component {
</Typography> </Typography>
</Grid> </Grid>
<Grid item xs={12} className={classes.paper}> <Grid item xs={12} className={classes.paper}>
<Typography id="range-slider" gutterBottom>
Time range
</Typography>
<Slider
value={this.valueTime}
onChange={this.handleChangeTime}
valueLabelDisplay="auto"
aria-labelledby="range-slider"
getAriaValueText={this.valuetextTime}
/>
<ToggleButton value="true" title="Set current time" size="small" onClick={this.setTstartNow} className={classes.timecontrolsbutton}> <ToggleButton value="true" title="Set current time" size="small" onClick={this.setTstartNow} className={classes.timecontrolsbutton}>
<Alarm /> <Alarm />
</ToggleButton> </ToggleButton>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment