Skip to content

Commit

Permalink
Add link to script cell type help
Browse files Browse the repository at this point in the history
  • Loading branch information
capital-G committed Sep 26, 2023
1 parent 2983430 commit 5da18c2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
32 changes: 31 additions & 1 deletion caster-editor/src/components/NodeEditorCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
/>
</div>
<div class="scriptcell-tools">
<div class="celltype">
<div
class="celltype"
@click="openHelp(scriptCell.cellType)"
>
<p>{{ scriptCell.cellType }}</p>
</div>
<div class="divider" />
Expand Down Expand Up @@ -132,4 +135,31 @@ const deleteScriptCell = async (uuid: Scalars["UUID"]) => {
const playScriptCell = () => {
ElMessage.error("Script cell playback not yet implemented");
};

const openHelp = (cellType: CellType) => {
let helpUrl = "https://docs.gencaster.org";
switch (cellType) {
case CellType.Audio: {
helpUrl = `${helpUrl}/editor.html#audio`;
break;
}
case CellType.Comment: {
helpUrl = `${helpUrl}/editor.html#comment`;
break;
}
case CellType.Markdown: {
helpUrl = `${helpUrl}/editor.html#markdown`;
break;
}
case CellType.Python: {
helpUrl = `${helpUrl}/editor.html#python`;
break;
}
case CellType.Supercollider: {
helpUrl = `${helpUrl}/editor.html#supercollider`;
break;
}
}
window.open(helpUrl, "_blank");
};
</script>
1 change: 0 additions & 1 deletion caster-editor/src/components/NodeEditorCells.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ const moveableScriptCells = computed<NodeSubscription["node"]["scriptCells"]>({
display: flex;
justify-content: center;
align-items: center;
pointer-events: none;
p {
margin: 0;
Expand Down

0 comments on commit 5da18c2

Please sign in to comment.