Skip to content

Commit

Permalink
bump to v0.5.33: add a copy button, copy raw markdown into clipboard, f…
Browse files Browse the repository at this point in the history
…ix #86
  • Loading branch information
ssst0n3 committed Oct 13, 2023
1 parent ef0a464 commit f6ad3f1
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docker-compose.mirror.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
services:
source-analysis-system:
image: m.daocloud.io/ghcr.io/ssst0n3/source-analysis-system:v0.5.32
image: m.daocloud.io/ghcr.io/ssst0n3/source-analysis-system:v0.5.33
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
volumes:
- source-analysis-system_secret:/secret
source-analysis-system:
image: ghcr.io/ssst0n3/source-analysis-system:v0.5.32
image: ghcr.io/ssst0n3/source-analysis-system:v0.5.33
restart: always
ports:
- "16080:8080"
Expand Down
89 changes: 89 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"marked-gfm-heading-id": "^3.0.6",
"marked-highlight": "^2.0.4",
"vue": "^2.6.14",
"vue-clipboard2": "^0.3.3",
"vue-cookies": "^1.8.3",
"vue-lightweight_restful": "^1.1.19",
"vue-router": "^3.5.2",
Expand Down
37 changes: 37 additions & 0 deletions frontend/src/components/Card/Tool/CopyButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<b-badge pill :variant="copied ? 'success' : 'info'"
v-clipboard:copy="node.markdown"
v-clipboard:success="success">
<b-link class="text-white">
<b-icon-clipboard-check v-if="copied"/>
<b-icon-clipboard v-else/>
</b-link>
</b-badge>
</template>

<script>
export default {
name: "CopyButton",
props: {
node: Object,
},
data() {
return {
copied: false,
}
},
methods: {
success() {
this.$bvToast.toast("copied " + this.node.markdown.slice(0, 10) + '...', {
title: "Copy " + this.node.ID,
variant: 'success'
}
)
}
}
}
</script>

<style scoped>
</style>
12 changes: 5 additions & 7 deletions frontend/src/components/Card/Tool/EditButton.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<template functional>
<span>
<b-badge pill variant="info" @click.stop="props.save({update: true})">
<b-link class="text-white">
<b-icon-pencil/>
</b-link>
</b-badge>
</span>
<b-badge pill variant="info" @click.stop="props.save({update: true})">
<b-link class="text-white">
<b-icon-pencil/>
</b-link>
</b-badge>
</template>
12 changes: 7 additions & 5 deletions frontend/src/components/Card/Tool/ToolBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
<span>
<NaviButton :static-view="staticView" :node="node"
v-on:save="save" v-on:navi="$emit('navi', arguments)"/>
<AddButton class="ml-1"
:directions="directions" :save="save"/>
<EditButton class="ml-3"
:save="save"/>
<span class="ml-3"><AddButton :directions="directions" :save="save"/></span>
<span class="ml-3">
<CopyButton :node="node"/>
<EditButton :save="save"/>
</span>
<CollapseButton class="ml-3"
:node="node"/>
<RemoveButton :node="node"/>
Expand All @@ -19,10 +20,11 @@ import CollapseButton from "@/components/Card/Tool/CollapseButton";
import RemoveButton from "@/components/Card/Tool/RemoveButton";
import EditButton from "@/components/Card/Tool/EditButton";
import consts from "@/util/const";
import CopyButton from "@/components/Card/Tool/CopyButton";
export default {
name: "ToolBar",
components: {EditButton, RemoveButton, CollapseButton, NaviButton, AddButton},
components: {CopyButton, EditButton, RemoveButton, CollapseButton, NaviButton, AddButton},
props: {
node: Object,
staticView: Boolean,
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ VMdEditor.use(githubTheme, {
});
Vue.use(VMdEditor)

// copy to clipboard
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)

import router from '@/router'

Vue.config.productionTip = false
Expand Down

0 comments on commit f6ad3f1

Please sign in to comment.