Преглед на файлове

website: output console logs in order

Especially to address this confusing output:

    []
    failed files:
    [{"source":"Dashboard","id":"uppy-15lessknowwebpackfeaturespdf-application/pdf-711976-1524658883000","name":"15-less-know-webpack-features.pdf","extension":"pdf","meta":{"relativePath":null,"name":"15-less-know-webpack-features.pdf","type":"application/pdf"},"type":"application/pdf","data":{},"progress":{"uploadStarted":1557736252411,"uploadComplete":true,"percentage":100,"bytesUploaded":711976,"bytesTotal":711976},"size":711976,"isRemote":false,"remote":"","tus":{"uploadUrl":"https://master.tus.io/files/4c9812d89aec61576014f0c8d8213972+VqNL644QdEZtFzWbS7WOp.DbiI1oiUaZFuH8W9RiegyrxssHNE0qEMKvtJt1x3Q6FH7c_mXKdEufb3sLzGZNhl63UtpPItFQs69NSoDLo.MCmZMud8707qPO4.M59jkA"},"response":{"uploadURL":"https://master.tus.io/files/4c9812d89aec61576014f0c8d8213972+VqNL644QdEZtFzWbS7WOp.DbiI1oiUaZFuH8W9RiegyrxssHNE0qEMKvtJt1x3Q6FH7c_mXKdEufb3sLzGZNhl63UtpPItFQs69NSoDLo.MCmZMud8707qPO4.M59jkA"},"uploadURL":"https://master.tus.io/files/4c9812d89aec61576014f0c8d8213972+VqNL644QdEZtFzWbS7WOp.DbiI1oiUaZFuH8W9RiegyrxssHNE0qEMKvtJt1x3Q6FH7c_mXKdEufb3sLzGZNhl63UtpPItFQs69NSoDLo.MCmZMud8707qPO4.M59jkA","isPaused":false}]
    successful files:

Here, the list of successful files is below `failed files:` so it looks
like those failed.

This changes it to:

    successful files:
    [{"source":"Dashboard","id":"uppy-15lessknowwebpackfeaturespdf-application/pdf-711976-1524658883000","name":"15-less-know-webpack-features.pdf","extension":"pdf","meta":{"relativePath":null,"name":"15-less-know-webpack-features.pdf","type":"application/pdf"},"type":"application/pdf","data":{},"progress":{"uploadStarted":1557736252411,"uploadComplete":true,"percentage":100,"bytesUploaded":711976,"bytesTotal":711976},"size":711976,"isRemote":false,"remote":"","tus":{"uploadUrl":"https://master.tus.io/files/4c9812d89aec61576014f0c8d8213972+VqNL644QdEZtFzWbS7WOp.DbiI1oiUaZFuH8W9RiegyrxssHNE0qEMKvtJt1x3Q6FH7c_mXKdEufb3sLzGZNhl63UtpPItFQs69NSoDLo.MCmZMud8707qPO4.M59jkA"},"response":{"uploadURL":"https://master.tus.io/files/4c9812d89aec61576014f0c8d8213972+VqNL644QdEZtFzWbS7WOp.DbiI1oiUaZFuH8W9RiegyrxssHNE0qEMKvtJt1x3Q6FH7c_mXKdEufb3sLzGZNhl63UtpPItFQs69NSoDLo.MCmZMud8707qPO4.M59jkA"},"uploadURL":"https://master.tus.io/files/4c9812d89aec61576014f0c8d8213972+VqNL644QdEZtFzWbS7WOp.DbiI1oiUaZFuH8W9RiegyrxssHNE0qEMKvtJt1x3Q6FH7c_mXKdEufb3sLzGZNhl63UtpPItFQs69NSoDLo.MCmZMud8707qPO4.M59jkA","isPaused":false}]
    failed files:
    []

When adding a new line the textarea is scrolled to the bottom so the
latest stuff is still always visible.
Renée Kooi преди 6 години
родител
ревизия
cfce113aac

+ 1 - 1
website/src/_template/contributing.md

@@ -88,7 +88,7 @@ npm install
 npm start
 ```
 
-Releases are managed by [Lerna](https://github.com/lerna/lerna/tree/2.x). We do some cleanup and compile work around releases too. Use the npm release script:
+Releases are managed by [Lerna](https://github.com/lerna/lerna). We do some cleanup and compile work around releases too. Use the npm release script:
 
 ```bash
 npm run release

+ 1 - 1
website/src/examples/bundle/index.ejs

@@ -14,7 +14,7 @@ This example showcases using a pre-built bundle from a CDN.
 <hr />
 
 <p id="console-wrapper">
-  Console output (latest logs are at the top): <br />
+  Console output: <br />
 </p>
 
 <p>

+ 1 - 1
website/src/examples/dashboard/index.ejs

@@ -15,7 +15,7 @@ Dashboard is the full-featured UI for Uppy that shows nice file previews and up
 
 <hr />
 
-<p id="console-wrapper">Console output (latest logs are at the top): <br /></p>
+<p id="console-wrapper">Console output: <br /></p>
 
 <p>On this page we're using the following JavaScript snippet:</p>
 

+ 2 - 2
website/src/examples/dragdrop/index.ejs

@@ -17,7 +17,7 @@ Here you'll see a demo of how you might set up Drag and Drop with Uppy.
 <hr />
 
 <p id="console-wrapper">
-  Console output (latest logs are at the top): <br />
+  Console output: <br />
 </p>
 
 <p>
@@ -28,4 +28,4 @@ Here you'll see a demo of how you might set up Drag and Drop with Uppy.
 <p>
   Along with this JavaScript:
 </p>
-{% include_code lang:js dragdrop/app.es6 %}
+{% include_code lang:js dragdrop/app.es6 %}

+ 1 - 1
website/src/examples/i18n/index.ejs

@@ -16,7 +16,7 @@ Here you’ll see a demo of how you might use internationalization (i18n) in Upp
 <hr />
 
 <p id="console-wrapper">
-  Console output (latest logs are at the top): <br />
+  Console output: <br />
 </p>
 
 <p>

+ 3 - 3
website/src/examples/markdown-snippets/index.ejs

@@ -9,13 +9,13 @@ category: 'File Processing'
 {% blockquote %}
 This is a demo app that works a bit like Github Gists or Pastebin. You can add markdown snippets, and add file attachments to each snippet.
 
-Uppy <a href="/docs/robodog/">Robodog</a> (using <a href="https://transloadit.com">Transloadit</a> internally) generates an inline preview image for images, videos, and audio files. 
+Uppy <a href="/docs/robodog/">Robodog</a> (using <a href="https://transloadit.com">Transloadit</a> internally) generates an inline preview image for images, videos, and audio files.
 
 You can view the <a target="_blank" href="https://github.com/transloadit/uppy/blob/master/examples/transloadit-textarea/template.json">Transloadit Assembly Template</a> and the <a href="#snippet-example-code"> code for this demo</a>.
 {% endblockquote %}
 
 <p>
- 
+
 </p>
 
 <p>
@@ -29,7 +29,7 @@ You can view the <a target="_blank" href="https://github.com/transloadit/uppy/bl
 <hr />
 
 <p id="console-wrapper">
-  Console output (latest logs are at the top): <br />
+  Console output: <br />
 </p>
 
 <p id="snippet-example-code">

+ 1 - 1
website/src/examples/statusbar/index.ejs

@@ -16,7 +16,7 @@ The StatusBar plugin shows detailed upload/processing progress with pause/resume
 <hr />
 
 <p id="console-wrapper">
-  Console output (latest logs are at the top): <br />
+  Console output: <br />
 </p>
 
 <p>

+ 1 - 1
website/src/examples/transloadit/index.ejs

@@ -47,7 +47,7 @@ This example demonstrates how to unlock Transloadit’s features within Uppy.
 
 <hr />
 
-<p id="console-wrapper">Console output (latest logs are at the top):
+<p id="console-wrapper">Console output:
   <br />
 </p>
 

+ 1 - 1
website/src/examples/xhrupload/index.ejs

@@ -23,7 +23,7 @@ Uppy recommends using tus resumable file uploads, but if you want you can also u
 <hr />
 
 <p id="console-wrapper">
-  Console output (latest logs are at the top): <br />
+  Console output: <br />
 </p>
 
 <p>

+ 12 - 11
website/themes/uppy/layout/example.ejs

@@ -27,17 +27,18 @@
 
   <textarea id="console-log" class="Console"></textarea>
   <script>
-  console.log = (function (old_function, div_log) {
-    return function (text) {
-      old_function(text);
-
-      if (text !== (text + '')) {
-        text = JSON.stringify(text);
-      }
-
-      div_log.value = text + "\n" + div_log.value;
-    };
-  } (console.log.bind(console), document.getElementById("console-log")));
+    console.log = (function (log, container) {
+      return function (text) {
+        log(text);
+
+        if (text !== (text + '')) {
+          text = JSON.stringify(text);
+        }
+
+        container.value += text;
+        container.scrollTop = container.scrollHeight + '\n';
+      };
+    }(console.log.bind(console), document.getElementById("console-log")));
   </script>
 
   <script>

+ 1 - 1
website/themes/uppy/layout/partials/generated_stargazers.ejs

@@ -1 +1 @@
-19048
+19157