forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
creating new branch based off dev for help mode
- Loading branch information
1 parent
53e0ac5
commit 262f165
Showing
10 changed files
with
205 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<script setup lang="ts"> | ||
import { computed } from "vue"; | ||
import { useHelpModeStatusStore } from "@/stores/helpmode/helpModeStatusStore"; | ||
const tooltip = "Enable/Disable Help Mode"; | ||
const statusStore = useHelpModeStatusStore(); | ||
const enabledStatus = computed({ | ||
get() { | ||
return statusStore.helpmodestatus; | ||
}, | ||
set(value: boolean) { | ||
statusStore.setHelpModeStatus(value); | ||
}, | ||
}); | ||
function toggleEnabledStatus() { | ||
enabledStatus.value = !enabledStatus.value; | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<button | ||
class="help-mode-button" | ||
:class="{ highlight: enabledStatus }" | ||
:title="tooltip" | ||
:aria-label="tooltip" | ||
@click="toggleEnabledStatus" | ||
@keydown.enter="toggleEnabledStatus"> | ||
<i class="fas fa-question-circle fa-lg" :class="{ highlight: enabledStatus }"> </i> Help Me | ||
</button> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.highlight { | ||
color: yellow; | ||
} | ||
.help-mode-button { | ||
background-color: inherit; | ||
border: 0px transparent; | ||
cursor: pointer; | ||
color: inherit; | ||
outline: none; | ||
} | ||
.help-mode-button.highlight { | ||
color: yellow; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<script setup lang="ts"> | ||
import { useDraggable } from "@vueuse/core"; | ||
import MarkdownIt from "markdown-it"; | ||
import { computed, onMounted, ref } from "vue"; | ||
import { useHelpModeStatusStore } from "@/stores/helpmode/helpModeStatusStore"; | ||
import { useHelpModeTextStore } from "@/stores/helpmode/helpModeTextStore"; | ||
const md = MarkdownIt(); | ||
const helpInfo = useHelpModeTextStore(); | ||
const status = useHelpModeStatusStore(); | ||
const helpText = computed({ | ||
get() { | ||
return md.render(helpInfo.helpmodetext); | ||
}, | ||
set() { | ||
//do nothing, this is set in components that add helptext | ||
}, | ||
}); | ||
const helpStatus = computed({ | ||
get() { | ||
return status.helpmodestatus; | ||
}, | ||
set(value: boolean) { | ||
status.setHelpModeStatus(value); | ||
}, | ||
}); | ||
function closeHelpMode() { | ||
helpStatus.value = !helpStatus.value; | ||
} | ||
const el = ref<HTMLElement | null>(null); | ||
const { x, y, style } = useDraggable(el, { | ||
initialValue: { x: 0, y: 0 }, | ||
}); | ||
const helpTextRef = ref(null); | ||
onMounted(() => { | ||
const links = (helpTextRef.value as unknown as HTMLElement).querySelectorAll("a"); | ||
links.forEach((link: HTMLAnchorElement) => { | ||
link.setAttribute("target", "_blank"); | ||
}); | ||
}); | ||
</script> | ||
<template> | ||
<div | ||
ref="el" | ||
:style="style" | ||
style="position: fixed" | ||
class="helptext unified-panel-body d-flex justify-content-between"> | ||
<div class="header"> | ||
<h1>Galaxy Help Mode</h1> | ||
<button class="close-button" @click="closeHelpMode"> | ||
<i class="fas fa-times"></i> | ||
</button> | ||
</div> | ||
<div ref="helpTextRef" class="help-mode-container" v-html="helpText"></div> | ||
</div> | ||
</template> | ||
<style> | ||
.helptext { | ||
display: flex; | ||
flex-direction: column; | ||
width: 25% !important; | ||
height: 30% !important; | ||
z-index: 9999; | ||
background-color: aliceblue; | ||
border-color: black; | ||
border-radius: 5px; | ||
border-width: 2px; | ||
border: solid; | ||
opacity: 90%; | ||
} | ||
.header { | ||
display: flex; | ||
color: white; | ||
background-color: #454d6b; | ||
justify-content: space-between; | ||
align-items: center; | ||
border-bottom: 2px solid #868686; | ||
/* padding-bottom: 10px; */ | ||
} | ||
.help-mode-container { | ||
margin-top: 0; | ||
padding: 10px; | ||
overflow-y: auto; | ||
height: 100%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defineStore } from "pinia"; | ||
|
||
import { useHelpModeTextStore } from "./helpModeTextStore"; | ||
|
||
export const useHelpModeStatusStore = defineStore("helpModeStatusStore", { | ||
state: () => { | ||
return { | ||
helpmodestatus: false, | ||
}; | ||
}, | ||
|
||
actions: { | ||
setHelpModeStatus(status) { | ||
this.helpmodestatus = status; | ||
if (status == false) { | ||
useHelpModeTextStore().clearHelpModeText(); | ||
} | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { defineStore } from "pinia"; | ||
|
||
import config from "./helpTextConfig.yml"; | ||
|
||
export const useHelpModeTextStore = defineStore("helpModeText", { | ||
state: () => { | ||
return { | ||
helpmodetext: "Welcome to Galaxy Help Mode!", | ||
}; | ||
}, | ||
|
||
actions: { | ||
addHelpModeText(text) { | ||
const file_path = config[text]; | ||
fetch("https://raw.githubusercontent.com/assuntad23/galaxy-help-markdown/main/" + file_path) | ||
.then((response) => response.text()) | ||
.then((text) => { | ||
this.helpmodetext = text; | ||
}); | ||
}, | ||
clearHelpModeText() { | ||
this.helpmodetext = "Welcome to Galaxy Help Mode!"; | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tool_form_base: tools/tool_form_base.md | ||
collection_builder: collections/collection_builder.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.