From bcc29e73ccee8f02690820310ce9bfe3fbb78d01 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: Tue, 9 Oct 2018 13:28:58 -0500 Subject: [PATCH] Support for LBRY and Spee.ch links on .tech --- app/helpers/fetch-metadata.js | 29 ++++++++++++++++++++------- app/sass/init/_extends.scss | 35 +++++++++++++++++++++++++++++++++ app/sass/pages/_playground.scss | 33 +------------------------------ app/sockets.js | 2 +- 4 files changed, 59 insertions(+), 40 deletions(-) diff --git a/app/helpers/fetch-metadata.js b/app/helpers/fetch-metadata.js index 4de22bc..26a8564 100644 --- a/app/helpers/fetch-metadata.js +++ b/app/helpers/fetch-metadata.js @@ -92,6 +92,8 @@ module.exports = exports = (data, socket) => { body.file_path = uploadResponse.filename; return publishMeme(body).then(publishResponse => { + let explorerNotice = ""; + if (publishResponse.error) { socket.send(JSON.stringify({ details: "Meme publish failed", @@ -110,20 +112,33 @@ module.exports = exports = (data, socket) => { return; } + if ( + publishResponse.result && + publishResponse.result.claim_address + ) explorerNotice = ` +

+ To see Proof of Work (lol) that your meme is on the LBRY blockchain, check it out on our blockchain explorer! Please note that it may take a couple minutes for the transaction to be confirmed. +

+ You can also check out your meme on LBRY or Spee.ch! +

+ +
+ `; + + delete publishResponse.result.lbrytech_claim_name; + const renderedCode = prism.highlight( stringifyObject(publishResponse, { indent: " ", singleQuotes: false }), prism.languages.json, "json" ); - let explorerNotice = ""; + /* + https://open.lbry.io/Yet--another-test-733dd99009#59b368ed4b616108fe27d308fa8e22602acc762f + https://open.lbry.io/claim_show#adee1be89febd3d89f51581601bca52d75a710a8 - if ( - publishResponse.result && - publishResponse.result.claim_address - ) explorerNotice = ` -

To see Proof of Work (lol) that your meme is on the LBRY blockchain, check it out on our blockchain explorer! Please note that it may take a couple minutes for the transaction to be confirmed.


- `; + You are generating the claim name, so you'd know it. it would be https://open.lbry.io/claim-name#claim_id (claim id comes from the return). You can also run a claim_show with the claim id parameter to get name if that's easier. The spee.ch link would just be https://spee.ch/claimid/claimname + */ return socket.send(JSON.stringify({ example: data.example, diff --git a/app/sass/init/_extends.scss b/app/sass/init/_extends.scss index 0ae37c3..5c6ccdf 100644 --- a/app/sass/init/_extends.scss +++ b/app/sass/init/_extends.scss @@ -125,6 +125,41 @@ padding-bottom: 0.5rem; } +.button { + @extend .__button-padding-horizontal; + color: $white; + font-size: 1rem; + line-height: 2rem; + position: relative; + transition: background-color 0.2s; + + &::after { + width: calc(100% + 2px); height: calc(100% + 2px); + top: -1px; left: -1px; + + content: ""; + position: absolute; + transition: background-color 0.2s; + z-index: -1; + } + + &:not(:hover) { + background-color: $black; + + &::after { + background-color: $black; + } + } + + &:hover { + background-color: $teal; + + &::after { + background-color: $teal; + } + } +} + /*! diff --git a/app/sass/pages/_playground.scss b/app/sass/pages/_playground.scss index 5c18838..83dbf32 100644 --- a/app/sass/pages/_playground.scss +++ b/app/sass/pages/_playground.scss @@ -399,43 +399,11 @@ button, span { height: 100%; - line-height: 2rem; } button { width: 6rem; - - color: $white; - font-size: 1rem; - position: relative; text-transform: lowercase; - transition: background-color 0.2s; - - &::after { - width: calc(100% + 2px); height: calc(100% + 2px); - top: -1px; left: -1px; - - content: ""; - position: absolute; - transition: background-color 0.2s; - z-index: -1; - } - - &:not(:hover) { - background-color: $black; - - &::after { - background-color: $black; - } - } - - &:hover { - background-color: $teal; - - &::after { - background-color: $teal; - } - } } input { @@ -455,6 +423,7 @@ color: rgba($black, 0.5); cursor: default; font-size: 1rem; + line-height: 2rem; text-align: right; } } diff --git a/app/sockets.js b/app/sockets.js index a4c3874..74ac23c 100644 --- a/app/sockets.js +++ b/app/sockets.js @@ -285,7 +285,7 @@ function generateMemeCreator(socket) {
- +
`;