diff --git a/import-export.md b/import-export.md index 3f751abf..142ef4b3 100644 --- a/import-export.md +++ b/import-export.md @@ -9,6 +9,7 @@ When exporting multiple segments as separate files, LosslessCut offers you the a | `${FILENAME}` | The original filename without the extension (e.g. `Beach Trip` for a file named `Beach Trip.mp4`) | `${EXT}` | The extension of the file (e.g.: `.mp4`, `.mkv`) | `${SEG_NUM}` | Number of the segment (e.g. `1`, `2` or `3`) +| `${EPOCH_MS}` | Number of milliseconds since epoch (e.g. `1680852771465`) | `${SEG_LABEL}` | The label of the segment (e.g. `Getting_Lunch`) | `${SEG_SUFFIX}` | If a label exists for this segment, the label will be used, prepended by `-`. Otherwise, the segment number prepended by `-seg` will be used (e.g. `-Getting_Lunch`, `-seg1`) | `${CUT_FROM}` | The timestamp for the beginning of the segment in `hh.mm.ss.sss` format (e.g. `00.00.27.184`) diff --git a/src/components/OutSegTemplateEditor.jsx b/src/components/OutSegTemplateEditor.jsx index 182a754e..3879558e 100644 --- a/src/components/OutSegTemplateEditor.jsx +++ b/src/components/OutSegTemplateEditor.jsx @@ -4,6 +4,7 @@ import i18n from 'i18next'; import { useTranslation } from 'react-i18next'; import { WarningSignIcon, ErrorIcon, Button, IconButton, TickIcon, ResetIcon } from 'evergreen-ui'; import withReactContent from 'sweetalert2-react-content'; +import { IoIosHelpCircle } from 'react-icons/io'; import Swal from '../swal'; import HighlightedText from './HighlightedText'; @@ -12,6 +13,8 @@ import useUserSettings from '../hooks/useUserSettings'; const ReactSwal = withReactContent(Swal); +const electron = window.require('electron'); + // eslint-disable-next-line no-template-curly-in-string const extVar = '${EXT}'; @@ -26,7 +29,7 @@ const OutSegTemplateEditor = memo(({ outSegTemplate, setOutSegTemplate, generate const [error, setError] = useState(); const [outSegFileNames, setOutSegFileNames] = useState(); const [shown, setShown] = useState(); - const inputRef = useRef(null); + const inputRef = useRef(); const { t } = useTranslation(); @@ -84,18 +87,14 @@ const OutSegTemplateEditor = memo(({ outSegTemplate, setOutSegTemplate, generate const needToShow = shown || error != null; - const onTextClick = useCallback(() => { - inputRef.current.focus(); - }, []); - const onVariableClick = useCallback((variable) => { const input = inputRef.current; const startPos = input.selectionStart; const endPos = input.selectionEnd; - - const newValue = `${text.slice(0, startPos)}${'${' + variable + '}' + text.slice(endPos)}`; + + const newValue = `${text.slice(0, startPos)}${`\${${variable}}${text.slice(endPos)}`}`; setText(newValue); - + // Move the cursor to after the inserted variable const newPos = startPos + variable.length + 2; input.selectionStart = newPos; @@ -113,7 +112,7 @@ const OutSegTemplateEditor = memo(({ outSegTemplate, setOutSegTemplate, generate {needToShow && ( <>