From 4699d6dc5349395b6990160b6738c969c9e6ad74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=83=D8=A7=D8=B1=D9=84=20=D9=85=D8=A8=D8=A7=D8=B1=D9=83?= Date: Thu, 21 Oct 2021 14:49:57 +0200 Subject: [PATCH] topics submenu nnow accessible on stream hover, toValidID funcntion regex expression tweaked to catch parantheses --- front/src/App.vue | 1 + front/src/components/Content/Chapter.vue | 5 +- front/src/components/Content/index.vue | 59 ++++++------------- front/src/components/Nav.vue | 74 ------------------------ front/src/components/SemanticList.vue | 65 --------------------- front/src/components/Streams/Stream.vue | 48 ++++++++++++--- front/src/components/Streams/index.vue | 15 +++-- front/src/components/TagList.vue | 49 ---------------- 8 files changed, 69 insertions(+), 247 deletions(-) delete mode 100644 front/src/components/Nav.vue delete mode 100644 front/src/components/SemanticList.vue delete mode 100644 front/src/components/TagList.vue diff --git a/front/src/App.vue b/front/src/App.vue index a5a888b..1228d1a 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -169,6 +169,7 @@ export default { \ No newline at end of file + diff --git a/front/src/components/Content/index.vue b/front/src/components/Content/index.vue index a45ade0..b0d5b9c 100644 --- a/front/src/components/Content/index.vue +++ b/front/src/components/Content/index.vue @@ -7,28 +7,12 @@ v-bind="$mdOpts" > - -

- - {{ author }} - . - and - , - -

+ + import { mapGetters, mapState } from "vuex"; -import Chapter from "./Chapter.vue"; +import Authors from './Authors'; +import Chapter from "./Chapter"; +import Toc from './Toc'; export default { name: "Content", components: { Chapter, + Toc, + Authors, }, props: ["print", "show_message_data"], computed: { ...mapState(["currentStream", "streams"]), ...mapGetters(["sortedTopics"]), - foundStream() { - return this.streams.find((s) => s.name == this.currentStream.name) + return this.streams.find(s => s.name == this.currentStream.name) }, title() { return this.foundStream @@ -81,31 +68,19 @@ export default { ), ...[ 'Pub Bot' ] ] - } + } }, methods: { toValidID(string) { return encodeURIComponent("ch-" + string) .toLowerCase() - .replace(/\.|%[0-9a-z]{2}/gi, ""); + .replace(/\.|%[0-9a-z]{2}/gi, "") + .replace(/\(|\)/gi, ""); }, - goTo(id) { - document.querySelector(`${id}`).scrollIntoView({ - behavior: "smooth", - }); - }, - isLast: (item, array) => ( - array.indexOf(item) === array.length - 1 - ), - isBeforeLast: (item, array) => ( - array.indexOf(item) === array.length - 2 - ), }, }; \ No newline at end of file + + diff --git a/front/src/components/Nav.vue b/front/src/components/Nav.vue deleted file mode 100644 index c989580..0000000 --- a/front/src/components/Nav.vue +++ /dev/null @@ -1,74 +0,0 @@ -. - - - - \ No newline at end of file diff --git a/front/src/components/SemanticList.vue b/front/src/components/SemanticList.vue deleted file mode 100644 index ab56987..0000000 --- a/front/src/components/SemanticList.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - \ No newline at end of file diff --git a/front/src/components/Streams/Stream.vue b/front/src/components/Streams/Stream.vue index 0377d98..8391434 100644 --- a/front/src/components/Streams/Stream.vue +++ b/front/src/components/Streams/Stream.vue @@ -1,36 +1,66 @@ \ No newline at end of file + + diff --git a/front/src/components/Streams/index.vue b/front/src/components/Streams/index.vue index d9b38cb..67e080e 100644 --- a/front/src/components/Streams/index.vue +++ b/front/src/components/Streams/index.vue @@ -1,7 +1,11 @@ @@ -15,7 +19,10 @@ export default { Stream, }, computed: { - ...mapState(["streams"]), + ...mapState([ + "streams", + "currentStream" + ]), }, }; @@ -26,4 +33,4 @@ export default { padding: 0; margin-bottom: 1em; } - \ No newline at end of file + diff --git a/front/src/components/TagList.vue b/front/src/components/TagList.vue deleted file mode 100644 index 98e346c..0000000 --- a/front/src/components/TagList.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - \ No newline at end of file