Display current topic only
This commit is contained in:
parent
af10da0865
commit
3954f43736
12 changed files with 15649 additions and 69 deletions
2
front/dist/index.html
vendored
2
front/dist/index.html
vendored
|
|
@ -1 +1 @@
|
|||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ChattyPub</title><link rel="stylesheet/css-polyfills" type="text/css" href="extra-styles.css"><script src="css-polyfills.js"></script><link href="/css/app.c01369df.css" rel="preload" as="style"><link href="/css/chunk-vendors.fa36ffc8.css" rel="preload" as="style"><link href="/js/app.185d5e35.js" rel="preload" as="script"><link href="/js/chunk-vendors.26f1d600.js" rel="preload" as="script"><link href="/css/chunk-vendors.fa36ffc8.css" rel="stylesheet"><link href="/css/app.c01369df.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but Chattypub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.26f1d600.js"></script><script src="/js/app.185d5e35.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ChattyPub</title><link rel="stylesheet/css-polyfills" type="text/css" href="extra-styles.css"><script src="css-polyfills.js"></script><link href="/css/app.c01369df.css" rel="preload" as="style"><link href="/css/chunk-vendors.fa36ffc8.css" rel="preload" as="style"><link href="/js/app.3eda33f2.js" rel="preload" as="script"><link href="/js/chunk-vendors.e35cf9b3.js" rel="preload" as="script"><link href="/css/chunk-vendors.fa36ffc8.css" rel="stylesheet"><link href="/css/app.c01369df.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but Chattypub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.e35cf9b3.js"></script><script src="/js/app.3eda33f2.js"></script></body></html>
|
||||
2
front/dist/js/app.185d5e35.js
vendored
2
front/dist/js/app.185d5e35.js
vendored
File diff suppressed because one or more lines are too long
1
front/dist/js/app.185d5e35.js.map
vendored
1
front/dist/js/app.185d5e35.js.map
vendored
File diff suppressed because one or more lines are too long
2
front/dist/js/app.3eda33f2.js
vendored
Normal file
2
front/dist/js/app.3eda33f2.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
front/dist/js/app.3eda33f2.js.map
vendored
Normal file
1
front/dist/js/app.3eda33f2.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
front/dist/js/chunk-vendors.26f1d600.js.map
vendored
1
front/dist/js/chunk-vendors.26f1d600.js.map
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
front/dist/js/chunk-vendors.e35cf9b3.js.map
vendored
Normal file
1
front/dist/js/chunk-vendors.e35cf9b3.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
15589
front/package-lock.json
generated
15589
front/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -7,14 +7,10 @@
|
|||
v-bind="$mdOpts"
|
||||
>
|
||||
</vue3-markdown-it>
|
||||
<Toc
|
||||
:sortedTopics="sortedTopics"
|
||||
/>
|
||||
<Authors
|
||||
:authors="authors"
|
||||
/>
|
||||
<Toc :sortedTopics="sortedTopics" />
|
||||
<Authors :authors="authors" />
|
||||
<Chapter
|
||||
v-for="topic in sortedTopics"
|
||||
v-for="topic in filteredTopics"
|
||||
:key="topic.title"
|
||||
:id="toValidID(topic.title)"
|
||||
:topic="topic"
|
||||
|
|
@ -26,9 +22,9 @@
|
|||
|
||||
<script>
|
||||
import { mapGetters, mapState } from "vuex";
|
||||
import Authors from './Authors';
|
||||
import Authors from "./Authors";
|
||||
import Chapter from "./Chapter";
|
||||
import Toc from './Toc';
|
||||
import Toc from "./Toc";
|
||||
|
||||
export default {
|
||||
name: "Content",
|
||||
|
|
@ -37,38 +33,48 @@ export default {
|
|||
Toc,
|
||||
Authors,
|
||||
},
|
||||
props: ["print", "show_message_data"],
|
||||
props: ["print", "show_message_data", "only_current_topic"],
|
||||
computed: {
|
||||
...mapState(["currentStream", "streams"]),
|
||||
...mapGetters(["sortedTopics"]),
|
||||
filteredTopics() {
|
||||
const hash = this.$route.hash.substr(1);
|
||||
if (!hash) return this.sortedTopics;
|
||||
const found = this.sortedTopics.find((el) => {
|
||||
return this.toValidID(el.title) === hash;
|
||||
});
|
||||
return [found];
|
||||
},
|
||||
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
|
||||
? this.currentStream.name
|
||||
: this.$route.path == '/'
|
||||
: this.$route.path == "/"
|
||||
? "<= pick a stream"
|
||||
: "Stream does not exist.";
|
||||
},
|
||||
description() {
|
||||
return this.title &&
|
||||
this.foundStream &&
|
||||
this.foundStream.description.replace('_PUB_', '')
|
||||
return (
|
||||
this.title &&
|
||||
this.foundStream &&
|
||||
this.foundStream.description.replace("_PUB_", "")
|
||||
);
|
||||
},
|
||||
authors() {
|
||||
return [
|
||||
...new Set(
|
||||
this.title &&
|
||||
this.foundStream &&
|
||||
this.sortedTopics
|
||||
.map(t => t.messages)
|
||||
.flat()
|
||||
.map(m => m.sender_full_name)
|
||||
this.foundStream &&
|
||||
this.sortedTopics
|
||||
.map((t) => t.messages)
|
||||
.flat()
|
||||
.map((m) => m.sender_full_name)
|
||||
),
|
||||
...[ 'Pub Bot' ]
|
||||
]
|
||||
}
|
||||
...["Pub Bot"],
|
||||
];
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toValidID(string) {
|
||||
|
|
@ -82,5 +88,4 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -25,3 +25,6 @@ app
|
|||
.use(router)
|
||||
.use(store)
|
||||
.mount('#app')
|
||||
|
||||
|
||||
app.config.devtools = true
|
||||
|
|
|
|||
|
|
@ -14,6 +14,12 @@
|
|||
<div class="controls">
|
||||
<button @click="toggle_ui">{{ show_ui ? "Hide" : "Show" }} UI</button>
|
||||
<button @click="print">Print</button>
|
||||
|
||||
<label for="checkbox">
|
||||
<input type="checkbox" id="checkbox" v-model="only_current_topic" />
|
||||
Display only current topic
|
||||
</label>
|
||||
|
||||
<!-- <button @click="print_preview">Preview</button> -->
|
||||
<label for="msg-data"
|
||||
><input
|
||||
|
|
@ -38,6 +44,7 @@
|
|||
:print="!show_ui || expand_content"
|
||||
:show_message_data="show_message_data"
|
||||
ref="content"
|
||||
:only_current_topic="only_current_topic"
|
||||
/>
|
||||
</pane>
|
||||
<pane v-if="show_ui" :size="panel_sizes[2]" min-size="15">
|
||||
|
|
@ -58,8 +65,7 @@ import Content from "../components/Content";
|
|||
import Rules from "../components/Rules";
|
||||
import { Splitpanes, Pane } from "splitpanes";
|
||||
import "splitpanes/dist/splitpanes.css";
|
||||
import { Previewer } from "pagedjs";
|
||||
|
||||
// import { Previewer } from "pagedjs";
|
||||
import { ref, onMounted } from "vue";
|
||||
|
||||
export default {
|
||||
|
|
@ -83,6 +89,7 @@ export default {
|
|||
show_message_data: false,
|
||||
panel_sizes: { 0: 10, 1: 55, 2: 35 },
|
||||
expand_content: false,
|
||||
only_current_topic: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -107,16 +114,16 @@ export default {
|
|||
if (prev) this.toggle_ui(null, true);
|
||||
}, 1000);
|
||||
},
|
||||
print_preview() {
|
||||
this.expand_content = true;
|
||||
let content = document.getElementById("content");
|
||||
let paged = new Previewer();
|
||||
paged
|
||||
.preview(content, ["path/to/css/file.css"], this.preview)
|
||||
.then((flow) => {
|
||||
console.log("Rendered", flow.total, "pages.");
|
||||
});
|
||||
},
|
||||
// print_preview() {
|
||||
// this.expand_content = true;
|
||||
// let content = document.getElementById("content");
|
||||
// let paged = new Previewer();
|
||||
// paged
|
||||
// .preview(content, ["path/to/css/file.css"], this.preview)
|
||||
// .then((flow) => {
|
||||
// console.log("Rendered", flow.total, "pages.");
|
||||
// });
|
||||
// },
|
||||
toggle_ui(evt, state) {
|
||||
if (state !== undefined) this.show_ui = state;
|
||||
else this.show_ui = !this.show_ui;
|
||||
|
|
|
|||
Loading…
Reference in a new issue