{"FileAPI":{"label":"FileAPI","class":"FileAPI","descr":{"en":"A set of javascript tools for working with files.","ru":"Набор JavaScript инструментов для работы с файлами."},"props":{"Get started":{"name":"Get started","type":-1,"label":"started","descr":{"en":"","ru":""},"code":{"type":"html","source":{"en":"  <div>\n    <!-- \"js-fileapi-wrapper\" -- required class -->\n    <div class=\"js-fileapi-wrapper upload-btn\">\n      <div class=\"upload-btn__txt\">Choose files</div>\n      <input id=\"choose\" name=\"files\" type=\"file\" multiple />\n    </div>\n    <div id=\"images\"><!-- previews --></div>\n  </div>\n\n  <script>window.FileAPI = { staticPath: '/js/FileAPI/dist/' };</script>\n  <script src=\"/js/FileAPI/dist/FileAPI.min.js\"></script>\n  <script>\n    FileAPI.event.on(choose, 'change', function (evt){\n      var files = FileAPI.getFiles(evt); // Retrieve file list\n\n      FileAPI.filterFiles(files, function (file, info/**Object*/){\n        if( /^image/.test(file.type) ){\n          return  info.width >= 320 && info.height >= 240;\n        }\n        return  false;\n      }, function (files/**Array*/, rejected/**Array*/){\n        if( files.length ){\n          // Make preview 100x100\n          FileAPI.each(files, function (file){\n            FileAPI.Image(file).preview(100).get(function (err, img){\n              images.appendChild(img);\n            });\n          });\n\n          // Uploading Files\n          FileAPI.upload({\n            url: './ctrl.php',\n            files: { images: files },\n            progress: function (evt){ /* ... */ },\n            complete: function (err, xhr){ /* ... */ }\n          });\n        }\n      });\n    });\n  </script>","ru":"  <div>\n    <!-- \"js-fileapi-wrapper\" -- обязательный class -->\n    <div class=\"js-fileapi-wrapper upload-btn\" id=\"choose\">\n      <div class=\"upload-btn__txt\">Choose files</div>\n      <input name=\"files\" type=\"file\" multiple />\n    </div>\n    <div id=\"images\"><!-- предпросмотр --></div>\n  </div>\n\n  <script>window.FileAPI = { staticPath: '/js/FileAPI/dist/' };</script>\n  <script src=\"/js/FileAPI/dist/FileAPI.min.js\"></script>\n  <script>\n    FileAPI.event.on(choose, 'change', function (evt){\n      var files = FileAPI.getFiles(evt); // Retrieve file list\n\n      FileAPI.filterFiles(files, function (file, info/**Object*/){\n        if( /^image/.test(file.type) ){\n          return  info.width >= 320 && info.height >= 240;\n        }\n        return  false;\n      }, function (files/**Array*/, rejected/**Array*/){\n        if( files.length ){\n          // Создаем предпросмотр 100x100\n          FileAPI.each(files, function (file){\n            FileAPI.Image(file).preview(100).get(function (err, img){\n              images.appendChild(img);\n            });\n          });\n\n          // Загружаем файлы\n          FileAPI.upload({\n            url: './ctrl.php',\n            files: { images: files },\n            progress: function (evt){ /* ... */ },\n            complete: function (err, xhr){ /* ... */ }\n          });\n        }\n      });\n    });\n  </script>"}}},"Setup options":{"name":"Setup options","type":-1,"label":"FileAPI.setup","descr":{"en":"Edit the file `crossdomain.xml` and place it to the root of the domain to which files will be uploaded.","ru":"Отредактируйте файл `crossdomain.xml` и разместите его в корне домена, на который будут загружаться файлы."},"code":{"type":"html","source":{"en":"  <script>\n    window.FileAPI = {\n        debug: false   // debug mode, see Console\n      , cors: false    // if used CORS, set `true`\n      , media: false   // if used WebCam, set `true`\n      , staticPath: '/js/FileAPI/dist/' // path to '*.swf'\n      , postNameConcat: function (name, idx){\n        // Default: object[foo]=1&object[bar][baz]=2\n        // .NET: https://github.com/mailru/FileAPI/issues/121#issuecomment-24590395\n        return  name + (idx != null ? '['+ idx +']' : '');\n      }\n    };\n  </script>\n  <script src=\"/js/FileAPI/dist/FileAPI.min.js\"></script>\n\n  <!-- OR -->\n\n  <script>\n    window.FileAPI = { /* options */ };\n    require(['FileAPI'], function (FileAPI){\n      // ...\n    });\n  </script>","ru":"  <script>\n    window.FileAPI = {\n        debug: false  // дебаг режим, смотрите Console\n      , cors: false   // если используете CORS -- `true`\n      , media: false  // если используете веб-камеру -- `true`\n      , staticPath: '/js/FileAPI/dist/' // путь к '*.swf'\n      , postNameConcat: function (name, idx){\n        // Default: object[foo]=1&object[bar][baz]=2\n        // .NET: https://github.com/mailru/FileAPI/issues/121#issuecomment-24590395\n        return  name + (idx != null ? '['+ idx +']' : '');\n      }\n    };\n  </script>\n  <script src=\"/js/FileAPI/dist/FileAPI.min.js\"></script>\n\n  <!-- ИЛИ -->\n\n  <script>\n    window.FileAPI = { /* etc. */ };\n    require(['FileAPI'], function (FileAPI){\n      // ...\n    });\n  </script>"}}}},"fn":{"getFiles":{"name":"getFiles","label":"FileAPI.getFiles","args":{"input":{"en":"`HTMLInputElement`, `change` and `drop` event, `jQuery` collection or `jQuery.Event`","ru":"`HTMLInputElement`, `change` и `drop` события, `jQuery` коллекция или `jQuery.Event`"}},"variants":[{"args":[{"name":"input","type":"HTMLInputElement|Event|$.Event","optional":false}],"descr":{"en":"Retrieve file list from `input` element or `event` object, also support `jQuery`.","ru":"Получить список файлов из `input` элемента, или `event`, также поддерживается `jQuery`."}}],"returns":"Array","code":{"type":"js","source":{"en":"var el = document.getElement('my-input');\nFileAPI.event.on(el, function (evt/**Event*/){\n  // Retrieve file list\n  var files = FileAPI.getFiles(el);\n\n  // or event\n  var files = FileAPI.getFiles(evt);\n});","ru":"var el = document.getElement('my-input');\nFileAPI.event.on(el, function (evt/**Event*/){\n  // Получить список файлов из `input`\n  var files = FileAPI.getFiles(el);\n\n  // или события\n  var files = FileAPI.getFiles(evt);\n});"}}},"getInfo":{"name":"getInfo","label":"FileAPI.getInfo","args":{"file":{"en":"file object (https://developer.mozilla.org/en-US/docs/DOM/File)","ru":"объект файла (https://developer.mozilla.org/en-US/docs/DOM/File)"},"callback":{"en":"function, called after collected info of file","ru":"функция, вызывается по завершению сбора информации"}},"variants":[{"args":[{"name":"file","type":"Object","optional":false},{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Get info of file (see also: FileAPI.addInfoReader).","ru":"Получить информацию о файле (см. FileAPI.addInfoReader)."}}],"returns":"void","code":{"type":"js","source":{"en":"// Get info of image file (FileAPI.exif.js included)\nFileAPI.getInfo(file, function (err/**String*/, info/**Object*/){\n  if( !err ){\n    console.log(info); // { width: 800, height: 600, exif: {..} }\n  }\n});\n\n// Get info of mp3 file (FileAPI.id3.js included)\nFileAPI.getInfo(file, function (err/**String*/, info/**Object*/){\n  if( !err ){\n    console.log(info); // { title: \"...\", album: \"...\", artists: \"...\", ... }\n  }\n});","ru":"// Получить информацию о изображении (FileAPI.exif.js подключен)\nFileAPI.getInfo(file, function (err/**String*/, info/**Object*/){\n  if( !err ){\n    console.log(info); // { width: 800, height: 600, exif: {..} }\n  }\n});\n\n// Получить информацию о mp3 файле (FileAPI.id3.js included)\nFileAPI.getInfo(file, function (err/**String*/, info/**Object*/){\n  if( !err ){\n    console.log(info); // { title: \"...\", album: \"...\", artists: \"...\", ... }\n  }\n});"}}},"filterFiles":{"name":"filterFiles","label":"FileAPI.filterFiles","args":{"files":{"en":"original list of files","ru":"оригинальный список файлов"},"filter":{"en":"function, takes two arguments: `file` — the file itself, `info` — additional information.","ru":"функция, принимает два аргумента: `file` — сам файл, `info` — дополнительная информация"},"callback":{"en":"function: `list` — files that match the condition, `other` — all the rest.","ru":"функция: `list` — список файлов, подошедшие под условия, `other` — все остальные."}},"variants":[{"args":[{"name":"files","type":"Array","optional":false},{"name":"filter","type":"Function","optional":false},{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Filtering the list of files, with additional information about files.\nSee also: FileAPI.getInfo and FileAPI.addInfoReader.","ru":"Отфильтровать список файлов, используя  дополнительную информацию о них.\nсм. FileAPI.getInfo или FileAPI.addInfoReader."}}],"returns":"void","code":{"type":"js","source":{"en":"// Get list of file\nvar files = FileAPI.getFiles(input);\n\n// Filter the List\nFileAPI.filterFiles(files, function (file/**Object*/, info/**Object*/){\n  if( /^image/.test(file.type) && info ){\n    return  info.width > 320 && info.height > 240;\n  } else {\n    return  file.size < 20 * FileAPI.MB;\n  }\n}, function (list/**Array*/, other/**Array*/){\n  if( list.length ){\n    // ..\n  }\n});","ru":"// Получаем список файлов\nvar files = FileAPI.getFiles(input);\n\n// Фильтруем список\nFileAPI.filterFiles(files, function (file/**Object*/, info/**Object*/){\n  if( /^image/.test(file.type) && info ){\n    return  info.width > 320 && info.height > 240;\n  } else {\n    return  file.size < 20 * FileAPI.MB;\n  }\n}, function (list/**Array*/, other/**Array*/){\n  if( list.length ){\n    // ..\n  }\n});"}}},"getDropFiles":{"name":"getDropFiles","label":"FileAPI.getDropFiles","args":{"evt":{"en":"`drop` event","ru":"`drop` event"},"callback":{"en":"function, takes one argument, a list of files","ru":"фнукция, принимает один аргумент — список файлов"}},"variants":[{"args":[{"name":"evt","type":"Event|$.Event","optional":false},{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Get a list of files, including directories.","ru":"Получить весь список файлов, включая директории."}}],"returns":"void","code":{"type":"js","source":{"en":"FileAPI.event.on(document, 'drop', function (evt/**Event*/){\n  evt.preventDefault();\n\n  // Get a list of files\n  FileAPI.getDropFiles(evt, function (files/**Array*/){\n    // ...\n  });\n});","ru":"FileAPI.event.on(document, 'drop', function (evt/**Event*/){\n  evt.preventDefault();\n\n  // Получаем все файлы\n  FileAPI.getDropFiles(evt, function (files/**Array*/){\n    // ...\n  });\n});"}}},"upload":{"name":"upload","label":"FileAPI.upload","args":{"opts":{"en":"options object, see [Upload options](#options)","ru":"объект настрое, см. раздел [Upload options](#options)"}},"variants":[{"args":[{"name":"opts","type":"Object","optional":false}],"descr":{"en":"Uploading files to the server (successively). Returns XHR-like object.\nIt is important to remember to correctly worked flash-transport server response body must not be empty,\nfor example, you can pass, just text \"ok\".","ru":"Загрузка файлов на сервер (последовательно). Возвращает XHR-подобный объект.\nПомните, для корректной работы flash-транспорта, тело ответа сервера не должно быть пустым,\nнапример можно ответить простым текстом \"ok\"."}}],"returns":"XmlHttpRequest","code":{"type":"js","source":{"en":"var el = document.getElementById('my-input');\nFileAPI.event.on(el, 'change', function (evt/**Event*/){\n  var files = FileAPI.getFiles(evt);\n  var xhr = FileAPI.upload({\n    url: 'http://rubaxa.org/FileAPI/server/ctrl.php',\n    files: { file: files[0] },\n    complete: function (err, xhr){\n      if( !err ){\n        var result = xhr.responseText;\n        // ...\n      }\n    }\n  });\n});","ru":"var el = document.getElementById('my-input');\nFileAPI.event.on(el, 'change', function (evt/**Event*/){\n  var files = FileAPI.getFiles(evt);\n  var xhr = FileAPI.upload({\n    url: 'http://rubaxa.org/FileAPI/server/ctrl.php',\n    files: { file: files[0] },\n    complete: function (err, xhr){\n      if( !err ){\n        var result = xhr.responseText;\n        // ...\n      }\n    }\n  });\n});"}}},"addInfoReader":{"name":"addInfoReader","label":"FileAPI.addInfoReader","args":{"mime":{"en":"pattern of mime-type","ru":"маска mime-type"},"handler":{"en":"takes two arguments: `file` object and `complete` function callback","ru":"функция, принимает два аргумента: `file` объект и `complete` функция обратного вызова"}},"variants":[{"args":[{"name":"mime","type":"RegExp","optional":false},{"name":"handler","type":"Function","optional":false}],"descr":{"en":"Adds a handler for the collection of information about a file.\nSee also: FileAPI.getInfo and FileAPI.filterFiles.","ru":"Добавить обработчик, для сбора информации о файле.\nсм. также: FileAPI.getInfo и FileAPI.filterFiles."}}],"returns":"void","code":{"type":"js","source":{"en":"FileAPI.addInfoReader(/^image/, function (file/**File*/, callback/**Function*/){\n  // http://www.nihilogic.dk/labs/exif/exif.js\n  // http://www.nihilogic.dk/labs/binaryajax/binaryajax.js\n  FileAPI.readAsBinaryString(file, function (evt/**Object*/){\n    if( evt.type == 'load' ){\n      var binaryString = evt.result;\n      var oFile = new BinaryFile(binaryString, 0, file.size);\n      var exif  = EXIF.readFromBinaryFile(oFile);\n      callback(false, { 'exif': exif || {} });\n    }\n    else if( evt.type == 'error' ){\n      callback('read_as_binary_string');\n    }\n    else if( evt.type == 'progress' ){\n      // ...\n    }\n  });\n});","ru":"FileAPI.addInfoReader(/^image/, function (file/**File*/, callback/**Function*/){\n  // http://www.nihilogic.dk/labs/exif/exif.js\n  // http://www.nihilogic.dk/labs/binaryajax/binaryajax.js\n  FileAPI.readAsBinaryString(file, function (evt/**Object*/){\n    if( evt.type == 'load' ){\n      var binaryString = evt.result;\n      var oFile = new BinaryFile(binaryString, 0, file.size);\n      var exif  = EXIF.readFromBinaryFile(oFile);\n      callback(false, { 'exif': exif || {} });\n    }\n    else if( evt.type == 'error' ){\n      callback('read_as_binary_string');\n    }\n    else if( evt.type == 'progress' ){\n      // ...\n    }\n  });\n});"}}},"readAsDataURL":{"name":"readAsDataURL","label":"FileAPI.readAsDataURL","args":{"file":{"en":"file object","ru":"файл для чтения"},"callback":{"en":"function, receives a result","ru":"функция обработчик"}},"variants":[{"args":[{"name":"file","type":"Object","optional":false},{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Reading the contents of the specified `File` as `dataURL`.","ru":"Чтение содержимого указанного файла как dataURL."}}],"returns":"void","code":{"type":"js","source":{"en":"FileAPI.readAsDataURL(file, function (evt/**Object*/){\n  if( evt.type == 'load' ){\n    // Success\n     var dataURL = evt.result;\n  } else if( evt.type =='progress' ){\n    var pr = evt.loaded/evt.total * 100;\n  } else {\n    // Error\n  }\n})","ru":"FileAPI.readAsDataURL(file, function (evt/**Object*/){\n  if( evt.type == 'load' ){\n    // Всё хорошо\n     var dataURL = evt.result;\n  } else if( evt.type =='progress' ){\n    var pr = evt.loaded/evt.total * 100;\n  } else {\n    // Ошибка\n  }\n})"}}},"readAsBinaryString":{"name":"readAsBinaryString","label":"FileAPI.readAsBinaryString","args":{"file":{"en":"file object","ru":"файл для чтения"},"callback":{"en":"function, receives a result","ru":"функция обработчик"}},"variants":[{"args":[{"name":"file","type":"Object","optional":false},{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Reading the contents of the specified `File` as `BinaryString`.","ru":"Чтение содержимого указанного файла как `BinaryString`."}},{"args":[{"name":"file","type":"Object","optional":false},{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Reading the contents of the specified `File` as `ArrayBuffer`.","ru":"Чтение содержимого указанного файла как `ArrayBuffer`."}}],"returns":"void","code":{"type":"js","source":{"en":"FileAPI.readAsArrayBuffer(file, function (evt/**Object*/){\n  if( evt.type == 'load' ){\n    // Success\n     var arrayBuffer = evt.result;\n  } else if( evt.type =='progress' ){\n    var pr = evt.loaded/evt.total * 100;\n  } else {\n    // Error\n  }\n})","ru":"FileAPI.readAsArrayBuffer(file, function (evt/**Object*/){\n  if( evt.type == 'load' ){\n    // Всё хорошо\n     var arrayBuffer = evt.result;\n  } else if( evt.type =='progress' ){\n    var pr = evt.loaded/evt.total * 100;\n  } else {\n    // Ошибка\n  }\n})"}}},"readAsText":{"name":"readAsText","label":"FileAPI.readAsText","args":{"file":{"en":"file object","ru":"файл для чтения"},"callback":{"en":"function, receives a result","ru":"функция обработчик"},"encoding":{"en":"a string indicating the encoding to use for the returned data. By default, UTF-8.","ru":"строкой с указанием кодировки. По умолчанию UTF-8."}},"variants":[{"args":[{"name":"file","type":"Object","optional":false},{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Reading the contents of the specified `File` as `text`.","ru":"Чтение содержимого указанного файла как `text`."}},{"args":[{"name":"file","type":"Object","optional":false},{"name":"encoding","type":"String","optional":false},{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Reading the contents of the specified `File` as `text`.","ru":"Чтение содержимого указанного файла как `text` в нужной кодировке."}}],"returns":"void","code":{"type":"js","source":{"en":"FileAPI.readAsText(file, \"utf-8\", function (evt/**Object*/){\n  if( evt.type == 'load' ){\n    // Success\n     var text = evt.result;\n  } else if( evt.type =='progress' ){\n    var pr = evt.loaded/evt.total * 100;\n  } else {\n    // Error\n  }\n})","ru":"FileAPI.readAsText(file, \"utf-8\", function (evt/**Object*/){\n  if( evt.type == 'load' ){\n    // Всё хорошо\n     var text = evt.result;\n  } else if( evt.type =='progress' ){\n    var pr = evt.loaded/evt.total * 100;\n  } else {\n    // Ошибка\n  }\n})"}}}}},"Upload options":{"label":"options","class":"Upload options","descr":{"en":"","ru":""},"props":{"url":{"name":"url","type":"String","label":"options.url","descr":{"en":"A string containing the URL to which the request is sent.","ru":"Строка, содержащая адрес, на который отправляется запрос."}},"data":{"name":"data","type":"Object","label":"options.data","descr":{"en":"Additional post data to be sent along with the file uploads.","ru":"Дополнительные данные, которые должны быть отправлены вместе с файлом."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  data: { 'session-id': 123 },\n  files: { ... },\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  data: { 'session-id': 123 },\n  files: { ... },\n});"}}},"headers":{"name":"headers","type":"Object","label":"options.headers","descr":{"en":"Additional request headers, HTML5 only.","ru":"Дополнительные заголовки запроса, только HTML5."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  headers: { 'x-upload': 'fileapi' },\n  files: { .. },\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  headers: { 'x-upload': 'fileapi' },\n  files: { .. },\n});"}}},"files":{"name":"files","type":"Object","label":"options.files","descr":{"en":"Key-value object, `key` — post name, `value` — File or FileAPI.Image object."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: {\n    audio: files\n  }\n});"}}},"chunkSize":{"name":"chunkSize","type":"Number","label":"options.chunkSize","descr":{"en":"Chunk size in bytes, HTML5 only.","ru":"Размер части файла в байта, только HTML5."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { images: fileList },\n  chunkSize: 0.5 * FileAPI.MB\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { images: fileList },\n  chunkSize: 0.5 * FileAPI.MB\n});"}}},"chunkUploadRetry":{"name":"chunkUploadRetry","type":"Number","label":"options.chunkUploadRetry","descr":{"en":"Number of retries during upload chunks, HTML5 only.","ru":"Количество попыток загрузки одной части, только HTML5."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { images: fileList },\n  chunkSize: 0.5 * FileAPI.MB,\n  chunkUploadRetry: 3\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { images: fileList },\n  chunkSize: 0.5 * FileAPI.MB,\n  chunkUploadRetry: 3\n});"}}},"imageTransform":{"name":"imageTransform","type":"Object","label":"options.imageTransform","descr":{"en":"Convert all images to jpeg or png.","ru":"Конвертация всех изображений в jpeg или png."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { image: imageFiles },\n  imageTransform: {\n    type: 'image/jpeg',\n    quality: 0.86 // jpeg quality\n  }\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { image: imageFiles },\n  imageTransform: {\n    type: 'image/jpeg',\n    quality: 0.86 // качество jpeg\n  }\n});"}}},"imageOriginal":{"name":"imageOriginal","type":"Boolean","label":"options.imageOriginal","descr":{"en":"Sent to the server the original image or not, if defined imageTransform option.","ru":"Отправлять исходное изображение на сервер или нет, если определен `imageTransform` вариант."}},"imageAutoOrientation":{"name":"imageAutoOrientation","type":"Boolean","label":"options.imageAutoOrientation","descr":{"en":"Auto-rotate images on the basis of EXIF.","ru":"Автоматический поворот изображения на основе EXIF."}},"prepare":{"name":"prepare","type":"Function","label":"options.prepare","descr":{"en":"Prepare options upload for a particular file.","ru":"Подготовка опций загрузки для конкретного файла."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  prepare: function (file/**Object*/, options/**Object*/){\n    options.data.secret = utils.getSecretKey(file.name);\n  }\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  prepare: function (file/**Object*/, options/**Object*/){\n    options.data.secret = utils.getSecretKey(file.name);\n  }\n});"}}},"upload":{"name":"upload","type":"Function","label":"options.upload","descr":{"en":"Start uploading.","ru":"Начало загрузки"},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  upload: function (xhr/**Object*/, options/**Object*/){\n    // ...\n  }\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  upload: function (xhr/**Object*/, options/**Object*/){\n    // ...\n  }\n});"}}},"fileupload":{"name":"fileupload","type":"Function","label":"options.fileupload","descr":{"en":"Start file uploading.","ru":"Начало загрузки файла"},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  fileupload: function (file/**Object*/, xhr/**Object*/, options/**Object*/){\n    // ...\n  }\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  fileupload: function (file/**Object*/, xhr/**Object*/, options/**Object*/){\n    // ...\n  }\n});"}}},"progress":{"name":"progress","type":"Function","label":"options.progress","descr":{"en":"Callback for upload progress events.","ru":"Общий прогресс загрузки файлов."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  progress: function (evt/**Object*/, file/**Object*/, xhr/**Object*/, options/**Object*/){\n    var pr = evt.loaded/evt.total * 100;\n  }\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  progress: function (evt/**Object*/, file/**Object*/, xhr/**Object*/, options/**Object*/){\n    var pr = evt.loaded/evt.total * 100;\n  }\n});"}}},"fileprogress":{"name":"fileprogress","type":"Function","label":"options.fileprogress","descr":{"en":"Callback for upload file progress events.","ru":"Прогресс загрузки файла."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  fileprogress: function (evt/**Object*/, file/**Object*/, xhr/**Object*/, options/**Object*/){\n    var pr = evt.loaded/evt.total * 100;\n  }\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  fileprogress: function (evt/**Object*/, file/**Object*/, xhr/**Object*/, options/**Object*/){\n    var pr = evt.loaded/evt.total * 100;\n  }\n});"}}},"complete":{"name":"complete","type":"Function","label":"options.complete","descr":{"en":"Callback for end upload requests.","ru":"Завершение загрузки всех файлов."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  complete: function (err/**String*/, xhr/**Object*/, file/**Object/, options/**Object*/){\n    if( !err ){\n      // All files successfully uploaded.\n    }\n  }\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  complete: function (err/**String*/, xhr/**Object*/, file/**Object/, options/**Object*/){\n    if( !err ){\n      // Все файлы загружены успешно\n    }\n  }\n});"}}},"filecomplete":{"name":"filecomplete","type":"Function","label":"options.filecomplete","descr":{"en":"Callback for end upload requests.","ru":"Конец загрузки файла."},"code":{"type":"js","source":{"en":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  filecomplete: function (err/**String*/, xhr/**Object*/, file/**Object/, options/**Object*/){\n    if( !err ){\n      // File successfully uploaded\n      var result = xhr.responseText;\n    }\n  }\n});","ru":"var xhr = FileAPI.upload({\n  url: '...',\n  files: { .. }\n  filecomplete: function (err/**String*/, xhr/**Object*/, file/**Object/, options/**Object*/){\n    if( !err ){\n      // Файл загружен успешно\n      var result = xhr.responseText;\n    }\n  }\n});"}}}},"fn":{}},"File object":{"label":"File","class":"File object","descr":{"en":"","ru":""},"props":{"name":{"name":"name","type":-1,"label":"File.name","descr":{"en":"The name of the file referenced by the File object.","ru":"Имя файла."}},"type":{"name":"type","type":-1,"label":"File.type","descr":{"en":"The type (MIME type) of the file referenced by the File object.","ru":"MIME type"}},"size":{"name":"size","type":-1,"label":"File.size","descr":{"en":"The size (in bytes) of the file referenced by the File object.","ru":"Размер файла в байтах."}}},"fn":{}},"FileAPI.event":{"label":"FileAPI.event","class":"FileAPI.event","descr":{"en":"","ru":""},"props":{},"fn":{"on":{"name":"on","label":"FileAPI.event.on","args":{"el":{"en":"DOM element","ru":"DOM элемент."},"events":{"en":"one or more space-separated event types.","ru":"одно или нескольких разделенных пробелами типов событий."},"handler":{"en":"A function to execute when the event is triggered.","ru":"функция обработчик события."}},"variants":[{"args":[{"name":"el","type":"HTMLElement","optional":false},{"name":"events","type":"String","optional":false},{"name":"handler","type":"Function","optional":false}],"descr":{"en":"Attach an event handler function.","ru":"Добавить функцию обработки события."}}],"returns":"void"},"off":{"name":"off","label":"FileAPI.event.off","args":{"el":{"en":"DOM element","ru":"DOM элемент"},"events":{"en":"one or more space-separated event types.","ru":"одно или нескольких разделенных пробелами типов событий."},"handler":{"en":"a handler function previously attached for the event(s).","ru":"функции обработчика ранее назначения на `event`."}},"variants":[{"args":[{"name":"el","type":"HTMLElement","optional":false},{"name":"events","type":"String","optional":false},{"name":"handler","type":"Function","optional":false}],"descr":{"en":"Remove an event handler.","ru":"Удалить обработчик события."}}],"returns":"void"},"one":{"name":"one","label":"FileAPI.event.one","args":{"el":{"en":"DOM element","ru":"DOM элемент."},"events":{"en":"one or more space-separated event types.","ru":"одно или нескольких разделенных пробелами типов событий."},"handler":{"en":"a function to execute when the event is triggered.","ru":"функция обработчик события."}},"variants":[{"args":[{"name":"el","type":"HTMLElement","optional":false},{"name":"events","type":"String","optional":false},{"name":"handler","type":"Function","optional":false}],"descr":{"en":"Attach an event handler function. The handler is executed at most once.","ru":"Добавить функцию обработки события. Обработчик выполняется не более одного раза."}}],"returns":"void"},"dnd":{"name":"dnd","label":"FileAPI.event.dnd","args":{"el":{"en":"drop zone","ru":"DOM элемент"},"hover":{"en":"`dragenter` and `dragleave` listener","ru":"`dragenter` и `dragleave` слушатель"},"handler":{"en":"`drop` event handler.","ru":"обработчик события `drop`"}},"variants":[{"args":[{"name":"el","type":"HTMLElement","optional":false},{"name":"hover","type":"Function","optional":false},{"name":"handler","type":"Function","optional":false}],"descr":{"en":"Attach an drag and drop event handler function.","ru":"Добавить функцию обработки событий `drag` и `drop`."}}],"returns":"void","code":{"type":"js","source":{"en":"var el = document.getElementById('dropzone');\nFileAPI.event.dnd(el, function (over){\n  el.style.backgroundColor = over ? '#f60': '';\n}, function (files){\n  if( files.length ){\n    // Upload their.\n  }\n});\n\n// or jQuery\n$('#dropzone').dnd(hoverFn, dropFn);","ru":"var el = document.getElementById('dropzone');\nFileAPI.event.dnd(el, function (over){\n  el.style.backgroundColor = over ? '#f60': '';\n}, function (files){\n  if( files.length ){\n    // Загружаем их.\n  }\n});\n\n// или jQuery\n$('#dropzone').dnd(hoverFn, dropFn);"}}},"dnd.off":{"name":"dnd.off","label":"FileAPI.event.dnd.off","args":{"el":{"en":"drop zone","ru":"DOM элемент"},"hover":{"en":"`dragenter` and `dragleave` listener","ru":"`dragenter` и `dragleave` слушатель"},"handler":{"en":"`drop` event handler.","ru":"обработчик события `drop`"}},"variants":[{"args":[{"name":"el","type":"HTMLElement","optional":false},{"name":"hover","type":"Function","optional":false},{"name":"handler","type":"Function","optional":false}],"descr":{"en":"Remove an drag and drop event handler function.","ru":"Удалить функцию обработки событий `drag` и `drop`."}}],"returns":"void","code":{"type":"js","source":{"en":"// Native\nFileAPI.event.dnd.off(el, hoverFn, dropFn);\n\n// jQuery\n$('#dropzone').dndoff(hoverFn, dropFn);","ru":"// Native\nFileAPI.event.dnd.off(el, hoverFn, dropFn);\n\n// jQuery\n$('#dropzone').dndoff(hoverFn, dropFn);"}}}}},"FileAPI.Image":{"label":"FileAPI.Image","class":"FileAPI.Image","descr":{"en":"Class for working with images","ru":"Класс для работы с изображениями"},"props":{},"fn":{"constructor":{"name":"constructor","label":"FileAPI.Image","args":{"file":{"en":"the `File` object","ru":"файл изображения"}},"variants":[{"args":[{"name":"file","type":"Object","optional":false}],"descr":{"en":"The constructor takes a single argument, the `File` object.","ru":"Конструктор получает только один параметр, файл."}}],"returns":"void","code":{"type":"js","source":{"en":"FileAPI.Image(imageFile).get(function (err/**String*/, img/**HTMLElement*/){\n  if( !err ){\n    document.body.appendChild( img );\n  }\n});","ru":"FileAPI.Image(imageFile).get(function (err/**String*/, img/**HTMLElement*/){\n  if( !err ){\n    document.body.appendChild( img );\n  }\n});"}}},"crop":{"name":"crop","label":"FileAPI.Image.crop","args":{"width":{"en":"new image width","ru":"новая ширина изображения"},"height":{"en":"new image height","ru":"новая высота изображения"},"x":{"en":"offset from the top corner","ru":"смещение относительно по x левого угла"},"y":{"en":"offset from the left corner","ru":"смещение относительно по y левого угла"}},"variants":[{"args":[{"name":"width","type":"Number","optional":false},{"name":"height","type":"Number","optional":false}],"descr":{"en":"Crop image by width and height.","ru":"Кроп изображения по ширине и высоте."}},{"args":[{"name":"x","type":"Number","optional":false},{"name":"y","type":"Number","optional":false},{"name":"width","type":"Number","optional":false},{"name":"height","type":"Number","optional":false}],"descr":{"en":"Crop image by x, y, width and height.","ru":"Кроп изображения по ширине и высоте, а также смещению по x и y."}}],"returns":"FileAPI.Image","code":{"type":"js","source":{"en":"FileAPI.Image(imageFile)\n  .crop(100, 50, 320, 240)\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;","ru":"FileAPI.Image(imageFile)\n  .crop(100, 50, 320, 240)\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;"}}},"resize":{"name":"resize","label":"FileAPI.Image.resize","args":{"width":{"en":"new image width","ru":"новая ширина"},"height":{"en":"new image height","ru":"новая высота"},"type":{"en":"enum: `min`, `max`, `preview`. By default `undefined`.","ru":"enum: `min`, `max`, `preview`. По умолчанию `undefined`."}},"variants":[{"args":[{"name":"width","type":"Number","optional":false},{"name":"height","type":"Number","optional":false},{"name":"type","type":"String","optional":true}],"descr":{"en":"Resize image.","ru":"Ресайз."}}],"returns":"FileAPI.Image","code":{"type":"js","source":{"en":"FileAPI.Image(imageFile)\n  .resize(320, 240)\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;\n\n// Resize image on by max side.\nFileAPI.Image(imageFile)\n  .resize(320, 240, 'max')\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;","ru":"FileAPI.Image(imageFile)\n  .resize(320, 240)\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;\n\n// По большей стороне\nFileAPI.Image(imageFile)\n  .resize(320, 240, 'max')\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;"}}},"preview":{"name":"preview","label":"FileAPI.Image.preview","args":{"width":{"en":"new image width","ru":"новая ширина"},"height":{"en":"new image height","ru":"новая высота"}},"variants":[{"args":[{"name":"width","type":"Number","optional":false},{"name":"height","type":"Number","optional":true}],"descr":{"en":"Crop and resize image.","ru":"Кроп и ресайз изображения."}}],"returns":"FileAPI.Image","code":{"type":"js","source":{"en":"FileAPI.Image(imageFile)\n  .preview(100, 100)\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;","ru":"FileAPI.Image(imageFile)\n  .preview(100, 100)\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;"}}},"rotate":{"name":"rotate","label":"FileAPI.Image.rotate","args":{"deg":{"en":"rotation angle in degrees","ru":"угол поворота в градусах"}},"variants":[{"args":[{"name":"deg","type":"Number","optional":false}],"descr":{"en":"Rotate image.","ru":"Поворот."}}],"returns":"FileAPI.Image","code":{"type":"js","source":{"en":"FileAPI.Image(imageFile)\n  .rotate(90)\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;","ru":"FileAPI.Image(imageFile)\n  .rotate(90)\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;"}}},"filter":{"name":"filter","label":"FileAPI.Image.filter","args":{"callback":{"en":"takes two arguments, `canvas` element and `done` method.","ru":"принимает два рагумента, `canvas` элемент и метод `done`."},"name":{"en":"CamanJS filter name (custom or preset)","ru":"название CamanJS фильтра (произвольный, либо предустановленный)"}},"variants":[{"args":[{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Apply filter function. Only `HTML5`.","ru":"Применить фильтр функцию. Только `HTML5`."}},{"args":[{"name":"name","type":"String","optional":false}],"descr":{"en":"Uses [CamanJS](http://camanjs.com/), include it before FileAPI library.","ru":"Используется [CamanJS](http://camanjs.com/), подключите его перед библиотекой FileAPI."}}],"returns":"FileAPI.Image","code":{"type":"js","source":{"en":"Caman.Filter.register(\"my-funky-filter\", function () {\n  // http://camanjs.com/guides/#Extending\n});\n\nFileAPI.Image(imageFile)\n  .filter(\"my-funky-filter\") // or .filter(\"vintage\")\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;","ru":"Caman.Filter.register(\"my-funky-filter\", function () {\n  // http://camanjs.com/guides/#Extending\n});\n\nFileAPI.Image(imageFile)\n  .filter(\"my-funky-filter\") // или .filter(\"vintage\")\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;"}}},"overlay":{"name":"overlay","label":"FileAPI.Image.overlay","args":{"images":{"en":"array of overlays","ru":"массив наложений"}},"variants":[{"args":[{"name":"images","type":"Array","optional":false}],"descr":{"en":"Add overlay images, eg: watermark.","ru":"Добавить наложение, например: водяной знак."}}],"returns":"FileAPI.Image","code":{"type":"js","source":{"en":"FileAPI.Image(imageFile)\n  .overlay([\n    // Left corner.\n    { x: 10, y: 10, w: 100, h: 10, src: '/i/watermark.png' },\n\n    // Right bottom corner.\n    { x: 10, y: 10, src: '/i/watermark.png', rel: FileAPI.Image.RIGHT_BOTTOM }\n  ])\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;","ru":"FileAPI.Image(imageFile)\n  .overlay([\n    // Левый угл.\n    { x: 10, y: 10, w: 100, h: 10, src: '/i/watermark.png' },\n\n    // Правый нижний угл.\n    { x: 10, y: 10, src: '/i/watermark.png', rel: FileAPI.Image.RIGHT_BOTTOM }\n  ])\n  .get(function (err/**String*/, img/**HTMLElement*/){\n\n  })\n;"}}},"get":{"name":"get","label":"FileAPI.Image.get","args":{"fn":{"en":"complete callback","ru":"функция обратного вызова"}},"variants":[{"args":[{"name":"fn","type":"Function","optional":false}],"descr":{"en":"Get the final image.","ru":"Получить итоговое изображение."}}],"returns":"FileAPI.Image"}}},"FileAPI.Camera":{"label":"FileAPI.Camera","class":"FileAPI.Camera","descr":{"en":"To work with a webcam, be sure to set `FileAPI.media: true`.","ru":"Для работы с веб-камерой, обязательно установить параметр `FileAPI.media: true`."},"props":{},"fn":{"publish":{"name":"publish","label":"FileAPI.Camera.publish","args":{"el":{"en":"target","ru":"куда публикуем"},"options":{"en":"{ `width: 100%`, `height: 100%`, `start: true` }","ru":"{ `width: 100%`, `height: 100%`, `start: true` }"},"callback":{"en":"the first parameter is a possible error, the second instance of FileAPI.Camera","ru":"первый параметр возможная ошибка, второй экземпляр FileAPI.Camera"}},"variants":[{"args":[{"name":"el","type":"HTMLElement","optional":false},{"name":"options","type":"Object","optional":false},{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Publication of the camera.","ru":"Публикация камеры."}}],"returns":"void","code":{"type":"js","source":{"en":"var el = document.getElementById('cam');\nFileAPI.Camera.publish(el, { width: 320, height: 240 }, function (err, cam/**FileAPI.Camera*/){\n  if( !err ){\n    // The webcam is ready, you can use it.\n  }\n});","ru":"var el = document.getElementById('cam');\nFileAPI.Camera.publish(el, { width: 320, height: 240 }, function (err, cam/**FileAPI.Camera*/){\n  if( !err ){\n    // Камера готова, можно использовать\n  }\n});"}}},"start":{"name":"start","label":"FileAPI.Camera.start","args":{"callback":{"en":"will be called when the camera ready","ru":"будет вызван в момент готовности камеры"}},"variants":[{"args":[{"name":"callback","type":"Function","optional":false}],"descr":{"en":"Turn on the camera.","ru":"Включить камеру"}}],"returns":"void","code":{"type":"js","source":{"en":"var el = document.getElementById('cam');\nFileAPI.Camera.publish(el, { start: false }, function (err, cam/**FileAPI.Camera*/){\n  if( !err ){\n    // Turn on\n    cam.start(function (err){\n      if( !err ){\n        // The camera is ready for use.\n      }\n    });\n  }\n});","ru":"var el = document.getElementById('cam');\nFileAPI.Camera.publish(el, { start: false }, function (err, cam/**FileAPI.Camera*/){\n  if( !err ){\n    // Включаем камеру\n    cam.start(function (err){\n      if( !err ){\n        // камера готова к использованию\n      }\n    });\n  }\n});"}}},"stop":{"name":"stop","label":"FileAPI.Camera.stop","args":{},"variants":[{"args":0,"descr":{"en":"Turn off the camera.","ru":"Выключить камеру"}}],"returns":"void"},"shot":{"name":"shot","label":"FileAPI.Camera.shot","args":{},"variants":[{"args":0,"descr":{"en":"Take a picture with the camera.","ru":"Сделать снимок с камеры"}}],"returns":"FileAPI.Image","code":{"type":"js","source":{"en":"var el = document.getElementById('cam');\nFileAPI.Camera.publish(el, function (err, cam/**FileAPI.Camera*/){\n  if( !err ){\n    var shot = cam.shot(); // take a picture\n\n    // create thumbnail 100x100\n    shot.preview(100).get(function (err, img){\n      previews.appendChild(img);\n    });\n\n    // and/or\n    FileAPI.upload({\n      url: '...',\n      files: { cam: shot\n    });\n  }\n});","ru":"var el = document.getElementById('cam');\nFileAPI.Camera.publish(el, function (err, cam/**FileAPI.Camera*/){\n  if( !err ){\n    var shot = cam.shot(); // делаем снимок\n\n    // создаем предпросмотр 100x100\n    shot.preview(100).get(function (err, img){\n      previews.appendChild(img);\n    });\n\n    // и/или загружаем\n    FileAPI.upload({\n      url: '...',\n      files: { cam: shot\n    });\n  }\n});"}}}}},"Сonst":{"label":"const","class":"Сonst","descr":{"en":"","ru":""},"props":{"FileAPI.KB":{"name":"FileAPI.KB","type":"Number","label":"FileAPI.KB","descr":{"en":"1024 bytes","ru":"1024 байт"}},"FileAPI.MB":{"name":"FileAPI.MB","type":"Number","label":"FileAPI.MB","descr":{"en":"1048576 bytes","ru":"1048576 байт"}},"FileAPI.GB":{"name":"FileAPI.GB","type":"Number","label":"FileAPI.GB","descr":{"en":"1073741824 bytes","ru":"1073741824 байт"}},"FileAPI.TB":{"name":"FileAPI.TB","type":"Number","label":"FileAPI.TB","descr":{"en":"1.0995116e+12 bytes","ru":"1.0995116e+12 байт"}}},"fn":{}},"Utils":{"label":"FileAPI.utils","class":"Utils","descr":{"en":"","ru":""},"props":{},"fn":{"FileAPI.each":{"name":"FileAPI.each","label":"FileAPI.each","args":{"obj":{"en":"array or object","ru":"массив или объект"},"callback":{"en":"a function to execute for each element.","ru":"функция, выполняется для каждого элемента."},"thisObject":{"en":"object to use as `this` when executing `callback`.","ru":"объект для использования в качестве `this` при выполнении `callback`."}},"variants":[{"args":[{"name":"obj","type":"Object|Array","optional":false},{"name":"callback","type":"Function","optional":false},{"name":"thisObject","type":"Mixed","optional":true}],"descr":{"en":"Iterate over a object or array, executing a function for each matched element.","ru":"Перебор объект или массив, выполняя функцию для каждого элемента."}}],"returns":"void"},"FileAPI.extend":{"name":"FileAPI.extend","label":"FileAPI.extend","args":{"dst":{"en":"an object that will receive the new properties","ru":"объект, который получит новые свойства"},"src":{"en":"an object containing additional properties to merge in.","ru":"объект, содержащий дополнительные свойства для объединения"}},"variants":[{"args":[{"name":"dst","type":"Object","optional":false},{"name":"src","type":"Object","optional":false}],"descr":{"en":"Merge the contents of two objects together into the first object.","ru":"Объединить содержимое двух объектов вместе."}}],"returns":"Object"},"FileAPI.filter":{"name":"FileAPI.filter","label":"FileAPI.filter","args":{"array":{"en":"original Array","ru":"оригинальный массив"},"callback":{"en":"Function to test each element of the array.","ru":"функция для проверки каждого элемента массива."},"thisObject":{"en":"object to use as `this` when executing `callback`.","ru":"объект для использования в качестве `this` при выполнении `callback`."}},"variants":[{"args":[{"name":"array","type":"Array","optional":false},{"name":"callback","type":"Function","optional":false},{"name":"thisObject","type":"Mixed","optional":false}],"descr":{"en":"Creates a new array with all elements that pass the test implemented by the provided function.","ru":"Создает новый массив со всеми элементами, которые соответствуют условиям."}}],"returns":"Object"}}},"Support":{"label":"support","class":"Support","descr":{"en":"<ul>\n\t<li>Multiupload: all browsers that support HTML5 or Flash</li>\n\t<li>Drag'n'Drop upload: files (HTML5) & directories (Chrome 21+)</li>\n\t<li>Chunked file upload (HTML5)</li>\n\t<li>Upload one file: all browsers</li>\n\t<li>\n\t\tWorking with Images: IE6+, FF 3.6+, Chrome 10+, Opera 11.1+, Safari 5.4+\n\t\t<ul>\n\t\t\t<li>crop, resize, preview & rotate (HTML5 or Flash)</li>\n\t\t\t<li>auto orientation by exif (HTML5, if include FileAPI.exif.js or Flash)</li>\n\t\t</ul>\n\t</li>\n</ul>","ru":"<ul>\n\t<li>Multiupload: все браузеры поддерживающие HTML5 или Flash</li>\n\t<li>Drag'n'Drop загрузка: файлы (HTML5) и директории (Chrome 21+)</li>\n\t<li>Загрузка файлов по частям, только HTML5</li>\n\t<li>Загрузка одно файла: все браузеры, даже очень старые</li>\n\t<li>\n\t\tРабота с изображениями: IE6+, FF 3.6+, Chrome 10+, Opera 11.1+, Safari 5.4+\n\t\t<ul>\n\t\t\t<li>crop, resize, preview & rotate (HTML5 или Flash)</li>\n\t\t\t<li>авто ориентация на основе EXIF (HTML5, если подключен FileAPI.exif.js или Flash)</li>\n\t\t</ul>\n\t</li>\n</ul>"},"props":{"FileAPI.support.html5":{"name":"FileAPI.support.html5","type":"Boolean","label":"FileAPI.support.html5","descr":{"en":"HTML5 borwser support","ru":"Поддержка HTML5."}},"FileAPI.support.cors":{"name":"FileAPI.support.cors","type":"Boolean","label":"FileAPI.support.cors","descr":{"en":"This cross-origin resource sharing is used to enable cross-site HTTP requests.","ru":"Поддержка кроссдоменных запросов."}},"FileAPI.support.dnd":{"name":"FileAPI.support.dnd","type":"Boolean","label":"FileAPI.support.dnd","descr":{"en":"Drag'n'drop events support.","ru":"Поддержка Drag'n'drop событий."}},"FileAPI.support.flash":{"name":"FileAPI.support.flash","type":"Boolean","label":"FileAPI.support.flash","descr":{"en":"Availability Flash plugin.","ru":"Наличие Flash плагина."}},"FileAPI.support.canvas":{"name":"FileAPI.support.canvas","type":"Boolean","label":"FileAPI.support.canvas","descr":{"en":"Canvas support.","ru":"Поддержка canvas."}},"FileAPI.support.dataURI":{"name":"FileAPI.support.dataURI","type":"Boolean","label":"FileAPI.support.dataURI","descr":{"en":"Support dataURI as src for image.","ru":"Поддержка dataURI в качестве src для изображений."}},"FileAPI.support.chunked":{"name":"FileAPI.support.chunked","type":"Boolean","label":"FileAPI.support.chunked","descr":{"en":"Support chuncked upload.","ru":"Возможность загрузки по частям."}}},"fn":{}},"Flash":{"label":"flash","class":"Flash","descr":{"en":"Flash is very \"buggy\" thing :]\nThe server response can not be empty.\nTherefore, in the event of a successful uploading `http status` should be only `200 OK`.","ru":"Флеш очень \"глючная\" штука :]\nПоэтому в случае успешной загрузки http status должен быть только `200 OK`."},"props":{"Settings":{"name":"Settings","type":-1,"label":"flash.settings","descr":{"en":"Flash settings.\nIt is advisable to place flash on the same server where the files will be uploaded.","ru":"Настройки для flash части.\nЖелательно, разместить flash на том же сервере, куда будут загружаться файлы."},"code":{"type":"html","source":{"en":"<script>\n  var FileAPI = {\n     // @default: \"./dist/\"\n    staticPath: '/js/',\n\n     // @default: FileAPI.staticPath + \"FileAPI.flash.swf\"\n    flashUrl: '/statics/FileAPI.flash.swf',\n\n    // @default: FileAPI.staticPath + \"FileAPI.flash.image.swf\"\n    flashImageUrl: '/statics/FileAPI.flash.image.swf'\n  };\n</script>\n<script src=\"/js/FileAPI.min.js\"></script>","ru":"<script>\n  var FileAPI = {\n     // @default: \"./dist/\"\n    staticPath: '/js/',\n\n     // @default: FileAPI.staticPath + \"FileAPI.flash.swf\"\n    flashUrl: '/statics/FileAPI.flash.swf',\n\n    // @default: FileAPI.staticPath + \"FileAPI.flash.image.swf\"\n    flashImageUrl: '/statics/FileAPI.flash.image.swf'\n  };\n</script>\n<script src=\"/js/FileAPI.min.js\"></script>"}}},"crossdomain.xml":{"name":"crossdomain.xml","type":-1,"label":"crossdomain.xml","descr":{"en":"Necessarily make this file on the server.\nDo not forget to replace `youdomain.com` on the name of your domain.","ru":"Обязательно создайте этот файл на сервере, куда будут загружаться файлы.\nНе забудьте заменить `youdomain.com` на имя вашего домена."},"code":{"type":"xml","source":{"en":"<?xml version=\"1.0\"?>\n<!DOCTYPE cross-domain-policy SYSTEM \"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\">\n<cross-domain-policy>\n  <site-control permitted-cross-domain-policies=\"all\"/>\n  <allow-access-from domain=\"youdomain.com\" secure=\"false\"/>\n  <allow-access-from domain=\"*.youdomain.com\" secure=\"false\"/>\n  <allow-http-request-headers-from domain=\"*\" headers=\"*\" secure=\"false\"/>\n</cross-domain-policy>","ru":"<?xml version=\"1.0\"?>\n<!DOCTYPE cross-domain-policy SYSTEM \"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\">\n<cross-domain-policy>\n  <site-control permitted-cross-domain-policies=\"all\"/>\n  <allow-access-from domain=\"youdomain.com\" secure=\"false\"/>\n  <allow-access-from domain=\"*.youdomain.com\" secure=\"false\"/>\n  <allow-http-request-headers-from domain=\"*\" headers=\"*\" secure=\"false\"/>\n</cross-domain-policy>"}}},"request":{"name":"request","type":-1,"label":"flash.request","descr":{"en":"The following sample HTTP POST request is sent from Flash Player to a server-side script if no parameters are specified:","ru":"Пример запроса, который отправляет flash player."},"code":{"type":"xml","source":{"en":"POST /server/ctrl.php HTTP/1.1\nAccept: text/*\nContent-Type: multipart/form-data;\nboundary=----------Ij5ae0ae0KM7GI3KM7\nUser-Agent: Shockwave Flash\nHost: www.youdomain.com\nContent-Length: 421\nConnection: Keep-Alive\nCache-Control: no-cache\n\n------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7\nContent-Disposition: form-data; name=\"Filename\"\n\nMyFile.jpg\n------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7\nContent-Disposition: form-data; name=\"Filedata\"; filename=\"MyFile.jpg\"\nContent-Type: application/octet-stream\n\n[[..FILE_DATA_HERE..]]\n------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7\nContent-Disposition: form-data; name=\"Upload\"\n\nSubmit Query\n------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7--","ru":"POST /server/ctrl.php HTTP/1.1\nAccept: text/*\nContent-Type: multipart/form-data;\nboundary=----------Ij5ae0ae0KM7GI3KM7\nUser-Agent: Shockwave Flash\nHost: www.youdomain.com\nContent-Length: 421\nConnection: Keep-Alive\nCache-Control: no-cache\n\n------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7\nContent-Disposition: form-data; name=\"Filename\"\n\nMyFile.jpg\n------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7\nContent-Disposition: form-data; name=\"Filedata\"; filename=\"MyFile.jpg\"\nContent-Type: application/octet-stream\n\n[[..FILE_DATA_HERE..]]\n------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7\nContent-Disposition: form-data; name=\"Upload\"\n\nSubmit Query\n------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7--"}}}},"fn":{}},"Server settings":{"label":"server","class":"Server settings","descr":{"en":"","ru":""},"props":{"IFrame/JSONP":{"name":"IFrame/JSONP","type":-1,"label":"server.iframe","descr":{"en":"","ru":""},"code":{"type":"php","source":{"en":"<script>\n(function (ctx, jsonp){\n  'use strict';\n  if( ctx && ctx[jsonp] ){\n    ctx[jsonp](200/*http.status*/, 'OK' /*http.statusText*/, \"response body\");\n  }\n})(window, '{{$request_param_callback}}');\n</script>\n\n<!-- or -->\n\n<?php\n  include './FileAPI.class.php';\n\n  if( strtoupper($_SERVER['REQUEST_METHOD']) == 'POST' ){\n    // Retrieve File List\n    $files  = FileAPI::getFiles();\n\n    // ... your logic\n\n    // JSONP callback name\n    $jsonp  = isset($_REQUEST['callback']) ? trim($_REQUEST['callback']) : null;\n\n    // Server response: \"HTTP/1.1 200 OK\"\n    FileAPI::makeResponse(array(\n        'status' => FileAPI::OK\n      , 'statusText' => 'OK'\n      , 'body' => array('count' => sizeof($files)\n    ), $jsonp);\n    exit;\n  }\n?>","ru":"<script>\n(function (ctx, jsonp){\n  'use strict';\n  if( ctx && ctx[jsonp] ){\n    ctx[jsonp](200/*http.status*/, 'OK' /*http.statusText*/, \"response body\");\n  }\n})(window, '{{$request_param_callback}}');\n</script>\n\n<!-- or -->\n\n<?php\n  include './FileAPI.class.php';\n\n  if( strtoupper($_SERVER['REQUEST_METHOD']) == 'POST' ){\n    // Получим список файлов\n    $files  = FileAPI::getFiles();\n\n    // ... ваша логика\n\n    // JSONP callback name\n    $jsonp  = isset($_REQUEST['callback']) ? trim($_REQUEST['callback']) : null;\n\n    // Ответ сервера: \"HTTP/1.1 200 OK\"\n    FileAPI::makeResponse(array(\n        'status' => FileAPI::OK\n      , 'statusText' => 'OK'\n      , 'body' => array('count' => sizeof($files)\n    ), $jsonp);\n    exit;\n  }\n?>"}}},"CORS":{"name":"CORS","type":-1,"label":"server.CORS","descr":{"en":"Enable CORS.","ru":"Включение CORS."},"code":{"type":"php","source":{"en":"<?php\n  // Permitted types of request\n    header('Access-Control-Allow-Methods: POST, OPTIONS');\n\n    // Describe custom headers\n    header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Range, Content-Disposition, Content-Type');\n\n    // A comma-separated list of domains\n    header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);\n\n  // Allow cookie\n  header('Access-Control-Allow-Credentials: true');\n\n    if( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' ){\n        exit;\n    }\n\n    if( $_SERVER['REQUEST_METHOD'] == 'POST' ){\n        // ...\n    }\n?>","ru":"<?php\n  // Permitted types of request\n    header('Access-Control-Allow-Methods: POST, OPTIONS');\n\n    // Describe custom headers\n    header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Range, Content-Disposition, Content-Type');\n\n    // A comma-separated list of domains\n    header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);\n\n    if( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' ){\n        exit;\n    }\n\n    if( $_SERVER['REQUEST_METHOD'] == 'POST' ){\n        // ...\n    }"}}},"Chunked file upload":{"name":"Chunked file upload","type":-1,"label":"server.chunked","descr":{"en":"Client and server communicate to each other using the following HTTP headers and status codes.<br/>\nClient explicitly sets the following headers:<br/>\n<ul>\n\t<li>Content-Range: bytes &lt;start-offset&gt;-&lt;end-offset&gt;/&lt;total&gt;</li>\n\t<li>Content-Disposition: attachment; filename=&lt;file-name&gt;</li>\n</ul>\nAny other headers are set by a target browser and are not used by client. Library does not provide any facilities to track a file uniqueness across requests, it's left on developer's consideration.<br/>\nResponse codes:\n<ul>\n\t<li>200 - last chunk is uploaded</li>\n\t<li>201 - chunk is successfully saved</li>\n\t<li>416 - range is not acceptable error, recoverable</li>\n\t<li>500 - server error, recoverable</li>\n</ul>\nFor recoverable errors server tries to resend chunk `chunkUploadRetry` times then fails.<br/\nResponse headers:\n<ul>\n\t<li>X-Last-Known-Byte: int, library tries to resend chunk from the given offset. Applicable to response codes 200 and 416</li>\n</ul>\nAll the other codes - fatal error, user's involvement is recommend.","ru":"Всё общение между клиентом и сервером ведётся на уровне HTTP заголовков.<br/>\nДля передачи отдельного chunk'а клиент устанавливает заголовки:<br/>\n<ul>\n\t<li>Content-Range: bytes &lt;start-offset>-&lt;end-offset>/&lt;total></li>\n\t<li>Content-Disposition: attachment; filename=&lt;file-name></li>\n</ul>\nДругие заголовки не используются, отслеживание уникальности имени передаваемого файла не реализуется и оставлено на усмотрение разработчика.<br/>\nВ ответ на передаваемый chunk сервер может отвечать следующими кодами:<br/>\n<ul>\n\t<li>200, 201 — chunk сохранён успешно</li>\n\t<li>416, 500 — восстановимая ошибка</li>\n</ul>\nОстальные коды — фатальная ошибка, требуется вмешательство пользователя."}}},"fn":{}},"Buttons examples":{"label":"buttons.examples","class":"Buttons examples","descr":{"en":"","ru":""},"props":{"Base":{"name":"Base","type":-1,"label":"buttons.examples.base","descr":{"en":"Simple input[type=\"file\"]","ru":"Простой input[type=\"file\"]"},"code":{"type":"html","source":{"en":"<span class=\"js-fileapi-wrapper\" style=\"position: relative; display: inline-block;\">\n    <input name=\"files\" type=\"file\" multiple/>\n</span>","ru":"<span class=\"js-fileapi-wrapper\" style=\"position: relative; display: inline-block;\">\n    <input name=\"files\" type=\"file\" multiple/>\n</span>"}}},"Button":{"name":"Button","type":-1,"label":"buttons.examples.button","descr":{"en":"Stylized button.","ru":"Стилизованная кнопка."},"code":{"type":"html","source":{"en":"<style>\n.upload-btn {\n    width: 130px;\n    height: 25px;\n    overflow: hidden;\n    position: relative;\n    border: 3px solid #06c;\n    border-radius: 5px;\n    background: #0cf;\n\n}\n    .upload-btn:hover {\n        background: #09f;\n    }\n    .upload-btn__txt {\n        z-index: 1;\n        position: relative;\n        color: #fff;\n        font-size: 18px;\n        font-family: \"Helvetica Neue\";\n        line-height: 24px;\n        text-align: center;\n        text-shadow: 0 1px 1px #000;\n    }\n    .upload-btn input {\n        top: -10px;\n        right: -40px;\n        z-index: 2;\n        position: absolute;\n        cursor: pointer;\n        opacity: 0;\n        filter: alpha(opacity=0);\n        font-size: 50px;\n    }\n</style>\n<div class=\"js-fileapi-wrapper upload-btn\">\n    <div class=\"upload-btn__txt\">Upload files</div>\n    <input name=\"files\" type=\"file\" multiple />\n</div>","ru":"<style>\n.upload-btn {\n    width: 130px;\n    height: 25px;\n    overflow: hidden;\n    position: relative;\n    border: 3px solid #06c;\n    border-radius: 5px;\n    background: #0cf;\n\n}\n    .upload-btn:hover {\n        background: #09f;\n    }\n    .upload-btn__txt {\n        z-index: 1;\n        position: relative;\n        color: #fff;\n        font-size: 18px;\n        font-family: \"Helvetica Neue\";\n        line-height: 24px;\n        text-align: center;\n        text-shadow: 0 1px 1px #000;\n    }\n    .upload-btn input {\n        top: -10px;\n        right: -40px;\n        z-index: 2;\n        position: absolute;\n        cursor: pointer;\n        opacity: 0;\n        filter: alpha(opacity=0);\n        font-size: 50px;\n    }\n</style>\n<div class=\"upload-btn js-fileapi-wrapper\">\n    <div class=\"upload-btn__txt\">Upload files</div>\n    <input name=\"files\" type=\"file\" multiple />\n</div>"}}},"Link":{"name":"Link","type":-1,"label":"buttons.examples.link","descr":{"en":"Button like link.","ru":"Кнопка в виде ссылки"},"code":{"type":"html","source":{"en":"<style>\n.upload-link {\n    color: #36c;\n    display: inline-block;\n    *zoom: 1;\n    *display: inline;\n    overflow: hidden;\n    position: relative;\n    padding-bottom: 2px;\n    text-decoration: none;\n}\n    .upload-link__txt {\n        z-index: 1;\n        position: relative;\n        border-bottom: 1px dotted #36c;\n    }\n        .upload-link:hover .upload-link__txt {\n            color: #f00;\n            border-bottom-color: #f00;\n        }\n\n    .upload-link input {\n        top: -10px;\n        right: -40px;\n        z-index: 2;\n        position: absolute;\n        cursor: pointer;\n        opacity: 0;\n        filter: alpha(opacity=0);\n        font-size: 50px;\n    }\n</style>\n<a class=\"js-fileapi-wrapper upload-link\">\n    <span class=\"upload-link__txt\">Upload photo</span>\n    <input name=\"photo\" type=\"file\" accept=\"image/*\" />\n</a>","ru":"<style>\n.upload-link {\n    color: #36c;\n    display: inline-block;\n    *zoom: 1;\n    *display: inline;\n    overflow: hidden;\n    position: relative;\n    padding-bottom: 2px;\n    text-decoration: none;\n}\n    .upload-link__txt {\n        z-index: 1;\n        position: relative;\n        border-bottom: 1px dotted #36c;\n    }\n        .upload-link:hover .upload-link__txt {\n            color: #f00;\n            border-bottom-color: #f00;\n        }\n\n    .upload-link input {\n        top: -10px;\n        right: -40px;\n        z-index: 2;\n        position: absolute;\n        cursor: pointer;\n        opacity: 0;\n        filter: alpha(opacity=0);\n        font-size: 50px;\n    }\n</style>\n<a class=\"upload-link js-fileapi-wrapper\">\n    <span class=\"upload-link__txt\">Upload photo</span>\n    <input name=\"photo\" type=\"file\" accept=\"image/*\" />\n</a>"}}}},"fn":{}},"Installation":{"label":"install","class":"Installation","descr":{"en":"`npm install fileapi`<br/>\n`cd fileapi`<br/>\n`npm install`<br/>\n`grunt`"},"props":{},"fn":{}},"Changelog":{"label":"Changelog","class":"Changelog","descr":{"en":""},"props":{"2.0.0":{"name":"2.0.0","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>+ FileAPI.Camera (HTML5 and Flash fallback)</li>\n\t<li>+ jquery.fileapi.js, see <a href=\"http://rubaxa.github.io/jquery.fileapi/\">demo</a></li>\n\t<li>+ npm support</li>\n\t<li>+ grunt support</li>\n\t<li>+ requirejs support</li>\n\t<li>+ [#80](https://https://github.com/mailru/FileAPI/issues/80): FileAPI.Image.fn.overlay</li>\n \t<li>`imageTransform` — now supports: `crop`, `type`, `quality` and `overlay` properties.</li>\n\t<li>Improved the documentation</li>\n\t<li>+iOS fix (https://github.com/blueimp/JavaScript-Load-Image)</li>\n\t<li>[#121](https://github.com/mailru/FileAPI/issues/121): + FileAPI.`postNameConcat:Function(name, idx)`</li>\n\t<li>[#116](https://github.com/mailru/FileAPI/issues/116): + `cache:false` option for FileAPI.upload</li>\n</ul>"}},"1.2.6":{"name":"1.2.6","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>[#91](https://github.com/mailru/FileAPI/issues/91): replace `new Image` to `FileAPI.newImage`</li>\n\t<li>+ FileAPI.withCredentials: true</li>\n\t<li>[#90](https://github.com/mailru/FileAPI/issues/90): Fixed `progress` event</li>\n\t<li>[#105](https://github.com/mailru/FileAPI/issues/105): Fixed `image/jpg` -> `image/jpeg`</li>\n\t<li>[#108](https://github.com/mailru/FileAPI/issues/108): Check width/height before resize by type(min/max)</li>\n</ul>"}},"1.2.5":{"name":"1.2.5","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>[#86](https://github.com/mailru/FileAPI/issues/86): Smarter upload recovery</li>\n\t<li>[#87](https://github.com/mailru/FileAPI/issues/87): Fixed upload files into browsers that do not support FormData</li>\n\t<li>Fixed support \"accept\" attribute for Flash.</li>\n\t<li>Fixed detection of HTML5 support for FireFox 3.6</li>\n\t<li> + FileAPI.html5 option, default \"true\"</li>\n</ul>"}},"1.2.4":{"name":"1.2.4","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>Fixed auto orientation image by EXIF (Flash)</li>\n\t<li>Fixed image dimensions after rotate (Flash)</li>\n\t<li>[#82](https://github.com/mailru/FileAPI/issues/82): \"undefined\" data-fields cause exceptions</li>\n\t<li>[#83](https://github.com/mailru/FileAPI/issues/83): Allow requests without files</li>\n\t<li>[#84](https://github.com/mailru/FileAPI/pull/84): Fixed connection abort when waiting for connection recovery</li>\n</ul>"}},"1.2.3":{"name":"1.2.3","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>[#77](https://github.com/mailru/FileAPI/pull/77): Fixed flash.abort(), [#75](https://github.com/mailru/FileAPI/issues/75)</li>\n\t<li>- `FileAPI.addMime`</li>\n\t<li>+ `FileAPI.accept` — fallback for flash.</li>\n</ul>"}},"1.2.2":{"name":"1.2.2","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>[#67](https://github.com/mailru/FileAPI/pull/67): Added correct httpStatus for upload fail, [#62](https://github.com/mailru/FileAPI/pull/68)</li>\n\t<li>[#68](https://github.com/mailru/FileAPI/pull/68) Added \"Content-Type\" for chunked upload, [#65](https://github.com/mailru/FileAPI/pull/65)</li>\n\t<li>[#69](https://github.com/mailru/FileAPI/issues/69): Fixed network down recovery</li>\n\t<li>Fixed progress event, [#66](https://github.com/mailru/FileAPI/issues/66)</li>\n\t<li>Increase flash stage size, [#73](https://github.com/mailru/FileAPI/pull/73)</li>\n\t<li>- array index from POST-param \"name\", [#72](https://github.com/mailru/FileAPI/issues/72)</li>\n\t<li>- dependency on FileAPI.Image for FileAPI.Flash</li>\n</ul>"}},"1.2.1":{"name":"1.2.1","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>[#64](https://github.com/mailru/FileAPI/issues/64): Bufixed for [#63](https://github.com/mailru/FileAPI/issues/63)</li>\n</ul>"}},"1.2.0":{"name":"1.2.0","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>[#57](https://github.com/mailru/FileAPI/issues/57): Chunked file upload</li>\n</ul>"}},"1.1.0":{"name":"1.1.0","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>[#54](https://github.com/mailru/FileAPI/issues/54): added `FileAPI.flashUrl` and `FileAPI.flashImageUrl`</li>\n</ul>"}},"1.0.1":{"name":"1.0.1","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>[#51](https://github.com/mailru/FileAPI/issues/51): remove circular references from `file-objects` (Flash transport)</li>\n\t<li>added `changelog`</li>\n</ul>"}},"1.0.0":{"name":"1.0.0","type":-1,"label":"Changelog","descr":{"en":"<ul>\n\t<li>first release</li>\n</ul>"}}},"fn":{}}}
