Skip to content

Commit 1d13355

Browse files
committed
docs: + FileAPI.rotate: auto
1 parent 325737d commit 1d13355

3 files changed

Lines changed: 52 additions & 33 deletions

File tree

README.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ FileAPI.readAsBinaryString(file, function (evt/**Object*/){
280280
---
281281

282282
<a name="FileAPI.readAsArrayBuffer"></a>
283-
### readAsBinaryString(file`:Object`, callback`:Function`)`:void`
283+
### readAsArrayBuffer(file`:Object`, callback`:Function`)`:void`
284284
Reading the contents of the specified `File` as `ArrayBuffer`.
285285

286286
* file — file object
@@ -331,14 +331,7 @@ Reading the contents of the specified `File` as `text`.
331331

332332
```js
333333
FileAPI.readAsText(file, "utf-8", function (evt/**Object*/){
334-
if( evt.type == 'load' ){
335-
// Success
336-
var text = evt.result;
337-
} else if( evt.type =='progress' ){
338-
var pr = evt.loaded/evt.total * 100;
339-
} else {
340-
// Error
341-
}
334+
/*__*/
342335
})
343336
```
344337

@@ -653,15 +646,15 @@ var xhr = FileAPI.upload({
653646
## File object
654647

655648
<a name="File.name"></a>
656-
### name
649+
### name`:String`
657650
The name of the file referenced by the File object.
658651

659652
<a name="File.type"></a>
660-
### type
653+
### type`:String`
661654
The type (MIME type) of the file referenced by the File object.
662655

663656
<a name="File.size"></a>
664-
### size
657+
### size`:Number`
665658
The size (in bytes) of the file referenced by the File object.
666659

667660
---
@@ -717,15 +710,15 @@ Returns the string containing the text of the specified header, or null if eithe
717710
### success(callback`:Function`)`:XmlHttpRequestPromise`
718711
A function to be called if the request succeeds.
719712

720-
* callback — receives two arguments: `xhr` and `options`
713+
* callback — receives two arguments: `xhr` and `options`
721714

722715
---
723716

724717
<a name="XmlHttpRequestPromise.error"></a>
725718
### error(callback`:Function`)`:XmlHttpRequestPromise`
726-
A function to be called if the request succeeds.
719+
A function to be called if the request failure.
727720

728-
* callback — receives three arguments: `error`, `xhr` and `options`
721+
* callback — receives three arguments: `error`, `xhr` and `options`
729722

730723
---
731724

@@ -918,6 +911,23 @@ FileAPI.Image(imageFile)
918911

919912
---
920913

914+
<a name="FileAPI.Image.rotate-auto"></a>
915+
### rotate(type`:String`)`:FileAPI.Image`
916+
Auto rotate image by exif.
917+
918+
* type — "auto"
919+
920+
```js
921+
FileAPI.Image(imageFile)
922+
.rotate("auto")
923+
.get(function (err/**String*/, img/**HTMLElement*/){
924+
925+
})
926+
;
927+
```
928+
929+
---
930+
921931
<a name="FileAPI.Image.filter"></a>
922932
### filter(callback`:Function`)`:FileAPI.Image`
923933
Apply filter function. Only `HTML5`.

README.ru.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ FileAPI.readAsBinaryString(file, function (evt/**Object*/){
279279
---
280280

281281
<a name="FileAPI.readAsArrayBuffer"></a>
282-
### readAsBinaryString(file`:Object`, callback`:Function`)`:void`
282+
### readAsArrayBuffer(file`:Object`, callback`:Function`)`:void`
283283
Чтение содержимого указанного файла как `ArrayBuffer`.
284284

285285
* file — файл для чтения
@@ -330,14 +330,7 @@ FileAPI.readAsText(file, function (evt/**Object*/){
330330

331331
```js
332332
FileAPI.readAsText(file, "utf-8", function (evt/**Object*/){
333-
if( evt.type == 'load' ){
334-
// Всё хорошо
335-
var text = evt.result;
336-
} else if( evt.type =='progress' ){
337-
var pr = evt.loaded/evt.total * 100;
338-
} else {
339-
// Ошибка
340-
}
333+
/*__*/
341334
})
342335
```
343336

@@ -651,15 +644,15 @@ var xhr = FileAPI.upload({
651644
## File object
652645

653646
<a name="File.name"></a>
654-
### name
647+
### name`:String`
655648
Имя файла.
656649

657650
<a name="File.type"></a>
658-
### type
651+
### type`:String`
659652
MIME type
660653

661654
<a name="File.size"></a>
662-
### size
655+
### size`:Number`
663656
Размер файла в байтах.
664657

665658

@@ -715,18 +708,17 @@ HTTP-статус в виде числа (404 — «Not Found», 200 — «OK»
715708

716709
<a name="XmlHttpRequestPromise.success"></a>
717710
### success(callback`:Function`)`:XmlHttpRequestPromise`
718-
Функция, которая исполняется в случае неудачного запроса.
711+
Функция, которая исполняется в случае успешного запроса.
719712

720-
* callback — принимает два аргумента: `xhr` и `options`
713+
* callback — принимает два аргумента: `xhr` и `options`
721714

722715
---
723716

724717
<a name="XmlHttpRequestPromise.error"></a>
725718
### error(callback`:Function`)`:XmlHttpRequestPromise`
726-
Функция, которая исполняется в случае успешного запроса.
727-
728-
* callback — принимает три аргумента: `error`, `xhr` и `options`
719+
Функция, которая исполняется в случае неудачного запроса.
729720

721+
* callback — принимает три аргумента: `error`, `xhr` и `options`
730722

731723
---
732724

@@ -920,6 +912,23 @@ FileAPI.Image(imageFile)
920912

921913
---
922914

915+
<a name="FileAPI.Image.rotate-auto"></a>
916+
### rotate(type`:String`)`:FileAPI.Image`
917+
Автоматический поворот по EXIF.
918+
919+
* type — "auto"
920+
921+
```js
922+
FileAPI.Image(imageFile)
923+
.rotate("auto")
924+
.get(function (err/**String*/, img/**HTMLElement*/){
925+
926+
})
927+
;
928+
```
929+
930+
---
931+
923932
<a name="FileAPI.Image.filter"></a>
924933
### filter(callback`:Function`)`:FileAPI.Image`
925934
Применить фильтр функцию. Только `HTML5`.

statics/docs.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)