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

Correction EsLint , ajout de .idea dans les .gitignore et suppression de commentaire inutile

parent 771cb4ad
No related branches found
No related tags found
1 merge request!7Change on the slide bar's UI from pluggin annotation
Pipeline #1619 failed
......@@ -5,3 +5,5 @@
/node_modules
/umd
npm-debug.log*
.idea
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/mirador-annotations.iml" filepath="$PROJECT_DIR$/.idea/mirador-annotations.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -136,9 +136,10 @@ class AnnotationCreation extends Component {
svg: null,
textBody: '',
textEditorStateBustingKey: 0,
xywh: null,
// eslint-disable-next-line sort-keys
// eslint-disable-next-line sort-keys,max-len
// TO DO : The state must be updated with the video's timing information when the component is mounted
valueTime: [0, 13],
xywh: null,
...annoState,
valuetextTime: '',
};
......@@ -166,7 +167,6 @@ class AnnotationCreation extends Component {
this.valuetextTime = this.valuetextTime.bind(this);
}
/** */
handleImgChange(newUrl, imgRef) {
const { image } = this.state;
......@@ -202,21 +202,23 @@ class AnnotationCreation extends Component {
this.setState({ tend: Math.floor(this.props.currentTime) });
}
// eslint-disable-next-line require-jsdoc
valuetextTime() {
return `${this.valueTime}°C`;
}
handleChangeTime = (event, newValueTime) => {
const timeStart = newValueTime[0];
const timeEnd = newValueTime[1];
console.log(VideosReferences.valueOf());
this.updateTstart(timeStart);
this.updateTend(timeEnd);
this.seekToTstart();
this.seekToTend();
};
/** update annotation start time */
updateTstart(value) { this.setState({ tstart: value }); }
/** update annotation end time */
updateTend(value) { this.setState({ tend: value }); }
/** seekTo/goto annotation start time */
seekToTstart() {
const { paused, setCurrentTime, setSeekTo } = this.props;
const { tstart } = this.state;
if (!paused) {
this.setState(setSeekTo(tstart));
} else {
this.setState(setCurrentTime(tstart));
}
}
/** seekTo/goto annotation end time */
seekToTend() {
......@@ -229,21 +231,21 @@ class AnnotationCreation extends Component {
}
}
/** update annotation start time */
updateTstart(value) { this.setState({ tstart: value }); }
/** update annotation end time */
updateTend(value) { this.setState({ tend: value }); }
// eslint-disable-next-line require-jsdoc
seekToTstart() {
const { paused, setCurrentTime, setSeekTo } = this.props;
const { tstart } = this.state;
if (!paused) {
this.setState(setSeekTo(tstart));
} else {
this.setState(setCurrentTime(tstart));
}
}
handleChangeTime = (event, newValueTime) => {
let timeStart = newValueTime[0];
let timeEnd = newValueTime[1];
console.log(VideosReferences.valueOf());
this.updateTstart(timeStart);
this.updateTend(timeEnd);
this.seekToTstart();
this.seekToTend();
};
// eslint-disable-next-line require-jsdoc
valuetextTime() {
return `${this.valueTime}°C`;
}
/** */
openChooseColor(e) {
......@@ -368,7 +370,6 @@ class AnnotationCreation extends Component {
const mediaIsVideo = typeof VideosReferences.get(windowId) !== 'undefined';
// let value = [20, 47]
return (
<CompanionWindow
title={annotation ? 'Edit annotation' : 'New annotation'}
......@@ -404,20 +405,26 @@ class AnnotationCreation extends Component {
max={2000}
/>
</Grid>
<Grid item xs={12} className={classes.paper}>
<Grid item xs={6} className={classes.paper}>
<div className={`${classes.paper} ${classes.selectTimeField} `}>
<div className={`${classes.paper} ${classes.selectTimeModule} `}>
<ToggleButton value="true" title="Set current time" size="small" onClick={this.setTstartNow} className={classes.timecontrolsbutton}>
<Alarm />
<Alarm fontSize="small" />
</ToggleButton>
<div>
<p>Start</p>
</div>
<HMSInput seconds={tstart} onChange={this.updateTstart} />
</Grid>
<Grid item xs={6} className={classes.paper}>
</div>
<div className={`${classes.paper} ${classes.selectTimeModule}`}>
<ToggleButton value="true" title="Set current time" size="small" onClick={this.setTendNow} className={classes.timecontrolsbutton}>
<Alarm />
<Alarm fontSize="small" />
</ToggleButton>
<div>
<p>End</p>
</div>
<HMSInput seconds={tend} onChange={this.updateTend} />
</Grid>
</Grid>
</div>
</div>
</>
)}
<Grid item xs={12}>
......@@ -618,17 +625,27 @@ const styles = (theme) => ({
paddingRight: theme.spacing(1),
paddingTop: theme.spacing(2),
},
selectTimeField: {
alignContent: 'center',
boxShadow: 'rgba(149, 157, 165, 0.2) 0px 4px 5px',
display: 'flex',
flexDirection: 'wrap',
gap: '5px',
padding: '5px',
},
selectTimeModule: {
display: 'flex',
flexWrap: 'nowrap',
justifyContent: 'center',
},
timecontrolsbutton: {
border: 'none',
height: '30px',
margin: 'auto',
marginLeft: '0',
marginRight: '5px',
width: '30px',
border: 'none',
},
leftSidePanel: {
minWidth: '800px',
}
});
AnnotationCreation.propTypes = {
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import { IconButton, Input } from '@material-ui/core';
import { IconButton, Input, TextField } from '@material-ui/core';
import { ArrowDownward, ArrowUpward } from '@material-ui/icons';
import { secondsToHMSarray } from './utils';
......@@ -48,7 +48,8 @@ class HMSInput extends Component {
return (
<div className={classes.root}>
<div className={classes.root}>
<Input className={classes.input} type='number' min='0' pattern name="hours" value={hours} onChange={this.someChange} />
<Input className={classes.input}
variant="filled" type='number' min='0' pattern name="hours" value={hours} onChange={this.someChange} />
<Input className={classes.input} type='number' min='0' max='59' name="minutes" value={minutes} onChange={this.someChange} />
<Input className={classes.input} type='number' min='0' max='59' name="seconds" value={seconds} onChange={this.someChange} />
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment