diff --git a/app/components/api/header-blockchain.js b/app/components/api/header-blockchain.js index 301b016..34a9a85 100644 --- a/app/components/api/header-blockchain.js +++ b/app/components/api/header-blockchain.js @@ -1,15 +1,18 @@ "use strict"; + + +// P A C K A G E + import html from "choo/html"; -export default () => { - return html` -
- Methods and signatures provided by the lbrycrd blockchain daemon are documented below. - To build, download, or run lbrycrd, see the project README. -
-Methods and signatures provided by the lbrycrd blockchain daemon are documented below. To build, download, or run lbrycrd, see the project README.
+- Methods and signatures provided by the lbry-sdk daemon are documented below. - To build, download, or run the daemon, see the project README. -
-Methods and signatures provided by the lbry-sdk daemon are documented below. To build, download, or run the daemon, see the project README.
+
# With the LBRY app/daemon running locally, you can use this in your Terminal
curl --header "Content-Type: application/json" --data '{ "method": "resolve", "params": { "uri": "${data}" }}' http://localhost:5279
@@ -160,7 +160,7 @@ curl --header "Content-Type: application/json"
`;
- document.getElementById("tour-loader").style.display = "none";
+ document.getElementById("playground-loader").style.display = "none";
break;
case 2:
@@ -171,7 +171,7 @@ curl --header "Content-Type: application/json"
"example": exampleNumber
}));
- document.getElementById("tour-results").innerHTML = `
+ document.getElementById("playground-results").innerHTML = `
# With the LBRY app/daemon running locally, you can use this in your Terminal
curl --header "Content-Type: application/json" --data '{ "method": "publish", "params": { "name": "TITLE_OF_YOUR_CONTENT", "file_path": "ABSOLUTE_PATH_TO_MEDIA_ON_YOUR_COMPUTER", "bid": "0.001", "metadata": { "description": "DESCRIPTION_OF_YOUR_CONTENT", "title": "TITLE_OF_YOUR_CONTENT", "language": "en", "license": "", "nsfw": false }}}' http://localhost:5279
@@ -181,7 +181,7 @@ curl --header "Content-Type: application/json"
`;
- document.getElementById("tour-loader").style.display = "none";
+ document.getElementById("playground-loader").style.display = "none";
break;
case 3:
@@ -194,7 +194,7 @@ curl --header "Content-Type: application/json"
document.getElementById("fetch-claim-uri").value = data;
- document.getElementById("tour-results").innerHTML = `
+ document.getElementById("playground-results").innerHTML = `
# With the LBRY app/daemon running locally, you can use this in your Terminal
curl --header "Content-Type: application/json" --data '{ "method": "wallet_send", "params": { "amount": "0.01", "claim_id": "${data}" }}' http://localhost:5279
@@ -204,7 +204,7 @@ curl --header "Content-Type: application/json"
`;
- document.getElementById("tour-loader").style.display = "none";
+ document.getElementById("playground-loader").style.display = "none";
break;
default:
@@ -228,14 +228,14 @@ const handleExamples = debounce(event => {
let exampleNumber;
const data = event.dataset;
- if (!parseInt(document.querySelector(".tour__navigation__example.active").dataset.example)) return;
- exampleNumber = parseInt(document.querySelector(".tour__navigation__example.active").dataset.example);
+ if (!parseInt(document.querySelector(".playground__navigation__example.active").dataset.example)) return;
+ exampleNumber = parseInt(document.querySelector(".playground__navigation__example.active").dataset.example);
switch(data.action) {
case "choose claim":
fetchMetadata(exampleNumber, data.claimId);
- if (document.querySelector(".tour__navigation__example:nth-child(3)").classList.contains("active"))
+ if (document.querySelector(".playground__navigation__example:nth-child(3)").classList.contains("active"))
document.getElementById("fetch-claim-uri").value = event.alt + "#" + event.dataset.claimId;
break;
@@ -245,28 +245,28 @@ const handleExamples = debounce(event => {
fetchMetadata(exampleNumber, document.getElementById("fetch-claim-uri").value);
break;
- case "tour, example 1":
- if (document.getElementById("tour-loader").classList.contains("tour__content__meme")) {
- document.getElementById("tour-loader").classList.remove("tour__content__meme");
- document.getElementById("tour-loader").classList.add("tour__content__trends");
+ case "playground, example 1":
+ if (document.getElementById("playground-loader").classList.contains("playground__content__meme")) {
+ document.getElementById("playground-loader").classList.remove("playground__content__meme");
+ document.getElementById("playground-loader").classList.add("playground__content__trends");
}
document.getElementById("fetch-claim-uri").value = ""; // reset URL bar
- document.querySelector("#tour-url button").textContent = "Resolve";
+ document.querySelector("#playground-url button").textContent = "Resolve";
- if (document.getElementById("tour-url").style.display === "none")
- document.getElementById("tour-url").removeAttribute("style");
+ if (document.getElementById("playground-url").style.display === "none")
+ document.getElementById("playground-url").removeAttribute("style");
- for (const example of document.querySelectorAll(".tour__navigation__example"))
+ for (const example of document.querySelectorAll(".playground__navigation__example"))
example.classList.remove("active");
- document.querySelector(".tour__navigation__example:nth-child(1)").classList.add("active");
+ document.querySelector(".playground__navigation__example:nth-child(1)").classList.add("active");
- document.getElementById("tour-loader").innerHTML = "";
- document.getElementById("tour-results").innerHTML = "";
+ document.getElementById("playground-loader").innerHTML = "";
+ document.getElementById("playground-results").innerHTML = "";
- document.getElementById("tour-loader").removeAttribute("style");
- document.getElementById("tour-results").removeAttribute("style");
+ document.getElementById("playground-loader").removeAttribute("style");
+ document.getElementById("playground-results").removeAttribute("style");
send(JSON.stringify({
"message": `request for ${data.action}`
@@ -274,25 +274,25 @@ const handleExamples = debounce(event => {
break;
- case "tour, example 2":
- if (document.getElementById("tour-loader").classList.contains("tour__content__trends")) {
- document.getElementById("tour-loader").classList.remove("tour__content__trends");
- document.getElementById("tour-loader").classList.add("tour__content__meme");
+ case "playground, example 2":
+ if (document.getElementById("playground-loader").classList.contains("playground__content__trends")) {
+ document.getElementById("playground-loader").classList.remove("playground__content__trends");
+ document.getElementById("playground-loader").classList.add("playground__content__meme");
}
document.getElementById("fetch-claim-uri").value = ""; // reset URL bar
- document.getElementById("tour-url").style.display = "none";
+ document.getElementById("playground-url").style.display = "none";
- for (const example of document.querySelectorAll(".tour__navigation__example"))
+ for (const example of document.querySelectorAll(".playground__navigation__example"))
example.classList.remove("active");
- document.querySelector(".tour__navigation__example:nth-child(2)").classList.add("active");
+ document.querySelector(".playground__navigation__example:nth-child(2)").classList.add("active");
- document.getElementById("tour-loader").innerHTML = "";
- document.getElementById("tour-results").innerHTML = "";
+ document.getElementById("playground-loader").innerHTML = "";
+ document.getElementById("playground-results").innerHTML = "";
- document.getElementById("tour-loader").removeAttribute("style");
- document.getElementById("tour-results").removeAttribute("style");
+ document.getElementById("playground-loader").removeAttribute("style");
+ document.getElementById("playground-results").removeAttribute("style");
send(JSON.stringify({
"message": `request for ${data.action}`
@@ -300,28 +300,28 @@ const handleExamples = debounce(event => {
break;
- case "tour, example 3":
- if (document.getElementById("tour-loader").classList.contains("tour__content__meme")) {
- document.getElementById("tour-loader").classList.remove("tour__content__meme");
- document.getElementById("tour-loader").classList.add("tour__content__trends");
+ case "playground, example 3":
+ if (document.getElementById("playground-loader").classList.contains("playground__content__meme")) {
+ document.getElementById("playground-loader").classList.remove("playground__content__meme");
+ document.getElementById("playground-loader").classList.add("playground__content__trends");
}
document.getElementById("fetch-claim-uri").value = ""; // reset URL bar
- document.querySelector("#tour-url button").textContent = "Tip";
+ document.querySelector("#playground-url button").textContent = "Tip";
- if (document.getElementById("tour-url").style.display === "none")
- document.getElementById("tour-url").removeAttribute("style");
+ if (document.getElementById("playground-url").style.display === "none")
+ document.getElementById("playground-url").removeAttribute("style");
- for (const example of document.querySelectorAll(".tour__navigation__example"))
+ for (const example of document.querySelectorAll(".playground__navigation__example"))
example.classList.remove("active");
- document.querySelector(".tour__navigation__example:nth-child(3)").classList.add("active");
+ document.querySelector(".playground__navigation__example:nth-child(3)").classList.add("active");
- document.getElementById("tour-loader").innerHTML = "";
- document.getElementById("tour-results").innerHTML = "";
+ document.getElementById("playground-loader").innerHTML = "";
+ document.getElementById("playground-results").innerHTML = "";
- document.getElementById("tour-loader").removeAttribute("style");
- document.getElementById("tour-results").removeAttribute("style");
+ document.getElementById("playground-loader").removeAttribute("style");
+ document.getElementById("playground-results").removeAttribute("style");
send(JSON.stringify({
"message": `request for ${data.action}`
diff --git a/app/components/ecosystem.js b/app/components/ecosystem.js
index 0bc1399..9adf194 100644
--- a/app/components/ecosystem.js
+++ b/app/components/ecosystem.js
@@ -16,7 +16,7 @@ const WALLET = require("./ecosystem/submodule-wallet");
// E X P O R T
-export default function () {
+export default () => {
return `
`;
-}
+};
diff --git a/app/components/ecosystem/module-lbrycrd.js b/app/components/ecosystem/module-lbrycrd.js
index 8798179..331cf19 100644
--- a/app/components/ecosystem/module-lbrycrd.js
+++ b/app/components/ecosystem/module-lbrycrd.js
@@ -24,7 +24,7 @@ module.exports = exports = () => `
LBRY uses a public, proof-of-work blockchain that is very similar to Bitcoin. The blockchain is the foundation of the protocol stack.
- The most salient feature of the LBRY blockchain is the association of a string of characters (a "name") with a structured set of metadata. This name can be accessed as a LBRY URL, e.g. lbry://hellolbry
+ The most salient feature of the LBRY blockchain is the association of a string of characters (a "name") with a structured set of metadata. This name can be accessed as a LBRY URL, e.g. lbry://hellolbry
The LBRY blockchain stores names and metadata in a Merkle tree. This allows LBRY URLs to be trustfully resolved even without a full copy of the blockchain.
diff --git a/app/components/edit-link.js b/app/components/edit-link.js
index e594ba3..6b181c4 100644
--- a/app/components/edit-link.js
+++ b/app/components/edit-link.js
@@ -15,7 +15,7 @@ const config = local("/config");
// E X P O R T
-export default function (pagePath) {
+export default pagePath => {
let githubUrl = `https://github.com/${config.github.repo}/edit/${config.github.branch}`;
switch(pagePath) {
@@ -23,12 +23,16 @@ export default function (pagePath) {
githubUrl = `${githubUrl}/app/views/home.js`;
break;
- case "/resources":
- githubUrl = `${githubUrl}/views/pages/resources.js`;
+ case "/api":
+ githubUrl = `${githubUrl}/app/views/api.js`;
break;
- case "/tour":
- githubUrl = `${githubUrl}/app/components/tour.js`;
+ case "/api/blockchain":
+ githubUrl = "https://github.com/lbryio/lbrycrd/blob/add_api_docs_scripts/contrib/devtools/generated/api_v1.json";
+ break;
+
+ case "/api/sdk":
+ githubUrl = "https://github.com/lbryio/lbry/blob/master/docs/api.json";
break;
default:
@@ -39,9 +43,9 @@ export default function (pagePath) {
return html`
${config.github.linkText}
`;
-}
+};
diff --git a/app/components/email-subscribe.js b/app/components/email-subscribe.js
index 8ea1d22..b205998 100644
--- a/app/components/email-subscribe.js
+++ b/app/components/email-subscribe.js
@@ -10,17 +10,15 @@ import html from "choo/html";
// E X P O R T
-export default function () {
- return html`
-
- Don't miss a bit - Subscribe for LBRY technical updates
+export default () => html`
+
+ Don't miss a bit - Subscribe for LBRY technical updates
-
-
-
-
-
+
+
+
- `;
-}
+
+
+
+`;
diff --git a/app/components/feature-links.js b/app/components/feature-links.js
index 00c193b..4708e54 100644
--- a/app/components/feature-links.js
+++ b/app/components/feature-links.js
@@ -41,7 +41,7 @@ const links = [ // TODO: Update images
// E X P O R T
-export default function () {
+export default () => {
const renderedLinks = [];
let imageLink = "";
@@ -53,7 +53,7 @@ export default function () {
return `
${renderedLinks.join("")}
`;
-}
+};
diff --git a/app/components/link-grid.js b/app/components/link-grid.js
index e21a861..561672e 100644
--- a/app/components/link-grid.js
+++ b/app/components/link-grid.js
@@ -10,7 +10,7 @@ import html from "choo/html";
// E X P O R T
-export default (links) => {
+export default links => {
const renderedLinks = links.map((link) =>
returnLinkTemplate(link.title, link.description, link.destination, link.label));
diff --git a/app/components/mission-statement.js b/app/components/mission-statement.js
index e4e9857..b0f2a07 100644
--- a/app/components/mission-statement.js
+++ b/app/components/mission-statement.js
@@ -10,16 +10,14 @@ import html from "choo/html";
// E X P O R T
-export default function () {
- return html`
-
- Mission Statement
- To create a market for accessing and publishing information1
- that is global2,
- decentralized3,
- robust4,
- optimal5
- and complete6.
-
- `;
-}
+export default () => html`
+
+ Mission Statement
+ To create a market for accessing and publishing information1
+ that is global2,
+ decentralized3,
+ robust4,
+ optimal5
+ and complete6.
+
+`;
diff --git a/app/components/playground.js b/app/components/playground.js
index efd182e..37f6371 100644
--- a/app/components/playground.js
+++ b/app/components/playground.js
@@ -12,17 +12,15 @@ import raw from "choo/html/raw";
// E X P O R T
-export default () => {
- return dedent`
-
- ${raw(example1())}
-
- `;
-};
+export default () => dedent`
+
-
-
+ ${raw(example1())}
+
+`;
@@ -30,16 +28,16 @@ export default () => {
function example1() {
return html`
-
+
+