Forráskód Böngészése

i18n examples for CDN & UMD

Artur Paikin 9 éve
szülő
commit
9e33d48f90

+ 1 - 2
website/src/examples/i18n/app.es6

@@ -5,8 +5,7 @@ const ru_RU = require('../../../../src/locale/ru_RU.js');
 
 
 const uppy = new Uppy({wait: false, locale: ru_RU});
 const uppy = new Uppy({wait: false, locale: ru_RU});
 const files = uppy
 const files = uppy
-  .use(DragDrop, {selector: '#upload-target'})
   .use(Tus10, {endpoint: 'http://master.tus.io:8080/files/'})
   .use(Tus10, {endpoint: 'http://master.tus.io:8080/files/'})
   .run();
   .run();
 
 
-console.log('Uppy ' + uppy.type + ' loaded');
+console.log('--> Uppy Bundled version with Tus10 & Russian language pack has loaded');

+ 17 - 13
website/src/examples/i18n/app.html

@@ -1,22 +1,26 @@
-<script src="/uppy/uppy.js"></script>
-<script src="/uppy/locale/ru_RU.js"></script>
-<script>
-var uppy = new Uppy.Core({locale: Uppy.locale.ru_RU});
-uppy.use(Uppy.plugins.Tus10);
-uppy.run();
-
-console.log('Uppy ' + uppy.type + ' loaded from CDN with tus enabled');
-</script>
-
 <!-- Basic Uppy styles -->
 <!-- Basic Uppy styles -->
 <link rel="stylesheet" href="/css/uppy.css">
 <link rel="stylesheet" href="/css/uppy.css">
 
 
 <form id="upload-target" class="UppyDragDrop" method="post" action="/" enctype="multipart/form-data">
 <form id="upload-target" class="UppyDragDrop" method="post" action="/" enctype="multipart/form-data">
-  <svg class="UppyDragDrop-puppy" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 125" enable-background="new 0 0 100 100"><path d="M16.582 21.3L-.085 62.713l32.94 13.295zM99.915 62.714L66.975 76.01 83.25 21.3zM50.917 68.117L62.443 56.59H37.386l11.527 11.526v5.905l-3.063 3.32 1.474 1.36 2.59-2.807 2.59 2.807 1.475-1.358-3.063-3.32zM66.976 41.415c-3.972 0-7.193-3.22-7.193-7.193 0-3.973 3.222-7.193 7.193-7.193 3.974 0 7.193 3.22 7.193 7.192 0 3.973-3.22 7.193-7.194 7.193m2.506-11.732c-.738 0-1.337.6-1.337 1.337s.6 1.336 1.337 1.336 1.337-.598 1.337-1.336-.6-1.337-1.338-1.337zM32.854 41.415c-3.973 0-7.193-3.22-7.193-7.193 0-3.973 3.22-7.193 7.194-7.193 3.973 0 7.192 3.22 7.192 7.192 0 3.973-3.22 7.193-7.192 7.193m2.506-11.732c-.738 0-1.337.6-1.337 1.337s.6 1.336 1.337 1.336 1.337-.598 1.337-1.336-.598-1.337-1.337-1.337z"/></svg>
+  <img class="UppyDragDrop-puppy" src="/images/uppy.svg">
   <div>
   <div>
     <input id="UppyDragDrop-input" class="UppyDragDrop-input" type="file" name="files[]" data-multiple-caption="{count} files selected" multiple />
     <input id="UppyDragDrop-input" class="UppyDragDrop-input" type="file" name="files[]" data-multiple-caption="{count} files selected" multiple />
-    <label class="UppyDragDrop-label" for="UppyDragDrop-input"><strong>Choose a file</strong><span class="UppyDragDrop-dragText"> or drag it here</span>.</label>
-    <!-- <button class="UppyDragDrop-btn" type="submit">Upload</button> -->
+    <label class="UppyDragDrop-label" for="UppyDragDrop-input">
+      <strong>Choose a file</strong>
+      <span class="UppyDragDrop-dragText"> or drag it here</span>.
+    </label>
   </div>
   </div>
   <div class="UppyDragDrop-status"></div>
   <div class="UppyDragDrop-status"></div>
 </form>
 </form>
+
+<!-- Load the Uppy CDN version and Russian language pack -->
+<script src="/uppy/uppy.js"></script>
+<script src="/uppy/locale/ru_RU.js"></script>
+<script>
+  var uppy = new Uppy.Core({locale: Uppy.locale.ru_RU});
+  uppy.use(Uppy.plugins.DragDrop, {selector: '#upload-target'});
+  uppy.use(Uppy.plugins.Tus10);
+  uppy.run();
+
+  console.log('--> Uppy CDN version with Tus10, DragDrop & Russian language pack has loaded');
+</script>

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

@@ -6,12 +6,12 @@ order: 1
 ---
 ---
 
 
 {% blockquote %}
 {% blockquote %}
-Here you'll see a demo of how you might set Uppy to work with multiple languages.
+Here you'll see a demo of how you might set Uppy to work with language packs (i18n). Actually, two examples: the CDN & Bundled / UMD.
 {% endblockquote %}
 {% endblockquote %}
 
 
 <link rel="stylesheet" href="app.css">
 <link rel="stylesheet" href="app.css">
 <% include app.html %>
 <% include app.html %>
-<script src="123app.js"></script>
+<script src="app.js"></script>
 
 
 <hr />
 <hr />
 
 
@@ -20,14 +20,14 @@ Here you'll see a demo of how you might set Uppy to work with multiple languages
 </p>
 </p>
 
 
 <p>
 <p>
-  On this page we're using the following HTML snippet:
+  To load from CDN we're using the following HTML and JavaScript:
 </p>
 </p>
-{% include_code lang:html dragdrop/app.html %}
+{% include_code lang:html i18n/app.html %}
 
 
 <p>
 <p>
-  Along with this JavaScript:
+  Or, if we want the UMD version, this JavaScript:
 </p>
 </p>
-{% include_code lang:js dragdrop/app.es6 %}
+{% include_code lang:js i18n/app.es6 %}
 
 
 <p>
 <p>
   And the following CSS:
   And the following CSS: