소스 검색

Docs updated, examples

Artur Paikin 9 년 전
부모
커밋
ab3b153b15
4개의 변경된 파일17개의 추가작업 그리고 19개의 파일을 삭제
  1. 14 18
      website/src/api/docs.md
  2. 1 0
      website/src/examples/dragdrop/app.css
  3. 1 1
      website/src/examples/dragdrop/app.html
  4. 1 0
      website/src/examples/i18n/app.css

+ 14 - 18
website/src/api/docs.md

@@ -32,20 +32,7 @@ Returns **Promise** of all methods
 
 
 ### setProgress
 ### setProgress
 
 
-Translate a string into the selected language (this.locale).
-Return the original string if locale is undefined
-
-**Parameters**
-
--   `string` **string** that needs translating
--   `plugin`  
--   `percentage`  
-
-Returns **string** translated string
-
-### setProgress
-
-Sets plugin’s progress, for uploads for example
+Sets plugin’s progress, like for uploads
 
 
 **Parameters**
 **Parameters**
 
 
@@ -68,9 +55,15 @@ Returns **object** self for chaining
 
 
 ## Translator
 ## Translator
 
 
-Translates strings with interpolation & pluralization support. Extensible with custom dictionaries and pluralization functions.
-Borrows heavily from and inspired by Polyglot <https://github.com/airbnb/polyglot.js>. Differences: pluralization functions are not hardcoded and can be easily added among with dictionaries.
-Usage example: translator.t('files\_chosen', {smart\_count: 3})
+Translates strings with interpolation & pluralization support.Extensible with custom dictionaries
+and pluralization functions.
+
+Borrows heavily from and inspired by Polyglot <https://github.com/airbnb/polyglot.js>,
+basically a stripped-down version of it. Differences: pluralization functions are not hardcoded
+and can be easily added among with dictionaries, nested objects are used for pluralization
+as opposed to `||||` delimeter
+
+Usage example: \`translator.t('files\_chosen', {smart\_count: 3})``
 
 
 **Parameters**
 **Parameters**
 
 
@@ -78,13 +71,16 @@ Usage example: translator.t('files\_chosen', {smart\_count: 3})
 
 
 ### interpolate
 ### interpolate
 
 
-Takes a string with placeholder variables like '%{smart\_count} file selected' and replaces it with values from options {smart\_count: 5}
+Takes a string with placeholder variables like `%{smart_count} file selected`
+and replaces it with values from options `{smart_count: 5}`
 
 
 **Parameters**
 **Parameters**
 
 
 -   `phrase` **string** that needs interpolation, with placeholders
 -   `phrase` **string** that needs interpolation, with placeholders
 -   `options` **object** with values that will be used to replace placeholders
 -   `options` **object** with values that will be used to replace placeholders
 
 
+Returns **string** interpolated
+
 ### t
 ### t
 
 
 Public translate method
 Public translate method

+ 1 - 0
website/src/examples/dragdrop/app.css

@@ -2,4 +2,5 @@
 
 
 .UppyDragDrop-puppy {
 .UppyDragDrop-puppy {
   max-width: 80px;
   max-width: 80px;
+  margin-bottom: 20px;
 }
 }

+ 1 - 1
website/src/examples/dragdrop/app.html

@@ -2,7 +2,7 @@
 <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>
     <label class="UppyDragDrop-label" for="UppyDragDrop-input"><strong>Choose a file</strong><span class="UppyDragDrop-dragText"> or drag it here</span>.</label>

+ 1 - 0
website/src/examples/i18n/app.css

@@ -2,4 +2,5 @@
 
 
 .UppyDragDrop-puppy {
 .UppyDragDrop-puppy {
   max-width: 80px;
   max-width: 80px;
+  margin-bottom: 20px;
 }
 }