From 7654917466ae1bfdf25414862f2c29aa32763cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=AB=20=E3=82=A6=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=83=96?= Date: Fri, 28 Sep 2018 16:34:42 -0500 Subject: [PATCH] Closes #157 --- app/components/head.js | 16 +++++++++++++--- app/views/api.js | 41 ++++++++++++++++++++++++++--------------- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/app/components/head.js b/app/components/head.js index 3f038c2..94fece0 100644 --- a/app/components/head.js +++ b/app/components/head.js @@ -17,9 +17,19 @@ let title = ""; // E X P O R T module.exports = exports = (state, emit) => { - if (state.route !== "/" && state.params.wildcard) title = `${state.params.wildcard.capitalize()} ∙ LBRY ∙ ${config.meta.tagline}`; - else if (state.route === "api") title = `API ∙ LBRY ∙ ${config.meta.tagline}`; - else title = `LBRY ∙ ${config.meta.tagline}`; + switch(true) { + case (state.route !== "/" && state.params.wildcard): + title = `${state.params.wildcard.capitalize()} ∙ LBRY ∙ ${config.meta.tagline}`; + break; + + case (state.route === "api"): + title = `API ∙ LBRY ∙ ${config.meta.tagline}`; + break; + + default: + title = `LBRY ∙ ${config.meta.tagline}`; + break; + } if (state.title !== title) emit(state.events.DOMTITLECHANGE, title); state.page = state.page || { }; diff --git a/app/views/api.js b/app/views/api.js index 728cb4c..b717103 100644 --- a/app/views/api.js +++ b/app/views/api.js @@ -19,24 +19,35 @@ const apiScripts = " - ${raw(apiScripts)} -`); +
${raw(createApiContent(response).join(""))}
+ + + + ${raw(apiScripts)} + `; +});