From 0f77759fa1241c2b44d4556769e2638556766726 Mon Sep 17 00:00:00 2001 From: Diogo Silva Date: Mon, 14 May 2018 12:35:25 +0100 Subject: [PATCH] fix: change daemon to node and upgrade error messages --- .../exchange-files-in-browser/public/app.css | 16 ++++++++-------- examples/exchange-files-in-browser/public/app.js | 16 ++++++++-------- .../exchange-files-in-browser/public/index.html | 10 +++++----- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/exchange-files-in-browser/public/app.css b/examples/exchange-files-in-browser/public/app.css index dba6e170cb..8324a06065 100644 --- a/examples/exchange-files-in-browser/public/app.css +++ b/examples/exchange-files-in-browser/public/app.css @@ -167,35 +167,35 @@ table tbody tr:hover { margin-bottom: 1em; } -/* Daemon +/* Node =========================================================================== */ -.box.daemon > div { +.box.node > div { display: flex; margin-bottom: 1em; } -.box.daemon > div:last-child { +.box.node > div:last-child { margin-bottom: 0; } -.box.daemon > div > h3 { +.box.node > div > h3 { flex: 0 0 15%; } -.box.daemon > div pre, -.box.daemon > div > ul { +.box.node > div pre, +.box.node > div > ul { flex: 0 0 85%; margin: 0; } -.box.daemon ul { +.box.node ul { margin: 0; padding: 0; list-style: none; } -.daemon-addresses li { +.node-addresses li { margin-bottom: 0.5em; font-size: 0.7em; word-wrap: break-word; diff --git a/examples/exchange-files-in-browser/public/app.js b/examples/exchange-files-in-browser/public/app.js index 807b551fa4..2ff5eea125 100644 --- a/examples/exchange-files-in-browser/public/app.js +++ b/examples/exchange-files-in-browser/public/app.js @@ -2,9 +2,9 @@ const IPFS = require('ipfs') -// Daemon -const $daemonId = document.querySelector('.daemon-id') -const $daemonAddresses = document.querySelector('.daemon-addresses') +// Node +const $nodeId = document.querySelector('.node-id') +const $nodeAddresses = document.querySelector('.node-addresses') const $logs = document.querySelector('#logs') // Peers const $peers = document.querySelector('#peers') @@ -50,7 +50,7 @@ function start () { .then((id) => { info = id updateView('ready', node) - onSuccess('Daemon is ready.') + onSuccess('Node is ready.') setInterval(refreshPeerList, 1000) }) .catch((error) => onError(err)) @@ -110,7 +110,7 @@ function getFile () { } }) }) - .catch((error) => onError('The inserted multihash is invalid.')) + .catch((error) => onError('An error occurred when fetching the files.')) } /* Drag & Drop @@ -178,7 +178,7 @@ function connectToPeer (event) { onSuccess(`Successfully connected to peer.`) $multiaddrInput.value = '' }) - .catch((error) => onError('The inserted multiaddr is invalid.')) + .catch((error) => onError('An error occurred when connecting to the peer.')) } function refreshPeerList () { @@ -237,8 +237,8 @@ const states = { const addressesHtml = info.addresses.map((address) => { return `
  • ${address}
  • ` }).join('') - $daemonId.innerText = info.id - $daemonAddresses.innerHTML = addressesHtml + $nodeId.innerText = info.id + $nodeAddresses.innerHTML = addressesHtml $allDisabledButtons.forEach(b => { b.disabled = false }) $allDisabledInputs.forEach(b => { b.disabled = false }) $allDisabledElements.forEach(el => { el.classList.remove('disabled') }) diff --git a/examples/exchange-files-in-browser/public/index.html b/examples/exchange-files-in-browser/public/index.html index 8d6358d340..1ec7f982ae 100644 --- a/examples/exchange-files-in-browser/public/index.html +++ b/examples/exchange-files-in-browser/public/index.html @@ -12,23 +12,23 @@
    -
    -

    Daemon

    +
    +

    Node

    ID

    -
    
    +          
    
             

    Addresses

    -
      +

        Logs

        -
        Initializing daemon...
        +
        Initializing node...