Skip to content
Draft
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
11 changes: 11 additions & 0 deletions editor-settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@ spanish = { lang = "es" }
# Default: false
#simpleMode = false

####
# Interactive Elements
##

[interactiveElements]

# If the interactive elements editor appears in the main menu
# Type: boolean
# Default: false
#show = false



############################################################
Expand Down
18 changes: 18 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ interface iSettings {
mainFlavor: string,
defaultVideoFlavor: Flavor | undefined,
};
interactiveElements: {
show: boolean,
textboxesMainFlavor: string,
quizzesMainFlavor: string,
defaultVideoFlavor: Flavor | undefined,
};
}

/**
Expand Down Expand Up @@ -119,6 +125,12 @@ const defaultSettings: iSettings = {
mainFlavor: "chapters",
defaultVideoFlavor: undefined,
},
interactiveElements: {
show: false,
textboxesMainFlavor: "textboxes",
quizzesMainFlavor: "quizzes",
defaultVideoFlavor: undefined,
},
};
let configFileSettings: iSettings;
let urlParameterSettings: iSettings;
Expand Down Expand Up @@ -433,6 +445,12 @@ const SCHEMA = {
mainFlavor: types.string,
defaultVideoFlavor: types.map,
},
interactiveElements: {
show: types.boolean,
textboxesMainFlavor: types.string,
quizzesMainFlavor: types.string,
defaultVideoFlavor: types.map,
},
thumbnail: {
show: types.boolean,
simpleMode: types.boolean,
Expand Down
12 changes: 12 additions & 0 deletions src/cssStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,15 @@ export const undisplay = (maxWidth: number) => css({
display: "none",
},
});

export const timeInputStyle = (theme: Theme) => css({
fontSize: "1em",
marginLeft: "15px",
marginRight: "2px",
borderRadius: "5px",
borderWidth: "1px",
padding: "10px 10px",
background: `${theme.element_bg}`,
border: "1px solid #ccc",
color: `${theme.text}`,
});
39 changes: 39 additions & 0 deletions src/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"subtitles-button": "Subtitles",
"chapters-button": "Chapters",
"thumbnail-button": "Thumbnail",
"interactiveElements-button": "Interactive Elements",
"metadata-button": "Metadata",
"keyboard-controls-button": "Keyboard Controls",
"tooltip-aria": "Main Navigation"
Expand Down Expand Up @@ -331,6 +332,44 @@
"editTitle": "Chapter Editor"
},

"interactiveElements" : {
"title": "Interactive Elements Editor",
"addTextbox": "Add Textbox",
"addTextbox-tooltip": "Add a textbox at the current timeline marker position.",
"addTextbox-tooltip-aria": "Add. Add a textbox at the current timeline marker position.",
"addQuiz": "Add Quiz",
"addQuiz-tooltip": "Add a quiz at the current timeline marker position.",
"addQuiz-tooltip-aria": "Add. Add a quiz at the current timeline marker position.",
"editElement-tooltip": "Edit the current element",
"editElement-tooltip-aria": "Edit the current element",
"deleteElement-tooltip": "Delete the current element",
"deleteElement-tooltip-aria": "Delete the current element",
"deleteElement-warning-header": "Caution!",
"deleteElement-warning": "This will remove the element! Are you sure?"
},

"interactiveElementsEditor": {
"title": {
"textbox": "Textbox Editor",
"quiz": "Quiz Editor"
},
"start": "Start",
"submit": "Submit",
"textbox": {
"description": "A little box for displaying a small amount of text and optionally a link. The box remains on screen for ten seconds.",
"text": "Text",
"link": "Link"
},
"quiz": {
"description": "Stops the video at the start time to display a multiple-choice quiz.",
"question": "Question",
"answers": "Answers",
"answer": "Answer",
"answerCorrect": "Correct",
"answerDelete": "Remove"
}
},

"keyboardControls": {
"header": "Shortcuts",
"defaultGroupName": "General",
Expand Down
4 changes: 2 additions & 2 deletions src/main/CuttingActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ interface cuttingActionsButtonInterface {
* A button representing a single action a user can take while cutting
* @param param0
*/
const CuttingActionsButton: React.FC<cuttingActionsButtonInterface> = ({
export const CuttingActionsButton: React.FC<cuttingActionsButtonInterface> = ({
Icon,
actionName,
actionHandler,
Expand Down Expand Up @@ -380,7 +380,7 @@ interface ZoomSliderInterface {
ariaLabelText: string,
}

const ZoomSlider : React.FC<ZoomSliderInterface> = ({
export const ZoomSlider : React.FC<ZoomSliderInterface> = ({
actionHandler,
tooltip,
ariaLabelText,
Expand Down
36 changes: 31 additions & 5 deletions src/main/CuttingActionsContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ import { cut, markAsDeletedOrAlive, mergeLeft, mergeRight, selectIsCurrentSegmen

const CuttingActionsContextMenu: React.FC<{
children: React.ReactNode,
isChapters?: boolean
isInteractiveElements?: boolean,
}> = ({
children,
isChapters = false,
isInteractiveElements = false,
}) => {

const { t } = useTranslation();
Expand Down Expand Up @@ -60,12 +64,34 @@ const CuttingActionsContextMenu: React.FC<{
},
];

const render = () => {
if (isChapters) {
return (
<>
{children}
</>
);
}
if (isInteractiveElements) {
return (
<>
{children}
</>
);
}
return (
<ThemedContextMenu
menuItems={cuttingContextMenuItems}
>
{children}
</ThemedContextMenu>
);
};

return (
<ThemedContextMenu
menuItems={cuttingContextMenuItems}
>
{children}
</ThemedContextMenu>
<>
{render()}
</>
);
};

Expand Down
Loading
Loading