feat: conversation titles
This commit is contained in:
parent
cf368b792d
commit
948ee9dff1
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"title": "Julius Caesar",
|
||||||
"characters": [
|
"characters": [
|
||||||
"Mark Antony",
|
"Mark Antony",
|
||||||
"Julius Caesar"
|
"Julius Caesar"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"title": "Operation Ides of March",
|
||||||
"characters": [
|
"characters": [
|
||||||
"Mark Antony",
|
"Mark Antony",
|
||||||
"Cassius",
|
"Cassius",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"title": "Lepidus",
|
||||||
"characters": [
|
"characters": [
|
||||||
"Mark Antony",
|
"Mark Antony",
|
||||||
"Lepidus"
|
"Lepidus"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"title": "Lucius Antony",
|
||||||
"characters": [
|
"characters": [
|
||||||
"Mark Antony",
|
"Mark Antony",
|
||||||
"Lucius Antony"
|
"Lucius Antony"
|
||||||
|
|
6
main.js
6
main.js
|
@ -234,10 +234,9 @@ function showConversation(path) {
|
||||||
setVisibleOnMobile(mainPanel, true);
|
setVisibleOnMobile(mainPanel, true);
|
||||||
setVisibleOnMobile(conversationListElem, false);
|
setVisibleOnMobile(conversationListElem, false);
|
||||||
|
|
||||||
const title = path.split(".")[0];
|
|
||||||
|
|
||||||
readConversationJson(path, json => {
|
readConversationJson(path, json => {
|
||||||
conversation = new Conversation(title);
|
conversation = new Conversation(json.title);
|
||||||
const jsonMessages = json.messages;
|
const jsonMessages = json.messages;
|
||||||
const participants = json.characters;
|
const participants = json.characters;
|
||||||
|
|
||||||
|
@ -264,7 +263,6 @@ function showConversation(path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function addConversationPreview(path) {
|
function addConversationPreview(path) {
|
||||||
const title = path.split(".")[0];
|
|
||||||
const listRoot = document.getElementById("side-panel");
|
const listRoot = document.getElementById("side-panel");
|
||||||
|
|
||||||
readConversationJson(path, json => {
|
readConversationJson(path, json => {
|
||||||
|
@ -275,7 +273,7 @@ function addConversationPreview(path) {
|
||||||
elem.className = "conversation";
|
elem.className = "conversation";
|
||||||
|
|
||||||
const headerElem = document.createElement("h2");
|
const headerElem = document.createElement("h2");
|
||||||
headerElem.innerHTML = title;
|
headerElem.innerHTML = json.title;
|
||||||
elem.appendChild(headerElem);
|
elem.appendChild(headerElem);
|
||||||
|
|
||||||
const previewElem = document.createElement("span");
|
const previewElem = document.createElement("span");
|
||||||
|
|
Loading…
Reference in New Issue